Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0522a86d
由
几米阳光
编写于
2018-12-19 11:27:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改日志打印
1 个父辈
f1e41247
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
245 行增加
和
137 行删除
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/store/KTK_Store.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
0522a86
...
@@ -105,152 +105,259 @@ namespace OnlineStore.DeviceLibrary
...
@@ -105,152 +105,259 @@ namespace OnlineStore.DeviceLibrary
List
<
WaitResultInfo
>
list
=
StoreMove
.
WaitList
;
List
<
WaitResultInfo
>
list
=
StoreMove
.
WaitList
;
//当等待超过一分钟时,需要打印提示
//当等待超过一分钟时,需要打印提示
TimeSpan
span
=
DateTime
.
Now
-
StoreMove
.
LastSetpTime
;
TimeSpan
span
=
DateTime
.
Now
-
StoreMove
.
LastSetpTime
;
if
(
span
.
TotalMinutes
>
5
)
string
NotOkMsg
=
""
;
if
(
list
.
Count
<=
0
)
{
{
WarnMsg
=
StoreName
+
"等待超时【"
+
StoreMove
.
MoveType
+
"】【"
+
StoreMove
.
MoveStep
+
"】已等待【"
+
Math
.
Round
(
span
.
TotalMinutes
)
+
"】分钟,"
;
StoreMove
.
EndStepWait
()
;
foreach
(
WaitResultInfo
wait
in
list
)
return
;
{
}
WarnMsg
=
WarnMsg
+
"\r\n"
+
wait
.
ToStr
()
;
bool
isOk
=
true
;
}
if
(
StoreMove
.
OneWaitCanEndStep
)
LogUtil
.
error
(
LOGGER
,
WarnMsg
,
12
);
{
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
)
;
isOk
=
false
;
}
}
if
(
list
.
Count
>
0
)
foreach
(
WaitResultInfo
wait
in
list
)
{
{
bool
isOk
=
true
;
if
(
wait
.
IsEnd
)
foreach
(
WaitResultInfo
wait
in
list
)
{
{
if
(
wait
.
WaitType
==
1
)
continue
;
{
}
string
msg
=
""
;
NotOkMsg
=
wait
.
ToStr
();
if
(
wait
.
IsHomeMove
)
if
(
wait
.
WaitType
==
1
)
{
{
if
(
wait
.
IsEnd
.
Equals
(
false
)
&&
(!
ACHomeMoveIsEnd
(
wait
.
AxisInfo
,
out
msg
)))
string
msg
=
""
;
{
if
(
wait
.
IsHomeMove
)
if
(!
msg
.
Equals
(
""
))
{
{
wait
.
IsEnd
=
ACHomeMoveIsEnd
(
wait
.
AxisInfo
,
out
msg
);
WarnMsg
=
msg
;
}
Alarm
(
StoreAlarmType
.
AxisMoveError
,
GetAlarmCodeByAxis
(
wait
.
AxisInfo
).
ToString
(),
WarnMsg
,
StoreMove
.
MoveType
);
else
}
{
isOk
=
false
;
wait
.
IsEnd
=
ACAxisMoveIsEnd
(
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
break
;
}
}
if
(!
msg
.
Equals
(
""
))
else
{
{
isOk
=
false
;
wait
.
IsEnd
=
true
;
WarnMsg
=
msg
;
}
Alarm
(
StoreAlarmType
.
AxisMoveError
,
GetAlarmCodeByAxis
(
wait
.
AxisInfo
).
ToString
(),
WarnMsg
,
StoreMove
.
MoveType
);
}
break
;
else
}
{
}
if
(!
wait
.
IsEnd
)
else
if
(
wait
.
WaitType
==
2
)
{
{
bool
isEnd
=
ACAxisMoveIsEnd
(
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
wait
.
IsEnd
=
KNDIOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(!
msg
.
Equals
(
""
))
int
timeOutMs
=
Config
.
IOSingle_TimerOut
;
{
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
)
isOk
=
false
;
{
WarnMsg
=
msg
;
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
Alarm
(
StoreAlarmType
.
AxisMoveError
,
GetAlarmCodeByAxis
(
wait
.
AxisInfo
).
ToString
(),
WarnMsg
,
StoreMove
.
MoveType
);
WarnMsg
=
StoreName
+
" 等待信号"
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
"超时!"
;
break
;
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
StoreMove
.
MoveType
);
}
LogUtil
.
error
(
LOGGER
,
StoreName
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
14
);
else
if
(!
isEnd
)
isOk
=
false
;
{
break
;
isOk
=
false
;
}
break
;
}
}
else
if
(
wait
.
WaitType
==
3
)
else
{
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
wait
.
IsEnd
=
true
;
}
}
else
{
}
}
}
else
if
(
wait
.
WaitType
==
2
)
{
if
(!
KNDIOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
))
{
//一分钟还未检测到
if
(
span
.
TotalMilliseconds
>
Config
.
IOSingle_TimerOut
)
{
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
StoreName
+
" 等待信号"
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
"超时!"
;
//SendAlarmCode(StoreID, LineAlarm.IoNotOk, wait.IoType);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
StoreMove
.
MoveType
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
14
);
}
isOk
=
false
;
if
(
StoreMove
.
OneWaitCanEndStep
.
Equals
(
false
))
{
break
;
}
}
else
if
(
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
if
(
wait
.
WaitType
==
3
)
{
if
(
span
.
TotalMilliseconds
<
wait
.
TimeMSeconds
)
{
isOk
=
false
;
if
(
StoreMove
.
OneWaitCanEndStep
.
Equals
(
false
))
{
break
;
}
}
else
if
(
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
if
(
wait
.
WaitType
==
5
)
{
if
(
wait
.
IsHomeMove
)
{
if
(!
ShuoKeControls
.
IsHomeMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
))
{
ShuoKeControls
.
GetStatus
(
wait
.
SlvAddr
);
isOk
=
false
;
break
;
}
else
if
(
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
{
if
(!
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
))
{
ShuoKeControls
.
GetStatus
(
wait
.
SlvAddr
);
isOk
=
false
;
break
;
}
else
if
(
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
}
}
}
if
(
isOk
)
else
if
(
wait
.
WaitType
==
5
)
{
{
StoreMove
.
EndStepWait
();
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
ShuoKeControls
.
IsHomeMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
);
}
else
{
wait
.
IsEnd
=
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
);
}
if
(!
wait
.
IsEnd
)
{
ShuoKeControls
.
GetStatus
(
wait
.
SlvAddr
);
}
}
if
(
wait
.
IsEnd
)
{
if
(
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
{
if
(!
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
}
}
else
if
(
isOk
)
{
{
StoreMove
.
EndStepWait
();
StoreMove
.
EndStepWait
();
}
}
else
if
(
span
.
TotalSeconds
>
120
)
{
WarnMsg
=
StoreName
+
"【"
+
StoreMove
.
MoveType
+
"】【"
+
StoreMove
.
MoveStep
+
"】等待超时 ["
+
NotOkMsg
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
LOGGER
,
WarnMsg
);
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
}
}
}
//private void CheckWait()
//{
// List<WaitResultInfo> list = StoreMove.WaitList;
// //当等待超过一分钟时,需要打印提示
// TimeSpan span = DateTime.Now - StoreMove.LastSetpTime;
// if (span.TotalMinutes > 5)
// {
// WarnMsg = StoreName + "等待超时【" + StoreMove.MoveType + "】【" + StoreMove.MoveStep + "】已等待【" + Math.Round(span.TotalMinutes) + "】分钟,";
// foreach (WaitResultInfo wait in list)
// {
// WarnMsg = WarnMsg + "\r\n" + wait.ToStr();
// }
// LogUtil.error(LOGGER, WarnMsg, 12);
// Alarm(StoreAlarmType.IoSingleTimeOut, "", WarnMsg, StoreMove.MoveType);
// }
// if (list.Count > 0)
// {
// bool isOk = true;
// foreach (WaitResultInfo wait in list)
// {
// if (wait.WaitType == 1)
// {
// string msg = "";
// if (wait.IsHomeMove)
// {
// if (wait.IsEnd.Equals(false) && (!ACHomeMoveIsEnd(wait.AxisInfo, out msg)))
// {
// if (!msg.Equals(""))
// {
// WarnMsg = msg;
// Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
// }
// isOk = false;
// break;
// }
// else
// {
// wait.IsEnd = true;
// }
// }
// else
// {
// if (!wait.IsEnd)
// {
// bool isEnd = ACAxisMoveIsEnd(wait.AxisInfo, wait.TargetPosition, wait.TargetSpeed, out msg);
// if (!msg.Equals(""))
// {
// isOk = false;
// WarnMsg = msg;
// Alarm(StoreAlarmType.AxisMoveError, GetAlarmCodeByAxis(wait.AxisInfo).ToString(), WarnMsg, StoreMove.MoveType);
// break;
// }
// else if (!isEnd)
// {
// isOk = false;
// break;
// }
// else
// {
// wait.IsEnd = true;
// }
// }
// else
// {
// }
// }
// }
// else if (wait.WaitType == 2)
// {
// if (!KNDIOValue(wait.IoType).Equals(wait.IoValue))
// {
// //一分钟还未检测到
// if (span.TotalMilliseconds > Config.IOSingle_TimerOut)
// {
// ConfigIO io = Config.getWaitIO(wait.IoType);
// WarnMsg = StoreName + " 等待信号" + io.DisplayStr + "=" + wait.IoValue + "超时!";
// //SendAlarmCode(StoreID, LineAlarm.IoNotOk, wait.IoType);
// Alarm(StoreAlarmType.IoSingleTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
// LogUtil.error(LOGGER, StoreName + wait.IoType + "等待信号(" + io.DisplayStr + "=" + wait.IoValue + ") 超时", 14);
// }
// isOk = false;
// if (StoreMove.OneWaitCanEndStep.Equals(false))
// {
// break;
// }
// }
// else if (StoreMove.OneWaitCanEndStep)
// {
// isOk = true;
// break;
// }
// }
// else if (wait.WaitType == 3)
// {
// if (span.TotalMilliseconds < wait.TimeMSeconds)
// {
// isOk = false;
// if (StoreMove.OneWaitCanEndStep.Equals(false))
// {
// break;
// }
// }
// else if (StoreMove.OneWaitCanEndStep)
// {
// isOk = true;
// break;
// }
// }
// else if (wait.WaitType == 5)
// {
// if (wait.IsHomeMove)
// {
// if (!ShuoKeControls.IsHomeMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime))
// {
// ShuoKeControls.GetStatus(wait.SlvAddr);
// isOk = false;
// break;
// }
// else if (StoreMove.OneWaitCanEndStep)
// {
// isOk = true; break;
// }
// }
// else
// {
// if (!ShuoKeControls.IsMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime))
// {
// ShuoKeControls.GetStatus(wait.SlvAddr);
// isOk = false;
// break;
// }
// else if (StoreMove.OneWaitCanEndStep)
// {
// isOk = true; break;
// }
// }
// }
// }
// if (isOk)
// {
// StoreMove.EndStepWait();
// }
// }
// else
// {
// StoreMove.EndStepWait();
// }
//}
#
endregion
#
endregion
#
region
入库
#
region
入库
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
0522a86
...
@@ -263,8 +263,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -263,8 +263,8 @@ namespace OnlineStore.DeviceLibrary
{
{
moveAxis
.
TargetPosition
=
targetPosition
;
moveAxis
.
TargetPosition
=
targetPosition
;
AddAxisMoveTime
(
moveAxis
);
AddAxisMoveTime
(
moveAxis
);
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
moveAxis
,
targetPosition
,
targetSpeed
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
moveAxis
,
targetPosition
,
targetSpeed
));
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
}
}
/// <summary>
/// <summary>
...
...
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
0522a86
...
@@ -234,11 +234,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -234,11 +234,11 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
IsHomeMove
)
if
(
IsHomeMove
)
{
{
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】原点返回"
;
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】原点返回"
;
}
}
else
else
{
{
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】绝对运动
,目标位置
【"
+
TargetPosition
+
"】"
;
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】绝对运动【"
+
TargetPosition
+
"】"
;
}
}
}
}
else
if
(
WaitType
==
2
)
else
if
(
WaitType
==
2
)
...
@@ -259,8 +259,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -259,8 +259,9 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
WaitType
==
6
)
else
if
(
WaitType
==
6
)
{
{
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】ORG信号:【"
+
IoValue
+
"】 "
;
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】ORG信号:【"
+
IoValue
+
"】 "
;
}
}
else
{
{
return
"Wait位置类型:WaitType=【"
+
WaitType
+
"】"
;
return
"Wait位置类型:WaitType=【"
+
WaitType
+
"】"
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论