Commit 0aff01d6 几米阳光

温湿度报警时间可配置

1 个父辈 981e0e18
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
<add key ="OutStoreWaitSeconds" value ="10"/> <add key ="OutStoreWaitSeconds" value ="10"/>
<!--压紧轴对应1mm的脉冲--> <!--压紧轴对应1mm的脉冲-->
<add key="ComAxisChangeValue" value="2400" /> <add key="ComAxisChangeValue" value="2400" />
<!--温湿度报警多久后报警,单位为秒-->
<add key ="HumidityAlarmSecond" value ="1800"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -69,6 +69,11 @@ statusBean.addServerData("needInAfterOut",needInAfterOut); ...@@ -69,6 +69,11 @@ statusBean.addServerData("needInAfterOut",needInAfterOut);
20190319 20190319
增加调试屏蔽的功能。 增加调试屏蔽的功能。
20190430
温湿度报警时间可配置
<!--温湿度报警多久后报警,单位为秒-->
<add key ="HumidityAlarmSecond" value ="1800"/>
......
...@@ -79,5 +79,9 @@ namespace OnlineStore.Common ...@@ -79,5 +79,9 @@ namespace OnlineStore.Common
/// 压紧轴1mm对应的脉冲 /// 压紧轴1mm对应的脉冲
/// </summary> /// </summary>
public static string ComAxisChangeValue = "ComAxisChangeValue"; public static string ComAxisChangeValue = "ComAxisChangeValue";
/// <summary>
/// 温湿度报警,不配置默认是30分钟,即1800
/// </summary>
public static string HumidityAlarmSecond = "HumidityAlarmSecond";
} }
} }
...@@ -836,6 +836,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -836,6 +836,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("【" + info + "】 处理完成,耗时:" + stopwatch.Elapsed.ToString()); LogUtil.info("【" + info + "】 处理完成,耗时:" + stopwatch.Elapsed.ToString());
} }
} }
private int ss = ConfigAppSettings.GetIntValue(Setting_Init.HumidityAlarmSecond);
private void LedProcess() private void LedProcess()
{ {
try try
...@@ -856,8 +857,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -856,8 +857,12 @@ namespace OnlineStore.DeviceLibrary
bool isTemp30M = false; bool isTemp30M = false;
if (TempOrHumidityIsAlarm) if (TempOrHumidityIsAlarm)
{ {
if (ss <= 0)
{
ss = 1800;
}
TimeSpan span = DateTime.Now - TempAlarmTime; TimeSpan span = DateTime.Now - TempAlarmTime;
if (span.Minutes > 30) if (span.TotalSeconds > ss)
{ {
isTemp30M = true; isTemp30M = true;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!