Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7a440845
由
LN
编写于
2020-02-12 16:40:24 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
agv修改
1 个父辈
de17e2b5
全部展开
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
914 行增加
和
102 行删除
dll/Client.dll
dll/Client.xml
source/AssemblyLineClient/App.config
source/AssemblyLineClient/AssemblyLineClient.csproj
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/AssemblyLineClient/agvtest/FrmAgvTest.Designer.cs
source/AssemblyLineClient/agvtest/FrmAgvTest.cs
source/AssemblyLineClient/agvtest/FrmAgvTest.resx
source/DeviceLibrary/agvClient/AgvClient -20200210-back.cs
source/DeviceLibrary/agvClient/AgvClient.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
dll/Client.dll
查看文件 @
7a44084
此文件类型无法预览
dll/Client.xml
查看文件 @
7a44084
...
...
@@ -199,5 +199,249 @@
<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.GetRFID"
>
<summary>
服务端发送的RFID
</summary>
</member>
<member
name=
"E:Asa.Client2.Arrive"
>
<summary>
小车到达,仅包装料仓
</summary>
</member>
<member
name=
"E:Asa.Client2.Ready"
>
<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=
"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.Reconnect"
>
<summary>
发送RFID
</summary>
<param
name=
"name"
></param>
<param
name=
"content"
></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.MayEnter"
>
<summary>
可以进入料架(包装料仓)
</summary>
</member>
<member
name=
"F:Asa.ClientAction.MayLeave"
>
<summary>
可以出去料架(包装料仓)
</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=
"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/AssemblyLineClient/App.config
查看文件 @
7a44084
...
...
@@ -39,7 +39,7 @@
<!--流水线监听端口-->
<
add
key
=
"TCPServerPort"
value
=
"5246"
/>
<!--
AGV
调度服务器地址-->
<
add
key
=
"AgvServerIp"
value
=
"1
92.168.103.22
"
/>
<
add
key
=
"AgvServerIp"
value
=
"1
0.85.160.20
"
/>
<!--
IO
配置-->
<
add
key
=
"DIMS"
value
=
"60"
/>
<
add
key
=
"DOMS"
value
=
"300"
/>
...
...
@@ -55,7 +55,7 @@
<
add
key
=
"CodeCount"
value
=
"3"
/>
<
add
key
=
"DefaultTrayNum"
value
=
"0"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"
0
"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"
1
"
/>
</
appSettings
>
<!-- <
log4net
> -->
<!-- <
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
> -->
...
...
source/AssemblyLineClient/AssemblyLineClient.csproj
查看文件 @
7a44084
...
...
@@ -55,6 +55,9 @@
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Reference Include="Client">
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference>
...
...
@@ -79,6 +82,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="agvtest\FrmAgvTest.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="agvtest\FrmAgvTest.Designer.cs">
<DependentUpon>FrmAgvTest.cs</DependentUpon>
</Compile>
<Compile Include="FrmIOMsg.cs">
<SubType>Form</SubType>
</Compile>
...
...
@@ -160,6 +169,9 @@
<Compile Include="ManagerUtil.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="agvtest\FrmAgvTest.resx">
<DependentUpon>FrmAgvTest.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmIOMsg.resx">
<DependentUpon>FrmIOMsg.cs</DependentUpon>
</EmbeddedResource>
...
...
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
7a44084
...
...
@@ -33,6 +33,7 @@
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
logBox
=
new
System
.
Windows
.
Forms
.
RichTextBox
();
this
.
lblCID
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
chbInStoNG
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
cmbTrayType
=
new
System
.
Windows
.
Forms
.
ComboBox
();
...
...
@@ -47,7 +48,6 @@
this
.
lblMoveInfo
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnTrayInfo
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblCID
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
chbAutoRun
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
chkDebug
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btnClearLog
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -82,6 +82,8 @@
this
.
托盘初始化
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator9
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
iO
模块状态
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator13
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripMenuItem2
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator12
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
清空托盘信息
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
帮助
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
...
...
@@ -96,6 +98,7 @@
this
.
toolStripSeparator8
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
checkBox1
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
...
...
@@ -123,6 +126,7 @@
//
// tabPage1
//
this
.
tabPage1
.
Controls
.
Add
(
this
.
checkBox1
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
logBox
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
lblCID
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
groupBox3
);
...
...
@@ -143,13 +147,24 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
logBox
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
logBox
.
Location
=
new
System
.
Drawing
.
Point
(
448
,
1
44
);
this
.
logBox
.
Location
=
new
System
.
Drawing
.
Point
(
448
,
1
67
);
this
.
logBox
.
Name
=
"logBox"
;
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
872
,
4
62
);
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
872
,
4
39
);
this
.
logBox
.
TabIndex
=
106
;
this
.
logBox
.
Text
=
""
;
this
.
logBox
.
VisibleChanged
+=
new
System
.
EventHandler
(
this
.
logBox_VisibleChanged
);
//
// lblCID
//
this
.
lblCID
.
AutoSize
=
true
;
this
.
lblCID
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblCID
.
Location
=
new
System
.
Drawing
.
Point
(
1287
,
4
);
this
.
lblCID
.
Name
=
"lblCID"
;
this
.
lblCID
.
Size
=
new
System
.
Drawing
.
Size
(
33
,
20
);
this
.
lblCID
.
TabIndex
=
95
;
this
.
lblCID
.
Text
=
"CID"
;
this
.
lblCID
.
Visible
=
false
;
//
// groupBox3
//
this
.
groupBox3
.
Controls
.
Add
(
this
.
chbInStoNG
);
...
...
@@ -302,17 +317,6 @@
this
.
btnTrayInfo
.
UseVisualStyleBackColor
=
false
;
this
.
btnTrayInfo
.
Click
+=
new
System
.
EventHandler
(
this
.
btnTrayInfo_Click
);
//
// lblCID
//
this
.
lblCID
.
AutoSize
=
true
;
this
.
lblCID
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblCID
.
Location
=
new
System
.
Drawing
.
Point
(
1287
,
4
);
this
.
lblCID
.
Name
=
"lblCID"
;
this
.
lblCID
.
Size
=
new
System
.
Drawing
.
Size
(
33
,
20
);
this
.
lblCID
.
TabIndex
=
95
;
this
.
lblCID
.
Text
=
"CID"
;
this
.
lblCID
.
Visible
=
false
;
//
// chbAutoRun
//
this
.
chbAutoRun
.
AutoSize
=
true
;
...
...
@@ -584,6 +588,8 @@
this
.
托盘初始化
ToolStripMenuItem
,
this
.
toolStripSeparator9
,
this
.
iO
模块状态
ToolStripMenuItem
,
this
.
toolStripSeparator13
,
this
.
toolStripMenuItem2
,
this
.
toolStripSeparator12
,
this
.
清空托盘信息
ToolStripMenuItem
});
this
.
设置
TToolStripMenuItem
.
Name
=
"设置TToolStripMenuItem"
;
...
...
@@ -635,6 +641,18 @@
this
.
iO
模块状态
ToolStripMenuItem
.
Text
=
"IO模块状态"
;
this
.
iO
模块状态
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
iO
模块状态
ToolStripMenuItem_Click
);
//
// toolStripSeparator13
//
this
.
toolStripSeparator13
.
Name
=
"toolStripSeparator13"
;
this
.
toolStripSeparator13
.
Size
=
new
System
.
Drawing
.
Size
(
177
,
6
);
//
// toolStripMenuItem2
//
this
.
toolStripMenuItem2
.
Name
=
"toolStripMenuItem2"
;
this
.
toolStripMenuItem2
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
26
);
this
.
toolStripMenuItem2
.
Text
=
"AGV调试"
;
this
.
toolStripMenuItem2
.
Click
+=
new
System
.
EventHandler
(
this
.
toolStripMenuItem2_Click
);
//
// toolStripSeparator12
//
this
.
toolStripSeparator12
.
Name
=
"toolStripSeparator12"
;
...
...
@@ -732,6 +750,18 @@
this
.
timer1
.
Interval
=
2000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// checkBox1
//
this
.
checkBox1
.
AutoSize
=
true
;
this
.
checkBox1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
checkBox1
.
Location
=
new
System
.
Drawing
.
Point
(
478
,
137
);
this
.
checkBox1
.
Name
=
"checkBox1"
;
this
.
checkBox1
.
Size
=
new
System
.
Drawing
.
Size
(
119
,
24
);
this
.
checkBox1
.
TabIndex
=
198
;
this
.
checkBox1
.
Text
=
"启用agvClient"
;
this
.
checkBox1
.
UseVisualStyleBackColor
=
true
;
this
.
checkBox1
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
checkBox1_CheckedChanged
);
//
// FrmLineStore
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
...
@@ -837,6 +867,9 @@
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator11
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator12
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
清空托盘信息
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator13
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
toolStripMenuItem2
;
private
System
.
Windows
.
Forms
.
CheckBox
checkBox1
;
}
}
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
7a44084
...
...
@@ -877,5 +877,16 @@ namespace OnlineStore.AssemblyLine
LogUtil
.
info
(
"-------------------点击:清空托盘。托盘内容已清空"
);
}
}
private
void
toolStripMenuItem2_Click
(
object
sender
,
EventArgs
e
)
{
FrmAgvTest
frm
=
new
FrmAgvTest
();
frm
.
ShowDialog
();
}
private
void
checkBox1_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
lineBean
.
UseAgvClient
=
checkBox1
.
Checked
;
}
}
}
source/AssemblyLineClient/agvtest/FrmAgvTest.Designer.cs
0 → 100644
查看文件 @
7a44084
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/agvtest/FrmAgvTest.cs
0 → 100644
查看文件 @
7a44084
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
OnlineStore.AssemblyLine
{
public
partial
class
FrmAgvTest
:
Form
{
private
Asa
.
Client2
client
;
private
string
[]
node
=
new
string
[]
{
"A1"
,
"A2"
,
"A3"
,
"A4"
,
"C1"
,
"C2"
,
"C3"
,
"C4"
,
"C5"
,
"C6"
,
"C7"
,
"C8"
};
public
FrmAgvTest
()
{
InitializeComponent
();
}
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
void
Form1_Load
(
object
sender
,
EventArgs
e
)
{
label2
.
Text
=
"IP:"
+
ServerIp
;
client
=
new
Asa
.
Client2
(
ServerIp
);
client
.
Log
+=
Client_Log
;
client
.
Arrive
+=
AgvClient_Arrive
;
// agvClient.CanEnter += AgvClient_CanEnter;
client
.
Ready
+=
AgvClient_Ready
;
// client.GetRFID += AgvClient_GetRFID;
}
private
void
AgvClient_Ready
(
string
name
,
byte
[]
content
)
{
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"FrmAgvTest 收到 AgvClient_Ready ["
+
name
+
"] ["
+
data
.
ToData
()
+
"] "
);
}
private
void
AgvClient_Arrive
(
string
name
,
byte
[]
content
)
{
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"FrmAgvTest 收到 AgvClient_Arrive ["
+
name
+
"] ["
+
data
.
ToData
()
+
"] "
);
}
//private static void AgvClient_GetRFID(string name, byte[] content)
//{
// RFIDData data = new RFIDData(content);
// LogUtil.info("FrmAgvTest 收到 AgvClient_GetRFID [" + name + "] [" + data.ToData() + "] ");
//}
private
void
Client_Log
(
string
s
)
{
try
{
LogUtil
.
info
(
"FrmAgvTest LOG :"
+
s
);
Invoke
(
new
Action
(()
=>
{
textBox1
.
AppendText
(
s
+
"\r\n"
);
}));
}
catch
(
Exception
ex
)
{
//MessageBox.Show(ex.ToString());
}
}
private
void
Form1_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
{
client
.
Connect
();
for
(
int
i
=
0
;
i
<
node
.
Length
;
i
++)
client
.
SetStatus
(
node
[
i
]);
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
client
.
Close
();
}
private
void
button8_Click
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
FinishEnter
,
Asa
.
ClientLevel
.
High
);
}
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
NeedLeave
,
Asa
.
ClientLevel
.
High
);
}
private
void
button4_Click
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
NeedEnter
,
Asa
.
ClientLevel
.
High
);
}
private
void
button9_Click_1
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
None
,
Asa
.
ClientLevel
.
High
);
}
private
void
button10_Click
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
None
,
Asa
.
ClientLevel
.
High
);
}
private
void
button11_Click
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
NeedEnter
,
Asa
.
ClientLevel
.
High
);
}
private
void
button12_Click
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
FinishEnter
,
Asa
.
ClientLevel
.
High
);
}
private
void
button7_Click_1
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
None
,
Asa
.
ClientLevel
.
High
);
}
private
void
button6_Click_1
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
NeedLeave
,
Asa
.
ClientLevel
.
High
);
}
private
void
button5_Click_1
(
object
sender
,
EventArgs
e
)
{
client
.
SetStatus
(
Parent
.
Text
,
""
,
textBox2
.
Text
,
Asa
.
ClientAction
.
None
,
Asa
.
ClientLevel
.
High
);
}
}
}
source/AssemblyLineClient/agvtest/FrmAgvTest.resx
0 → 100644
查看文件 @
7a44084
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
source/DeviceLibrary/agvClient/AgvClient -20200210-back.cs
0 → 100644
查看文件 @
7a44084
using
Asa
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
AgvClient
{
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
static
Client
agvClient
;
public
static
Dictionary
<
string
,
string
>
actionMap
=
new
Dictionary
<
string
,
string
>();
public
static
List
<
string
>
NodeList
=
new
List
<
string
>();
public
static
void
Init
()
{
try
{
if
(
agvClient
==
null
)
{
agvClient
=
new
Client
(
ServerIp
);
}
actionMap
=
new
Dictionary
<
string
,
string
>();
foreach
(
string
key
in
NodeList
)
{
actionMap
.
Add
(
key
,
AGVAction
.
None
);
}
agvClient
.
Log
+=
AgvClient_Log
;
agvClient
.
Arrive
+=
AgvClient_Arrive
;
agvClient
.
CanEnter
+=
AgvClient_CanEnter
;
agvClient
.
Ready
+=
AgvClient_Ready
;
agvClient
.
Connect
(
NodeList
.
ToArray
());
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"初始化agvClient "
+
ServerIp
+
" 出错:"
,
ex
);
}
}
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
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
if
(
equip
==
null
)
{
LogUtil
.
error
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()+
"] 未找到对应的设备 ,暂不处理"
);
return
;
}
equip
.
AgvReady
(
id
,
data
);
}
private
static
void
AgvClient_CanEnter
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGVAction
.
CanEnter
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_CanEnter ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
if
(
equip
==
null
)
{
string
okName
=
""
;
foreach
(
FeedingEquip
feed
in
LineManager
.
Line
.
FeedingEquipMap
.
Values
)
{
if
(
id
.
Contains
(
feed
.
Config
.
AgvInName
))
{
if
(
feed
.
AgvCanEnter
(
id
,
data
))
{
okName
+=
feed
.
Config
.
AgvInName
;
}
}
}
agvClient
.
IsEnter
(
okName
);
return
;
}
else
{
bool
result
=
equip
.
AgvCanEnter
(
id
,
data
);
agvClient
.
IsEnter
(
equip
.
Config
.
AgvInName
);
}
}
private
static
void
AgvClient_Arrive
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGVAction
.
Arrive
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
if
(
equip
==
null
)
{
LogUtil
.
error
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 未找到对应的设备 ,暂不处理 "
);
return
;
}
equip
.
AgvArrive
(
id
,
data
);
}
private
static
FeedingEquip
getFeedEquip
(
string
nodeId
)
{
foreach
(
FeedingEquip
feed
in
LineManager
.
Line
.
FeedingEquipMap
.
Values
)
{
if
(
feed
.
Config
.
AgvInName
.
Equals
(
nodeId
)
||
feed
.
Config
.
AgvOutName
.
Equals
(
nodeId
))
{
return
feed
;
}
}
return
null
;
}
internal
static
bool
ISConnected
()
{
if
(
agvClient
==
null
)
{
return
false
;
}
return
agvClient
.
IsConn
;
}
internal
static
void
SendRFID
(
string
NodeName
,
string
rfid
)
{
agvClient
.
SendRFID
(
NodeName
,
rfid
);
}
internal
static
void
NeedEnter
(
string
NodeName
)
{
agvClient
.
NeedEnter
(
NodeName
);
}
internal
static
void
NeedLeave
(
string
NodeName
)
{
agvClient
.
NeedLeave
(
NodeName
);
}
internal
static
void
MayEnter
(
string
NodeName
)
{
agvClient
.
MayEnter
(
NodeName
);
}
internal
static
void
FinishEnter
(
string
NodeName
)
{
agvClient
.
FinishEnter
(
NodeName
);
}
internal
static
void
MayLeave
(
string
NodeName
)
{
agvClient
.
MayLeave
(
NodeName
);
}
private
static
void
AgvClient_Log
(
string
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
)
{
if
(
actionMap
.
ContainsKey
(
NodeName
))
{
return
actionMap
[
NodeName
];
}
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
{
if
(
agvClient
!=
null
)
{
agvClient
.
Close
();
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"释放 agvClient "
+
ServerIp
+
" 出错:"
,
ex
);
}
}
}
public
class
AGVAction
{
public
static
string
None
=
"None"
;
public
static
string
Arrive
=
"Arrive"
;
public
static
string
CanEnter
=
"CanEnter"
;
public
static
string
GetRFID
=
"GetRFID"
;
public
static
string
Ready
=
"Ready"
;
}
}
source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
7a44084
...
...
@@ -12,28 +12,46 @@ namespace OnlineStore.DeviceLibrary
public
class
AgvClient
{
private
static
string
ServerIp
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
AgvServerIp
);
private
static
Client
agvClient
;
public
static
Dictionary
<
string
,
string
>
actionMap
=
new
Dictionary
<
string
,
string
>();
private
static
Asa
.
Client2
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
;
public
static
void
Init
()
{
try
{
if
(
agvClient
==
null
)
LogUtil
.
info
(
"开始 Init agvclient"
);
if
(!
isInit
)
{
agvClient
=
new
Client
(
ServerIp
);
isInit
=
true
;
agvClient
=
new
Asa
.
Client2
(
ServerIp
);
agvClient
.
Log
+=
AgvClient_Log
;
agvClient
.
Arrive
+=
AgvClient_Arrive
;
// agvClient.CanEnter += AgvClient_CanEnter;
agvClient
.
Ready
+=
AgvClient_Ready
;
// agvClient.GetRFID += AgvClient_GetRFID;
}
actionMap
=
new
Dictionary
<
string
,
string
>();
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
foreach
(
string
key
in
NodeList
)
{
actionMap
.
Add
(
key
,
AGVAction
.
None
);
actionMap
.
Add
(
key
,
Asa
.
ClientAction
.
None
);
}
if
(!
LineManager
.
Line
.
UseAgvClient
)
{
LogUtil
.
info
(
"LineManager.Line.UseAgvClient 未启用,直接返回"
);
return
;
}
else
{
LogUtil
.
info
(
" 开始 agvClient.Connect"
);
}
agvClient
.
Connect
();
foreach
(
string
str
in
NodeList
)
{
SetStatus
(
str
);
}
agvClient
.
Log
+=
AgvClient_Log
;
agvClient
.
Arrive
+=
AgvClient_Arrive
;
agvClient
.
CanEnter
+=
AgvClient_CanEnter
;
agvClient
.
Ready
+=
AgvClient_Ready
;
agvClient
.
Connect
(
NodeList
.
ToArray
());
}
catch
(
Exception
ex
)
{
...
...
@@ -41,53 +59,41 @@ 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
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
//private static void AgvClient_GetRFID(string name, byte[] content)
//{
// RFIDData data = new RFIDData(content);
// LogUtil.info("收到 AgvClient_GetRFID [" + name + "] [" + data.ToData() + "] ");
//}
if
(
equip
==
null
)
public
static
void
SetStatus
(
string
id
,
string
shelfId
=
""
,
ClientAction
action
=
ClientAction
.
None
,
ClientLevel
level
=
ClientLevel
.
Low
)
{
ClientAction
currA
=
GetAction
(
id
);
//相同状态就设置一次
if
(
currA
.
Equals
(
action
))
{
LogUtil
.
error
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()+
"] 未找到对应的设备 ,暂不处理"
);
return
;
}
equip
.
AgvReady
(
id
,
data
);
agvClient
.
SetStatus
(
id
,
""
,
shelfId
,
action
,
level
);
UpdateAction
(
id
,
action
);
}
private
static
void
AgvClient_CanEnter
(
string
id
,
byte
[]
content
)
private
static
void
AgvClient_Ready
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGVAction
.
CanEnter
);
UpdateAction
(
id
,
ClientAction
.
Ready
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_
CanEnter ["
+
id
+
"] ["
+
data
.
ToData
()
+
"]
"
);
LogUtil
.
info
(
"收到 AgvClient_
Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"]
"
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
if
(
equip
==
null
)
{
string
okName
=
""
;
foreach
(
FeedingEquip
feed
in
LineManager
.
Line
.
FeedingEquipMap
.
Values
)
{
if
(
id
.
Contains
(
feed
.
Config
.
AgvInName
))
{
if
(
feed
.
AgvCanEnter
(
id
,
data
))
{
okName
+=
feed
.
Config
.
AgvInName
;
}
}
}
agvClient
.
IsEnter
(
okName
);
LogUtil
.
error
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] 未找到对应的设备 ,暂不处理"
);
return
;
}
else
{
bool
result
=
equip
.
AgvCanEnter
(
id
,
data
);
agvClient
.
IsEnter
(
equip
.
Config
.
AgvInName
);
}
equip
.
AgvReady
(
id
,
data
);
}
private
static
void
AgvClient_Arrive
(
string
id
,
byte
[]
content
)
{
UpdateAction
(
id
,
AGVAction
.
Arrive
);
UpdateAction
(
id
,
ClientAction
.
Arrive
);
RFIDData
data
=
new
RFIDData
(
content
);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
data
.
ToData
()
+
"] "
);
FeedingEquip
equip
=
getFeedEquip
(
id
);
...
...
@@ -119,57 +125,67 @@ namespace OnlineStore.DeviceLibrary
}
return
agvClient
.
IsConn
;
}
internal
static
void
SendRFID
(
string
NodeName
,
string
rfid
)
{
agvClient
.
SendRFID
(
NodeName
,
rfid
);
}
internal
static
void
NeedEnter
(
string
NodeName
)
public
static
bool
NeedEnter
(
string
id
,
string
shelfId
)
{
ClientAction
currA
=
GetAction
(
id
);
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
FinishLeave
)
||
currA
.
Equals
(
ClientAction
.
FinishEnter
))
{
agvClient
.
NeedEnter
(
NodeName
);
SetStatus
(
id
,
shelfId
,
ClientAction
.
NeedEnter
);
return
true
;
}
return
false
;
}
internal
static
void
NeedLeave
(
string
NodeName
)
public
static
bool
NeedLeave
(
string
id
,
string
shelfId
=
""
)
{
ClientAction
currA
=
GetAction
(
id
);
if
(
currA
.
Equals
(
ClientAction
.
None
)
||
currA
.
Equals
(
ClientAction
.
FinishLeave
)
||
currA
.
Equals
(
ClientAction
.
FinishEnter
))
{
agvClient
.
NeedLeave
(
NodeName
);
SetStatus
(
id
,
shelfId
,
ClientAction
.
NeedLeave
);
return
true
;
}
internal
static
void
MayEnter
(
string
NodeName
)
return
false
;
}
internal
static
void
MayEnter
(
string
NodeName
,
string
shelfId
=
""
)
{
agvClient
.
MayEnter
(
NodeName
);
SetStatus
(
NodeName
,
shelfId
,
ClientAction
.
MayEnter
,
ClientLevel
.
High
);
}
internal
static
void
FinishEnter
(
string
NodeName
)
internal
static
void
FinishEnter
(
string
NodeName
,
string
shelfId
=
""
)
{
agvClient
.
FinishEnter
(
NodeName
);
SetStatus
(
NodeName
,
shelfId
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
);
}
internal
static
void
MayLeave
(
string
NodeName
)
internal
static
void
MayLeave
(
string
NodeName
,
string
shelfId
=
""
)
{
agvClient
.
MayLeave
(
NodeName
);
SetStatus
(
NodeName
,
shelfId
,
ClientAction
.
MayLeave
,
ClientLevel
.
High
);
}
private
static
bool
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Agv_Log_Open
).
Equals
(
1
);
private
static
void
AgvClient_Log
(
string
s
)
{
try
{
bool
isLog
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Agv_Log_Open
).
Equals
(
1
);
if
(
isLog
)
{
LogUtil
.
info
(
" AGV "
+
ServerIp
+
" Log : "
+
s
);
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AgvClient_Log 出错:"
+
ex
.
ToString
());
}
}
public
static
string
GetAction
(
string
NodeName
)
public
static
Asa
.
ClientAction
GetAction
(
string
NodeName
)
{
if
(
actionMap
.
ContainsKey
(
NodeName
))
{
return
actionMap
[
NodeName
];
}
return
A
GV
Action
.
None
;
return
A
sa
.
Client
Action
.
None
;
}
public
static
void
UpdateAction
(
string
name
,
string
action
)
public
static
void
UpdateAction
(
string
name
,
Asa
.
ClientAction
action
)
{
if
(
actionMap
.
ContainsKey
(
name
))
{
...
...
@@ -195,12 +211,12 @@ namespace OnlineStore.DeviceLibrary
}
}
}
public
class
AGVAction
{
public
static
string
None
=
"None"
;
public
static
string
Arrive
=
"Arrive"
;
public
static
string
CanEnter
=
"CanEnter"
;
public
static
string
GetRFID
=
"GetRFID"
;
public
static
string
Ready
=
"Ready"
;
}
//
public class AGVAction
//
{
//
public static string None = "None";
//
public static string Arrive = "Arrive";
//
public static string CanEnter = "CanEnter";
//
public static string GetRFID = "GetRFID";
//
public static string Ready = "Ready";
//
}
}
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
7a44084
...
...
@@ -46,13 +46,13 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
if
(
isDebug
)
{
//连接AGV调度
if
(!
AgvClient
.
ISConnected
())
{
AgvClient
.
Init
();
}
}
//
if (isDebug)
//
{ //连接AGV调度
//
if (!AgvClient.ISConnected())
//
{
//
AgvClient.Init();
//
}
//
}
if
(
IOValue
(
IO_Type
.
SL_SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
SetWarnMsg
(
Name
+
"启动失败:急停未开"
);
...
...
@@ -750,7 +750,7 @@ namespace OnlineStore.DeviceLibrary
CurrShelfId
=
rfidD
.
NumStr
();
//发送料架信息给调度系统
AgvClient
.
SendRFID
(
Config
.
AgvInName
,
CurrShelfId
);
//
AgvClient.SendRFID(Config.AgvInName, CurrShelfId);
LogUtil
.
info
(
Name
+
"读取到料架编号:"
+
CurrShelfId
);
}
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
7a44084
...
...
@@ -402,9 +402,14 @@ namespace OnlineStore.DeviceLibrary
else
if
(
IOValue
(
IO_Type
.
SL_Out_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
//线体出口检测到料架,需要通知AGV小车
//
AgvClient.NeedLeave(Config.AgvOutName);
AgvClient
.
NeedLeave
(
Config
.
AgvOutName
);
// SendShelfToAGV();
}
//入口无料架,mayEnter
if
(
IOValue
(
IO_Type
.
SL_Entry_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
AgvClient
.
MayEnter
(
Config
.
AgvInName
);
}
return
false
;
}
...
...
@@ -762,8 +767,9 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_31_BatchAxisToP2
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_32_TrayLocationCylinder_After
);
InLog
(
"上料完成"
+
MoveInfo
.
SLog
+
": 升降盘定位气缸后退"
);
InLog
(
"上料完成"
+
MoveInfo
.
SLog
+
": 升降盘定位气缸后退
, 清理料架信息clearPutInRfid["
+
CurrShelfId
+
"]
"
);
TrayLCylinderAfter
(
MoveInfo
);
SServerManager
.
clearPutInRfid
(
Name
,
CurrShelfId
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_32_TrayLocationCylinder_After
))
{
...
...
@@ -826,7 +832,7 @@ namespace OnlineStore.DeviceLibrary
MoveEndS
();
// MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun);
InLog
(
"上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束"
);
AgvClient
.
NeedLeave
(
Config
.
AgvOutName
);
AgvClient
.
NeedLeave
(
Config
.
AgvOutName
,
CurrShelfId
);
}
#
endregion
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
查看文件 @
7a44084
...
...
@@ -338,7 +338,7 @@ namespace OnlineStore.DeviceLibrary
MoveEndS
();
// MoveInfo.NextMoveStep(LineMoveStep.FO_39_OutLineRun);
OutLog
(
"送出料串: "
+
MoveInfo
.
SLog
+
", 出口线体运转,料架到达出口处, 通知AGV取空料架, 出料结束"
);
AgvClient
.
NeedLeave
(
Config
.
AgvOutName
);
AgvClient
.
NeedLeave
(
Config
.
AgvOutName
,
CurrShelfId
);
}
else
if
(
MoveInfo
.
MoveStep
>=
LineMoveStep
.
FO_211_AxisDownMove
&&
MoveInfo
.
MoveStep
<
LineMoveStep
.
FO_30_BatchAxisToP2
)
{
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
7a44084
...
...
@@ -20,7 +20,7 @@ namespace OnlineStore.DeviceLibrary
public
partial
class
LineBean
:
KTK_Store
{
public
bool
IsDebug
=
false
;
public
bool
UseAgvClient
=
false
;
/// <summary>
/// 灯闪烁定时器
/// </summary>
...
...
@@ -236,7 +236,7 @@ namespace OnlineStore.DeviceLibrary
}
return
""
;
}
public
override
bool
StartRun
(
bool
isDebug
=
false
)
public
override
bool
StartRun
(
bool
isDebug
=
false
)
{
string
result
=
CanStart
();
if
(
String
.
IsNullOrEmpty
(
result
).
Equals
(
false
))
...
...
@@ -251,9 +251,9 @@ namespace OnlineStore.DeviceLibrary
}
else
{
ledProcessTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
ledProcessTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
lineStatus
=
LineStatus
.
ResetMove
;
runStatus
=
LineRunStatus
.
HomeMoving
;
StartTime
=
DateTime
.
Now
;
...
...
@@ -266,12 +266,14 @@ namespace OnlineStore.DeviceLibrary
RFIDManager
.
Open
();
});
Thread
.
Sleep
(
5
);
//连接AGV调度
if
(!
AgvClient
.
ISConnected
())
{
AgvClient
.
Init
();
}
LineServer
.
StartServer
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TCPServerPort
));
RHomeOp
();
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
7a44084
...
...
@@ -283,6 +283,30 @@ namespace OnlineStore.DeviceLibrary
}
return
""
;
}
private
static
string
Addr_clearPutInRfid
=
"/service/store/qisda/clearPutInRfid"
;
public
static
string
clearPutInRfid
(
string
deviceName
,
string
rfid
)
{
string
msg
=
""
;
try
{
if
(
String
.
IsNullOrEmpty
(
rfid
))
{
return
msg
;
}
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"rfid"
,
rfid
);
//rfid
string
server
=
GetAddr
(
Addr_clearPutInRfid
,
paramMap
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
deviceName
+
"clearPutInRfid 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
deviceName
+
" "
+
ex
.
ToString
());
}
return
msg
;
}
}
public
class
LocStatus
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论