diff --git a/C-Windows-1/C-Windows-LL18.csproj b/C-Windows-1/C-Windows-LL18.csproj index 1ea36f9..210765c 100644 --- a/C-Windows-1/C-Windows-LL18.csproj +++ b/C-Windows-1/C-Windows-LL18.csproj @@ -58,6 +58,10 @@ ..\packages\BouncyCastle.Cryptography.2.2.1\lib\net461\BouncyCastle.Cryptography.dll + + False + bin\Debug\DHDMesApi.dll + ..\packages\Enums.NET.4.0.1\lib\net45\Enums.NET.dll diff --git a/C-Windows-1/Form1.Designer.cs b/C-Windows-1/Form1.Designer.cs index 32c0e71..c275ac6 100644 --- a/C-Windows-1/Form1.Designer.cs +++ b/C-Windows-1/Form1.Designer.cs @@ -85,6 +85,7 @@ this.基本设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.测试参数ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.存储设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mESSetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.注销登录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.label35 = new System.Windows.Forms.Label(); @@ -125,16 +126,14 @@ this.strbatch = new System.Windows.Forms.TextBox(); this.strlocation = new System.Windows.Forms.TextBox(); this.strlinename = new System.Windows.Forms.TextBox(); - this.label41 = new System.Windows.Forms.Label(); this.label42 = new System.Windows.Forms.Label(); this.label43 = new System.Windows.Forms.Label(); this.label48 = new System.Windows.Forms.Label(); - this.PreCode1 = new System.Windows.Forms.TextBox(); - this.label49 = new System.Windows.Forms.Label(); this.label50 = new System.Windows.Forms.Label(); this.textBox3 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.timerCH1 = new System.Windows.Forms.Timer(this.components); + this.checkCodeRepeat = new System.Windows.Forms.CheckBox(); this.myGroupBox4 = new C_Windows_1.MyGroupBox(this.components); this.PUnit = new System.Windows.Forms.ComboBox(); this.label47 = new System.Windows.Forms.Label(); @@ -375,7 +374,7 @@ this.label36.Font = new System.Drawing.Font("宋体", 12F); this.label36.Location = new System.Drawing.Point(162, 326); this.label36.Name = "label36"; - this.label36.Size = new System.Drawing.Size(72, 16); + this.label36.Size = new System.Drawing.Size(71, 16); this.label36.TabIndex = 89; this.label36.Text = "测试进度"; // @@ -385,7 +384,7 @@ this.Manual.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold); this.Manual.Location = new System.Drawing.Point(777, 5); this.Manual.Name = "Manual"; - this.Manual.Size = new System.Drawing.Size(17, 16); + this.Manual.Size = new System.Drawing.Size(16, 16); this.Manual.TabIndex = 63; this.Manual.TabStop = true; this.Manual.Text = "?"; @@ -585,6 +584,7 @@ this.基本设置ToolStripMenuItem, this.测试参数ToolStripMenuItem, this.存储设置ToolStripMenuItem, + this.mESSetToolStripMenuItem, this.注销登录ToolStripMenuItem, this.帮助ToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); @@ -636,6 +636,14 @@ this.存储设置ToolStripMenuItem.Text = "存储设置"; this.存储设置ToolStripMenuItem.Click += new System.EventHandler(this.存储设置ToolStripMenuItem_Click); // + // mESSetToolStripMenuItem + // + this.mESSetToolStripMenuItem.Name = "mESSetToolStripMenuItem"; + this.mESSetToolStripMenuItem.Size = new System.Drawing.Size(70, 21); + this.mESSetToolStripMenuItem.Text = "MES设置"; + this.mESSetToolStripMenuItem.Visible = false; + this.mESSetToolStripMenuItem.Click += new System.EventHandler(this.mESSetToolStripMenuItem_Click); + // // 注销登录ToolStripMenuItem // this.注销登录ToolStripMenuItem.Name = "注销登录ToolStripMenuItem"; @@ -760,7 +768,7 @@ this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label9.Location = new System.Drawing.Point(872, 50); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(88, 16); + this.label9.Size = new System.Drawing.Size(87, 16); this.label9.TabIndex = 143; this.label9.Text = "条形码长度"; // @@ -770,7 +778,7 @@ this.Scancode.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Scancode.Location = new System.Drawing.Point(1596, 57); this.Scancode.Name = "Scancode"; - this.Scancode.Size = new System.Drawing.Size(91, 20); + this.Scancode.Size = new System.Drawing.Size(90, 20); this.Scancode.TabIndex = 144; this.Scancode.Text = "扫码启动"; this.Scancode.UseVisualStyleBackColor = true; @@ -808,7 +816,7 @@ this.Passzong.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Passzong.Location = new System.Drawing.Point(84, 99); this.Passzong.Name = "Passzong"; - this.Passzong.Size = new System.Drawing.Size(24, 16); + this.Passzong.Size = new System.Drawing.Size(23, 16); this.Passzong.TabIndex = 3; this.Passzong.Text = "10"; // @@ -828,7 +836,7 @@ this.Sunzong.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Sunzong.Location = new System.Drawing.Point(84, 49); this.Sunzong.Name = "Sunzong"; - this.Sunzong.Size = new System.Drawing.Size(24, 16); + this.Sunzong.Size = new System.Drawing.Size(23, 16); this.Sunzong.TabIndex = 1; this.Sunzong.Text = "10"; this.Sunzong.Click += new System.EventHandler(this.label29_Click); @@ -881,20 +889,17 @@ // checkBox2 // this.checkBox2.AutoSize = true; - this.checkBox2.Checked = true; - this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox2.Location = new System.Drawing.Point(907, 402); + this.checkBox2.Location = new System.Drawing.Point(870, 172); this.checkBox2.Name = "checkBox2"; - this.checkBox2.Size = new System.Drawing.Size(78, 16); + this.checkBox2.Size = new System.Drawing.Size(90, 16); this.checkBox2.TabIndex = 173; - this.checkBox2.Text = "在线/离线"; + this.checkBox2.Text = "MES过站检测"; this.checkBox2.UseVisualStyleBackColor = true; - this.checkBox2.Visible = false; this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); // // pictureBox1 // - this.pictureBox1.Location = new System.Drawing.Point(907, 362); + this.pictureBox1.Location = new System.Drawing.Point(907, 371); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(82, 28); this.pictureBox1.TabIndex = 172; @@ -905,7 +910,7 @@ // this.label29.AutoSize = true; this.label29.Font = new System.Drawing.Font("宋体", 14F); - this.label29.Location = new System.Drawing.Point(903, 340); + this.label29.Location = new System.Drawing.Point(903, 349); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(87, 19); this.label29.TabIndex = 171; @@ -967,7 +972,6 @@ this.groupBox2.Controls.Add(this.strbatch); this.groupBox2.Controls.Add(this.strlocation); this.groupBox2.Controls.Add(this.strlinename); - this.groupBox2.Controls.Add(this.label41); this.groupBox2.Controls.Add(this.label42); this.groupBox2.Controls.Add(this.label43); this.groupBox2.Controls.Add(this.label48); @@ -1029,15 +1033,6 @@ this.strlinename.TabIndex = 4; this.strlinename.TextChanged += new System.EventHandler(this.strlinename_TextChanged); // - // label41 - // - this.label41.AutoSize = true; - this.label41.Location = new System.Drawing.Point(30, 291); - this.label41.Name = "label41"; - this.label41.Size = new System.Drawing.Size(69, 20); - this.label41.TabIndex = 3; - this.label41.Text = "站名:"; - // // label42 // this.label42.AutoSize = true; @@ -1065,48 +1060,25 @@ this.label48.TabIndex = 0; this.label48.Text = "线别名称:"; // - // PreCode1 - // - this.PreCode1.Font = new System.Drawing.Font("宋体", 18F); - this.PreCode1.Location = new System.Drawing.Point(1276, 477); - this.PreCode1.Name = "PreCode1"; - this.PreCode1.Size = new System.Drawing.Size(547, 35); - this.PreCode1.TabIndex = 180; - this.PreCode1.Visible = false; - this.PreCode1.TextChanged += new System.EventHandler(this.PreCode1_TextChanged); - // - // label49 - // - this.label49.AutoSize = true; - this.label49.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label49.Location = new System.Drawing.Point(1162, 482); - this.label49.Name = "label49"; - this.label49.Size = new System.Drawing.Size(106, 24); - this.label49.TabIndex = 181; - this.label49.Text = "预条形码"; - this.label49.Visible = false; - // // label50 // this.label50.AutoSize = true; this.label50.Font = new System.Drawing.Font("宋体", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label50.Location = new System.Drawing.Point(1108, 28); + this.label50.Location = new System.Drawing.Point(866, 201); this.label50.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label50.Name = "label50"; this.label50.Size = new System.Drawing.Size(87, 22); this.label50.TabIndex = 185; this.label50.Text = "MES返回"; - this.label50.Visible = false; // // textBox3 // - this.textBox3.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox3.Location = new System.Drawing.Point(1034, 54); + this.textBox3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.textBox3.Location = new System.Drawing.Point(865, 233); this.textBox3.Multiline = true; this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(256, 129); + this.textBox3.Size = new System.Drawing.Size(148, 101); this.textBox3.TabIndex = 184; - this.textBox3.Visible = false; // // textBox1 // @@ -1119,6 +1091,17 @@ // this.timerCH1.Tick += new System.EventHandler(this.timer5_Tick); // + // checkCodeRepeat + // + this.checkCodeRepeat.AutoSize = true; + this.checkCodeRepeat.Location = new System.Drawing.Point(869, 128); + this.checkCodeRepeat.Name = "checkCodeRepeat"; + this.checkCodeRepeat.Size = new System.Drawing.Size(96, 16); + this.checkCodeRepeat.TabIndex = 187; + this.checkCodeRepeat.Text = "条码重复检测"; + this.checkCodeRepeat.UseVisualStyleBackColor = true; + this.checkCodeRepeat.CheckedChanged += new System.EventHandler(this.checkCodeRepeat_CheckedChanged); + // // myGroupBox4 // this.myGroupBox4.Controls.Add(this.PUnit); @@ -1719,7 +1702,7 @@ this.label3.Font = new System.Drawing.Font("宋体", 12F); this.label3.Location = new System.Drawing.Point(25, 79); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(88, 16); + this.label3.Size = new System.Drawing.Size(87, 16); this.label3.TabIndex = 61; this.label3.Text = "串口状态:"; // @@ -1751,7 +1734,7 @@ this.label1.Font = new System.Drawing.Font("宋体", 12F); this.label1.Location = new System.Drawing.Point(37, 32); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(64, 16); + this.label1.Size = new System.Drawing.Size(63, 16); this.label1.TabIndex = 8; this.label1.Text = "端口号:"; // @@ -1770,11 +1753,10 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1025, 675); + this.Controls.Add(this.checkCodeRepeat); this.Controls.Add(this.textBox1); this.Controls.Add(this.label50); this.Controls.Add(this.textBox3); - this.Controls.Add(this.PreCode1); - this.Controls.Add(this.label49); this.Controls.Add(this.groupBox2); this.Controls.Add(this.button3); this.Controls.Add(this.button4); @@ -1828,7 +1810,7 @@ this.Controls.Add(this.groupBox1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; - this.Text = "LL18-25062501"; + this.Text = "LL18-25063001"; this.Activated += new System.EventHandler(this.Form1_Activated); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); @@ -2013,15 +1995,14 @@ private System.Windows.Forms.TextBox strbatch; private System.Windows.Forms.TextBox strlocation; private System.Windows.Forms.TextBox strlinename; - private System.Windows.Forms.Label label41; private System.Windows.Forms.Label label42; private System.Windows.Forms.Label label43; private System.Windows.Forms.Label label48; - public System.Windows.Forms.TextBox PreCode1; - private System.Windows.Forms.Label label49; private System.Windows.Forms.Label label50; private System.Windows.Forms.TextBox textBox3; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Timer timerCH1; + private System.Windows.Forms.CheckBox checkCodeRepeat; + private System.Windows.Forms.ToolStripMenuItem mESSetToolStripMenuItem; } } \ No newline at end of file diff --git a/C-Windows-1/Form1.cs b/C-Windows-1/Form1.cs index 2bebf4a..c0c8c89 100644 --- a/C-Windows-1/Form1.cs +++ b/C-Windows-1/Form1.cs @@ -20,6 +20,8 @@ using NPOI.SS.UserModel; using NPOI.HSSF.UserModel; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button; using System.Runtime.InteropServices; +using DHDMesApi; +using DHDMesApi.Data; namespace C_Windows_1 { @@ -66,6 +68,13 @@ namespace C_Windows_1 public bool checkINI; //选中ini导出 public bool checkTxt; //选中txt导出 + //得辉达MES信息 + public string strURL = "http://192.168.1.21:8080/PlMesRf/RfEntry.jws?wsdl"; //MES服务器地址 + public string productionOrder = ""; //生产工单 + public string lineNumber = ""; //产线编号 + public string processNumber = ""; //工序号 + public string tester = ""; //测试员 + public string machineNumber = ""; //测试设备编号 public Form1() { f1 = this; @@ -937,7 +946,6 @@ namespace C_Windows_1 button2.BackColor = Color.White; button3.BackColor = Color.White; button4.BackColor = Color.White; - checkBox1.Checked = true; pictureBox1.BackColor = Color.Green; //Scancode.Checked = true; //修改密码ToolStripMenuItem.Enabled = false; @@ -1714,22 +1722,18 @@ namespace C_Windows_1 //启动仪器 private void BtnStart_Click(object sender, EventArgs e) { + bool bStart = true; try { - //if (string.IsNullOrEmpty(Form1.f1.CodeLength.Text)) - //{ - // MessageBox.Show("请设定条码长度", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; - //} - //if (Convert.ToInt32(Form1.f1.CodeLength.Text) <= 2) - //{ - // MessageBox.Show("条码长度设置错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; - //} - - //Code.Focus(); - workstation = (int)yiqi.start; - - - + //检测设备是否已过站 + if (checkBox2.Checked) + { + bStart = MesCheck(Code.Text); + } + if (bStart) + { + workstation = (int)yiqi.start; + } } catch (Exception ex) { @@ -2598,6 +2602,25 @@ namespace C_Windows_1 checkBox1.Checked = Convert.ToBoolean(regName.GetValue("codelengthcheck")); } + if (regName.GetValue("codeRepeatCheck") is null) + { + checkCodeRepeat.Checked = true; + } + else + { + checkCodeRepeat.Checked = Convert.ToBoolean(regName.GetValue("codeRepeatCheck")); + } + + if (regName.GetValue("codeTestCheck") is null) + { + checkBox2.Checked = true; + } + else + { + checkBox2.Checked = Convert.ToBoolean(regName.GetValue("codeTestCheck")); + } + + if (regName.GetValue("Baudrate") is null) { Baudrate.Text = "9600"; @@ -2764,6 +2787,38 @@ namespace C_Windows_1 { CeckScanning.Checked = Convert.ToBoolean(regName.GetValue("CeckScanning").ToString()); } + + //读取MES信息 + var regVal = regName.GetValue("productionOrder"); + if (regVal != null) + { + productionOrder = regVal.ToString(); + } + regVal = regName.GetValue("processNumber"); + if (regVal != null) + { + processNumber = regVal.ToString(); + } + regVal = regName.GetValue("machineNumber"); + if (regVal != null) + { + machineNumber = regVal.ToString(); + } + regVal = regName.GetValue("lineNumber"); + if (regVal != null) + { + lineNumber = regVal.ToString(); + } + regVal = regName.GetValue("tester"); + if (regVal != null) + { + tester = regVal.ToString(); + } + regVal = regName.GetValue("URL"); + if (regVal != null) + { + strURL = regVal.ToString(); + } regName.Close(); } @@ -2782,24 +2837,21 @@ namespace C_Windows_1 //} return encode.GetString(_bytes); } - - - private void SetcheckBox1(bool check) + /// + /// 打开注册表 SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL18-Set + /// + private RegistryKey openRegedit() { RegistryKey regName; - regName = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL18-Set", true); if (regName is null) { regName = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL18-Set"); } - - regName.SetValue("codelengthcheck", check); - regName.Close(); + return regName; } - private void checkBox1_CheckedChanged(object sender, EventArgs e) { //if (checkBox1.Checked) @@ -2809,14 +2861,12 @@ namespace C_Windows_1 // Code.ResetText(); // Code.Focus(); // } - if (checkBox1.Checked) - { - SetcheckBox1(true); - } - else - { - SetcheckBox1(false); - } + RegistryKey regName; + + regName = openRegedit(); + + regName.SetValue("codelengthcheck", checkBox1.Checked); + regName.Close(); } private void Setcodecheck() { @@ -2956,6 +3006,13 @@ namespace C_Windows_1 { pictureBox1.BackColor = Color.Red; } + + RegistryKey regName; + + regName = openRegedit(); + + regName.SetValue("codeTestCheck", checkBox2.Checked); + regName.Close(); } private void strlinename_TextChanged(object sender, EventArgs e) @@ -3002,32 +3059,27 @@ namespace C_Windows_1 { this.codecheck.Text = "21"; } - bool flag2 = this.Code.TextLength > 0; - if (flag2) + //条码长度检测 + if (checkBox1.Checked && this.Code.TextLength != int.Parse(this.CodeLength.Text)) + { + MessageBox.Show(string.Format("条形码长度错误!当前条码长度:{0},设置长度为:{1}", this.Code.Text.Length, this.CodeLength.Text)); + this.Code.ResetText(); + this.Code.Focus(); + } + //条码重复检测 + if (checkCodeRepeat.Checked) { int Count = BarcodeInfo.QueryBarcodeCount(Code.Text); if (Count > 0) { - this.Code.ResetText(); this.Code.Focus(); MessageBox.Show("条形码重码,请检查"); } - bool flag3 = this.Code.TextLength == int.Parse(this.CodeLength.Text) && this.checkBox1.Checked; - if (flag3) + if (Code.TextLength == int.Parse(this.CodeLength.Text)) { string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); BarcodeInfo.InsertBarcodeData(time, Code.Text, "", "", "", "", "", ""); - - } - else - { - if (Code.TextLength > 0&& checkBox1.Checked) - { - MessageBox.Show(string.Format("条形码长度错误!当前条码长度:{0},设置长度为:{1}", this.Code.Text.Length, this.CodeLength.Text)); - this.Code.ResetText(); - this.Code.Focus(); - } } } } @@ -3044,7 +3096,7 @@ namespace C_Windows_1 string text4; string text5; - text = this.PreCode1.Text; + text = this.Code.Text; text2 = this.strstation.Text; text3 = this.strlocation.Text; text4 = this.strbatch.Text; @@ -3175,23 +3227,34 @@ namespace C_Windows_1 private void Form1_Activated(object sender, EventArgs e) { - //PreCode1.Focus(); Code.Focus(); } - private void PreCode1_TextChanged(object sender, EventArgs e) - { - if (PreCode1.Text.Length > 0) - { - timerCH1.Stop(); - timerCH1.Start(); - } - } - private void label33_Click(object sender, EventArgs e) { //CreateFile(); } + private void checkCodeRepeat_CheckedChanged(object sender, EventArgs e) + { + RegistryKey regName; + + regName = openRegedit(); + + regName.SetValue("codeRepeatCheck", checkCodeRepeat.Checked); + regName.Close(); + } + + private void mESSetToolStripMenuItem_Click(object sender, EventArgs e) + { + MESConfig mes = new MESConfig(); + mes.productionOrder.Text = productionOrder; + mes.processNumber.Text = processNumber; + mes.machineNumber.Text = machineNumber; + mes.lineNumber.Text = lineNumber; + mes.tester.Text = tester; + mes.URL.Text = strURL; + OpenForm(mes); + } /// /// 16进制格式字符串转字节数组 @@ -3213,5 +3276,30 @@ namespace C_Windows_1 return returnBytes; } + + //过站检测 + private bool MesCheck(string sCode) + { + //string sData = processNumber + "@" + lineNumber + "@" + processNumber + "@" + + // tester + "@" + machineNumber + "@" + sCode; + + //string sResponse = MESInfo.HttpPost(strURL, sData); + + string sResponse = ""; + + try + { + sResponse = DHDMes_IFLYTEK_Data.GetAllData(sCode); + } + catch (Exception e) + { + Console.WriteLine(e); + sResponse = e.Message; + } + + textBox3.Text = sResponse; + + return sResponse.Contains("OK"); + } } } \ No newline at end of file diff --git a/C-Windows-1/Form1.resx b/C-Windows-1/Form1.resx index 8853d03..ade474c 100644 --- a/C-Windows-1/Form1.resx +++ b/C-Windows-1/Form1.resx @@ -208,7 +208,7 @@ 1159, 6 - 56 + 82 diff --git a/C-Windows-1/MESConfig.Designer.cs b/C-Windows-1/MESConfig.Designer.cs index caacb2f..76d9333 100644 --- a/C-Windows-1/MESConfig.Designer.cs +++ b/C-Windows-1/MESConfig.Designer.cs @@ -29,53 +29,31 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MESConfig)); - this.Dept = new System.Windows.Forms.TextBox(); - this.label19 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); - this.MESStation = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.Config = new System.Windows.Forms.Button(); - this.method = new System.Windows.Forms.TextBox(); + this.machineNumber = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); - this.appkey = new System.Windows.Forms.TextBox(); + this.processNumber = new System.Windows.Forms.TextBox(); this.label6 = new System.Windows.Forms.Label(); - this.appid = new System.Windows.Forms.TextBox(); + this.productionOrder = new System.Windows.Forms.TextBox(); this.label7 = new System.Windows.Forms.Label(); this.URL = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); - this.Type = new System.Windows.Forms.ComboBox(); - this.Machinemodel = new System.Windows.Forms.ComboBox(); + this.lineNumber = new System.Windows.Forms.TextBox(); + this.tester = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // - // Dept - // - this.Dept.Location = new System.Drawing.Point(273, 72); - this.Dept.Margin = new System.Windows.Forms.Padding(5); - this.Dept.Name = "Dept"; - this.Dept.Size = new System.Drawing.Size(249, 26); - this.Dept.TabIndex = 160; - // - // label19 - // - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(270, 51); - this.label19.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(56, 16); - this.label19.TabIndex = 161; - this.label19.Text = "机构名"; - // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(270, 112); this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(104, 16); + this.label1.Size = new System.Drawing.Size(72, 16); this.label1.TabIndex = 163; - this.label1.Text = "测试物料类型"; + this.label1.Text = "产线编号"; // // label2 // @@ -83,27 +61,9 @@ this.label2.Location = new System.Drawing.Point(270, 176); this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(80, 16); + this.label2.Size = new System.Drawing.Size(56, 16); this.label2.TabIndex = 165; - this.label2.Text = "机型model"; - // - // MESStation - // - this.MESStation.Location = new System.Drawing.Point(273, 257); - this.MESStation.Margin = new System.Windows.Forms.Padding(5); - this.MESStation.Name = "MESStation"; - this.MESStation.Size = new System.Drawing.Size(249, 26); - this.MESStation.TabIndex = 166; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(270, 236); - this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(144, 16); - this.label3.TabIndex = 167; - this.label3.Text = "测试站编号station"; + this.label2.Text = "测试员"; // // label4 // @@ -126,13 +86,13 @@ this.Config.UseVisualStyleBackColor = true; this.Config.Click += new System.EventHandler(this.Config_Click); // - // method + // machineNumber // - this.method.Location = new System.Drawing.Point(14, 258); - this.method.Margin = new System.Windows.Forms.Padding(5); - this.method.Name = "method"; - this.method.Size = new System.Drawing.Size(249, 26); - this.method.TabIndex = 174; + this.machineNumber.Location = new System.Drawing.Point(14, 258); + this.machineNumber.Margin = new System.Windows.Forms.Padding(5); + this.machineNumber.Name = "machineNumber"; + this.machineNumber.Size = new System.Drawing.Size(249, 26); + this.machineNumber.TabIndex = 174; // // label5 // @@ -140,17 +100,17 @@ this.label5.Location = new System.Drawing.Point(11, 237); this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(56, 16); + this.label5.Size = new System.Drawing.Size(104, 16); this.label5.TabIndex = 175; - this.label5.Text = "method"; + this.label5.Text = "测试设备编号"; // - // appkey + // processNumber // - this.appkey.Location = new System.Drawing.Point(14, 194); - this.appkey.Margin = new System.Windows.Forms.Padding(5); - this.appkey.Name = "appkey"; - this.appkey.Size = new System.Drawing.Size(249, 26); - this.appkey.TabIndex = 172; + this.processNumber.Location = new System.Drawing.Point(14, 194); + this.processNumber.Margin = new System.Windows.Forms.Padding(5); + this.processNumber.Name = "processNumber"; + this.processNumber.Size = new System.Drawing.Size(249, 26); + this.processNumber.TabIndex = 172; // // label6 // @@ -160,15 +120,15 @@ this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(56, 16); this.label6.TabIndex = 173; - this.label6.Text = "appKey"; + this.label6.Text = "工序号"; // - // appid + // productionOrder // - this.appid.Location = new System.Drawing.Point(14, 133); - this.appid.Margin = new System.Windows.Forms.Padding(5); - this.appid.Name = "appid"; - this.appid.Size = new System.Drawing.Size(249, 26); - this.appid.TabIndex = 170; + this.productionOrder.Location = new System.Drawing.Point(14, 133); + this.productionOrder.Margin = new System.Windows.Forms.Padding(5); + this.productionOrder.Name = "productionOrder"; + this.productionOrder.Size = new System.Drawing.Size(249, 26); + this.productionOrder.TabIndex = 170; // // label7 // @@ -176,16 +136,16 @@ this.label7.Location = new System.Drawing.Point(11, 112); this.label7.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(48, 16); + this.label7.Size = new System.Drawing.Size(72, 16); this.label7.TabIndex = 171; - this.label7.Text = "appid"; + this.label7.Text = "生产工单"; // // URL // this.URL.Location = new System.Drawing.Point(14, 72); this.URL.Margin = new System.Windows.Forms.Padding(5); this.URL.Name = "URL"; - this.URL.Size = new System.Drawing.Size(249, 26); + this.URL.Size = new System.Drawing.Size(506, 26); this.URL.TabIndex = 176; // // label8 @@ -198,45 +158,39 @@ this.label8.TabIndex = 177; this.label8.Text = "URL"; // - // Type + // lineNumber // - this.Type.FormattingEnabled = true; - this.Type.Location = new System.Drawing.Point(273, 133); - this.Type.Name = "Type"; - this.Type.Size = new System.Drawing.Size(249, 24); - this.Type.TabIndex = 178; + this.lineNumber.Location = new System.Drawing.Point(273, 133); + this.lineNumber.Name = "lineNumber"; + this.lineNumber.Size = new System.Drawing.Size(247, 26); + this.lineNumber.TabIndex = 180; // - // Machinemodel + // tester // - this.Machinemodel.FormattingEnabled = true; - this.Machinemodel.Location = new System.Drawing.Point(273, 196); - this.Machinemodel.Name = "Machinemodel"; - this.Machinemodel.Size = new System.Drawing.Size(249, 24); - this.Machinemodel.TabIndex = 179; + this.tester.Location = new System.Drawing.Point(271, 194); + this.tester.Name = "tester"; + this.tester.Size = new System.Drawing.Size(247, 26); + this.tester.TabIndex = 181; // // MESConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(534, 360); - this.Controls.Add(this.Machinemodel); - this.Controls.Add(this.Type); + this.Controls.Add(this.tester); + this.Controls.Add(this.lineNumber); this.Controls.Add(this.URL); this.Controls.Add(this.label8); - this.Controls.Add(this.method); + this.Controls.Add(this.machineNumber); this.Controls.Add(this.label5); - this.Controls.Add(this.appkey); + this.Controls.Add(this.processNumber); this.Controls.Add(this.label6); - this.Controls.Add(this.appid); + this.Controls.Add(this.productionOrder); this.Controls.Add(this.label7); this.Controls.Add(this.Config); this.Controls.Add(this.label4); - this.Controls.Add(this.MESStation); - this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); - this.Controls.Add(this.Dept); - this.Controls.Add(this.label19); this.Font = new System.Drawing.Font("宋体", 12F); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Margin = new System.Windows.Forms.Padding(4); @@ -249,24 +203,19 @@ } #endregion - - private System.Windows.Forms.TextBox Dept; - private System.Windows.Forms.Label label19; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox MESStation; - private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; private System.Windows.Forms.Button Config; - private System.Windows.Forms.TextBox method; + public System.Windows.Forms.TextBox machineNumber; private System.Windows.Forms.Label label5; - private System.Windows.Forms.TextBox appkey; + public System.Windows.Forms.TextBox processNumber; private System.Windows.Forms.Label label6; - private System.Windows.Forms.TextBox appid; + public System.Windows.Forms.TextBox productionOrder; private System.Windows.Forms.Label label7; - private System.Windows.Forms.TextBox URL; + public System.Windows.Forms.TextBox URL; private System.Windows.Forms.Label label8; - private System.Windows.Forms.ComboBox Type; - private System.Windows.Forms.ComboBox Machinemodel; + public System.Windows.Forms.TextBox lineNumber; + public System.Windows.Forms.TextBox tester; } } \ No newline at end of file diff --git a/C-Windows-1/MESConfig.cs b/C-Windows-1/MESConfig.cs index ba7f488..190e4c3 100644 --- a/C-Windows-1/MESConfig.cs +++ b/C-Windows-1/MESConfig.cs @@ -14,19 +14,16 @@ namespace C_Windows_1 private void MESConfig_Load(object sender, EventArgs e) { ReadINI(); - Read(); } private void Config_Click(object sender, EventArgs e) { - Form1.f1.appid.Text = appid.Text; - Form1.f1.appkey.Text = appkey.Text; - Form1.f1.method.Text = method.Text; - Form1.f1.Dept.Text = Dept.Text; - Form1.f1.Type.Text = Type.Text; - Form1.f1.Machinemodel.Text = Machinemodel.Text; - Form1.f1.MESStation.Text = MESStation.Text; - Form1.f1.URL.Text = URL.Text; + Form1.f1.productionOrder = productionOrder.Text; + Form1.f1.processNumber = processNumber.Text; + Form1.f1.machineNumber = machineNumber.Text; + Form1.f1.lineNumber = lineNumber.Text; + Form1.f1.tester = tester.Text; + Form1.f1.strURL = URL.Text; Set(); this.Close(); @@ -48,112 +45,15 @@ namespace C_Windows_1 regName = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL18-Set"); } - regName.SetValue("appid", appid.Text); - regName.SetValue("appkey", appkey.Text); - regName.SetValue("method", method.Text); - regName.SetValue("dept", Dept.Text); - regName.SetValue("type", Type.Text); - regName.SetValue("model", Machinemodel.Text); - regName.SetValue("teststation", MESStation.Text); - regName.SetValue("url", URL.Text); + regName.SetValue("productionOrder", productionOrder.Text); + regName.SetValue("processNumber", processNumber.Text); + regName.SetValue("machineNumber", machineNumber.Text); + regName.SetValue("lineNumber", lineNumber.Text); + regName.SetValue("tester", tester.Text); + regName.SetValue("URL", URL.Text); regName.Close(); } - - - //读出站号、条码长度、通道数等参数 - private void Read() - { - - RegistryKey regName; - - regName = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL18-Set", true); - - if (regName is null) - { - regName = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\PMD\\1.0\\User-LL18-Set"); - } - - regName.OpenSubKey("User"); - if (regName.GetValue("url") is null) - { - URL.Text = "https://xms.be.xiaomi.com/xmsapi"; - } - else - { - URL.Text = regName.GetValue("url").ToString(); - - } - - - if (regName.GetValue("appid") is null) - { - appid.Text = "xm_1004"; - } - else - { - appid.Text = regName.GetValue("appid").ToString(); - - } - if (regName.GetValue("appkey") is null) - { - appkey.Text = "1a3015121bb93b05de89128de42f98ca"; - } - else - { - appkey.Text = regName.GetValue("appkey").ToString(); - - } - if (regName.GetValue("method") is null) - { - method.Text = "outrepair.importWRTresult"; - } - else - { - method.Text = regName.GetValue("method").ToString(); - - } - if (regName.GetValue("dept") is null) - { - Dept.Text = ""; - } - else - { - Dept.Text = regName.GetValue("dept").ToString(); - - } - if (regName.GetValue("type") is null) - { - Type.Text = ""; - } - else - { - Type.Text = regName.GetValue("type").ToString(); - - } - if (regName.GetValue("model") is null) - { - Machinemodel.Text = ""; - } - else - { - Machinemodel.Text = regName.GetValue("model").ToString(); - - } - if (regName.GetValue("teststation") is null) - { - MESStation.Text = ""; - } - else - { - MESStation.Text = regName.GetValue("teststation").ToString(); - } - - regName.Close(); - - } - - string dialog; //从ini读出测试物料类型、机型model参数 private void ReadINI() @@ -199,43 +99,6 @@ namespace C_Windows_1 mes.IniWriteValue("Machinemodel", "model29", "Test"); mes.IniWriteValue("Machinemodel", "model30", "Test"); } - Type.Items.Add(mes.IniReadValue("Type", "type1")); - Type.Items.Add(mes.IniReadValue("Type", "type2")); - Type.Items.Add(mes.IniReadValue("Type", "type3")); - Type.Items.Add(mes.IniReadValue("Type", "type4")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model1")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model2")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model3")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model4")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model5")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model6")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model7")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model8")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model9")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model10")); - - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model11")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model12")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model13")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model14")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model15")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model16")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model17")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model18")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model19")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model20")); - - - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model21")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model22")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model23")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model24")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model25")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model26")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model27")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model28")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model29")); - Machinemodel.Items.Add(mes.IniReadValue("Machinemodel", "model30")); } } diff --git a/C-Windows-1/bin/Debug/Config/BarcodeRecord/BarcodeInfo.mdb b/C-Windows-1/bin/Debug/Config/BarcodeRecord/BarcodeInfo.mdb deleted file mode 100644 index 5f3b704..0000000 Binary files a/C-Windows-1/bin/Debug/Config/BarcodeRecord/BarcodeInfo.mdb and /dev/null differ diff --git a/C-Windows-1/bin/Debug/DHDMesApi.dll b/C-Windows-1/bin/Debug/DHDMesApi.dll new file mode 100644 index 0000000..93be73e Binary files /dev/null and b/C-Windows-1/bin/Debug/DHDMesApi.dll differ diff --git a/C-Windows-1/bin/Debug/LL18-Control.exe b/C-Windows-1/bin/Debug/LL18-Control.exe index 7b9b681..89f28dc 100644 Binary files a/C-Windows-1/bin/Debug/LL18-Control.exe and b/C-Windows-1/bin/Debug/LL18-Control.exe differ diff --git a/C-Windows-1/bin/Debug/LL28-Control.exe b/C-Windows-1/bin/Debug/LL28-Control.exe deleted file mode 100644 index 9c6865d..0000000 Binary files a/C-Windows-1/bin/Debug/LL28-Control.exe and /dev/null differ diff --git a/C-Windows-1/bin/Debug/MES.dll b/C-Windows-1/bin/Debug/MES.dll new file mode 100644 index 0000000..b74c391 Binary files /dev/null and b/C-Windows-1/bin/Debug/MES.dll differ diff --git a/C-Windows-1/bin/Debug/Oracle.ManagedDataAccess.dll b/C-Windows-1/bin/Debug/Oracle.ManagedDataAccess.dll new file mode 100644 index 0000000..8cf6d1e Binary files /dev/null and b/C-Windows-1/bin/Debug/Oracle.ManagedDataAccess.dll differ diff --git a/C-Windows-1/obj/Debug/C-Windows-LL18.csproj.CopyComplete b/C-Windows-1/obj/Debug/C-Windows-LL18.csproj.CopyComplete deleted file mode 100644 index e69de29..0000000 diff --git a/C-Windows-1/obj/Debug/C-Windows-LL18.csproj.FileListAbsolute.txt b/C-Windows-1/obj/Debug/C-Windows-LL18.csproj.FileListAbsolute.txt index 36f70d3..06891b6 100644 --- a/C-Windows-1/obj/Debug/C-Windows-LL18.csproj.FileListAbsolute.txt +++ b/C-Windows-1/obj/Debug/C-Windows-LL18.csproj.FileListAbsolute.txt @@ -1071,9 +1071,6 @@ E:\platform\LL-28\C-Windows-1\obj\Debug\LL18-Control.pdb E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\LL18-Control.exe.config E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\LL18-Control.exe E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\LL18-Control.pdb -E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Buffers.dll -E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Numerics.Vectors.dll -E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Security.Principal.Windows.dll E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\LL18-Control.exe.config E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C_Windows_1.Activationcode.resources @@ -1092,7 +1089,6 @@ E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C_Windows_1.TestPara.resources E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C_Windows_1.UserPassword.resources E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C-Windows-LL18.csproj.GenerateResource.cache E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C-Windows-LL18.csproj.CoreCompileInputs.cache -E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C-Windows-LL18.csproj.CopyComplete E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\LL18-Control.exe E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\LL18-Control.pdb E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C-Windows-LL18.csproj.AssemblyReference.cache @@ -1113,3 +1109,11 @@ E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Memory.xml E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Security.AccessControl.xml E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Security.Cryptography.Xml.xml E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Text.Encoding.CodePages.xml +E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\Newtonsoft.Json.dll +E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Security.AccessControl.dll +E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C-Windows-LL18.csproj.SuggestedBindingRedirects.cache +E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Buffers.xml +E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Numerics.Vectors.xml +E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml +E:\platform\LL-28_dehuida\C-Windows-1\obj\Debug\C-Window.5B87B986.Up2Date +E:\platform\LL-28_dehuida\C-Windows-1\bin\Debug\Oracle.ManagedDataAccess.dll diff --git a/C-Windows-1/obj/Debug/LL18-Control.exe b/C-Windows-1/obj/Debug/LL18-Control.exe index 7b9b681..89f28dc 100644 Binary files a/C-Windows-1/obj/Debug/LL18-Control.exe and b/C-Windows-1/obj/Debug/LL18-Control.exe differ diff --git a/得辉达产测工具设计要求与 MES API V1.0.7.7.pdf b/得辉达产测工具设计要求与 MES API V1.0.7.7.pdf new file mode 100644 index 0000000..9b0f514 Binary files /dev/null and b/得辉达产测工具设计要求与 MES API V1.0.7.7.pdf differ