Browse Source

添加Reset模块

callm 4 years ago
parent
commit
7e452890f8

+ 42 - 0
UAS_MES_PW/CustomControl/CustomCheckBox/ReSetCheckBox.Designer.cs

@@ -0,0 +1,42 @@
+namespace UAS_MES_NEW.CustomControl.CustomCheckBox
+{
+    partial class ReSetCheckBox
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.SuspendLayout();
+            // 
+            // ReSetCheckBox
+            // 
+            this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ReSetCheckBox_Layout);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+    }
+}

+ 31 - 0
UAS_MES_PW/CustomControl/CustomCheckBox/ReSetCheckBox.cs

@@ -0,0 +1,31 @@
+using System.Windows.Forms;
+using UAS_MES_NEW.Entity;
+
+namespace UAS_MES_NEW.CustomControl.CustomCheckBox
+{
+    public partial class ReSetCheckBox : CheckBox
+    {
+        DataOperate.DataHelper dh = SystemInf.dh;
+
+        public ReSetCheckBox()
+        {
+            InitializeComponent();
+
+        }
+
+        private void ReSetCheckBox_Layout(object sender, LayoutEventArgs e)
+        {
+            if (dh != null)
+            {
+                if (dh.getFieldDataByCondition("Step", "st_ifreset", "st_code='" + User.CurrentStepCode + "'").ToString() == "-1")
+                {
+                    Checked = true;
+                }
+                else
+                {
+                    Checked = false;
+                }
+            }
+        }
+    }
+}

+ 123 - 0
UAS_MES_PW/CustomControl/CustomCheckBox/ReSetCheckBox.resx

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </metadata>
+</root>

+ 65 - 37
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.Designer.cs

@@ -1,4 +1,6 @@
-namespace UAS_MES_NEW.Make
+using UAS_MES_NEW.CustomControl.CustomCheckBox;
+
+namespace UAS_MES_NEW.Make
 {
     partial class Make_GetTestFileData
     {
@@ -43,13 +45,15 @@
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
-            this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ReSet = new UAS_MES_NEW.CustomControl.CustomCheckBox.ReSetCheckBox();
             this.std_class = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.std_testtimes = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.std_testresult = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.std_badcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
+            this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             ((System.ComponentModel.ISupportInitialize)(this.CheckItemDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -192,6 +196,7 @@
             this.dataGridViewTextBoxColumn1.HeaderText = "检测项";
             this.dataGridViewTextBoxColumn1.MinimumWidth = 150;
             this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
+            this.dataGridViewTextBoxColumn1.ReadOnly = true;
             // 
             // dataGridViewTextBoxColumn2
             // 
@@ -200,6 +205,7 @@
             this.dataGridViewTextBoxColumn2.HeaderText = "系统值";
             this.dataGridViewTextBoxColumn2.MinimumWidth = 460;
             this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.ReadOnly = true;
             // 
             // dataGridViewTextBoxColumn3
             // 
@@ -208,43 +214,25 @@
             this.dataGridViewTextBoxColumn3.HeaderText = "本机值";
             this.dataGridViewTextBoxColumn3.MinimumWidth = 460;
             this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
+            this.dataGridViewTextBoxColumn3.ReadOnly = true;
             // 
-            // StepCount
+            // dataGridViewTextBoxColumn4
             // 
-            this.StepCount.LineCode = null;
-            this.StepCount.Location = new System.Drawing.Point(1102, 130);
-            this.StepCount.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.StepCount.Name = "StepCount";
-            this.StepCount.Size = new System.Drawing.Size(176, 44);
-            this.StepCount.Source = null;
-            this.StepCount.StepCode = null;
-            this.StepCount.TabIndex = 32;
+            this.dataGridViewTextBoxColumn4.DataPropertyName = "std_badcode";
+            this.dataGridViewTextBoxColumn4.HeaderText = "故障代码";
+            this.dataGridViewTextBoxColumn4.MinimumWidth = 200;
+            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
+            this.dataGridViewTextBoxColumn4.Width = 200;
             // 
-            // sncode
+            // ReSet
             // 
-            this.sncode.AllPower = null;
-            this.sncode.BackColor = System.Drawing.Color.White;
-            this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(144, 788);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4);
-            this.sncode.Name = "sncode";
-            this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(334, 35);
-            this.sncode.Str = null;
-            this.sncode.Str1 = null;
-            this.sncode.Str2 = null;
-            this.sncode.TabIndex = 29;
-            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
-            // 
-            // OperateResult
-            // 
-            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(1265, 199);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
-            this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(454, 562);
-            this.OperateResult.TabIndex = 27;
-            this.OperateResult.Text = "";
+            this.ReSet.AutoSize = true;
+            this.ReSet.Location = new System.Drawing.Point(1102, 795);
+            this.ReSet.Name = "ReSet";
+            this.ReSet.Size = new System.Drawing.Size(186, 28);
+            this.ReSet.TabIndex = 34;
+            this.ReSet.Text = "恢复出厂设置";
+            this.ReSet.UseVisualStyleBackColor = true;
             // 
             // std_class
             // 
@@ -281,11 +269,49 @@
             this.std_badcode.Name = "std_badcode";
             this.std_badcode.Width = 200;
             // 
+            // StepCount
+            // 
+            this.StepCount.LineCode = null;
+            this.StepCount.Location = new System.Drawing.Point(1102, 130);
+            this.StepCount.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.StepCount.Name = "StepCount";
+            this.StepCount.Size = new System.Drawing.Size(176, 44);
+            this.StepCount.Source = null;
+            this.StepCount.StepCode = null;
+            this.StepCount.TabIndex = 32;
+            // 
+            // sncode
+            // 
+            this.sncode.AllPower = null;
+            this.sncode.BackColor = System.Drawing.Color.White;
+            this.sncode.ID = null;
+            this.sncode.Location = new System.Drawing.Point(144, 788);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.sncode.Name = "sncode";
+            this.sncode.Power = null;
+            this.sncode.Size = new System.Drawing.Size(334, 35);
+            this.sncode.Str = null;
+            this.sncode.Str1 = null;
+            this.sncode.Str2 = null;
+            this.sncode.TabIndex = 29;
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(1265, 199);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(454, 562);
+            this.OperateResult.TabIndex = 27;
+            this.OperateResult.Text = "";
+            // 
             // Make_GetTestFileData
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1772, 866);
+            this.Controls.Add(this.ReSet);
             this.Controls.Add(this.CheckItemDGV);
             this.Controls.Add(this.StepCount);
             this.Controls.Add(this.pr_detail);
@@ -336,5 +362,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn std_testtimes;
         private System.Windows.Forms.DataGridViewTextBoxColumn std_testresult;
         private System.Windows.Forms.DataGridViewTextBoxColumn std_badcode;
+        private ReSetCheckBox ReSet;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
     }
 }

+ 6 - 1
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.cs

@@ -104,11 +104,16 @@ namespace UAS_MES_NEW.Make
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "标签核对", "参数核对成功", sncode.Text, "");
                                 //SN核对成功
                                 //>> 请输入SN
-                                OperateResult.AppendText("<<"+sncode.Text+"信息核对成功\n", Color.Green, sncode);
+                                OperateResult.AppendText("<<" + sncode.Text + "信息核对成功\n", Color.Green, sncode);
                                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
+
                                 SetCheck set = new SetCheck("OK", Color.Green);
                                 BaseUtil.SetFormCenter(set);
                                 set.ShowDialog();
+                                if (ReSet.Checked)
+                                {
+                                    BaseUtil.GetDataFromDevice("RESET");
+                                }
                             }
                             else
                             {

+ 0 - 12
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.resx

@@ -129,16 +129,4 @@
   <metadata name="std_badcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="std_class.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_testtimes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_testresult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_badcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>

+ 9 - 0
UAS_MES_PW/FunctionCode/Make/Make_ReadWriteInfo.cs

@@ -115,6 +115,15 @@ namespace UAS_MES_NEW.Make
                             dt.Rows.Add(dr);
                         }
                         CheckItemDGV.DataSource = dt;
+                        //烧写信息
+                        if (LogicHandler.snBurn(sncode.Text, sncode.Text, User.UserSourceCode, User.UserCode, omakeCode, 0, IMEI0, IMEI1, "", "", "", "", "", "", "", MAC, BT, "", "", "", out oErrorMessage))
+                        {
+                            OperateResult.AppendText(">>SN:" + sncode.Text + "烧写信息绑定成功\n", Color.Green, sncode);
+                        }
+                        else
+                        {
+                            OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
+                        }
                     }
                     else
                     {

+ 8 - 7
UAS_MES_PW/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -1,4 +1,6 @@
-namespace UAS_MES_NEW.Make
+using UAS_MES_NEW.CustomControl.CustomCheckBox;
+
+namespace UAS_MES_NEW.Make
 {
     partial class Make_TestCollection
     {
@@ -52,7 +54,7 @@
             this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.columnHeader10 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.AutoBadCode = new System.Windows.Forms.CheckBox();
+            this.AutoBadCode = new ReSetCheckBox();
             this.ma_qty_label = new System.Windows.Forms.Label();
             this.ma_prodcode_label = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
@@ -314,14 +316,13 @@
             // 
             this.AutoBadCode.AutoSize = true;
             this.AutoBadCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoBadCode.Location = new System.Drawing.Point(1440, 302);
+            this.AutoBadCode.Location = new System.Drawing.Point(1455, 309);
             this.AutoBadCode.Margin = new System.Windows.Forms.Padding(4);
             this.AutoBadCode.Name = "AutoBadCode";
-            this.AutoBadCode.Size = new System.Drawing.Size(238, 35);
+            this.AutoBadCode.Size = new System.Drawing.Size(190, 35);
             this.AutoBadCode.TabIndex = 69;
-            this.AutoBadCode.Text = "自动产生不良代码";
+            this.AutoBadCode.Text = "恢复出厂设置";
             this.AutoBadCode.UseVisualStyleBackColor = true;
-            this.AutoBadCode.Visible = false;
             // 
             // ma_qty_label
             // 
@@ -946,7 +947,7 @@
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private CustomControl.TextBoxWithIcon.EnterTextBox bc_code;
-        private System.Windows.Forms.CheckBox AutoBadCode;
+        private ReSetCheckBox AutoBadCode;
         private System.Windows.Forms.ColumnHeader columnHeader4;
         private CustomControl.ButtonUtil.NormalButton Save;
         private System.Windows.Forms.Panel panel1;

+ 18 - 29
UAS_MES_PW/FunctionCode/Make/Make_TestCollection.cs

@@ -337,9 +337,6 @@ namespace UAS_MES_NEW.Make
                 LoadChoosedBadListView();
                 OperateResult.AppendText(">>请采集不良代码\n", Color.Green);
                 bc_code.Focus();
-                //勾选了自动产生代码
-                if (AutoBadCode.Checked)
-                    Save_Click(new object(), new EventArgs());
             }
             else if (GoodProduct.Checked)
             {
@@ -368,6 +365,9 @@ namespace UAS_MES_NEW.Make
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
                             LastSncode = ms_sncode.Text;
                             OperateResult.AppendText(">>" + ms_sncode.Text + "良品采集成功\n", Color.Green, ms_sncode);
+                            //恢复出厂设置
+                            if (AutoBadCode.Checked)
+                                BaseUtil.GetDataFromDevice("RESET");
                             //记录操作日志
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "采集良品", "采集良品成功", LastSncode, ob_checkno.Text);
                         }
@@ -461,37 +461,26 @@ namespace UAS_MES_NEW.Make
                 string[] bgcode = new string[RejectCount];
                 string[] bgname = new string[RejectCount];
                 string[] bcname = new string[RejectCount];
-                if (AutoBadCode.Checked)
+
+                if (ChoosedRejectList.Items.Count == 0)
                 {
-                    string defaultvalue = Properties.Settings.Default.DefaultCollectionValue;
-                    bccode = new string[] { defaultvalue };
-                    bcremark = new string[] { defaultvalue };
-                    bgcode = new string[] { defaultvalue };
-                    bgname = new string[] { defaultvalue };
-                    bcname = new string[] { defaultvalue };
+                    OperateResult.AppendText(">>不良品必须选择不良原因和不良代码!\n", Color.Red);
+                    return;
                 }
                 else
                 {
-                    if (ChoosedRejectList.Items.Count == 0)
-                    {
-                        OperateResult.AppendText(">>不良品必须选择不良原因和不良代码!\n", Color.Red);
-                        return;
-                    }
-                    else
+                    for (int i = 0; i < RejectCount; i++)
                     {
-                        for (int i = 0; i < RejectCount; i++)
-                        {
-                            //获取不良代码组
-                            bgcode[i] = ChoosedRejectList.Items[i].SubItems[1].Text.Split(':')[0];
-                            //获取不良代码组名称
-                            bgname[i] = ChoosedRejectList.Items[i].SubItems[1].Text.Split(':')[1];
-                            //获取所有的不良代码
-                            bccode[i] = ChoosedRejectList.Items[i].SubItems[2].Text;
-                            //获取不良名称
-                            bcname[i] = ChoosedRejectList.Items[i].SubItems[3].Text;
-                            //获取所有的不良备注
-                            bcremark[i] = bc_remark.Text;
-                        }
+                        //获取不良代码组
+                        bgcode[i] = ChoosedRejectList.Items[i].SubItems[1].Text.Split(':')[0];
+                        //获取不良代码组名称
+                        bgname[i] = ChoosedRejectList.Items[i].SubItems[1].Text.Split(':')[1];
+                        //获取所有的不良代码
+                        bccode[i] = ChoosedRejectList.Items[i].SubItems[2].Text;
+                        //获取不良名称
+                        bcname[i] = ChoosedRejectList.Items[i].SubItems[3].Text;
+                        //获取所有的不良备注
+                        bcremark[i] = bc_remark.Text;
                     }
                 }
                 //如果之前是良品的

+ 6 - 0
UAS_MES_PW/PublicMethod/BaseUtil.cs

@@ -1443,6 +1443,12 @@ namespace UAS_MES_NEW.PublicMethod
                     value = p.StandardOutput.ReadToEnd().Replace(":", "").ToUpper();
                     p.Close();
                     break;
+                case "RESET":
+                    p.StartInfo.Arguments = " reboot recovery";
+                    p.Start();
+                    value = p.StandardOutput.ReadToEnd().Replace(":", "").ToUpper();
+                    p.Close();
+                    break;
                 default:
                     break;
             }

+ 12 - 0
UAS_MES_PW/PublicMethod/LogicHandler.cs

@@ -1327,6 +1327,18 @@ namespace UAS_MES_NEW.PublicMethod
             else
                 return false;
         }
+
+        public static bool snBurn(string iTSN, string iSN, string iSourcecode, string iUsercode, string iMacode, int iifrechange, string iMEI1, string iMEI2, string iMEI3, string iMEID, string iNETCODE, string iPSN, string iID1, string iID2, string iID3, string iMAC, string iBT, string iCODE1, string iCODE2, string iCODE3, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string[] param = new string[] { iTSN, iSN, iSourcecode, iUsercode, iMacode, iifrechange + "", iMEI1, iMEI2, iMEI3, iMEID, iNETCODE, iPSN, iID1, iID2, iID3, iMAC, iBT, iCODE1, iCODE2, iCODE3, oErrorMessage };
+            dh.CallProcedure("CS_SNBURN", ref param);
+            oErrorMessage = param[20];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null" || oErrorMessage.Contains("AFTERSUCCESS"))
+                return true;
+            else
+                return false;
+        }
         /// <summary>
         /// 记录打印
         /// </summary>