Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7f886fa7
由
刘韬
编写于
2023-01-16 16:51:31 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'master' of
http://106.15.194.121:8083/liutao/1069_MIMO_PlUS
2 个父辈
cb0174dd
0a82a1e2
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
233 行增加
和
98 行删除
Common/Setting_Init.cs
Common/bean/Bean.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Store.cs
DeviceLibrary/theMachine/MainMachine_String.cs
DeviceLibrary/theMachine/RobotManage.cs
Common/Setting_Init.cs
查看文件 @
7f886fa
...
@@ -31,5 +31,9 @@ namespace OnlineStore.Common
...
@@ -31,5 +31,9 @@ namespace OnlineStore.Common
public
static
string
QRCodeCount
=
"QRCodeCount"
;
public
static
string
QRCodeCount
=
"QRCodeCount"
;
public
static
string
CodeTimeOut
=
"CodeTimeOut"
;
public
static
string
CodeTimeOut
=
"CodeTimeOut"
;
/// <summary>
/// 校准库位的料盘信息
/// </summary>
public
static
string
FixBuffInfo
=
"FixBuffInfo"
;
}
}
}
}
Common/bean/Bean.cs
查看文件 @
7f886fa
...
@@ -72,6 +72,7 @@ namespace OnlineStore.Common
...
@@ -72,6 +72,7 @@ namespace OnlineStore.Common
get
{
return
_data
;
}
get
{
return
_data
;
}
set
{
_data
=
value
;
}
set
{
_data
=
value
;
}
}
}
public
Dictionary
<
String
,
Dictionary
<
String
,
String
>>
mimoOpMap
=
new
Dictionary
<
string
,
Dictionary
<
string
,
string
>>();
/// <summary>
/// <summary>
/// 整体料仓状态
/// 整体料仓状态
/// 1=正常运行中
/// 1=正常运行中
...
@@ -291,5 +292,22 @@ namespace OnlineStore.Common
...
@@ -291,5 +292,22 @@ namespace OnlineStore.Common
public
static
string
disable
=
"disable"
;
public
static
string
disable
=
"disable"
;
public
static
string
queueTaskCount
=
"queueTaskCount"
;
public
static
string
queueTaskCount
=
"queueTaskCount"
;
/// <summary>
/// 贴标机交互按钮,出口 满料串取出
/// </summary>
public
static
string
SendFullShelf
=
"SendFullShelf"
;
/// <summary>
/// 贴标机交互按钮,出口 空料串送入
/// </summary>
public
static
string
NeedEmptySHelf
=
"NeedEmptySHelf"
;
/// <summary>
/// 贴标机交互按钮,入口 满料串送入
/// </summary>
public
static
string
NeedFullShelf
=
"NeedFullShelf"
;
/// <summary>
/// 贴标机交互按钮,入口 空料串取出
/// </summary>
public
static
string
SendEmptyShelf
=
"SendEmptyShelf"
;
}
}
}
}
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
7f886fa
...
@@ -14,10 +14,12 @@ namespace DeviceLibrary
...
@@ -14,10 +14,12 @@ namespace DeviceLibrary
partial
class
ServerCommunication
partial
class
ServerCommunication
{
{
volatile
StoreStatus
_storeStatus
=
StoreStatus
.
Debugging
;
volatile
StoreStatus
_storeStatus
=
StoreStatus
.
Debugging
;
public
StoreStatus
storeStatus
{
public
StoreStatus
storeStatus
{
get
=>
_storeStatus
;
get
=>
_storeStatus
;
set
{
set
if
(
_storeStatus
!=
value
)
{
if
(
_storeStatus
!=
value
)
LogUtil
.
info
(
$
"set storeStatus to {value}"
);
LogUtil
.
info
(
$
"set storeStatus to {value}"
);
_storeStatus
=
value
;
_storeStatus
=
value
;
}
}
...
@@ -25,13 +27,14 @@ namespace DeviceLibrary
...
@@ -25,13 +27,14 @@ namespace DeviceLibrary
static
string
server
=
ConfigHelper
.
Config
.
Get
(
"http_server"
);
static
string
server
=
ConfigHelper
.
Config
.
Get
(
"http_server"
);
static
string
CID
=
ConfigHelper
.
Config
.
Get
(
"CID"
);
static
string
CID
=
ConfigHelper
.
Config
.
Get
(
"CID"
);
int
StoreID
=
1
;
int
StoreID
=
1
;
string
StoreName
=
""
;
string
StoreName
=
""
;
string
WarnMsg
=
""
;
string
WarnMsg
=
""
;
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
object
serverclock
=
new
object
();
object
serverclock
=
new
object
();
public
ServerCommunication
()
{
public
ServerCommunication
()
{
serverConnectTimer
.
Interval
=
1000
;
serverConnectTimer
.
Interval
=
1000
;
serverConnectTimer
.
AutoReset
=
true
;
serverConnectTimer
.
AutoReset
=
true
;
serverConnectTimer
.
Enabled
=
true
;
serverConnectTimer
.
Enabled
=
true
;
...
@@ -65,17 +68,22 @@ namespace DeviceLibrary
...
@@ -65,17 +68,22 @@ namespace DeviceLibrary
{
{
LogUtil
.
info
(
$
"ServerConnectTimer_Elapsed:{ex}"
);
LogUtil
.
info
(
$
"ServerConnectTimer_Elapsed:{ex}"
);
}
}
finally
{
finally
{
//Monitor.Exit(serverConnectTimer);
//Monitor.Exit(serverConnectTimer);
}
}
}
}
public
void
StartConnectServer
()
{
public
void
StartConnectServer
()
{
//serverConnectTimer.Enabled = true;
//serverConnectTimer.Enabled = true;
}
public
void
StopConnectServer
()
{
}
public
void
StopConnectServer
()
{
//serverConnectTimer.Enabled = false;
//serverConnectTimer.Enabled = false;
}
}
public
void
ProcessMsg
(
List
<
Msg
>
msg
)
{
public
void
ProcessMsg
(
List
<
Msg
>
msg
)
{
WarnMsg
=
string
.
Join
(
","
,
msg
.
Select
(
x
=>
WarnMsg
=
string
.
Join
(
","
,
msg
.
Select
(
x
=>
{
{
if
(
x
.
msgLevel
==
MsgLevel
.
warning
||
x
.
msgLevel
==
MsgLevel
.
alarm
)
if
(
x
.
msgLevel
==
MsgLevel
.
warning
||
x
.
msgLevel
==
MsgLevel
.
alarm
)
...
@@ -84,9 +92,10 @@ namespace DeviceLibrary
...
@@ -84,9 +92,10 @@ namespace DeviceLibrary
}
}
return
null
;
return
null
;
}
}
).
Where
(
x
=>
!
string
.
IsNullOrEmpty
(
x
)));
).
Where
(
x
=>
!
string
.
IsNullOrEmpty
(
x
)));
}
}
public
void
SendInStoreRequest
(
string
[]
codelist
,
ReelParam
reel
,
bool
printlog
=
false
)
{
public
void
SendInStoreRequest
(
string
[]
codelist
,
ReelParam
reel
,
bool
printlog
=
false
)
{
if
(
RobotManage
.
InoutDebugMode
)
if
(
RobotManage
.
InoutDebugMode
)
return
;
return
;
...
@@ -97,7 +106,7 @@ namespace DeviceLibrary
...
@@ -97,7 +106,7 @@ namespace DeviceLibrary
operation
.
op
=
1
;
operation
.
op
=
1
;
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
code
},
{
"boxId"
,
StoreID
.
ToString
()
},
{
"doorReelSignal"
,
"1"
}
};
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
code
},
{
"boxId"
,
StoreID
.
ToString
()
},
{
"doorReelSignal"
,
"1"
}
};
if
(
reel
.
PlateH
==
100
&&
ConfigHelper
.
Config
.
Get
(
"Device_SingleInSingleOut"
,
false
))
if
(
reel
.
PlateH
==
100
&&
ConfigHelper
.
Config
.
Get
(
"Device_SingleInSingleOut"
,
false
))
{
{
//singleIn 单盘入库
//singleIn 单盘入库
operation
.
data
.
Add
(
"singleIn"
,
"true"
);
operation
.
data
.
Add
(
"singleIn"
,
"true"
);
...
@@ -123,7 +132,7 @@ namespace DeviceLibrary
...
@@ -123,7 +132,7 @@ namespace DeviceLibrary
Operation
operation
=
getLineBoxStatus
();
Operation
operation
=
getLineBoxStatus
();
if
(!
string
.
IsNullOrEmpty
(
posid
))
if
(!
string
.
IsNullOrEmpty
(
posid
))
operation
.
boxStatus
[
StoreID
].
data
.
Add
(
ParamDefine
.
posId
,
posid
);
operation
.
boxStatus
[
StoreID
].
data
.
Add
(
ParamDefine
.
posId
,
posid
);
operation
.
boxStatus
[
StoreID
].
status
=
(
int
)
storeStatus
;
operation
.
boxStatus
[
StoreID
].
status
=
(
int
)
storeStatus
;
LogUtil
.
info
(
JsonHelper
.
SerializeObject
(
operation
));
LogUtil
.
info
(
JsonHelper
.
SerializeObject
(
operation
));
...
@@ -136,7 +145,8 @@ namespace DeviceLibrary
...
@@ -136,7 +145,8 @@ namespace DeviceLibrary
LogUtil
.
info
(
$
"SendStoreState error,posid:{posid}, storeStatus:{storeStatus}"
);
LogUtil
.
info
(
$
"SendStoreState error,posid:{posid}, storeStatus:{storeStatus}"
);
return
false
;
return
false
;
}
}
if
(
operation
.
seq
!=
resultOperation
.
seq
)
{
if
(
operation
.
seq
!=
resultOperation
.
seq
)
{
LogUtil
.
info
(
$
"SendStoreState seq error,posid:{posid}, storeStatus:{storeStatus}"
);
LogUtil
.
info
(
$
"SendStoreState seq error,posid:{posid}, storeStatus:{storeStatus}"
);
return
false
;
return
false
;
}
}
...
@@ -144,26 +154,25 @@ namespace DeviceLibrary
...
@@ -144,26 +154,25 @@ namespace DeviceLibrary
LogUtil
.
info
(
$
"SendStoreState success,posid:{posid}, storeStatus:{storeStatus}"
);
LogUtil
.
info
(
$
"SendStoreState success,posid:{posid}, storeStatus:{storeStatus}"
);
ResultProcess
(
resultOperation
);
ResultProcess
(
resultOperation
);
if
(
storeStatus
==
StoreStatus
.
OutStoreEnd
||
//if (storeStatus == StoreStatus.OutStoreEnd ||
storeStatus
==
StoreStatus
.
OutStoreBoxEnd
||
// storeStatus == StoreStatus.OutStoreBoxEnd ||
storeStatus
==
StoreStatus
.
InStoreEnd
)
// storeStatus == StoreStatus.InStoreEnd)
{
//{
this
.
storeStatus
=
StoreStatus
.
StoreOnline
;
// this.storeStatus = StoreStatus.StoreOnline;
}
//}
}
}
return
true
;
return
true
;
}
}
public
string
spiltStr
=
"##"
;
public
string
spiltStr
=
"##"
;
private
string
ProcessCode
(
string
[]
codeList
,
int
reelw
,
int
reelh
)
private
string
ProcessCode
(
string
[]
codeList
,
int
reelw
,
int
reelh
)
{
{
string
message
=
""
;
string
message
=
""
;
//= 7x12 = CODE
//= 7x12 = CODE
foreach
(
string
str
in
codeList
)
foreach
(
string
str
in
codeList
)
{
{
string
code
=
str
.
Replace
(
"\r"
,
""
);
string
code
=
str
.
Replace
(
"\r"
,
""
);
code
=
code
.
Replace
(
"\n"
,
""
);
code
=
code
.
Replace
(
"\n"
,
""
);
//根据二维码开头获取固定尺寸
//根据二维码开头获取固定尺寸
string
codeSize
=
$
"{reelw}x{reelh}"
;
string
codeSize
=
$
"{reelw}x{reelh}"
;
message
=
message
+
"="
+
"1+0x0-"
+
codeSize
+
"="
+
code
+
spiltStr
;
message
=
message
+
"="
+
"1+0x0-"
+
codeSize
+
"="
+
code
+
spiltStr
;
...
@@ -185,10 +194,9 @@ namespace DeviceLibrary
...
@@ -185,10 +194,9 @@ namespace DeviceLibrary
lineOperation
.
status
=
1
;
lineOperation
.
status
=
1
;
lineOperation
.
data
=
new
Dictionary
<
string
,
string
>();
lineOperation
.
data
=
new
Dictionary
<
string
,
string
>();
lineOperation
.
data
=
lineOperation
.
data
.
Concat
(
GetBtnStatus
()).
ToDictionary
(
x
=>
x
.
Key
,
v
=>
v
.
Value
);
lineOperation
.
data
=
lineOperation
.
data
.
Concat
(
GetBtnStatus
()).
ToDictionary
(
x
=>
x
.
Key
,
v
=>
v
.
Value
);
lineOperation
.
data
=
lineOperation
.
data
.
Concat
(
AgvStatus
()).
ToDictionary
(
x
=>
x
.
Key
,
v
=>
v
.
Value
);
lineOperation
.
data
=
lineOperation
.
data
.
Concat
(
AgvStatus
()).
ToDictionary
(
x
=>
x
.
Key
,
v
=>
v
.
Value
);
lineOperation
.
status
=
(
int
)
storeStatus
;
lineOperation
.
status
=
(
int
)
storeStatus
;
//判断如果是等待料盘拿走超时,状态改为4Warning
//判断如果是等待料盘拿走超时,状态改为4Warning
//if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && StoreMove.MoveType.Equals(StoreMoveType.OutStore))
//if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && StoreMove.MoveType.Equals(StoreMoveType.OutStore))
//{
//{
...
@@ -220,14 +228,15 @@ namespace DeviceLibrary
...
@@ -220,14 +228,15 @@ namespace DeviceLibrary
else
if
(!
string
.
IsNullOrEmpty
(
WarnMsg
))
else
if
(!
string
.
IsNullOrEmpty
(
WarnMsg
))
{
{
sendmsg
=
string
.
Join
(
","
,
new
string
[]
{
WarnMsg
});
sendmsg
=
string
.
Join
(
","
,
new
string
[]
{
WarnMsg
});
//lineOperation.msgData["zh"] = lineOperation.msg;
//lineOperation.msgData["zh"] = lineOperation.msg;
//lineOperation.msgData["en"] = lineOperation.msg;
//lineOperation.msgData["en"] = lineOperation.msg;
//lineOperation.msgData["jp"] = lineOperation.msg;
//lineOperation.msgData["jp"] = lineOperation.msg;
//lineOperation.status = (int)StoreStatus.Warning;
//lineOperation.status = (int)StoreStatus.Warning;
}
}
else
if
(!
RobotManage
.
isRunning
){
else
if
(!
RobotManage
.
isRunning
)
sendmsg
=
crc
.
GetString
(
"Res0001"
,
"设备未启动"
);
{
sendmsg
=
crc
.
GetString
(
"Res0001"
,
"设备未启动"
);
}
}
lineOperation
.
msg
=
sendmsg
;
lineOperation
.
msg
=
sendmsg
;
...
@@ -293,13 +302,14 @@ namespace DeviceLibrary
...
@@ -293,13 +302,14 @@ namespace DeviceLibrary
}
}
}
}
if
(
lineOperation
.
status
!=
laststatus
)
{
if
(
lineOperation
.
status
!=
laststatus
)
{
laststatus
=
lineOperation
.
status
;
laststatus
=
lineOperation
.
status
;
printlog
=
true
;
printlog
=
true
;
}
}
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
lineOperation
,
700
,
printlog
);
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
lineOperation
,
700
,
printlog
);
if
(
resultOperation
!=
null
)
if
(
resultOperation
!=
null
)
getthtime
=
0
;
getthtime
=
0
;
//LogUtil.info(JsonHelper.SerializeObject(resultOperation.data));
//LogUtil.info(JsonHelper.SerializeObject(resultOperation.data));
...
@@ -311,7 +321,7 @@ namespace DeviceLibrary
...
@@ -311,7 +321,7 @@ namespace DeviceLibrary
}
}
}
}
}
}
public
int
queueTaskCount
=
-
1
;
public
int
queueTaskCount
=
-
1
;
ConcurrentQueue
<
string
>
commandResultMsg
=
new
ConcurrentQueue
<
string
>();
ConcurrentQueue
<
string
>
commandResultMsg
=
new
ConcurrentQueue
<
string
>();
void
ResultProcess
(
Operation
resultOperation
)
void
ResultProcess
(
Operation
resultOperation
)
{
{
...
@@ -344,7 +354,7 @@ namespace DeviceLibrary
...
@@ -344,7 +354,7 @@ namespace DeviceLibrary
AgvProcess
(
dataMap
);
AgvProcess
(
dataMap
);
string
result
=
""
;
string
result
=
""
;
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
queueTaskCount
))
if
(
dataMap
.
ContainsKey
(
ParamDefine
.
queueTaskCount
))
{
{
...
@@ -406,8 +416,8 @@ namespace DeviceLibrary
...
@@ -406,8 +416,8 @@ namespace DeviceLibrary
}
}
...
@@ -421,7 +431,12 @@ namespace DeviceLibrary
...
@@ -421,7 +431,12 @@ namespace DeviceLibrary
map
.
Add
(
ParamDefine
.
confirmReelOut
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
confirmReelOut
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
singleReelIn
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
singleReelIn
,
ParamDefine
.
disable
);
if
(
storeStatus
==
StoreStatus
.
ResetMove
map
.
Add
(
ParamDefine
.
SendEmptyShelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
SendFullShelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
NeedEmptySHelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
NeedFullShelf
,
ParamDefine
.
disable
);
if
(
storeStatus
==
StoreStatus
.
ResetMove
||
storeStatus
==
StoreStatus
.
SuddenStop
||
storeStatus
==
StoreStatus
.
SuddenStop
||
storeStatus
==
StoreStatus
.
Debugging
||
storeStatus
==
StoreStatus
.
Debugging
)
)
...
@@ -429,7 +444,7 @@ namespace DeviceLibrary
...
@@ -429,7 +444,7 @@ namespace DeviceLibrary
if
(
//RobotManage.mainMachine.IOValue(IO_Type.StringDoor_Close).Equals(IO_VALUE.HIGH) &&
if
(
//RobotManage.mainMachine.IOValue(IO_Type.StringDoor_Close).Equals(IO_VALUE.HIGH) &&
(
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
(
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
||
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
==
MoveStep
.
Wait
))
||
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
==
MoveStep
.
Wait
))
{
{
//map.Add(ParamDefine.doorStatus, "料串门关闭");
//map.Add(ParamDefine.doorStatus, "料串门关闭");
...
@@ -440,7 +455,7 @@ namespace DeviceLibrary
...
@@ -440,7 +455,7 @@ namespace DeviceLibrary
map
[
ParamDefine
.
closeLock
]
=
ParamDefine
.
enable
;
map
[
ParamDefine
.
closeLock
]
=
ParamDefine
.
enable
;
//map.Add(ParamDefine.doorStatus, "料串门打开");
//map.Add(ParamDefine.doorStatus, "料串门打开");
}
}
if
(
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
>=
MoveStep
.
StringLoad_04
if
(
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
>=
MoveStep
.
StringLoad_04
&&
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
<
MoveStep
.
StringOut_01
)
&&
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
<
MoveStep
.
StringOut_01
)
map
[
ParamDefine
.
takeOutReel
]
=
ParamDefine
.
enable
;
map
[
ParamDefine
.
takeOutReel
]
=
ParamDefine
.
enable
;
...
@@ -449,10 +464,57 @@ namespace DeviceLibrary
...
@@ -449,10 +464,57 @@ namespace DeviceLibrary
map
[
ParamDefine
.
confirmReelOut
]
=
ParamDefine
.
enable
;
map
[
ParamDefine
.
confirmReelOut
]
=
ParamDefine
.
enable
;
}
}
if
(
RobotManage
.
mainMachine
.
StringType
==
MainMachine
.
StringTypeE
.
Out
||
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
if
(
RobotManage
.
mainMachine
.
StringType
==
MainMachine
.
StringTypeE
.
Out
||
RobotManage
.
mainMachine
.
StringMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
{
map
[
ParamDefine
.
singleReelIn
]
=
ParamDefine
.
enable
;
map
[
ParamDefine
.
singleReelIn
]
=
ParamDefine
.
enable
;
}
}
map
.
Add
(
ParamDefine
.
SendEmptyShelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
SendFullShelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
NeedEmptySHelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
NeedFullShelf
,
ParamDefine
.
disable
);
if
(
RobotManage
.
mainMachine
?.
StringState
==
MainMachine
.
StringStateE
.
None
)
{
map
[
ParamDefine
.
NeedEmptySHelf
]
=
ParamDefine
.
enable
;
map
[
ParamDefine
.
NeedFullShelf
]
=
ParamDefine
.
enable
;
}
if
(
RobotManage
.
mainMachine
?.
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
)
{
if
(
RobotManage
.
mainMachine
.
StringState
==
MainMachine
.
StringStateE
.
Full
)
{
map
[
ParamDefine
.
SendFullShelf
]
=
ParamDefine
.
enable
;
}
else
{
map
[
ParamDefine
.
SendEmptyShelf
]
=
ParamDefine
.
enable
;
}
}
return
map
;
}
public
Dictionary
<
string
,
string
>
GetAgvBtnStatus
()
{
//mimo呼叫agv按钮
Dictionary
<
string
,
string
>
map
=
new
Dictionary
<
string
,
string
>();
map
.
Add
(
ParamDefine
.
SendEmptyShelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
SendFullShelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
NeedEmptySHelf
,
ParamDefine
.
disable
);
map
.
Add
(
ParamDefine
.
NeedFullShelf
,
ParamDefine
.
disable
);
if
(
RobotManage
.
mainMachine
?.
StringState
==
MainMachine
.
StringStateE
.
None
)
{
map
[
ParamDefine
.
NeedEmptySHelf
]
=
ParamDefine
.
enable
;
map
[
ParamDefine
.
NeedFullShelf
]
=
ParamDefine
.
enable
;
}
if
(
RobotManage
.
mainMachine
?.
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
)
{
if
(
RobotManage
.
mainMachine
.
StringState
==
MainMachine
.
StringStateE
.
Full
)
{
map
[
ParamDefine
.
SendFullShelf
]
=
ParamDefine
.
enable
;
}
else
{
map
[
ParamDefine
.
SendEmptyShelf
]
=
ParamDefine
.
enable
;
}
}
return
map
;
return
map
;
}
}
/// <summary>
/// <summary>
...
@@ -486,7 +548,7 @@ namespace DeviceLibrary
...
@@ -486,7 +548,7 @@ namespace DeviceLibrary
{
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
WarnMsg
=
crc
.
GetString
(
L
.
in_store_nothave_position
,
"入库未找到库位:"
)
+
posId
;
//0505
WarnMsg
=
crc
.
GetString
(
L
.
in_store_nothave_position
,
"入库未找到库位:"
)
+
posId
;
//0505
LogUtil
.
info
(
"收到服务器入库命令:入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
LogUtil
.
info
(
"收到服务器入库命令:入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
return
;
}
}
...
@@ -512,10 +574,11 @@ namespace DeviceLibrary
...
@@ -512,10 +574,11 @@ namespace DeviceLibrary
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
//RobotManage.mainMachine.ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_01);
//RobotManage.mainMachine.ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_01);
RobotManage
.
mainMachine
.
NGPuted
(
msg
);
RobotManage
.
mainMachine
.
NGPuted
(
msg
);
LogUtil
.
info
(
"服务器没有正确返回库位. msg="
+
msg
);
LogUtil
.
info
(
"服务器没有正确返回库位. msg="
+
msg
);
}
}
else
{
else
{
}
}
}
}
...
@@ -535,13 +598,13 @@ namespace DeviceLibrary
...
@@ -535,13 +598,13 @@ namespace DeviceLibrary
{
{
string
maxHumidity
=
data
[
ParamDefine
.
maxHumidity
];
string
maxHumidity
=
data
[
ParamDefine
.
maxHumidity
];
string
maxTemp
=
data
[
ParamDefine
.
maxTemperature
];
string
maxTemp
=
data
[
ParamDefine
.
maxTemperature
];
LogUtil
.
info
(
"收到服务器温湿度预警值:maxHumidity="
+
maxHumidity
+
",maxTemperature="
+
maxTemp
);
LogUtil
.
info
(
"收到服务器温湿度预警值:maxHumidity="
+
maxHumidity
+
",maxTemperature="
+
maxTemp
);
try
try
{
{
this
.
Max_Humidity
=
(
float
)
Convert
.
ToDouble
(
maxHumidity
);
this
.
Max_Humidity
=
(
float
)
Convert
.
ToDouble
(
maxHumidity
);
this
.
Max_Temperature
=
(
float
)
Convert
.
ToDouble
(
maxTemp
);
this
.
Max_Temperature
=
(
float
)
Convert
.
ToDouble
(
maxTemp
);
LogUtil
.
info
(
"保存温湿度预警值:Max_Humidity="
+
Max_Humidity
+
",Max_Temperature="
+
Max_Temperature
);
LogUtil
.
info
(
"保存温湿度预警值:Max_Humidity="
+
Max_Humidity
+
",Max_Temperature="
+
Max_Temperature
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
@@ -585,13 +648,13 @@ namespace DeviceLibrary
...
@@ -585,13 +648,13 @@ namespace DeviceLibrary
{
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg
=
StoreName
+
"出库未找库位:【"
+
posId
+
"】"
;
WarnMsg
=
StoreName
+
"出库未找库位:【"
+
posId
+
"】"
;
LogUtil
.
error
(
"收到服务器出库命令:未找到【"
+
posId
+
"】的库位信息"
);
LogUtil
.
error
(
"收到服务器出库命令:未找到【"
+
posId
+
"】的库位信息"
);
continue
;
continue
;
}
}
else
else
{
{
if
(
isSingleOut
)
if
(
isSingleOut
)
RobotManage
.
mainMachine
.
AddSingleStoreTask
(
posId
,
plateW
,
plateH
);
RobotManage
.
mainMachine
.
AddSingleStoreTask
(
posId
,
plateW
,
plateH
);
else
else
RobotManage
.
mainMachine
.
AddOutStoreTask
(
posId
,
plateW
,
plateH
);
RobotManage
.
mainMachine
.
AddOutStoreTask
(
posId
,
plateW
,
plateH
);
}
}
...
@@ -730,6 +793,6 @@ namespace DeviceLibrary
...
@@ -730,6 +793,6 @@ namespace DeviceLibrary
/// 扫码入库失败
/// 扫码入库失败
/// </summary>
/// </summary>
InStoreError
=
14
,
InStoreError
=
14
,
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
7f886fa
...
@@ -190,6 +190,7 @@ namespace DeviceLibrary
...
@@ -190,6 +190,7 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
StoreFIX01
:
case
MoveStep
.
StoreFIX01
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreFIX02
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreFIX02
);
RobotManage
.
PutReelInFixPos
(
MoveInfo
.
MoveParam
);
Middle_Axis
.
AbsMove
(
MoveInfo
,
Fix
.
Middle_P2
,
Config
.
Middle_P2_speed
);
Middle_Axis
.
AbsMove
(
MoveInfo
,
Fix
.
Middle_P2
,
Config
.
Middle_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:行走机构到达目的地:{Fix.Middle_P2}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:行走机构到达目的地:{Fix.Middle_P2}"
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
Fix
.
UpDown_PH
,
Config
.
UpDown_P1_speed
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
Fix
.
UpDown_PH
,
Config
.
UpDown_P1_speed
);
...
@@ -226,6 +227,7 @@ namespace DeviceLibrary
...
@@ -226,6 +227,7 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
StoreTS10
:
case
MoveStep
.
StoreTS10
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS11
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS11
);
RobotManage
.
ClearReelInFixPos
();
Middle_Axis
.
AbsMove
(
MoveInfo
,
To
.
Middle_P2
,
Config
.
Middle_P2_speed
);
Middle_Axis
.
AbsMove
(
MoveInfo
,
To
.
Middle_P2
,
Config
.
Middle_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:行走机构到达目的地:{To.Middle_P2}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:行走机构到达目的地:{To.Middle_P2}"
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
To
.
UpDown_PH
,
Config
.
UpDown_P1_speed
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
To
.
UpDown_PH
,
Config
.
UpDown_P1_speed
);
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
7f886fa
...
@@ -535,6 +535,17 @@ namespace DeviceLibrary
...
@@ -535,6 +535,17 @@ namespace DeviceLibrary
ServerCM
.
storeStatus
=
StoreStatus
.
OutStoreExecute
;
ServerCM
.
storeStatus
=
StoreStatus
.
OutStoreExecute
;
CloseFlipDoor
(
StoreMoveInfo
);
CloseFlipDoor
(
StoreMoveInfo
);
}
}
else
if
((
RobotManage
.
HasReelInFixPos
(
out
ReelParam
reelParam
))
&&
boxTransport
.
IsComplateOrFree
&&
ClampMoveInfo
.
MoveStep
==
MoveStep
.
Wait
&&
ConfigHelper
.
Config
.
Get
(
"Device_Use_Fixpos"
,
false
)
&&
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
{
var
pos
=
BoxStorePosition
.
GetFixPos
(
Config
,
reelParam
);
LogUtil
.
info
(
$
"复位完成,校准库位出库:{pos.posid}"
);
RobotManage
.
mainMachine
.
AddSingleStoreTask
(
pos
.
posid
,
reelParam
.
PlateW
,
reelParam
.
PlateH
);
RobotManage
.
ClearReelInFixPos
();
CloseFlipDoor
(
StoreMoveInfo
);
}
runStatus
=
RunStatus
.
Running
;
runStatus
=
RunStatus
.
Running
;
ServerCM
.
storeStatus
=
StoreStatus
.
StoreOnline
;
ServerCM
.
storeStatus
=
StoreStatus
.
StoreOnline
;
break
;
break
;
...
...
DeviceLibrary/theMachine/MainMachine_Store.cs
查看文件 @
7f886fa
...
@@ -16,8 +16,9 @@ namespace DeviceLibrary
...
@@ -16,8 +16,9 @@ namespace DeviceLibrary
StoreJobList
OutStoreJobList
=
new
StoreJobList
(
$
"批量"
);
StoreJobList
OutStoreJobList
=
new
StoreJobList
(
$
"批量"
);
StoreJobList
OutSingleJobList
=
new
StoreJobList
(
$
"单盘"
);
StoreJobList
OutSingleJobList
=
new
StoreJobList
(
$
"单盘"
);
public
void
AddOutStoreTask
(
string
posId
,
int
plateW
,
int
plateH
)
{
public
void
AddOutStoreTask
(
string
posId
,
int
plateW
,
int
plateH
)
JobInfo
jobInfo
=
new
JobInfo
(
""
,
posId
,
plateW
,
plateH
);
{
JobInfo
jobInfo
=
new
JobInfo
(
""
,
posId
,
plateW
,
plateH
);
OutStoreJobList
.
Enqueue
(
jobInfo
);
OutStoreJobList
.
Enqueue
(
jobInfo
);
LogUtil
.
info
(
$
"添加出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}"
);
LogUtil
.
info
(
$
"添加出库任务队列: {posId},当前任务数量: {OutStoreJobList.Count}"
);
}
}
...
@@ -54,6 +55,7 @@ namespace DeviceLibrary
...
@@ -54,6 +55,7 @@ namespace DeviceLibrary
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn01
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn01
);
StoreMoveInfo
.
MoveParam
=
ClampMoveInfo
.
MoveParam
.
clone
();
StoreMoveInfo
.
MoveParam
=
ClampMoveInfo
.
MoveParam
.
clone
();
StoreMoveInfo
.
log
(
$
"入库料盘已准备好"
);
StoreMoveInfo
.
log
(
$
"入库料盘已准备好"
);
ServerCM
.
storeStatus
=
StoreStatus
.
InStoreExecute
;
}
}
//判断有没有单盘出库任务, 需要入库空闲, 出口空闲
//判断有没有单盘出库任务, 需要入库空闲, 出口空闲
else
if
(
OutSingleJobList
.
Count
>
0
&&
boxTransport
.
IsComplateOrFree
&&
ClampMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
else
if
(
OutSingleJobList
.
Count
>
0
&&
boxTransport
.
IsComplateOrFree
&&
ClampMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
...
@@ -63,11 +65,11 @@ namespace DeviceLibrary
...
@@ -63,11 +65,11 @@ namespace DeviceLibrary
if
(!
boxTransport
.
IgnoreX09
&&
IOMonitor
.
IODebound
(
IO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
1000
))
if
(!
boxTransport
.
IgnoreX09
&&
IOMonitor
.
IODebound
(
IO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
1000
))
{
{
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
//RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
//RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
}
}
else
else
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
else
else
...
@@ -87,18 +89,18 @@ namespace DeviceLibrary
...
@@ -87,18 +89,18 @@ namespace DeviceLibrary
}
}
}
}
//判断有没有出库任务, 需要入库空闲, 出口空闲
//判断有没有出库任务, 需要入库空闲, 出口空闲
else
if
(
OutStoreJobList
.
Count
>
0
&&
boxTransport
.
IsComplateOrFree
)
else
if
(
OutStoreJobList
.
Count
>
0
&&
boxTransport
.
IsComplateOrFree
)
{
{
if
(!
boxTransport
.
IgnoreX09
&&
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(!
boxTransport
.
IgnoreX09
&&
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
if
(!
boxTransport
.
IgnoreX09
&&
IOMonitor
.
IODebound
(
IO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
1000
))
if
(!
boxTransport
.
IgnoreX09
&&
IOMonitor
.
IODebound
(
IO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
1000
))
{
{
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
//RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
//RobotManage.UserPause("收到出库任务,但料叉上有料,无法启动,请检查");
}
}
else
else
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0004"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
else
else
...
@@ -110,7 +112,7 @@ namespace DeviceLibrary
...
@@ -110,7 +112,7 @@ namespace DeviceLibrary
StoreMoveInfo
.
MoveParam
.
PosID
=
jobInfo
.
PosId
;
StoreMoveInfo
.
MoveParam
.
PosID
=
jobInfo
.
PosId
;
StoreMoveInfo
.
MoveParam
.
PlateH
=
jobInfo
.
plateH
;
StoreMoveInfo
.
MoveParam
.
PlateH
=
jobInfo
.
plateH
;
StoreMoveInfo
.
MoveParam
.
PlateW
=
jobInfo
.
plateW
;
StoreMoveInfo
.
MoveParam
.
PlateW
=
jobInfo
.
plateW
;
StoreMoveInfo
.
log
(
$
"开始出库任务:"
+
jobInfo
.
ToStr
());
StoreMoveInfo
.
log
(
$
"开始出库任务:"
+
jobInfo
.
ToStr
());
ServerCM
.
storeStatus
=
StoreStatus
.
OutStoreExecute
;
ServerCM
.
storeStatus
=
StoreStatus
.
OutStoreExecute
;
}
}
}
}
...
@@ -118,13 +120,13 @@ namespace DeviceLibrary
...
@@ -118,13 +120,13 @@ namespace DeviceLibrary
case
MoveStep
.
StoreIn01
:
case
MoveStep
.
StoreIn01
:
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreExecute
))
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreExecute
))
{
{
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn03
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn03
);
var
ac
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
StoreMoveInfo
.
MoveParam
.
PosID
);
var
ac
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
StoreMoveInfo
.
MoveParam
.
PosID
);
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
StoreSide
.
NGDoor
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
ac
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
boxTransport
.
Start
(
new
BoxStorePosition
(
Config
,
StoreSide
.
NGDoor
,
StoreMoveInfo
.
MoveParam
),
new
BoxStorePosition
(
Config
,
ac
,
StoreMoveInfo
.
MoveParam
),
StoreMoveType
.
InStore
,
true
);
StoreMoveInfo
.
log
(
$
"开始转运料盘"
);
StoreMoveInfo
.
log
(
$
"开始转运料盘"
);
break
;
break
;
case
MoveStep
.
StoreIn02
:
case
MoveStep
.
StoreIn02
:
break
;
break
;
...
@@ -145,12 +147,12 @@ namespace DeviceLibrary
...
@@ -145,12 +147,12 @@ namespace DeviceLibrary
{
{
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreEnd
))
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreEnd
))
{
{
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
StoreMoveInfo
.
EndMove
();
StoreMoveInfo
.
EndMove
();
}
}
break
;
break
;
case
MoveStep
.
StoreOut_NGPre
:
case
MoveStep
.
StoreOut_NGPre
:
...
@@ -159,18 +161,18 @@ namespace DeviceLibrary
...
@@ -159,18 +161,18 @@ namespace DeviceLibrary
case
MoveStep
.
StoreOut10
:
case
MoveStep
.
StoreOut10
:
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreExecute
))
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreExecute
))
{
{
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut11
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut11
);
var
outFrom
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
StoreMoveInfo
.
MoveParam
.
PosID
);
var
outFrom
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
StoreMoveInfo
.
MoveParam
.
PosID
);
BoxStorePosition
outTo
;
BoxStorePosition
outTo
;
if
(
StoreMoveInfo
.
MoveParam
.
IsNg
)
if
(
StoreMoveInfo
.
MoveParam
.
IsNg
)
outTo
=
new
BoxStorePosition
(
Config
,
StoreSide
.
NGDoor
,
StoreMoveInfo
.
MoveParam
);
outTo
=
new
BoxStorePosition
(
Config
,
StoreSide
.
NGDoor
,
StoreMoveInfo
.
MoveParam
);
else
else
outTo
=
new
BoxStorePosition
(
Config
,
StoreSide
.
String
,
StoreMoveInfo
.
MoveParam
);
outTo
=
new
BoxStorePosition
(
Config
,
StoreSide
.
String
,
StoreMoveInfo
.
MoveParam
);
boxTransport
.
Start
(
outFrom
==
null
?
null
:
new
BoxStorePosition
(
Config
,
outFrom
,
StoreMoveInfo
.
MoveParam
),
outTo
,
StoreMoveType
.
OutStore
);
boxTransport
.
Start
(
outFrom
==
null
?
null
:
new
BoxStorePosition
(
Config
,
outFrom
,
StoreMoveInfo
.
MoveParam
),
outTo
,
StoreMoveType
.
OutStore
);
StoreMoveInfo
.
log
(
$
"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "
单料口
" : "
料串
")}"
);
StoreMoveInfo
.
log
(
$
"开始转运料盘{(StoreMoveInfo.MoveParam.IsNg ? "
单料口
" : "
料串
")}"
);
break
;
break
;
case
MoveStep
.
StoreOut11
:
case
MoveStep
.
StoreOut11
:
...
@@ -178,7 +180,7 @@ namespace DeviceLibrary
...
@@ -178,7 +180,7 @@ namespace DeviceLibrary
{
{
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreBoxEnd
))
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreBoxEnd
))
{
{
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut12
);
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut12
);
...
@@ -194,13 +196,13 @@ namespace DeviceLibrary
...
@@ -194,13 +196,13 @@ namespace DeviceLibrary
{
{
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreEnd
))
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreEnd
))
{
{
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0008"
,
"服务器连接异常"
),
MsgLevel
.
warning
);
return
;
return
;
}
}
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
if
(
StoreMoveInfo
.
MoveParam
.
IsNg
)
if
(
StoreMoveInfo
.
MoveParam
.
IsNg
)
{
{
NGPuted
(
StoreMoveInfo
.
MoveParam
.
NgMsg
);
NGPuted
(
StoreMoveInfo
.
MoveParam
.
NgMsg
);
OutSingleJobList
.
ClearLastPosid
(
StoreMoveInfo
.
MoveParam
.
PosID
);
OutSingleJobList
.
ClearLastPosid
(
StoreMoveInfo
.
MoveParam
.
PosID
);
}
}
...
@@ -209,7 +211,7 @@ namespace DeviceLibrary
...
@@ -209,7 +211,7 @@ namespace DeviceLibrary
ReelPutted
(
StoreMoveInfo
.
MoveParam
.
PlateH
);
ReelPutted
(
StoreMoveInfo
.
MoveParam
.
PlateH
);
OutStoreJobList
.
ClearLastPosid
(
StoreMoveInfo
.
MoveParam
.
PosID
);
OutStoreJobList
.
ClearLastPosid
(
StoreMoveInfo
.
MoveParam
.
PosID
);
}
}
StoreMoveInfo
.
EndMove
();
StoreMoveInfo
.
EndMove
();
}
}
break
;
break
;
...
@@ -218,8 +220,9 @@ namespace DeviceLibrary
...
@@ -218,8 +220,9 @@ namespace DeviceLibrary
break
;
break
;
}
}
}
}
string
StoreState
()
{
string
StoreState
()
string
state
=
crc
.
GetString
(
L
.
free
,
"空闲中"
);
{
string
state
=
crc
.
GetString
(
L
.
free
,
"空闲中"
);
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
)
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
)
{
{
state
=
$
"{crc.GetString(L.reel_outting, "
出库中
")},{crc.GetString(L.posnum, "
出库中
")}:{StoreMoveInfo.MoveParam.PosID}"
;
state
=
$
"{crc.GetString(L.reel_outting, "
出库中
")},{crc.GetString(L.posnum, "
出库中
")}:{StoreMoveInfo.MoveParam.PosID}"
;
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
7f886fa
...
@@ -59,9 +59,10 @@ namespace DeviceLibrary
...
@@ -59,9 +59,10 @@ namespace DeviceLibrary
/// <summary>
/// <summary>
/// 强制转换料串为出库模式
/// 强制转换料串为出库模式
/// </summary>
/// </summary>
public
bool
TurnToOut
()
{
public
bool
TurnToOut
()
{
if
(
StringState
==
StringStateE
.
OutStore
&&
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
)
if
(
StringState
==
StringStateE
.
OutStore
&&
StringMoveInfo
.
MoveStep
==
MoveStep
.
StringOut_Released
)
{
{
StringMoveInfo
.
log
(
$
"升起待机料串"
);
StringMoveInfo
.
log
(
$
"升起待机料串"
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_03
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_03
);
...
@@ -173,7 +174,7 @@ namespace DeviceLibrary
...
@@ -173,7 +174,7 @@ namespace DeviceLibrary
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
//CylinderMove(StringMoveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
//CylinderMove(StringMoveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
BatchAxisToP2
(
StringMoveInfo
,
StringState
==
StringStateE
.
OutStore
);
BatchAxisToP2
(
StringMoveInfo
,
StringState
==
StringStateE
.
OutStore
);
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0009"
,
"料串正在上升"
),
MsgLevel
.
warning
));
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0009"
,
"料串正在上升"
),
MsgLevel
.
warning
));
}
}
else
if
(
StringMoveInfo
.
IsTimeOut
(
10
))
else
if
(
StringMoveInfo
.
IsTimeOut
(
10
))
{
{
...
@@ -197,11 +198,11 @@ namespace DeviceLibrary
...
@@ -197,11 +198,11 @@ namespace DeviceLibrary
if
(
ConfigHelper
.
Config
.
Get
(
"Device_String_StandbyAtBottom"
,
true
)
&&
OutStoreJobList
.
Count
==
0
)
if
(
ConfigHelper
.
Config
.
Get
(
"Device_String_StandbyAtBottom"
,
true
)
&&
OutStoreJobList
.
Count
==
0
)
{
{
SetReelHeight
(
GetHeight
(
StringMoveInfo
));
SetReelHeight
(
GetHeight
(
StringMoveInfo
));
StringMoveInfo
.
log
(
$
"当
钱
空料串, 并且没有出库任务, 料串下降待机"
);
StringMoveInfo
.
log
(
$
"当
前
空料串, 并且没有出库任务, 料串下降待机"
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_01
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_01
);
}
}
}
}
else
if
(
StringState
!=
StringStateE
.
OutStore
)
else
if
(
StringState
!=
StringStateE
.
OutStore
)
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04a
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04a
);
StringState
=
StringStateE
.
InStore
;
StringState
=
StringStateE
.
InStore
;
...
@@ -244,7 +245,7 @@ namespace DeviceLibrary
...
@@ -244,7 +245,7 @@ namespace DeviceLibrary
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReadyGet
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReadyGet
);
StringMoveInfo
.
log
(
$
"料串有盘上升5mm"
);
StringMoveInfo
.
log
(
$
"料串有盘上升5mm"
);
var
tpos4
=
Batch_Axis
.
GetAclPosition
()
+
Config
.
Batch_PoToMM
*
(
Config
.
Batch_DetectDownMM
+
2
);
var
tpos4
=
Batch_Axis
.
GetAclPosition
()
+
Config
.
Batch_PoToMM
*
(
Config
.
Batch_DetectDownMM
+
2
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos4
,
Config
.
Batch_P1_speed
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos4
,
Config
.
Batch_P1_speed
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
//OpenFlipDoor(StringMoveInfo);
//OpenFlipDoor(StringMoveInfo);
...
@@ -291,7 +292,7 @@ namespace DeviceLibrary
...
@@ -291,7 +292,7 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
StringReelPut
:
case
MoveStep
.
StringReelPut
:
LastStringState
=
StringStateE
.
OutStore
;
LastStringState
=
StringStateE
.
OutStore
;
if
(
ConfigHelper
.
Config
.
Get
(
"Device_OutStoreStringReelCheck"
,
false
))
if
(
ConfigHelper
.
Config
.
Get
(
"Device_OutStoreStringReelCheck"
,
false
))
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_03
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_03
);
StringMoveInfo
.
log
(
$
"检测阻挡工作"
);
StringMoveInfo
.
log
(
$
"检测阻挡工作"
);
...
@@ -340,12 +341,12 @@ namespace DeviceLibrary
...
@@ -340,12 +341,12 @@ namespace DeviceLibrary
case
MoveStep
.
StringReelPut_02
:
case
MoveStep
.
StringReelPut_02
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04b
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04b
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
BatchAxisToP2
(
StringMoveInfo
,
true
);
BatchAxisToP2
(
StringMoveInfo
,
true
);
break
;
break
;
case
MoveStep
.
StringReelPut_03
:
case
MoveStep
.
StringReelPut_03
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_04
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_04
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
BatchAxisToP2
(
StringMoveInfo
,
true
);
BatchAxisToP2
(
StringMoveInfo
,
true
);
break
;
break
;
case
MoveStep
.
StringReelPut_04
:
case
MoveStep
.
StringReelPut_04
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_05
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_05
);
...
@@ -379,7 +380,7 @@ namespace DeviceLibrary
...
@@ -379,7 +380,7 @@ namespace DeviceLibrary
StringMoveInfo
.
log
(
$
"料串下降到P1点"
);
StringMoveInfo
.
log
(
$
"料串下降到P1点"
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
Config
.
Batch_P1
,
Config
.
Batch_P1_speed
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
Config
.
Batch_P1
,
Config
.
Batch_P1_speed
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
LOW
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
LOW
);
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0010"
,
"料串正在下降"
),
MsgLevel
.
warning
));
StringMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0010"
,
"料串正在下降"
),
MsgLevel
.
warning
));
break
;
break
;
case
MoveStep
.
StringOut_02
:
case
MoveStep
.
StringOut_02
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_03
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_03
);
...
@@ -392,6 +393,7 @@ namespace DeviceLibrary
...
@@ -392,6 +393,7 @@ namespace DeviceLibrary
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringFix_Bottom
,
IO_Type
.
StringFix_Top
,
IO_VALUE
.
LOW
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringFix_Bottom
,
IO_Type
.
StringFix_Top
,
IO_VALUE
.
LOW
);
break
;
break
;
case
MoveStep
.
StringOut_Released
:
case
MoveStep
.
StringOut_Released
:
ServerCM
.
storeStatus
=
StoreStatus
.
StoreOnline
;
if
(
StringState
==
StringStateE
.
Full
)
if
(
StringState
==
StringStateE
.
Full
)
Msg
.
add
(
crc
.
GetString
(
L
.
string_full_takeout
,
"料串已满请取出"
),
MsgLevel
.
warning
);
//0427
Msg
.
add
(
crc
.
GetString
(
L
.
string_full_takeout
,
"料串已满请取出"
),
MsgLevel
.
warning
);
//0427
else
else
...
@@ -445,14 +447,15 @@ namespace DeviceLibrary
...
@@ -445,14 +447,15 @@ namespace DeviceLibrary
}
}
}
}
string
StringProcessState
()
{
string
StringProcessState
()
{
string
state
=
""
;
string
state
=
""
;
if
(
StringState
==
StringStateE
.
OutStore
)
if
(
StringState
==
StringStateE
.
OutStore
)
state
=
crc
.
GetString
(
L
.
empty_reel
,
"空料串"
);
state
=
crc
.
GetString
(
L
.
empty_reel
,
"空料串"
);
else
if
(
StringState
==
StringStateE
.
Full
)
else
if
(
StringState
==
StringStateE
.
Full
)
{
{
state
=
crc
.
GetString
(
L
.
full_reel
,
"满料串"
);
state
=
crc
.
GetString
(
L
.
full_reel
,
"满料串"
);
}
}
else
if
(
StringState
==
StringStateE
.
InStore
)
else
if
(
StringState
==
StringStateE
.
InStore
)
...
@@ -488,14 +491,14 @@ namespace DeviceLibrary
...
@@ -488,14 +491,14 @@ namespace DeviceLibrary
int
targetSpeed
=
Config
.
Batch_P2_speed
;
int
targetSpeed
=
Config
.
Batch_P2_speed
;
if
(
isFirstMove
)
if
(
isFirstMove
)
{
{
targetSpeed
=
Config
.
Batch_P1_speed
;
targetSpeed
=
Config
.
Batch_P1_speed
;
}
}
moveInfo
.
log
(
"BatchAxisToP2 目标P2: "
+
targetP2
);
moveInfo
.
log
(
"BatchAxisToP2 目标P2: "
+
targetP2
);
moveInfo
.
TimeOutSeconds
=
200
;
moveInfo
.
TimeOutSeconds
=
200
;
moveInfo
.
CanWhileCount
=
0
;
moveInfo
.
CanWhileCount
=
0
;
Batch_Axis
.
SuddenStop
();
Batch_Axis
.
SuddenStop
();
// 需要增加定时器,获取验证信号并停止伺服
// 需要增加定时器,获取验证信号并停止伺服
StartMovePosition
=
Batch_Axis
.
GetAclPosition
()-
(
Config
.
Batch_PoToMM
*
2
);
StartMovePosition
=
Batch_Axis
.
GetAclPosition
()
-
(
Config
.
Batch_PoToMM
*
2
);
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitBatchAxisMove
(
Config
.
Batch_Axis
,
targetP2
,
targetSpeed
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitBatchAxisMove
(
Config
.
Batch_Axis
,
targetP2
,
targetSpeed
));
Config
.
Batch_Axis
.
TargetPosition
=
targetP2
;
Config
.
Batch_Axis
.
TargetPosition
=
targetP2
;
Batch_Axis
.
AbsMove
(
null
,
targetP2
,
targetSpeed
);
Batch_Axis
.
AbsMove
(
null
,
targetP2
,
targetSpeed
);
...
@@ -507,7 +510,7 @@ namespace DeviceLibrary
...
@@ -507,7 +510,7 @@ namespace DeviceLibrary
{
{
int
targetP1
=
Config
.
Batch_P1
;
int
targetP1
=
Config
.
Batch_P1
;
int
targetSpeed
=
Config
.
Batch_P2_speed
;
int
targetSpeed
=
Config
.
Batch_P2_speed
;
moveInfo
.
log
(
"BatchAxisToLow 目标P1: "
+
targetP1
);
moveInfo
.
log
(
"BatchAxisToLow 目标P1: "
+
targetP1
);
moveInfo
.
TimeOutSeconds
=
200
;
moveInfo
.
TimeOutSeconds
=
200
;
moveInfo
.
CanWhileCount
=
0
;
moveInfo
.
CanWhileCount
=
0
;
...
@@ -568,7 +571,8 @@ namespace DeviceLibrary
...
@@ -568,7 +571,8 @@ namespace DeviceLibrary
return
LastHeight
;
return
LastHeight
;
}
}
public
void
StringDoorOpen
(
MoveInfo
moveInfo
)
{
public
void
StringDoorOpen
(
MoveInfo
moveInfo
)
{
if
(
StringDoor
!=
null
)
if
(
StringDoor
!=
null
)
{
{
StringDoor
.
LiftUp
(
moveInfo
);
StringDoor
.
LiftUp
(
moveInfo
);
...
@@ -580,10 +584,12 @@ namespace DeviceLibrary
...
@@ -580,10 +584,12 @@ namespace DeviceLibrary
}
}
public
void
StringDoorClose
(
MoveInfo
moveInfo
)
public
void
StringDoorClose
(
MoveInfo
moveInfo
)
{
{
if
(
StringDoor
!=
null
)
{
if
(
StringDoor
!=
null
)
{
StringDoor
.
LiftDown
(
moveInfo
);
StringDoor
.
LiftDown
(
moveInfo
);
}
}
else
{
else
{
CylinderMove
(
moveInfo
,
IO_Type
.
StringDoor_Close
,
IO_Type
.
StringDoor_Open
,
IO_VALUE
.
LOW
);
CylinderMove
(
moveInfo
,
IO_Type
.
StringDoor_Close
,
IO_Type
.
StringDoor_Open
,
IO_VALUE
.
LOW
);
}
}
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
7f886fa
...
@@ -183,6 +183,34 @@ namespace DeviceLibrary
...
@@ -183,6 +183,34 @@ namespace DeviceLibrary
else
else
LogUtil
.
info
(
"用户取消忽略安全光栅"
);
LogUtil
.
info
(
"用户取消忽略安全光栅"
);
}
}
#
region
校准库位缓存
public
static
bool
HasReelInFixPos
(
out
ReelParam
reelParam
)
{
reelParam
=
null
;
try
{
string
fix
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
FixBuffInfo
,
""
);
if
(!
string
.
IsNullOrEmpty
(
fix
))
{
reelParam
=
JsonHelper
.
DeserializeJsonToObject
<
ReelParam
>(
fix
);
return
true
;
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"解析校准库位缓存异常"
,
e
);
}
return
false
;
}
public
static
void
PutReelInFixPos
(
ReelParam
reelParam
)
{
ConfigHelper
.
Config
.
Set
(
Setting_Init
.
FixBuffInfo
,
JsonHelper
.
SerializeObject
(
reelParam
));
}
public
static
void
ClearReelInFixPos
()
{
ConfigHelper
.
Config
.
Set
(
Setting_Init
.
FixBuffInfo
,
""
);
}
#
endregion
}
}
public
enum
StoreType
{
public
enum
StoreType
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论