Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8474f71b
由
几米阳光
编写于
2019-01-28 17:17:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库失败时缓存
1 个父辈
39ce94c7
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
58 行增加
和
20 行删除
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/store/AC_Store.cs
source/DeviceLibrary/store/model/FixtureCodeInfo.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
8474f71
...
...
@@ -45,6 +45,7 @@ namespace OnlineStore.DeviceLibrary
Init
();
serverConnectTimer
.
Elapsed
+=
server_connect_timer_Tick
;
IoCheckTimer
.
Elapsed
+=
IoCheckTimer_Elapsed
;
ledCheckTimer
.
Elapsed
+=
LedCheckTimer_Elapsed
;
IsDebug
=
(
config
.
IsInDebug
==
1
);
...
...
@@ -88,6 +89,17 @@ namespace OnlineStore.DeviceLibrary
});
}
}
private
static
bool
ledInProcess
=
false
;
private
void
LedCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
ledInProcess
)
{
return
;
}
ledInProcess
=
true
;
LedProcess
();
ledInProcess
=
false
;
}
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
...
...
@@ -98,17 +110,17 @@ namespace OnlineStore.DeviceLibrary
{
if
(
isInSuddenDown
.
Equals
(
false
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
"收到急停信号,等待200后再次判断"
);
Thread
.
Sleep
(
200
);
if
(
KND
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
//
LogUtil.error(LOGGER, StoreName + "收到急停信号,等待200后再次判断");
//
Thread.Sleep(200);
//
if (KND.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
//
{
isInSuddenDown
=
true
;
LogUtil
.
error
(
LOGGER
,
StoreName
+
"收到急停信号,报警急停"
);
WarnMsg
=
StoreName
+
ResourceControl
.
GetString
(
ResourceControl
.
inSuddenStop
,
"收到急停信号,报警急停"
);
//报警时会关闭所有轴
Alarm
(
StoreAlarmType
.
SuddenStop
,
"1"
,
WarnMsg
,
StoreMoveType
.
None
);
}
//
}
}
}
else
...
...
@@ -225,6 +237,7 @@ namespace OnlineStore.DeviceLibrary
HumitureController
.
Init
(
Config
.
Humiture_Port
);
ReturnHome
();
mainTimer
.
Enabled
=
true
;
ledCheckTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
serverConnectTimer
.
Enabled
=
true
;
return
true
;
...
...
@@ -728,6 +741,7 @@ namespace OnlineStore.DeviceLibrary
autoNext
=
false
;
IoCheckTimer
.
Enabled
=
false
;
serverConnectTimer
.
Enabled
=
false
;
ledCheckTimer
.
Enabled
=
false
;
StoreMove
.
EndMove
();
StopMove
(
true
);
...
...
@@ -748,7 +762,7 @@ namespace OnlineStore.DeviceLibrary
{
SaveAlarmInfo
(
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
autoNext
=
false
;
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
if
(
this
.
alarmType
.
Equals
(
alarmType
)
&&
alarmType
!=
StoreAlarmType
.
SuddenStop
&&
alarmType
!=
StoreAlarmType
.
NoAirCheck
)
{
return
;
...
...
@@ -1084,7 +1098,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
"IOTimeOutProcess出错:"
+
ex
.
ToString
());
}
}
//private DateTime preProTime = DateTime.Now;
/// <summary>
/// 超过配置次数时需要复位
/// </summary>
...
...
@@ -1092,6 +1106,12 @@ namespace OnlineStore.DeviceLibrary
{
try
{
//TimeSpan span = DateTime.Now - preProTime;
//if (span.TotalSeconds < 1)
//{
// return;
//}
//preProTime = DateTime.Now;
if
(
CurrInOutACount
>=
this
.
Config
.
Box_ResetACount
)
{
if
(
storeRunStatus
<
StoreRunStatus
.
Runing
||
StoreMove
.
MoveType
==
StoreMoveType
.
InStore
||
StoreMove
.
MoveType
==
StoreMoveType
.
OutStore
)
...
...
@@ -1394,6 +1414,7 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
#
region
与服务器通信定时器,每
1
秒向服务器通知一次状态
,
同时执行出库操作
public
string
CodeOrInoutMsg
=
""
;
private
bool
isInProcess
=
false
;
...
...
@@ -1418,7 +1439,7 @@ namespace OnlineStore.DeviceLibrary
//温湿度暂时注释
HumitureController
.
QueryData
();
HumidityProcess
();
LedProcess
();
//
LedProcess();
isInProcess
=
false
;
}
...
...
@@ -1701,13 +1722,21 @@ namespace OnlineStore.DeviceLibrary
}
else
{
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
);
if
(
CanStarInOut
())
{
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
plateH
,
plateW
),
!
isSingleOut
);
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
plateH
,
plateW
),
!
isSingleOut
);
if
(!
result
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
}
else
{
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:出库【"
+
posId
+
"】失败,当前在忙碌中"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,当前在忙碌中,加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
}
}
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
8474f71
...
...
@@ -82,7 +82,7 @@ namespace OnlineStore.DeviceLibrary
param
.
MoveP
.
BatchAxis_DownValue
=
AutomaticBaiting
.
AxisChangeValue
*
param
.
PlateH
+
Config
.
BatchAxis_OutDownPosition
;
//LogUtil.debug("【" + param.PositionNum + "】高度【" + param.PlateH + "】批量上下料轴需要下降【" + param.MoveP.BatchAxis_DownValue + "】");
param
.
MoveP
.
UpDown_P1
=
Config
.
GetUpDownP1
(
param
.
PlateH
);
LogUtil
.
info
(
"【"
+
param
.
PositionNum
+
"】高【"
+
param
.
PlateH
+
"】升降轴P1【"
+
param
.
MoveP
.
UpDown_P1
+
"】压紧轴P2【"
+
param
.
MoveP
.
ComPress_P2
+
"】批量上下料轴需要下降【"
+
param
.
MoveP
.
BatchAxis_DownValue
+
"】"
);
LogUtil
.
debug
(
"【"
+
param
.
PositionNum
+
"】高【"
+
param
.
PlateH
+
"】升降轴P1【"
+
param
.
MoveP
.
UpDown_P1
+
"】压紧轴P2【"
+
param
.
MoveP
.
ComPress_P2
+
"】批量上下料轴需要下降【"
+
param
.
MoveP
.
BatchAxis_DownValue
+
"】"
);
return
true
;
}
...
...
@@ -629,6 +629,7 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog
(
"出库:SO_01 定位气缸下降"
);
LocationDownAndWait
();
}
CodeOrInoutMsg
=
""
;
return
true
;
}
else
...
...
@@ -914,6 +915,7 @@ namespace OnlineStore.DeviceLibrary
public
void
UpdateInOutMsg
(
string
Msg
)
{
CodeOrInoutMsg
=
Msg
;
//WarnMsg = Msg;
LogUtil
.
error
(
Msg
);
}
public
bool
InOutAxisCanMove
()
...
...
source/DeviceLibrary/store/AC_Store.cs
查看文件 @
8474f71
...
...
@@ -73,6 +73,7 @@ namespace OnlineStore.DeviceLibrary
protected
System
.
Timers
.
Timer
mainTimer
;
protected
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
protected
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
protected
System
.
Timers
.
Timer
ledCheckTimer
=
new
System
.
Timers
.
Timer
();
public
AC_Store
()
{
}
...
...
@@ -94,9 +95,14 @@ namespace OnlineStore.DeviceLibrary
serverConnectTimer
.
Enabled
=
false
;
//serverConnectTimer.Elapsed += server_connect_timer_Tick;
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
IoCheckTimer
.
Interval
=
3
00
;
IoCheckTimer
.
Interval
=
2
00
;
IoCheckTimer
.
AutoReset
=
true
;
IoCheckTimer
.
Enabled
=
false
;
ledCheckTimer
=
new
System
.
Timers
.
Timer
();
ledCheckTimer
.
Interval
=
500
;
ledCheckTimer
.
AutoReset
=
true
;
ledCheckTimer
.
Enabled
=
false
;
//IoCheckTimer.Elapsed += IoCheckTimer_Elapsed;
}
...
...
source/DeviceLibrary/store/model/FixtureCodeInfo.cs
查看文件 @
8474f71
...
...
@@ -20,14 +20,15 @@ namespace OnlineStore.DeviceLibrary
this
.
PosId
=
posId
;
SetSize
();
}
//public FixtureCodeInfo(int trayCode, string wareNum, string posId,int platew, int plateh)
//{
// this.TrayCode = trayCode;
// this.WareNum = wareNum;
// this.PosId = posId;
// this.plateW = platew;
// this.plateH = plateh;
//}
public
FixtureCodeInfo
(
int
trayCode
,
string
wareNum
,
string
posId
,
int
platew
,
int
plateh
)
{
this
.
TrayCode
=
trayCode
;
this
.
WareNum
=
wareNum
;
this
.
PosId
=
posId
;
this
.
plateW
=
platew
;
this
.
plateH
=
plateh
;
}
public
void
SetSize
()
{
AutoStorePosition
position
=
CSVPositionReader
<
AutoStorePosition
>.
GetPositon
(
PosId
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论