Commit ae9b7319 LN

增加UpdateTrayLoc处理

1 个父辈 7f70812b
此文件类型无法预览
<?xml version="1.0"?>
<doc>
<assembly>
<name>Asa.RFID</name>
</assembly>
<members>
<member name="T:Asa.RFID.Reader">
<summary>
RFID读卡器
</summary>
</member>
<member name="M:Asa.RFID.Reader.#ctor">
<summary>
RFID读卡器
</summary>
</member>
<member name="M:Asa.RFID.Reader.#ctor(System.String)">
<summary>
RFID读卡器
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsConn">
<summary>
是否连接
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsAutoScan">
<summary>
是否自动扫描
</summary>
</member>
<member name="P:Asa.RFID.Reader.IsExist">
<summary>
是否存在ID卡
</summary>
</member>
<member name="P:Asa.RFID.Reader.ErrCode">
<summary>
错误代码
</summary>
</member>
<member name="P:Asa.RFID.Reader.IP">
<summary>
IP地址
</summary>
</member>
<member name="P:Asa.RFID.Reader.ID">
<summary>
ID号码
</summary>
</member>
<member name="M:Asa.RFID.Reader.Connect(System.Boolean)">
<summary>
连接
</summary>
<param name="autoScan">自动扫描</param>
</member>
<member name="M:Asa.RFID.Reader.Close">
<summary>
关闭
</summary>
</member>
<member name="M:Asa.RFID.Reader.FindRFID">
<summary>
查找电子标签,扫描模式不能使用
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.Read">
<summary>
读取电子标签
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.Reader.Write(System.Byte[])">
<summary>
写入数据到电子标签,扫描模式不能使用
</summary>
<param name="buff">数据,必须小于等于112字节</param>
<returns></returns>
</member>
<member name="T:Asa.RFID.ReaderAll">
<summary>
RFID读卡器
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.#ctor">
<summary>
RFID
</summary>
</member>
<member name="P:Asa.RFID.ReaderAll.LogPath">
<summary>
日志目录
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.Open(System.String[])">
<summary>
打开所有
</summary>
<param name="ip"></param>
</member>
<member name="M:Asa.RFID.ReaderAll.Close">
<summary>
关闭所有
</summary>
</member>
<member name="M:Asa.RFID.ReaderAll.Read(System.String)">
<summary>
读取
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.ReaderAll.Clear(System.String)">
<summary>
清零
</summary>
<param name="ip"></param>
</member>
<member name="T:Asa.RFID.IP">
<summary>
IP地址操作
</summary>
</member>
<member name="M:Asa.RFID.IP.Find(System.String)">
<summary>
查找IP地址
</summary>
<param name="localIP"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.IP.Modify(System.String,System.String,System.String)">
<summary>
修改IP地址,需要先查找IP
</summary>
<param name="localIP">本地IP</param>
<param name="beforeIP">修改前的IP</param>
<param name="afterIP">修改后的IP</param>
<returns></returns>
</member>
<member name="M:Asa.RFID.IP.GetLocal">
<summary>
获取本地IPv4地址
</summary>
<returns></returns>
</member>
</members>
</doc>
此文件类型无法预览
此文件类型无法预览
1.0.0.0 2019-11-19
1、钉盘上传
\ No newline at end of file
......@@ -557,7 +557,7 @@
//
this.lblSize.AutoSize = true;
this.lblSize.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblSize.Location = new System.Drawing.Point(7, 74);
this.lblSize.Location = new System.Drawing.Point(7, 69);
this.lblSize.Name = "lblSize";
this.lblSize.Size = new System.Drawing.Size(63, 17);
this.lblSize.TabIndex = 275;
......@@ -770,7 +770,7 @@
this.lblMsg.AutoSize = true;
this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMsg.ForeColor = System.Drawing.Color.Green;
this.lblMsg.Location = new System.Drawing.Point(248, 76);
this.lblMsg.Location = new System.Drawing.Point(248, 71);
this.lblMsg.Name = "lblMsg";
this.lblMsg.Size = new System.Drawing.Size(135, 20);
this.lblMsg.TabIndex = 223;
......@@ -781,7 +781,7 @@
this.btnSavePosition.BackColor = System.Drawing.SystemColors.Control;
this.btnSavePosition.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSavePosition.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSavePosition.Location = new System.Drawing.Point(617, 26);
this.btnSavePosition.Location = new System.Drawing.Point(617, 21);
this.btnSavePosition.Name = "btnSavePosition";
this.btnSavePosition.Size = new System.Drawing.Size(105, 38);
this.btnSavePosition.TabIndex = 217;
......@@ -794,7 +794,7 @@
this.btnStartAuTo.BackColor = System.Drawing.SystemColors.Control;
this.btnStartAuTo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStartAuTo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStartAuTo.Location = new System.Drawing.Point(470, 26);
this.btnStartAuTo.Location = new System.Drawing.Point(470, 21);
this.btnStartAuTo.Name = "btnStartAuTo";
this.btnStartAuTo.Size = new System.Drawing.Size(141, 38);
this.btnStartAuTo.TabIndex = 222;
......@@ -806,7 +806,7 @@
//
this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.Location = new System.Drawing.Point(101, 79);
this.label9.Location = new System.Drawing.Point(101, 74);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(83, 17);
this.label9.TabIndex = 220;
......@@ -814,7 +814,7 @@
//
// txtJiange
//
this.txtJiange.Location = new System.Drawing.Point(190, 73);
this.txtJiange.Location = new System.Drawing.Point(190, 68);
this.txtJiange.Name = "txtJiange";
this.txtJiange.Size = new System.Drawing.Size(52, 26);
this.txtJiange.TabIndex = 221;
......@@ -975,7 +975,7 @@
this.cmbPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cmbPosition.FormattingEnabled = true;
this.cmbPosition.Location = new System.Drawing.Point(10, 31);
this.cmbPosition.Location = new System.Drawing.Point(10, 26);
this.cmbPosition.Name = "cmbPosition";
this.cmbPosition.Size = new System.Drawing.Size(232, 28);
this.cmbPosition.TabIndex = 174;
......@@ -1001,7 +1001,7 @@
this.btnInStore.BackColor = System.Drawing.SystemColors.Control;
this.btnInStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnInStore.Location = new System.Drawing.Point(248, 26);
this.btnInStore.Location = new System.Drawing.Point(248, 21);
this.btnInStore.Name = "btnInStore";
this.btnInStore.Size = new System.Drawing.Size(105, 38);
this.btnInStore.TabIndex = 102;
......@@ -1014,7 +1014,7 @@
this.btnOutStore.BackColor = System.Drawing.SystemColors.Control;
this.btnOutStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOutStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOutStore.Location = new System.Drawing.Point(359, 26);
this.btnOutStore.Location = new System.Drawing.Point(359, 21);
this.btnOutStore.Name = "btnOutStore";
this.btnOutStore.Size = new System.Drawing.Size(105, 38);
this.btnOutStore.TabIndex = 101;
......
......@@ -100,7 +100,6 @@ namespace OnlineStore.ACPackingStore
txtUpDownP1.Text = BoxBean.Config.UpDownAxis_P1.ToString();
LoadPData(ktkPosition);
timer1.Start();
chbDebug.Checked = BoxBean.IsDebug;
this.ShowInTaskbar = true;
try
......@@ -115,6 +114,7 @@ namespace OnlineStore.ACPackingStore
}
txtTempPort.Text = BoxBean.Config.Humiture_Port;
timer1.Start();
LoadOk = true;
}
#endregion
......
......@@ -32,6 +32,10 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStore));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.chbDoorCanMove = new System.Windows.Forms.CheckBox();
this.chbAutoShelfInstore = new System.Windows.Forms.CheckBox();
this.chbUseBuzzer = new System.Windows.Forms.CheckBox();
......@@ -68,6 +72,8 @@
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
......@@ -91,6 +97,8 @@
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox4);
this.tabPage1.Controls.Add(this.groupBox3);
this.tabPage1.Controls.Add(this.chbDoorCanMove);
this.tabPage1.Controls.Add(this.chbAutoShelfInstore);
this.tabPage1.Controls.Add(this.chbUseBuzzer);
......@@ -106,11 +114,63 @@
this.tabPage1.Text = " 日志信息 ";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.tableLayoutPanel2);
this.groupBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox4.Location = new System.Drawing.Point(6, 118);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(229, 171);
this.groupBox4.TabIndex = 199;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "DO列表";
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Location = new System.Drawing.Point(5, 14);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(218, 151);
this.tableLayoutPanel2.TabIndex = 103;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.tableLayoutPanel1);
this.groupBox3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox3.Location = new System.Drawing.Point(6, 6);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(229, 109);
this.groupBox3.TabIndex = 198;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "DI列表";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Location = new System.Drawing.Point(6, 14);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(218, 89);
this.tableLayoutPanel1.TabIndex = 102;
//
// chbDoorCanMove
//
this.chbDoorCanMove.AutoSize = true;
this.chbDoorCanMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDoorCanMove.Location = new System.Drawing.Point(923, 13);
this.chbDoorCanMove.Location = new System.Drawing.Point(36, 461);
this.chbDoorCanMove.Name = "chbDoorCanMove";
this.chbDoorCanMove.Size = new System.Drawing.Size(126, 24);
this.chbDoorCanMove.TabIndex = 197;
......@@ -122,7 +182,7 @@
//
this.chbAutoShelfInstore.AutoSize = true;
this.chbAutoShelfInstore.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoShelfInstore.Location = new System.Drawing.Point(751, 13);
this.chbAutoShelfInstore.Location = new System.Drawing.Point(36, 411);
this.chbAutoShelfInstore.Name = "chbAutoShelfInstore";
this.chbAutoShelfInstore.Size = new System.Drawing.Size(154, 24);
this.chbAutoShelfInstore.TabIndex = 196;
......@@ -134,7 +194,7 @@
//
this.chbUseBuzzer.AutoSize = true;
this.chbUseBuzzer.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbUseBuzzer.Location = new System.Drawing.Point(621, 13);
this.chbUseBuzzer.Location = new System.Drawing.Point(36, 361);
this.chbUseBuzzer.Name = "chbUseBuzzer";
this.chbUseBuzzer.Size = new System.Drawing.Size(98, 24);
this.chbUseBuzzer.TabIndex = 195;
......@@ -146,7 +206,7 @@
//
this.chkDebug.AutoSize = true;
this.chkDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(285, 13);
this.chkDebug.Location = new System.Drawing.Point(36, 511);
this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(132, 24);
this.chkDebug.TabIndex = 194;
......@@ -158,7 +218,7 @@
//
this.chbAutoRun.AutoSize = true;
this.chbAutoRun.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoRun.Location = new System.Drawing.Point(449, 13);
this.chbAutoRun.Location = new System.Drawing.Point(36, 311);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(140, 24);
this.chbAutoRun.TabIndex = 94;
......@@ -170,11 +230,11 @@
//
this.btnCopyLog.BackColor = System.Drawing.Color.White;
this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyLog.Location = new System.Drawing.Point(19, 8);
this.btnCopyLog.Location = new System.Drawing.Point(13, 558);
this.btnCopyLog.Name = "btnCopyLog";
this.btnCopyLog.Size = new System.Drawing.Size(105, 35);
this.btnCopyLog.TabIndex = 191;
this.btnCopyLog.Text = "复制";
this.btnCopyLog.Text = "复制日志";
this.btnCopyLog.UseVisualStyleBackColor = false;
this.btnCopyLog.Click += new System.EventHandler(this.btnCopyLog_Click);
//
......@@ -182,7 +242,7 @@
//
this.btnClearLog.BackColor = System.Drawing.Color.White;
this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearLog.Location = new System.Drawing.Point(130, 8);
this.btnClearLog.Location = new System.Drawing.Point(124, 558);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(105, 35);
this.btnClearLog.TabIndex = 190;
......@@ -196,9 +256,9 @@
| 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(10, 48);
this.logBox.Location = new System.Drawing.Point(241, 3);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(1316, 588);
this.logBox.Size = new System.Drawing.Size(1085, 633);
this.logBox.TabIndex = 106;
this.logBox.Text = "";
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
......@@ -422,6 +482,8 @@
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
......@@ -468,6 +530,10 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.CheckBox chbAutoShelfInstore;
private System.Windows.Forms.CheckBox chbDoorCanMove;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}
......@@ -12,6 +12,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UserFromControl;
namespace OnlineStore.ACPackingStore
{
......@@ -42,7 +43,7 @@ namespace OnlineStore.ACPackingStore
this.Close();
return;
}
LoadIOList();
foreach (AC_BOX_Bean box in store.BoxMap.Values)
{
FrmBox frm = new FrmBox();
......@@ -62,10 +63,62 @@ namespace OnlineStore.ACPackingStore
this.timer1.Start();
}
Dictionary<string, IOTextControl> DIControlList = new Dictionary<string, IOTextControl>();
Dictionary<string, IOTextControl> DOControlList = new Dictionary<string, IOTextControl>();
private void LoadIOList()
{
int roleindex = 0;
this.tableLayoutPanel1.RowStyles.Clear();
this.tableLayoutPanel1.RowCount = store.Config.DIList.Count;
foreach (ConfigIO ioValue in store.Config.DIList.Values)
{
this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
this.tableLayoutPanel1.Controls.Add(control, 0, roleindex);
roleindex++;
DIControlList.Add(ioValue.ProName, control);
}
tableLayoutPanel2.RowStyles.Clear();
this.tableLayoutPanel2.RowCount = store.Config.DOList.Count;
roleindex = 0;
foreach (ConfigIO ioValue in store.Config.DOList.Values)
{
this.tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 28));
IOTextControl control = new IOTextControl(ioValue.ElectricalDefinition + "_" + ioValue.Explain, ioValue.ProName);
this.tableLayoutPanel2.Controls.Add(control, 0, roleindex);
roleindex++;
DOControlList.Add(ioValue.ProName, control);
}
this.SuspendLayout(); //此处为不闪屏,一定要有的!
}
private void ReadIOList()
{
foreach (string key in DIControlList.Keys)
{
IOTextControl control = DIControlList[key];
int iov = (int)store.IOValue(key);
if (iov != control.IOValue)
{
control.IOValue = iov;
control.ShowData();
}
}
foreach (string key in this.DOControlList.Keys)
{
IOTextControl control = DOControlList[key];
int iov = (int)store.IOValue(key);
if (iov != control.IOValue)
{
control.IOValue = iov;
control.ShowData();
}
}
}
private void AddForm(string text, Form form)
{
text = text.PadLeft(10, ' ');
text = text.PadLeft(12, ' ');
TabPage lineTabPage = new TabPage(text);
lineTabPage.AutoScroll = true;
// lineTabPage.Tag = lineBean;
......@@ -286,6 +339,7 @@ namespace OnlineStore.ACPackingStore
{
return;
}
ReadIOList();
string msg = "";
foreach(AC_BOX_Bean box in StoreManager.Store.BoxMap.Values)
{
......
......@@ -141,7 +141,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
LogInfo("开始启动,启动时间:" + StartTime.ToString());
if (!IsDebug)
if (IsDebug)
{
//连接AGV调度
if (!AgvClient.ISConnected())
......@@ -214,9 +214,11 @@ namespace OnlineStore.DeviceLibrary
#region 原点返回和复位处理
private void ReturnHome()
{
AutoInout.ClearCount();
lastPosId = "";
lastPosIdStatus = StoreStatus.ResetMove;
AutoInout.ClearCount();
storeRunStatus = StoreRunStatus.HomeMoving;
MoveInfo.NewMove(StoreMoveType.ReturnHome);
MoveInfo.NewMove(StoreMoveType.ReturnHome);
InoutStartReset();
}
public void MoveToP1()
......@@ -455,6 +457,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public override void StopRun()
{
lastPosId = "";
lastPosIdStatus = StoreStatus.StoreOnline;
WarnMsg = "";
AutoInout.StopAuto();
IoCheckTimer.Enabled = false;
......@@ -850,9 +854,9 @@ namespace OnlineStore.DeviceLibrary
msg += "runS: " + storeRunStatus + "\n";
msg += "lineS: " + storeStatus + "\n";
msg += "alarm: " + alarmType + "\n";
msg += "MoveT:" + MoveInfo.MoveType + "\n";
msg += "Move:" + MoveInfo.MoveType + "\n";
msg += "MoveS: " + MoveInfo.SLog + "\n";
msg += "Shlef: " + LastShelfData.NumStr() ;
msg += "Shlef: " + CurrShelfID ;
return msg;
}
}
......
......@@ -183,7 +183,7 @@ namespace OnlineStore.DeviceLibrary
private int ComTargetPosition = 0;
private int LastWidth = 0;
private int LastHeight = 0;
private RFIDData LastShelfData = new RFIDData(0,0);
private string CurrShelfID = "";
#region 入库
private void ClearLastTrayInfo()
......@@ -284,13 +284,12 @@ namespace OnlineStore.DeviceLibrary
//TODO 判断料架是否正确
if (data.RFType.Equals("A"))
{
LastShelfData = data;
AgvClient.SendRFID(Config.AgvNodeName, data.ToData());
CurrShelfID = data.NumStr();
AgvClient.SendRFID(Config.AgvNodeName, CurrShelfID);
}
else
{
LogUtil.error(Name + "检测到入料口有料架,读取RFID数据错误:" + data.NumStr());
// return;
LogUtil.error(Name + "检测到入料口有料架,读取RFID数据错误:" + data.NumStr());
}
}
......@@ -438,11 +437,11 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_24_InOutToP1))
{
if (IOValue(IO_Type.TrayCheck_3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.TrayCheck_4).Equals(IO_VALUE.HIGH))
if (IOValue(IO_Type.TrayCheck_3).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.TrayCheck_4).Equals(IO_VALUE.HIGH))
{
LastWidth = 15;
}
else if (IOValue(IO_Type.TrayCheck_1).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.TrayCheck_2).Equals(IO_VALUE.HIGH))
else if (IOValue(IO_Type.TrayCheck_1).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.TrayCheck_2).Equals(IO_VALUE.HIGH))
{
LastWidth = 7;
}
......@@ -630,7 +629,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogInfo(" 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
LogInfo(" 入库,MoveStep=" + MoveInfo.MoveStep + ",没有对应的处理!");
}
}
......@@ -841,13 +840,25 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate
{
int posLoc = StoreManager.GetLocByShelfPosID(MoveInfo.MoveParam.ShelfPosID, ShelfPosList);
string msg = StoreManager.PutShelfFinished(Name, MoveInfo.MoveParam.WareCode, LastShelfData.NumStr(), posLoc.ToString(), out serverShelfData);
if (String.IsNullOrEmpty(msg).Equals(false))
//分盘料和紧急料发PutFinished
if (MoveInfo.MoveParam.cutReel || MoveInfo.MoveParam.urgentReel)
{
string msg = StoreManager.PutShelfFinished(Name, MoveInfo.MoveParam.WareCode, CurrShelfID, posLoc.ToString(), out serverShelfData);
if (String.IsNullOrEmpty(msg).Equals(false))
{
LogUtil.error(Name + "【" + MoveInfo.MoveParam.WareCode + "】【" + CurrShelfID + "】【" + posLoc + "】PutShelfFinished 结果:" + msg);
serverShelfData = null;
}
}
else
{
LogUtil.error(Name + "【" + MoveInfo.MoveParam.WareCode + "】【" + LastShelfData + "】【" + posLoc + "】PutShelfFinished 结果:" + msg);
serverShelfData = null;
string msg = StoreManager.UpdateTrayLoc(Name, MoveInfo.MoveParam.WareCode, CurrShelfID+"@"+ posLoc.ToString());
if (String.IsNullOrEmpty(msg).Equals(false))
{
LogUtil.error(Name + "【" + MoveInfo.MoveParam.WareCode + "】【" + CurrShelfID + "】【" + posLoc + "】UpdateTrayLoc 结果:" + msg);
serverShelfData = null;
}
}
});
}
......@@ -877,19 +888,19 @@ namespace OnlineStore.DeviceLibrary
}
else if (EmprtShelfList.Count <= 0)
{
InOutStoreLog("出库完成,料架【" + LastShelfData + "】没有剩余位置,送出料架");
InOutStoreLog("出库完成,料架【" + CurrShelfID + "】没有剩余位置,送出料架");
isNeedSend = true;
}
else if (serverShelfData != null)
{
if (serverShelfData.packageEmpty <= 0)
{
InOutStoreLog("出库完成,料架【" + LastShelfData + "】没有位置,packageEmpty=" + serverShelfData.packageEmpty + ",送出料架");
InOutStoreLog("出库完成,料架【" + CurrShelfID + "】没有位置,packageEmpty=" + serverShelfData.packageEmpty + ",送出料架");
isNeedSend = true;
}
else if ((serverShelfData.cutPackageTask + serverShelfData.packageTask) <= 0)
{
InOutStoreLog("出库完成,料架【" + LastShelfData + "】没有出库任务,cutPackageTask=" + serverShelfData.cutPackageTask + ",packageTask=" + serverShelfData.packageTask + ",送出料架");
InOutStoreLog("出库完成,料架【" + CurrShelfID + "】没有出库任务,cutPackageTask=" + serverShelfData.cutPackageTask + ",packageTask=" + serverShelfData.packageTask + ",送出料架");
isNeedSend = true;
}
}
......
......@@ -209,9 +209,9 @@ namespace OnlineStore.DeviceLibrary
if (instoreShelf)
{
InOutStoreLog(moveName + MoveInfo.SLog + ":调用AgvClient.SendRFID【" + LastShelfData.ToData() + "】,调用AgvClient.MayOut,线体开始反转");
InOutStoreLog(moveName + MoveInfo.SLog + ":调用AgvClient.SendRFID【" + CurrShelfID + "】,调用AgvClient.MayOut,线体开始反转");
//TODO AGV到达,发送料架信息,是否需要重新读取?
AgvClient.SendRFID(Config.AgvNodeName, LastShelfData.ToData());
AgvClient.SendRFID(Config.AgvNodeName, CurrShelfID);
}
else
{
......@@ -586,7 +586,7 @@ namespace OnlineStore.DeviceLibrary
//发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", 1.ToString() } };
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", 1.ToString() }, { ParamDefine.rfid, CurrShelfID } };
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
if (resultOperation == null)
......
......@@ -30,6 +30,7 @@ namespace OnlineStore.DeviceLibrary
public Store_Config Config { get; set; }
public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
public bool AutoShelfInstore = ConfigAppSettings.GetIntValue(Setting_Init.AutoShelfInstore).Equals(1);
List<string> rfidList = new List<string>();
#region 初始化
internal bool canStart = false;
......@@ -53,7 +54,7 @@ namespace OnlineStore.DeviceLibrary
AddDeviceName(ioList, Config.DIODeviceNameList);
List<string> rfidList = new List<string>();
foreach (AC_BOX_Config config in configList.Values)
{
AC_BOX_Bean equip = new AC_BOX_Bean(config);
......@@ -112,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
#endregion
public override bool StartRun(bool isDebug = false)
{
{
if (!canStart)
{
SetWarnMsg("启动失败:设备未初始化完成");
......@@ -125,15 +126,15 @@ namespace OnlineStore.DeviceLibrary
}
if (IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
SetWarnMsg("启动失败:急停未开");
SetWarnMsg("启动失败:急停未开");
}
else if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW))
{
SetWarnMsg("启动失败:没有气压信号");
SetWarnMsg("启动失败:没有气压信号");
}
else
{
LogUtil.info( Name + "开始启动,启动时间:" + StartTime.ToString());
LogUtil.info(Name + "开始启动,连接agv调度,连接rfid,启动时间:" + StartTime.ToString());
storeRunStatus = StoreRunStatus.HomeMoving;
StartTime = DateTime.Now;
//连接AGV调度
......@@ -141,59 +142,54 @@ namespace OnlineStore.DeviceLibrary
{
AgvClient.Init();
}
mainTimer.Enabled = false;
RFIDManager.Open(rfidList.ToArray());
mainTimer.Enabled = false;
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = StoreAlarmType.None;
WarnMsg = "";
foreach (AC_BOX_Bean box in this.BoxMap.Values)
{
// if (!box.IsDebug)
{
box.StartRun();
}
box.StartRun();
}
ledProcessTimer.Enabled = true;
ledProcessTimer.Enabled = true;
mainTimer.Enabled = true;
return true;
}
return false;
}
}
public override void Reset(bool isNeedClearAuto = true)
public override void Reset(bool isNeedClearAuto = true)
{
mainTimer.Enabled = false;
mainTimer.Enabled = false;
//停止运动
MoveInfo.EndMove();
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Reset;
mainTimer.Enabled = false;
mainTimer.Enabled = false;
isInSuddenDown = false;
isNoAirCheck = false;
alarmType = StoreAlarmType.None;
WarnMsg = "";
foreach (AC_BOX_Bean equip in BoxMap.Values)
{
//调试状态不再重置
// if (!equip.IsDebug)
if (!equip.alarmType.Equals(StoreAlarmType.None))
{
if (!equip.alarmType.Equals(StoreAlarmType.None))
{
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
equip.Reset();
}
else
{
LogUtil.info(Name + "收到复位信号," + equip.Name + " 正常无报警,不需要复位");
}
LogUtil.info(Name + "收到复位信号," + equip.Name + " 需要复位");
equip.Reset();
}
else
{
LogUtil.info(Name + "收到复位信号," + equip.Name + " 正常无报警,不需要复位");
}
}
mainTimer.Enabled = true;
}
mainTimer.Enabled = true;
}
......@@ -209,9 +205,9 @@ namespace OnlineStore.DeviceLibrary
equip.StopRun();
}
storeRunStatus = StoreRunStatus.Wait;
RFIDManager.Close();
TimeSpan span = DateTime.Now - StartTime;
LogUtil.info( Name + ",停止运行,总运行时间:" + span.ToString());
LogUtil.info( Name + ",停止运行,关闭rfid,总运行时间:" + span.ToString());
}
#region 灯光处理
......
......@@ -324,6 +324,50 @@ namespace OnlineStore.DeviceLibrary
}
return "";
}
/// <summary>
/// 2 料盘流转位置信息更新
/// 地址: /rest/api/qisda/device/updateLocInfo
/// </summary>
private static string Addr_updateLocInfo = "/rest/api/qisda/device/updateLocInfo";
public static string UpdateTrayLoc(string deviceName, string barcode, string locInfo)
{
string msg = "";
try
{
if (String.IsNullOrEmpty(barcode))
{
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);//barcode = 料盘的条码
paramMap.Add("status", "INSHELF"); // status = 状态信息, 移栽 = MOVING, 流水线 = INLINE, 皮带线 = INBELT
paramMap.Add("locInfo", locInfo); // locInfo = 位置信息,移栽时为移栽编号,流水线时为托盘号,皮带线时为皮带线编号,机器人时为机器人编号
string server = GetAddr(Addr_updateLocInfo, paramMap);
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("UpdateTrayLoc 【" + server + "】【" + resultStr + "】");
// 返回: { "code": 0, "msg":"ok", "data":""}
ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
if (serverResult == null)
{
msg = deviceName + "UpdateTrayLoc【 " + barcode + "】【" + "INSHELF" + "】【" + locInfo + "】没有收到服务器反馈";
}
else if (serverResult.code.Equals(0).Equals(false))
{
// code: 0为正常,其他为异常, msg: 消息, data: 为空
msg = deviceName + " UpdateTrayLoc【 " + barcode + "】【" + "INSHELF" + "】【" + locInfo + "】 :" + "[" + serverResult.code + "]" + serverResult.msg;
}
if (!msg.Equals(""))
{
LogUtil.error(msg);
}
}
catch (Exception ex)
{
LogUtil.error(deviceName + " " + ex.ToString());
}
return msg;
}
public static int GetLocByShelfPosID(string shelfId, List<String> shelfPosList)
{
int loc = -1;
......
......@@ -53,8 +53,9 @@ namespace OnlineStore.DeviceLibrary
///02 发送RFID
/// </summary>
/// <param name="NodeName"></param>
internal static void SendRFID(string NodeName, byte[] data)
internal static void SendRFID(string NodeName, string shelfId)
{
byte[] data = null;
agvClient.SendRFID(NodeName, data);
}
......
......@@ -14,8 +14,14 @@ namespace OnlineStore.DeviceLibrary
public class RFIDManager
{
public static void Open(string[] iparray)
{
RFIDReader.Open(null ,iparray);
{
try
{
RFIDReader.Open(null, iparray);
}catch(Exception ex)
{
LogUtil.error("Open 出错:" + ex.ToString());
}
}
public static RFIDData ReadRFID(string ip, bool isClear = false)
......@@ -65,17 +71,14 @@ namespace OnlineStore.DeviceLibrary
public class RFIDData
{
/// <summary>
/// RFID类型,区分是料架还是托盘,托盘E=69,A=65
/// </summary>
public int RFType = 0;
/// <summary>
/// 托盘编号,从1-32
/// RFID类型,区分是料架还是托盘,托盘E=69,包装料料架A=65,料串=B
/// </summary>
public char RFType = 'A';
public int Num = 0;
public RFIDData(int num, int t)
{
this.RFType = t;
this.RFType = (char)t;
this.Num = num;
}
......@@ -85,8 +88,8 @@ namespace OnlineStore.DeviceLibrary
{
if (data != null && data.Length > 2)
{
RFType = data[1];
Num = Convert.ToInt32(data[2]);
RFType = (char)data[1];
Num = (int)(data[2]);
}
}
catch (Exception ex)
......@@ -100,7 +103,7 @@ namespace OnlineStore.DeviceLibrary
}
public string NumStr()
{
return "" + RFType + "" + Num.ToString().PadLeft(2,'0') + "";
}
return "" + RFType + "" + Num.ToString().PadLeft(2, '0') + "";
}
}
}
......@@ -140,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
}
public string ToStr()
{
return " ShelfPosID=[" + ShelfPosID + "],WareCode [" + WareCode + "],PosID [" + PosID + "],PlateW [" + PlateW + "],PlateH [" + PlateH + "]" +
return " 料架号[" + ShelfPosID + "],库位号 [" + PosID + "], [" + WareCode + "], [" + PlateW + "x" + PlateH + "]" +
"NeedEnterShelf【" + NeedEnterShelf + "】NeedOutShelf【" + NeedOutShelf + "】"+
"urgentReel [" + urgentReel + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "]";
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!