Commit 1a150e20 刘韬

修正若干bug, 打印按钮不答应, 脚踏开关弹出文件选择对话框, 匹配数量bug

1 个父辈 34f6a115
......@@ -221,11 +221,11 @@ namespace BLL
{
if (key.ContainsKey("DateTime"))
{
key["DateTime"] = DateTime.Now.ToString("dd-MM-yyyy");
key["DateTime"] = DateTime.Now.ToString(ConfigHelper.Config.Get("Ex_UserDataRule", "dd-MM-yyyy"));
}
else
{
key.Add("DateTime", DateTime.Now.ToString("dd-MM-yyyy"));
key.Add("DateTime", DateTime.Now.ToString(ConfigHelper.Config.Get("Ex_UserDataRule", "dd-MM-yyyy")));
}
}
if (extensions != null && !extensions[0].Control.InvokeRequired)
......@@ -341,7 +341,7 @@ namespace BLL
// 如果有字段更新,则再次调用OnKeySet更新WPF界面
LogNet.log.Info($"OnKeySet");
OnKeySet(originalCode, key, hasMatch);
if (lastKeys == null && !islast && BLLCommon.config.CheckFunction)
......@@ -394,7 +394,10 @@ namespace BLL
//else
//{
if (!updatereelid(key, out errmsg))
{
LogNet.log.Info($"updatereelid false");
return false;
}
// }
......@@ -435,6 +438,7 @@ namespace BLL
LogNet.log.Error("GetHttpReelID:" + errmsg);
return false;
}
LogNet.log.Error("GetHttpReelID:true" );
//key["ReelID"] = newid;
}
if (extensions != null && extensions.Count > 0 && !extensions[0].Control.InvokeRequired)
......@@ -655,6 +659,7 @@ namespace BLL
private void GetHttpReelID(object sender, EventArgs e)
{
updatereelid(lastkey, out _);
LogNet.log.Info($"updatereelid GetHttpReelID");
}
private void BtnSkip_Click(object sender, EventArgs e)
{
......@@ -825,7 +830,7 @@ namespace BLL
{
errmsg = "Api error";
if (extensions != null && !extensions[0].Control.InvokeRequired)
MessageboxNeo.Show("BoxReelIDInfoMaintain", errmsg, "NEO SCAN", true);
return MessageboxNeo.Show("BoxReelIDInfoMaintain", errmsg, "NEO SCAN", true);
// new FaceMessageBox("BoxReelIDInfoMaintain", errmsg, System.Windows.Forms.MessageBoxButtons.OK, true).ShowDialog();
return false;
......@@ -840,7 +845,7 @@ namespace BLL
{
errmsg = "Api parse error:\r\n" + json;
if (extensions != null && !extensions[0].Control.InvokeRequired)
MessageboxNeo.Show("BoxReelIDInfoMaintain", errmsg, "NEO SCAN", true);
return MessageboxNeo.Show("BoxReelIDInfoMaintain", errmsg, "NEO SCAN", true);
//new FaceMessageBox("BoxReelIDInfoMaintain", errmsg, System.Windows.Forms.MessageBoxButtons.OK, true).ShowDialog();
return false;
......@@ -849,7 +854,7 @@ namespace BLL
if (!dic.TryGetValue("CODE", out object value))
{
if (extensions != null && !extensions[0].Control.InvokeRequired)
MessageboxNeo.Show("BoxReelIDInfoMaintain", errmsg, "NEO SCAN", true);
return MessageboxNeo.Show("BoxReelIDInfoMaintain", errmsg, "NEO SCAN", true);
//new FaceMessageBox("BoxReelIDInfoMaintain", "Api return data error:\r\n" + json, System.Windows.Forms.MessageBoxButtons.OK, true).ShowDialog();
else
errmsg = "Api return data error:\r\n" + json;
......@@ -860,7 +865,7 @@ namespace BLL
{
errmsg = "Api parse error:\r\n" + dic["MSG"].ToString();
if (extensions != null && !extensions[0].Control.InvokeRequired)
new FaceMessageBox("BoxReelIDInfoMaintain", errmsg, System.Windows.Forms.MessageBoxButtons.OK, true).ShowDialog();
return MessageboxNeo.Show("BoxReelIDInfoMaintain", errmsg, "NEO SCAN", true);
return false;
}
......@@ -977,7 +982,7 @@ namespace BLL
if (extensions != null && extensions.Count > 0 && !extensions[0].Control.InvokeRequired)
{
//自动打印and模板匹配成功,只负责打印标签
if (config.AutoPrint && match)
//if (config.AutoPrint && match)
{
isprint = true;
PrintLabel(true, EventArgs.Empty);
......
......@@ -115,7 +115,9 @@ namespace SmartScan
// 订阅语言更改事件
MF_top.LanguageChanged += MF_top_LanguageChanged;
//拖动
MF_top.DragRequested += MF_top_DragRequested; ;
MF_top.DragRequested += MF_top_DragRequested;
}
private bool isDragging = false;
private System.Drawing.Point dragStartPoint;
......@@ -185,7 +187,7 @@ namespace SmartScan
private void MF_top_LanguageChanged(object sender, string language)
{
// 处理语言变更
if (BLLCommon.config.Language != language)
//if (BLLCommon.config.Language != language)
{
Language.LoadLanguage(language);
BLLCommon.config.Language = language;
......@@ -429,7 +431,6 @@ namespace SmartScan
// 确保它位于Z顺序的顶部
host.BringToFront();
}
......@@ -463,6 +464,7 @@ namespace SmartScan
private void Ns_rigth_Load(object sender, EventArgs e)
{
InitializeWpfControl();
MF_top_LanguageChanged(this, BLLCommon.config.Language);
}
//private General generals;
......@@ -1060,7 +1062,7 @@ namespace SmartScan
private void OnBllKeySet(string[] originalCode, Dictionary<string, string> key, bool hasMatch)
{
LogNet.log.Info($"OnBllKeySet hasMatch:{hasMatch}, key:" + JsonConvert.SerializeObject(key));
// 1. 更新UI显示原始码
wpfControl.UpdateOriginalCodeDisplay(originalCode);
......@@ -1113,6 +1115,7 @@ namespace SmartScan
private void CboLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
return;
if (BLLCommon.config.Language != CboLanguage.Text)
{
Language.LoadLanguage(CboLanguage.Text);
......
......@@ -37,8 +37,7 @@ namespace SmartScan
menu.Add(BtnGenneralSetting, new UsrWpfPanel(new WPFWorkMode()));
// menu.Add(aaa, new UsrWpfPanel(new WPF_MaterialTemplate()));
Language.LoadLanguage(BLLCommon.config.Language);
Language.SetLanguage(this);
......@@ -57,6 +56,9 @@ namespace SmartScan
BtnKeyword.HoldPress = true;
menu[BtnKeyword].GetPanel().Visible = true;
Maximize();
Language.LoadLanguage(BLLCommon.config.Language);
Language.SetLanguage(this);
}
private void BtnMenu_Click(object sender, EventArgs e)
......
......@@ -409,7 +409,8 @@ WPF_Software 软件设置 Software Settings
WPF_API 数据源设置 API Setting
Serial_number 添加流水 Add the serial number
xianshi 已选关键词(按显示顺序排列) Selected keywords (arranged according to display order)
Dialog_NS_KetRight_Green 绿色 - 完全正确 微软雅黑,12,,
Dialog_NS_KetRight_yllow 黄色 - OCR识别结果,需要验证 微软雅黑,12,,
Dialog_NS_KetRight_Red 红色 - 无法识别或有问题 微软雅黑,12,,
Dialog_NS_KetRight_TextBlock 识别结果 微软雅黑,12,,
\ No newline at end of file
Dialog_NS_KetRight_Green 绿色 - 完全正确 Green - Completely correct 微软雅黑,12,,
Dialog_NS_KetRight_yllow 黄色 - OCR识别结果,需要验证 OCR recognition result, needs verification 微软雅黑,12,,
Dialog_NS_KetRight_Red 红色 - 无法识别或有问题 Unrecognizable or problematic 微软雅黑,12,,
Dialog_NS_KetRight_TextBlock 识别结果 Result: 微软雅黑,12,,
NS_KetRight_Detect 已检测字段 Detected Fields 微软雅黑,12,,
\ No newline at end of file
......@@ -190,7 +190,7 @@ UsrCodeExtractList_ChkMatchisnumber 璉瘚僎頧祆銝箸摮 摮璊
UsrCodeExtractList_ChkMatchingSplit 条码分割字符 バーコードの分割キャラクタ 微软雅黑,12,,
UsrCodeExtractList_LblSplitPart 获取分割部分 分割部分の取得 微软雅黑,12,,
UsrCodeExtractList_ChkCaseSensitivity 区分大小写 大文字と小文字を区別 微软雅黑,12,,
UsrCodeExtractList_Characteristicbarcode 特征码 特徴コード微软雅黑,12,,
UsrCodeExtractList_Characteristicbarcode 特征码 特徴コード微软雅黑,12,, 微软雅黑,12,,
UsrCodeExtractList_ChkMinLength 最小长度 最小長さ 微软雅黑,12,,
UsrCodeExtractList_ChkMaxLength 最大长度 最大長さ 微软雅黑,12,,
UsrCodeExtractList_LblKeyword 选择关键字 キーワードを選択 微软雅黑,12,,
......@@ -458,7 +458,29 @@ WPF_Software 頧臭辣霈曄蔭 身蝵
WPF_API API设置 API设置
Serial_number 添加流水 シリアル値
xianshi 已选关键词(按显示顺序排列) 選択されたキーワード(表示順に配列)
Dialog_NS_KetRight_Green 绿色 - 完全正确 微软雅黑,12,,
Dialog_NS_KetRight_yllow 黄色 - OCR识别结果,需要验证 微软雅黑,12,,
Dialog_NS_KetRight_Red 红色 - 无法识别或有问题 微软雅黑,12,,
Dialog_NS_KetRight_TextBlock 识别结果 微软雅黑,12,,
\ No newline at end of file
Dialog_NS_KetRight_Green 绿色 - 完全正确 緑色 - 完全に正確 微软雅黑,12,,
Dialog_NS_KetRight_yllow 黄色 - OCR识别结果,需要验证 黄色 - OCR認識結果、検証が必要 微软雅黑,12,,
Dialog_NS_KetRight_Red 红色 - 无法识别或有问题 赤色 - 認識不能または問題あり 微软雅黑,12,,
Dialog_NS_KetRight_TextBlock 识别结果 認識結果 微软雅黑,12,,
Dialog_NS_KetRight_Detect 已检测字段 検出されたフィールド 微软雅黑,12,,
FrmSet_ChkRecursive 遍历同目录 同じディレクトリを遍歴 微软雅黑,12,,
FrmSet_groupBox_lblkey 标签可用字段 ラベル可用フィールド 微软雅黑,12,,
FrmSet_BtnSelectFile 选择文件 ファイル選択 微软雅黑,12,,
FrmSet_faceLabel2 关键字匹配数据标题 キーワードマッチデータタイトル 微软雅黑,12,,
FrmSet_faceLabel1 识别关键词 キーワード認識 微软雅黑,12,,
FrmSet_LblFilestatus 文件状态: ファイル状態: 微软雅黑,12,,
FrmSet_LblContent 标签数据源 ラベルデータソース 微软雅黑,12,,
FrmSet_BtnAddLabel 新しいラベルを作成 新しいラベルを作成 微软雅黑,12,,
FrmSet_BtnDelLabel ラベル削除 ラベル削除 微软雅黑,12,,
FrmSet_facePanel7 フィールド操作 フィールド操作 微软雅黑,12,,
FrmSet_BtnAddField フィールド追加 フィールド追加 微软雅黑,12,,
FrmSet_BtnDelField フィールド削除 フィールド削除 微软雅黑,12,,
FrmSet_ChkFieldShowKey キーワード表示 キーワード表示 微软雅黑,12,,
FrmSet_BtnSetField フィールド内容設定 フィールド内容設定 微软雅黑,12,,
FrmSet_BtnPrintTest 印刷テスト 印刷テスト 微软雅黑,12,,
FrmSet_LblFieldType バーコード種類 バーコード種類 微软雅黑,12,,
FrmSet_pnLabelFieldPos フィールド位置 フィールド位置 微软雅黑,12,,
FrmSet_LblFieldSize 用紙サイズ 用紙サイズ 微软雅黑,12,,
FrmSet_pnlPrintTmpLstOp ラベルテンプレート操作 ラベルテンプレート操作 微软雅黑,12,,
Dialog_About_About 关于 About 微软雅黑,12,,
Dialog_About_mrs 物料注册系统 材料登録システム 微软雅黑,12,,
\ No newline at end of file
......@@ -461,4 +461,5 @@ xianshi 已选关键词(按显示顺序排列) 已选关键词(按显示
Dialog_NS_KetRight_Green 绿色 - 完全正确 绿色 - 完全正确 微软雅黑,12,,
Dialog_NS_KetRight_yllow 黄色 - OCR识别结果,需要验证 黄色 - OCR识别结果,需要验证 微软雅黑,12,,
Dialog_NS_KetRight_Red 红色 - 无法识别或有问题 红色 - 无法识别或有问题 微软雅黑,12,,
Dialog_NS_KetRight_TextBlock 识别结果 微软雅黑,12,,
\ No newline at end of file
Dialog_NS_KetRight_TextBlock 识别结果 识别结果 微软雅黑,12,,
NS_KetRight_Detect 已检测字段 已检测字段 微软雅黑,12,,
\ No newline at end of file
......@@ -30,7 +30,7 @@ using System.Runtime.InteropServices;
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
[assembly: AssemblyVersion("4.1.*")]
[assembly: AssemblyVersion("4.2.*")]
//[assembly: AssemblyVersion("3.0.0.0")]
//[assembly: AssemblyFileVersion("3.0.0.0")]
......
......@@ -415,7 +415,7 @@ namespace SmartScan
{
LogNet.log.Info("Work GetCodeInfo");
if (BLLCommon.config.EnabledCamera && isstart==true)
if (BLLCommon.config.EnabledCamera)// && isstart==true)
{
LogNet.log.Info("1");
if (BLLCommon.config.TriggerOpenLight)
......@@ -762,7 +762,7 @@ namespace SmartScan
string status = BLLCommon.extension.labelText.ToLower();
needPrint = (status == "等待中" || status == "Waiting" || status == "待機中");
}
if (needPrint)
if (needPrint && BLLCommon.config.AutoPrint)
{
if (workCodeKeyword.Any(a => a.Value.StartsWith("<OCR>")))
{
......@@ -804,6 +804,7 @@ namespace SmartScan
}
else
{
if (hasMatch)
//打印
BLLCommon.extension.Print(hasMatch, pairs);
}
......@@ -838,6 +839,7 @@ namespace SmartScan
}
else
{
if (hasMatch)
BLLCommon.extension.Print(hasMatch, workCodeKeyword);
}
//打印
......
......@@ -56,6 +56,8 @@ namespace SmartScan.SetControl.WPF
string YU = BLLCommon.config.Language;
text1.Text = Asa.FaceControl.Language.Dialog("About_About", "关于");
text2.Text = Asa.FaceControl.Language.Dialog("About_mrs", "物料注册系统");
VersionInfo = BLLCommon.config.SoftVersion;
//if (YU == "English")
//{
// = "About";
......
......@@ -72,8 +72,7 @@
Background="Transparent"
Foreground="White"
BorderBrush="#444444"
FontSize="12"
SelectionChanged="LanguageSelector_SelectionChanged">
FontSize="12">
<!-- 自定义ComboBox样式 -->
<ComboBox.Resources>
......
using BLL;
using SharpDocx.CodeBlocks;
using SmartScan.SetControl.WPF.Model;
using System;
using System.Collections.Generic;
......@@ -35,7 +36,6 @@ namespace SmartScan.SetControl.WPF
InitializeComponent();
// 从配置中获取当前语言
string configLanguage = BLLCommon.config.Language;
// 根据配置设置选择正确的ComboBoxItem
SelectLanguageInUI(configLanguage);
this.Loaded += (s, e) => {
......
......@@ -85,10 +85,11 @@
<Grid Margin="0,5,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="13*"/>
</Grid.ColumnDefinitions>
<Rectangle Width="16" Height="16" Fill="#FFC107" RadiusX="2" RadiusY="2"/>
<TextBlock Grid.Column="1" x:Name="lbl_yellow" Text="黄色 - OCR识别结果,需要验证" FontSize="14" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="10,0,0,0"/>
<Rectangle Width="16" Height="16" Fill="#FFC107" RadiusX="2" RadiusY="2" Margin="4,1,4,1"/>
<TextBlock Grid.Column="1" x:Name="lbl_yellow" Text="黄色 - OCR识别结果,需要验证" FontSize="14" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="10,0,0,0" Grid.ColumnSpan="2"/>
</Grid>
<Grid Margin="0,5,0,5">
......
......@@ -209,6 +209,6 @@
</WrapPanel>
</Grid>
<TextBlock Text="等待运行" Visibility="Collapsed" FontFamily="微软雅黑" Name="ShowLog" FontSize="21" Foreground="Red" VerticalAlignment="Bottom" Margin="0 0 0 50" HorizontalAlignment="Center"/>
<TextBlock Text="4.1.9233.34683" FontFamily="微软雅黑" FontSize="11" Foreground="#999999" VerticalAlignment="Bottom" Margin="0 0 0 10" HorizontalAlignment="Center"/>
<TextBlock x:Name="txt_version" Text="4.1.9233.34683" FontFamily="微软雅黑" FontSize="11" Foreground="#999999" VerticalAlignment="Bottom" Margin="0 0 0 10" HorizontalAlignment="Center"/>
</Grid>
</UserControl>
\ No newline at end of file
......@@ -168,6 +168,7 @@ namespace SmartScan.SetControl.WPF
public VerticalMenuControl()
{
InitializeComponent();
txt_version.Text = BLLCommon.config.SoftVersion;
string YU = BLLCommon.config.Language;
if (YU == "English")
{
......
......@@ -420,9 +420,9 @@
<ComboBox x:Name="ChoMatchMiddleType" Grid.Column="1" Style="{StaticResource DarkComboBoxStyle}"
Margin="10,0,0,0" SelectionChanged="MatchTextChanged">
<ComboBoxItem Name="Dialog_MatchType_max" Content="匹配数量等于" FontFamily="微软雅黑" FontSize="14"/>
<ComboBoxItem Name="Dialog_MatchType_equals" Content="匹配数量于" FontFamily="微软雅黑" FontSize="14"/>
<ComboBoxItem Name="Dialog_MatchType_min" Content="匹配数量小于" FontFamily="微软雅黑" FontSize="14"/>
<ComboBoxItem Name="Dialog_MatchType_max" Content="匹配数量至多" FontFamily="微软雅黑" FontSize="14"/>
<ComboBoxItem Name="Dialog_MatchType_equals" Content="匹配数量于" FontFamily="微软雅黑" FontSize="14"/>
<ComboBoxItem Name="Dialog_MatchType_min" Content="匹配数量至少" FontFamily="微软雅黑" FontSize="14"/>
</ComboBox>
</Grid>
</StackPanel>
......
......@@ -66,7 +66,7 @@ namespace SmartScan.SetControl.WPF
TxtMatchingMiddleText.Text = matchShared.MiddleText;
NudMiddleTextCount.Text = matchShared.MiddleTextCount.ToString();
ChkCaseSensitivity.IsChecked = matchShared.CaseSensitive;
ChoMatchMiddleType.SelectedIndex = matchShared.MatchMiddleType == -1 ? 0 : matchShared.MatchMiddleType;
ChoMatchMiddleType.SelectedIndex = matchShared.MatchMiddleType + 1;
ChkCheckCodeType.IsChecked = matchShared.CheckCodeType;
Characteristicbarcode.IsChecked = matchShared.Characteristic;
......@@ -587,16 +587,16 @@ namespace SmartScan.SetControl.WPF
}
// 根据选择的匹配类型比较
switch (ChoMatchMiddleType.SelectedIndex)
switch (ChoMatchMiddleType.SelectedIndex-1)
{
case -1: // 至多
ismatch = count <= targetCount;
break;
case 0: // 等于
ismatch = count == targetCount;
break;
case 1: // 大于
ismatch = count > targetCount;
break;
case 2: // 小于
ismatch = count < targetCount;
case 1: // 至少
ismatch = count >= targetCount;
break;
default:
ismatch = count == targetCount;
......@@ -891,7 +891,7 @@ namespace SmartScan.SetControl.WPF
match.CaseSensitive = ChkCaseSensitivity.IsChecked == true;
match.CheckCodeType = ChkCheckCodeType.IsChecked == true;
match.CodeType = codeType;
match.MatchMiddleType = ChoMatchMiddleType.SelectedIndex;
match.MatchMiddleType = ChoMatchMiddleType.SelectedIndex-1;
match.CodeID = codeID;
match.Characteristic = Characteristicbarcode.IsChecked == true;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!