Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
MIMO
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4b497d99
由
刘韬
编写于
2022-11-01 09:00:12 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
3a88735d
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
59 行增加
和
7 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/DeviceLibrary/SocketScanner.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/MainMachine _Common.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Clamp.cs
Common/Setting_Init.cs
查看文件 @
4b497d9
...
@@ -58,6 +58,12 @@ namespace OnlineStore.Common
...
@@ -58,6 +58,12 @@ namespace OnlineStore.Common
[
MyConfigComment
(
"出库时料串检测料盘高度"
)]
[
MyConfigComment
(
"出库时料串检测料盘高度"
)]
public
static
MyConfig
<
bool
>
Device_OutStoreStringReelCheck
=
false
;
public
static
MyConfig
<
bool
>
Device_OutStoreStringReelCheck
=
false
;
[
MyConfigComment
(
"是否启用库位屏蔽"
)]
public
static
MyConfig
<
bool
>
Device_DisableStorePosition
=
false
;
[
MyConfigComment
(
"管理员密码"
)]
[
MyConfigComment
(
"管理员密码"
)]
public
static
MyConfig
<
string
>
User_AdminPassword
=
"123456"
;
public
static
MyConfig
<
string
>
User_AdminPassword
=
"123456"
;
[
MyConfigComment
(
"启用管理员密码"
)]
[
MyConfigComment
(
"启用管理员密码"
)]
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
4b497d9
...
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
...
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace
DeviceLibrary
namespace
DeviceLibrary
{
{
class
ServerCommunication
public
class
ServerCommunication
{
{
volatile
StoreStatus
_storeStatus
=
StoreStatus
.
Debugging
;
volatile
StoreStatus
_storeStatus
=
StoreStatus
.
Debugging
;
public
StoreStatus
storeStatus
{
public
StoreStatus
storeStatus
{
...
@@ -625,6 +625,40 @@ namespace DeviceLibrary
...
@@ -625,6 +625,40 @@ namespace DeviceLibrary
}
}
return
msg
;
return
msg
;
}
}
public
string
DisabledPos
(
string
posId
,
string
barcode
)
{
string
msg
=
""
;
try
{
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"posId"
,
posId
);
paramMap
.
Add
(
"barcode"
,
barcode
);
string
server
=
GetAddr
(
"/service/store/disabledPos"
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
"DisabledPos "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
ResultData
data
=
JsonHelper
.
DeserializeJsonToObject
<
ResultData
>(
resultStr
);
if
(
data
==
null
)
{
return
msg
=
" DisabledPos【 "
+
posId
+
"】 没有收到服务器反馈"
;
}
else
if
(
data
.
code
.
Equals
(
0
).
Equals
(
false
))
{
return
msg
=
" DisabledPos【 "
+
posId
+
"】 :"
+
data
.
msg
;
}
return
""
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"DisabledPos: "
+
ex
.
ToString
());
}
return
msg
;
}
private
static
string
GetAddr
(
string
addr
,
Dictionary
<
string
,
string
>
paramsMap
)
private
static
string
GetAddr
(
string
addr
,
Dictionary
<
string
,
string
>
paramsMap
)
{
{
if
(
server
.
EndsWith
(
"/"
))
if
(
server
.
EndsWith
(
"/"
))
...
...
DeviceLibrary/DeviceLibrary/SocketScanner.cs
查看文件 @
4b497d9
...
@@ -93,11 +93,13 @@ namespace DeviceLibrary
...
@@ -93,11 +93,13 @@ namespace DeviceLibrary
if
(
i
==
0
)
if
(
i
==
0
)
return
false
;
return
false
;
var
recv
=
Encoding
.
ASCII
.
GetString
(
buff
,
0
,
i
);
var
recv
=
Encoding
.
ASCII
.
GetString
(
buff
,
0
,
i
);
LogUtil
.
info
(
"收到扫码数据:"
+
recv
);
var
m
=
Regex
.
Match
(
recv
,
pattern
);
var
m
=
Regex
.
Match
(
recv
,
pattern
);
if
(
m
.
Success
)
if
(
m
.
Success
)
{
{
var
index
=
m
.
Groups
.
Count
-
1
;
var
index
=
m
.
Groups
.
Count
-
1
;
result
=
m
.
Groups
[
index
].
Value
;
result
=
m
.
Groups
[
index
].
Value
;
LogUtil
.
info
(
"匹配规则后返回:"
+
result
);
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
4b497d9
...
@@ -202,19 +202,26 @@ namespace DeviceLibrary
...
@@ -202,19 +202,26 @@ namespace DeviceLibrary
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromOut
));
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromOut
));
if
(!
ignoreFixtureCheck
&&
!
IgnoreX09
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
if
(!
ignoreFixtureCheck
&&
!
IgnoreX09
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
out_store_not_detect_material
,
"出库时料叉X
30
没有检测到有物料无法继续,请检查."
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
Msg
.
add
(
crc
.
GetString
(
L
.
out_store_not_detect_material
,
"出库时料叉X
23
没有检测到有物料无法继续,请检查."
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
//RobotManage.UserPause("出库时料叉X30没有检测到有物料无法继续,请检查");
//RobotManage.UserPause("出库时料叉X30没有检测到有物料无法继续,请检查");
}
}
else
else
{
{
if
(!
ignoreFixtureCheck
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
{
MoveInfo
.
log
(
$
"忽略物料:Device_DisableStorePosition:{Setting_Init.Device_DisableStorePosition.Val},库位:{From.posid},{WareCode}"
);
if
(
Setting_Init
.
Device_DisableStorePosition
&&
From
.
posid
!=
BoxStorePosition
.
strings
&&
From
.
posid
!=
BoxStorePosition
.
ngdoor
&&
From
.
posid
!=
BoxStorePosition
.
clamp
)
{
MoveInfo
.
log
(
$
"料叉未检测到物料,屏蔽库位:{From.posid},{WareCode}"
);
RobotManage
.
mainMachine
.
ServerCM
.
DisabledPos
(
From
.
posid
,
WareCode
);
}
}
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
IgnoreX09
=
false
;
if
(
To
.
posid
==
BoxStorePosition
.
strings
&&
Setting_Init
.
Device_Use_Fixpos
&&
Fix
!=
null
)
if
(
To
.
posid
==
BoxStorePosition
.
strings
&&
Setting_Init
.
Device_Use_Fixpos
&&
Fix
!=
null
)
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreFIX01
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreFIX01
);
else
else
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS10
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS10
);
MoveInfo
.
log
(
$
"{storeMoveType}:X
30
取到料"
);
MoveInfo
.
log
(
$
"{storeMoveType}:X
23
取到料"
);
InOutEndProcess
(
StoreMoveType
.
OutStore
,
From
.
posid
);
InOutEndProcess
(
StoreMoveType
.
OutStore
,
From
.
posid
);
}
}
break
;
break
;
...
@@ -310,6 +317,8 @@ namespace DeviceLibrary
...
@@ -310,6 +317,8 @@ namespace DeviceLibrary
//}
//}
//else
//else
{
{
if
(
To
.
posid
!=
BoxStorePosition
.
strings
&&
To
.
posid
!=
BoxStorePosition
.
ngdoor
&&
To
.
posid
!=
BoxStorePosition
.
clamp
)
Comp_Axis
.
HomeMove
(
MoveInfo
,
true
);
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
IgnoreX09
=
false
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS16
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS16
);
...
...
DeviceLibrary/theMachine/MainMachine _Common.cs
查看文件 @
4b497d9
...
@@ -85,7 +85,7 @@ namespace DeviceLibrary
...
@@ -85,7 +85,7 @@ namespace DeviceLibrary
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
{
{
ConfigIO
io
=
RobotManage
.
Config
.
getWaitIO
(
wait
.
IoType
);
ConfigIO
io
=
RobotManage
.
Config
.
getWaitIO
(
wait
.
IoType
);
NotOkMsg
=
MoveInfo
.
Name
+
$
" {crc.GetString(L.wait, "
等待
")}【"
+
io
.
DisplayStr
+
"】=【"
+
wait
.
IoValue
+
"】"
;
NotOkMsg
=
MoveInfo
.
Name
+
$
" {crc.GetString(L.wait, "
等待
")}【"
+
io
.
ElectricalDefinition
+
" "
+
crc
.
GetString
(
io
.
ProName
,
io
.
Explain
)
+
"】=【"
+
wait
.
IoValue
+
"】"
;
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(!
wait
.
IsEnd
)
if
(!
wait
.
IsEnd
)
{
{
...
@@ -93,7 +93,7 @@ namespace DeviceLibrary
...
@@ -93,7 +93,7 @@ namespace DeviceLibrary
if
(
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
if
(
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
{
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
$
"] {crc.GetString(L.wait, "
等待
")}("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
$
") {crc.GetString(L.timeout, "
超时
")}"
;
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
$
"] {crc.GetString(L.wait, "
等待
")}("
+
io
.
ElectricalDefinition
+
" "
+
crc
.
GetString
(
io
.
ProName
,
io
.
Explain
)
+
"="
+
wait
.
IoValue
+
$
") {crc.GetString(L.timeout, "
超时
")}"
;
Msg
.
add
(
WarnMsg
,
MsgLevel
.
alarm
);
Msg
.
add
(
WarnMsg
,
MsgLevel
.
alarm
);
if
(
NoAlarm
())
if
(
NoAlarm
())
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
4b497d9
...
@@ -57,7 +57,7 @@ namespace DeviceLibrary
...
@@ -57,7 +57,7 @@ namespace DeviceLibrary
public
bool
boxTransportIsFree
{
get
=>
boxTransport
.
IsComplateOrFree
;
}
public
bool
boxTransportIsFree
{
get
=>
boxTransport
.
IsComplateOrFree
;
}
public
event
Action
<
string
,
StoreMoveType
,
bool
>
InOutEndProcessEvent
;
public
event
Action
<
string
,
StoreMoveType
,
bool
>
InOutEndProcessEvent
;
ServerCommunication
ServerCM
=
new
ServerCommunication
();
public
ServerCommunication
ServerCM
=
new
ServerCommunication
();
/// <summary>
/// <summary>
/// 开始运行的时间
/// 开始运行的时间
/// </summary>
/// </summary>
...
...
DeviceLibrary/theMachine/MainMachine_Clamp.cs
查看文件 @
4b497d9
...
@@ -427,6 +427,7 @@ namespace DeviceLibrary
...
@@ -427,6 +427,7 @@ namespace DeviceLibrary
if
(
Setting_Init
.
SocketScanner_enable
)
{
if
(
Setting_Init
.
SocketScanner_enable
)
{
LastCodeList
=
new
List
<
CodeInfo
>();
LastCodeList
=
new
List
<
CodeInfo
>();
if
(
RobotManage
.
socketScanner
.
Scan
(
Setting_Init
.
SocketScanner_trigger_code
,
Setting_Init
.
SocketScanner_pattern_code
,
out
string
code
))
{
if
(
RobotManage
.
socketScanner
.
Scan
(
Setting_Init
.
SocketScanner_trigger_code
,
Setting_Init
.
SocketScanner_pattern_code
,
out
string
code
))
{
LastCodeList
.
Add
(
new
CodeInfo
(
code
,
0
,
0
));
LastCodeList
.
Add
(
new
CodeInfo
(
code
,
0
,
0
));
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论