Commit 0432b9cd LN

1

1 个父辈 d8163b58
......@@ -29,6 +29,11 @@
远程IP地址
</summary>
</member>
<member name="P:Asa.RFID.Reader.RemoteIndex">
<summary>
远程设备索引,用于修改远程IP
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsConn">
<summary>
是否连接
......@@ -44,6 +49,11 @@
是否存在ID卡
</summary>
</member>
<member name="P:Asa.RFID.Reader.ErrCode">
<summary>
错误代码
</summary>
</member>
<member name="P:Asa.RFID.Reader.ID">
<summary>
ID号码
......
......@@ -49,7 +49,7 @@
<add key ="OpenRFIDWrite" value ="1"/>
<add key="DefaultPWD" value ="123456"/>
<!--当前调试的设备ID,分号分割-->
<add key ="DebugDeviceId" value ="103"/>
<add key ="DebugDeviceId" value ="0"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -54,6 +54,10 @@
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Reference Include="Asa.RFID, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\dll\RFID\Asa.RFID.dll</HintPath>
</Reference>
<Reference Include="Client">
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
......
......@@ -352,7 +352,7 @@
this.btnBStopDown.BackColor = System.Drawing.Color.White;
this.btnBStopDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBStopDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBStopDown.Location = new System.Drawing.Point(16, 130);
this.btnBStopDown.Location = new System.Drawing.Point(16, 138);
this.btnBStopDown.Name = "btnBStopDown";
this.btnBStopDown.Size = new System.Drawing.Size(153, 34);
this.btnBStopDown.TabIndex = 267;
......@@ -365,7 +365,7 @@
this.btnEStopDown.BackColor = System.Drawing.Color.White;
this.btnEStopDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnEStopDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnEStopDown.Location = new System.Drawing.Point(175, 83);
this.btnEStopDown.Location = new System.Drawing.Point(175, 138);
this.btnEStopDown.Name = "btnEStopDown";
this.btnEStopDown.Size = new System.Drawing.Size(153, 34);
this.btnEStopDown.TabIndex = 266;
......@@ -378,7 +378,7 @@
this.btnOSWRun.BackColor = System.Drawing.Color.White;
this.btnOSWRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOSWRun.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOSWRun.Location = new System.Drawing.Point(16, 83);
this.btnOSWRun.Location = new System.Drawing.Point(16, 87);
this.btnOSWRun.Name = "btnOSWRun";
this.btnOSWRun.Size = new System.Drawing.Size(153, 34);
this.btnOSWRun.TabIndex = 265;
......@@ -417,7 +417,7 @@
this.btnFL_TopCylinder.BackColor = System.Drawing.Color.White;
this.btnFL_TopCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFL_TopCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFL_TopCylinder.Location = new System.Drawing.Point(175, 130);
this.btnFL_TopCylinder.Location = new System.Drawing.Point(175, 291);
this.btnFL_TopCylinder.Name = "btnFL_TopCylinder";
this.btnFL_TopCylinder.Size = new System.Drawing.Size(153, 34);
this.btnFL_TopCylinder.TabIndex = 262;
......@@ -430,7 +430,7 @@
this.btnSwLocationCylinder.BackColor = System.Drawing.Color.White;
this.btnSwLocationCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSwLocationCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSwLocationCylinder.Location = new System.Drawing.Point(16, 318);
this.btnSwLocationCylinder.Location = new System.Drawing.Point(16, 342);
this.btnSwLocationCylinder.Name = "btnSwLocationCylinder";
this.btnSwLocationCylinder.Size = new System.Drawing.Size(153, 34);
this.btnSwLocationCylinder.TabIndex = 261;
......@@ -443,7 +443,7 @@
this.btnSWTop.BackColor = System.Drawing.Color.White;
this.btnSWTop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSWTop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSWTop.Location = new System.Drawing.Point(175, 318);
this.btnSWTop.Location = new System.Drawing.Point(175, 342);
this.btnSWTop.Name = "btnSWTop";
this.btnSWTop.Size = new System.Drawing.Size(153, 34);
this.btnSWTop.TabIndex = 260;
......@@ -456,7 +456,7 @@
this.btnCloseAll.BackColor = System.Drawing.Color.White;
this.btnCloseAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAll.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAll.Location = new System.Drawing.Point(16, 405);
this.btnCloseAll.Location = new System.Drawing.Point(16, 393);
this.btnCloseAll.Name = "btnCloseAll";
this.btnCloseAll.Size = new System.Drawing.Size(153, 34);
this.btnCloseAll.TabIndex = 259;
......@@ -469,7 +469,7 @@
this.btnOutTopCylinder.BackColor = System.Drawing.Color.White;
this.btnOutTopCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOutTopCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOutTopCylinder.Location = new System.Drawing.Point(175, 177);
this.btnOutTopCylinder.Location = new System.Drawing.Point(175, 189);
this.btnOutTopCylinder.Name = "btnOutTopCylinder";
this.btnOutTopCylinder.Size = new System.Drawing.Size(153, 34);
this.btnOutTopCylinder.TabIndex = 258;
......@@ -482,7 +482,7 @@
this.btnLocationCylinder.BackColor = System.Drawing.Color.White;
this.btnLocationCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLocationCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLocationCylinder.Location = new System.Drawing.Point(16, 177);
this.btnLocationCylinder.Location = new System.Drawing.Point(16, 189);
this.btnLocationCylinder.Name = "btnLocationCylinder";
this.btnLocationCylinder.Size = new System.Drawing.Size(153, 34);
this.btnLocationCylinder.TabIndex = 256;
......@@ -495,7 +495,7 @@
this.btnTrayLocationCylinder.BackColor = System.Drawing.Color.White;
this.btnTrayLocationCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTrayLocationCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTrayLocationCylinder.Location = new System.Drawing.Point(175, 271);
this.btnTrayLocationCylinder.Location = new System.Drawing.Point(175, 87);
this.btnTrayLocationCylinder.Name = "btnTrayLocationCylinder";
this.btnTrayLocationCylinder.Size = new System.Drawing.Size(153, 34);
this.btnTrayLocationCylinder.TabIndex = 255;
......@@ -508,11 +508,11 @@
this.btnFeedSideWayCylinder.BackColor = System.Drawing.Color.White;
this.btnFeedSideWayCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFeedSideWayCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFeedSideWayCylinder.Location = new System.Drawing.Point(175, 224);
this.btnFeedSideWayCylinder.Location = new System.Drawing.Point(16, 240);
this.btnFeedSideWayCylinder.Name = "btnFeedSideWayCylinder";
this.btnFeedSideWayCylinder.Size = new System.Drawing.Size(153, 34);
this.btnFeedSideWayCylinder.TabIndex = 252;
this.btnFeedSideWayCylinder.Text = "SL上料横移气缸取料";
this.btnFeedSideWayCylinder.Text = "上料横移气缸取料端";
this.btnFeedSideWayCylinder.UseVisualStyleBackColor = false;
this.btnFeedSideWayCylinder.Click += new System.EventHandler(this.btnFeedSideWayCylinder_Click);
//
......@@ -521,11 +521,11 @@
this.btnFeedCylinder.BackColor = System.Drawing.Color.White;
this.btnFeedCylinder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFeedCylinder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFeedCylinder.Location = new System.Drawing.Point(16, 271);
this.btnFeedCylinder.Location = new System.Drawing.Point(16, 291);
this.btnFeedCylinder.Name = "btnFeedCylinder";
this.btnFeedCylinder.Size = new System.Drawing.Size(153, 34);
this.btnFeedCylinder.TabIndex = 249;
this.btnFeedCylinder.Text = "SL上料气缸放松";
this.btnFeedCylinder.Text = "料气缸放松";
this.btnFeedCylinder.UseVisualStyleBackColor = false;
this.btnFeedCylinder.Click += new System.EventHandler(this.btnFeedCylinder_Click);
//
......@@ -534,11 +534,11 @@
this.btnFeedSideWay.BackColor = System.Drawing.Color.White;
this.btnFeedSideWay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFeedSideWay.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFeedSideWay.Location = new System.Drawing.Point(16, 224);
this.btnFeedSideWay.Location = new System.Drawing.Point(175, 240);
this.btnFeedSideWay.Name = "btnFeedSideWay";
this.btnFeedSideWay.Size = new System.Drawing.Size(153, 34);
this.btnFeedSideWay.TabIndex = 246;
this.btnFeedSideWay.Text = "SL上料横移机构上升";
this.btnFeedSideWay.Text = "上料横移机构上升";
this.btnFeedSideWay.UseVisualStyleBackColor = false;
this.btnFeedSideWay.Click += new System.EventHandler(this.btnFeedSideWay_Click);
//
......
......@@ -362,16 +362,16 @@ namespace OnlineStore.AssemblyLine
}
private void btnFeedSideWay_Click(object sender, EventArgs e)
{
BtnMove(btnFeedSideWay, "SL上料横移机构上升", "SL上料横移机构下降", IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
BtnMove(btnFeedSideWay, "上料横移机构上升", "上料横移机构下降", IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
private void btnFeedCylinder_Click(object sender, EventArgs e)
{
BtnMove(btnFeedCylinder, "SL上料气缸放松", "SL上料气缸夹紧", IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
BtnMove(btnFeedCylinder, "夹料气缸放松", "夹料气缸夹紧", IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
private void btnFeedSideWayCylinder_Click(object sender, EventArgs e)
{
BtnMove(btnFeedSideWayCylinder, "SL上料横移气缸取料", "SL上料横移气缸放料", IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
BtnMove(btnFeedSideWayCylinder, "上料横移气缸取料端", "上料横移气缸放料端", IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
private void btnTrayLocationCylinder_Click(object sender, EventArgs e)
{
......
......@@ -37,7 +37,7 @@
this.label2 = new System.Windows.Forms.Label();
this.comType = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.btnRead = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.numNum = new System.Windows.Forms.NumericUpDown();
this.btnFind = new System.Windows.Forms.Button();
......@@ -49,6 +49,8 @@
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label6 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnClose = new System.Windows.Forms.Button();
this.btnConnect = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.numNum)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -83,7 +85,7 @@
//
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBack.Location = new System.Drawing.Point(295, 235);
this.btnBack.Location = new System.Drawing.Point(412, 238);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(120, 45);
this.btnBack.TabIndex = 274;
......@@ -151,17 +153,17 @@
this.label3.Text = "卡类型:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// button1
// btnRead
//
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(151, 235);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(120, 45);
this.button1.TabIndex = 281;
this.button1.Text = "读取测试";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
this.btnRead.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRead.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRead.Location = new System.Drawing.Point(286, 238);
this.btnRead.Name = "btnRead";
this.btnRead.Size = new System.Drawing.Size(120, 45);
this.btnRead.TabIndex = 281;
this.btnRead.Text = "读取测试";
this.btnRead.UseVisualStyleBackColor = false;
this.btnRead.Click += new System.EventHandler(this.button1_Click);
//
// label4
//
......@@ -213,8 +215,9 @@
//
this.txtSearchIp.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtSearchIp.Location = new System.Drawing.Point(196, 87);
this.txtSearchIp.Multiline = true;
this.txtSearchIp.Name = "txtSearchIp";
this.txtSearchIp.Size = new System.Drawing.Size(233, 26);
this.txtSearchIp.Size = new System.Drawing.Size(233, 244);
this.txtSearchIp.TabIndex = 286;
//
// btnSearch
......@@ -260,7 +263,7 @@
this.groupBox1.Controls.Add(this.btnSearch);
this.groupBox1.Location = new System.Drawing.Point(22, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(614, 138);
this.groupBox1.Size = new System.Drawing.Size(614, 350);
this.groupBox1.TabIndex = 290;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "搜索RFID";
......@@ -281,11 +284,13 @@
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox2.Controls.Add(this.btnClose);
this.groupBox2.Controls.Add(this.btnConnect);
this.groupBox2.Controls.Add(this.comboxType);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.btnFind);
this.groupBox2.Controls.Add(this.lblHas);
this.groupBox2.Controls.Add(this.button1);
this.groupBox2.Controls.Add(this.btnRead);
this.groupBox2.Controls.Add(this.txtIP);
this.groupBox2.Controls.Add(this.btnNext);
this.groupBox2.Controls.Add(this.label2);
......@@ -294,18 +299,42 @@
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.comType);
this.groupBox2.Location = new System.Drawing.Point(22, 160);
this.groupBox2.Location = new System.Drawing.Point(22, 368);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(614, 319);
this.groupBox2.Size = new System.Drawing.Size(614, 301);
this.groupBox2.TabIndex = 291;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "读取RFID";
//
// btnClose
//
this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClose.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClose.Location = new System.Drawing.Point(160, 238);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(120, 45);
this.btnClose.TabIndex = 287;
this.btnClose.Text = "关闭";
this.btnClose.UseVisualStyleBackColor = false;
this.btnClose.Click += new System.EventHandler(this.button2_Click);
//
// btnConnect
//
this.btnConnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnConnect.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnConnect.Location = new System.Drawing.Point(34, 238);
this.btnConnect.Name = "btnConnect";
this.btnConnect.Size = new System.Drawing.Size(120, 45);
this.btnConnect.TabIndex = 286;
this.btnConnect.Text = "连接";
this.btnConnect.UseVisualStyleBackColor = false;
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
//
// FrmRFIPEdit
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(662, 503);
this.ClientSize = new System.Drawing.Size(662, 693);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
......@@ -331,7 +360,7 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox comType;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btnRead;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown numNum;
private System.Windows.Forms.Button btnFind;
......@@ -343,5 +372,7 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button btnConnect;
private System.Windows.Forms.Button btnClose;
}
}
\ No newline at end of file

using Asa.RFID;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
......@@ -104,6 +105,16 @@ namespace OnlineStore.AssemblyLine
{
txtIP.Text = V;
}
if (RFIDManager.RFReaderMap.ContainsKey(V))
{
btnConnect.Enabled = false;
btnClose.Enabled = true;
}
else
{
btnClose.Enabled = false;
btnConnect.Enabled = true;
}
}
}
......@@ -126,8 +137,46 @@ namespace OnlineStore.AssemblyLine
private void btnSearch_Click(object sender, EventArgs e)
{
string text = cmbLocalIp.Text;
string ip = RFIDManager.SearchIP(text);
txtSearchIp.Text = ip;
string[] ip = RFIDManager.SearchIP(text);
foreach(string ipstr in ip)
{
txtSearchIp.Text += ipstr + "\n";
}
// txtSearchIp.Text = ip;
}
private void btnConnect_Click(object sender, EventArgs e)
{
string ip = txtIP.Text;
bool result = RFIDManager.ConnectionIP(ip);
if (RFIDManager.RFReaderMap.ContainsKey(ip))
{
btnConnect.Enabled = false;
btnClose.Enabled = true;
}
else
{
btnClose.Enabled = false;
btnConnect.Enabled = true;
}
MessageBox.Show("" + result);
}
private void button2_Click(object sender, EventArgs e)
{
string ip = txtIP.Text;
RFIDManager.CloseRFID(ip);
if (RFIDManager.RFReaderMap.ContainsKey(ip))
{
btnConnect.Enabled = false;
btnClose.Enabled = true;
}
else
{
btnClose.Enabled = false;
btnConnect.Enabled = true;
}
}
}
}
......@@ -103,7 +103,11 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.LOW);
IOMove(IO_Type.FL_StopCylinder_Down2, IO_VALUE.LOW);
//顶升气缸下降
CylinderMove(null, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.FL_TopCylinder_Up, IO_Type.FL_TopCylinder_Down);
}else if (LineManager.Line.runStatus <= LineRunStatus.Wait)
{
CylinderMove(MoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
}
//线体停止
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
......
......@@ -146,6 +146,9 @@ namespace OnlineStore.DeviceLibrary
{
MoveEquip equip = MoveEquipMap[id];
ioList.AddRange(equip.Config.IOIPList);
}else if (id.Equals(0))
{
ioList.AddRange(Config.IOIPList);
}
}
}
......
......@@ -73,54 +73,67 @@ namespace OnlineStore.DeviceLibrary
isProcess = false;
}
internal static void ConnectionIP(string rfid)
public static bool ConnectionIP(string rfid)
{
Reader rfidReader = null;
if (RFReaderMap.ContainsKey(rfid))
{
rfidReader = RFReaderMap[rfid];
if (null != rfidReader)
{
rfidReader.Close();
rfidReader = null;
}
RFReaderMap.Remove(rfid);
}
CloseRFID(rfid);
string logName = "RFIP模块[" + rfid + "] ";
try
{
LogUtil.debug("开始连接" + logName + ",尝试重连3次");
for (int i = 1; i <= 1; i++)
{
rfidReader = new Reader();
// rfidReader.LocalIP = "192.168.100.101";
rfidReader.RemoteIP = rfid;
bool result = rfidReader.Connect();
string[] array = rfid.Split('.');
int index = Convert.ToInt32(array[3]);
bool result = rfidReader.Connect(index);
if (result)
{
rfidReader.AutoScan(true);
LogUtil.info("第【" + i + "】次连接 " + logName + " 成功:");
LogUtil.info("连接 " + logName + " [" + index + "]成功");
RFReaderMap.Add(rfid, rfidReader);
if (RfIPList.Contains(rfid))
{
RfIPList.Remove(rfid);
}
break;
return true;
}
else
{
LogUtil.error("第【" + i + "】次连接 " + logName + " 失败:" + "");
LogUtil.error("连接 " + logName + " [" + index + "] 失败" + "");
}
Thread.Sleep(5);
}
}
catch (Exception error)
{
LogUtil.error("连接RFIP模块 " + logName + " 出错:" + error.ToString());
}
return false;
}
public static void CloseRFID(string rfid)
{
try
{
if (RFReaderMap.ContainsKey(rfid))
{
Reader rfidReader = RFReaderMap[rfid];
if (null != rfidReader)
{
rfidReader.Close();
rfidReader = null;
}
RFReaderMap.Remove(rfid);
}
}catch(Exception exx)
{
LogUtil.error("关闭rfid【"+rfid+"】出错:" + rfid);
}
}
public static void CloseAllConnection()
{
foreach (Reader reader in RFReaderMap.Values)
......@@ -147,19 +160,19 @@ namespace OnlineStore.DeviceLibrary
// byte[] reviceData = ReadData(IP, 3);
// return reviceData;
//}
public static string SearchIP(string localIp)
public static string[] SearchIP(string localIp)
{
string ip = "";
string[] ipList=null;
try
{
Reader rfReader = new Reader();
rfReader.LocalIP = localIp;
ip = rfReader.FindIP();
ipList = rfReader.FindIP();
}
catch (Exception ex)
{
}
return ip;
return ipList;
}
public static bool FindRFID(string IP)
{
......
......@@ -300,10 +300,19 @@ namespace OnlineStore.LoadCSVLibrary
foreach (string key in diList.Keys)
{
DIList.Add(key, diList[key]);
if (!IOIPList.Contains(diList[key].IO_IP))
{
IOIPList.Add(diList[key].IO_IP);
}
}
foreach (string key in doList.Keys)
{
DOList.Add(key, doList[key]);
if (!IOIPList.Contains(doList[key].IO_IP))
{
IOIPList.Add(doList[key].IO_IP);
}
}
}
public ConfigIO getWaitIO(string ioType)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!