Commit 7a440845 LN

agv修改

1 个父辈 de17e2b5
此文件类型无法预览
......@@ -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>
......@@ -39,7 +39,7 @@
<!--流水线监听端口-->
<add key="TCPServerPort" value="5246" />
<!--AGV调度服务器地址-->
<add key="AgvServerIp" value="192.168.103.22" />
<add key="AgvServerIp" value="10.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"> -->
......
......@@ -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>
......
......@@ -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, 144);
this.logBox.Location = new System.Drawing.Point(448, 167);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(872, 462);
this.logBox.Size = new System.Drawing.Size(872, 439);
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;
}
}
......@@ -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;
}
}
}
namespace OnlineStore.AssemblyLine
{
partial class FrmAgvTest
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button8 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.button9 = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button10 = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.button7 = new System.Windows.Forms.Button();
this.button11 = new System.Windows.Forms.Button();
this.button12 = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(482, 12);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(278, 426);
this.textBox1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(12, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "连接";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(93, 12);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 2;
this.button2.Text = "断开";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button8
//
this.button8.Location = new System.Drawing.Point(6, 49);
this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(75, 23);
this.button8.TabIndex = 10;
this.button8.Text = "完成进料";
this.button8.UseVisualStyleBackColor = true;
this.button8.Click += new System.EventHandler(this.button8_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(6, 20);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 12;
this.button3.Text = "需要出料";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(6, 20);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 23);
this.button4.TabIndex = 13;
this.button4.Text = "需要进料";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button9);
this.groupBox1.Controls.Add(this.button3);
this.groupBox1.Location = new System.Drawing.Point(290, 233);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(87, 80);
this.groupBox1.TabIndex = 15;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "A3";
//
// button9
//
this.button9.Location = new System.Drawing.Point(6, 49);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(75, 23);
this.button9.TabIndex = 13;
this.button9.Text = "不出料";
this.button9.UseVisualStyleBackColor = true;
this.button9.Click += new System.EventHandler(this.button9_Click_1);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.button10);
this.groupBox2.Controls.Add(this.button4);
this.groupBox2.Controls.Add(this.button8);
this.groupBox2.Location = new System.Drawing.Point(383, 233);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(87, 107);
this.groupBox2.TabIndex = 16;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "A2";
//
// button10
//
this.button10.Location = new System.Drawing.Point(6, 78);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(75, 23);
this.button10.TabIndex = 14;
this.button10.Text = "不进料";
this.button10.UseVisualStyleBackColor = true;
this.button10.Click += new System.EventHandler(this.button10_Click);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.button7);
this.groupBox4.Controls.Add(this.button11);
this.groupBox4.Controls.Add(this.button12);
this.groupBox4.Location = new System.Drawing.Point(267, 61);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(87, 107);
this.groupBox4.TabIndex = 17;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "C7";
//
// button7
//
this.button7.Location = new System.Drawing.Point(6, 78);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(75, 23);
this.button7.TabIndex = 14;
this.button7.Text = "不进料";
this.button7.UseVisualStyleBackColor = true;
this.button7.Click += new System.EventHandler(this.button7_Click_1);
//
// button11
//
this.button11.Location = new System.Drawing.Point(6, 20);
this.button11.Name = "button11";
this.button11.Size = new System.Drawing.Size(75, 23);
this.button11.TabIndex = 13;
this.button11.Text = "需要进料";
this.button11.UseVisualStyleBackColor = true;
this.button11.Click += new System.EventHandler(this.button11_Click);
//
// button12
//
this.button12.Location = new System.Drawing.Point(6, 49);
this.button12.Name = "button12";
this.button12.Size = new System.Drawing.Size(75, 23);
this.button12.TabIndex = 10;
this.button12.Text = "完成进料";
this.button12.UseVisualStyleBackColor = true;
this.button12.Click += new System.EventHandler(this.button12_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.button5);
this.groupBox3.Controls.Add(this.button6);
this.groupBox3.Location = new System.Drawing.Point(174, 12);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(87, 80);
this.groupBox3.TabIndex = 16;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "C8";
//
// button5
//
this.button5.Location = new System.Drawing.Point(6, 49);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(75, 23);
this.button5.TabIndex = 13;
this.button5.Text = "不出料";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click_1);
//
// button6
//
this.button6.Location = new System.Drawing.Point(6, 20);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(75, 23);
this.button6.TabIndex = 12;
this.button6.Text = "需要出料";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click_1);
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(12, 61);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(75, 21);
this.textBox2.TabIndex = 18;
this.textBox2.Text = "A1";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 46);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(29, 12);
this.label1.TabIndex = 19;
this.label1.Text = "RFID";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 139);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(23, 12);
this.label2.TabIndex = 20;
this.label2.Text = "IP:";
//
// FrmAgvTest
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(771, 451);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Name = "FrmAgvTest";
this.Text = "AGV调试";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button11;
private System.Windows.Forms.Button button12;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
}
}
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);
}
}
}
<?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

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";
}
}
......@@ -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)
//private static void AgvClient_GetRFID(string name, byte[] content)
//{
// RFIDData data = new RFIDData(content);
// LogUtil.info("收到 AgvClient_GetRFID [" + name + "] [" + data.ToData() + "] ");
//}
public static void SetStatus(string id, string shelfId = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low)
{
UpdateAction(id, AGVAction.Ready);
RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] ");
FeedingEquip equip = getFeedEquip(id);
if (equip == null)
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);
......@@ -99,8 +105,8 @@ namespace OnlineStore.DeviceLibrary
equip.AgvArrive(id, data);
}
private static FeedingEquip getFeedEquip(string nodeId)
{
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))
......@@ -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)
{
agvClient.NeedEnter(NodeName);
ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter))
{
SetStatus(id, shelfId, ClientAction.NeedEnter);
return true;
}
return false;
}
internal static void NeedLeave(string NodeName)
public static bool NeedLeave(string id, string shelfId = "")
{
agvClient.NeedLeave(NodeName);
ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter))
{
SetStatus(id, shelfId, ClientAction.NeedLeave);
return true;
}
return false;
}
internal static void MayEnter(string NodeName)
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 AGVAction.None;
return Asa.ClientAction.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";
//}
}
......@@ -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)
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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,26 +251,28 @@ 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;
LogUtil.info(Name + "开始启动,启动时间:" + StartTime.ToString());
// rfidList = new List<string>();
// rfidList = new List<string>();
Task.Factory.StartNew(delegate
{
LogUtil.info(Name + "RFIDManager.Open");
RFIDManager.Open();
});
Thread.Sleep(5);
//连接AGV调度
if (!AgvClient.ISConnected())
{
AgvClient.Init();
}
LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort));
RHomeOp();
......@@ -284,7 +286,7 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Enabled = true;
mainTimer.Enabled = true;
return true;
}
}
}
private void EquipStartRun(EquipBase moveEquip)
{
......
......@@ -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!