Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7b74af66
由
LN
编写于
2021-03-29 15:01:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
报警修改
1 个父辈
57fcc6e2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
37 行增加
和
3 行删除
source/ACSingleStore/FrmStoreBox.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
7b74af6
...
@@ -18,6 +18,7 @@ using System.IO.Ports;
...
@@ -18,6 +18,7 @@ using System.IO.Ports;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
CodeLibrary
;
using
CodeLibrary
;
using
UserFromControl
;
using
UserFromControl
;
using
System.Diagnostics
;
namespace
OnlineStore.ACSingleStore
namespace
OnlineStore.ACSingleStore
{
{
...
@@ -159,9 +160,41 @@ namespace OnlineStore.ACSingleStore
...
@@ -159,9 +160,41 @@ namespace OnlineStore.ACSingleStore
btnStoreStop
.
Enabled
=
isOpen
;
btnStoreStop
.
Enabled
=
isOpen
;
}
}
private
DateTime
lastLogTime
=
DateTime
.
Now
;
PerformanceCounter
curtime
=
null
;
private
void
LogM
()
{
try
{
TimeSpan
sp
=
DateTime
.
Now
-
lastLogTime
;
if
(
sp
.
TotalMinutes
>=
1
)
{
lastLogTime
=
DateTime
.
Now
;
Process
process
=
Process
.
GetCurrentProcess
();
if
(
curtime
==
null
)
{
curtime
=
new
PerformanceCounter
(
"Process"
,
"% Processor Time"
,
process
.
ProcessName
);
}
if
(
process
!=
null
)
{
StringBuilder
sbResult
=
new
StringBuilder
();
PerformanceCounter
pf1
=
new
PerformanceCounter
(
"Process"
,
"Working Set - Private"
,
process
.
ProcessName
);
sbResult
.
AppendFormat
(
DateTime
.
Now
.
ToLongTimeString
()
+
", 名称:{0} 内存:{1}M "
,
process
.
ProcessName
,
Math
.
Round
(
pf1
.
NextValue
()
/
1024
/
1024F
,
2
));
sbResult
.
AppendFormat
(
", CPU : {0} %"
,
curtime
.
NextValue
()
/
Environment
.
ProcessorCount
);
LogUtil
.
info
(
sbResult
.
ToString
());
}
}
//ClearMemory();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"LogM Error: "
+
ex
.
ToString
());
}
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
{
LogM
();
if
(!
this
.
Visible
)
if
(!
this
.
Visible
)
{
{
return
;
return
;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
7b74af6
...
@@ -682,7 +682,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -682,7 +682,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 报警,报警类型:"
+
nalarmType
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 报警,报警类型:"
+
nalarmType
);
this
.
alarmType
=
nalarmType
;
this
.
alarmType
=
nalarmType
;
if
(
nalarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
|
nalarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
if
(
nalarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
|
|
nalarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
{
{
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
))
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
))
//只有第一次报警才处理库位号
//只有第一次报警才处理库位号
...
@@ -707,6 +707,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -707,6 +707,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
"轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
"轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
StoreMove
.
EndMove
();
StopMove
(
true
);
StopMove
(
true
);
}
}
else
if
(
nalarmType
==
StoreAlarmType
.
SuddenStop
)
else
if
(
nalarmType
==
StoreAlarmType
.
SuddenStop
)
...
@@ -1410,9 +1411,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1410,9 +1411,10 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
if
((
DateTime
.
Now
-
preLogTime
).
TotalSeconds
>
10
)
if
((
DateTime
.
Now
-
preLogTime
).
TotalSeconds
>
3
)
{
{
preLogTime
=
DateTime
.
Now
;
preLogTime
=
DateTime
.
Now
;
HumitureController
.
QueryData
();
//用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
//用最大的湿度判断是否需要吹气,开始吹气的值=发过来的值-4
//温湿度
//温湿度
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
//ASTemperateParam param = HumitureServer.GetTemperateParam(Config.GetTempAddrList());
...
@@ -1558,7 +1560,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1558,7 +1560,6 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
HumitureController
.
QueryData
();
HumidityProcess
();
HumidityProcess
();
LedProcess
();
LedProcess
();
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论