浏览代码

通过配置文件配置串口的校验位。

JeffWang 3 年之前
父节点
当前提交
373bc644be

+ 1 - 0
FactoryTool_CShare/Models/StructList.cs

@@ -124,6 +124,7 @@ namespace MOKA_Factory_Tools
     {
     {
         public string TVCOM { get; set; }
         public string TVCOM { get; set; }
         public string TVBaud { get; set; }
         public string TVBaud { get; set; }
+        public int TVParity { get; set; } = 0;      // 校验位默认为None
         public string ChannelList { get; set; }
         public string ChannelList { get; set; }
         public bool WriteChannel { get; set; }
         public bool WriteChannel { get; set; }
         public bool WriteOSD { get; set; }
         public bool WriteOSD { get; set; }

+ 3 - 1
FactoryTool_CShare/Views/Main.cs

@@ -671,7 +671,9 @@ namespace MOKA_Factory_Tools
                 functionSetting1.EnterFactoryRetry = jObject["EnterFactoryRetry"].Value<int>();
                 functionSetting1.EnterFactoryRetry = jObject["EnterFactoryRetry"].Value<int>();
                 functionSetting1.AllowNoScanning = jObject["AllowNoScanning"].Value<bool>();
                 functionSetting1.AllowNoScanning = jObject["AllowNoScanning"].Value<bool>();
                 functionSetting1.ReportTimeOut = jObject["ReportTimeOut"].Value<int>();
                 functionSetting1.ReportTimeOut = jObject["ReportTimeOut"].Value<int>();
-
+                if (jObject["Parity"] == null)
+                    SaveJsonConfig("Parity", functionSetting1.TVParity);
+                functionSetting1.TVParity = jObject["Parity"] != null ? jObject["Parity"].Value<int>() : 0;
 
 
                 //本地离线抄写时key长度设置获取
                 //本地离线抄写时key长度设置获取
                 functionSetting1.LocalDidSize = jObject["LocalSize"]["DID"].Value<int>();
                 functionSetting1.LocalDidSize = jObject["LocalSize"]["DID"].Value<int>();

+ 1 - 0
FactoryTool_CShare/Views/OperationPanel.cs

@@ -665,6 +665,7 @@ namespace MOKA_Factory_Tools
                 TVPort.BaudRate = Convert.ToInt32(FunctionSettingNow.TVBaud);
                 TVPort.BaudRate = Convert.ToInt32(FunctionSettingNow.TVBaud);
                 TVPort.WriteBufferSize = 20480;
                 TVPort.WriteBufferSize = 20480;
                 TVPort.ReadBufferSize = 20480;
                 TVPort.ReadBufferSize = 20480;
+                TVPort.Parity = (Parity)FunctionSettingNow.TVParity;
                 TVPort.Open();
                 TVPort.Open();
             }
             }
             catch (Exception ex)
             catch (Exception ex)