Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-VMILineClient
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0376e1f0
由
LN
编写于
2020-01-13 13:33:41 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
agv对接修改
1 个父辈
50b094c8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
67 行增加
和
8 行删除
source/Common/Setting_Init.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/VMILineClient/App.config
source/Common/Setting_Init.cs
查看文件 @
0376e1f
...
...
@@ -34,5 +34,7 @@ namespace OnlineStore.Common
public
static
string
AgvServerIp
=
"AgvServerIp"
;
public
static
string
Agv_Log_Open
=
"Agv_Log_Open"
;
}
}
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
0376e1f
...
...
@@ -2,6 +2,7 @@
using
Asa
;
using
Asa.RFID
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -47,25 +48,58 @@ namespace OnlineStore.DeviceLibrary
private
static
void
AgvClient_Ready
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGVAction
.
Ready
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 未找到对应的设备 "
);
MayEnter
(
"C2"
);
}
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
if
(
id
.
Equals
(
LineManager
.
Config
.
OutL_AgvName
))
{
// MayEnter("C2");
if
(
IOManager
.
IOValue
(
IO_Type
.
OutL_InCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
agvClient
.
MayEnter
(
id
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 调用 MayEnter "
);
}
}
else
if
(
id
.
Equals
(
LineManager
.
Config
.
InL_AgvName
))
{
if
(
IOManager
.
IOValue
(
IO_Type
.
InL_OutStopCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
LineManager
.
VMILine
.
StopIOMove
(
IO_Type
.
InL_OutStopDown
);
agvClient
.
MayLeave
(
id
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 调用 MayLeave "
);
}
}
}
private
static
void
AgvClient_CanEnter
(
string
id
,
byte
[]
content
)
{
RFIDData
data
=
new
RFIDData
(
content
);
UpdateAction
(
id
,
AGVAction
.
CanEnter
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 未找到对应的设备 "
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
if
(
id
.
Equals
(
LineManager
.
Config
.
OutL_AgvName
))
{
bool
result
=
IOManager
.
IOValue
(
IO_Type
.
OutL_InCheck
).
Equals
(
IO_VALUE
.
LOW
);
if
(
IOManager
.
IOValue
(
IO_Type
.
OutL_InCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
agvClient
.
IsEnter
(
id
);
}
}
else
if
(
id
.
Equals
(
LineManager
.
Config
.
InL_AgvName
))
{
}
}
private
static
void
AgvClient_Arrive
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGVAction
.
Arrive
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"]
未找到对应的设备
"
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"]
"
);
}
...
...
@@ -114,7 +148,18 @@ namespace OnlineStore.DeviceLibrary
}
private
static
void
AgvClient_Log
(
string
s
)
{
LogUtil
.
info
(
" AGV "
+
ServerIp
+
" Log : "
+
s
);
try
{
bool
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Agv_Log_Open
).
Equals
(
1
);
if
(
isLog
)
{
LogUtil
.
info
(
" AGV "
+
ServerIp
+
" Log : "
+
s
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AgvClient_Log 出错:"
+
ex
.
ToString
());
}
}
public
static
string
GetAction
(
string
NodeName
)
...
...
@@ -125,6 +170,17 @@ namespace OnlineStore.DeviceLibrary
}
return
AGVAction
.
None
;
}
public
static
void
UpdateAction
(
string
name
,
string
action
)
{
if
(
actionMap
.
ContainsKey
(
name
))
{
actionMap
[
name
]
=
action
;
}
else
{
actionMap
.
Add
(
name
,
action
);
}
}
public
static
void
Dispose
()
{
try
...
...
source/VMILineClient/App.config
查看文件 @
0376e1f
...
...
@@ -23,7 +23,8 @@
<
add
key
=
"AgvServerIp"
value
=
"192.168.103.12"
/>
<!--是否调试状态-->
<
add
key
=
"IsInDebug"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"1"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论