Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9211d903
由
LN
编写于
2021-06-30 17:19:12 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
bug修改
1 个父辈
03579498
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
65 行增加
和
42 行删除
source/Common/util/RunLogUtil.cs
source/DeviceLibrary/model/KTK_Store.cs
source/DeviceLibrary/model/StoreStep.cs
source/Common/util/RunLogUtil.cs
查看文件 @
9211d90
...
@@ -65,6 +65,9 @@ namespace OnlineStore.Common
...
@@ -65,6 +65,9 @@ namespace OnlineStore.Common
}
}
public
ErrorLog
(
string
deviceName
,
string
errType
,
string
errMsg
,
DateTime
startTime
,
DateTime
endTime
,
string
operType
=
""
,
string
posid
=
""
,
string
barcode
=
""
)
public
ErrorLog
(
string
deviceName
,
string
errType
,
string
errMsg
,
DateTime
startTime
,
DateTime
endTime
,
string
operType
=
""
,
string
posid
=
""
,
string
barcode
=
""
)
{
{
if
(
operType
==
null
)
{
operType
=
""
;
}
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"Error"
;
this
.
LogType
=
"Error"
;
this
.
DeviceName
=
deviceName
.
Trim
();
this
.
DeviceName
=
deviceName
.
Trim
();
this
.
ErrorType
=
errType
.
Trim
();
this
.
ErrorType
=
errType
.
Trim
();
...
@@ -108,7 +111,9 @@ namespace OnlineStore.Common
...
@@ -108,7 +111,9 @@ namespace OnlineStore.Common
this
.
LogType
=
"Running"
;
this
.
LogType
=
"Running"
;
}
}
public
MoveLog
(
string
deviceName
,
string
moveType
,
string
moveMsg
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
public
MoveLog
(
string
deviceName
,
string
moveType
,
string
moveMsg
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
{
{
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"Running"
;
this
.
LogType
=
"Running"
;
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
...
@@ -150,6 +155,8 @@ namespace OnlineStore.Common
...
@@ -150,6 +155,8 @@ namespace OnlineStore.Common
}
}
public
MoveEndLog
(
string
deviceName
,
string
moveType
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
public
MoveEndLog
(
string
deviceName
,
string
moveType
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
{
{
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"InoutEnd"
;
this
.
LogType
=
"InoutEnd"
;
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
...
@@ -189,6 +196,8 @@ namespace OnlineStore.Common
...
@@ -189,6 +196,8 @@ namespace OnlineStore.Common
}
}
public
AxisMoveLog
(
string
deviceName
,
string
axisName
,
string
moveType
,
int
targetP
,
int
speed
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
public
AxisMoveLog
(
string
deviceName
,
string
axisName
,
string
moveType
,
int
targetP
,
int
speed
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
{
{
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"Axis"
;
this
.
LogType
=
"Axis"
;
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
...
...
source/DeviceLibrary/model/KTK_Store.cs
查看文件 @
9211d90
...
@@ -579,68 +579,82 @@ namespace OnlineStore.DeviceLibrary
...
@@ -579,68 +579,82 @@ namespace OnlineStore.DeviceLibrary
/// <param name="logseconds"></param>
/// <param name="logseconds"></param>
public
void
SetWarnMsg
(
string
msg
=
""
,
string
alarmType
=
""
,
LineMoveInfo
moveInfo
=
null
,
int
logseconds
=
10
)
public
void
SetWarnMsg
(
string
msg
=
""
,
string
alarmType
=
""
,
LineMoveInfo
moveInfo
=
null
,
int
logseconds
=
10
)
{
{
int
logtype
=
801
;
try
if
(
moveInfo
!=
null
)
{
logtype
=
DeviceID
*
10000
+
(
int
)
moveInfo
.
MoveStep
;
}
if
(
String
.
IsNullOrEmpty
(
msg
).
Equals
(
false
))
{
{
if
(
WarnMsg
.
Equals
(
msg
))
int
logtype
=
801
;
if
(
moveInfo
!=
null
)
{
{
if
(
msg
.
StartsWith
(
Name
))
logtype
=
DeviceID
*
10000
+
(
int
)
moveInfo
.
MoveStep
;
}
if
(
String
.
IsNullOrEmpty
(
msg
).
Equals
(
false
))
{
if
(
WarnMsg
.
Equals
(
msg
)
||
warnParam
.
AlarmType
.
Equals
(
alarmType
))
{
{
LogUtil
.
error
(
msg
,
logtype
,
logseconds
);
if
(
msg
.
StartsWith
(
Name
))
{
LogUtil
.
error
(
msg
,
logtype
,
logseconds
);
}
else
{
LogUtil
.
error
(
Name
+
msg
,
logtype
,
logseconds
);
}
}
}
else
else
{
{
LogUtil
.
error
(
Name
+
msg
,
logtype
,
logseconds
);
if
(
msg
.
StartsWith
(
Name
))
{
LogUtil
.
error
(
msg
);
}
else
{
LogUtil
.
error
(
Name
+
msg
);
}
}
}
}
}
else
if
(!
warnParam
.
AlarmType
.
Equals
(
alarmType
))
{
{
if
(
msg
.
StartsWith
(
Name
))
//报警类型不一致,若之前不是空,记录日志
if
(!
String
.
IsNullOrEmpty
(
warnParam
.
AlarmType
))
{
RunLogUtil
.
ErrorLog
(
new
ErrorLog
(
Name
,
warnParam
.
AlarmType
,
WarnMsg
,
warnParam
.
StartTime
,
DateTime
.
Now
,
warnParam
.
OperteType
,
warnParam
.
PosId
,
warnParam
.
Barcode
));
}
//更新开始时间
warnParam
.
StartTime
=
DateTime
.
Now
;
if
(
moveInfo
!=
null
)
{
{
LogUtil
.
error
(
msg
);
warnParam
.
PosId
=
moveInfo
.
MoveParam
?.
PosId
;
warnParam
.
Barcode
=
moveInfo
.
MoveParam
?.
WareCode
;
warnParam
.
OperteType
=
moveInfo
.
GetMoveType
();
}
}
else
else
{
{
LogUtil
.
error
(
Name
+
msg
);
warnParam
.
PosId
=
""
;
warnParam
.
Barcode
=
""
;
warnParam
.
OperteType
=
""
;
}
}
}
}
}
}
catch
(
Exception
ex
)
if
(!
warnParam
.
AlarmType
.
Equals
(
alarmType
))
{
{
//报警类型不一致,若之前不是空,记录日志
LogUtil
.
error
(
"SetWarnMsg Error: "
+
ex
.
ToString
());
if
(!
String
.
IsNullOrEmpty
(
warnParam
.
AlarmType
))
{
RunLogUtil
.
ErrorLog
(
new
ErrorLog
(
Name
,
warnParam
.
AlarmType
,
WarnMsg
,
warnParam
.
StartTime
,
DateTime
.
Now
,
warnParam
.
OperteType
,
warnParam
.
PosId
,
warnParam
.
Barcode
));
}
//更新开始时间
warnParam
.
StartTime
=
DateTime
.
Now
;
if
(
moveInfo
!=
null
)
{
warnParam
.
PosId
=
moveInfo
.
MoveParam
?.
PosId
;
warnParam
.
Barcode
=
moveInfo
.
MoveParam
?.
WareCode
;
warnParam
.
OperteType
=
moveInfo
.
GetMoveType
();
}
else
{
warnParam
.
PosId
=
""
;
warnParam
.
Barcode
=
""
;
warnParam
.
OperteType
=
""
;
}
}
}
WarnMsg
=
msg
;
WarnMsg
=
msg
;
warnParam
.
AlarmType
=
alarmType
;
warnParam
.
AlarmType
=
alarmType
;
}
}
protected
void
MoveTimeoutAlarm
(
LineMoveInfo
move
,
string
alarmType
)
protected
void
MoveTimeoutAlarm
(
LineMoveInfo
move
,
string
alarmType
)
{
{
SetWarnMsg
(
move
.
Name
+
"["
+
move
.
GetMoveType
()
+
"]["
+
move
.
SLog
+
"] "
+
alarmType
+
" ["
+
FormUtil
.
GetSpanStr
(
move
.
StepSpan
())
+
"]"
,
alarmType
,
move
);
try
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
{
SetWarnMsg
(
move
.
Name
+
"["
+
move
.
GetMoveType
()
+
"]["
+
move
.
SLog
+
"] "
+
alarmType
+
" ["
+
FormUtil
.
GetSpanStr
(
move
.
StepSpan
())
+
"]"
,
alarmType
,
move
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
catch
(
Exception
ex
)
{
}
}
}
protected
void
ClearTimeoutAlarm
(
string
msg
)
protected
void
ClearTimeoutAlarm
(
string
msg
)
{
{
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
9211d90
...
@@ -1017,7 +1017,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1017,7 +1017,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 紧急出料移栽:等待夹爪有料
/// 紧急出料移栽:等待夹爪有料
/// </summary>
/// </summary>
[
Description
(
"出料_取料完成_
上料横移机构上升
"
)]
[
Description
(
"出料_取料完成_
等待夹爪有料
"
)]
FO_217_ClampCheck
,
FO_217_ClampCheck
,
/// <summary>
/// <summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论