Пример #1
0
 /// <summary>
 /// 初始化串口消息配置
 /// </summary>
 public void InitSerialInfoConfig()
 {
     SerialInfoConfig.Path = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "SerialInfoConfig.config";
     objSerialInfoConfig   = Json.ReadFile <SerialInfoConfig>(SerialInfoConfig.Path);
     if (objSerialInfoConfig == null)
     {
         objSerialInfoConfig = new SerialInfoConfig();
         objSerialInfoConfig.ResetConfig();
     }
 }
Пример #2
0
 /// <summary>
 /// 初始化串口消息UI
 /// </summary>
 private void InitSerialInfoUI(SerialInfoConfig serialInfoConfig)
 {
     txtInfoFont.Font            = serialInfoConfig.Font;
     BtnInfoFontColor1.ForeColor = serialInfoConfig.Color1Write;
     BtnInfoFontColor2.ForeColor = serialInfoConfig.Color1Receive;
     BtnInfoFontColor3.ForeColor = serialInfoConfig.Color2Write;
     BtnInfoFontColor4.ForeColor = serialInfoConfig.Color2Receive;
     txtTimeFormat.Text          = serialInfoConfig.TimeFormat;
     ShowTimeFormat(serialInfoConfig.TimeFormat);
 }
Пример #3
0
 /// <summary>
 /// 初始化串口消息配置
 /// </summary>
 public void InitSerialInfoConfig()
 {
     SerialInfoConfig.Path = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "SerialInfoConfig.config";
     objSerialInfoConfig   = Json.ReadFile <SerialInfoConfig>(SerialInfoConfig.Path);
     if (objSerialInfoConfig == null)
     {
         objSerialInfoConfig = new SerialInfoConfig();
         objSerialInfoConfig.ResetConfig();
     }
     chkShowSend.Checked   = objSerialInfoConfig.ShowSend;
     chkShowSerial.Checked = objSerialInfoConfig.ShowSerial;
     chkShowTime.Checked   = objSerialInfoConfig.ShowTime;
 }
Пример #4
0
 /// <summary>
 /// 初始化串口消息UI
 /// </summary>
 private void InitSerialInfoUI(SerialInfoConfig serialInfoConfig)
 {
     txtInfoFont.Font            = serialInfoConfig.Font;
     BtnInfoFontColor1.ForeColor = serialInfoConfig.Color1Write;
     BtnInfoFontColor2.ForeColor = serialInfoConfig.Color1Receive;
     BtnInfoFontColor3.ForeColor = serialInfoConfig.Color2Write;
     BtnInfoFontColor4.ForeColor = serialInfoConfig.Color2Receive;
     txtTimeFormat.Text          = serialInfoConfig.TimeFormat;
     ShowTimeFormat(serialInfoConfig.TimeFormat);
     chkMemoryFunction.Checked = serialInfoConfig.MemoryFunction;
     chkShowSerial.Checked     = serialInfoConfig.ShowSerial;
     chkShowSend.Checked       = serialInfoConfig.ShowSend;
     chkShowTime.Checked       = serialInfoConfig.ShowTime;
     GroupBoxEnable(groupBoxInfoConfigMemaryFunction, !chkMemoryFunction.Checked);
 }