Commit 867e2376 刘韬

添加温湿度更新显示

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