Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a63a8a86
由
几米阳光
编写于
2019-04-29 15:44:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加自动出入库功能
1 个父辈
4ec0cea8
全部展开
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
169 行增加
和
159 行删除
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/记录.txt
source/DeviceLibrary/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/DeviceLibrary/PanasonicServo/BatchAxisController.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
a63a8a8
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
a63a8a8
...
@@ -192,7 +192,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -192,7 +192,7 @@ namespace OnlineStore.AutoInOutStore
}
}
preOpen
=
isOpen
;
preOpen
=
isOpen
;
btnOutStore
.
Enabled
=
isOpen
;
//
btnOutStore.Enabled = isOpen;
//btnInStore.Enabled = isOpen;
//btnInStore.Enabled = isOpen;
//btnAxisAMove.Enabled = isOpen;
//btnAxisAMove.Enabled = isOpen;
...
@@ -235,6 +235,14 @@ namespace OnlineStore.AutoInOutStore
...
@@ -235,6 +235,14 @@ namespace OnlineStore.AutoInOutStore
cmbHomeType
.
SelectedIndex
=
1
;
cmbHomeType
.
SelectedIndex
=
1
;
timer1
.
Start
();
timer1
.
Start
();
store
.
ResetEvent
+=
Store_ResetEvent
;
store
.
ResetEvent
+=
Store_ResetEvent
;
cmbJianGe
.
Items
.
Clear
();
for
(
int
i
=
0
;
i
<=
20
;
i
++)
{
cmbJianGe
.
Items
.
Add
(
i
.
ToString
());
}
cmbJianGe
.
SelectedIndex
=
0
;
DebugStatus
(
false
);
}
}
private
void
Store_ResetEvent
()
private
void
Store_ResetEvent
()
...
@@ -326,10 +334,10 @@ namespace OnlineStore.AutoInOutStore
...
@@ -326,10 +334,10 @@ namespace OnlineStore.AutoInOutStore
if
(
store
.
autoNext
)
if
(
store
.
autoNext
)
{
{
string
msg
=
store
.
autoMsg
;
string
msg
=
store
.
autoMsg
;
lblMsg
.
Text
=
msg
;
groupAuto
.
Text
=
msg
;
if
(
btnStart
AuTo
.
Text
.
Equals
(
StartAuto
))
if
(
btnStart
.
Text
.
Equals
(
StartAuto
))
{
{
btnStart
AuTo
.
Text
=
StopAuto
;
btnStart
.
Text
=
StopAuto
;
}
}
try
try
{
{
...
@@ -345,18 +353,17 @@ namespace OnlineStore.AutoInOutStore
...
@@ -345,18 +353,17 @@ namespace OnlineStore.AutoInOutStore
}
}
else
else
{
{
// lblMsg.Text = "没有开启自动出入库";
groupAuto
.
Text
=
"自动出入库操作"
;
if
(
btnStartAuTo
.
Text
.
Equals
(
StopAuto
))
btnStart
.
Text
=
StartAuto
;
{
btnStartAuTo
.
Text
=
StartAuto
;
}
}
}
}
}
else
else
{
{
groupAuto
.
Text
=
StartAuto
;
lblThisSta
.
Text
=
WaitStart
;
lblThisSta
.
Text
=
WaitStart
;
//lblWarnMsg.Text = "";
//lblWarnMsg.Text = "";
btnStartAuTo
.
Text
=
StartAuto
;
btnStart
.
Text
=
StartAuto
;
lblDoorStatus
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
NoDoorStatus
,
"仓门状态未知"
);
lblDoorStatus
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
NoDoorStatus
,
"仓门状态未知"
);
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
...
@@ -993,45 +1000,6 @@ namespace OnlineStore.AutoInOutStore
...
@@ -993,45 +1000,6 @@ namespace OnlineStore.AutoInOutStore
FormManager
.
ShowAxisDebug
(
store
);
FormManager
.
ShowAxisDebug
(
store
);
}
}
private
void
btnStartAuTo_Click
(
object
sender
,
EventArgs
e
)
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
CanotSingleInStore
,
"此设备不支持单个入库"
),
ResourceCulture
.
GetString
(
ResourceCulture
.
MsgTitle
,
"提示"
),
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
return
;
if
(
store
.
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
if
(
store
.
autoNext
)
{
store
.
autoNext
=
false
;
btnStartAuTo
.
Text
=
StartAuto
;
}
else
{
DialogResult
res
=
MessageBox
.
Show
(
StartAuto
+
"?"
,
ResourceCulture
.
GetString
(
ResourceCulture
.
MsgTitle
,
"提示"
),
MessageBoxButtons
.
YesNo
);
if
(
res
.
Equals
(
DialogResult
.
Yes
))
{
store
.
autoNext
=
true
;
int
jiange
=
FormUtil
.
GetIntValue
(
txtJiange
);
store
.
autoJiange
=
jiange
;
if
(
cmbPosition
.
SelectedIndex
>=
0
)
{
int
currIndex
=
cmbPosition
.
SelectedIndex
;
store
.
autoPositionIndex
=
currIndex
;
string
poText
=
cmbPosition
.
Text
;
store
.
autoMsg
=
"自动出库:"
+
poText
;
LogUtil
.
info
(
LOGGER
,
store
.
StoreName
+
"开启自动出入库模式,开始位置【"
+
poText
+
"】(索引="
+
currIndex
+
"),间隔="
+
jiange
+
",入库开始!"
);
//store.StartOutStoreMove(new InOutStoreParam("", poText));
store
.
StartInStoreMove
(
new
InOutStoreParam
(
""
,
poText
),
false
);
}
btnStartAuTo
.
Text
=
StopAuto
;
}
}
}
else
{
MessageBox
.
Show
(
ResourceCulture
.
GetString
(
ResourceCulture
.
PleaseStartStore
,
"请先启动料仓!"
));
}
}
private
void
轴卡点动
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
轴卡点动
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
button1_Click
(
null
,
null
);
button1_Click
(
null
,
null
);
...
@@ -1313,16 +1281,11 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1313,16 +1281,11 @@ namespace OnlineStore.AutoInOutStore
{
{
this
.
timer1
.
Enabled
=
false
;
this
.
timer1
.
Enabled
=
false
;
}
}
if
(
this
.
停止
ToolStripMenuItem
.
Enabled
)
{
stop_button_Click
(
null
,
null
);
}
LogUtil
.
info
(
"ExitApp:停止料仓运行"
);
LogUtil
.
info
(
"ExitApp:停止料仓运行"
);
store
.
Exit
();
store
.
Exit
();
LogUtil
.
info
(
"ExitApp:料仓已停止,关闭所有DO"
);
ACServerManager
.
CloseAllPort
();
IOManager
.
instance
.
CloseAllDO
();
StoreOpenStatus
(
false
);
StoreOpenStatus
(
false
);
LogUtil
.
info
(
"ExitApp:
关闭所有DO完成,
端口所有IO连接"
);
LogUtil
.
info
(
"ExitApp:
端口所有IO连接"
);
IOManager
.
instance
.
CloseAllConnection
();
IOManager
.
instance
.
CloseAllConnection
();
//KNDAIManager.CloseAllConnection();
//KNDAIManager.CloseAllConnection();
//WCFControl.CloseWCF();
//WCFControl.CloseWCF();
...
@@ -1351,7 +1314,6 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1351,7 +1314,6 @@ namespace OnlineStore.AutoInOutStore
this
.
ShowInTaskbar
=
false
;
this
.
ShowInTaskbar
=
false
;
this
.
notifyIcon1
.
Visible
=
true
;
this
.
notifyIcon1
.
Visible
=
true
;
this
.
Hide
();
this
.
Hide
();
DebugStatus
(
false
);
}
}
private
void
FrmStoreBox_FormClosed
(
object
sender
,
FormClosedEventArgs
e
)
private
void
FrmStoreBox_FormClosed
(
object
sender
,
FormClosedEventArgs
e
)
{
{
...
@@ -1520,7 +1482,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1520,7 +1482,7 @@ namespace OnlineStore.AutoInOutStore
{
{
ACServerManager
.
ServoOff
(
store
.
Config
.
Batch_Axis
.
DeviceName
,
store
.
Config
.
Batch_Axis
.
GetAxisValue
());
ACServerManager
.
ServoOff
(
store
.
Config
.
Batch_Axis
.
DeviceName
,
store
.
Config
.
Batch_Axis
.
GetAxisValue
());
//关闭串口,等下次重新打开
//关闭串口,等下次重新打开
ACServerManager
.
ColsePort
(
store
.
Config
.
Batch_Axis
.
DeviceName
);
//
ACServerManager.ColsePort(store.Config.Batch_Axis.DeviceName);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
...
@@ -1700,11 +1662,71 @@ namespace OnlineStore.AutoInOutStore
...
@@ -1700,11 +1662,71 @@ namespace OnlineStore.AutoInOutStore
groupAxis
.
Enabled
=
status
;
groupAxis
.
Enabled
=
status
;
groupComAxis
.
Enabled
=
status
;
groupComAxis
.
Enabled
=
status
;
groupInout
.
Enabled
=
status
;
groupInout
.
Enabled
=
status
;
if
(
store
.
autoNext
)
{
groupAuto
.
Enabled
=
true
;
cmbJianGe
.
Enabled
=
false
;
}
else
{
groupAuto
.
Enabled
=
status
;
}
}
}
private
void
btnClearBuzzer_Click
(
object
sender
,
EventArgs
e
)
private
void
btnClearBuzzer_Click
(
object
sender
,
EventArgs
e
)
{
{
IOManager
.
IOMove
(
IO_Type
.
Buzzer_Sign
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Buzzer_Sign
,
IO_VALUE
.
LOW
);
}
}
private
void
btnStart_Click
(
object
sender
,
EventArgs
e
)
{
if
(
store
.
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
if
(
store
.
autoNext
)
{
store
.
autoNext
=
false
;
btnStart
.
Text
=
StartAuto
;
}
else
{
DialogResult
res
=
MessageBox
.
Show
(
"确定开始自动出入库?"
,
"提示"
,
MessageBoxButtons
.
YesNo
);
if
(
res
.
Equals
(
DialogResult
.
Yes
))
{
store
.
autoNext
=
true
;
int
jiange
=
cmbJianGe
.
SelectedIndex
;
store
.
autoJiange
=
jiange
;
if
(
cmbPosition
.
SelectedIndex
>=
0
)
{
int
currIndex
=
cmbPosition
.
SelectedIndex
;
store
.
autoPositionIndex
=
currIndex
;
store
.
AutoStartIndex
=
currIndex
;
string
poText
=
cmbPosition
.
Text
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DebugPosId
,
poText
);
store
.
autoMsg
=
"自动入库:"
+
poText
;
string
msg
=
AutomaticBaiting
.
doStartBatchIn
();
if
(
msg
.
Equals
(
""
))
{
btnStart
.
Text
=
StopAuto
;
LogUtil
.
info
(
LOGGER
,
store
.
StoreName
+
"开启自动出入库模式,开始位置【"
+
poText
+
"】(索引="
+
currIndex
+
"),间隔="
+
jiange
+
",入库开始!"
);
}
else
{
MessageBox
.
Show
(
msg
);
store
.
autoNext
=
false
;
btnStart
.
Text
=
StartAuto
;
LogUtil
.
info
(
LOGGER
,
store
.
StoreName
+
"自动出入库失败【"
+
msg
+
"】,开始位置【"
+
poText
+
"】(索引="
+
currIndex
+
"),间隔="
+
jiange
+
",入库开始!"
);
}
DebugStatus
(
false
);
}
}
}
}
else
{
MessageBox
.
Show
(
"请先启动料仓!"
);
}
}
}
}
}
}
source/ACSingleStore/记录.txt
查看文件 @
a63a8a8
...
@@ -149,6 +149,9 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
...
@@ -149,6 +149,9 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
新料仓修改:增加一对门锁气缸输入信号
新料仓修改:增加一对门锁气缸输入信号
蜂鸣器和报警灯分开处理。
蜂鸣器和报警灯分开处理。
20190428
增加自动出入库功能。
...
...
source/DeviceLibrary/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
a63a8a8
...
@@ -119,8 +119,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -119,8 +119,19 @@ namespace OnlineStore.DeviceLibrary
{
{
serialBeanMap
.
Remove
(
portName
);
serialBeanMap
.
Remove
(
portName
);
}
}
LogUtil
.
info
(
"ACServerManager 关闭串口【"
+
portName
+
"】 "
);
}
}
public
static
void
CloseAllPort
()
{
List
<
string
>
kes
=
new
List
<
string
>(
serialBeanMap
.
Keys
);
foreach
(
string
key
in
kes
)
{
ColsePort
(
key
);
}
}
/// <summary>
/// <summary>
/// 是否成功打开伺服
/// 是否成功打开伺服
/// </summary>
/// </summary>
...
...
source/DeviceLibrary/DeviceLibrary/PanasonicServo/BatchAxisController.cs
查看文件 @
a63a8a8
...
@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -22,7 +22,7 @@ namespace OnlineStore.DeviceLibrary
{
{
checkTimer
=
new
System
.
Timers
.
Timer
();
checkTimer
=
new
System
.
Timers
.
Timer
();
checkTimer
.
AutoReset
=
true
;
checkTimer
.
AutoReset
=
true
;
checkTimer
.
Interval
+=
50
;
checkTimer
.
Interval
+=
49
;
checkTimer
.
Elapsed
+=
CheckTimer_Elapsed
;
checkTimer
.
Elapsed
+=
CheckTimer_Elapsed
;
checkTimer
.
Enabled
=
false
;
checkTimer
.
Enabled
=
false
;
}
}
...
@@ -40,6 +40,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -40,6 +40,7 @@ namespace OnlineStore.DeviceLibrary
return
true
;
return
true
;
}
}
private
static
bool
IsInProcess
=
false
;
private
static
bool
IsInProcess
=
false
;
private
static
DateTime
preTime
=
DateTime
.
Now
;
private
static
void
CheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
private
static
void
CheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
{
if
(
IsInProcess
)
{
return
;
}
if
(
IsInProcess
)
{
return
;
}
...
@@ -50,11 +51,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -50,11 +51,15 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
"批量上料轴,检测到【"
+
TargetIoType
+
"】信号,可以停止运动"
);
LogUtil
.
info
(
"批量上料轴,检测到【"
+
TargetIoType
+
"】信号,可以停止运动"
);
result
=
true
;
result
=
true
;
}
}
//else if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(1))
TimeSpan
span
=
DateTime
.
Now
-
preTime
;
//{
if
(
span
.
TotalMilliseconds
>
100
)
// LogUtil.info("批量上料轴,检测到正极限信号,可以停止运动");
{
// result = true;
if
(
ACServerManager
.
GetLimitPositiveSingle
(
StoreManager
.
Config
.
Batch_Axis
).
Equals
(
1
))
//}
{
LogUtil
.
info
(
"批量上料轴,检测到正极限信号,可以停止运动"
);
result
=
true
;
}
}
if
(
result
)
if
(
result
)
{
{
//AutoAxisIsMove = 0;
//AutoAxisIsMove = 0;
...
@@ -62,6 +67,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -62,6 +67,7 @@ namespace OnlineStore.DeviceLibrary
ACServerManager
.
SuddenStop
(
StoreManager
.
Config
.
Batch_Axis
.
DeviceName
,
StoreManager
.
Config
.
Batch_Axis
.
GetAxisValue
());
ACServerManager
.
SuddenStop
(
StoreManager
.
Config
.
Batch_Axis
.
DeviceName
,
StoreManager
.
Config
.
Batch_Axis
.
GetAxisValue
());
StopCheck
();
StopCheck
();
}
}
preTime
=
DateTime
.
Now
;
IsInProcess
=
false
;
IsInProcess
=
false
;
}
}
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
a63a8a8
...
@@ -711,13 +711,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -711,13 +711,15 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
info
(
StoreName
+
"关闭刹车,关闭伺服"
);
LogUtil
.
info
(
StoreName
+
"关闭刹车,关闭伺服"
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
LogUtil
.
debug
(
StoreName
+
"关闭刹车完成,开始关闭伺服"
);
foreach
(
ConfigMoveAxis
axis
in
moveAxisList
)
foreach
(
ConfigMoveAxis
axis
in
moveAxisList
)
{
{
LogUtil
.
debug
(
StoreName
+
" 开始关闭伺服 "
+
axis
.
DisplayStr
);
ACServerManager
.
ServoOff
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
ACServerManager
.
ServoOff
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
//关闭串口,等下次重新打开
ACServerManager
.
ColsePort
(
axis
.
DeviceName
);
}
}
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
LogUtil
.
debug
(
StoreName
+
"关闭伺服完成,开始关闭Run_Sign"
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
}
}
...
@@ -778,11 +780,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -778,11 +780,11 @@ namespace OnlineStore.DeviceLibrary
}
}
public
void
Exit
()
public
void
Exit
()
{
{
if
(!
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
mainTimer
.
Enabled
=
false
;
if
(
storeRunStatus
>
StoreRunStatus
.
Wait
)
{
{
StopRun
();
StopRun
();
}
}
mainTimer
.
Enabled
=
false
;
}
}
public
override
void
Alarm
(
StoreAlarmType
alarmType
,
string
alarmDetial
,
string
alarmMsg
,
StoreMoveType
storeMoveType
)
public
override
void
Alarm
(
StoreAlarmType
alarmType
,
string
alarmDetial
,
string
alarmMsg
,
StoreMoveType
storeMoveType
)
{
{
...
@@ -1124,20 +1126,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1124,20 +1126,18 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
"IOTimeOutProcess出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
LOGGER
,
"IOTimeOutProcess出错:"
+
ex
.
ToString
());
}
}
}
}
//private DateTime preProTime = DateTime.Now;
private
DateTime
preProTime
=
DateTime
.
Now
;
/// <summary>
/// 超过配置次数时需要复位
/// </summary>
private
void
AutoResetProcess
()
private
void
AutoResetProcess
()
{
{
try
try
{
{
//
TimeSpan span = DateTime.Now - preProTime;
TimeSpan
span
=
DateTime
.
Now
-
preProTime
;
//if (span.TotalSeconds < 1
)
if
(
span
.
TotalSeconds
<
10
)
//
{
{
//
return;
return
;
//
}
}
//
preProTime = DateTime.Now;
preProTime
=
DateTime
.
Now
;
if
(
CurrInOutACount
>=
this
.
Config
.
Box_ResetACount
)
if
(
CurrInOutACount
>=
this
.
Config
.
Box_ResetACount
)
{
{
if
(
storeRunStatus
<
StoreRunStatus
.
Runing
||
StoreMove
.
MoveType
==
StoreMoveType
.
InStore
||
StoreMove
.
MoveType
==
StoreMoveType
.
OutStore
)
if
(
storeRunStatus
<
StoreRunStatus
.
Runing
||
StoreMove
.
MoveType
==
StoreMoveType
.
InStore
||
StoreMove
.
MoveType
==
StoreMoveType
.
OutStore
)
...
@@ -1287,6 +1287,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1287,6 +1287,8 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
}
}
}
}
MeteringSignal
.
StopCheck
();
AutomaticBaiting
.
StopMove
();
if
(
IsCloseAxis
)
if
(
IsCloseAxis
)
{
{
CloseAllAxis
();
CloseAllAxis
();
...
@@ -1295,8 +1297,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1295,8 +1297,6 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
AutomaticBaiting
.
StopMove
();
MeteringSignal
.
StopCheck
();
isInPro
=
false
;
isInPro
=
false
;
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
a63a8a8
...
@@ -24,8 +24,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -24,8 +24,12 @@ namespace OnlineStore.DeviceLibrary
/// 自动出入库间隔
/// 自动出入库间隔
/// </summary>
/// </summary>
public
int
autoJiange
=
3
;
public
int
autoJiange
=
3
;
public
int
AutoStartIndex
=
0
;
public
int
autoPositionIndex
=
0
;
public
int
autoPositionIndex
=
0
;
public
string
autoMsg
=
""
;
public
string
autoMsg
=
""
;
private
static
StoreMoveType
lastMoveType
=
StoreMoveType
.
None
;
#
endregion
#
endregion
#
region
出入库参数
#
region
出入库参数
...
@@ -308,6 +312,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -308,6 +312,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus
=
StoreRunStatus
.
Busy
;
storeRunStatus
=
StoreRunStatus
.
Busy
;
storeStatus
=
StoreStatus
.
InStoreExecute
;
storeStatus
=
StoreStatus
.
InStoreExecute
;
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
,
param
);
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
,
param
);
lastMoveType
=
StoreMoveType
.
InStore
;
StoreMove
.
IsBatchInOutStore
=
IsBatchWork
;
StoreMove
.
IsBatchInOutStore
=
IsBatchWork
;
StoreMove
.
IsNeedInStore
=
isNeedInStore
;
StoreMove
.
IsNeedInStore
=
isNeedInStore
;
if
(
IsHasCompress_Axis
||
Config
.
IsHasLocationCylinder
.
Equals
(
0
))
if
(
IsHasCompress_Axis
||
Config
.
IsHasLocationCylinder
.
Equals
(
0
))
...
@@ -624,6 +629,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -624,6 +629,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
logMsg
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logMsg
);
storeRunStatus
=
StoreRunStatus
.
Busy
;
storeRunStatus
=
StoreRunStatus
.
Busy
;
StoreMove
.
NewMove
(
StoreMoveType
.
OutStore
,
param
);
StoreMove
.
NewMove
(
StoreMoveType
.
OutStore
,
param
);
lastMoveType
=
StoreMoveType
.
OutStore
;
StoreMove
.
IsBatchInOutStore
=
IsBatchWork
;
StoreMove
.
IsBatchInOutStore
=
IsBatchWork
;
if
(
IsHasCompress_Axis
||
Config
.
IsHasLocationCylinder
.
Equals
(
0
))
if
(
IsHasCompress_Axis
||
Config
.
IsHasLocationCylinder
.
Equals
(
0
))
{
{
...
@@ -1005,78 +1011,30 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1005,78 +1011,30 @@ namespace OnlineStore.DeviceLibrary
}
}
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
InStore
))
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
InStore
))
{
{
int
newIndex
=
autoPositionIndex
-
1
;
if
(
autoJiange
==
0
)
{
newIndex
=
autoPositionIndex
;
}
if
(
newIndex
<
0
)
{
autoNext
=
false
;
autoMsg
=
"自动出入库结束!"
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
"下一个索引不存在,自动 出入库结束!"
);
}
else
{
autoPositionIndex
=
newIndex
;
string
posid
=
PositionNumList
[
autoPositionIndex
];
string
posid
=
PositionNumList
[
autoPositionIndex
];
//判断是否需要重置
autoMsg
=
"自动入库:"
+
posid
;
if
(
CurrInOutACount
>=
Config
.
Box_ResetACount
)
//自动出入口,入库结束把出库加入队列
{
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posid
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutACount
+
"次,需要重置BOX,先把出库信息存入排队列表中"
);
AddWaitOutInfo
(
currInOutFixture
);
Reset
(
false
);
LogUtil
.
info
(
"自动出入口,入库结束,将库位号【"
+
posid
+
"】加入出库等待中"
);
autoMsg
=
"自动出库:"
+
posid
;
AddWaitOutInfo
(
new
FixtureCodeInfo
(
0
,
""
,
posid
));
}
else
if
(
CurrInOutCount
>=
Config
.
Box_ResetMCount
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutCount
+
"次,需要重置BOX旋转轴,先把出库信息存入排队列表中"
);
//ResetMiddleAxis(false);
autoMsg
=
"自动出库:"
+
posid
;
AddWaitOutInfo
(
new
FixtureCodeInfo
(
0
,
""
,
posid
));
}
else
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个出库:posid="
+
posid
);
autoMsg
=
"自动出库:"
+
posid
;
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posid
),
false
);
}
}
}
}
else
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
OutStore
))
else
if
(
storeMoveType
.
Equals
(
StoreMoveType
.
OutStore
))
{
{
int
newIndex
=
autoPositionIndex
-
autoJiange
;
int
newIndex
=
autoPositionIndex
-
autoJiange
;
if
(
newIndex
<
0
)
if
(
newIndex
<
0
)
{
{
autoNext
=
false
;
newIndex
=
AutoStartIndex
;
autoMsg
=
"自动出入库结束!"
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
"下一个索引不存在,自动 出入库结束!"
);
}
}
else
else
{
{
autoPositionIndex
=
newIndex
;
string
posid
=
PositionNumList
[
newIndex
];
string
posid
=
PositionNumList
[
newIndex
];
//判断是否需要重置
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DebugPosId
,
posid
);
if
(
CurrInOutACount
>=
Config
.
Box_ResetACount
)
//开始自动入库
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个入库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutACount
+
"次,需要重置BOX,先把入库信息存入排队列表中"
);
Reset
(
false
);
autoMsg
=
"自动入库:"
+
posid
;
AddWaitOutInfo
(
new
FixtureCodeInfo
(
0
,
"AAAA"
,
posid
));
}
else
if
(
CurrInOutCount
>=
Config
.
Box_ResetMCount
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个出库:posid="
+
posid
+
",当时已经出入库"
+
CurrInOutCount
+
"次,需要重置BOX旋转轴,先把出库信息存入排队列表中"
);
//ResetMiddleAxis(false);
autoMsg
=
"自动入库:"
+
posid
;
autoMsg
=
"自动入库:"
+
posid
;
AddWaitOutInfo
(
new
FixtureCodeInfo
(
0
,
"AAAA"
,
posid
));
string
msg
=
AutomaticBaiting
.
doStartBatchIn
();
}
LogUtil
.
info
(
"自动出入库:库位号【"
+
posid
+
"】,开始入库"
+
msg
);
else
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"自动进入下一个入库:posid="
+
posid
);
autoMsg
=
"自动入库:"
+
posid
;
StartInStoreMove
(
new
InOutStoreParam
(
"AAAA"
,
posid
),
false
);
}
}
}
}
}
}
}
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
a63a8a8
...
@@ -275,7 +275,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -275,7 +275,7 @@ namespace OnlineStore.DeviceLibrary
}
}
LastCodeList
=
hasList
;
LastCodeList
=
hasList
;
LastCode
=
message
;
LastCode
=
message
;
if
(
LastCode
.
Equals
(
""
)
&&
StoreManager
.
Store
.
IsDebug
)
if
(
LastCode
.
Equals
(
""
)
&&
(
StoreManager
.
Store
.
IsDebug
||
StoreManager
.
Store
.
autoNext
)
)
{
{
LastCode
=
"NoCode"
;
LastCode
=
"NoCode"
;
LogUtil
.
info
(
Name
+
"模拟二维码:NoCode"
);
LogUtil
.
info
(
Name
+
"模拟二维码:NoCode"
);
...
@@ -331,41 +331,50 @@ namespace OnlineStore.DeviceLibrary
...
@@ -331,41 +331,50 @@ namespace OnlineStore.DeviceLibrary
{
{
try
try
{
{
message
=
ScanCodeManager
.
ReplaceCode
(
message
);
if
(
StoreManager
.
Store
.
IsDebug
||
StoreManager
.
Store
.
autoNext
)
if
(
message
.
Equals
(
""
)
||
string
.
IsNullOrEmpty
(
message
))
{
CodeMsg
=
"没有收到二维码信息,请重新放入料盘"
;
LogUtil
.
info
(
Name
+
"没有收到二维码信息,请重新放入料盘"
);
return
;
}
if
(
StoreManager
.
Store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
LogUtil
.
info
(
Name
+
"收到二维码【 "
+
message
+
"】,设备未启动,不需要发送服务器"
);
return
;
}
if
(
StoreManager
.
Store
.
IsDebug
)
{
{
string
posId
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DebugPosId
);
string
posId
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DebugPosId
);
if
(!
posId
.
Equals
(
""
))
if
(!
posId
.
Equals
(
""
))
{
{
LogUtil
.
info
(
Name
+
"调试模式,模拟库位号【"
+
posId
+
"】"
);
string
type
=
StoreManager
.
Store
.
autoNext
?
"自动出入库"
:
"入库模拟调试"
;
LogUtil
.
info
(
Name
+
type
+
" ,模拟库位号【"
+
posId
+
"】"
);
if
(
StoreManager
.
Store
.
CanStarInOut
())
if
(
StoreManager
.
Store
.
CanStarInOut
())
{
{
LastPosId
=
posId
;
LastPosId
=
posId
;
InOutStoreParam
param
=
new
InOutStoreParam
(
message
,
posId
,
LastHeight
,
LastWidth
);
InOutStoreParam
param
=
new
InOutStoreParam
(
message
,
posId
,
LastHeight
,
LastWidth
);
bool
result
=
StoreManager
.
Store
.
StartInStoreMove
(
param
,
true
);
bool
result
=
StoreManager
.
Store
.
StartInStoreMove
(
param
,
true
);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
Name
+
" 入库调试模拟
:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 开始入库!"
);
LogUtil
.
info
(
Name
+
type
+
"
:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 开始入库!"
);
}
}
else
else
{
{
LogUtil
.
info
(
Name
+
" 入库调试模拟:库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 正在忙碌中,无法入库!"
);
LogUtil
.
info
(
Name
+
type
+
" :库位号【"
+
posId
+
"】二维码【"
+
message
+
"】 正在忙碌中,无法入库!"
);
}
//清理库位号,防止重复入库
if
(
StoreManager
.
Store
.
autoNext
)
{
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
DebugPosId
,
""
);
}
return
;
}
}
}
else
{
message
=
ScanCodeManager
.
ReplaceCode
(
message
);
if
(
message
.
Equals
(
""
)
||
string
.
IsNullOrEmpty
(
message
))
{
CodeMsg
=
"没有收到二维码信息,请重新放入料盘"
;
LogUtil
.
info
(
Name
+
"没有收到二维码信息,请重新放入料盘"
);
return
;
return
;
}
}
if
(
StoreManager
.
Store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
LogUtil
.
info
(
Name
+
"收到二维码【 "
+
message
+
"】,设备未启动,不需要发送服务器"
);
return
;
}
}
//开启服务器日志
//开启服务器日志
//HttpHelper.isLog = 1;
//HttpHelper.isLog = 1;
LogUtil
.
info
(
Name
+
"收到二维码【 "
+
message
+
"】,发送给服务器获取入库PosID"
);
LogUtil
.
info
(
Name
+
"收到二维码【 "
+
message
+
"】,发送给服务器获取入库PosID"
);
...
@@ -413,7 +422,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -413,7 +422,7 @@ namespace OnlineStore.DeviceLibrary
string
[]
posArray
=
posId
.
Split
(
'#'
);
string
[]
posArray
=
posId
.
Split
(
'#'
);
if
(!(
posArray
.
Length
==
2
))
if
(!(
posArray
.
Length
==
2
))
{
{
WarnMsg
=
Name
+
ResourceControl
.
GetString
(
ResourceControl
.
InStoreError
,
"入库库位格式错误:"
)
+
"【"
+
message
+
"】【"
+
posId
+
"】"
;
WarnMsg
=
Name
+
ResourceControl
.
GetString
(
ResourceControl
.
InStoreError
,
"入库库位格式错误:"
)
+
"【"
+
message
+
"】【"
+
posId
+
"】"
;
LogUtil
.
error
(
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
LogUtil
.
error
(
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
LogUtil
.
info
(
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
LogUtil
.
info
(
"服务器反馈 入库库位格式错误:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
return
;
...
@@ -449,6 +458,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -449,6 +458,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
Name
+
ex
.
StackTrace
);
LogUtil
.
error
(
Name
+
ex
.
StackTrace
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论