MainMachine _IOMonitor.cs
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using CodeLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
partial class MainMachine
{
void ioMonitor()
{
if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW)) {
Msg.add(crc.GetString("Res0166","未检测到气压信号."), MsgLevel.warning);
}
}
bool lastTHoutRangeStatus = false;
DateTime lastTHoutRangeTime = DateTime.MaxValue;
bool IsTHoutRange()
{
if (HumitureController.LastData.Humidity > ServerCM.Max_Humidity// || HumitureController.LastData.Humidity < ServerCM.Min_Humidity
|| HumitureController.LastData.Temperate > ServerCM.Max_Temperature)
{
if (!lastTHoutRangeStatus)
lastTHoutRangeTime = DateTime.Now;
lastTHoutRangeStatus = true;
return true;
}
else
{
if (lastTHoutRangeStatus)
lastTHoutRangeTime = DateTime.MaxValue;
lastTHoutRangeStatus = false;
return false;
}
}
bool IsTHoutRangeOver30m() {
return (DateTime.Now - lastTHoutRangeTime).TotalMinutes > 30;
}
}
}