LL18_25070202得辉达增加条码前缀检测
This commit is contained in:
@@ -77,6 +77,8 @@ namespace C_Windows_1
|
||||
public string tester = ""; //测试员
|
||||
public string machineNumber = ""; //测试设备编号
|
||||
public string stationName = ""; //上工站名称
|
||||
|
||||
private string preSn = ""; //条码前缀
|
||||
public Form1()
|
||||
{
|
||||
f1 = this;
|
||||
@@ -2376,6 +2378,7 @@ namespace C_Windows_1
|
||||
private void 基本设置ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Config c1 = new Config();
|
||||
c1.textPreSn.Text = textPreSn.Text;
|
||||
OpenForm(c1);
|
||||
}
|
||||
|
||||
@@ -2603,6 +2606,10 @@ namespace C_Windows_1
|
||||
{
|
||||
checkCodeRepeat.Checked = Convert.ToBoolean(regName.GetValue("codeRepeatCheck"));
|
||||
}
|
||||
if (regName.GetValue("codePreSn") != null)
|
||||
{
|
||||
textPreSn.Text = regName.GetValue("codePreSn").ToString();
|
||||
}
|
||||
|
||||
if (regName.GetValue("codeTestCheck") is null)
|
||||
{
|
||||
@@ -2612,7 +2619,16 @@ namespace C_Windows_1
|
||||
{
|
||||
checkBox2.Checked = Convert.ToBoolean(regName.GetValue("codeTestCheck"));
|
||||
}
|
||||
|
||||
|
||||
if (regName.GetValue("codePreSnCheck") is null)
|
||||
{
|
||||
checkPreSn.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkPreSn.Checked = Convert.ToBoolean(regName.GetValue("codePreSnCheck"));
|
||||
}
|
||||
|
||||
|
||||
if (regName.GetValue("Baudrate") is null)
|
||||
{
|
||||
@@ -2986,7 +3002,7 @@ namespace C_Windows_1
|
||||
|
||||
private void label32_Click(object sender, EventArgs e)
|
||||
{
|
||||
AddDatebase();
|
||||
//AddDatebase();
|
||||
}
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
@@ -3080,6 +3096,16 @@ namespace C_Windows_1
|
||||
BarcodeInfo.InsertBarcodeData(time, Code.Text, "", "", "", "", "", "");
|
||||
}
|
||||
}
|
||||
//条码前缀检测
|
||||
if (checkPreSn.Checked)
|
||||
{
|
||||
if (!Code.Text.StartsWith(textPreSn.Text))
|
||||
{
|
||||
MessageBox.Show(string.Format("条形码前缀错误!当前条码:{0},设置前缀为:{1}", this.Code.Text, this.textPreSn.Text));
|
||||
this.Code.ResetText();
|
||||
this.Code.Focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> InMes(int CH)
|
||||
@@ -3288,6 +3314,16 @@ namespace C_Windows_1
|
||||
}
|
||||
}
|
||||
|
||||
private void checkPreCheck_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
RegistryKey regName;
|
||||
|
||||
regName = openRegedit();
|
||||
|
||||
regName.SetValue("codePreSnCheck", checkPreSn.Checked);
|
||||
regName.Close();
|
||||
}
|
||||
|
||||
//过站检测
|
||||
private bool MesCheck(string sCode)
|
||||
{
|
||||
@@ -3308,12 +3344,12 @@ namespace C_Windows_1
|
||||
}
|
||||
else if (nRet == 0)
|
||||
{
|
||||
textBox3.Text = "上工序漏做"; //未过站
|
||||
MessageBox.Show("上工序漏做");
|
||||
textBox3.Text = "上工站漏做"; //未过站
|
||||
MessageBox.Show("上工站漏做");
|
||||
}
|
||||
else
|
||||
{
|
||||
textBox3.Text = "已过站:" + nRet.ToString();
|
||||
textBox3.Text = "非法值:" + nRet.ToString();
|
||||
MessageBox.Show(textBox3.Text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user