Просмотр исходного кода

Revert "=====特殊版本====="

This reverts commit a5db45af31cb73227111441bceb60b50aeacf934.
sat23 3 лет назад
Родитель
Сommit
7a8e3938e2

+ 0 - 3
SCBC Factory Tools/Models/StructList.cs

@@ -196,9 +196,6 @@ namespace MOKA_Factory_Tools
         /// 单位:毫秒
         /// </summary>
         public int NextCommandWaitTime { get; set; } = 100;
-        #region 波兰工厂临时解决方案;
-        public int CheckDHAWaitTime { get; set; } = 8000;
-        #endregion
     }
 
     public class KeyInfo

+ 0 - 11
SCBC Factory Tools/Views/Main.cs

@@ -720,17 +720,6 @@ namespace MOKA_Factory_Tools
                     functionSetting1.NextCommandWaitTime = SerialCMD.NextCommandWaitTime = jObject["NextCommandWaitTime"].Value<int>();
                 }
 
-                #region 波兰工厂临时解决方案
-                if (jObject["CheckDHAWaitTime"] == null)
-                {
-                    SaveJsonConfig("CheckDHAWaitTime", functionSetting1.CheckDHAWaitTime);
-                }
-                else
-                {
-                    functionSetting1.CheckDHAWaitTime = jObject["CheckDHAWaitTime"].Value<int>();
-                }
-                #endregion
-
                 foreach (var ss in jObject["Channel"])  //遍历Channel
                 {
                     Dictionary<string, string> ChannelValues = JsonConvert.DeserializeObject<Dictionary<string, string>>(ss.ToString());

+ 1 - 104
SCBC Factory Tools/Views/OperationPanel.cs

@@ -37,7 +37,7 @@ namespace MOKA_Factory_Tools
         KeyInfo keyInfo = new KeyInfo();
         FireTVKey fireTVKey = new FireTVKey();
         bool preloadNow;
-        string SN = "";
+        string SN;
         string orderNow;
         Main mainform;
         int usingTime = 0;
@@ -46,7 +46,6 @@ namespace MOKA_Factory_Tools
         Thread WritekeyThread;
         string availableCount = "unknow";
 
-        public string PSN = "";
 
         //删除界面指针委托
         public delegate void DisplayUpdateDelegate(IntPtr intPtr);
@@ -709,88 +708,12 @@ namespace MOKA_Factory_Tools
         {
             if (e.KeyCode == Keys.Enter)
             {
-#if true
-                #region 波兰工厂临时解决方案
-                // 获取条码前缀;
-                string strSN = SNText.Text;
-                SNText.Text = "";
-                SNText.Enabled = false;
-                if (strSN.StartsWith(orderNow))
-                {
-                    if (SN.Length == 17)
-                    {
-                        MessageBox.Show("FSN already has, please scan PSN", "Error", MessageBoxButtons.OK);
-                        SNText.Enabled = true;
-                        return;
-                    }
-
-                    if (strSN.Length != 17)
-                    {
-                        MessageBox.Show("The length of FSN is wrong!", "Error", MessageBoxButtons.OK);
-                        SNText.Enabled = true;
-                        return;
-                    }
-
-                    SN = strSN;
-                    if (PSN.Length != 17)
-                    {
-                        SNText.Enabled = true;
-                        return;
-                    }
-
-                    SNText.Enabled = true;
-                }
-                else if (strSN.StartsWith("B"))
-                {
-                    if (PSN.Length == 17)
-                    {
-                        MessageBox.Show("PSN already has, please scan FSN", "Error", MessageBoxButtons.OK);
-                        SNText.Enabled = true;
-                        return;
-                    }
-
-                    if (strSN.Length != 17)
-                    {
-                        MessageBox.Show("The length of PSN is wrong", "Error", MessageBoxButtons.OK);
-                        SNText.Enabled = true;
-                        return;
-                    }
-
-                    PSN = strSN;
-                    if (SN.Length != 17)
-                    {
-                        SNText.Enabled = true;
-                        return;
-                    }
-
-                    SNText.Enabled = true;
-                }
-                else
-                {
-                    MessageBox.Show("Unknown barcode type=" + strSN, "Error", MessageBoxButtons.OK);
-                    SNText.Enabled = true;
-                    return;
-                }
-
-                if (PSN.Length == 0 || SN.Length == 0)
-                {
-                    SNText.Enabled = true;
-                    return;
-                }
-                keyInfo = new KeyInfo();
-                FocusMark = false;
-                SNKeyDownEven(this.Handle);
-                SetInitialStatus();
-                SNText.Enabled = false;
-                #endregion 波兰工厂临时解决方案
-#else
                 keyInfo = new KeyInfo();
                 FocusMark = false;
                 SNKeyDownEven(this.Handle);
                 SetInitialStatus();
                 SN = SNText.Text;
                 SNText.Enabled = false;
-#endif
                 if (FunctionSettingNow.BarcodeLimit)
                 {
                     if (SN.Length != FunctionSettingNow.BarcodeLength || !SN.StartsWith(FunctionSettingNow.BarcodeKeyword))
@@ -1646,18 +1569,11 @@ namespace MOKA_Factory_Tools
                     byte[] result_psn;
                     byte[] data_psn;
                     string error_psn;
-#if true // 波兰工厂临时解决方案;
-                    if (PSN.Length == 17)
-                    {
-                        if (CommonMethod.GetFireTVDsn(midListNow.host, orderNow, Encoding.ASCII.GetString(data), SN, PSN, out string dsn, out error_psn, errorDBNow))
-                        {
-#else
                     if (SerialCMD.ReadFireTVPSN(TVPort, out result_psn, out data_psn, out error_psn, SerailDelay))
                     {
                         string psn = Encoding.ASCII.GetString(data_psn);
                         if (CommonMethod.GetFireTVDsn(midListNow.host, orderNow, Encoding.ASCII.GetString(data), SN, psn, out string dsn, out error_psn, errorDBNow))
                         {
-#endif
                             keyInfo.DSN = dsn;
                             if (!CommonMethod.IsNumberAndWord(keyInfo.DSN))
                             {
@@ -4541,25 +4457,6 @@ namespace MOKA_Factory_Tools
                 }
             }
 
-#region 波兰工厂临时功能-抄写所有Key后执行Trigger和Check指令;
-            Log.WriteInfoLog("Start to Trigger DHA...");
-            if ( SerialCMD.TriggerDHA(TVPort, out result, out data, out error, SerailDelay) )
-            {
-                Thread.Sleep(FunctionSettingNow.CheckDHAWaitTime);
-                Log.WriteInfoLog("Start to Check DHA...");
-                if ( !SerialCMD.CheckDHA(TVPort, out result, out data, out error, SerailDelay) )
-                {
-                    MessageBox.Show("Check DHA Fail!");
-                    goto end;
-                }
-            }
-            else
-            {
-                MessageBox.Show("Trigger DHA Fail!");
-                goto end;
-            }
-#endregion
-
             //数据上传
             if (midListNow.host == "LocalPC" && !preloadNow)
             {