Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
RC1250-BackFeedLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 41f0bdef
由
张东亮
编写于
2020-10-20 11:14:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
initial
1 个父辈
35cc8911
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
1065 行增加
和
338 行删除
dll/Client.dll
dll/Client.xml
source/BackFeedLine/App.config
source/BackFeedLine/BackFeedLineClient.csproj
source/BackFeedLine/FrmBackFeedClient.Designer.cs → source/BackFeedLine/FrmLineClient.Designer.cs
source/BackFeedLine/FrmBackFeedClient.cs → source/BackFeedLine/FrmLineClient.cs
source/BackFeedLine/FrmBackFeedClient.resx → source/BackFeedLine/FrmLineClient.resx
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/LineConfig/FeederLineConfig.csv
source/DeviceLibrary/LineConfig/LineConfig.csv
source/DeviceLibrary/acFeederLine/FeederLineBean.cs
source/DeviceLibrary/acFeederLine/FeederLineBean_Partial.cs
source/DeviceLibrary/acFeederLine/LineManager.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/agvClient/AgvClient1.cs
dll/Client.dll
0 → 100644
查看文件 @
41f0bde
此文件类型无法预览
dll/Client.xml
0 → 100644
查看文件 @
41f0bde
<?xml version="1.0"?>
<doc>
<assembly>
<name>
Client
</name>
</assembly>
<members>
<member
name=
"T:Asa.Client"
>
<summary>
电脑客户端
</summary>
</member>
<member
name=
"F:Asa.Client.HEART"
>
<summary>
心跳包,HEART
</summary>
</member>
<member
name=
"F:Asa.Client.SERVER_OFF"
>
<summary>
服务器关闭,OFF
</summary>
</member>
<member
name=
"F:Asa.Client.CLIENT_OFF"
>
<summary>
客户端关闭,OFF
</summary>
</member>
<member
name=
"T:Asa.Client.ActionEvent"
>
<summary>
小车动作事件
</summary>
</member>
<member
name=
"E:Asa.Client.GetRFID"
>
<summary>
服务端发送的RFID
</summary>
</member>
<member
name=
"E:Asa.Client.Arrive"
>
<summary>
小车到达,仅包装料仓
</summary>
</member>
<member
name=
"E:Asa.Client.Ready"
>
<summary>
小车已准备,对接完成
</summary>
</member>
<member
name=
"E:Asa.Client.CanEnter"
>
<summary>
能否进入,仅流水线
</summary>
</member>
<member
name=
"T:Asa.Client.LogEvent"
>
<summary>
日志事件
</summary>
<param
name=
"s"
></param>
</member>
<member
name=
"E:Asa.Client.Log"
>
<summary>
日志
</summary>
</member>
<member
name=
"P:Asa.Client.IsConn"
>
<summary>
是否连接服务器
</summary>
</member>
<member
name=
"P:Asa.Client.RFID"
>
<summary>
RFID的内容
</summary>
</member>
<member
name=
"M:Asa.Client.#ctor(System.String)"
>
<summary>
电脑客户端
</summary>
<param
name=
"serverIP"
>
服务器IP地址
</param>
</member>
<member
name=
"M:Asa.Client.Connect(System.String[])"
>
<summary>
连接
</summary>
<param
name=
"id"
></param>
</member>
<member
name=
"M:Asa.Client.Close"
>
<summary>
关闭
</summary>
</member>
<member
name=
"M:Asa.Client.SendRFID(System.String,System.String)"
>
<summary>
发送RFID信息
</summary>
<param
name=
"id"
></param>
<param
name=
"s"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.NeedEnter(System.String,System.String)"
>
<summary>
需要进入料架(包装料仓)
</summary>
<param
name=
"id"
></param>
<param
name=
"mark"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.NeedLeave(System.String)"
>
<summary>
需要出料架
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.MayEnter(System.String)"
>
<summary>
可以进入
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.FinishEnter(System.String)"
>
<summary>
完成进入
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.MayLeave(System.String)"
>
<summary>
可以出去
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.FinishLeave(System.String)"
>
<summary>
完成出去
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.IsEnter(System.String)"
>
<summary>
是否可以进入,仅用于CanEnter事件
</summary>
<param
name=
"id"
>
节点,可以多个
</param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.Send(System.Byte[])"
>
<summary>
发送命令
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.HexBuff(System.Byte[])"
>
<summary>
16进制
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.ListenNet"
>
<summary>
监听线程
</summary>
</member>
<member
name=
"M:Asa.Client.Resolve"
>
<summary>
分析数据包
</summary>
</member>
<member
name=
"M:Asa.Client.Splice(System.Byte,System.String,System.Byte[])"
>
<summary>
拼接命令
</summary>
<param
name=
"code"
></param>
<param
name=
"id"
></param>
<param
name=
"content"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.CheckRemoteIP(System.String)"
>
<summary>
检查远程IP地址
</summary>
<param
name=
"ip"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.IsHeart(System.Byte[])"
>
<summary>
是否心跳包
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client.IsServerOffline(System.Byte[])"
>
<summary>
是否服务器断开
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"T:Asa.Client2"
>
<summary>
电脑客户端
</summary>
</member>
<member
name=
"F:Asa.Client2.HEART"
>
<summary>
心跳包,HEART
</summary>
</member>
<member
name=
"F:Asa.Client2.SERVER_OFF"
>
<summary>
服务器关闭,OFF
</summary>
</member>
<member
name=
"F:Asa.Client2.CLIENT_OFF"
>
<summary>
客户端关闭,OFF
</summary>
</member>
<member
name=
"T:Asa.Client2.ActionEvent"
>
<summary>
小车动作事件
</summary>
</member>
<member
name=
"T:Asa.Client2.LogEvent"
>
<summary>
日志事件
</summary>
<param
name=
"s"
></param>
</member>
<member
name=
"E:Asa.Client2.Arrive"
>
<summary>
小车到达,仅包装料仓
</summary>
</member>
<member
name=
"E:Asa.Client2.Ready"
>
<summary>
小车已准备,对接完成
</summary>
</member>
<member
name=
"E:Asa.Client2.CloseDoor"
>
<summary>
关门,仅包装料仓
</summary>
</member>
<member
name=
"E:Asa.Client2.EnterShelf"
>
<summary>
准备进入料架不能出料,仅包装料仓
</summary>
</member>
<member
name=
"E:Asa.Client2.Log"
>
<summary>
日志
</summary>
</member>
<member
name=
"M:Asa.Client2.#ctor(System.String)"
>
<summary>
电脑客户端
</summary>
<param
name=
"serverIP"
>
服务器IP地址
</param>
</member>
<member
name=
"P:Asa.Client2.IsConn"
>
<summary>
是否连接服务器
</summary>
</member>
<member
name=
"P:Asa.Client2.CancelState"
>
<summary>
取消状态,true发送none,false发送实际状态
</summary>
</member>
<member
name=
"P:Asa.Client2.SendLog"
>
<summary>
发送命令的日志是否打印,不影响其他日志
</summary>
</member>
<member
name=
"P:Asa.Client2.SendSleep"
>
<summary>
发送命令的时间间隔(单位:秒)
</summary>
</member>
<member
name=
"M:Asa.Client2.Connect"
>
<summary>
连接
</summary>
</member>
<member
name=
"M:Asa.Client2.Close"
>
<summary>
关闭
</summary>
</member>
<member
name=
"M:Asa.Client2.SetStatus(System.String,System.String,System.String,Asa.ClientAction,Asa.ClientLevel)"
>
<summary>
设置状态
</summary>
<param
name=
"name"
>
节点名称
</param>
<param
name=
"mark"
>
节点标记
</param>
<param
name=
"rfid"
>
架子RFID
</param>
<param
name=
"action"
></param>
<param
name=
"level"
></param>
</member>
<member
name=
"M:Asa.Client2.Splice(Asa.ClientNode)"
>
<summary>
拼接命令
</summary>
<param
name=
"node"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.ListenNet"
>
<summary>
监听线程
</summary>
</member>
<member
name=
"M:Asa.Client2.Resolve"
>
<summary>
分析数据包
</summary>
</member>
<member
name=
"M:Asa.Client2.Send(System.Byte[])"
>
<summary>
发送命令
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.HexBuff(System.Byte[])"
>
<summary>
16进制
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.IsHeart(System.Byte[])"
>
<summary>
是否心跳包
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.Client2.IsServerOffline(System.Byte[])"
>
<summary>
是否服务器断开
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"T:Asa.ClientNode"
>
<summary>
客户端的节点
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Name"
>
<summary>
节点名称
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Mark"
>
<summary>
标记,用于包装料仓
</summary>
</member>
<member
name=
"F:Asa.ClientNode.RFID"
>
<summary>
当前架子的RFID
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Action"
>
<summary>
动作
</summary>
</member>
<member
name=
"F:Asa.ClientNode.Level"
>
<summary>
优先级
</summary>
</member>
<member
name=
"M:Asa.ClientNode.#ctor(System.String,System.String,System.String,Asa.ClientAction,Asa.ClientLevel)"
>
<summary>
客户端节点
</summary>
<param
name=
"name"
></param>
<param
name=
"mark"
></param>
<param
name=
"rfid"
></param>
<param
name=
"action"
></param>
<param
name=
"level"
></param>
</member>
<member
name=
"T:Asa.ClientAction"
>
<summary>
客户端的动作
</summary>
</member>
<member
name=
"F:Asa.ClientAction.None"
>
<summary>
没有动作
</summary>
</member>
<member
name=
"F:Asa.ClientAction.CloseDoor"
>
<summary>
包装料仓关门
</summary>
</member>
<member
name=
"F:Asa.ClientAction.MayEnter"
>
<summary>
可以进入料架,Arrive事件使用,让小车开始对接
</summary>
</member>
<member
name=
"F:Asa.ClientAction.MayLeave"
>
<summary>
可以出去料架,Arrive事件使用,让小车开始对接
</summary>
</member>
<member
name=
"F:Asa.ClientAction.NeedEnter"
>
<summary>
需要进入料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.NeedLeave"
>
<summary>
需要出去料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.FinishEnter"
>
<summary>
完成进入料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.FinishLeave"
>
<summary>
完成出去料架
</summary>
</member>
<member
name=
"F:Asa.ClientAction.Arrive"
>
<summary>
小车到达,到达包装料仓门口,等待开门
</summary>
</member>
<member
name=
"F:Asa.ClientAction.Ready"
>
<summary>
小车已准备,已对接上流水线
</summary>
</member>
<member
name=
"F:Asa.ClientAction.EnterShelf"
>
<summary>
包装料仓只能入料不能出料
</summary>
</member>
<member
name=
"T:Asa.ClientLevel"
>
<summary>
客户端的优先级
</summary>
</member>
<member
name=
"F:Asa.ClientLevel.Low"
>
<summary>
低
</summary>
</member>
<member
name=
"F:Asa.ClientLevel.Middle"
>
<summary>
中等
</summary>
</member>
<member
name=
"F:Asa.ClientLevel.High"
>
<summary>
高
</summary>
</member>
</members>
</doc>
source/BackFeedLine/App.config
查看文件 @
41f0bde
...
@@ -12,14 +12,14 @@
...
@@ -12,14 +12,14 @@
<!--
storeType
-->
<!--
storeType
-->
<
add
key
=
"store_count"
value
=
"1"
/>
<
add
key
=
"store_count"
value
=
"1"
/>
<!--
start
one
store
config
-->
<!--
start
one
store
config
-->
<
add
key
=
"Line_Config"
value
=
"\LineConfig\
Feeder
LineConfig.csv"
/>
<
add
key
=
"Line_Config"
value
=
"\LineConfig\LineConfig.csv"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<!--
IO
配置-->
<!--
IO
配置-->
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
<
add
key
=
"DIMS"
value
=
"60"
/>
<
add
key
=
"DIMS"
value
=
"60"
/>
<
add
key
=
"DOMS"
value
=
"300"
/>
<
add
key
=
"DOMS"
value
=
"300"
/>
<!--
AGV
调度服务器地址-->
<!--
AGV
调度服务器地址-->
<
add
key
=
"AgvServerIp"
value
=
"10.85.199.
1
"
/>
<
add
key
=
"AgvServerIp"
value
=
"10.85.199.
20
"
/>
<!--是否调试状态-->
<!--是否调试状态-->
<
add
key
=
"IsInDebug"
value
=
"1"
/>
<
add
key
=
"IsInDebug"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"1"
/>
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
</
layout
>
</
layout
>
</
appender
>
</
appender
>
<
appender
name
=
"TheRFID"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"TheRFID"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/TheRFID-
vmi
.log"
/>
<
file
value
=
"logs/TheRFID-
line
.log"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
param
name
=
"Encoding"
value
=
"UTF-8"
/>
<
appendToFile
value
=
"true"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
rollingStyle
value
=
"Date"
/>
...
...
source/BackFeedLine/BackFeedLineClient.csproj
查看文件 @
41f0bde
...
@@ -81,11 +81,11 @@
...
@@ -81,11 +81,11 @@
<Compile Include="FrmBase.Designer.cs">
<Compile Include="FrmBase.Designer.cs">
<DependentUpon>FrmBase.cs</DependentUpon>
<DependentUpon>FrmBase.cs</DependentUpon>
</Compile>
</Compile>
<Compile Include="Frm
BackFeed
Client.cs">
<Compile Include="Frm
Line
Client.cs">
<SubType>Form</SubType>
<SubType>Form</SubType>
</Compile>
</Compile>
<Compile Include="Frm
BackFeed
Client.Designer.cs">
<Compile Include="Frm
Line
Client.Designer.cs">
<DependentUpon>Frm
BackFeed
Client.cs</DependentUpon>
<DependentUpon>Frm
Line
Client.cs</DependentUpon>
</Compile>
</Compile>
<Compile Include="ManagerUtil.cs" />
<Compile Include="ManagerUtil.cs" />
<Compile Include="Program.cs" />
<Compile Include="Program.cs" />
...
@@ -94,8 +94,8 @@
...
@@ -94,8 +94,8 @@
<DependentUpon>FrmBase.cs</DependentUpon>
<DependentUpon>FrmBase.cs</DependentUpon>
<SubType>Designer</SubType>
<SubType>Designer</SubType>
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource Include="Frm
BackFeed
Client.resx">
<EmbeddedResource Include="Frm
Line
Client.resx">
<DependentUpon>Frm
BackFeed
Client.cs</DependentUpon>
<DependentUpon>Frm
Line
Client.cs</DependentUpon>
<SubType>Designer</SubType>
<SubType>Designer</SubType>
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<EmbeddedResource Include="Properties\Resources.resx">
...
@@ -146,8 +146,6 @@
...
@@ -146,8 +146,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</Content>
<Content Include="BackFeed.ico" />
<Content Include="BackFeed.ico" />
<Content Include="box.ico" />
<Content Include="DfIcon.ico" />
<Content Include="记录.txt" />
<Content Include="记录.txt" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
source/BackFeedLine/Frm
BackFeed
Client.Designer.cs
→
source/BackFeedLine/Frm
Line
Client.Designer.cs
查看文件 @
41f0bde
...
@@ -210,9 +210,9 @@
...
@@ -210,9 +210,9 @@
this
.
cmbStopList
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
cmbStopList
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
cmbStopList
.
FormattingEnabled
=
true
;
this
.
cmbStopList
.
FormattingEnabled
=
true
;
this
.
cmbStopList
.
Items
.
AddRange
(
new
object
[]
{
this
.
cmbStopList
.
Items
.
AddRange
(
new
object
[]
{
"
Feeder1
进料线_阻挡"
,
"进料线_阻挡"
,
"
Feeder1
进料线_出口阻挡"
,
"进料线_出口阻挡"
,
"
Feeder2
出料线_阻挡"
});
"出料线_阻挡"
});
this
.
cmbStopList
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
435
);
this
.
cmbStopList
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
435
);
this
.
cmbStopList
.
Name
=
"cmbStopList"
;
this
.
cmbStopList
.
Name
=
"cmbStopList"
;
this
.
cmbStopList
.
Size
=
new
System
.
Drawing
.
Size
(
153
,
28
);
this
.
cmbStopList
.
Size
=
new
System
.
Drawing
.
Size
(
153
,
28
);
...
@@ -261,7 +261,7 @@
...
@@ -261,7 +261,7 @@
this
.
btnOLOutStopDown
.
Name
=
"btnOLOutStopDown"
;
this
.
btnOLOutStopDown
.
Name
=
"btnOLOutStopDown"
;
this
.
btnOLOutStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnOLOutStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnOLOutStopDown
.
TabIndex
=
281
;
this
.
btnOLOutStopDown
.
TabIndex
=
281
;
this
.
btnOLOutStopDown
.
Text
=
"
Feeder2
线体出口阻挡下降"
;
this
.
btnOLOutStopDown
.
Text
=
"
出料
线体出口阻挡下降"
;
this
.
btnOLOutStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnOLOutStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnOLOutStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOLOutStopDown_Click
);
this
.
btnOLOutStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOLOutStopDown_Click
);
//
//
...
@@ -272,7 +272,7 @@
...
@@ -272,7 +272,7 @@
this
.
btnOLInStopDown
.
Name
=
"btnOLInStopDown"
;
this
.
btnOLInStopDown
.
Name
=
"btnOLInStopDown"
;
this
.
btnOLInStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnOLInStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnOLInStopDown
.
TabIndex
=
280
;
this
.
btnOLInStopDown
.
TabIndex
=
280
;
this
.
btnOLInStopDown
.
Text
=
"
Feeder2
线体阻挡下降"
;
this
.
btnOLInStopDown
.
Text
=
"
出料
线体阻挡下降"
;
this
.
btnOLInStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnOLInStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnOLInStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOLInStopDown_Click
);
this
.
btnOLInStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOLInStopDown_Click
);
//
//
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
this
.
btnInLOutStopDown
.
Name
=
"btnInLOutStopDown"
;
this
.
btnInLOutStopDown
.
Name
=
"btnInLOutStopDown"
;
this
.
btnInLOutStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnInLOutStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnInLOutStopDown
.
TabIndex
=
279
;
this
.
btnInLOutStopDown
.
TabIndex
=
279
;
this
.
btnInLOutStopDown
.
Text
=
"
Feeder1
出口缓冲打开"
;
this
.
btnInLOutStopDown
.
Text
=
"
入料
出口缓冲打开"
;
this
.
btnInLOutStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnInLOutStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnInLOutStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInLOutStopDown_Click
);
this
.
btnInLOutStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInLOutStopDown_Click
);
//
//
...
@@ -294,7 +294,7 @@
...
@@ -294,7 +294,7 @@
this
.
btnInLInStopDown
.
Name
=
"btnInLInStopDown"
;
this
.
btnInLInStopDown
.
Name
=
"btnInLInStopDown"
;
this
.
btnInLInStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnInLInStopDown
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnInLInStopDown
.
TabIndex
=
278
;
this
.
btnInLInStopDown
.
TabIndex
=
278
;
this
.
btnInLInStopDown
.
Text
=
"
Feeder1
线体阻挡下降"
;
this
.
btnInLInStopDown
.
Text
=
"
入料
线体阻挡下降"
;
this
.
btnInLInStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnInLInStopDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnInLInStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInLInStopDown_Click
);
this
.
btnInLInStopDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInLInStopDown_Click
);
//
//
...
@@ -305,7 +305,7 @@
...
@@ -305,7 +305,7 @@
this
.
btnInLineRun
.
Name
=
"btnInLineRun"
;
this
.
btnInLineRun
.
Name
=
"btnInLineRun"
;
this
.
btnInLineRun
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnInLineRun
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnInLineRun
.
TabIndex
=
276
;
this
.
btnInLineRun
.
TabIndex
=
276
;
this
.
btnInLineRun
.
Text
=
"
Feeder1
线体运转"
;
this
.
btnInLineRun
.
Text
=
"
入料
线体运转"
;
this
.
btnInLineRun
.
UseVisualStyleBackColor
=
true
;
this
.
btnInLineRun
.
UseVisualStyleBackColor
=
true
;
this
.
btnInLineRun
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInLineRun_Click
);
this
.
btnInLineRun
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInLineRun_Click
);
//
//
...
@@ -316,7 +316,7 @@
...
@@ -316,7 +316,7 @@
this
.
btnOutL
.
Name
=
"btnOutL"
;
this
.
btnOutL
.
Name
=
"btnOutL"
;
this
.
btnOutL
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnOutL
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
39
);
this
.
btnOutL
.
TabIndex
=
277
;
this
.
btnOutL
.
TabIndex
=
277
;
this
.
btnOutL
.
Text
=
"
Feeder2
线体运转"
;
this
.
btnOutL
.
Text
=
"
出料
线体运转"
;
this
.
btnOutL
.
UseVisualStyleBackColor
=
true
;
this
.
btnOutL
.
UseVisualStyleBackColor
=
true
;
this
.
btnOutL
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOutL_Click
);
this
.
btnOutL
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOutL_Click
);
//
//
...
...
source/BackFeedLine/Frm
BackFeed
Client.cs
→
source/BackFeedLine/Frm
Line
Client.cs
查看文件 @
41f0bde
...
@@ -224,7 +224,7 @@ namespace OnlineStore.FeederLineClient
...
@@ -224,7 +224,7 @@ namespace OnlineStore.FeederLineClient
IOManager
.
instance
.
CloseAllDO
();
IOManager
.
instance
.
CloseAllDO
();
IOManager
.
instance
.
CloseAllConnection
();
IOManager
.
instance
.
CloseAllConnection
();
feederLine
.
a
gvClient
.
Dispose
();
A
gvClient
.
Dispose
();
System
.
Environment
.
Exit
(
System
.
Environment
.
ExitCode
);
System
.
Environment
.
Exit
(
System
.
Environment
.
ExitCode
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -332,32 +332,32 @@ namespace OnlineStore.FeederLineClient
...
@@ -332,32 +332,32 @@ namespace OnlineStore.FeederLineClient
}
}
private
void
btnInLineRun_Click
(
object
sender
,
EventArgs
e
)
private
void
btnInLineRun_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnInLineRun
,
"
退料1线体运转"
,
"退料1
线体停止"
,
IO_Type
.
L1_Run
);
BtnMove
(
btnInLineRun
,
"
入料线体运转"
,
"入料
线体停止"
,
IO_Type
.
L1_Run
);
}
}
private
void
btnInLInStopDown_Click
(
object
sender
,
EventArgs
e
)
private
void
btnInLInStopDown_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnInLInStopDown
,
"
退料1线体阻挡下降"
,
"退料1
线体阻挡上升"
,
IO_Type
.
L1_StopDown
);
BtnMove
(
btnInLInStopDown
,
"
入料线体阻挡下降"
,
"入料
线体阻挡上升"
,
IO_Type
.
L1_StopDown
);
}
}
private
void
btnInLOutStopDown_Click
(
object
sender
,
EventArgs
e
)
private
void
btnInLOutStopDown_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnInLOutStopDown
,
"
退料1出口缓冲打开"
,
"退料1
出口缓冲关闭"
,
IO_Type
.
L1_OutStopDown
);
BtnMove
(
btnInLOutStopDown
,
"
入料出口缓冲打开"
,
"入料
出口缓冲关闭"
,
IO_Type
.
L1_OutStopDown
);
}
}
private
void
btnOLInStopDown_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOLInStopDown_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnOLInStopDown
,
"
退料2线体阻挡下降"
,
"退料2
线体阻挡上升"
,
IO_Type
.
L2_StopDown
);
BtnMove
(
btnOLInStopDown
,
"
出料线体阻挡下降"
,
"出料
线体阻挡上升"
,
IO_Type
.
L2_StopDown
);
}
}
private
void
btnOutL_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOutL_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnOutL
,
"
退料2线体运转"
,
"退料2
线体停止"
,
IO_Type
.
L2_Run
);
BtnMove
(
btnOutL
,
"
出料线体运转"
,
"出料
线体停止"
,
IO_Type
.
L2_Run
);
}
}
private
void
btnOLOutStopDown_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOLOutStopDown_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnOLOutStopDown
,
"
退料2线体出口阻挡下降"
,
"退料2
线体出口阻挡上升"
,
IO_Type
.
L2_OutStopDown
);
BtnMove
(
btnOLOutStopDown
,
"
出料线体出口阻挡下降"
,
"出料
线体出口阻挡上升"
,
IO_Type
.
L2_OutStopDown
);
}
}
private
void
btnCloseA_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCloseA_Click
(
object
sender
,
EventArgs
e
)
...
...
source/BackFeedLine/Frm
BackFeed
Client.resx
→
source/BackFeedLine/Frm
Line
Client.resx
查看文件 @
41f0bde
文件被删除
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
41f0bde
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
<Reference Include="Asa.RFID">
<Reference Include="Asa.RFID">
<HintPath>..\..\dll\Asa.RFID.dll</HintPath>
<HintPath>..\..\dll\Asa.RFID.dll</HintPath>
</Reference>
</Reference>
<Reference Include="
AsaPL.Agv
Client">
<Reference Include="Client">
<HintPath>..\..\dll\
AsaPL.Agv
Client.dll</HintPath>
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
</Reference>
<Reference Include="CodeLibrary">
<Reference Include="CodeLibrary">
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\CodeLibrary.dll</HintPath>
<HintPath>..\..\..\RC32-SZBOSCH-ACSingleStore\dll\CodeLibrary.dll</HintPath>
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
</ItemGroup>
</ItemGroup>
<ItemGroup />
<ItemGroup />
<ItemGroup>
<ItemGroup>
<None Include="LineConfig\
Feeder
LineConfig.csv">
<None Include="LineConfig\LineConfig.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
</ItemGroup>
</ItemGroup>
...
...
source/DeviceLibrary/LineConfig/FeederLineConfig.csv
deleted
100644 → 0
查看文件 @
35cc891
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
PRO,IO模块对应的DI数量,IO_DILength,192.168.103.28#16,,,,,,,
PRO,模块对应的DO数量,IO_DOLength,192.168.103.28#16,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_1,192.168.103.28,,,,,,,
,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X761,DI-01,0,
DI,退料1线入口检测,L1_InCheck,1,PRO_AOI_IP_1,0,退料1线入口检测,X762,DI-02,0,
DI,退料1线阻挡检测,L1_StopCheck,2,PRO_AOI_IP_1,0,退料1线阻挡检测,X763,DI-03,0,
DI,退料1线出口检测,L1_OutCheck,3,PRO_AOI_IP_1,0,退料1线出口检测,X764,DI-04,0,
DI,退料2线入口检测,L2_InCheck,4,PRO_AOI_IP_1,0,退料2线入口检测,X765,DI-05,0,
DI,退料2线阻挡检测,L2_StopCheck,5,PRO_AOI_IP_1,0,退料2线阻挡检测,X766,DI-06,0,
DI,退料2线出口检测,L2_OutCheck,6,PRO_AOI_IP_1,0,退料2线出口检测,X767,DI-07,0,
DI,退料1线人工取料信号,L1_ManualRecSig,7,PRO_AOI_IP_1,0,退料1线人工取料信号,X768,DI-08,0,
DI,退料1线顶升上升端,L1_Updown_Up_Sig,8,PRO_AOI_IP_1,0,退料1线顶升上升端,X769,DI-09,0,
DI,退料1线顶升下降端,L1_Updown_Down_Sig,9,PRO_AOI_IP_1,0,退料1线顶升下降端,X770,DI-10,0,
DI,退料2线顶升上升端,L2_Updown_Up_Sig,10,PRO_AOI_IP_1,0,退料2线顶升上升端,X771,DI-11,0,
DI,退料2线顶升下降端,L2_Updown_Down_Sig,11,PRO_AOI_IP_1,0,退料2线顶升下降端,X772,DI-12,0,
,,,12,PRO_AOI_IP_1,0,,X773,DI-13,0,
,,,13,PRO_AOI_IP_1,0,,X774,DI-14,0,
,,,14,PRO_AOI_IP_1,0,,X775,DI-15,0,
,,,15,PRO_AOI_IP_1,0,,X776,DI-16,0,
DO,退料1线驱动电机运转,L1_Run,0,PRO_AOI_IP_1,0,退料1线驱动电机运转,Y761,DO-01,0,
DO,退料2线驱动电机运转,L2_Run,1,PRO_AOI_IP_1,0,退料2线驱动电机运转,Y762,DO-02,0,
DO,退料1线阻挡1下降,L1_StopDown,2,PRO_AOI_IP_1,0,退料1线阻挡1下降,Y763,DO-03,0,
DO,退料1线出口缓冲器,L1_OutStopDown,3,PRO_AOI_IP_1,0,退料1线出口缓冲器,Y764,DO-04,0,
DO,退料2线出口阻挡下降,L2_OutStopDown,4,PRO_AOI_IP_1,0,退料2线出口阻挡下降,Y765,DO-05,0,
DO,退料2线阻挡1下降,L2_StopDown,5,PRO_AOI_IP_1,0,退料2线阻挡1下降,Y766,DO-06,0,
DO,退料线横移机构上升SOL,Tranverse_Up_SOL,6,PRO_AOI_IP_1,0,退料线横移机构上升SOL,Y767,DO-07,0,
DO,退料线横移机构下降SOL,Tranverse_Down_SOL,7,PRO_AOI_IP_1,0,退料线横移机构下降SOL,Y768,DO-08,0,
DO,退料线横移电机运转,Tranverse_Run,8,PRO_AOI_IP_1,0,退料线横移电机运转,Y769,DO-09,0,
,,,9,PRO_AOI_IP_1,0,,Y770,DO-10,0,
,,,10,PRO_AOI_IP_1,0,,Y771,DO-11,0,
,,,11,PRO_AOI_IP_1,0,,Y772,DO-12,0,
,,,12,PRO_AOI_IP_1,0,,Y773,DO-13,0,
,,,13,PRO_AOI_IP_1,0,,Y774,DO-14,0,
,,,14,PRO_AOI_IP_1,0,,Y775,DO-15,0,
,,,15,PRO_AOI_IP_1,0,,Y776,DO-16,0,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,退料1线AGV节点名称,L1_AgvName,D21,,,,,,,
PRO,退料2线AGV节点名称,L2_AgvName,D22,,,,,,,
PRO,退料线出口RFIDIP,L2Out_RFIDIP,192.168.103.108,,,,,, ,
PRO,休眠秒数(秒),SleepSeconds,60,,,,,,,
source/DeviceLibrary/LineConfig/LineConfig.csv
0 → 100644
查看文件 @
41f0bde
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
PRO,IO模块对应的DI数量,IO_DILength,192.168.103.28#16,,,,,,,
PRO,模块对应的DO数量,IO_DOLength,192.168.103.28#16,,,,,,,
PRO,IO模块IP,PRO_AOI_IP_1,192.168.103.28,,,,,,,
,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X01,DI-01,0,
DI,进料线体入口检测,L1_InCheck,1,PRO_AOI_IP_1,0,进料线体入口检测,X02,DI-02,0,
DI,进料线体阻挡检测,L1_StopCheck,2,PRO_AOI_IP_1,0,进料线体阻挡检测,X03,DI-03,0,
DI,进料线体出口检测,L1_OutCheck,3,PRO_AOI_IP_1,0,进料线体出口检测,X04,DI-04,0,
DI,出料线体入口检测,L2_InCheck,4,PRO_AOI_IP_1,0,出料线体入口检测,X05,DI-05,0,
DI,出料线体阻挡检测,L2_StopCheck,5,PRO_AOI_IP_1,0,出料线体阻挡检测,X06,DI-06,0,
DI,出料线体出口检测,L2_OutCheck,6,PRO_AOI_IP_1,0,出料线体出口检测,X07,DI-07,0,
DI,进料线体人工取料信号,L1_ManualRecSig,7,PRO_AOI_IP_1,0,进料线体人工取料信号,X08,DI-08,0,
DI,入料线体顶升上升端,L1_Updown_Up_Sig,8,PRO_AOI_IP_1,0,入料线体顶升上升端,X09,DI-09,0,
DI,入料线体顶升下降端,L1_Updown_Down_Sig,9,PRO_AOI_IP_1,0,入料线体顶升下降端,X10,DI-10,0,
DI,出料线体顶升上升端,L2_Updown_Up_Sig,10,PRO_AOI_IP_1,0,出料线体顶升上升端,X11,DI-11,0,
DI,出料线体顶升下降端,L2_Updown_Down_Sig,11,PRO_AOI_IP_1,0,出料线体顶升下降端,X12,DI-12,0,
,,,12,PRO_AOI_IP_1,0,,X13,DI-13,0,
,,,13,PRO_AOI_IP_1,0,,X774,DI-14,0,
,,,14,PRO_AOI_IP_1,0,,X775,DI-15,0,
,,,15,PRO_AOI_IP_1,0,,X776,DI-16,0,
DO,进料线体驱动电机运转,L1_Run,0,PRO_AOI_IP_1,0,进料线体驱动电机运转,Y01,DO-01,0,
DO,出料线体驱动电机运转,L2_Run,1,PRO_AOI_IP_1,0,出料线体驱动电机运转,Y02,DO-02,0,
DO,进料线体阻挡1下降,L1_StopDown,2,PRO_AOI_IP_1,0,进料线体阻挡1下降,Y03,DO-03,0,
DO,进料线体出口缓冲器,L1_OutStopDown,3,PRO_AOI_IP_1,0,进料线体出口缓冲器,Y04,DO-04,0,
DO,出料线体出口阻挡下降,L2_OutStopDown,4,PRO_AOI_IP_1,0,出料线体出口阻挡下降,Y05,DO-05,0,
DO,出料线体阻挡1下降,L2_StopDown,5,PRO_AOI_IP_1,0,出料线体阻挡1下降,Y06,DO-06,0,
DO,横移机构上升SOL,Tranverse_Up_SOL,6,PRO_AOI_IP_1,0,横移机构上升SOL,Y07,DO-07,0,
DO,横移机构下降SOL,Tranverse_Down_SOL,7,PRO_AOI_IP_1,0,横移机构下降SOL,Y08,DO-08,0,
DO,横移电机运转,Tranverse_Run,8,PRO_AOI_IP_1,0,横移电机运转,Y09,DO-09,0,
,,,9,PRO_AOI_IP_1,0,,Y770,DO-10,0,
,,,10,PRO_AOI_IP_1,0,,Y771,DO-11,0,
,,,11,PRO_AOI_IP_1,0,,Y772,DO-12,0,
,,,12,PRO_AOI_IP_1,0,,Y773,DO-13,0,
,,,13,PRO_AOI_IP_1,0,,Y774,DO-14,0,
,,,14,PRO_AOI_IP_1,0,,Y775,DO-15,0,
,,,15,PRO_AOI_IP_1,0,,Y776,DO-16,0,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,入料线体AGV节点名称,L1_AgvName,D3,,,,,,,
PRO,出料线体AGV节点名称,L2_AgvName,D4,,,,,,,
PRO,退料线出口RFIDIP,L2Out_RFIDIP,192.168.103.108,,,,,, ,
PRO,休眠秒数(秒),SleepSeconds,60,,,,,,,
source/DeviceLibrary/acFeederLine/FeederLineBean.cs
查看文件 @
41f0bde
using
AsaPL
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
...
@@ -21,7 +20,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -21,7 +20,6 @@ namespace OnlineStore.DeviceLibrary
public
LineMoveInfo
MoveInfo
=
null
;
public
LineMoveInfo
MoveInfo
=
null
;
public
AlarmType
alarmType
=
AlarmType
.
None
;
public
AlarmType
alarmType
=
AlarmType
.
None
;
public
RunStatus
runStatus
=
RunStatus
.
Wait
;
public
RunStatus
runStatus
=
RunStatus
.
Wait
;
public
AgvClient
agvClient
;
public
string
WarnMsg
=
""
;
public
string
WarnMsg
=
""
;
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
mainTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
mainTimer
=
new
System
.
Timers
.
Timer
();
...
@@ -46,14 +44,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -46,14 +44,15 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
Init
();
IOManager
.
Init
();
IOManager
.
instance
.
ConnectionIOList
(
Config
.
DIODeviceNameList
);
IOManager
.
instance
.
ConnectionIOList
(
Config
.
DIODeviceNameList
);
AgvClient
.
NodeList
.
Add
(
config
.
L2_AgvName
);
AgvClient
.
NodeList
.
Add
(
config
.
L1_AgvName
);
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
isAuto
==
1
)
if
(
isAuto
==
1
)
{
{
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
}
}
agvClient
=
new
AgvClient
();
AgvClient
.
Init
();
agvClient
.
Init
();
//Thread.Sleep(300);
//Thread.Sleep(300);
}
}
...
@@ -164,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -164,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
""
;
WarnMsg
=
""
;
RFIDManager
.
Close
();
RFIDManager
.
Close
();
a
gvClient
.
SetCancelState
(
true
);
A
gvClient
.
SetCancelState
(
true
);
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
serverConnectTimer
.
Enabled
=
false
;
serverConnectTimer
.
Enabled
=
false
;
StopMove
();
StopMove
();
...
@@ -346,10 +345,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -346,10 +345,10 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
stopwatch
.
Stop
();
stopwatch
.
Stop
();
Thread
.
Sleep
(
5000
);
IOManager
.
CIOMove
(
IO_Type
.
Tranverse_Run
,
IO_VALUE
.
LOW
);
IOManager
.
CIOMove
(
IO_Type
.
Tranverse_Run
,
IO_VALUE
.
LOW
);
// IOManager.IOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
// IOManager.IOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
LogUtil
.
info
(
" 横移电机停止"
);
LogUtil
.
info
(
" 横移电机停止"
);
Thread
.
Sleep
(
5000
);
IOManager
.
CIOMove
(
IO_Type
.
Tranverse_Up_SOL
,
IO_VALUE
.
LOW
);
IOManager
.
CIOMove
(
IO_Type
.
Tranverse_Up_SOL
,
IO_VALUE
.
LOW
);
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
IOManager
.
CIOMove
(
IO_Type
.
Tranverse_Down_SOL
,
IO_VALUE
.
HIGH
);
IOManager
.
CIOMove
(
IO_Type
.
Tranverse_Down_SOL
,
IO_VALUE
.
HIGH
);
...
@@ -363,7 +362,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -363,7 +362,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
span
=
DateTime
.
Now
-
il_lastCallAgvTime
;
TimeSpan
span
=
DateTime
.
Now
-
il_lastCallAgvTime
;
//退料1出口有料架,退料2入口空
//退料1出口有料架,退料2入口空
//出口信号需要持续6秒钟
//出口信号需要持续6秒钟
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
L2_InCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
span
.
TotalSeconds
>
6
)
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
L2_InCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOManager
.
IOValue
(
IO_Type
.
L1_ManualRecSig
).
Equals
(
IO_VALUE
.
HIGH
)
&&
span
.
TotalSeconds
>
6
)
{
{
if
(
LineManager
.
checkWatch
(
ol_tranverseShelfWatch
,
2000
))
if
(
LineManager
.
checkWatch
(
ol_tranverseShelfWatch
,
2000
))
{
{
...
...
source/DeviceLibrary/acFeederLine/FeederLineBean_Partial.cs
查看文件 @
41f0bde
...
@@ -130,8 +130,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -130,8 +130,8 @@ namespace OnlineStore.DeviceLibrary
{
{
//return "进料线出口" + Config.L2_AgvName + ":" + AgvClient.GetAction(Config.L2_AgvName) + ",料架: " + LastInShelfId + "\r\n" +
//return "进料线出口" + Config.L2_AgvName + ":" + AgvClient.GetAction(Config.L2_AgvName) + ",料架: " + LastInShelfId + "\r\n" +
// "出料线进口" + Config.L1_AgvName + ":" + AgvClient.GetAction(Config.L1_AgvName) + ",料架: " + LastOutShelfId + "\r\n";
// "出料线进口" + Config.L1_AgvName + ":" + AgvClient.GetAction(Config.L1_AgvName) + ",料架: " + LastOutShelfId + "\r\n";
return
"
退料1线入料口"
+
Config
.
L1_AgvName
+
":"
+
agvClient
.
Feeder_In_Msg
+
"\r\n"
+
//"料架: " + LastInShelfId + AgvClient.GetAction(Config.L1_AgvName)
return
"
入料线体入料口"
+
Config
.
L1_AgvName
+
":"
+
AgvClient
.
GetAction
(
Config
.
L1_AgvName
)
+
"\r\n"
+
//"料架: " + LastInShelfId + AgvClient.GetAction(Config.L1_AgvName)
"
退料2线出料口"
+
Config
.
L2_AgvName
+
":"
+
"料架: "
+
LastOutShelfId
+
" "
+
agvClient
.
Feeder_Out_Msg
+
"\r\n"
;
//+ "料架: " + LastOutShelfId + AgvClient.GetAction(Config.L2_AgvName) +
"
出料线体出料口"
+
Config
.
L2_AgvName
+
":"
+
AgvClient
.
GetAction
(
Config
.
L2_AgvName
)
+
"料架: "
+
LastOutShelfId
+
"\r\n"
;
//+ "料架: " + LastOutShelfId + AgvClient.GetAction(Config.L2_AgvName) +
}
}
#
endregion
#
endregion
...
@@ -170,8 +170,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -170,8 +170,8 @@ namespace OnlineStore.DeviceLibrary
needCheckList
.
Add
(
IO_Type
.
L2_StopDown
);
needCheckList
.
Add
(
IO_Type
.
L2_StopDown
);
}
}
bool
agvBusy
=
false
;
bool
agvBusy
=
false
;
if
(
agvClient
.
D21_InProcess
||
agvClient
.
D22_InProcess
)
//
if (agvClient.D21_InProcess || agvClient.D22_InProcess)
agvBusy
=
true
;
//
agvBusy = true;
if
(
agvBusy
&&
IsSleep
)
if
(
agvBusy
&&
IsSleep
)
{
{
UpdateSleep
(
false
);
UpdateSleep
(
false
);
...
...
source/DeviceLibrary/acFeederLine/LineManager.cs
查看文件 @
41f0bde
...
@@ -60,14 +60,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -60,14 +60,14 @@ namespace OnlineStore.DeviceLibrary
string
appPath
=
Application
.
StartupPath
;
string
appPath
=
Application
.
StartupPath
;
string
linefilePath
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Line_Config
);
string
linefilePath
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Line_Config
);
LogUtil
.
info
(
LOGGER
,
" 开始加载
Feeder流水线
配置:"
+
linefilePath
);
LogUtil
.
info
(
LOGGER
,
" 开始加载
线体
配置:"
+
linefilePath
);
RobotConfig
storeConfig
=
CSVConfigReader
.
LoadConfig
(
linefilePath
);
RobotConfig
storeConfig
=
CSVConfigReader
.
LoadConfig
(
linefilePath
);
Config
=
(
FeederLineConfig
)
storeConfig
;
Config
=
(
FeederLineConfig
)
storeConfig
;
feederLine
=
new
FeederLineBean
(
Config
);
feederLine
=
new
FeederLineBean
(
Config
);
LogUtil
.
info
(
LOGGER
,
"加载
Feeder流水线
完成!"
);
LogUtil
.
info
(
LOGGER
,
"加载
线体配置
完成!"
);
return
feederLine
;
return
feederLine
;
}
}
...
...
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
41f0bde
using
Asa
;
using
Asa.RFID
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
AsaPL
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
OnlineStore.LoadCSVLibrary
;
using
System.Web.UI.WebControls
;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
public
class
AgvClient
public
class
AgvClient
{
{
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
AsaPL
.
AgvClient
agvClient
;
private
static
Asa
.
AgvClient
agvClient
;
public
static
Dictionary
<
string
,
Asa
.
ClientAction
>
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
public
static
List
<
string
>
NodeList
=
new
List
<
string
>();
private
static
bool
isInit
=
false
;
private
static
bool
isInit
=
false
;
public
static
Dictionary
<
string
,
AsaPL
.
ClientAction
>
actionMap
=
new
Dictionary
<
string
,
AsaPL
.
ClientAction
>();
public
static
void
Init
()
public
bool
D21_InProcess
=
false
;
public
bool
D22_InProcess
=
false
;
private
static
string
InLine_Name
=
"C21"
;
private
static
string
OutLine_Name
=
"C22"
;
public
string
D22_RFID
{
get
;
set
;
}
=
""
;
#
region
D21
Action
/// <summary>
/// 无状态
/// </summary>
public
void
D21_None
()
{
SetStatus
(
"D21"
,
""
,
ClientAction
.
None
);
}
/// <summary>
/// 可以进入状态
/// </summary>
public
void
D21_NeedEnter
()
{
SetStatus
(
"D21"
,
""
,
ClientAction
.
NeedEnter
);
}
#
endregion
#
region
D22
Action
/// <summary>
/// 无状态
/// </summary>
public
void
D22_None
()
{
SetStatus
(
"D22"
,
""
,
ClientAction
.
None
);
}
/// <summary>
/// 可以出去状态
/// </summary>
public
void
D22_NeedLeave
()
{
SetStatus
(
"D22"
,
D22_RFID
,
ClientAction
.
NeedLeave
);
}
#
endregion
public
void
Init
()
{
{
try
try
{
{
if
(!
isInit
)
if
(!
isInit
)
{
{
isInit
=
true
;
isInit
=
true
;
agvClient
=
new
Asa
PL
.
AgvClient
(
ServerIp
);
agvClient
=
new
Asa
.
AgvClient
(
ServerIp
);
agvClient
.
CancelState
=
fals
e
;
agvClient
.
CancelState
=
tru
e
;
agvClient
.
ReadyEnter
+=
AgvClient_ReadyEnter
;
agvClient
.
Log
+=
AgvClient_Log
;
agvClient
.
ReadyLeave
+=
AgvClient_ReadyLeave
;
agvClient
.
Arrive
+=
AgvClient_Arrive
;
agvClient
.
AGVFinishEnter
+=
AgvClient_FinishEnter
;
agvClient
.
Ready
+=
AgvClient_Ready
;
agvClient
.
AGVFinishLeave
+=
AgvClient_FinishLeave
;
agvClient
.
CloseDoor
+=
AgvClient_CloseDoor
;
}
}
actionMap
=
new
Dictionary
<
string
,
AsaPL
.
ClientAction
>();
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
agvClient
.
SetStatus
(
InLine_Name
,
""
,
ClientAction
.
None
);
//foreach (string key in NodeList)
agvClient
.
SetStatus
(
OutLine_Name
,
""
,
ClientAction
.
None
);
//{
// actionMap.Add(key, Asa.ClientAction.None);
//}
agvClient
.
Connect
();
agvClient
.
Connect
();
LogUtil
.
info
(
"初始化AGV服务"
);
foreach
(
string
str
in
NodeList
)
{
SetStatus
(
str
);
LogUtil
.
info
(
"agv init ,SetStatus["
+
str
+
"]=none "
);
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"初始化
AGV服务
"
+
ServerIp
+
" 出错:"
,
ex
);
LogUtil
.
error
(
"初始化
agvClient
"
+
ServerIp
+
" 出错:"
,
ex
);
}
}
}
}
/// <summary>
public
static
void
SetCancelState
(
bool
isCancel
)
/// 设置取消状态
/// </summary>
/// <param name="isCancel">true则ClientAction为None</param>
public
void
SetCancelState
(
bool
isCancel
)
{
{
agvClient
.
CancelState
=
isCancel
;
agvClient
.
CancelState
=
isCancel
;
}
}
private
static
void
AgvClient_CloseDoor
(
string
id
,
string
rfid
)
{
//RFIDData data = new RFIDData(content);
LogUtil
.
info
(
"收到 AgvClient_CloseDoor ["
+
id
+
"] ["
+
rfid
+
"] "
);
}
public
string
Feeder_In_Msg
=
""
;
public
static
void
SetStatus
(
string
id
,
string
shelfId
=
""
,
ClientAction
action
=
ClientAction
.
None
,
ClientLevel
level
=
ClientLevel
.
Low
)
public
string
Feeder_Out_Msg
=
""
;
/// <summary>
/// 小车准备进入
/// </summary>
/// <param name="name">节点名称</param>
private
void
AgvClient_ReadyEnter
(
string
name
)
{
{
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
!
D21_InProcess
&&
name
.
Equals
(
InLine_Name
))
// ClientAction currA = GetAction(id);
if
(
actionMap
.
ContainsKey
(
id
))
{
{
MayEnter
(
InLine_Name
);
ClientAction
currA
=
actionMap
[
id
];
//相同状态就设置一次
Task
.
Factory
.
StartNew
(
delegate
if
(
currA
.
Equals
(
action
))
{
{
Feeder_In_Msg
=
"Feeder In: 等待 L1_InCheck=HIGH"
;
return
;
LogUtil
.
info
(
Feeder_In_Msg
);
}
try
{
WaitUtil
.
Wait
(
60000
,
delegate
{
return
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
HIGH
);
},
"等待L1_InCheck=HIGH"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"Feeder In:"
+
ex
.
ToString
());
}
//五秒后改为离开状态
Thread
.
Sleep
(
5000
);
Feeder_In_Msg
=
"Feeder In: 调用 FinishEnter "
;
LogUtil
.
info
(
Feeder_In_Msg
);
FinishEnter
(
InLine_Name
);
Feeder_In_Msg
=
"Feeder In: 处理结束 更新状态为None "
;
LogUtil
.
info
(
Feeder_In_Msg
);
D21_None
();
});
}
else
{
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
HIGH
))
Feeder_In_Msg
=
"Feeder In: L1_InCheck 检测到有料架,AGV的料架无法进入"
;
LogUtil
.
info
(
Feeder_In_Msg
);
D21_None
();
}
}
LogUtil
.
info
(
"收到 AgvClient_ReadyEnter ["
+
name
+
"]"
);
agvClient
.
SetStatus
(
id
,
""
,
shelfId
,
action
,
level
);
UpdateAction
(
id
,
action
);
}
}
private
static
void
AgvClient_Ready
(
string
id
,
string
rfid
)
/// <summary>
///料架准备离开
/// </summary>
/// <param name="name">节点名称</param>
private
void
AgvClient_ReadyLeave
(
string
name
)
{
{
//SetStatus(name, "", ClientAction.ReadyLeave);
// RFIDData data = new RFIDData(content);
//if (name.Equals("D22"))
string
logName
=
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
rfid
+
"] "
;
//{
LogUtil
.
info
(
logName
);
// D22_InProcess = true;
// D22_ReadyLeave = true;
UpdateAction
(
id
,
Asa
.
ClientAction
.
Ready
);
//}
if
(
id
.
Equals
(
LineManager
.
Config
.
L1_AgvName
))
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
!
D22_InProcess
&&
name
.
Equals
(
OutLine_Name
))
{
{
LineManager
.
feederLine
.
UpdateSleep
(
false
);
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
Task
.
Factory
.
StartNew
(
delegate
{
// SetStatus(id, "", ClientAction.MayEnter);
LogUtil
.
info
(
logName
+
" ,等待OutL_InCheck"
);
try
{
WaitUtil
.
Wait
(
60000
,
delegate
{
return
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
HIGH
);
},
"等待L1_InCheck=HIGH"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
logName
+
":"
+
ex
.
ToString
());
}
//两秒后改为离开状态
Thread
.
Sleep
(
3000
);
LogUtil
.
info
(
logName
+
" ,调用 FinishEnter "
);
SetStatus
(
id
,
""
,
ClientAction
.
FinishEnter
);
MayLeave
(
OutLine_Name
);
Thread
.
Sleep
(
5000
);
//LineManager.feederLine.UpdateSleep(false);
LogUtil
.
info
(
logName
+
" ,处理结束 更新状态为None "
);
LineManager
.
feederLine
.
StopIOMove
(
IO_Type
.
L2_OutStopDown
,
1500
);
SetStatus
(
id
,
""
,
ClientAction
.
None
);
//agvClient.MayLeave(id);
// SetStatus(id, shefId, ClientAction.MayLeave);
Feeder_Out_Msg
=
"Feeder Out: 允许流出料架"
;
LogUtil
.
info
(
Feeder_Out_Msg
);
Task
.
Factory
.
StartNew
(
delegate
});
}
else
{
{
//十秒后改为完成状态
LogUtil
.
error
(
logName
+
" OutL_InCheck 检测到有料架,AGV的料架无法进入"
);
Thread
.
Sleep
(
10000
);
SetStatus
(
id
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
);
Feeder_Out_Msg
=
"Feeder Out: 调用 FinishLeave "
;
}
LogUtil
.
info
(
Feeder_Out_Msg
);
FinishLeave
(
OutLine_Name
);
Thread
.
Sleep
(
5000
);
Feeder_Out_Msg
=
"Feeder Out: 处理结束 更新状态为None "
;
LogUtil
.
info
(
Feeder_Out_Msg
);
D22_None
();
});
}
}
else
else
if
(
id
.
Equals
(
LineManager
.
Config
.
L2_AgvName
))
{
{
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
LOW
))
string
shefId
=
LineManager
.
feederLine
.
LastOutShelfId
;
Feeder_Out_Msg
=
"Feeder Out: L2_OutCheck 未检测到料架,无法将料架进入AGV"
;
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
))
LogUtil
.
info
(
Feeder_Out_Msg
);
{
D22_None
();
LineManager
.
feederLine
.
UpdateSleep
(
false
);
}
LineManager
.
feederLine
.
StopIOMove
(
IO_Type
.
L2_OutStopDown
,
1500
);
//agvClient.MayLeave(id);
// SetStatus(id, shefId, ClientAction.MayLeave);
LogUtil
.
info
(
logName
+
"下降 L2_OutStopDown , "
+
shefId
);
LogUtil
.
info
(
"收到 AgvClient_ReadyLeave ["
+
name
+
"] "
);
Task
.
Factory
.
StartNew
(
delegate
{
//两秒后改为离开状态
Thread
.
Sleep
(
5000
);
LogUtil
.
info
(
logName
+
" ,调用 FinishLeave "
+
shefId
);
SetStatus
(
id
,
shefId
,
ClientAction
.
FinishLeave
);
}
Thread
.
Sleep
(
5000
);
/// <summary>
LogUtil
.
info
(
logName
+
" ,处理结束 更新状态为None "
);
/// 料架离开小车完成
SetStatus
(
id
,
""
,
ClientAction
.
None
);
/// </summary>
});
/// <param name="name"></param>
}
private
void
AgvClient_FinishLeave
(
string
name
)
else
{
{
if
(
name
.
Equals
(
InLine_Name
))
LogUtil
.
error
(
logName
+
" L2_OutCheck 未检测到料架,无法将料架进入AGV"
);
{
SetStatus
(
id
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
);
D21_InProcess
=
false
;
}
}
}
else
if
(
name
.
Equals
(
OutLine_Name
))
}
private
static
void
AgvClient_Arrive
(
string
id
,
string
rfid
)
{
UpdateAction
(
id
,
Asa
.
ClientAction
.
Arrive
);
// RFIDData data = new RFIDData(content);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
rfid
+
"] "
);
}
public
static
bool
SetToNone
(
string
id
,
string
shelfId
=
""
)
{
ClientAction
currA
=
GetAction
(
id
);
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
NeedLeave
)
||
currA
.
Equals
(
ClientAction
.
NeedEnter
))
{
{
D22_InProcess
=
false
;
SetStatus
(
id
,
shelfId
,
ClientAction
.
None
);
return
true
;
}
}
LogUtil
.
info
(
"收到 AgvClient_FinishLeave ["
+
name
+
"] "
)
;
return
false
;
}
}
/// <summary>
public
static
bool
NeedEnter
(
string
id
,
string
shelfId
)
/// 料架进入小车完成
/// </summary>
/// <param name="name"></param>
private
void
AgvClient_FinishEnter
(
string
name
)
{
{
//if (name.Equals("D21"))
ClientAction
currA
=
GetAction
(
id
);
//{
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
NeedLeave
)
||
currA
.
Equals
(
ClientAction
.
NeedEnter
))
// D21_InProcess = false;
{
//}
SetStatus
(
id
,
shelfId
,
ClientAction
.
NeedEnter
);
//else if (name.Equals("D22"))
return
true
;
//{
}
// D22_InProcess = false;
return
false
;
//}
LogUtil
.
info
(
"收到 AgvClient_FinishEnter ["
+
name
+
"] "
);
}
}
public
static
bool
NeedLeave
(
string
id
,
string
shelfId
)
public
void
MayEnter
(
string
name
)
{
{
SetStatus
(
name
,
""
,
ClientAction
.
MayEnter
);
ClientAction
currA
=
GetAction
(
id
);
if
(
name
.
Equals
(
InLine_Name
))
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
NeedLeave
)
||
currA
.
Equals
(
ClientAction
.
NeedEnter
))
{
{
D21_InProcess
=
true
;
SetStatus
(
id
,
shelfId
,
ClientAction
.
NeedLeave
);
return
true
;
}
}
LogUtil
.
info
(
"MayEnter ["
+
name
+
"] "
)
;
return
false
;
}
}
public
static
bool
ISConnected
()
public
void
MayLeave
(
string
name
)
{
{
SetStatus
(
name
,
""
,
ClientAction
.
MayLeave
);
if
(
agvClient
==
null
)
if
(
name
.
Equals
(
OutLine_Name
))
{
{
D22_InProcess
=
tru
e
;
return
fals
e
;
}
}
LogUtil
.
info
(
"MayLeave ["
+
name
+
"] "
)
;
return
agvClient
.
IsConn
;
}
}
//public static void SendRFID(string NodeName, string rfid)
//{
// agvClient.SendRFID(NodeName, rfid);
/// <summary>
//}
/// 料架进入产线完成
private
static
void
AgvClient_Log
(
string
s
)
/// </summary>
/// <param name="name"></param>
public
void
FinishEnter
(
string
name
)
{
{
Task
.
Factory
.
StartNew
(
delegate
try
{
{
SetStatus
(
name
,
""
,
ClientAction
.
FinishEnter
);
bool
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Agv_Log_Open
).
Equals
(
1
);
if
(
isLog
)
Thread
.
Sleep
(
15000
);
if
(
name
.
Equals
(
InLine_Name
))
{
{
D21_InProcess
=
false
;
LogUtil
.
info
(
" AGV "
+
ServerIp
+
" Log : "
+
s
)
;
}
}
else
if
(
name
.
Equals
(
OutLine_Name
))
}
{
catch
(
Exception
ex
)
D22_InProcess
=
false
;
}
});
}
/// <summary>
/// 料架离开产线完成
/// </summary>
/// <param name="name"></param>
public
void
FinishLeave
(
string
name
)
{
Task
.
Factory
.
StartNew
(
delegate
{
{
SetStatus
(
name
,
""
,
ClientAction
.
FinishLeave
);
LogUtil
.
error
(
"AgvClient_Log 出错:"
+
ex
.
ToString
());
Thread
.
Sleep
(
15000
);
}
if
(
name
.
Equals
(
InLine_Name
))
{
D21_InProcess
=
false
;
}
else
if
(
name
.
Equals
(
OutLine_Name
))
{
D22_InProcess
=
false
;
}
});
}
}
p
rivate
bool
SetStatus
(
string
name
,
string
shelfId
=
""
,
ClientAction
action
=
ClientAction
.
None
,
ClientLevel
level
=
ClientLevel
.
Low
)
p
ublic
static
Asa
.
ClientAction
GetAction
(
string
NodeName
)
{
{
// if (!agvClient.IsConn)
if
(
actionMap
.
ContainsKey
(
NodeName
))
// {
// LogUtil.error("SetStatus AGV服务未连接!");
// return false;
// }
if
(
actionMap
.
ContainsKey
(
name
))
{
{
ClientAction
currA
=
actionMap
[
name
];
//相同状态就设置一次
return
actionMap
[
NodeName
];
if
(
currA
.
Equals
(
action
)
&&
shelfId
==
""
)
{
return
false
;
}
// actionMap[name] = action;
// agvClient.SetStatus(name, shelfId, action, level);
//LogUtil.info("设置 " + name + " [" + shelfId + "] " + action.ToString());
return
true
;
}
}
agvClient
.
SetStatus
(
name
,
shelfId
,
action
,
level
);
return
Asa
.
ClientAction
.
None
;
//actionMap.Add(name, action);
//LogUtil.info("设置 " + name + " ["+ shelfId + "] "+ action.ToString());
return
true
;
}
}
public
static
void
UpdateAction
(
string
name
,
Asa
.
ClientAction
action
)
public
bool
ISConnected
()
{
{
if
(
a
gvClient
==
null
)
if
(
a
ctionMap
.
ContainsKey
(
name
)
)
{
{
return
false
;
actionMap
[
name
]
=
action
;
}
else
{
actionMap
.
Add
(
name
,
action
);
}
}
return
agvClient
.
IsConn
;
}
}
public
static
void
Dispose
()
public
void
Dispose
()
{
{
try
try
{
{
if
(
agvClient
!=
null
)
if
(
agvClient
!=
null
)
{
{
agvClient
.
Close
();
agvClient
.
Close
();
LogUtil
.
info
(
"关闭AGV服务"
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"
关闭AGV服务
"
+
ServerIp
+
" 出错:"
,
ex
);
LogUtil
.
error
(
"
agvClient.Close
"
+
ServerIp
+
" 出错:"
,
ex
);
}
}
}
}
}
}
}
}
source/DeviceLibrary/agvClient/AgvClient1.cs
0 → 100644
查看文件 @
41f0bde
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
AsaPL
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
OnlineStore.LoadCSVLibrary
;
using
System.Web.UI.WebControls
;
namespace
OnlineStore.DeviceLibrary
{
public
class
AgvClient
{
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
AsaPL
.
AgvClient
agvClient
;
private
static
bool
isInit
=
false
;
public
static
Dictionary
<
string
,
AsaPL
.
ClientAction
>
actionMap
=
new
Dictionary
<
string
,
AsaPL
.
ClientAction
>();
public
bool
D21_InProcess
=
false
;
public
bool
D22_InProcess
=
false
;
private
static
string
InLine_Name
=
"C21"
;
private
static
string
OutLine_Name
=
"C22"
;
public
string
D22_RFID
{
get
;
set
;
}
=
""
;
#
region
D21
Action
/// <summary>
/// 无状态
/// </summary>
public
void
D21_None
()
{
SetStatus
(
"D21"
,
""
,
ClientAction
.
None
);
}
/// <summary>
/// 可以进入状态
/// </summary>
public
void
D21_NeedEnter
()
{
SetStatus
(
"D21"
,
""
,
ClientAction
.
NeedEnter
);
}
#
endregion
#
region
D22
Action
/// <summary>
/// 无状态
/// </summary>
public
void
D22_None
()
{
SetStatus
(
"D22"
,
""
,
ClientAction
.
None
);
}
/// <summary>
/// 可以出去状态
/// </summary>
public
void
D22_NeedLeave
()
{
SetStatus
(
"D22"
,
D22_RFID
,
ClientAction
.
NeedLeave
);
}
#
endregion
public
void
Init
()
{
try
{
if
(!
isInit
)
{
isInit
=
true
;
agvClient
=
new
AsaPL
.
AgvClient
(
ServerIp
);
agvClient
.
CancelState
=
false
;
agvClient
.
ReadyEnter
+=
AgvClient_ReadyEnter
;
agvClient
.
ReadyLeave
+=
AgvClient_ReadyLeave
;
agvClient
.
AGVFinishEnter
+=
AgvClient_FinishEnter
;
agvClient
.
AGVFinishLeave
+=
AgvClient_FinishLeave
;
}
actionMap
=
new
Dictionary
<
string
,
AsaPL
.
ClientAction
>();
agvClient
.
SetStatus
(
InLine_Name
,
""
,
ClientAction
.
None
);
agvClient
.
SetStatus
(
OutLine_Name
,
""
,
ClientAction
.
None
);
agvClient
.
Connect
();
LogUtil
.
info
(
"初始化AGV服务"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"初始化AGV服务 "
+
ServerIp
+
" 出错:"
,
ex
);
}
}
/// <summary>
/// 设置取消状态
/// </summary>
/// <param name="isCancel">true则ClientAction为None</param>
public
void
SetCancelState
(
bool
isCancel
)
{
agvClient
.
CancelState
=
isCancel
;
}
public
string
Feeder_In_Msg
=
""
;
public
string
Feeder_Out_Msg
=
""
;
/// <summary>
/// 小车准备进入
/// </summary>
/// <param name="name">节点名称</param>
private
void
AgvClient_ReadyEnter
(
string
name
)
{
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
LOW
)
&&
!
D21_InProcess
&&
name
.
Equals
(
InLine_Name
))
{
MayEnter
(
InLine_Name
);
Task
.
Factory
.
StartNew
(
delegate
{
Feeder_In_Msg
=
"Feeder In: 等待 L1_InCheck=HIGH"
;
LogUtil
.
info
(
Feeder_In_Msg
);
try
{
WaitUtil
.
Wait
(
60000
,
delegate
{
return
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
HIGH
);
},
"等待L1_InCheck=HIGH"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"Feeder In:"
+
ex
.
ToString
());
}
//五秒后改为离开状态
Thread
.
Sleep
(
5000
);
Feeder_In_Msg
=
"Feeder In: 调用 FinishEnter "
;
LogUtil
.
info
(
Feeder_In_Msg
);
FinishEnter
(
InLine_Name
);
Feeder_In_Msg
=
"Feeder In: 处理结束 更新状态为None "
;
LogUtil
.
info
(
Feeder_In_Msg
);
D21_None
();
});
}
else
{
if
(
IOManager
.
IOValue
(
IO_Type
.
L1_InCheck
).
Equals
(
IO_VALUE
.
HIGH
))
Feeder_In_Msg
=
"Feeder In: L1_InCheck 检测到有料架,AGV的料架无法进入"
;
LogUtil
.
info
(
Feeder_In_Msg
);
D21_None
();
}
LogUtil
.
info
(
"收到 AgvClient_ReadyEnter ["
+
name
+
"]"
);
}
/// <summary>
///料架准备离开
/// </summary>
/// <param name="name">节点名称</param>
private
void
AgvClient_ReadyLeave
(
string
name
)
{
//SetStatus(name, "", ClientAction.ReadyLeave);
//if (name.Equals("D22"))
//{
// D22_InProcess = true;
// D22_ReadyLeave = true;
//}
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
!
D22_InProcess
&&
name
.
Equals
(
OutLine_Name
))
{
MayLeave
(
OutLine_Name
);
//LineManager.feederLine.UpdateSleep(false);
LineManager
.
feederLine
.
StopIOMove
(
IO_Type
.
L2_OutStopDown
,
1500
);
//agvClient.MayLeave(id);
// SetStatus(id, shefId, ClientAction.MayLeave);
Feeder_Out_Msg
=
"Feeder Out: 允许流出料架"
;
LogUtil
.
info
(
Feeder_Out_Msg
);
Task
.
Factory
.
StartNew
(
delegate
{
//十秒后改为完成状态
Thread
.
Sleep
(
10000
);
Feeder_Out_Msg
=
"Feeder Out: 调用 FinishLeave "
;
LogUtil
.
info
(
Feeder_Out_Msg
);
FinishLeave
(
OutLine_Name
);
Thread
.
Sleep
(
5000
);
Feeder_Out_Msg
=
"Feeder Out: 处理结束 更新状态为None "
;
LogUtil
.
info
(
Feeder_Out_Msg
);
D22_None
();
});
}
else
{
if
(
IOManager
.
IOValue
(
IO_Type
.
L2_OutCheck
).
Equals
(
IO_VALUE
.
LOW
))
Feeder_Out_Msg
=
"Feeder Out: L2_OutCheck 未检测到料架,无法将料架进入AGV"
;
LogUtil
.
info
(
Feeder_Out_Msg
);
D22_None
();
}
LogUtil
.
info
(
"收到 AgvClient_ReadyLeave ["
+
name
+
"] "
);
}
/// <summary>
/// 料架离开小车完成
/// </summary>
/// <param name="name"></param>
private
void
AgvClient_FinishLeave
(
string
name
)
{
if
(
name
.
Equals
(
InLine_Name
))
{
D21_InProcess
=
false
;
}
else
if
(
name
.
Equals
(
OutLine_Name
))
{
D22_InProcess
=
false
;
}
LogUtil
.
info
(
"收到 AgvClient_FinishLeave ["
+
name
+
"] "
);
}
/// <summary>
/// 料架进入小车完成
/// </summary>
/// <param name="name"></param>
private
void
AgvClient_FinishEnter
(
string
name
)
{
//if (name.Equals("D21"))
//{
// D21_InProcess = false;
//}
//else if (name.Equals("D22"))
//{
// D22_InProcess = false;
//}
LogUtil
.
info
(
"收到 AgvClient_FinishEnter ["
+
name
+
"] "
);
}
public
void
MayEnter
(
string
name
)
{
SetStatus
(
name
,
""
,
ClientAction
.
MayEnter
);
if
(
name
.
Equals
(
InLine_Name
))
{
D21_InProcess
=
true
;
}
LogUtil
.
info
(
"MayEnter ["
+
name
+
"] "
);
}
public
void
MayLeave
(
string
name
)
{
SetStatus
(
name
,
""
,
ClientAction
.
MayLeave
);
if
(
name
.
Equals
(
OutLine_Name
))
{
D22_InProcess
=
true
;
}
LogUtil
.
info
(
"MayLeave ["
+
name
+
"] "
);
}
/// <summary>
/// 料架进入产线完成
/// </summary>
/// <param name="name"></param>
public
void
FinishEnter
(
string
name
)
{
Task
.
Factory
.
StartNew
(
delegate
{
SetStatus
(
name
,
""
,
ClientAction
.
FinishEnter
);
Thread
.
Sleep
(
15000
);
if
(
name
.
Equals
(
InLine_Name
))
{
D21_InProcess
=
false
;
}
else
if
(
name
.
Equals
(
OutLine_Name
))
{
D22_InProcess
=
false
;
}
});
}
/// <summary>
/// 料架离开产线完成
/// </summary>
/// <param name="name"></param>
public
void
FinishLeave
(
string
name
)
{
Task
.
Factory
.
StartNew
(
delegate
{
SetStatus
(
name
,
""
,
ClientAction
.
FinishLeave
);
Thread
.
Sleep
(
15000
);
if
(
name
.
Equals
(
InLine_Name
))
{
D21_InProcess
=
false
;
}
else
if
(
name
.
Equals
(
OutLine_Name
))
{
D22_InProcess
=
false
;
}
});
}
private
bool
SetStatus
(
string
name
,
string
shelfId
=
""
,
ClientAction
action
=
ClientAction
.
None
,
ClientLevel
level
=
ClientLevel
.
Low
)
{
// if (!agvClient.IsConn)
// {
// LogUtil.error("SetStatus AGV服务未连接!");
// return false;
// }
if
(
actionMap
.
ContainsKey
(
name
))
{
ClientAction
currA
=
actionMap
[
name
];
//相同状态就设置一次
if
(
currA
.
Equals
(
action
)
&&
shelfId
==
""
)
{
return
false
;
}
// actionMap[name] = action;
// agvClient.SetStatus(name, shelfId, action, level);
//LogUtil.info("设置 " + name + " [" + shelfId + "] " + action.ToString());
return
true
;
}
agvClient
.
SetStatus
(
name
,
shelfId
,
action
,
level
);
//actionMap.Add(name, action);
//LogUtil.info("设置 " + name + " ["+ shelfId + "] "+ action.ToString());
return
true
;
}
public
bool
ISConnected
()
{
if
(
agvClient
==
null
)
{
return
false
;
}
return
agvClient
.
IsConn
;
}
public
void
Dispose
()
{
try
{
if
(
agvClient
!=
null
)
{
agvClient
.
Close
();
LogUtil
.
info
(
"关闭AGV服务"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"关闭AGV服务 "
+
ServerIp
+
" 出错:"
,
ex
);
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论