Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c7401629
由
LN
编写于
2021-07-01 10:50:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
盘点料逻辑修改。增加jison日志
1 个父辈
e835dfd3
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
426 行增加
和
65 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/Program.cs
source/Common/Common.csproj
source/Common/util/RunLogUtil.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1_SLStation.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/ALineManager.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/model/KTK_Store.cs
source/DeviceLibrary/model/LineMoveInfo.cs
source/DeviceLibrary/model/StoreStep.cs
source/AssemblyLineClient/App.config
查看文件 @
c740162
...
...
@@ -96,6 +96,16 @@
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
appender
name
=
"RunLog"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/log/RunLog-line.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
" %m%n"
/>
</
layout
>
</
appender
>
<
logger
name
=
"RollingLogFileAppender"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
...
...
@@ -108,6 +118,10 @@
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"AIOBOX"
/>
</
logger
>
<
logger
name
=
"RunLog"
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RunLog"
/>
</
logger
>
<!--<
root
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
...
...
source/AssemblyLineClient/Program.cs
查看文件 @
c740162
...
...
@@ -54,7 +54,7 @@ namespace OnlineStore.AssemblyLine
[
STAThread
]
static
void
Main
(
string
[]
Args
)
{
//string code = " (X: 380,Y: 148) L00000000000WG9D19055;E20191230 0180;B7H.10618.5B1008082019123004000;R0080820191230E9600";
//string r = CodeManager.ReplaceCode(code);
Application
.
SetUnhandledExceptionMode
(
UnhandledExceptionMode
.
CatchException
);
...
...
source/Common/Common.csproj
查看文件 @
c740162
...
...
@@ -65,6 +65,7 @@
<Compile Include="util\NetTCPServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="util\RunLogUtil.cs" />
<Compile Include="util\TcpClient.cs" />
<Compile Include="util\TcpServer.cs" />
<Compile Include="util\UdpServer.cs" />
...
...
source/Common/util/RunLogUtil.cs
0 → 100644
查看文件 @
c740162
using
log4net
;
using
Newtonsoft.Json
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Runtime.Serialization
;
using
System.Text
;
namespace
OnlineStore.Common
{
public
class
RunLogUtil
{
public
static
readonly
ILog
RunLog
=
LogManager
.
GetLogger
(
"RunLog"
);
public
static
void
ErrorLog
(
ErrorLog
log
)
{
string
jsonStr
=
JsonHelper
.
SerializeObject
(
log
);
RunLog
.
Error
(
jsonStr
);
}
public
static
void
MoveLog
(
MoveLog
log
)
{
//if (log == null || (!log.IsValid()))
//{
// return;
//}
//string jsonStr = JsonHelper.SerializeObject(log);
//RunLog.Info(jsonStr);
}
public
static
void
MoveEndLog
(
MoveEndLog
log
)
{
if
(
log
==
null
||
(!
log
.
IsValid
()))
{
return
;
}
string
jsonStr
=
JsonHelper
.
SerializeObject
(
log
);
RunLog
.
Info
(
jsonStr
);
}
public
static
void
AxisLog
(
AxisMoveLog
log
)
{
string
jsonStr
=
JsonHelper
.
SerializeObject
(
log
);
RunLog
.
Error
(
jsonStr
);
}
}
public
class
BaseLog
{
[
JsonProperty
(
Order
=
0
)]
public
string
Name
{
get
;
set
;
}
=
"三楼环形线"
;
[
JsonProperty
(
Order
=
1
)]
public
string
DeviceName
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
2
)]
public
string
LogType
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
3
)]
public
string
StartTime
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
4
)]
public
string
EndTime
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
5
)]
public
string
timeSpan
{
get
;
set
;
}
=
""
;
}
public
class
ErrorLog
:
BaseLog
{
public
ErrorLog
()
{
this
.
LogType
=
"Error"
;
}
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
=
""
;
}
if
(
errType
==
null
)
{
errType
=
""
;
}
if
(
errMsg
==
null
)
{
errMsg
=
""
;
}
this
.
LogType
=
"Error"
;
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
ErrorType
=
errType
.
Trim
();
this
.
ErrorMsg
=
errMsg
.
Trim
();
this
.
StartTime
=
startTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
EndTime
=
endTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
OperateType
=
operType
.
Trim
();
this
.
PosId
=
posid
.
Trim
();
this
.
Barcode
=
barcode
.
Trim
();
TimeSpan
span
=
endTime
-
startTime
;
this
.
timeSpan
=
(
Math
.
Round
(
span
.
TotalMinutes
,
2
)).
ToString
();
//两位小数的分钟
}
public
bool
IsValid
()
{
if
(
string
.
IsNullOrEmpty
(
DeviceName
)
||
String
.
IsNullOrEmpty
(
LogType
)
||
string
.
IsNullOrEmpty
(
ErrorType
)
||
string
.
IsNullOrEmpty
(
ErrorMsg
))
{
return
false
;
}
return
true
;
}
[
JsonProperty
(
Order
=
11
)]
public
string
ErrorType
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
12
)]
public
string
ErrorMsg
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
13
)]
public
string
OperateType
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
14
)]
public
string
PosId
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
15
)]
public
string
Barcode
{
get
;
set
;
}
=
""
;
}
public
class
MoveLog
:
BaseLog
{
public
MoveLog
()
{
this
.
LogType
=
"Running"
;
}
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
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
this
.
MoveMsg
=
moveMsg
.
Trim
();
this
.
StartTime
=
startTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
EndTime
=
endTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
PosId
=
posid
.
Trim
();
this
.
Barcode
=
barcode
.
Trim
();
TimeSpan
span
=
endTime
-
startTime
;
this
.
timeSpan
=
(
Math
.
Round
(
span
.
TotalMinutes
,
2
)).
ToString
();
//两位小数的分钟
}
public
bool
IsValid
()
{
if
(
string
.
IsNullOrEmpty
(
DeviceName
)
||
String
.
IsNullOrEmpty
(
LogType
)
||
string
.
IsNullOrEmpty
(
MoveType
)
||
string
.
IsNullOrEmpty
(
MoveMsg
))
{
return
false
;
}
return
true
;
}
[
JsonProperty
(
Order
=
11
)]
public
string
MoveType
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
12
)]
public
string
MoveMsg
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
13
)]
public
string
PosId
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
14
)]
public
string
Barcode
{
get
;
set
;
}
=
""
;
}
public
class
MoveEndLog
:
BaseLog
{
public
MoveEndLog
()
{
this
.
LogType
=
"InoutEnd"
;
}
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
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
this
.
StartTime
=
startTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
EndTime
=
endTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
PosId
=
posid
.
Trim
();
this
.
Barcode
=
barcode
.
Trim
();
TimeSpan
span
=
endTime
-
startTime
;
this
.
timeSpan
=
(
Math
.
Round
(
span
.
TotalMinutes
,
2
)).
ToString
();
//两位小数的分钟
}
public
bool
IsValid
()
{
if
(
string
.
IsNullOrEmpty
(
DeviceName
)
||
string
.
IsNullOrEmpty
(
MoveType
))
{
return
false
;
}
return
true
;
}
[
JsonProperty
(
Order
=
11
)]
public
string
MoveType
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
12
)]
public
string
PosId
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
13
)]
public
string
Barcode
{
get
;
set
;
}
=
""
;
}
public
class
AxisMoveLog
:
BaseLog
{
public
AxisMoveLog
()
{
this
.
LogType
=
"Axis"
;
}
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
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
this
.
AxisName
=
axisName
;
this
.
TargetPos
=
targetP
;
this
.
StartTime
=
startTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
EndTime
=
endTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
this
.
PosId
=
posid
.
Trim
();
this
.
Barcode
=
barcode
.
Trim
();
TimeSpan
span
=
endTime
-
startTime
;
this
.
timeSpan
=
(
Math
.
Round
(
span
.
TotalMinutes
,
2
)).
ToString
();
//两位小数的分钟
this
.
Speed
=
speed
;
}
public
bool
IsValid
()
{
if
(
string
.
IsNullOrEmpty
(
DeviceName
)
||
string
.
IsNullOrEmpty
(
MoveType
))
{
return
false
;
}
return
true
;
}
[
JsonProperty
(
Order
=
11
)]
public
string
AxisName
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
12
)]
public
string
MoveType
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
13
)]
public
int
TargetPos
{
get
;
set
;
}
=
0
;
[
JsonProperty
(
Order
=
14
)]
public
int
Speed
{
get
;
set
;
}
[
JsonProperty
(
Order
=
15
)]
public
string
PosId
{
get
;
set
;
}
=
""
;
[
JsonProperty
(
Order
=
16
)]
public
string
Barcode
{
get
;
set
;
}
=
""
;
}
}
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
c740162
...
...
@@ -182,26 +182,26 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
Name
+
" BusyMoveProcess 出错:"
+
ex
.
ToString
());
}
}
protected
void
MoveTimeOut
(
LineMoveInfo
move
,
string
msg
)
{
WarnMsg
=
move
.
Name
+
"["
+
move
.
MoveStep
+
"] "
+
msg
+
" ["
+
FormUtil
.
GetSpanStr
(
move
.
StepSpan
())
+
"]"
;
int
logId
=
DeviceID
*
10000
+
(
int
)
move
.
MoveStep
;
LogUtil
.
error
(
WarnMsg
,
logId
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
protected
void
ClearTimeoutAlarm
(
string
msg
)
{
if
(
isInSuddenDown
||
isNoAirCheck
)
{
return
;
}
if
(
WarnMsg
.
Contains
(
msg
)
&&
alarmType
.
Equals
(
LineAlarmType
.
IoSingleTimeOut
))
{
LogUtil
.
info
(
Name
+
"清理信号超时报警【"
+
WarnMsg
+
"】 "
);
alarmType
=
LineAlarmType
.
None
;
SetWarnMsg
(
""
);
}
}
//
protected void MoveTimeOut(LineMoveInfo move, string msg)
//
{
//
WarnMsg = move.Name + "[" + move.MoveStep + "] "+ msg + " [" +FormUtil.GetSpanStr( move.StepSpan()) + "]";
//
int logId = DeviceID * 10000 + (int)move.MoveStep;
//
LogUtil.error(WarnMsg, logId);
//
Alarm(LineAlarmType.IoSingleTimeOut);
//
}
//
protected void ClearTimeoutAlarm(string msg)
//
{
//
if (isInSuddenDown || isNoAirCheck)
//
{
//
return;
//
}
//
if (WarnMsg.Contains(msg) && alarmType.Equals(LineAlarmType.IoSingleTimeOut))
//
{
//
LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 ");
//
alarmType = LineAlarmType.None;
//
SetWarnMsg("");
//
}
//
}
protected
bool
CanStartRun
()
{
string
canResult
=
LineManager
.
Line
.
CanStart
();
...
...
@@ -384,7 +384,7 @@ namespace OnlineStore.DeviceLibrary
{
return
true
;
}
SetWarnMsg
(
Name
+
msg
);
SetWarnMsg
(
Name
+
msg
,
axis
.
Config
.
DisplayStr
+
"_轴报警"
);
Alarm
(
LineAlarmType
.
AxisAlarm
);
return
false
;
}
...
...
@@ -423,8 +423,9 @@ namespace OnlineStore.DeviceLibrary
if
(
alarmIo
==
1
)
{
WarnMsg
=
Name
+
" 运动轴"
+
axisInfo
.
Config
.
Explain
+
"报警"
;
LogUtil
.
error
(
WarnMsg
);
string
msg
=
Name
+
" 运动轴"
+
axisInfo
.
Config
.
Explain
+
"报警"
;
//LogUtil.error(WarnMsg);
SetWarnMsg
(
msg
,
axisInfo
.
Config
.
Explain
+
"轴报警"
);
Alarm
(
LineAlarmType
.
AxisAlarm
);
isInAlarm
=
true
;
}
...
...
@@ -476,16 +477,25 @@ namespace OnlineStore.DeviceLibrary
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
AxisBean
.
HomeMoveIsEnd
(
moveInfo
,
wait
.
AxisInfo
,
out
msg
);
if
(
wait
.
IsEnd
)
{
RunLogUtil
.
AxisLog
(
new
AxisMoveLog
(
Name
,
wait
.
AxisInfo
.
Explain
,
"回原点"
,
0
,
wait
.
AxisInfo
.
HomeHighSpeed
,
moveInfo
.
LastSetpTime
,
DateTime
.
Now
,
moveInfo
.
MoveParam
.
PosId
,
moveInfo
.
MoveParam
.
WareCode
));
}
}
else
{
wait
.
IsEnd
=
AxisBean
.
ACAxisMoveIsEnd
(
moveInfo
,
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
if
(
wait
.
IsEnd
)
{
RunLogUtil
.
AxisLog
(
new
AxisMoveLog
(
Name
,
wait
.
AxisInfo
.
Explain
,
"绝对运动"
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
moveInfo
.
LastSetpTime
,
DateTime
.
Now
,
moveInfo
.
MoveParam
.
PosId
,
moveInfo
.
MoveParam
.
WareCode
));
}
}
if
(!
msg
.
Equals
(
""
))
{
isOk
=
false
;
WarnMsg
=
Name
+
msg
;
string
type
=
moveInfo
.
GetStepDes
()
+
"_轴运动报警"
;
// WarnMsg = Name + msg;
SetWarnMsg
(
msg
,
type
,
moveInfo
);
Alarm
(
LineAlarmType
.
AxisMoveError
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
AxisMoveError
);
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
14
);
...
...
@@ -510,8 +520,8 @@ namespace OnlineStore.DeviceLibrary
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
alarmType
<=
LineAlarmType
.
IoSingleTimeOut
)
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒"
;
string
warnmsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒"
;
SetWarnMsg
(
warnmsg
,
moveInfo
.
GetStepDes
()
+
"_超时报警"
,
moveInfo
);
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
13
);
if
(
NoAlarm
())
{
...
...
@@ -592,10 +602,11 @@ namespace OnlineStore.DeviceLibrary
if
(
isOk
)
{
moveInfo
.
EndStepWait
();
ClearStepAlarm
(
moveInfo
.
GetStepDes
());
}
else
if
(
span
.
TotalSeconds
>
moveInfo
.
TimeOutSeconds
)
{
WarnM
sg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
string
m
sg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
"超时["
+
FormUtil
.
GetSpanStr
(
span
)+
"]"
;
int
second
=
10
;
if
(
IsLowAlarm
(
moveInfo
))
...
...
@@ -610,7 +621,9 @@ namespace OnlineStore.DeviceLibrary
{
second
=
10
;
}
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
15
,
second
);
string
type
=
moveInfo
.
GetStepDes
()
+
"_"
+
"超时报警"
;
//LogUtil.error(WarnMsg, DeviceID * 1000 + 15, second);
SetWarnMsg
(
msg
,
type
,
moveInfo
,
second
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
IoSingleTimeOut
);
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
c740162
...
...
@@ -352,12 +352,12 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
MoveTime
Out
(
MoveInfo
,
"启用抓料超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"启用抓料超时"
);
}
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
MoveTime
Out
(
MoveInfo
,
"扫码结束超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"扫码结束超时"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FI_21_CylinderTake
))
...
...
@@ -504,7 +504,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
(
120
))
{
MoveTime
Out
(
MoveInfo
,
"获取库位号超时 "
+
getPosIdMsg
);
MoveTime
outAlarm
(
MoveInfo
,
"获取库位号超时 "
+
getPosIdMsg
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FI_32_WaitTray
))
//TODO
...
...
@@ -527,7 +527,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
(
180
))
{
MoveTime
Out
(
MoveInfo
,
"等待空托盘到达超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待空托盘到达超时"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
FI_33_CylinderDown
))
...
...
@@ -971,7 +971,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
MoveTime
Out
(
MoveInfo
,
"预扫码结束超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"预扫码结束超时"
);
}
}
else
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
查看文件 @
c740162
...
...
@@ -802,7 +802,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
MoveTime
Out
(
MoveInfo
,
"等待给服务器发送afterPut完成超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待给服务器发送afterPut完成超时"
);
}
}
}
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
查看文件 @
c740162
...
...
@@ -544,7 +544,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
())
{
MoveTime
Out
(
MoveInfo
,
"等待"
+
hyout
.
Name
+
"可以横移超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待"
+
hyout
.
Name
+
"可以横移超时"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
HY13_WaitHY2Ready
))
...
...
@@ -562,7 +562,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
())
{
MoveTime
Out
(
MoveInfo
,
"等待"
+
hyout
.
Name
+
"顶升上升完成超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待"
+
hyout
.
Name
+
"顶升上升完成超时"
);
}
...
...
@@ -584,7 +584,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
())
{
MoveTime
Out
(
MoveInfo
,
"等待托盘到达"
+
hyout
.
Name
+
"超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待托盘到达"
+
hyout
.
Name
+
"超时"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
HY16_WatOutFixture2
))
...
...
@@ -603,7 +603,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
())
{
MoveTime
Out
(
MoveInfo
,
"等待托盘到达"
+
hyout
.
Name
+
""
);
MoveTime
outAlarm
(
MoveInfo
,
"等待托盘到达"
+
hyout
.
Name
+
""
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
HY17_TopDown
))
...
...
@@ -955,8 +955,23 @@ namespace OnlineStore.DeviceLibrary
if
(!
instoreId
.
Contains
(
storeId
))
{
return
true
;
}
}
}
else
if
(
tray
.
InOrOutStore
.
Equals
(
2
)
&&
tray
.
InoutPar
.
urgentReel
)
{
pandianliao
++;
if
(
pandianliao
>=
2
)
{
bool
needhy
=
SServerManager
.
canReelToBelt
(
Name
,
tray
.
InoutPar
.
WareCode
,
false
);
if
(
needhy
)
{
LogUtil
.
info
(
Name
+
"盘点料["
+
pandianliao
+
"]:需要横移 "
+
tray
.
InoutPar
.
ToShortStr
());
pandianliao
=
0
;
return
true
;
}
pandianliao
=
0
;
}
}
}
}
...
...
@@ -997,7 +1012,7 @@ namespace OnlineStore.DeviceLibrary
}
return
false
;
}
private
int
pandianliao
=
0
;
private
int
PreIsToOutCount
=
0
;
private
bool
TrayNeedToOutLine
(
int
trayNum
)
{
...
...
source/DeviceLibrary/assemblyLine/HY/HY_C1_SLStation.cs
查看文件 @
c740162
...
...
@@ -364,13 +364,13 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
(
30
))
{
MoveTime
Out
(
MoveInfo
,
"等待"
+
feed
.
Name
+
"开始出库超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待"
+
feed
.
Name
+
"开始出库超时"
);
//如果当前无料串,或者料串已离开,直接放行 托盘
TrayCanLeave
();
}
else
if
(
MoveInfo
.
IsTimeOut
(
20
))
{
MoveTime
Out
(
MoveInfo
,
"等待"
+
feed
.
Name
+
"开始出库超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待"
+
feed
.
Name
+
"开始出库超时"
);
}
}
else
...
...
@@ -414,7 +414,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
())
{
MoveTime
Out
(
MoveInfo
,
"等待"
+
hyOut
.
Name
+
"可以横移超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待"
+
hyOut
.
Name
+
"可以横移超时"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
HY13_WaitHY2Ready
))
...
...
@@ -431,7 +431,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
())
{
MoveTime
Out
(
MoveInfo
,
"等待"
+
hyOut
+
"顶升上升完成超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待"
+
hyOut
+
"顶升上升完成超时"
);
}
}
...
...
@@ -456,7 +456,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
())
{
MoveTime
Out
(
MoveInfo
,
"等待托盘到达"
+
hyOut
.
Name
+
""
);
MoveTime
outAlarm
(
MoveInfo
,
"等待托盘到达"
+
hyOut
.
Name
+
""
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
HY17_TopDown
))
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
c740162
...
...
@@ -611,7 +611,7 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
SetWarnMsg
(
"收到急停信号,报警急停"
);
SetWarnMsg
(
"收到急停信号,报警急停"
,
"急停报警"
);
Alarm
(
LineAlarmType
.
SuddenStop
);
}
}
...
...
@@ -902,9 +902,10 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
span
.
TotalSeconds
>
120
)
{
WarnM
sg
=
Name
+
"["
+
MoveInfo
.
MoveStep
+
"]["
+
msg
+
"]已等待["
+
FormUtil
.
GetSpanStr
(
span
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
903
);
string
warnm
sg
=
Name
+
"["
+
MoveInfo
.
MoveStep
+
"]["
+
msg
+
"]已等待["
+
FormUtil
.
GetSpanStr
(
span
)
+
"]秒"
;
//
LogUtil.error(WarnMsg, 903);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
MoveTimeoutAlarm
(
MoveInfo
,
msg
);
}
}
}
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
c740162
...
...
@@ -104,9 +104,10 @@ namespace OnlineStore.DeviceLibrary
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
NoAlarm
())
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
checkWaitInfo
.
Name
+
"["
+
checkWaitInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
" 超时"
;
string
warnMsg
=
checkWaitInfo
.
Name
+
"["
+
checkWaitInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
" 超时"
;
SetWarnMsg
(
warnMsg
,
checkWaitInfo
.
GetStepDes
()
+
"_超时报警"
,
checkWaitInfo
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
LogUtil
.
error
(
WarnMsg
,
901
);
//
LogUtil.error(WarnMsg, 901);
}
//超过报警时长
else
if
(
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
LineManager
.
Config
.
IOSingle_TimerOut
*
2
)
...
...
@@ -177,11 +178,13 @@ namespace OnlineStore.DeviceLibrary
if
(
isOk
)
{
checkWaitInfo
.
EndStepWait
();
ClearStepAlarm
(
checkWaitInfo
.
GetStepDes
());
}
else
if
(
span
.
TotalSeconds
>
checkWaitInfo
.
TimeOutSeconds
)
{
WarnMsg
=
checkWaitInfo
.
Name
+
"["
+
checkWaitInfo
.
MoveStep
+
"]["
+
NotOkMsg
+
"]已等待["
+
FormUtil
.
GetSpanStr
(
span
)
+
"] "
;
LogUtil
.
error
(
WarnMsg
,
900
);
string
warnMsg
=
checkWaitInfo
.
Name
+
"["
+
checkWaitInfo
.
MoveStep
+
"]["
+
NotOkMsg
+
"]已等待["
+
FormUtil
.
GetSpanStr
(
span
)
+
"] "
;
SetWarnMsg
(
warnMsg
,
checkWaitInfo
.
GetStepDes
()
+
"_超时报警"
,
checkWaitInfo
);
//LogUtil.error(WarnMsg, 900);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
c740162
...
...
@@ -255,7 +255,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
IsTimeOut
(
180
))
{
MoveTime
Out
(
MoveInfo
,
"等待空托盘到达超时"
);
MoveTime
outAlarm
(
MoveInfo
,
"等待空托盘到达超时"
);
return
false
;
}
return
false
;
...
...
@@ -464,8 +464,9 @@ namespace OnlineStore.DeviceLibrary
if
(
sendCount
>=
3
)
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
" 等待BOX开始入库超时 已发送"
+
sendCount
+
"次"
;
LogUtil
.
error
(
WarnMsg
);
SetWarnMsg
(
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
" 等待BOX开始入库超时 已发送"
+
sendCount
+
"次"
,
"等待BOX开始入库超时"
);
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] " + " 等待BOX开始入库超时 已发送" + sendCount + "次";
//LogUtil.error(WarnMsg);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
...
...
@@ -1003,9 +1004,10 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
IsTimeOut
(
120
))
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
SLog
+
"]等待HY8空闲["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
12
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
MoveTimeoutAlarm
(
SecondMoveInfo
,
"等待HY8空闲超时"
);
//WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待HY8空闲[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
//LogUtil.error(WarnMsg, DeviceID * 1000 + 12);
//Alarm(LineAlarmType.IoSingleTimeOut);
}
}
...
...
source/DeviceLibrary/assemblymanager/ALineManager.cs
查看文件 @
c740162
...
...
@@ -34,7 +34,8 @@ namespace OnlineStore.DeviceLibrary
public
LineManager
()
{
}
public
static
bool
CheckEnum
(
Type
type
)
public
static
Dictionary
<
string
,
string
>
StepDesMap
=
new
Dictionary
<
string
,
string
>();
public
static
bool
CheckEnum
(
Type
type
,
bool
isStep
=
false
)
{
if
(
type
.
IsEnum
)
{
...
...
@@ -49,6 +50,13 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
valueList
.
Add
(
item
);
if
(
isStep
)
{
LineMoveStep
en
=
(
LineMoveStep
)
item
;
string
des
=
EnumDesHelper
.
GetStepDes
(
en
);
StepDesMap
.
Add
(
en
.
ToString
(),
des
);
}
}
}
return
true
;
...
...
@@ -68,7 +76,7 @@ namespace OnlineStore.DeviceLibrary
{
IsConnectServer
=
true
;
}
if
(!
CheckEnum
(
typeof
(
LineMoveStep
)))
if
(!
CheckEnum
(
typeof
(
LineMoveStep
)
,
true
))
{
return
false
;
}
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
c740162
...
...
@@ -637,13 +637,13 @@ namespace OnlineStore.DeviceLibrary
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
debug
(
$
"{deviceName }canReelToBelt {FormUtil.GetSpanStr(DateTime.Now - startTime) } 【{ server }】【{resultStr }】"
);
//{ "code":0,"msg":"ok","data":true}
ReturnData
data
=
JsonHelper
.
DeserializeJsonToObject
<
ReturnData
>(
resultStr
);
if
(
data
!=
null
)
{
bool
result
=
Convert
.
ToBoolean
(
data
.
data
);
if
(
data
.
code
.
Equals
(
0
)
&&
(!
result
)
)
if
(
data
.
code
.
Equals
(
0
))
{
return
result
;
}
...
...
source/DeviceLibrary/model/KTK_Store.cs
查看文件 @
c740162
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/model/LineMoveInfo.cs
查看文件 @
c740162
...
...
@@ -34,6 +34,8 @@ namespace OnlineStore.DeviceLibrary
public
int
MoveNum
{
get
;
set
;
}
public
DateTime
MoveStartTime
{
get
;
set
;
}
public
DateTime
LastSetpTime
{
get
;
set
;
}
/// <summary>
...
...
@@ -106,6 +108,7 @@ namespace OnlineStore.DeviceLibrary
}
public
void
NextMoveStep
(
LineMoveStep
step
)
{
StepMoveLog
();
PreMoveStep
=
moveStep
;
moveStep
=
step
;
LastSetpTime
=
DateTime
.
Now
;
...
...
@@ -131,7 +134,8 @@ namespace OnlineStore.DeviceLibrary
LastSetpTime
=
DateTime
.
Now
;
WaitList
=
new
List
<
WaitResultInfo
>();
WriteIoList
=
new
List
<
WriteIOInfo
>();
MoveNum
++;
MoveNum
++;
MoveStartTime
=
DateTime
.
Now
;
}
public
void
NewMove
(
LineMoveType
type
,
InOutParam
param
)
{
...
...
@@ -141,9 +145,11 @@ namespace OnlineStore.DeviceLibrary
LastSetpTime
=
DateTime
.
Now
;
WaitList
=
new
List
<
WaitResultInfo
>();
WriteIoList
=
new
List
<
WriteIOInfo
>();
MoveStartTime
=
DateTime
.
Now
;
}
public
void
EndMove
()
{
StepMoveLog
();
this
.
moveType
=
LineMoveType
.
None
;
this
.
MoveParam
=
null
;
moveStep
=
LineMoveStep
.
Wait
;
...
...
@@ -174,6 +180,64 @@ namespace OnlineStore.DeviceLibrary
string
str
=
$
"[{MoveType}][{MoveStep}]{ MoveParam?.ToStr()}"
;
return
str
;
}
public
string
GetStepDes
()
{
string
currName
=
moveStep
.
ToString
();
try
{
if
(
LineManager
.
StepDesMap
.
ContainsKey
(
currName
))
{
string
v
=
LineManager
.
StepDesMap
[
currName
];
if
(
String
.
IsNullOrEmpty
(
v
))
{
return
currName
;
}
else
{
return
v
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"GetStepDes 出错:"
+
ex
.
ToString
());
}
return
currName
;
}
public
string
GetMoveType
()
{
switch
(
moveType
)
{
case
LineMoveType
.
Fixture
:
return
"托盘处理"
;
break
;
case
LineMoveType
.
InStore
:
return
"入料"
;
break
;
case
LineMoveType
.
OutStore
:
return
"出料"
;
break
;
case
LineMoveType
.
Reset
:
return
"复位"
;
break
;
case
LineMoveType
.
RHome
:
return
"回原"
;
break
;
}
return
""
;
}
private
void
StepMoveLog
()
{
try
{
RunLogUtil
.
MoveLog
(
new
MoveLog
(
Name
,
GetMoveType
(),
GetStepDes
(),
LastSetpTime
,
DateTime
.
Now
,
MoveParam
.
PosId
,
MoveParam
.
WareCode
));
}
catch
(
Exception
ex
)
{
}
}
}
public
class
WriteIOInfo
{
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
c740162
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论