Commit b1431631 LN

料架入库处理

1 个父辈 aece1f17
...@@ -96,5 +96,8 @@ namespace OnlineStore.Common ...@@ -96,5 +96,8 @@ namespace OnlineStore.Common
public static string CodeCount = "CodeCount"; public static string CodeCount = "CodeCount";
public static string CurrShelfNum = "CurrShelfNum";
public static string CurrShelfType = "CurrShelfType";
} }
} }
...@@ -55,6 +55,10 @@ ...@@ -55,6 +55,10 @@
<add key="AutoShelfInstore" value="1" /> <add key="AutoShelfInstore" value="1" />
<!--进出轴位置--> <!--进出轴位置-->
<add key ="InOutDefaultPosition" value ="3000"/> <add key ="InOutDefaultPosition" value ="3000"/>
<!--当前料架信息-料架号-->
<add key ="CurrShelfNum" value ="-1"/>
<!--当前料架信息-料架类型,0=空料架,1=入库料架,2=出库料架-->
<add key ="CurrShelfType" value ="0"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -50,7 +50,7 @@ namespace OnlineStore.DUOStore ...@@ -50,7 +50,7 @@ namespace OnlineStore.DUOStore
} }
// this.groupBox3.Text = "设备[" + BoxBean.CID + "]状态"; // this.groupBox3.Text = "设备[" + BoxBean.CID + "]状态";
this.Text = BoxBean.Name; this.Text = BoxBean.Name;
axisMoveControl1.LoadData(BoxBean, new AxisBean[] {BoxBean.MiddleAxis,BoxBean.UpdownAxis,BoxBean.InoutAxis,BoxBean.ComAxis }); axisMoveControl1.LoadData(BoxBean, new AxisBean[] { BoxBean.MiddleAxis, BoxBean.UpdownAxis, BoxBean.InoutAxis, BoxBean.ComAxis });
ACBoxPosition acPosition = null; ACBoxPosition acPosition = null;
if (BoxBean.PositionNumList.Count > 0) if (BoxBean.PositionNumList.Count > 0)
{ {
...@@ -213,7 +213,7 @@ namespace OnlineStore.DUOStore ...@@ -213,7 +213,7 @@ namespace OnlineStore.DUOStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
InOutParam param = new InOutParam("", selectPositionNum, ktk); InOutParam param = new InOutParam(MoveType.OutStore, "", selectPositionNum, ktk);
BoxBean.StartOutStoreMove(param); BoxBean.StartOutStoreMove(param);
} }
else else
...@@ -228,7 +228,7 @@ namespace OnlineStore.DUOStore ...@@ -228,7 +228,7 @@ namespace OnlineStore.DUOStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
BoxBean.StartInStoreMove(new InOutParam("", selectPositionNum, ktk)); BoxBean.StartInStoreMove(new InOutParam(MoveType.InStore, "", selectPositionNum, ktk));
} }
else else
{ {
...@@ -365,7 +365,7 @@ namespace OnlineStore.DUOStore ...@@ -365,7 +365,7 @@ namespace OnlineStore.DUOStore
needUpdate = true; needUpdate = true;
} }
if (BoxBean.Config.UpDownAxis_P2 != upp2 ) if (BoxBean.Config.UpDownAxis_P2 != upp2)
{ {
BoxBean.Config.UpDownAxis_P2 = upp2; BoxBean.Config.UpDownAxis_P2 = upp2;
needUpdate = true; needUpdate = true;
...@@ -376,7 +376,7 @@ namespace OnlineStore.DUOStore ...@@ -376,7 +376,7 @@ namespace OnlineStore.DUOStore
BoxBean.Config.UpDownAxis_P11 = upp11; BoxBean.Config.UpDownAxis_P11 = upp11;
needUpdate = true; needUpdate = true;
} }
if (BoxBean.Config.UpDownAxis_P12 != upp12 ) if (BoxBean.Config.UpDownAxis_P12 != upp12)
{ {
BoxBean.Config.UpDownAxis_P12 = upp12; BoxBean.Config.UpDownAxis_P12 = upp12;
needUpdate = true; needUpdate = true;
...@@ -384,17 +384,17 @@ namespace OnlineStore.DUOStore ...@@ -384,17 +384,17 @@ namespace OnlineStore.DUOStore
if (BoxBean.Config.CompAxis_P3 != comp3 ) if (BoxBean.Config.CompAxis_P3 != comp3)
{ {
BoxBean.Config.CompAxis_P3 = comp3; BoxBean.Config.CompAxis_P3 = comp3;
needUpdate = true; needUpdate = true;
} }
if (BoxBean.Config.GetComP2(acPosition.BagHigh) != comp2 ) if (BoxBean.Config.GetComP2(acPosition.BagHigh) != comp2)
{ {
BoxBean.Config.UpdateComP2(acPosition.BagHigh,comp2); BoxBean.Config.UpdateComP2(acPosition.BagHigh, comp2);
needUpdate = true; needUpdate = true;
} }
if (BoxBean.Config.CompAxis_P1 != comp1 ) if (BoxBean.Config.CompAxis_P1 != comp1)
{ {
BoxBean.Config.CompAxis_P1 = comp1; BoxBean.Config.CompAxis_P1 = comp1;
needUpdate = true; needUpdate = true;
...@@ -542,7 +542,7 @@ namespace OnlineStore.DUOStore ...@@ -542,7 +542,7 @@ namespace OnlineStore.DUOStore
BoxBean.AutoInout.autoMsg = "自动出库:" + poText; BoxBean.AutoInout.autoMsg = "自动出库:" + poText;
LogUtil.info(BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!"); LogUtil.info(BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//BoxBean.StartOutStoreMove(new InOutStoreParam("", poText)); //BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
BoxBean.StartInStoreMove(new InOutParam("", poText)); BoxBean.StartInStoreMove(new InOutParam(MoveType.InStore, "", poText));
btnStartAuTo.Text = "停止自动出入库"; btnStartAuTo.Text = "停止自动出入库";
} }
...@@ -806,7 +806,7 @@ namespace OnlineStore.DUOStore ...@@ -806,7 +806,7 @@ namespace OnlineStore.DUOStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
BoxBean.StartInStoreMove(new InOutParam("", selectPositionNum, ktk,1)); BoxBean.StartInStoreMove(new InOutParam(MoveType.InStore, "", selectPositionNum, ktk, 1));
} }
else else
{ {
...@@ -820,7 +820,7 @@ namespace OnlineStore.DUOStore ...@@ -820,7 +820,7 @@ namespace OnlineStore.DUOStore
{ {
string selectPositionNum = cmbPosition.Text; string selectPositionNum = cmbPosition.Text;
LineMoveP ktk = LoadPostion(); LineMoveP ktk = LoadPostion();
InOutParam param = new InOutParam("", selectPositionNum, ktk,1); InOutParam param = new InOutParam(MoveType.OutStore, "", selectPositionNum, ktk, 1);
BoxBean.StartOutStoreMove(param); BoxBean.StartOutStoreMove(param);
} }
else else
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
// //
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(653, 572); this.button1.Location = new System.Drawing.Point(689, 563);
this.button1.Name = "button1"; this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(125, 37); this.button1.Size = new System.Drawing.Size(125, 37);
this.button1.TabIndex = 254; this.button1.TabIndex = 254;
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(524, 3); this.groupBox1.Location = new System.Drawing.Point(524, 3);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(323, 544); this.groupBox1.Size = new System.Drawing.Size(322, 544);
this.groupBox1.TabIndex = 105; this.groupBox1.TabIndex = 105;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "DO写入"; this.groupBox1.Text = "DO写入";
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
// //
this.btnCloseAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 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.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAll.Location = new System.Drawing.Point(168, 358); this.btnCloseAll.Location = new System.Drawing.Point(167, 358);
this.btnCloseAll.Name = "btnCloseAll"; this.btnCloseAll.Name = "btnCloseAll";
this.btnCloseAll.Size = new System.Drawing.Size(125, 34); this.btnCloseAll.Size = new System.Drawing.Size(125, 34);
this.btnCloseAll.TabIndex = 302; this.btnCloseAll.TabIndex = 302;
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
// //
this.btnRelax.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRelax.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRelax.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnRelax.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRelax.Location = new System.Drawing.Point(168, 300); this.btnRelax.Location = new System.Drawing.Point(167, 300);
this.btnRelax.Name = "btnRelax"; this.btnRelax.Name = "btnRelax";
this.btnRelax.Size = new System.Drawing.Size(125, 34); this.btnRelax.Size = new System.Drawing.Size(125, 34);
this.btnRelax.TabIndex = 297; this.btnRelax.TabIndex = 297;
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
// //
this.btnClamp.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClamp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClamp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnClamp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnClamp.Location = new System.Drawing.Point(168, 263); this.btnClamp.Location = new System.Drawing.Point(167, 263);
this.btnClamp.Name = "btnClamp"; this.btnClamp.Name = "btnClamp";
this.btnClamp.Size = new System.Drawing.Size(125, 34); this.btnClamp.Size = new System.Drawing.Size(125, 34);
this.btnClamp.TabIndex = 296; this.btnClamp.TabIndex = 296;
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
// //
this.btnLineStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLineStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLineStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnLineStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLineStop.Location = new System.Drawing.Point(14, 300); this.btnLineStop.Location = new System.Drawing.Point(31, 300);
this.btnLineStop.Name = "btnLineStop"; this.btnLineStop.Name = "btnLineStop";
this.btnLineStop.Size = new System.Drawing.Size(125, 34); this.btnLineStop.Size = new System.Drawing.Size(125, 34);
this.btnLineStop.TabIndex = 295; this.btnLineStop.TabIndex = 295;
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
// //
this.btnLineRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLineRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLineRun.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnLineRun.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLineRun.Location = new System.Drawing.Point(14, 263); this.btnLineRun.Location = new System.Drawing.Point(31, 263);
this.btnLineRun.Name = "btnLineRun"; this.btnLineRun.Name = "btnLineRun";
this.btnLineRun.Size = new System.Drawing.Size(125, 34); this.btnLineRun.Size = new System.Drawing.Size(125, 34);
this.btnLineRun.TabIndex = 294; this.btnLineRun.TabIndex = 294;
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
// //
this.btnDeviceLed.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDeviceLed.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDeviceLed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnDeviceLed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDeviceLed.Location = new System.Drawing.Point(14, 398); this.btnDeviceLed.Location = new System.Drawing.Point(31, 398);
this.btnDeviceLed.Name = "btnDeviceLed"; this.btnDeviceLed.Name = "btnDeviceLed";
this.btnDeviceLed.Size = new System.Drawing.Size(125, 34); this.btnDeviceLed.Size = new System.Drawing.Size(125, 34);
this.btnDeviceLed.TabIndex = 293; this.btnDeviceLed.TabIndex = 293;
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
// //
this.btnCamerLed.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCamerLed.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCamerLed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCamerLed.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCamerLed.Location = new System.Drawing.Point(14, 358); this.btnCamerLed.Location = new System.Drawing.Point(31, 358);
this.btnCamerLed.Name = "btnCamerLed"; this.btnCamerLed.Name = "btnCamerLed";
this.btnCamerLed.Size = new System.Drawing.Size(125, 34); this.btnCamerLed.Size = new System.Drawing.Size(125, 34);
this.btnCamerLed.TabIndex = 290; this.btnCamerLed.TabIndex = 290;
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
// //
this.btnTopDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnTopDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTopDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnTopDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTopDown.Location = new System.Drawing.Point(14, 206); this.btnTopDown.Location = new System.Drawing.Point(31, 206);
this.btnTopDown.Name = "btnTopDown"; this.btnTopDown.Name = "btnTopDown";
this.btnTopDown.Size = new System.Drawing.Size(125, 34); this.btnTopDown.Size = new System.Drawing.Size(125, 34);
this.btnTopDown.TabIndex = 289; this.btnTopDown.TabIndex = 289;
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
// //
this.btnTopUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnTopUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTopUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnTopUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnTopUp.Location = new System.Drawing.Point(14, 169); this.btnTopUp.Location = new System.Drawing.Point(31, 169);
this.btnTopUp.Name = "btnTopUp"; this.btnTopUp.Name = "btnTopUp";
this.btnTopUp.Size = new System.Drawing.Size(125, 34); this.btnTopUp.Size = new System.Drawing.Size(125, 34);
this.btnTopUp.TabIndex = 288; this.btnTopUp.TabIndex = 288;
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
this.btnCloseDO.BackColor = System.Drawing.Color.White; this.btnCloseDO.BackColor = System.Drawing.Color.White;
this.btnCloseDO.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCloseDO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseDO.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCloseDO.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseDO.Location = new System.Drawing.Point(165, 111); this.btnCloseDO.Location = new System.Drawing.Point(167, 111);
this.btnCloseDO.Name = "btnCloseDO"; this.btnCloseDO.Name = "btnCloseDO";
this.btnCloseDO.Size = new System.Drawing.Size(125, 34); this.btnCloseDO.Size = new System.Drawing.Size(125, 34);
this.btnCloseDO.TabIndex = 281; this.btnCloseDO.TabIndex = 281;
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
// //
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnBack.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBack.Location = new System.Drawing.Point(168, 206); this.btnBack.Location = new System.Drawing.Point(167, 206);
this.btnBack.Name = "btnBack"; this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(125, 34); this.btnBack.Size = new System.Drawing.Size(125, 34);
this.btnBack.TabIndex = 251; this.btnBack.TabIndex = 251;
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
// //
this.btnFoward.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnFoward.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFoward.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnFoward.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFoward.Location = new System.Drawing.Point(168, 169); this.btnFoward.Location = new System.Drawing.Point(167, 169);
this.btnFoward.Name = "btnFoward"; this.btnFoward.Name = "btnFoward";
this.btnFoward.Size = new System.Drawing.Size(125, 34); this.btnFoward.Size = new System.Drawing.Size(125, 34);
this.btnFoward.TabIndex = 250; this.btnFoward.TabIndex = 250;
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(904, 621); this.ClientSize = new System.Drawing.Size(858, 621);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox4);
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStore)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStore));
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.listView1 = new System.Windows.Forms.ListView();
this.chbSendShelfOut = new System.Windows.Forms.CheckBox();
this.lblServerMsg = new System.Windows.Forms.Label(); this.lblServerMsg = new System.Windows.Forms.Label();
this.chbUseBuzzer = new System.Windows.Forms.CheckBox(); this.chbUseBuzzer = new System.Windows.Forms.CheckBox();
this.chkDebug = new System.Windows.Forms.CheckBox(); this.chkDebug = new System.Windows.Forms.CheckBox();
...@@ -91,6 +93,8 @@ ...@@ -91,6 +93,8 @@
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.listView1);
this.tabPage1.Controls.Add(this.chbSendShelfOut);
this.tabPage1.Controls.Add(this.lblServerMsg); this.tabPage1.Controls.Add(this.lblServerMsg);
this.tabPage1.Controls.Add(this.chbUseBuzzer); this.tabPage1.Controls.Add(this.chbUseBuzzer);
this.tabPage1.Controls.Add(this.chkDebug); this.tabPage1.Controls.Add(this.chkDebug);
...@@ -105,6 +109,35 @@ ...@@ -105,6 +109,35 @@
this.tabPage1.Text = " 日志信息 "; this.tabPage1.Text = " 日志信息 ";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.BackColor = System.Drawing.Color.White;
this.listView1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(3, 3);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(1110, 117);
this.listView1.TabIndex = 203;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// chbSendShelfOut
//
this.chbSendShelfOut.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbSendShelfOut.AutoSize = true;
this.chbSendShelfOut.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbSendShelfOut.Location = new System.Drawing.Point(1132, 142);
this.chbSendShelfOut.Name = "chbSendShelfOut";
this.chbSendShelfOut.Size = new System.Drawing.Size(112, 24);
this.chbSendShelfOut.TabIndex = 202;
this.chbSendShelfOut.Text = "送出出料料架";
this.chbSendShelfOut.UseVisualStyleBackColor = true;
//
// lblServerMsg // lblServerMsg
// //
this.lblServerMsg.AutoSize = true; this.lblServerMsg.AutoSize = true;
...@@ -119,7 +152,7 @@ ...@@ -119,7 +152,7 @@
this.chbUseBuzzer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chbUseBuzzer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbUseBuzzer.AutoSize = true; 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.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbUseBuzzer.Location = new System.Drawing.Point(1132, 55); this.chbUseBuzzer.Location = new System.Drawing.Point(1132, 56);
this.chbUseBuzzer.Name = "chbUseBuzzer"; this.chbUseBuzzer.Name = "chbUseBuzzer";
this.chbUseBuzzer.Size = new System.Drawing.Size(98, 24); this.chbUseBuzzer.Size = new System.Drawing.Size(98, 24);
this.chbUseBuzzer.TabIndex = 195; this.chbUseBuzzer.TabIndex = 195;
...@@ -132,7 +165,7 @@ ...@@ -132,7 +165,7 @@
this.chkDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chkDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkDebug.AutoSize = true; 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.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chkDebug.Location = new System.Drawing.Point(1132, 97); this.chkDebug.Location = new System.Drawing.Point(1132, 99);
this.chkDebug.Name = "chkDebug"; this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(132, 24); this.chkDebug.Size = new System.Drawing.Size(132, 24);
this.chkDebug.TabIndex = 194; this.chkDebug.TabIndex = 194;
...@@ -158,7 +191,7 @@ ...@@ -158,7 +191,7 @@
this.btnCopyLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnCopyLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopyLog.BackColor = System.Drawing.Color.White; this.btnCopyLog.BackColor = System.Drawing.Color.White;
this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyLog.Location = new System.Drawing.Point(1132, 139); this.btnCopyLog.Location = new System.Drawing.Point(1145, 546);
this.btnCopyLog.Name = "btnCopyLog"; this.btnCopyLog.Name = "btnCopyLog";
this.btnCopyLog.Size = new System.Drawing.Size(105, 35); this.btnCopyLog.Size = new System.Drawing.Size(105, 35);
this.btnCopyLog.TabIndex = 191; this.btnCopyLog.TabIndex = 191;
...@@ -171,7 +204,7 @@ ...@@ -171,7 +204,7 @@
this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearLog.BackColor = System.Drawing.Color.White; this.btnClearLog.BackColor = System.Drawing.Color.White;
this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearLog.Location = new System.Drawing.Point(1132, 192); this.btnClearLog.Location = new System.Drawing.Point(1145, 599);
this.btnClearLog.Name = "btnClearLog"; this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(105, 35); this.btnClearLog.Size = new System.Drawing.Size(105, 35);
this.btnClearLog.TabIndex = 190; this.btnClearLog.TabIndex = 190;
...@@ -185,9 +218,9 @@ ...@@ -185,9 +218,9 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | 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.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(3, 3); this.logBox.Location = new System.Drawing.Point(3, 126);
this.logBox.Name = "logBox"; this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(1110, 635); this.logBox.Size = new System.Drawing.Size(1110, 512);
this.logBox.TabIndex = 106; this.logBox.TabIndex = 106;
this.logBox.Text = ""; this.logBox.Text = "";
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged); this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
...@@ -199,9 +232,9 @@ ...@@ -199,9 +232,9 @@
this.lblWarnMsg.BackColor = System.Drawing.Color.Transparent; this.lblWarnMsg.BackColor = System.Drawing.Color.Transparent;
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red; this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(526, 4); this.lblWarnMsg.Location = new System.Drawing.Point(511, 4);
this.lblWarnMsg.Name = "lblWarnMsg"; this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(775, 72); this.lblWarnMsg.Size = new System.Drawing.Size(790, 72);
this.lblWarnMsg.TabIndex = 96; this.lblWarnMsg.TabIndex = 96;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
...@@ -463,6 +496,8 @@ ...@@ -463,6 +496,8 @@
private System.Windows.Forms.Label lblServerMsg; private System.Windows.Forms.Label lblServerMsg;
private System.Windows.Forms.ToolStripMenuItem 扫码测试ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 扫码测试ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9; private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
private System.Windows.Forms.CheckBox chbSendShelfOut;
private System.Windows.Forms.ListView listView1;
} }
} }
...@@ -91,6 +91,118 @@ namespace OnlineStore.DUOStore ...@@ -91,6 +91,118 @@ namespace OnlineStore.DUOStore
tabPageList.Add(lineTabPage); tabPageList.Add(lineTabPage);
tabControl1.Controls.Add(lineTabPage); tabControl1.Controls.Add(lineTabPage);
} }
private void LoadListView()
{
this.listView1.Columns.Clear();
AddHealder("名称", 90);
AddHealder("启用", 50);
AddHealder("报警", 130);
AddHealder("状态", 110);
AddHealder("料盘信息", listView1.Size.Width - 110 - 130 - 50 - 90 - 10);
//AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8);
AddRow(store, true);
AddRow(store.BoxMap[1], store.BoxMap[1].IsDebug);
AddRow(store.BoxMap[2], store.BoxMap[2].IsDebug);
}
private void AddHealder(string name, int widht)
{
ColumnHeader preSendwire = new ColumnHeader();
preSendwire.Text = name; //设置列标题
preSendwire.Width = widht; //设置列宽度
preSendwire.TextAlign = HorizontalAlignment.Left; //设置列的对齐方式
this.listView1.Columns.Add(preSendwire); //将列头添加到ListView控件。
}
private void AddRow(EquipBase equip, bool isDebug)
{
ListViewItem lvi = new ListViewItem();
lvi.Text = equip.Name;
lvi.SubItems.Add(isDebug ? "✘" : "✔");
lvi.SubItems.Add(equip.alarmType.ToString());
lvi.SubItems.Add(equip.GetRunStr());
lvi.SubItems.Add("");
this.listView1.Items.Add(lvi);
}
private void UpdateListBox()
{
int item_debug_index = 1;
int item_alarm_index = 2;
int item_runStr_index = 3;
int item_move_info_index = 4;
int i = 0;
List<EquipBase> eqList = new List<EquipBase>(store.BoxMap.Values);
eqList.Insert(0, store);
foreach (EquipBase equip in store.BoxMap.Values)
{
if (i.Equals(0))
{
}
else
{
SetItemText(i, item_debug_index, equip.IsDebug ? "✘" : "✔");
}
SetItemText(i, item_alarm_index, equip.alarmType.ToString());
SetItemText(i, item_runStr_index, equip.GetRunStr());
StoreRunStatus s = equip.runStatus;
string trayInfo = "";
if (!equip.MoveInfo.MoveType.Equals(MoveType.None))
{
s = StoreRunStatus.Busy;
trayInfo = equip.MoveInfo.MoveParam.ToStr();
}
SetItemText(i, item_move_info_index, trayInfo);
SetItemColor(i, s, equip.alarmType);
i++;
}
}
private void SetItemColor(int i, StoreRunStatus runStatus, AlarmType alarmType)
{
if (runStatus.Equals(StoreRunStatus.Wait))
{
SetItemColor(i, Color.White);
//listView1.Items[i].BackColor = Color.White;
}
else if (alarmType.Equals(AlarmType.IoSingleTimeOut))
{
SetItemColor(i, Color.LightCoral);
}
else if (alarmType.Equals(AlarmType.None).Equals(false))
{
SetItemColor(i, Color.Red);
}
else if (runStatus.Equals(StoreRunStatus.HomeMoving) || runStatus.Equals(StoreRunStatus.Reset))
{
SetItemColor(i, Color.Orange);
}
else if (runStatus.Equals(StoreRunStatus.Busy))
{
SetItemColor(i, Color.LimeGreen);
}
else if (runStatus.Equals(StoreRunStatus.Runing))
{
SetItemColor(i, Color.LightBlue);
}
}
private void SetItemColor(int i, Color color)
{
if (!listView1.Items[i].BackColor.Equals(color))
{
listView1.Items[i].BackColor = color;
}
}
private void SetItemText(int rowIndex, int subIndex, string value)
{
if (this.listView1.Items[rowIndex].SubItems.Count > subIndex)
{
if (!this.listView1.Items[rowIndex].SubItems[subIndex].Text.Equals(value))
{
this.listView1.Items[rowIndex].SubItems[subIndex].Text = value;
}
}
}
/// <summary> /// <summary>
/// 隐藏窗口 /// 隐藏窗口
/// </summary> /// </summary>
...@@ -340,7 +452,6 @@ namespace OnlineStore.DUOStore ...@@ -340,7 +452,6 @@ namespace OnlineStore.DUOStore
{ {
return; return;
} }
lblServerMsg.Text = HttpHelper.LastServerMsg;
string msg = ""; string msg = "";
foreach(BoxBean box in StoreManager.Store.BoxMap.Values) foreach(BoxBean box in StoreManager.Store.BoxMap.Values)
......
...@@ -14,9 +14,6 @@ using System.Threading.Tasks; ...@@ -14,9 +14,6 @@ using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
/// <summary>
/// 流水线自动料仓-Box类
/// </summary>
public partial class BoxBean : EquipBase public partial class BoxBean : EquipBase
{ {
private bool IsIntSlvBlock = false; private bool IsIntSlvBlock = false;
...@@ -363,14 +360,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -363,14 +360,17 @@ namespace OnlineStore.DeviceLibrary
public override void StopMove() public override void StopMove()
{ {
IOMove(IO_Type.UpdownAxis_Break, IO_VALUE.LOW);
MoveInfo.EndMove(); MoveInfo.EndMove();
IOMove(IO_Type.UpdownAxis_Break, IO_VALUE.LOW); IOMove(IO_Type.UpdownAxis_Break, IO_VALUE.LOW);
//运动版停止 //运动版停止
ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue()); MiddleAxis.SuddenStop(true);
ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue()); UpdownAxis.SuddenStop(true);
ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue()); InoutAxis.SuddenStop(true);
ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue()); ComAxis.SuddenStop(true);
//ACServerManager.SuddenStop(Config.Middle_Axis.DeviceName, Config.Middle_Axis.GetAxisValue());
//ACServerManager.SuddenStop(Config.UpDown_Axis.DeviceName, Config.UpDown_Axis.GetAxisValue());
//ACServerManager.SuddenStop(Config.InOut_Axis.DeviceName, Config.InOut_Axis.GetAxisValue());
//ACServerManager.SuddenStop(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue());
CloseAllAxis(); CloseAllAxis();
LogInfo("StopMove"); LogInfo("StopMove");
isInPro = false; isInPro = false;
......
...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public ConcurrentQueue<InOutParam> waitOutStoreList = new ConcurrentQueue<InOutParam>(); public ConcurrentQueue<InOutParam> waitOutStoreList = new ConcurrentQueue<InOutParam>();
// public InOutParam waitOutStoreList = null; public InOutParam waitInStoreList = null;
#region 出入库结果验证 #region 出入库结果验证
private bool AcInPosition(ConfigMoveAxis axis,int p) private bool AcInPosition(ConfigMoveAxis axis,int p)
...@@ -42,7 +42,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -42,7 +42,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
///是否已经接收到过出库信息 ///是否已经接收到过出库信息
///</summary> ///</summary>
public bool IsReviceInPosId( string posId) public bool IsReviceInPosId(string posId)
{ {
bool isReviceInfo = false; bool isReviceInfo = false;
try try
...@@ -52,17 +52,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -52,17 +52,13 @@ namespace OnlineStore.DeviceLibrary
LogInfo(" IsReviceInPosId 正在入库中:" + MoveInfo.MoveParam.ToStr()); LogInfo(" IsReviceInPosId 正在入库中:" + MoveInfo.MoveParam.ToStr());
isReviceInfo = true; isReviceInfo = true;
} }
if (!isReviceInfo &&.Count > 0) if (!isReviceInfo && (waitInStoreList != null))
{ {
//foreach (InOutParam inout in waitOutStoreList) if (waitInStoreList.PosID.Equals(posId) && (!waitInStoreList.WareCode.Equals("")))
//{ {
// if (inout.PosID.Equals(posId) && (!inout.WareCode.Equals(""))) LogInfo(" IsReviceInPosId 已存在入库任务:" + waitInStoreList.ToStr());
// { isReviceInfo = true;
// LogInfo(" IsReviceInPosId 已存在入库任务:" + inout.ToStr()); }
// isReviceInfo = true;
// break;
// }
//}
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -77,7 +73,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,7 +73,7 @@ namespace OnlineStore.DeviceLibrary
private DateTime startInStoreTime = DateTime.Now; private DateTime startInStoreTime = DateTime.Now;
public override void StartInStoreMove(InOutParam param) public override bool StartInStoreMove(InOutParam param)
{ {
startInStoreTime = DateTime.Now; startInStoreTime = DateTime.Now;
string posId = param != null ? param.PosID : ""; string posId = param != null ? param.PosID : "";
...@@ -86,13 +82,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -86,13 +82,13 @@ namespace OnlineStore.DeviceLibrary
|| (!MoveInfo.MoveType.Equals(MoveType.None))) || (!MoveInfo.MoveType.Equals(MoveType.None)))
{ {
LogUtil.error(Name + " 启动出库出错,忙碌或报警中 ,storeStatus=" + runStatus + ",MoveType=" + MoveInfo.MoveType + ",isInSuddenDown=" + isInSuddenDown + ",isNoAirCheck" + isNoAirCheck); LogUtil.error(Name + " 启动出库出错,忙碌或报警中 ,storeStatus=" + runStatus + ",MoveType=" + MoveInfo.MoveType + ",isInSuddenDown=" + isInSuddenDown + ",isNoAirCheck" + isNoAirCheck);
return; return false ;
} }
if (!StoreManager.LoadInoutParam(param, MoveType.InStore, true, this)) if (!StoreManager.LoadInoutParam(param, MoveType.InStore, true, this))
{ {
LogUtil.error(Name + " 启动入库【" + param.ToStr() + "】出错,找不到库位信息"); LogUtil.error(Name + " 启动入库【" + param.ToStr() + "】出错,找不到库位信息");
return; return false ;
} }
LogInfo(" 启动入库【" + param.ToStr() + "】 "); LogInfo(" 启动入库【" + param.ToStr() + "】 ");
runStatus = StoreRunStatus.Busy; runStatus = StoreRunStatus.Busy;
...@@ -100,12 +96,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -100,12 +96,14 @@ namespace OnlineStore.DeviceLibrary
{ {
storeStatus = StoreStatus.InStoreExecute; storeStatus = StoreStatus.InStoreExecute;
} }
param.moveType = MoveType.InStore;
MoveInfo.NewMove(MoveType.InStore, param); MoveInfo.NewMove(MoveType.InStore, param);
//新的料架库位 //新的料架库位
MoveInfo.NextMoveStep(StoreMoveStep.SI_01_InoutToP1); MoveInfo.NextMoveStep(StoreMoveStep.SI_01_InoutToP1);
InOutStoreLog("启动入料: 进出轴返回P1"); InOutStoreLog("启动入料: 进出轴返回P1");
InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1_Speed); InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1_Speed);
return true;
} }
protected override void InStoreProcess() protected override void InStoreProcess()
...@@ -307,6 +305,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -307,6 +305,7 @@ namespace OnlineStore.DeviceLibrary
storeStatus = StoreStatus.OutStoreExecute; storeStatus = StoreStatus.OutStoreExecute;
runStatus = StoreRunStatus.Busy; runStatus = StoreRunStatus.Busy;
param.moveType = MoveType.OutStore;
MoveInfo.NewMove(MoveType.OutStore, param); MoveInfo.NewMove(MoveType.OutStore, param);
LogInfo("启动出库【" + param.ToStr() + "】 "); LogInfo("启动出库【" + param.ToStr() + "】 ");
//出库前shelfPosID需要固定,出库时根据rfid判断是否需要出入料架 //出库前shelfPosID需要固定,出库时根据rfid判断是否需要出入料架
......
...@@ -4,6 +4,7 @@ using OnlineStore.Common; ...@@ -4,6 +4,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
...@@ -22,12 +23,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -22,12 +23,14 @@ namespace OnlineStore.DeviceLibrary
public Store_Config Config { get; set; } public Store_Config Config { get; set; }
public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1); public bool UseBuzzer = ConfigAppSettings.GetIntValue(Setting_Init.UseBuzzer).Equals(1);
/// <summary> /// <summary>
/// 取料提升机构 /// 取料提升机构气缸
/// </summary> /// </summary>
public HoisterCylinder hoisterCylinder = new HoisterCylinder(0); public HoisterCylinder hoisterCylinder = new HoisterCylinder(0);
public AxisBean T1_BatchAxis = null; public AxisBean T1_BatchAxis = null;
public AxisBean T2_MiddleAxis = null; public AxisBean T2_MiddleAxis = null;
public AxisBean T3_UpdownAxis = null; public AxisBean T3_UpdownAxis = null;
#region 初始化 #region 初始化
internal bool canStart = false; internal bool canStart = false;
...@@ -290,6 +293,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -290,6 +293,13 @@ namespace OnlineStore.DeviceLibrary
equip.StopMove(); equip.StopMove();
} }
MoveInfo.EndMove(); MoveInfo.EndMove();
hoisterCylinder.Stop();
//轴运动停止
T3_UpdownAxis.SuddenStop(true);
T2_MiddleAxis.SuddenStop(true);
T1_BatchAxis.SuddenStop(true);
CloseAllAxis();
} }
...@@ -546,12 +556,60 @@ namespace OnlineStore.DeviceLibrary ...@@ -546,12 +556,60 @@ namespace OnlineStore.DeviceLibrary
CheckAxisAlarm(new AxisBean[] { T1_BatchAxis,T2_MiddleAxis,T3_UpdownAxis}); CheckAxisAlarm(new AxisBean[] { T1_BatchAxis,T2_MiddleAxis,T3_UpdownAxis});
ShowTimeLog("轴报警检测完成"); ShowTimeLog("轴报警检测完成");
} }
if (runStatus.Equals(StoreRunStatus.Runing) || runStatus.Equals(StoreRunStatus.Busy))
{
ShelfOutProcess();
}
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "定时处理出错" + ex.ToString()); LogUtil.error(Name + "定时处理出错" + ex.ToString());
} }
} }
private bool LowProcess=false;
private Stopwatch lowWatch = new Stopwatch();
private void ShelfOutProcess()
{
try
{
if (IOValue(IO_Type.Line_OutCheck).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.Line_BackRun).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.Line_Run).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.Line_BufferCheck).Equals(IO_VALUE.HIGH) &&
IOValue(IO_Type.Line_Stop3_Buffer).Equals(IO_VALUE.LOW) &&
IOValue(IO_Type.Line_Stop4_Out).Equals(IO_VALUE.LOW) &&
LowProcess.Equals(false))
{
if (StoreManager.checkWatch(lowWatch, 3000))
{
//左侧下层需要放个料架
Task.Factory.StartNew(delegate
{
LowProcess = true;
LogUtil.info(Name + "从料架堆积处放一个料架到后端");
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH, false, 30000);
IOMove(IO_Type.Line_Stop3_Buffer, IO_VALUE.HIGH, false, 2000);
if (WaitIo(IO_Type.Line_OutCheck, IO_VALUE.HIGH, 30000, "堆积处放料架到后端"))
{
LineStop();
}
LowProcess = false;
});
}
}
else
{
lowWatch.Stop();
}
}
catch (Exception ex)
{
LogUtil.error(Name + " ShelfOutProcess 出错:" + ex.ToString());
}
}
#endregion #endregion
public int GetShelfNum() public int GetShelfNum()
......
...@@ -13,6 +13,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,6 +13,25 @@ namespace OnlineStore.DeviceLibrary
partial class DUOStoreBean partial class DUOStoreBean
{ {
public int CurrShelfNum = 0;
/// <summary>
/// 料架类型,0=空料架,1=入库料架,2=出库料架
/// </summary>
public int CurrShelfType = 0;
/// <summary>
/// 更新料架信息
/// </summary>
/// <param name="num">料架编号</param>
/// <param name="type">料架类型,0=空料架,1=入库料架,2=出库料架</param>
private void UpdateShelfNum(int num,int type)
{
CurrShelfNum = num;
CurrShelfType = type;
ConfigAppSettings.SaveValue(Setting_Init.CurrShelfType, type);
ConfigAppSettings.SaveValue(Setting_Init.CurrShelfNum, num);
LogUtil.info(Name + "更新料架信息:【" + CurrShelfNum + "】【" + CurrShelfType + "】");
}
protected override bool CheckWaitResult(StoreMoveInfo moveInfo, WaitResultInfo wait) protected override bool CheckWaitResult(StoreMoveInfo moveInfo, WaitResultInfo wait)
{ {
if (wait.WaitType.Equals(WaitEnum.W008_BatchAxis)) if (wait.WaitType.Equals(WaitEnum.W008_BatchAxis))
...@@ -48,8 +67,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -48,8 +67,6 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
public int CurrShelfNum = 0;
#region 料架出料 #region 料架出料
public override bool StartOutStoreMove(InOutParam param) public override bool StartOutStoreMove(InOutParam param)
...@@ -74,7 +91,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -74,7 +91,7 @@ namespace OnlineStore.DeviceLibrary
private bool StartInStoreP() private bool StartInStoreP()
{ {
if (IOValue(IO_Type.Line_InCheck).Equals(IO_VALUE.HIGH) && (!InShelfInProcess)) if (IOValue(IO_Type.Line_InCheck).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW) && (!InShelfInProcess))
{ {
ShelfEnterProcess(); ShelfEnterProcess();
} }
...@@ -87,8 +104,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -87,8 +104,6 @@ namespace OnlineStore.DeviceLibrary
{ {
StartInStoreMove(null); StartInStoreMove(null);
} }
return false; return false;
} }
...@@ -100,14 +115,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -100,14 +115,11 @@ namespace OnlineStore.DeviceLibrary
InShelfInProcess = true; InShelfInProcess = true;
try try
{ {
if (IOValue(IO_Type.Line_InCheck).Equals(IO_VALUE.LOW))
{
InShelfInProcess = true; InShelfInProcess = true;
LineRun(null); LineRun(null);
//等待进料检测信号 //等待进料检测信号
bool result = WaitIo(IO_Type.Line_InCheck, IO_VALUE.LOW, 10000); bool result = WaitIo(IO_Type.Line_InCheck, IO_VALUE.LOW, 10000);
} }
}
catch (Exception ex) catch (Exception ex)
{ {
} }
...@@ -133,7 +145,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -133,7 +145,7 @@ namespace OnlineStore.DeviceLibrary
private void LI_04_LineStart() private void LI_04_LineStart()
{ {
CurrShelfNum = GetShelfNum(); UpdateShelfNum(GetShelfNum(), 1);
if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
{ {
LI_05_WaitTime(); LI_05_WaitTime();
...@@ -162,19 +174,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -162,19 +174,35 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public override void StartInStoreMove(InOutParam param) public override bool StartInStoreMove(InOutParam param)
{ {
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore);
MoveInfo.MoveParam = new InOutParam();
//判断是哪个工位有料架 //判断是哪个工位有料架
if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.Line_WorkCheck).Equals(IO_VALUE.HIGH))
{ {
if (CurrShelfNum < 0 || CurrShelfType.Equals(1))
{
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore,new InOutParam(MoveType.InStore));
LI_05_WaitTime(); LI_05_WaitTime();
return true;
} }
else else if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.HIGH))
{ {
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore, new InOutParam(MoveType.InStore));
//先将当前料架送出
LI_31_BatchAxisToP1();
}
}
else if (IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.HIGH))
{
runStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
MoveInfo.NewMove(MoveType.InStore, new InOutParam(MoveType.InStore));
if (T1_BatchAxis.IsInPosition(Config.BatchAxis_P1)) if (T1_BatchAxis.IsInPosition(Config.BatchAxis_P1))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_02_HoisterBack); MoveInfo.NextMoveStep(StoreMoveStep.LI_02_HoisterBack);
...@@ -187,7 +215,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -187,7 +215,9 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog("检测到料架,提升轴先返回P1"); InOutStoreLog("检测到料架,提升轴先返回P1");
T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P1Speed); T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P1Speed);
} }
return true;
} }
return false ;
} }
...@@ -242,7 +272,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -242,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_08_AxisUpToP2)) else if (MoveInfo.IsStep(StoreMoveStep.LI_08_AxisUpToP2))
{ {
LI_09_ScanCode(); CheckHasTray();
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_09_ScanCode)) else if (MoveInfo.IsStep(StoreMoveStep.LI_09_ScanCode))
{ {
...@@ -302,13 +332,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -302,13 +332,24 @@ namespace OnlineStore.DeviceLibrary
{ {
if (LastPosParam.InStoreNg) if (LastPosParam.InStoreNg)
{ {
int box = GetInstoreNgBox();
LastPosParam.TargetBox = box;
}
else
{
int storeId = LastPosParam.GetStoreId();
if (storeId.Equals(1))
{
LastPosParam.TargetBox = 1;
}
else
{
LastPosParam.TargetBox = 2;
} }
MoveInfo.NextMoveStep(StoreMoveStep.LI_19_ToBoxDoor); }
MoveInfo.NextMoveStep(StoreMoveStep.LI_21_WaitToBox);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
InOutStoreLog("料盘移栽:获取库位号完成,升降轴到料门口高点,旋转轴到料仓门口"); InOutStoreLog("料盘移栽:" + LastPosParam.ToStr() + " 等待料仓门口无信号");
T3_UpdownAxis.AbsMove(Config.updo)
ClearTimeoutAlarm("获取库位号超时"); ClearTimeoutAlarm("获取库位号超时");
} }
else if (MoveInfo.IsTimeOut(120)) else if (MoveInfo.IsTimeOut(120))
...@@ -317,46 +358,175 @@ namespace OnlineStore.DeviceLibrary ...@@ -317,46 +358,175 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(WarnMsg, ID * 1000 + 30); LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
} }
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_19_ToBoxDoor)) else if (MoveInfo.IsStep(StoreMoveStep.LI_21_WaitToBox))
{
int storeId = LastPosParam.GetStoreId();
if (IOManager.IOValue(IO_Type.InDoor_Check, storeId).Equals(IO_VALUE.LOW))
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_22_ToBoxDoor);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
//判断是左侧还是右侧
if (LastPosParam.TargetBox.Equals(1))
{
InOutStoreLog("料盘移栽:获取库位号完成, BOX " + storeId + " 升降轴到料门口高点[" + Config.UpdownAxis_P4 + "],旋转轴到料仓门口 [" + Config.MiddleAxis_P2 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P2, Config.MiddleAxis_P2Speed);
}
else
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_20_UpdownDown); InOutStoreLog("料盘移栽:获取库位号完成, BOX " + storeId + " 升降轴到料门口高点[" + Config.UpdownAxis_P6 + "],旋转轴到料仓门口 [" + Config.MiddleAxis_P3 + "]");
InOutStoreLog("料盘移栽: 升降轴到料门口低点,开始预扫码"); T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P6, Config.UpdownAxis_P6Speed);
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P3, Config.MiddleAxis_P3Speed);
}
ClearTimeoutAlarm("入料口无料盘");
}
else if (MoveInfo.IsTimeOut(120))
{
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待BOX_" + storeId + " 入料口无料盘 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, ID * 1000 + 30);
Alarm(AlarmType.IoSingleTimeOut);
}
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_22_ToBoxDoor))
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_23_UpdownDown);
YuScanCode();
if (LastPosParam.TargetBox.Equals(1))
{
InOutStoreLog("料盘移栽: 升降轴到料门口低点[" + Config.UpdownAxis_P3 + "],开始预扫码");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P3, Config.UpdownAxis_P3Speed);
}
else
{
InOutStoreLog("料盘移栽: 升降轴到料门口低点[" + Config.UpdownAxis_P5 + "],开始预扫码");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P5, Config.UpdownAxis_P5Speed);
}
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_20_UpdownDown)) else if (MoveInfo.IsStep(StoreMoveStep.LI_23_UpdownDown))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_21_CylinderRelax); MoveInfo.NextMoveStep(StoreMoveStep.LI_24_CylinderRelax);
InOutStoreLog("料盘移栽: 上料气缸放松"); InOutStoreLog("料盘移栽: 上料气缸放松");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Clamp, IO_Type.ClampCylinder_Relax);
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_21_CylinderRelax)) else if (MoveInfo.IsStep(StoreMoveStep.LI_24_CylinderRelax))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_22_UpdownUp); MoveInfo.NextMoveStep(StoreMoveStep.LI_25_UpdownUp);
InOutStoreLog("料盘移栽: 升降轴到料门口高点"); if (LastPosParam.TargetBox.Equals(1))
{
InOutStoreLog("料盘移栽: 升降轴到料门口高点[" + Config.UpdownAxis_P4 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P4, Config.UpdownAxis_P4Speed);
}
else
{
InOutStoreLog("料盘移栽: 升降轴到料门口高点[" + Config.UpdownAxis_P6 + "]");
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P6, Config.UpdownAxis_P6Speed);
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_22_UpdownUp)) }
else if (MoveInfo.IsStep(StoreMoveStep.LI_25_UpdownUp))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_23_AxisToWait); MoveInfo.NextMoveStep(StoreMoveStep.LI_26_AxisToWait);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
InOutStoreLog("料盘移栽:旋转轴返回待机点P1,升降轴到料串高点P2"); InOutStoreLog("料盘移栽:旋转轴返回待机点P1,升降轴到料串高点P2");
T2_MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P1, Config.MiddleAxis_P1Speed);
T3_UpdownAxis.AbsMove(MoveInfo, Config.UpdownAxis_P2, Config.UpdownAxis_P2Speed);
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_26_AxisToWait))
{
CheckHasTray();
}
#region 送出料架处理
else if (MoveInfo.IsStep(StoreMoveStep.LI_31_BatchAxisToP1))
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_32_HoisterBack);
InOutStoreLog("送出料架:升降盘定位气缸后退");
hoisterCylinder.StartBack(MoveInfo);
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_23_AxisToWait)) else if (MoveInfo.IsStep(StoreMoveStep.LI_32_HoisterBack))
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_33_TopCylinderDown);
InOutStoreLog("送出料架:顶升气缸下降");
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Up);
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_33_TopCylinderDown))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_24_ToNexTray);
InOutStoreLog("料盘移栽:判断是否还有料");
//判断是否需要送出料架,如果入口和等待区无料架,暂不送出
if (IOValue(IO_Type.Line_InCheck).Equals(IO_VALUE.LOW) && IOValue(IO_Type.Line_WaitCheck).Equals(IO_VALUE.LOW))
{
InOutStoreLog("送出料架:入口和等待区暂无料架,不需要送出料架");
MoveEndP();
} }
else if (MoveInfo.IsStep(StoreMoveStep.LI_24_ToNexTray)) else
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_06_TopUp); MoveInfo.NextMoveStep(StoreMoveStep.LI_34_WorkStopDown);
InOutStoreLog("入料检测: 顶升气缸上升"); InOutStoreLog("送出料架:上料阻挡下降1秒,流水线开始转动");
UpdateShelfNum(-1, -1);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
LineRun(MoveInfo);
IOMove(IO_Type.Line_Stop2_Work, IO_VALUE.HIGH, false, 1500);
}
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_34_WorkStopDown))
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_35_WaitShelfGo);
InOutStoreLog("送出料架:等待上料无料架");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Line_WaitCheck, IO_VALUE.LOW));
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_35_WaitShelfGo))
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_36_LineRun);
InOutStoreLog("送出料架:流水线再转动3秒");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
LineRun(MoveInfo);
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_36_LineRun))
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_37_LineStop);
InOutStoreLog("送出料架:流水线停止转动");
LineStop(MoveInfo);
}
else if (MoveInfo.IsStep(StoreMoveStep.LI_37_LineStop))
{
LineStop(MoveInfo);
MoveEndP();
}
#endregion
}
private int GetInstoreNgBox()
{
//空闲且门口无料盘
foreach(BoxBean box in BoxMap.Values)
{
if (box.MoveInfo.MoveType.Equals(MoveType.None) && IOManager.IOValue(IO_Type.InDoor_Check, box.ID).Equals(IO_VALUE.LOW))
{
return box.ID;
}
} }
//忙碌且目标是出料口
foreach (BoxBean box in BoxMap.Values)
{
if (box.MoveInfo.MoveType.Equals(MoveType.None))
{
if (IOManager.IOValue(IO_Type.InDoor_Check, box.ID).Equals(IO_VALUE.LOW))
{
return box.ID;
}
}
else if (box.MoveInfo.MoveParam.TargetPosition.Equals(1))
{
return box.ID;
}
}
return 1;
} }
protected void ClearTimeoutAlarm(string msg) protected void ClearTimeoutAlarm(string msg)
{ {
if (isInSuddenDown || isNoAirCheck) if (isInSuddenDown || isNoAirCheck)
...@@ -393,18 +563,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -393,18 +563,18 @@ namespace OnlineStore.DeviceLibrary
GetPosResult result = StoreManager.GetPosId(Name, LastCodeList, LastHeight, LastWidth, CurrShelfNum); GetPosResult result = StoreManager.GetPosId(Name, LastCodeList, LastHeight, LastWidth, CurrShelfNum);
if (result.IsTimeOut) if (result.IsTimeOut)
{ {
LogUtil.error(Name + "【" + code + "】第[" + count + "]次 FI_23_GetPosID 超时,等待1s后重新获取"); LogUtil.error(Name + "【" + code + "】第[" + count + "]次 LI_18_GetPosID 超时,等待1s后重新获取");
Thread.Sleep(1000); Thread.Sleep(1000);
} }
else if (result.Result.Equals(99) || result.Result.Equals(100)) else if (result.Result.Equals(99) || result.Result.Equals(100))
{ {
LogUtil.error(Name + "【" + code + "】第[" + count + "]次 FI_23_GetPosID 结果【" + result.Result + "】,等待3s后重新获取"); LogUtil.error(Name + "【" + code + "】第[" + count + "]次 LI_18_GetPosID 结果【" + result.Result + "】,等待3s后重新获取");
Thread.Sleep(3000); Thread.Sleep(3000);
} }
else if (!result.Msg.Equals("")) else if (!result.Msg.Equals(""))
{ {
LastPosParam = result.Param; LastPosParam = result.Param;
LogUtil.error(Name + "【" + code + "】第[" + count + "]次 FI_23_GetPosID 入库NG:" + result.Msg); LogUtil.error(Name + "【" + code + "】第[" + count + "]次 LI_18_GetPosID 入库NG:" + result.Msg);
break; break;
} }
else else
...@@ -421,6 +591,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -421,6 +591,8 @@ namespace OnlineStore.DeviceLibrary
} }
}); });
MoveInfo.MoveParam = LastPosParam;
} }
private void LI_11_AxisToTray() private void LI_11_AxisToTray()
...@@ -532,7 +704,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -532,7 +704,7 @@ namespace OnlineStore.DeviceLibrary
if (chaz > T1_BatchAxis.Config.CanErrorCountMax) if (chaz > T1_BatchAxis.Config.CanErrorCountMax)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.LI_08_AxisUpToP2); MoveInfo.NextMoveStep(StoreMoveStep.LI_08_AxisUpToP2);
InOutStoreLog(" CheckHasTray:上料轴开始慢速上升到P3点,等待检测到料盘"); InOutStoreLog(" CheckHasTray:上料轴开始慢速上升到P2点,等待检测到料盘");
ShelfNoTray = false; ShelfNoTray = false;
BatchAxisToP2(false); BatchAxisToP2(false);
return; return;
...@@ -540,14 +712,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -540,14 +712,18 @@ namespace OnlineStore.DeviceLibrary
} }
//无料盘 //无料盘
ShelfNoTray = true; ShelfNoTray = true;
LI_31_BatchAxisToP1();
}
}
private void LI_31_BatchAxisToP1()
{
MoveInfo.NextMoveStep(StoreMoveStep.LI_31_BatchAxisToP1); MoveInfo.NextMoveStep(StoreMoveStep.LI_31_BatchAxisToP1);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
InOutStoreLog("料盘移栽" + MoveInfo.SLog + ":未检测到料盘,提升伺服到P1点"); InOutStoreLog("料盘移栽" + MoveInfo.SLog + ":未检测到料盘,提升伺服到P1点 ");
UpdateShelfNum(CurrShelfNum, 0);
T1_BatchAxis.SuddenStop(); T1_BatchAxis.SuddenStop();
T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P2Speed); T1_BatchAxis.AbsMove(MoveInfo, Config.BatchAxis_P1, Config.BatchAxis_P2Speed);
} }
}
private void BatchAxisToP2(bool isFirstMove = true) private void BatchAxisToP2(bool isFirstMove = true)
{ {
int targetP2 = Config.BatchAxis_P2; int targetP2 = Config.BatchAxis_P2;
......
...@@ -3,6 +3,7 @@ using OnlineStore.Common; ...@@ -3,6 +3,7 @@ using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Ports; using System.IO.Ports;
using System.Linq; using System.Linq;
...@@ -209,13 +210,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -209,13 +210,13 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库"); LogUtil.error(box.Name + "GetPositon[" + param.PosID + "]=null,没有库位不能执行出入库");
return false; return false;
} }
if (String.IsNullOrEmpty(param.PlateH)) if (param.PlateH<=0)
{ {
param.PlateH = position.BagHigh.ToString(); param.PlateH = position.BagHigh;
} }
if (string.IsNullOrEmpty(param.PlateW)) if (param.PlateW<=0)
{ {
param.PlateW = position.BagWidth.ToString(); param.PlateW = position.BagWidth;
} }
p.ComPress_P2 = box.Config.GetComP2(position.BagHigh); p.ComPress_P2 = box.Config.GetComP2(position.BagHigh);
p.ComPress_P3 = box.Config.CompAxis_P3; p.ComPress_P3 = box.Config.CompAxis_P3;
...@@ -374,14 +375,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -374,14 +375,14 @@ namespace OnlineStore.DeviceLibrary
{ {
result.Msg = deviceName + " 【" + codeStr + "】结果:没有收到服务器反馈,调用 cancelPutInTask "; result.Msg = deviceName + " 【" + codeStr + "】结果:没有收到服务器反馈,调用 cancelPutInTask ";
cancelPutInTask(deviceName, codeStr); cancelPutInTask(deviceName, codeStr);
result.Param = new InOutParam( codeStr, "", width,height,1, shelfNum, true, "没有收到服务器反馈"); result.Param = new InOutParam( MoveType.InStore, codeStr, "", width,height,1, shelfNum, true, "没有收到服务器反馈");
return result; return result;
} }
else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false)) else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false))
{ {
result.Result = serverResult.result; result.Result = serverResult.result;
result.Msg = deviceName + " 【" + codeStr + "】结果:" + serverResult.msg; result.Msg = deviceName + " 【" + codeStr + "】结果:" + serverResult.msg;
result.Param = new InOutParam(codeStr, "", width, height, 1, shelfNum, true, serverResult.msg); result.Param = new InOutParam(MoveType.InStore, codeStr, "", width, height, 1, shelfNum, true, serverResult.msg);
return result; return result;
} }
...@@ -392,7 +393,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -392,7 +393,7 @@ namespace OnlineStore.DeviceLibrary
//根据库位号查找移栽 //根据库位号查找移栽
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败 // 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
result.Param = new InOutParam( serverResult.barcode, posId, width, height,0, shelfNum, false,""); result.Param = new InOutParam(MoveType.InStore, serverResult.barcode, posId, width, height,0, shelfNum, false,"");
int storeId = result.Param.GetStoreId(); int storeId = result.Param.GetStoreId();
if (Store.BoxMap.ContainsKey(storeId)) if (Store.BoxMap.ContainsKey(storeId))
{ {
...@@ -401,16 +402,24 @@ namespace OnlineStore.DeviceLibrary ...@@ -401,16 +402,24 @@ namespace OnlineStore.DeviceLibrary
{ {
result.Param.InStoreNg = true; result.Param.InStoreNg = true;
result.Param.NgMsg = "入库库位重复"; result.Param.NgMsg = "入库库位重复";
result.Msg = deviceName + ("收到服务器入库命令 " + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!"); result.Msg = deviceName + ("收到入库命令:" + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!");
return result; return result;
} }
LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " "); LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " ");
if (!box.StartInStoreMove(result.Param))
{
if (box.waitInStoreList == null)
{
result.Msg = deviceName + ("收到入库命令:" + "启动入库失败,缓存到waitInStoreList等待稍后入库: " + result.Param.ToStr() + " ");
box.waitInStoreList = result.Param;
}
}
} }
else else
{ {
result.Param.InStoreNg = true; result.Param.InStoreNg = true;
result.Param.NgMsg = "未找到料仓[" + storeId + "]"; result.Param.NgMsg = "未找到料仓[" + storeId + "]";
result.Msg = deviceName + ("收到服务器入库命令 " + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!"); result.Msg = deviceName + ("收到入库命令:" + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!");
return result; return result;
} }
} }
...@@ -421,34 +430,51 @@ namespace OnlineStore.DeviceLibrary ...@@ -421,34 +430,51 @@ namespace OnlineStore.DeviceLibrary
} }
return result; return result;
} }
public static void SendPosToStoreCheck(string deviceName, InOutParam param) //public static void SendPosToStoreCheck(string deviceName, InOutParam param)
{ //{
if (param == null || param.InStoreNg) // if (param == null || param.InStoreNg)
{ // {
return; // return;
} // }
int storeId = param.GetStoreId(); // int storeId = param.GetStoreId();
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId]; // BoxBean moveEquip = Store.BoxMap[storeId];
if (LineServer.BoxCanInStore(moveEquip.DeviceID)) // if (LineServer.BoxCanInStore(moveEquip.DeviceID))
{ // {
LineServer.CheckInStorePos(storeId, param); // LineServer.CheckInStorePos(storeId, param);
// }
// else
// {
// //等待3秒后重发验证
// Task.Factory.StartNew(delegate
// {
// LogUtil.error(deviceName + "[" + moveEquip.Name + " ]入库命令: " + param.ToStr() + " 给料仓发送验证失败,等待3秒后重发 ");
// Thread.Sleep(3000);
// LineServer.CheckInStorePos(storeId, param);
// });
// }
// lock (moveEquip.waitInListLock)
// {
// //如果当前正在出入库中,需要记录下来,等待空闲时执行
// LogUtil.info(deviceName + "[" + moveEquip.Name + " ]入库命令: " + param.ToStr() + "加入等待列表中!");
// moveEquip.waitInStoreList.Add(param);
// }
//}
public static bool checkWatch(Stopwatch watch, int targetMs, bool isStop = true)
{
if (!watch.IsRunning)
{
watch.Restart();
return false;
} }
else else if (watch.ElapsedMilliseconds >= targetMs)
{ {
//等待3秒后重发验证 if (isStop)
Task.Factory.StartNew(delegate
{ {
LogUtil.error(deviceName + "[" + moveEquip.Name + " ]入库命令: " + param.ToStr() + " 给料仓发送验证失败,等待3秒后重发 "); watch.Stop();
Thread.Sleep(3000);
LineServer.CheckInStorePos(storeId, param);
});
} }
lock (moveEquip.waitInListLock) return true;
{
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(deviceName + "[" + moveEquip.Name + " ]入库命令: " + param.ToStr() + "加入等待列表中!");
moveEquip.waitInStoreList.Add(param);
} }
return false;
} }
} }
public class GetPosResult public class GetPosResult
......
...@@ -75,7 +75,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -75,7 +75,7 @@ namespace OnlineStore.DeviceLibrary
positionIndex = newIndex; positionIndex = newIndex;
string posid = boxBean.PositionNumList[positionIndex]; string posid = boxBean.PositionNumList[positionIndex];
InOutParam param = new InOutParam("AutoOut", posid); InOutParam param = new InOutParam(MoveType.OutStore, "AutoOut", posid);
//param.NeedOutShelf = false; //param.NeedOutShelf = false;
//param.NeedEnterShelf = false; //param.NeedEnterShelf = false;
//判断是否需要重置 //判断是否需要重置
...@@ -114,7 +114,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -114,7 +114,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
string posid = boxBean.PositionNumList[newIndex]; string posid = boxBean.PositionNumList[newIndex];
InOutParam param = new InOutParam("AutoIn", posid); InOutParam param = new InOutParam(MoveType.InStore, "AutoIn", posid);
// param.NeedOutShelf = false; // param.NeedOutShelf = false;
//判断是否需要重置 //判断是否需要重置
if (CurrInOutACount >= StoreManager.Config.Box_ResetACount) if (CurrInOutACount >= StoreManager.Config.Box_ResetACount)
......
...@@ -12,7 +12,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -12,7 +12,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public class InOutParam public class InOutParam
{ {
public InOutParam(string wareNo = "", string posId = "", int platew = 0, int plateh = 0, int targetP = 0,int shefNum,bool IsNg=false,string ngMsg="" ) public InOutParam(MoveType type, string wareNo = "", string posId = "", int platew = 0, int plateh = 0, int targetP = 0, int shefNum=0, bool IsNg = false, string ngMsg = "")
{ {
WareCode = wareNo; WareCode = wareNo;
PosID = posId; PosID = posId;
...@@ -23,20 +23,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,20 +23,19 @@ namespace OnlineStore.DeviceLibrary
this.shelfNum = shefNum; this.shelfNum = shefNum;
this.InStoreNg = IsNg; this.InStoreNg = IsNg;
this.NgMsg = ngMsg; this.NgMsg = ngMsg;
this.moveType = type;
} }
public InOutParam(string wareNo, string posId, LineMoveP linePosition, int targetP = 0) public InOutParam(MoveType type, string wareNo, string posId, LineMoveP linePosition, int targetP = 0)
{ {
WareCode = wareNo; WareCode = wareNo;
PosID = posId; PosID = posId;
MoveP = linePosition; MoveP = linePosition;
this.TargetPosition = targetP; this.TargetPosition = targetP;
this.moveType = type;
}
public InOutParam NewParam()
{
InOutParam newp = new InOutParam(WareCode, PosID, PlateW, PlateH);
return newp;
} }
public MoveType moveType = MoveType.None;
/// <summary> /// <summary>
/// 物品二维码信息 /// 物品二维码信息
/// </summary> /// </summary>
...@@ -76,6 +75,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -76,6 +75,12 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public int TargetPosition = 0; public int TargetPosition = 0;
/// <summary>
/// 目标料仓,1=左侧,2=右侧
/// </summary>
public int TargetBox = 0;
/// <summary> /// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1 /// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary> /// </summary>
...@@ -109,7 +114,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -109,7 +114,21 @@ namespace OnlineStore.DeviceLibrary
} }
public string ToStr() public string ToStr()
{ {
return " 库位 [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] "; if (InStoreNg)
{
return " 入库失败[BOX_" + TargetBox + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] ";
}
else
{
if (moveType.Equals(MoveType.InStore))
{
return " 入库 [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] ";
}
else
{
return " 出库 [" + PosID + "] [" + WareCode + "], [" + PlateW + "x" + PlateH + "] ";
}
}
} }
......
...@@ -251,7 +251,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -251,7 +251,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始入库移动移动 /// 开始入库移动移动
/// </summary> /// </summary>
public abstract void StartInStoreMove(InOutParam param); public abstract bool StartInStoreMove(InOutParam param);
protected abstract void InStoreProcess(); protected abstract void InStoreProcess();
#endregion #endregion
......
...@@ -406,31 +406,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -406,31 +406,32 @@ namespace OnlineStore.DeviceLibrary
LI_18_GetPosID, LI_18_GetPosID,
/// <summary> /// <summary>
/// 料盘移栽:等待料仓门口无料盘信号
/// </summary>
LI_21_WaitToBox,
/// <summary>
/// 料盘移栽:获取库位号完成,升降轴到料门口高点,旋转轴到料仓门口 /// 料盘移栽:获取库位号完成,升降轴到料门口高点,旋转轴到料仓门口
/// </summary> /// </summary>
LI_19_ToBoxDoor, LI_22_ToBoxDoor,
/// <summary> /// <summary>
/// 料盘移栽: 升降轴到料门口低点,开始预扫码 /// 料盘移栽: 升降轴到料门口低点,开始预扫码
/// </summary> /// </summary>
LI_20_UpdownDown, LI_23_UpdownDown,
/// <summary> /// <summary>
/// 料盘移栽: 上料气缸放松 /// 料盘移栽: 上料气缸放松
/// </summary> /// </summary>
LI_21_CylinderRelax, LI_24_CylinderRelax,
/// <summary> /// <summary>
/// 料盘移栽: 升降轴到料门口高点 /// 料盘移栽: 升降轴到料门口高点
/// </summary> /// </summary>
LI_22_UpdownUp, LI_25_UpdownUp,
/// <summary> /// <summary>
/// 料盘移栽:旋转轴返回待机点P1,升降轴到料串高点P2 /// 料盘移栽:旋转轴返回待机点P1,升降轴到料串高点P2
/// </summary> /// </summary>
LI_23_AxisToWait, LI_26_AxisToWait,
/// <summary>
/// 料盘移栽:判断是否还有料
/// </summary>
LI_24_ToNexTray,
...@@ -460,6 +461,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -460,6 +461,11 @@ namespace OnlineStore.DeviceLibrary
///送出料架, 流水线再转动3秒, ///送出料架, 流水线再转动3秒,
/// </summary> /// </summary>
LI_36_LineRun, LI_36_LineRun,
/// <summary>
///送出料架, 流水线停止转动,
/// </summary>
LI_37_LineStop,
#endregion #endregion
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!