Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 528b3ae2
由
张东亮
编写于
2020-06-23 10:47:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
盘点-20ms刷新盘点IO
1 个父辈
cf88750c
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
41 行增加
和
56 行删除
source/ACSingleStore/FrmStoreBox.Designer.cs
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Inventory.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/store/KTK_Store.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
528b3ae
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
528b3ae
...
...
@@ -143,7 +143,7 @@ namespace OnlineStore.DeviceLibrary
try
{
UpdateAllDI
(
box
.
IP
,
sta
);
//
LogUtil.info("ReadAllDI [" + box.IP + "]:" + string.Join(" ", sta));
//LogUtil.info("ReadAllDI [" + box.IP + "]:" + string.Join(" ", sta));
}
catch
(
Exception
ex
)
{
...
...
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
查看文件 @
528b3ae
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
528b3ae
...
...
@@ -44,6 +44,7 @@ namespace OnlineStore.DeviceLibrary
//public ScanSocket scanSocket = new ScanSocket();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
readDITimer
=
new
System
.
Timers
.
Timer
();
public
AC_SA_BoxBean
(
AC_SA_Config
config
)
{
Init
();
...
...
@@ -58,6 +59,12 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer
.
Enabled
=
false
;
IoCheckTimer
.
Elapsed
+=
IoCheckTimer_Elapsed
;
readDITimer
=
new
System
.
Timers
.
Timer
();
readDITimer
.
Interval
=
20
;
readDITimer
.
AutoReset
=
true
;
readDITimer
.
Enabled
=
false
;
readDITimer
.
Elapsed
+=
ReadDITimer_Elapsed
;
//添加调试
IsDebug
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
IsInDebug
).
Equals
(
1
);
...
...
@@ -128,6 +135,13 @@ namespace OnlineStore.DeviceLibrary
}
private
void
ReadDITimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SC_03_MoveToHBag
)&&
IOManager
.
IOValue
(
IO_Type
.
CheckPos
).
Equals
(
IO_VALUE
.
HIGH
))
{
reelIsExist
=
true
;
}
}
/// <summary>
/// 配置速度,加减速时间
/// </summary>
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Inventory.cs
查看文件 @
528b3ae
...
...
@@ -10,13 +10,11 @@ namespace OnlineStore.DeviceLibrary
{
public
partial
class
AC_SA_BoxBean
{
//进出轴到P1
//InOutBackToP1(StoreMove.MoveParam.MoveP.InOut_P1);
bool
reelIsExist
=
false
;
protected
override
void
InventoryProcess
()
{
LineMoveP
moveP
=
StoreMove
.
MoveParam
.
MoveP
;
bool
IsExist
=
false
;
if
(
StoreMove
.
IsInWait
)
{
CheckWait
();
...
...
@@ -31,7 +29,6 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P3
,
Config
.
MiddleAxis_P2_Speed
);
int
outCount
=
ACServerManager
.
GetActualtPosition
(
Config
.
UpDown_Axis
.
DeviceName
,
Config
.
UpDown_Axis
.
GetAxisValue
());
int
disCount
=
Math
.
Abs
(
outCount
-
moveP
.
UpDown_P5
);
//CheckPositionLog("升降轴当前位置与目标位置距离为(高低速距离阈值为150000)" + disCount.ToString());
if
(
disCount
>
150000
)
{
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P5
,
Config
.
UpDownAxis_P5_Speed
);
...
...
@@ -48,48 +45,36 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SC_03_MoveToHBag
);
CheckPositionLog
(
" 升降轴到库位高点P9, UpDownAxis_P9_Speed="
+
Config
.
UpDownAxis_P9_Speed
.
ToString
());
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P9
,
Config
.
UpDownAxis_P9_Speed
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
CheckPos
,
IO_VALUE
.
HIGH
));
StoreMove
.
OneWaitCanEndStep
=
true
;
//
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.CheckPos, IO_VALUE.HIGH));
//
StoreMove.OneWaitCanEndStep = true;
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SC_03_MoveToHBag
)
{
ACServerManager
.
SuddenStop
(
Config
.
UpDown_Axis
.
DeviceName
,
Config
.
UpDown_Axis
.
GetAxisValue
());
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SC_04_Inventory
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
int
outCount
=
ACServerManager
.
GetActualtPosition
(
Config
.
UpDown_Axis
);
int
errorCount
=
Math
.
Abs
(
outCount
-
moveP
.
UpDown_P9
);
CheckPositionLog
(
" 升降轴到目标位置, 当前位置="
+
ACServerManager
.
GetActualtPosition
(
Config
.
UpDown_Axis
)
+
" 目标位置="
+
ACServerManager
.
GetTargetPosition
(
Config
.
UpDown_Axis
.
DeviceName
,
Config
.
UpDown_Axis
.
GetAxisValue
()));
//ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
if
(
errorCount
<=
Config
.
UpDown_Axis
.
CanErrorCountMax
)
{
CheckPositionLog
(
" 升降轴到目标位置停止, 当前位置="
+
ACServerManager
.
GetActualtPosition
(
Config
.
UpDown_Axis
));
}
else
{
CheckPositionLog
(
" 升降轴未到目标停止, 当前位置="
+
ACServerManager
.
GetActualtPosition
(
Config
.
UpDown_Axis
));
}
// if (ACAxisMoveIsEnd(Config.UpDown_Axis, moveP.UpDown_P9,Config.UpDownAxis_P9_Speed, out string msg))
//int outCount = ACServerManager.GetActualtPosition(Config.UpDown_Axis);
//int errorCount = Math.Abs(outCount - moveP.UpDown_P9);
//if (errorCount <= Config.UpDown_Axis.CanErrorCountMax)
//{
// CheckPositionLog(" 升降轴到目标位置, 当前位置=" + ACServerManager.GetActualtPosition(Config.UpDown_Axis)+" 目标位置="+ moveP.UpDown_P9 + " errorCount="+ errorCount);
//}
//else
//{
// //IsExist = true;
// //IsExist = IOManager.IOValue(IO_Type.CheckPos).Equals(IO_VALUE.HIGH);
// CheckPositionLog(" 升降轴运动过程中检测到料盘, 当前位置=" + ACServerManager.GetActualtPosition(Config.UpDown_Axis) + " 目标位置=" + moveP.UpDown_P9 + " errorCount=" + errorCount+ " Config.UpDown_Axis.CanErrorCountMax=" + Config.UpDown_Axis.CanErrorCountMax);
//}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SC_04_Inventory
)
{
IsExist
=
IOManager
.
IOValue
(
IO_Type
.
CheckPos
).
Equals
(
IO_VALUE
.
HIGH
);
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"cid"
,
CID
);
//cid = 料仓CID
paramMap
.
Add
(
"pos"
,
StoreMove
.
MoveParam
.
PosInfo
.
PosId
);
// 库位
paramMap
.
Add
(
"hasReel"
,
IsExist
.
ToString
());
// 是否有料
paramMap
.
Add
(
"hasReel"
,
reel
IsExist
.
ToString
());
// 是否有料
string
server
=
StoreManager
.
GetAddr
(
StoreManager
.
Addr_posReelCheck
,
paramMap
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
CheckPositionLog
(
"盘点仓位: [CID="
+
CID
+
"] ["
+
StoreMove
.
MoveParam
.
PosInfo
.
PosId
+
"] [IO_Type.CheckPos="
+
IsExist
.
ToString
()
+
"] [resultStr="
+
resultStr
+
"]"
);
CheckPositionLog
(
"盘点仓位: [CID="
+
CID
+
"] ["
+
StoreMove
.
MoveParam
.
PosInfo
.
PosId
+
"] [IO_Type.reelIsExist="
+
reelIsExist
.
ToString
()
+
"] [resultStr="
+
resultStr
+
"]"
);
reelIsExist
=
false
;
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SC_04_Inventory
)
{
StoreMove
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
//设备连接,盘点后,BOX恢复原始状态
...
...
@@ -107,11 +92,10 @@ namespace OnlineStore.DeviceLibrary
{
try
{
CurrInOutCount
++;
CurrInOutACount
++;
//是否自动状态
if
(!
autoNext
)
{
readDITimer
.
Enabled
=
false
;
return
;
}
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
CheckPosition
))
...
...
@@ -127,6 +111,7 @@ namespace OnlineStore.DeviceLibrary
else
{
autoNext
=
false
;
readDITimer
.
Enabled
=
false
;
autoMsg
=
"自动盘点结束!"
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
"下一个索引不存在,自动盘点结束!"
);
//回待机位
...
...
@@ -138,27 +123,10 @@ namespace OnlineStore.DeviceLibrary
autoPositionIndex
=
newIndex
;
string
posid
=
PositionNumList
[
autoPositionIndex
];
InOutPosInfo
inoutinfo
=
new
InOutPosInfo
(
autoInoutCode
,
posid
);
//判断是否需要重置
if
(
CurrInOutACount
>=
Config
.
Box_ResetACount
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个仓位:posid="
+
posid
+
",当时已经盘点"
+
CurrInOutACount
+
"次,需要重置BOX"
);
//,先把盘点信息存入排队列表中
Reset
(
false
);
autoMsg
=
"自动盘点:"
+
posid
;
AddWaitOutInfo
(
inoutinfo
);
}
else
if
(
CurrInOutCount
>=
Config
.
Box_ResetMCount
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个仓位:posid="
+
posid
+
",当时已经出盘点"
+
CurrInOutCount
+
"次,需要重置BOX旋转轴"
);
//ResetMiddleAxis(false);
autoMsg
=
"自动盘点:"
+
posid
;
AddWaitOutInfo
(
inoutinfo
);
}
else
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个仓位:posid="
+
posid
);
autoMsg
=
"自动盘点:"
+
posid
;
StartInventoryMove
(
new
InOutParam
(
inoutinfo
));
}
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个仓位:posid="
+
posid
);
autoMsg
=
"自动盘点:"
+
posid
;
StartInventoryMove
(
new
InOutParam
(
inoutinfo
));
}
}
}
...
...
@@ -174,6 +142,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
void
StartInventoryMove
(
InOutParam
param
)
{
readDITimer
.
Enabled
=
true
;
startInStoreTime
=
DateTime
.
Now
;
string
posId
=
param
!=
null
?
param
.
PosInfo
.
PosId
:
""
;
if
(
storeRunStatus
==
StoreRunStatus
.
Runing
)
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
528b3ae
...
...
@@ -159,7 +159,6 @@ namespace OnlineStore.DeviceLibrary
else
{
wait
.
IsEnd
=
ACAxisMoveIsEnd
(
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
}
if
(!
msg
.
Equals
(
""
))
{
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
528b3ae
...
...
@@ -470,6 +470,9 @@ namespace OnlineStore.DeviceLibrary
case
StoreStatus
.
OutStoreFaild
:
aa
=
"出库失败("
+
WarnMsg
+
")"
;
break
;
case
StoreStatus
.
CheckPosMove
:
aa
=
"盘点中"
;
break
;
}
if
(!
aa
.
Equals
(
""
))
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论