Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a9caaaa9
由
几米阳光
编写于
2019-05-16 13:42:02 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
温湿度处理修改
1 个父辈
0aff01d6
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
95 行增加
和
31 行删除
source/ACSingleStore/FrmStoreBox.cs
source/Common/bean/Bean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
a9caaaa
...
...
@@ -241,15 +241,7 @@ namespace OnlineStore.ACSingleStore
lblWarnMsg
.
Text
=
store
.
WarnMsg
;
if
(
store
.
Config
.
IsHasDoorLimit
.
Equals
(
1
))
{
//if (store.KNDIOValue(IO_Type.Left_Door_LimitSingle).Equals(IO_VALUE.LOW))
//{
// lblWarnMsg.Text = lblWarnMsg.Text + " 左侧门未关";
//}
//if (store.KNDIOValue(IO_Type.Right_Door_LimitSingle).Equals(IO_VALUE.LOW))
//{
// lblWarnMsg.Text = lblWarnMsg.Text + " 右侧门未关";
//}
{
if
(
store
.
KNDIOValue
(
IO_Type
.
Door_LimitSingle
).
Equals
(
IO_VALUE
.
LOW
))
{
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
" 前门未关"
;
...
...
@@ -260,6 +252,10 @@ namespace OnlineStore.ACSingleStore
{
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
" 叉子料盘检测有料,请检查"
;
}
if
(
store
.
TempOrHumidityIsAlarm
)
{
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
" 温湿度报警["
+
store
.
TempAlarmTime
.
ToLongTimeString
()+
"]"
;
}
if
(
store
.
autoNext
)
{
string
msg
=
store
.
autoMsg
;
...
...
source/Common/bean/Bean.cs
查看文件 @
a9caaaa
...
...
@@ -30,6 +30,7 @@ namespace OnlineStore.Common
/// 1扫码入库(扫码成功后发送给服务器),
/// 2 出库(服务器发送),3表示错误信息 )
/// 4,发送给服务表示二维码扫码入库,收到开始扫码
/// 5=表示温湿度报警值
/// </summary>
public
int
op
{
get
;
set
;
}
/// <summary>
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
a9caaaa
...
...
@@ -68,8 +68,8 @@ namespace OnlineStore.DeviceLibrary
this
.
Config
=
config
;
this
.
DIList
=
config
.
StoreDIList
;
this
.
DOList
=
config
.
StoreDOList
;
Max_Humidity
=
config
.
Max_Humidity
;
Max_Temperature
=
config
.
Max_Temperature
;
//
Max_Humidity = config.Max_Humidity;
//
Max_Temperature = config.Max_Temperature;
moveAxisList
=
new
List
<
ConfigMoveAxis
>();
MoveAxisConfig
();
List
<
ACStorePosition
>
positionList
=
CSVPositionReader
<
ACStorePosition
>.
getPositionList
();
...
...
@@ -1416,7 +1416,28 @@ namespace OnlineStore.DeviceLibrary
return
;
}
IsScanCode
=
false
;
ReviceInStoreProcess
(
message
,
resultOperation
);
if
(
resultOperation
.
data
!=
null
)
{
ProcessHumidityCMD
(
resultOperation
);
}
if
(
resultOperation
.
op
.
Equals
(
2
))
{
ReviceOutStoreProcess
(
resultOperation
);
}
else
if
(
resultOperation
.
op
.
Equals
(
1
))
{
ReviceInStoreProcess
(
message
,
resultOperation
);
}
//else if (resultOperation.op.Equals(5))
//{
// ProcessHumidityCMD(resultOperation);
//}
else
{
LogUtil
.
error
(
"收到服务器命令:op="
+
resultOperation
.
op
+
",未找到对应处理"
);
}
}
catch
(
Exception
ex
)
{
...
...
@@ -1693,8 +1714,8 @@ namespace OnlineStore.DeviceLibrary
private
DateTime
LastEndBlowTime
=
new
DateTime
(
1997
,
1
,
1
);
private
DateTime
preLogTime
=
DateTime
.
Now
;
p
rivate
bool
TempOrHumidityIsAlarm
=
false
;
p
rivate
DateTime
TempAlarmTime
=
DateTime
.
Now
;
p
ublic
bool
TempOrHumidityIsAlarm
=
false
;
p
ublic
DateTime
TempAlarmTime
=
DateTime
.
Now
;
private
float
StartBlowValue
=
(
float
)
ConfigAppSettings
.
GetNumValue
(
Setting_Init
.
StartBlowValue
);
private
float
StopBlowValue
=
(
float
)
ConfigAppSettings
.
GetNumValue
(
Setting_Init
.
StopBlowValue
);
...
...
@@ -1743,8 +1764,7 @@ namespace OnlineStore.DeviceLibrary
if
(
IsInBlowing
&&
stopBlowHumidity
>
currMaxHumidity
)
{
LOGGER
.
Info
(
"当前最大湿度:"
+
currMaxHumidity
.
ToString
()
+
",停止吹气湿度:"
+
stopBlowHumidity
+
",停止吹气!"
);
IsInBlowing
=
false
;
//Thread.Sleep(100);
IsInBlowing
=
false
;
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
LastEndBlowTime
=
DateTime
.
Now
;
}
...
...
@@ -1761,24 +1781,16 @@ namespace OnlineStore.DeviceLibrary
LastEndBlowTime
=
DateTime
.
Now
;
}
}
bool
needAlarm
=
false
;
//如果开始吹气并且当前达到报警值
if
(
IsInBlowing
.
Equals
(
true
)
&&
humidity
>
Max_Humidity
)
if
(
IsInBlowing
&&
humidity
>
Max_Humidity
)
{
TempAlarmTime
=
DateTime
.
Now
;
TempOrHumidityIsAlarm
=
true
;
needAlarm
=
true
;
}
else
{
TempOrHumidityIsAlarm
=
false
;
}
//如果湿度没有报警,温度达到范围也需要报警
if
(
temp
>
Max_Temperature
&&
Max_Temperature
>
0
)
else
if
(
temp
>
Max_Temperature
&&
Max_Temperature
>
0
)
{
LOGGER
.
Info
(
"当前温度【"
+
param
.
Temperate
+
"】超过最高温度【"
+
Max_Temperature
+
"】,开始报警!"
);
TempAlarmTime
=
DateTime
.
Now
;
TempOrHumidityIsAlarm
=
true
;
needAlarm
=
true
;
//Thread.Sleep(100);
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
...
...
@@ -1791,6 +1803,14 @@ namespace OnlineStore.DeviceLibrary
//Thread.Sleep(100);
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
}
if
(
needAlarm
)
{
HTAlarm
();
}
else
{
TempOrHumidityIsAlarm
=
false
;
}
}
}
...
...
@@ -1799,6 +1819,15 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Error
(
StoreName
+
"HumidityProcess出错:"
+
ex
.
ToString
());
}
}
private
void
HTAlarm
()
{
if
(
TempOrHumidityIsAlarm
)
{
return
;
}
TempAlarmTime
=
DateTime
.
Now
;
TempOrHumidityIsAlarm
=
true
;
}
#
endregion
#
region
与服务器通信定时器,每
1
秒向服务器通知一次状态
,
同时执行出库操作
...
...
@@ -1927,7 +1956,12 @@ namespace OnlineStore.DeviceLibrary
DateTime
time
=
DateTime
.
Now
;
//构建发送给服务器的对象
Operation
lineOperation
=
getLineBoxStatus
();
//如果还没湿度范围,先获取
if
(
Max_Humidity
<=
0
||
(
Max_Temperature
<=
0
))
{
lineOperation
.
op
=
5
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
"没有湿度预警范围,需要从服务器获取,发送OP="
+
lineOperation
.
op
);
}
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
//增加报警处理
...
...
@@ -1947,11 +1981,20 @@ namespace OnlineStore.DeviceLibrary
}
}
//发送状态信息到服务器
if
(
resultOperation
==
null
||
(
resultOperation
.
op
<=
0
)
)
if
(
resultOperation
==
null
)
{
//判断服务端是否返回出库操作
return
;
}
if
(
resultOperation
.
data
!=
null
)
{
ProcessHumidityCMD
(
resultOperation
);
}
if
((
resultOperation
.
op
<=
0
))
{
return
;
}
if
(
resultOperation
.
op
.
Equals
(
2
))
{
ReviceOutStoreProcess
(
resultOperation
);
...
...
@@ -1959,6 +2002,10 @@ namespace OnlineStore.DeviceLibrary
{
ReviceInStoreProcess
(
""
,
resultOperation
);
}
//else if (resultOperation.op.Equals(5))
//{
// ProcessHumidityCMD(resultOperation);
//}
else
{
LogUtil
.
error
(
"收到服务器命令:op="
+
resultOperation
.
op
+
",未找到对应处理"
);
...
...
@@ -1969,7 +2016,27 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
StoreName
+
"执行TimerProcess 共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒"
);
}
}
private
void
ProcessHumidityCMD
(
Operation
resultOperation
)
{
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
maxHumidity
)
&&
data
.
ContainsKey
(
ParamDefine
.
maxTemperature
))
{
string
maxHumidity
=
data
[
ParamDefine
.
maxHumidity
];
string
maxTemp
=
data
[
ParamDefine
.
maxTemperature
];
LogUtil
.
info
(
LOGGER
,
"收到服务器温湿度预警值:maxHumidity="
+
maxHumidity
+
",maxTemperature="
+
maxTemp
);
try
{
this
.
Max_Humidity
=
(
float
)
Convert
.
ToDouble
(
maxHumidity
);
this
.
Max_Temperature
=
(
float
)
Convert
.
ToDouble
(
maxTemp
);
LogUtil
.
info
(
LOGGER
,
"保存温湿度预警值:Max_Humidity="
+
Max_Humidity
+
",Max_Temperature="
+
Max_Temperature
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"转换温湿度失败:"
+
ex
.
ToString
());
}
}
}
private
void
ReviceOutStoreProcess
(
Operation
resultOperation
)
{
try
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论