Commit 867e2376 刘韬

添加温湿度更新显示

1 个父辈 3d549ae0
...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices; ...@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SO951-HC-ACSingleStore 1c16320299ab1b63176199afd21d9905bd56f930")] [assembly: AssemblyProduct("SO951-HC-ACSingleStore 3d549ae0c7c9724db465741a9e9d5c941cd6b733")]
[assembly: AssemblyCopyright("Copyright ? 2017")] [assembly: AssemblyCopyright("Copyright ? 2017")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
......
...@@ -49,6 +49,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -49,6 +49,7 @@ namespace OnlineStore.DeviceLibrary
public int CurrScanCount = 1; public int CurrScanCount = 1;
//public ScanSocket scanSocket = new ScanSocket(); //public ScanSocket scanSocket = new ScanSocket();
private System.Timers.Timer serverConnectTimer = new System.Timers.Timer(); private System.Timers.Timer serverConnectTimer = new System.Timers.Timer();
private System.Timers.Timer HumiCheckTimer = new System.Timers.Timer();
private System.Timers.Timer IoCheckTimer = new System.Timers.Timer(); private System.Timers.Timer IoCheckTimer = new System.Timers.Timer();
private int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds); private int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds);
...@@ -69,11 +70,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -69,11 +70,19 @@ namespace OnlineStore.DeviceLibrary
serverConnectTimer.AutoReset = true; serverConnectTimer.AutoReset = true;
serverConnectTimer.Enabled = false; serverConnectTimer.Enabled = false;
serverConnectTimer.Elapsed += server_connect_timer_Tick; serverConnectTimer.Elapsed += server_connect_timer_Tick;
HumiCheckTimer = new System.Timers.Timer();
HumiCheckTimer.Interval = 5000;
HumiCheckTimer.AutoReset = true;
HumiCheckTimer.Enabled = false;
HumiCheckTimer.Elapsed += HumiCheckTimer_timer_Tick;
IoCheckTimer = new System.Timers.Timer(); IoCheckTimer = new System.Timers.Timer();
IoCheckTimer.Interval = 400; IoCheckTimer.Interval = 400;
IoCheckTimer.AutoReset = true; IoCheckTimer.AutoReset = true;
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
IoCheckTimer.Elapsed += IoCheckTimer_Elapsed; IoCheckTimer.Elapsed += IoCheckTimer_Elapsed;
GC.KeepAlive(serverConnectTimer);
GC.KeepAlive(HumiCheckTimer);
GC.KeepAlive(IoCheckTimer);
//添加调试 //添加调试
if (config.IsInDebug == 1) if (config.IsInDebug == 1)
{ {
...@@ -2108,34 +2117,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -2108,34 +2117,38 @@ namespace OnlineStore.DeviceLibrary
private string CodeMsg = ""; private string CodeMsg = "";
private string CodeMsgEn = ""; private string CodeMsgEn = "";
private string CodeMsgJp = ""; private string CodeMsgJp = "";
private bool isInProcess = false; private object isInProcess = new object();
public void server_connect_timer_Tick(object sender, EventArgs e) public void server_connect_timer_Tick(object sender, EventArgs e)
{ {
if (isInProcess) if (Monitor.TryEnter(isInProcess))
{
return;
}
//HumitureServer.RandomData(Config.GetTempAddrList());
isInProcess = true;
if (StoreManager.IsConnectServer)
{ {
try try
{ {
SendLineStatus(); if (StoreManager.IsConnectServer)
{
try
{
SendLineStatus();
}
catch (Exception ex)
{
LOGGER.Error("定时给服务器发送消息出错:", ex);
}
// dlScanSocket.TimerCheck();
}
LedProcess();
} }
catch (Exception ex) finally {
{ Monitor.Exit(isInProcess);
LOGGER.Error("定时给服务器发送消息出错:", ex);
} }
// dlScanSocket.TimerCheck();
} }
}
public void HumiCheckTimer_timer_Tick(object sender, EventArgs e)
{
HumitureController.QueryData(); HumitureController.QueryData();
HumidityProcess(); HumidityProcess();
LedProcess();
isInProcess = false;
} }
string lastwatnmsg = "";
/// <summary> /// <summary>
/// 获取整个料仓的状态 /// 获取整个料仓的状态
/// </summary> /// </summary>
...@@ -2148,9 +2161,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -2148,9 +2161,10 @@ namespace OnlineStore.DeviceLibrary
lineOperation.cid = CID; lineOperation.cid = CID;
lineOperation.seq = ConfigAppSettings.nextSeq(); lineOperation.seq = ConfigAppSettings.nextSeq();
lineOperation.status = 1; lineOperation.status = 1;
if (WarnObj.WarnMsg != "") if (WarnObj.WarnMsg != "" && lastwatnmsg!=WarnObj.WarnMsg || lastwatnmsg=="")
{ {
//lineOperation.status = (int)StoreStatus.Warning; //lineOperation.status = (int)StoreStatus.Warning;
lastwatnmsg = WarnObj.WarnMsg;
lineOperation.msg = WarnObj.WarnMsg; lineOperation.msg = WarnObj.WarnMsg;
lineOperation.msgEn = WarnObj.WarnMsgEn; lineOperation.msgEn = WarnObj.WarnMsgEn;
lineOperation.msgJp = WarnObj.WarnMsgJp; lineOperation.msgJp = WarnObj.WarnMsgJp;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!