Преглед изворни кода

称重界面替换xml存串口和波特率

shim пре 8 година
родитељ
комит
398102d57b

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_BigBoxWeight.cs

@@ -58,8 +58,8 @@ namespace UAS_MES.Make
         {
             asc.controllInitializeSize(this);
             CheckForIllegalCrossThreadCalls = false;
-            Comlist = Properties.Settings.Default.PortName;
-            Baurate = Properties.Settings.Default.BaudRate;
+            Comlist = BaseUtil.GetCacheData("PortName").ToString();
+            Baurate = BaseUtil.GetCacheData("BaudRate").ToString();
             InitPrint = new Thread(InPrint);
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -58,8 +58,8 @@ namespace UAS_MES.Make
         {
             CheckForIllegalCrossThreadCalls = false;
             asc.controllInitializeSize(this);
-            ComList.Text = Properties.Settings.Default.PortName;
-            BaudRate.Text = Properties.Settings.Default.BaudRate;
+            ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
+            BaudRate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
             InitPrint = new Thread(InPrint);
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -48,8 +48,8 @@ namespace UAS_MES.Make
         private void Make_ColorBoxWeigh_Load(object sender, EventArgs e)
         {
             asc.controllInitializeSize(this);
-            ComList.Text = Properties.Settings.Default.PortName;
-            BaudRate.Text = Properties.Settings.Default.BaudRate;
+            ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
+            BaudRate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
             InitPrint = new Thread(InPrint);
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_PalletWeigh.cs

@@ -56,8 +56,8 @@ namespace UAS_MES.Make
             OperateResult.AppendText(">>请输入栈板号\n", Color.Black);
             //栈板号输入框聚焦
             palletcode.Focus();
-            ComList.Text = Properties.Settings.Default.PortName;
-            BaudRate.Text = Properties.Settings.Default.BaudRate;
+            ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
+            BaudRate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
             dh = new DataHelper();
             InitPrint = new Thread(InPrint);
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");

+ 4 - 5
UAS-MES/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs

@@ -33,8 +33,8 @@ namespace UAS_MES.SystemSetting
         private void 电子秤调试_Load(object sender, EventArgs e)
         {
             CheckForIllegalCrossThreadCalls = false;
-            ComList.Text = Properties.Settings.Default.PortName;
-            BaudRate.Text = Properties.Settings.Default.BaudRate;
+            ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
+            BaudRate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
         }
 
         private void StartTest_Click(object sender, EventArgs e)
@@ -45,9 +45,8 @@ namespace UAS_MES.SystemSetting
                 ReadData = true;
                 serialPort1.PortName = this.ComList.Text;
                 serialPort1.BaudRate = int.Parse(BaudRate.Text);
-                Properties.Settings.Default.PortName = this.ComList.Text;
-                Properties.Settings.Default.BaudRate = BaudRate.Text;
-                Properties.Settings.Default.Save();
+                BaseUtil.SetCacheData("PortName", this.ComList.Text);
+                BaseUtil.SetCacheData("BaudRate", BaudRate.Text);
                 serialPort1.Open();
                 thread.Start();
             }