Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c0ea1ea8
由
几米阳光
编写于
2018-12-27 18:49:52 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加与服务器通信模块
1 个父辈
97edbb72
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
314 行增加
和
157 行删除
source/ACSingleStore/FrmIOStatus.cs
source/ACSingleStore/FrmStoreBox.cs
source/Common/bean/Bean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/ACSingleStore/FrmIOStatus.cs
查看文件 @
c0ea1ea
...
@@ -299,7 +299,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -299,7 +299,7 @@ namespace OnlineStore.AutoInOutStore
private
void
btnDOpen_Click
(
object
sender
,
EventArgs
e
)
private
void
btnDOpen_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
AutomaticBaiting
.
CanOpenBatchDoor
())
if
(
AutomaticBaiting
.
CanOpenBatchDoor
()
||
StoreManager
.
Store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
)
)
{
{
AutomaticBaiting
.
BatchDoorOpen
(
false
);
AutomaticBaiting
.
BatchDoorOpen
(
false
);
}
}
...
...
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
c0ea1ea
...
@@ -179,10 +179,9 @@ namespace OnlineStore.AutoInOutStore
...
@@ -179,10 +179,9 @@ namespace OnlineStore.AutoInOutStore
return
;
return
;
}
}
BatchInoutStatus
();
BatchInoutStatus
();
//HumitureServer.RandomData(store.Config.GetTempAddrList());
lblTemp
.
Text
=
store
.
currTempStr
;
lblTemp
.
Text
=
store
.
currTempStr
;
//验证运动是否完成
//CheckWait();
//忙碌状态不读取状态
//忙碌状态不读取状态
if
(!
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Busy
))
if
(!
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Busy
))
{
{
...
@@ -296,76 +295,32 @@ namespace OnlineStore.AutoInOutStore
...
@@ -296,76 +295,32 @@ namespace OnlineStore.AutoInOutStore
private
void
BatchInoutStatus
()
private
void
BatchInoutStatus
()
{
{
if
(
AutomaticBaiting
.
IsWaitTragGo
&&
(
AutomaticBaiting
.
IsGetTrayGo
.
Equals
(
false
)))
Dictionary
<
string
,
string
>
map
=
AutomaticBaiting
.
GetBtnStatus
();
btnWaitTrgGo
.
Visible
=
map
[
ParamDefine
.
confirmReelOut
].
Equals
(
ParamDefine
.
enable
);
lblWaitTragGo
.
Visible
=
map
[
ParamDefine
.
confirmReelOut
].
Equals
(
ParamDefine
.
enable
);
btnOpenDoor
.
Enabled
=
map
[
ParamDefine
.
openLock
].
Equals
(
ParamDefine
.
enable
);
btnBatchInStore
.
Enabled
=
map
[
ParamDefine
.
startBatchIn
].
Equals
(
ParamDefine
.
enable
);
btnGetOutTray
.
Enabled
=
map
[
ParamDefine
.
takeOutReel
].
Equals
(
ParamDefine
.
enable
);
btnCloseDoor
.
Enabled
=
map
[
ParamDefine
.
closeLock
].
Equals
(
ParamDefine
.
enable
);
if
(
AutomaticBaiting
.
DoorStatus
.
Equals
(
2
))
{
{
btnWaitTrgGo
.
Visible
=
true
;
lblDoorStatus
.
Text
=
"仓门状态:关闭"
;
lblWaitTragGo
.
Visible
=
true
;
btnBatchInStore
.
Enabled
=
false
;
btnBatchInStore
.
Enabled
=
false
;
btnOpenDoor
.
Enabled
=
false
;
btnCloseDoor
.
Enabled
=
false
;
}
}
else
else
{
{
btnWaitTrgGo
.
Visible
=
false
;
lblDoorStatus
.
Text
=
"仓门状态:打开"
;
lblWaitTragGo
.
Visible
=
false
;
if
(
AutomaticBaiting
.
DoorStatus
.
Equals
(
2
))
{
lblDoorStatus
.
Text
=
"仓门状态:关闭"
;
UpdateFormDoorStats
(
false
);
}
else
{
lblDoorStatus
.
Text
=
"仓门状态:打开"
;
UpdateFormDoorStats
(
true
);
}
}
}
lblOutInfo
.
Visible
=
!
lblWaitTragGo
.
Visible
;
lblOutInfo
.
Visible
=
!
lblWaitTragGo
.
Visible
;
lblOutInfo
.
Text
=
"批量出入库信息: 入库:"
+
AutomaticBaiting
.
BatchInStoreCount
+
"盘共"
+
AutomaticBaiting
.
BatchInStoreHeight
+
"mm,"
+
lblOutInfo
.
Text
=
"批量出入库信息: 入库:"
+
AutomaticBaiting
.
BatchInStoreCount
+
"盘共"
+
AutomaticBaiting
.
BatchInStoreHeight
+
"mm,"
+
"出库: "
+
AutomaticBaiting
.
BatchOutStoreCount
+
"盘共"
+
AutomaticBaiting
.
BatchOutStoreHeight
+
"mm"
;
"出库: "
+
AutomaticBaiting
.
BatchOutStoreCount
+
"盘共"
+
AutomaticBaiting
.
BatchOutStoreHeight
+
"mm"
;
if
(
HumitureController
.
IsRun
)
{
btnSelTemp
.
Enabled
=
true
;
btnTempClose
.
Enabled
=
true
;
btnTempInit
.
Enabled
=
false
;
}
else
{
btnSelTemp
.
Enabled
=
false
;
btnTempClose
.
Enabled
=
false
;
btnTempInit
.
Enabled
=
true
;
}
}
private
void
UpdateFormDoorStats
(
bool
dooIsOpen
)
{
btnCloseDoor
.
Enabled
=
dooIsOpen
;
bool
isRun
=
HumitureController
.
IsRun
;
btnBatchInStore
.
Enabled
=
dooIsOpen
;
btnSelTemp
.
Enabled
=
isRun
;
if
(
dooIsOpen
.
Equals
(
false
))
btnTempClose
.
Enabled
=
isRun
;
{
btnTempInit
.
Enabled
=
!
isRun
;
if
(
AutomaticBaiting
.
BatchOutStoreCount
>
0
)
{
btnGetOutTray
.
Enabled
=
true
;
btnOpenDoor
.
Enabled
=
false
;
}
else
{
btnGetOutTray
.
Enabled
=
false
;
btnOpenDoor
.
Enabled
=
true
;
}
}
else
{
btnOpenDoor
.
Enabled
=
!
dooIsOpen
;
btnGetOutTray
.
Enabled
=
!
dooIsOpen
;
}
btnBatchReset
.
Enabled
=
!
dooIsOpen
;
}
}
private
void
ReadPosistion
()
private
void
ReadPosistion
()
{
{
string
portName
=
GetPortName
();
string
portName
=
GetPortName
();
...
@@ -1569,9 +1524,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1569,9 +1524,7 @@ namespace OnlineStore.AutoInOutStore
DialogResult
result
=
MessageBox
.
Show
(
"已经将料盘手动拿出?"
,
"确认提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
DialogResult
result
=
MessageBox
.
Show
(
"已经将料盘手动拿出?"
,
"确认提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
{
LogUtil
.
info
(
"已确认料盘已手动拿出"
);
AutomaticBaiting
.
doConfirmReelGo
();
AutomaticBaiting
.
IsWaitTragGo
=
false
;
AutomaticBaiting
.
IsGetTrayGo
=
true
;
}
}
}
}
...
@@ -1585,62 +1538,81 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1585,62 +1538,81 @@ namespace OnlineStore.AutoInOutStore
}
}
private
void
BtnOpenDoor_Click
(
object
sender
,
EventArgs
e
)
private
void
BtnOpenDoor_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
AutomaticBaiting
.
CanOpenBatchDoor
())
//if (AutomaticBaiting.CanOpenBatchDoor())
{
//{
AutomaticBaiting
.
BatchDoorOpen
(
false
);
// AutomaticBaiting.BatchDoorOpen(false);
AutomaticBaiting
.
IsNeedStartInout
=
false
;
// AutomaticBaiting.IsNeedStartInout = false;
}
//}
else
//else
//{
// MessageBox.Show("忙碌中,无法打开门锁");
//}
string
msg
=
AutomaticBaiting
.
doOpenDoor
();
if
(!
msg
.
Equals
(
""
))
{
{
MessageBox
.
Show
(
"忙碌中,无法打开门锁"
);
MessageBox
.
Show
(
msg
);
}
}
}
}
private
void
btnBatchInStore_Click
(
object
sender
,
EventArgs
e
)
private
void
btnBatchInStore_Click
(
object
sender
,
EventArgs
e
)
{
{
string
msg
=
AutomaticBaiting
.
doStartBatchIn
();
if
(!
AutomaticBaiting
.
DoorIsClose
(
))
if
(!
msg
.
Equals
(
""
))
{
{
MessageBox
.
Show
(
"请先关闭门锁"
);
MessageBox
.
Show
(
msg
);
return
;
}
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
MessageBox
.
Show
(
"叉子料盘检测有料,请检查后再入库"
);
return
;
}
}
//if (!AutomaticBaiting.DoorIsClose())
//{
// MessageBox.Show("请先关闭门锁");
// return;
//}
//if (KND.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
//{
// MessageBox.Show("叉子料盘检测有料,请检查后再入库");
// return;
//}
AutomaticBaiting
.
BatchDoorClose
(
false
);
//
AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting
.
Reset
(
true
);
//
AutomaticBaiting.Reset(true);
}
}
private
void
btnStartBatchInStore_Click
(
object
sender
,
EventArgs
e
)
private
void
btnStartBatchInStore_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(!
AutomaticBaiting
.
DoorIsClose
())
string
msg
=
AutomaticBaiting
.
doCloseDoor
();
if
(!
msg
.
Equals
(
""
))
{
{
MessageBox
.
Show
(
"请先关闭门锁"
);
MessageBox
.
Show
(
msg
);
return
;
}
}
AutomaticBaiting
.
BatchDoorClose
(
false
);
//if (!AutomaticBaiting.DoorIsClose())
AutomaticBaiting
.
Reset
(
false
);
//{
// MessageBox.Show("请先关闭门锁");
// return;
//}
//AutomaticBaiting.BatchDoorClose(false);
//AutomaticBaiting.Reset(false);
}
}
private
void
btnGetOutTray_Click
(
object
sender
,
EventArgs
e
)
private
void
btnGetOutTray_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
AutomaticBaiting
.
CanOpenBatchDoor
())
string
msg
=
AutomaticBaiting
.
doTakeReel
();
{
if
(!
msg
.
Equals
(
""
))
if
(
AutomaticBaiting
.
BatchOutStoreCount
>
0
&&
AutomaticBaiting
.
BatchOutStoreHeight
>
0
)
{
AutomaticBaiting
.
BatchDoorOpen
(
false
);
}
else
{
MessageBox
.
Show
(
"未出库,无料盘可取"
);
}
}
else
{
{
MessageBox
.
Show
(
"忙碌中,无法打开门锁"
);
MessageBox
.
Show
(
msg
);
}
}
//if (AutomaticBaiting.CanOpenBatchDoor())
//{
// if (AutomaticBaiting.BatchOutStoreCount > 0 && AutomaticBaiting.BatchOutStoreHeight > 0)
// {
// AutomaticBaiting.BatchDoorOpen(false);
// }
// else
// {
// MessageBox.Show("未出库,无料盘可取");
// }
//}
//else
//{
// MessageBox.Show("忙碌中,无法打开门锁");
//}
}
}
private
void
btnBatchOutEnd_Click
(
object
sender
,
EventArgs
e
)
private
void
btnBatchOutEnd_Click
(
object
sender
,
EventArgs
e
)
...
...
source/Common/bean/Bean.cs
查看文件 @
c0ea1ea
...
@@ -204,5 +204,31 @@ namespace OnlineStore.Common
...
@@ -204,5 +204,31 @@ namespace OnlineStore.Common
/// 是否是单个出库,true表示单个出库,其他都是批量出库
/// 是否是单个出库,true表示单个出库,其他都是批量出库
/// </summary>
/// </summary>
public
static
string
singleOut
=
"singleOut"
;
public
static
string
singleOut
=
"singleOut"
;
/// <summary>
/// 打开门锁动作
/// </summary>
public
static
string
openLock
=
"openLock"
;
/// <summary>
/// 批量出入库动作
/// </summary>
public
static
string
startBatchIn
=
"startBatchIn"
;
/// <summary>
/// 关闭门锁
/// </summary>
public
static
string
closeLock
=
"closeLock"
;
/// <summary>
/// 取出出库料盘动作
/// </summary>
public
static
string
takeOutReel
=
"takeOutReel"
;
/// <summary>
/// 门口料盘已取出
/// </summary>
public
static
string
confirmReelOut
=
"confirmReelOut"
;
public
static
string
doit
=
"doit"
;
public
static
string
enable
=
"enable"
;
public
static
string
disable
=
"disable"
;
}
}
}
}
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
c0ea1ea
...
@@ -188,16 +188,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -188,16 +188,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
StoreName
+
"打开驱动器串口失败,启动失败!"
);
LogUtil
.
info
(
StoreName
+
"打开驱动器串口失败,启动失败!"
);
return
false
;
return
false
;
}
}
}
}
//if (UseBatchInout)
string
canStart
=
AutomaticBaiting
.
CanStart
();
//{
if
(!
canStart
.
Equals
(
""
))
string
canStart
=
AutomaticBaiting
.
CanStart
();
{
if
(!
canStart
.
Equals
(
""
))
LogUtil
.
info
(
StoreName
+
canStart
);
{
return
false
;
LogUtil
.
info
(
StoreName
+
canStart
);
}
return
false
;
}
//}
autoNext
=
false
;
autoNext
=
false
;
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
alarmType
=
StoreAlarmType
.
None
;
alarmType
=
StoreAlarmType
.
None
;
...
@@ -214,11 +211,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -214,11 +211,9 @@ namespace OnlineStore.DeviceLibrary
if
(!
RunAxis
(
true
))
if
(!
RunAxis
(
true
))
{
{
return
false
;
return
false
;
}
}
//if (UseBatchInout)
AutomaticBaiting
.
Reset
(
false
);
{
AutomaticBaiting
.
Reset
(
false
);
}
//TODO 启动时先所有轴远点返回,测试暂时关闭
//TODO 启动时先所有轴远点返回,测试暂时关闭
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
HumitureController
.
Init
(
Config
.
Humiture_Port
);
HumitureController
.
Init
(
Config
.
Humiture_Port
);
...
@@ -1505,6 +1500,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1505,6 +1500,7 @@ namespace OnlineStore.DeviceLibrary
{
{
lineOperation
.
alarmList
.
Add
(
alarmInfo
);
lineOperation
.
alarmList
.
Add
(
alarmInfo
);
}
}
lineOperation
.
data
=
AutomaticBaiting
.
GetBtnStatus
();
return
lineOperation
;
return
lineOperation
;
}
}
...
@@ -1538,12 +1534,68 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1538,12 +1534,68 @@ namespace OnlineStore.DeviceLibrary
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
//发送状态信息到服务器
//发送状态信息到服务器
if
(
resultOperation
==
null
||
(
resultOperation
.
op
!=
2
)
)
if
(
resultOperation
==
null
)
{
{
//判断服务端是否返回出库操作
//判断服务端是否返回出库操作
return
;
return
;
}
}
if
(
resultOperation
.
op
.
Equals
(
2
))
{
doOutStore
(
resultOperation
);
}
else
if
(
resultOperation
.
data
!=
null
)
{
string
result
=
""
;
Dictionary
<
string
,
string
>
dataMap
=
resultOperation
.
data
;
//string reviceData = "";
//foreach(string key in dataMap.Keys)
//{
// reviceData += "["+key+"="+dataMap[key]+"]";
//}
//if (ConfigAppSettings.GetIntValue(Setting_Init.Server_Log_Open).Equals(1))
//{
// LogUtil.info(StoreName + "收到服务器Data:"+ reviceData);
//}
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
openLock
)
&&
dataMap
[
ParamDefine
.
openLock
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:openLock=doit"
);
result
=
AutomaticBaiting
.
doOpenDoor
();
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
startBatchIn
)
&&
dataMap
[
ParamDefine
.
startBatchIn
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:startBatchIn=doit"
);
result
=
AutomaticBaiting
.
doStartBatchIn
();
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
takeOutReel
)
&&
dataMap
[
ParamDefine
.
takeOutReel
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:takeOutReel=doit"
);
result
=
AutomaticBaiting
.
doTakeReel
();
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
closeLock
)
&&
dataMap
[
ParamDefine
.
closeLock
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:closeLock=doit"
);
result
=
AutomaticBaiting
.
doCloseDoor
();
}
else
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
confirmReelOut
)
&&
dataMap
[
ParamDefine
.
confirmReelOut
].
Equals
(
ParamDefine
.
doit
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:confirmReelOut=doit"
);
AutomaticBaiting
.
doConfirmReelGo
();
}
if
(!
result
.
Equals
(
""
))
{
LogUtil
.
info
(
StoreName
+
"收到服务器命令:doit执行失败:"
+
result
);
CodeOrInoutMsg
=
result
;
}
}
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
100
)
{
LogUtil
.
info
(
StoreName
+
"SendLineStatus 共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒"
);
}
}
private
void
doOutStore
(
Operation
resultOperation
)
{
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
...
@@ -1553,7 +1605,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1553,7 +1605,7 @@ namespace OnlineStore.DeviceLibrary
string
plateHStr
=
data
[
ParamDefine
.
plateH
];
string
plateHStr
=
data
[
ParamDefine
.
plateH
];
string
singleOut
=
data
[
ParamDefine
.
singleOut
];
string
singleOut
=
data
[
ParamDefine
.
singleOut
];
LogUtil
.
info
(
LOGGER
,
"收到服务器出库消息:poaIs="
+
posIdStr
+
",platew="
+
plateWStr
+
",plateh="
+
plateHStr
+
",singleOut="
+
singleOut
);
LogUtil
.
info
(
LOGGER
,
"收到服务器出库消息:poaIs="
+
posIdStr
+
",platew="
+
plateWStr
+
",plateh="
+
plateHStr
+
",singleOut="
+
singleOut
);
char
splitChar
=
'|'
;
char
splitChar
=
'|'
;
string
[]
posIdArray
=
posIdStr
.
Split
(
splitChar
);
string
[]
posIdArray
=
posIdStr
.
Split
(
splitChar
);
string
[]
plateWArray
=
plateWStr
.
Split
(
splitChar
);
string
[]
plateWArray
=
plateWStr
.
Split
(
splitChar
);
...
@@ -1563,45 +1615,46 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1563,45 +1615,46 @@ namespace OnlineStore.DeviceLibrary
foreach
(
string
posId
in
posIdArray
)
foreach
(
string
posId
in
posIdArray
)
{
{
index
++;
index
++;
string
plateW
=
plateWArray
[
index
];
try
string
plateH
=
plateHArray
[
index
];
bool
isSingleOut
=
singleOutArray
[
index
].
ToLower
().
Equals
(
"true"
);
string
[]
posArray
=
posId
.
Split
(
'#'
);
if
(
posArray
.
Length
!=
2
)
{
{
WarnMsg
=
StoreName
+
"出库格式错误:库位号【"
+
posId
+
"】"
;
int
plateW
=
Convert
.
ToInt32
(
plateWArray
[
index
]);
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:库位号【"
+
posId
+
"】格式错误"
);
int
plateH
=
Convert
.
ToInt32
(
plateHArray
[
index
]);
continue
;
bool
isSingleOut
=
singleOutArray
[
index
].
ToLower
().
Equals
(
"true"
);
}
string
[]
posArray
=
posId
.
Split
(
'#'
);
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
if
(
posArray
.
Length
!=
2
)
{
WarnMsg
=
StoreName
+
"出库格式错误:库位号【"
+
posId
+
"】"
;
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:库位号【"
+
posId
+
"】格式错误"
);
continue
;
}
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
//根据发送的posId获取位置列表
//根据发送的posId获取位置列表
AutoStorePosition
position
=
CSVPositionReader
<
AutoStorePosition
>.
GetPositon
(
posId
);
AutoStorePosition
position
=
CSVPositionReader
<
AutoStorePosition
>.
GetPositon
(
posId
);
if
(
position
==
null
)
if
(
position
==
null
)
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg
=
StoreName
+
"出库未找库位:【"
+
posId
+
"】"
;
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:未找到【"
+
posId
+
"】的库位信息"
);
continue
;
}
else
{
if
(
CanStarInOut
())
{
{
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
),
!
isSingleOut
);
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg
=
StoreName
+
"出库未找库位:【"
+
posId
+
"】"
;
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:未找到【"
+
posId
+
"】的库位信息"
);
continue
;
}
}
else
else
{
{
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:出库【"
+
posId
+
"】失败,当前在忙碌中"
);
if
(
CanStarInOut
())
{
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
plateH
,
plateW
),
!
isSingleOut
);
}
else
{
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:出库【"
+
posId
+
"】失败,当前在忙碌中"
);
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
StoreName
+
"解析服务发送的出库【"
+
posId
+
"】出错"
+
ex
.
StackTrace
);
}
}
}
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
10
)
{
LogUtil
.
info
(
StoreName
+
"执行TimerProcess 共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒"
);
}
}
}
}
}
}
#
endregion
#
endregion
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
c0ea1ea
...
@@ -132,7 +132,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -132,7 +132,7 @@ namespace OnlineStore.DeviceLibrary
StoreManager
.
Store
.
alarmType
.
Equals
(
StoreAlarmType
.
BatchAxisAlarm
)
||
StoreManager
.
Store
.
alarmType
.
Equals
(
StoreAlarmType
.
BatchIoTimeOut
))
StoreManager
.
Store
.
alarmType
.
Equals
(
StoreAlarmType
.
BatchAxisAlarm
)
||
StoreManager
.
Store
.
alarmType
.
Equals
(
StoreAlarmType
.
BatchIoTimeOut
))
{
{
LogUtil
.
info
(
Name
+
" 复位前,清理报警【"
+
StoreManager
.
Store
.
alarmType
+
"】"
);
LogUtil
.
info
(
Name
+
" 复位前,清理报警【"
+
StoreManager
.
Store
.
alarmType
+
"】"
);
StoreManager
.
Store
.
alarmType
=
StoreAlarmType
.
None
;
StoreManager
.
Store
.
alarmType
=
StoreAlarmType
.
None
;
WarnMsg
=
""
;
WarnMsg
=
""
;
}
}
AutomaticBaiting
.
IsNeedStartInout
=
isNeedInout
;
AutomaticBaiting
.
IsNeedStartInout
=
isNeedInout
;
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
c0ea1ea
...
@@ -319,7 +319,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -319,7 +319,8 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
return
msg
;
return
msg
;
}
}
//=1+0x0-13x24=201810220856;025;5N02018101;121;700012865;92498;1800;##
private
static
void
GetInStorePosId
(
string
message
)
private
static
void
GetInStorePosId
(
string
message
)
{
{
try
try
...
@@ -342,9 +343,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -342,9 +343,7 @@ namespace OnlineStore.DeviceLibrary
{
{
string
posId
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DebugPosId
);
string
posId
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DebugPosId
);
if
(!
posId
.
Equals
(
""
))
if
(!
posId
.
Equals
(
""
))
{
{
//"1#AC2_2_1_1";
LogUtil
.
info
(
Name
+
"调试模式,模拟库位号【"
+
posId
+
"】"
);
LogUtil
.
info
(
Name
+
"调试模式,模拟库位号【"
+
posId
+
"】"
);
if
(
StoreManager
.
Store
.
CanStarInOut
())
if
(
StoreManager
.
Store
.
CanStarInOut
())
{
{
...
@@ -367,7 +366,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -367,7 +366,14 @@ namespace OnlineStore.DeviceLibrary
//发送扫码内容到服务器进行入库操作
//发送扫码内容到服务器进行入库操作
Operation
operation
=
StoreManager
.
Store
.
getLineBoxStatus
();
Operation
operation
=
StoreManager
.
Store
.
getLineBoxStatus
();
operation
.
op
=
1
;
operation
.
op
=
1
;
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
StoreManager
.
Store
.
StoreID
.
ToString
()
}
};
if
(
operation
.
data
==
null
)
{
operation
.
data
=
new
Dictionary
<
string
,
string
>();
}
operation
.
data
.
Add
(
"code"
,
message
);
operation
.
data
.
Add
(
"boxId"
,
StoreManager
.
Store
.
StoreID
.
ToString
());
//{ { "code", message }, { "boxId", StoreManager.Store.StoreID.ToString() } };
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
if
(
resultOperation
==
null
)
if
(
resultOperation
==
null
)
...
@@ -439,6 +445,106 @@ namespace OnlineStore.DeviceLibrary
...
@@ -439,6 +445,106 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
public
static
Dictionary
<
string
,
string
>
GetBtnStatus
()
{
Dictionary
<
string
,
string
>
map
=
new
Dictionary
<
string
,
string
>();
map
.
Add
(
ParamDefine
.
openLock
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
startBatchIn
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
closeLock
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
takeOutReel
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
confirmReelOut
,
ParamDefine
.
disable
);
if
(
AutomaticBaiting
.
IsWaitTragGo
&&
(
AutomaticBaiting
.
IsGetTrayGo
.
Equals
(
false
)))
{
map
[
ParamDefine
.
confirmReelOut
]
=
ParamDefine
.
enable
;
}
else
if
(
AutomaticBaiting
.
CanOpenBatchDoor
())
{
if
(
AutomaticBaiting
.
DoorStatus
.
Equals
(
2
))
{
if
(
AutomaticBaiting
.
BatchOutStoreCount
>
0
)
{
map
[
ParamDefine
.
takeOutReel
]
=
ParamDefine
.
enable
;
}
else
{
map
[
ParamDefine
.
openLock
]
=
ParamDefine
.
enable
;
}
}
else
{
map
[
ParamDefine
.
closeLock
]
=
ParamDefine
.
enable
;
map
[
ParamDefine
.
startBatchIn
]
=
ParamDefine
.
enable
;
}
}
return
map
;
}
public
static
string
doOpenDoor
()
{
if
(
AutomaticBaiting
.
CanOpenBatchDoor
())
{
AutomaticBaiting
.
BatchDoorOpen
(
false
);
AutomaticBaiting
.
IsNeedStartInout
=
false
;
return
""
;
}
else
{
return
"忙碌中,无法打开门锁"
;
}
}
public
static
string
doStartBatchIn
()
{
if
(!
AutomaticBaiting
.
DoorIsClose
())
{
return
"批量入库失败:请先关闭上料机构"
;
}
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
"批量入库失败:叉子料盘检测有料,请检查后再入库"
;
}
AutomaticBaiting
.
BatchDoorClose
(
false
);
AutomaticBaiting
.
Reset
(
true
);
return
""
;
}
public
static
string
doTakeReel
()
{
if
(
AutomaticBaiting
.
CanOpenBatchDoor
())
{
if
(
AutomaticBaiting
.
BatchOutStoreCount
>
0
&&
AutomaticBaiting
.
BatchOutStoreHeight
>
0
)
{
AutomaticBaiting
.
BatchDoorOpen
(
false
);
return
""
;
}
else
{
return
(
"取出料盘失败:无料盘可取"
);
}
}
else
{
return
(
"取出料盘失败:忙碌中,无法打开门锁"
);
}
}
public
static
string
doCloseDoor
()
{
if
(!
AutomaticBaiting
.
DoorIsClose
())
{
return
(
"锁门失败:请先关闭上料机构"
);
}
AutomaticBaiting
.
BatchDoorClose
(
false
);
AutomaticBaiting
.
Reset
(
false
);
return
""
;
}
public
static
bool
doConfirmReelGo
()
{
LogUtil
.
info
(
"已确认料盘已手动拿出"
);
AutomaticBaiting
.
IsWaitTragGo
=
false
;
AutomaticBaiting
.
IsGetTrayGo
=
true
;
return
true
;
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论