Commit 67ccc046 LN

1

1 个父辈 0bcf605c
......@@ -94,6 +94,7 @@
this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.lblName = new System.Windows.Forms.Label();
this.btnScan = new System.Windows.Forms.Button();
this.lblwidth = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -581,7 +582,7 @@
this.lblThisSta.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblThisSta.ForeColor = System.Drawing.Color.Red;
this.lblThisSta.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblThisSta.Location = new System.Drawing.Point(406, 65);
this.lblThisSta.Location = new System.Drawing.Point(406, 110);
this.lblThisSta.Name = "lblThisSta";
this.lblThisSta.Size = new System.Drawing.Size(720, 109);
this.lblThisSta.TabIndex = 246;
......@@ -696,6 +697,7 @@
this.groupBox6.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.groupBox6.Controls.Add(this.lblwidth);
this.groupBox6.Controls.Add(this.lblMoveInfo);
this.groupBox6.Controls.Add(this.lblAgvInfo);
this.groupBox6.Controls.Add(this.lblInstoreList);
......@@ -736,7 +738,7 @@
this.lblInstoreList.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblInstoreList.ForeColor = System.Drawing.Color.Green;
this.lblInstoreList.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblInstoreList.Location = new System.Drawing.Point(406, 175);
this.lblInstoreList.Location = new System.Drawing.Point(406, 220);
this.lblInstoreList.Name = "lblInstoreList";
this.lblInstoreList.Size = new System.Drawing.Size(720, 109);
this.lblInstoreList.TabIndex = 277;
......@@ -1150,6 +1152,17 @@
this.btnScan.UseVisualStyleBackColor = false;
this.btnScan.Click += new System.EventHandler(this.btnScan_Click);
//
// lblwidth
//
this.lblwidth.AutoSize = true;
this.lblwidth.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblwidth.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblwidth.Location = new System.Drawing.Point(248, 78);
this.lblwidth.Name = "lblwidth";
this.lblwidth.Size = new System.Drawing.Size(92, 17);
this.lblwidth.TabIndex = 279;
this.lblwidth.Text = "当前料盘宽度:";
//
// FrmFeedingEquip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -1267,6 +1280,7 @@
private System.Windows.Forms.CheckBox chbMoveStop;
private System.Windows.Forms.Button btnOLine;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Label lblwidth;
}
}
......@@ -133,6 +133,7 @@ namespace OnlineStore.AssemblyLine
lblInstoreList.Text = text;
}
lblMoveInfo.Text = equipBean.GetMoveStr();
lblwidth.Text = " ";
}
catch (Exception ex)
{
......
......@@ -33,20 +33,21 @@
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.lblMoveInfo = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.lblCID = new System.Windows.Forms.Label();
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.btnUpdateStatus = new System.Windows.Forms.Button();
this.chkDebug = new System.Windows.Forms.CheckBox();
this.btnClearLog = new System.Windows.Forms.Button();
this.btnCopyLog = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblPosId = new System.Windows.Forms.Label();
this.btnUpdateStatus = new System.Windows.Forms.Button();
this.txtPosId = new System.Windows.Forms.TextBox();
this.cmbBoxIndex = new System.Windows.Forms.ComboBox();
this.btnInStoreTset = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.lblCID = new System.Windows.Forms.Label();
this.chkDebug = new System.Windows.Forms.CheckBox();
this.listView1 = new System.Windows.Forms.ListView();
this.btnCopyLog = new System.Windows.Forms.Button();
this.btnClearLog = new System.Windows.Forms.Button();
this.logBox = new System.Windows.Forms.RichTextBox();
this.lblStatus = new System.Windows.Forms.Label();
this.lblWarnMsg = new System.Windows.Forms.Label();
......@@ -78,13 +79,13 @@
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnTrayInfo = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
......@@ -128,6 +129,33 @@
this.lblMoveInfo.TabIndex = 196;
this.lblMoveInfo.Text = "CID";
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.btnTrayInfo);
this.groupBox2.Controls.Add(this.lblCID);
this.groupBox2.Controls.Add(this.chbAutoRun);
this.groupBox2.Controls.Add(this.chkDebug);
this.groupBox2.Controls.Add(this.btnClearLog);
this.groupBox2.Controls.Add(this.btnCopyLog);
this.groupBox2.Location = new System.Drawing.Point(460, 4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(860, 75);
this.groupBox2.TabIndex = 196;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "状态信息";
//
// lblCID
//
this.lblCID.AutoSize = true;
this.lblCID.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCID.Location = new System.Drawing.Point(19, 34);
this.lblCID.Name = "lblCID";
this.lblCID.Size = new System.Drawing.Size(33, 20);
this.lblCID.TabIndex = 95;
this.lblCID.Text = "CID";
//
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
......@@ -140,18 +168,43 @@
this.chbAutoRun.UseVisualStyleBackColor = true;
this.chbAutoRun.CheckedChanged += new System.EventHandler(this.chbAutoRun_CheckedChanged);
//
// btnUpdateStatus
// chkDebug
//
this.btnUpdateStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnUpdateStatus.BackColor = System.Drawing.Color.White;
this.btnUpdateStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdateStatus.Location = new System.Drawing.Point(629, 28);
this.btnUpdateStatus.Name = "btnUpdateStatus";
this.btnUpdateStatus.Size = new System.Drawing.Size(222, 35);
this.btnUpdateStatus.TabIndex = 195;
this.btnUpdateStatus.Text = "更改为调试状态";
this.btnUpdateStatus.UseVisualStyleBackColor = false;
this.btnUpdateStatus.Click += new System.EventHandler(this.btnUpdateStatus_Click);
this.chkDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
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(755, 32);
this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(76, 24);
this.chkDebug.TabIndex = 194;
this.chkDebug.Text = "DEBUG";
this.chkDebug.UseVisualStyleBackColor = true;
//
// btnClearLog
//
this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearLog.BackColor = System.Drawing.Color.White;
this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearLog.Location = new System.Drawing.Point(635, 27);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(105, 35);
this.btnClearLog.TabIndex = 190;
this.btnClearLog.Text = "清空日志";
this.btnClearLog.UseVisualStyleBackColor = false;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
// btnCopyLog
//
this.btnCopyLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopyLog.BackColor = System.Drawing.Color.White;
this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyLog.Location = new System.Drawing.Point(515, 27);
this.btnCopyLog.Name = "btnCopyLog";
this.btnCopyLog.Size = new System.Drawing.Size(105, 35);
this.btnCopyLog.TabIndex = 191;
this.btnCopyLog.Text = "复制日志";
this.btnCopyLog.UseVisualStyleBackColor = false;
this.btnCopyLog.Click += new System.EventHandler(this.btnCopyLog_Click);
//
// groupBox1
//
......@@ -180,6 +233,19 @@
this.lblPosId.TabIndex = 197;
this.lblPosId.Text = "库位:";
//
// btnUpdateStatus
//
this.btnUpdateStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnUpdateStatus.BackColor = System.Drawing.Color.White;
this.btnUpdateStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdateStatus.Location = new System.Drawing.Point(629, 28);
this.btnUpdateStatus.Name = "btnUpdateStatus";
this.btnUpdateStatus.Size = new System.Drawing.Size(222, 35);
this.btnUpdateStatus.TabIndex = 195;
this.btnUpdateStatus.Text = "更改为调试状态";
this.btnUpdateStatus.UseVisualStyleBackColor = false;
this.btnUpdateStatus.Click += new System.EventHandler(this.btnUpdateStatus_Click);
//
// txtPosId
//
this.txtPosId.Location = new System.Drawing.Point(426, 32);
......@@ -232,28 +298,6 @@
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// lblCID
//
this.lblCID.AutoSize = true;
this.lblCID.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblCID.Location = new System.Drawing.Point(19, 34);
this.lblCID.Name = "lblCID";
this.lblCID.Size = new System.Drawing.Size(33, 20);
this.lblCID.TabIndex = 95;
this.lblCID.Text = "CID";
//
// chkDebug
//
this.chkDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
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(755, 32);
this.chkDebug.Name = "chkDebug";
this.chkDebug.Size = new System.Drawing.Size(76, 24);
this.chkDebug.TabIndex = 194;
this.chkDebug.Text = "DEBUG";
this.chkDebug.UseVisualStyleBackColor = true;
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
......@@ -271,32 +315,6 @@
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// btnCopyLog
//
this.btnCopyLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCopyLog.BackColor = System.Drawing.Color.White;
this.btnCopyLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyLog.Location = new System.Drawing.Point(515, 27);
this.btnCopyLog.Name = "btnCopyLog";
this.btnCopyLog.Size = new System.Drawing.Size(105, 35);
this.btnCopyLog.TabIndex = 191;
this.btnCopyLog.Text = "复制日志";
this.btnCopyLog.UseVisualStyleBackColor = false;
this.btnCopyLog.Click += new System.EventHandler(this.btnCopyLog_Click);
//
// btnClearLog
//
this.btnClearLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearLog.BackColor = System.Drawing.Color.White;
this.btnClearLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearLog.Location = new System.Drawing.Point(635, 27);
this.btnClearLog.Name = "btnClearLog";
this.btnClearLog.Size = new System.Drawing.Size(105, 35);
this.btnClearLog.TabIndex = 190;
this.btnClearLog.Text = "清空日志";
this.btnClearLog.UseVisualStyleBackColor = false;
this.btnClearLog.Click += new System.EventHandler(this.btnClearLog_Click);
//
// logBox
//
this.logBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
......@@ -540,21 +558,18 @@
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// groupBox2
// btnTrayInfo
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.lblCID);
this.groupBox2.Controls.Add(this.chbAutoRun);
this.groupBox2.Controls.Add(this.chkDebug);
this.groupBox2.Controls.Add(this.btnClearLog);
this.groupBox2.Controls.Add(this.btnCopyLog);
this.groupBox2.Location = new System.Drawing.Point(460, 4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(860, 75);
this.groupBox2.TabIndex = 196;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "状态信息";
this.btnTrayInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnTrayInfo.BackColor = System.Drawing.Color.White;
this.btnTrayInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTrayInfo.Location = new System.Drawing.Point(401, 26);
this.btnTrayInfo.Name = "btnTrayInfo";
this.btnTrayInfo.Size = new System.Drawing.Size(105, 35);
this.btnTrayInfo.TabIndex = 195;
this.btnTrayInfo.Text = "托盘信息";
this.btnTrayInfo.UseVisualStyleBackColor = false;
this.btnTrayInfo.Click += new System.EventHandler(this.btnTrayInfo_Click);
//
// FrmLineStore
//
......@@ -579,13 +594,13 @@
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -642,6 +657,7 @@
private System.Windows.Forms.ToolStripMenuItem iO模块状态ToolStripMenuItem;
private System.Windows.Forms.Label lblMoveInfo;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button btnTrayInfo;
}
}
......@@ -718,5 +718,16 @@ namespace OnlineStore.AssemblyLine
FrmIOMsg frm = new FrmIOMsg();
frm.ShowDialog();
}
private void btnTrayInfo_Click(object sender, EventArgs e)
{
List<TrayInfo> tray = TrayManager.getTrayList();
LogUtil.info("-------------------开始打印托盘信息:");
foreach(TrayInfo t in tray)
{
LogUtil.info(t.ToStr());
}
LogUtil.info("-------------------结束打印托盘信息");
}
}
}
......@@ -17,8 +17,10 @@ namespace OnlineStore.Common
public string cids = "";
public string code = "";
}
public class LineOperation
{
// //{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
/// <summary>
/// 0=成功
/// </summary>
......
......@@ -482,7 +482,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.debug(Name + msg);
}
protected void InStoreLog(string msg)
protected void InLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (String.IsNullOrEmpty( posId))
......@@ -494,7 +494,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + " " + "[" + posId + "]" + msg);
}
}
protected void OutStoreLog(string msg)
protected void OutLog(string msg)
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
if (String.IsNullOrEmpty(posId))
......@@ -506,7 +506,30 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + " " + "[" + posId + "] " + msg);
}
}
protected void SInLog(string msg)
{
string posId = SecondMoveInfo.MoveParam != null ? SecondMoveInfo.MoveParam.PosId : "";
if (String.IsNullOrEmpty(posId))
{
LogUtil.info(Name + " " + msg);
}
else
{
LogUtil.info(Name + " " + "[" + posId + "]" + msg);
}
}
protected void SOutLog(string msg)
{
string posId = SecondMoveInfo.MoveParam != null ? SecondMoveInfo.MoveParam.PosId : "";
if (String.IsNullOrEmpty(posId))
{
LogUtil.info(Name + " " + msg);
}
else
{
LogUtil.info(Name + " " + "[" + posId + "] " + msg);
}
}
public string GetMoveStr()
{
string msg = "";
......
......@@ -410,6 +410,7 @@ namespace OnlineStore.DeviceLibrary
private IO_VALUE TargetIoValue = IO_VALUE.HIGH;
private bool BatchAxisStartCheck(string targetIo = "", IO_VALUE value = IO_VALUE.HIGH)
{
isOk = false;
if (String.IsNullOrEmpty(targetIo))
{
targetIo = IO_Type.SL_AxisLocationCheck;
......@@ -430,6 +431,7 @@ namespace OnlineStore.DeviceLibrary
private bool BatchAxisStopCheck()
{
isOk = false;
if (!(axisCheckTimer == null))
{
axisCheckTimer.Stop();
......@@ -437,15 +439,34 @@ namespace OnlineStore.DeviceLibrary
return true;
}
private bool IsInProcess = false;
private bool isOk = false;
private DateTime lastOkTime = DateTime.Now;
private void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (IsInProcess) { return; }
IsInProcess = true;
if (IOValue(TargetIoType).Equals(TargetIoValue))
{
LogUtil.info(Name + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",可以停止运动");
BatchAxis.SuddenStop();
BatchAxisStopCheck();
if (!isOk)
{
isOk = true;
lastOkTime = DateTime.Now;
}
else
{
TimeSpan span = DateTime.Now - lastOkTime;
if (span.TotalMilliseconds > 200)
{
LogUtil.info(Name + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",可以停止运动");
BatchAxis.SuddenStop();
BatchAxisStopCheck();
}
}
}
else
{
isOk = false;
}
IsInProcess = false;
}
......
......@@ -235,7 +235,7 @@ namespace OnlineStore.DeviceLibrary
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + "*************** 托盘号【" + currTrayNum + "】 ,需要出库,开始出库处理,升降伺服到P1点");
// InStoreLog(" 紧急出料移栽 " + SecondMoveInfo.SLog + ":升降伺服到P1点");
// InStoreLog("紧急出料移栽 " + SecondMoveInfo.SLog + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
......@@ -261,7 +261,7 @@ namespace OnlineStore.DeviceLibrary
if (Config.SidesWayNum > 0)
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
InStoreLog("托盘放行, " + SecondMoveInfo.SLog + " 托盘开始放行,环形线定位气缸下降");
SInLog("托盘放行, " + SecondMoveInfo.SLog + " 托盘开始放行,环形线定位气缸下降");
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
}
else
......@@ -342,45 +342,45 @@ namespace OnlineStore.DeviceLibrary
if (MoveCylineCanTakeOrGive())
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_202_MoveCylinder_Give);
InStoreLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端前先上升横移气缸");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_202_MoveCylinder_Give))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_203_MoveCylinder_Down);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构下降");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构下降");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_203_MoveCylinder_Down))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_204_UpdownAxisToP2);
int targetP = Config.GetUpdownPositionP2(SecondMoveInfo.MoveParam.PlateH);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":升降伺服下降到指定位置" + targetP);
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":升降伺服下降到指定位置" + targetP);
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_204_UpdownAxisToP2))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_205_MoveCylinder_Tighten);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料气缸夹紧");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料气缸夹紧");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_205_MoveCylinder_Tighten))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_206_UpdownAxisToP1);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":升降伺服到P1");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":升降伺服到P1");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_206_UpdownAxisToP1))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构上升,更新【" + currTrayNum + "】为空托盘");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构上升,更新【" + currTrayNum + "】为空托盘");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//更新此托盘为空托盘
......@@ -391,21 +391,21 @@ namespace OnlineStore.DeviceLibrary
if (MoveCylineCanTakeOrGive())
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_208_MoveCylinder_Take);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到取料端");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到取料端");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up);
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端前先上升横移气缸");
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + ":上料横移机构到放料端前先上升横移气缸");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_208_MoveCylinder_Take))
{
InStoreLog(" 紧急出料移栽" + SecondMoveInfo.MoveStep + " 托盘开始放行,定位气缸下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
SOutLog("紧急出料移栽" + SecondMoveInfo.MoveStep + " 托盘开始放行,定位气缸下降");
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Up, IO_Type.SW_LocationCylinder_Down);
}
#endregion
......@@ -457,7 +457,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
InStoreLog("检测到料架, "+MoveInfo.MoveStep+" :升降盘定位气缸下降");
InLog("检测到料架, "+MoveInfo.MoveStep+" :升降盘定位气缸下降");
}
return true ;
}
......@@ -466,7 +466,7 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,等待1秒后再次检测
MoveInfo.NextMoveStep(LineMoveStep.FI_04_WaitTime);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 等待1秒再次检测");
InLog("定位工位检测到料架: " + MoveInfo.SLog + " 等待1秒再次检测");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
......@@ -483,7 +483,7 @@ namespace OnlineStore.DeviceLibrary
else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart);
InStoreLog(" 入料检测: " + MoveInfo.SLog + " 阻挡工位检测有料架,进料阻挡上升,缓冲阻挡下降,流水线转动 1000");
InLog("入料检测: " + MoveInfo.SLog + " 阻挡工位检测有料架,进料阻挡上升,缓冲阻挡下降,流水线转动 1000");
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH);//进料阻挡上升
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
......@@ -493,7 +493,7 @@ namespace OnlineStore.DeviceLibrary
}else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart);
InStoreLog(" 入料检测: " + MoveInfo.SLog + " 进料口检测有料架,进料阻挡下降,缓冲阻挡上升,流水线转动 1000");
InLog("入料检测: " + MoveInfo.SLog + " 进料口检测有料架,进料阻挡下降,缓冲阻挡上升,流水线转动 1000");
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);//进料阻挡上升
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH);//缓冲阻挡下降
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
......@@ -523,13 +523,13 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep.Equals(LineMoveStep.Wait))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
InStoreLog(" 料架入库" + MoveInfo.SLog + " :升降盘定位气缸下降");
InLog("料架入库" + MoveInfo.SLog + " :升降盘定位气缸下降");
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_01_TrayLocation_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_02_LocationCylinder_Down);
InStoreLog(" 料架入库" + MoveInfo.SLog + ":定位气缸下降,提升伺服移动到P1");
InLog("料架入库" + MoveInfo.SLog + ":定位气缸下降,提升伺服移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
......@@ -547,7 +547,7 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
InLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
......@@ -562,14 +562,14 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
InLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_07_LocationCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_08_BatchAxisToP2);
InStoreLog(" 料架入库" + MoveInfo.SLog + ":提升轴下降到位P2,定位气缸上升");
InLog("料架入库" + MoveInfo.SLog + ":提升轴下降到位P2,定位气缸上升");
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SL_LocationCylinder_Up);
......@@ -577,13 +577,13 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_08_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_09_TrayLocation_Before);
InStoreLog(" 料架入库" + MoveInfo.SLog + ":升降盘定位气缸前进");
InLog("料架入库" + MoveInfo.SLog + ":升降盘定位气缸前进");
TrayLCylinderBefore(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_09_TrayLocation_Before))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_10_AxisUpMove);
InStoreLog(" 料架入库" + MoveInfo.SLog + ":上料轴开始慢速上升到P3点,等待检测到料盘");
InLog("料架入库" + MoveInfo.SLog + ":上料轴开始慢速上升到P3点,等待检测到料盘");
BatchAxisToP3();
}
#endregion
......@@ -603,7 +603,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:是否需要扫码【" + isScan + "】");
InLog("料盘移栽" + MoveInfo.SLog + ":开始扫码:是否需要扫码【" + isScan + "】");
LastCodeList = new List<string>();
if (isScan)
......@@ -638,32 +638,32 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_13_ScanCode))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_14_MoveCylinder_Take);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_14_MoveCylinder_Take))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_15_UpdownAxisToP3);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":升降轴到P3");
InLog("料盘移栽" + MoveInfo.SLog + ":升降轴到P3");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP3, Config.UpdownAxis_P3Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_15_UpdownAxisToP3))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_16_MoveCylinder_Tighten);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移机构夹紧");
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构夹紧");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_16_MoveCylinder_Tighten))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_17_UpdownAxisToP1);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
InLog("料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_UpdownAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_17_BatchAxisToP3);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3");
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3");
BatchAxisToP3();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_17_BatchAxisToP3))
......@@ -676,13 +676,13 @@ namespace OnlineStore.DeviceLibrary
//判断是否还有料盘
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW))
{
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】,已经没有料盘,提升轴开始回下降待机点P2");
InLog("料盘移栽" + MoveInfo.SLog + ":记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】,已经没有料盘,提升轴开始回下降待机点P2");
MoveInfo.ShelfNoTray = true;
BatchAxis.AbsMove(Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
else
{
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
InLog("料盘移栽" + MoveInfo.SLog + ":记录高度尺寸 高度【" + LastHeight + "】宽度【" + LastWidth + "】");
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_SaveSize))
......@@ -690,20 +690,20 @@ namespace OnlineStore.DeviceLibrary
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_19_MoveCylinder_Emptying);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_18_SaveSize);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_MoveCylinder_Emptying))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_WaitTray);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":等待空托盘到达");
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达");
//TODO 此处需要等待空托盘
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_WaitTray))//TODO
......@@ -711,7 +711,7 @@ namespace OnlineStore.DeviceLibrary
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_MoveCylinder_Down);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料机构下降");
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else
......@@ -729,25 +729,25 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_22_UpdownAxisToP2);
int targetPositon = Config.GetUpdownPositionP2(LastHeight);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":移栽伺服下降到指定位置:" + targetPositon);
InLog("料盘移栽" + MoveInfo.SLog + ":移栽伺服下降到指定位置:" + targetPositon);
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_UpdownAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_MoveCylinder_Slack);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
InLog("料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_MoveCylinder_Slack))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_24_UpDownAxisToP1);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
InLog("料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_UpDownAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_MoveCylinder_Up);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":上料横移机构上升,记录托盘尺寸, 托盘开始放行");
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构上升,记录托盘尺寸, 托盘开始放行");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
Task.Factory.StartNew(delegate
{
......@@ -756,14 +756,14 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayInfo(currTrayNum, true, 1, code, "", LastHeight, LastWidth);
if (code.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
TrayManager.UpdateInStoreNG(currTrayNum, true,"扫码失败");
}
//从服务器获取库位号
string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
if (!result.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
LogUtil.error(result);
TrayManager.UpdateInStoreNG(currTrayNum, true,result);
LogUtil.error(Name+"托盘【"+currTrayNum+"】"+ result);
}
});
......@@ -780,20 +780,20 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_31_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_32_TrayLocationCylinder_After);
InStoreLog(" 上料完成" + MoveInfo.SLog + ": 升降盘定位气缸后退");
InLog("上料完成" + MoveInfo.SLog + ": 升降盘定位气缸后退");
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_32_TrayLocationCylinder_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_33_BatchAxisToP1);
InStoreLog(" 上料完成" + MoveInfo.SLog + ":提升伺服到P1点,定位气缸下降");
InLog("上料完成" + MoveInfo.SLog + ":提升伺服到P1点,定位气缸下降");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_33_BatchAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_35_OutTopCylinder_Up);
InStoreLog(" 上料完成" + MoveInfo.SLog + ",出口顶升气缸上升,出料缓冲阻挡上升");
InLog("上料完成" + MoveInfo.SLog + ",出口顶升气缸上升,出料缓冲阻挡上升");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Down, IO_Type.SL_OutTopCylinder_Up);
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.LOW);
}
......@@ -802,7 +802,7 @@ namespace OnlineStore.DeviceLibrary
{
//TODO
MoveInfo.NextMoveStep(LineMoveStep.FI_36_SideWayLineRun);
InStoreLog(" 上料完成" + MoveInfo.SLog + ", 线体横移电机运转,等待料架离开上料工位");
InLog("上料完成" + MoveInfo.SLog + ", 线体横移电机运转,等待料架离开上料工位");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Location_Check, IO_VALUE.LOW));
......@@ -810,7 +810,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_36_SideWayLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_37_WaitShelfGo);
InStoreLog(" 上料完成" + MoveInfo.SLog + ", 线体横移电机运转,等待料架到达出口");
InLog("上料完成" + MoveInfo.SLog + ", 线体横移电机运转,等待料架到达出口");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
//MoveInfo.OneWaitCanEndStep = true;
......@@ -821,7 +821,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_37_LineStop);
InStoreLog(" 上料完成" + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止 ");
InLog("上料完成" + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止 ");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.LOW);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
......@@ -829,7 +829,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_37_LineStop))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_38_TopCylinderDown);
InStoreLog(" 上料完成" + MoveInfo.SLog + ", 料架到达出口,出口顶升下降 , ");
InLog("上料完成" + MoveInfo.SLog + ", 料架到达出口,出口顶升下降 , ");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
......@@ -838,7 +838,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove();
runStatus = LineRunStatus.Runing;
// MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun);
InStoreLog("上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束");
InLog("上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束");
AgvClient.ReadyEmpty(Config.AgvOutName);
}
......@@ -850,14 +850,14 @@ namespace OnlineStore.DeviceLibrary
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_12_MoveCylinder_Give);
InStoreLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构到放料端");
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构到放料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
//有料盘
MoveInfo.NextMoveStep(LineMoveStep.FI_11_MoveCylinder_Up);
InStoreLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构上升");
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构检测到料盘,横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
}
......@@ -873,7 +873,8 @@ namespace OnlineStore.DeviceLibrary
//无料盘
MoveInfo.ShelfNoTray = true;
MoveInfo.NextMoveStep(LineMoveStep.FI_31_BatchAxisToP2);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":未检测到料盘,提升伺服到P2点");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
InLog("料盘移栽" + MoveInfo.SLog + ":未检测到料盘,提升伺服到P2点");
BatchAxis.SuddenStop();
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
......@@ -919,7 +920,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(msg + ",归类为" + LastHeight);
return LastHeight;
}
private int GetWidth()
public int GetWidth()
{
int width = 15;
if (IOValue(IO_Type.SL_TrayCheck4).Equals(IO_VALUE.HIGH))
......@@ -937,6 +938,9 @@ namespace OnlineStore.DeviceLibrary
else if (IOValue(IO_Type.SL_TrayCheck1).Equals(IO_VALUE.HIGH))
{
width = 7;
}else
{
width = 7;
}
return width;
}
......
......@@ -21,7 +21,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.MoveParam = new InOutParam();
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
InStoreLog("检测到料架, FO_01_TrayLocation_After :升降盘定位气缸后退");
OutLog("检测到料架, FO_01_TrayLocation_After :升降盘定位气缸后退");
return true;
}
private void LineOutStoreProcess()
......@@ -33,7 +33,7 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FO_07_LocationCylinder_Up);
OutStoreLog("定位工位检测到料架" + MoveInfo.MoveStep + ":缓冲阻挡上升, 定位气缸上升");
OutLog("定位工位检测到料架" + MoveInfo.MoveStep + ":缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
......@@ -46,7 +46,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
OutStoreLog("出料检测" + MoveInfo.SLog + ":阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
OutLog("出料检测" + MoveInfo.SLog + ":阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
}
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
......@@ -56,7 +56,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
OutStoreLog("出料检测" + MoveInfo.SLog + ":入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000");
OutLog("出料检测" + MoveInfo.SLog + ":入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000");
}
else
{
......@@ -79,12 +79,12 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
OutStoreLog("出料检测" + MoveInfo.SLog + ":升降盘定位气缸后退");
OutLog("出料检测" + MoveInfo.SLog + ":升降盘定位气缸后退");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_01_TrayLocation_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_02_LocationCylinder_Down);
OutStoreLog("出库: " + MoveInfo.SLog + " 开始:定位气缸下降,提升轴移动到P1");
OutLog("出库: " + MoveInfo.SLog + " 开始:定位气缸下降,提升轴移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
......@@ -100,26 +100,26 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_07_LocationCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_08_BatchAxisToP2);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :提升轴下降到位P2");
OutLog("出库移栽 " + MoveInfo.SLog + " :提升轴下降到位P2");
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_08_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_09_TrayLocation_Before);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :升降盘定位气缸前进");
OutLog("出库移栽 " + MoveInfo.SLog + " :升降盘定位气缸前进");
TrayLCylinderBefore(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_09_TrayLocation_Before))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_10_AxisUpMove);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :上料轴开始慢速上升到P3点");
OutLog("出库移栽 " + MoveInfo.SLog + " :上料轴开始慢速上升到P3点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP3, Config.BatchAxis_TargetSpeed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_10_AxisUpMove))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_11_AxisDownMove);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + " :提升伺服下降指定的高度");
OutLog("出库移栽 " + MoveInfo.SLog + " :提升伺服下降指定的高度");
int targetPosition = Config.BatchAxisP3 + lastOutParam.PlateH * Config.Height_ChangeValue;
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_TargetSpeed);
......@@ -127,44 +127,44 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_11_AxisDownMove))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_12_MoveCylinder_Down);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":出料横移机构下降");
OutLog("出库移栽 " + MoveInfo.SLog + ":出料横移机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_12_MoveCylinder_Down))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_13_MoveCylinder_Slack);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":出料横移机构放松");
OutLog("出库移栽 " + MoveInfo.SLog + ":出料横移机构放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_13_MoveCylinder_Slack))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_14_MoveCylinder_Up);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":上料横移机构上升");
OutLog("出库移栽 " + MoveInfo.SLog + ":上料横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_14_MoveCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_31_BatchAxisToP2);
OutStoreLog("出库料盘移栽 " + MoveInfo.SLog + ":未检测到料盘,提升伺服到P2点");
OutLog("出库移栽 " + MoveInfo.SLog + ":未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_31_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_32_TrayLocationCylinder_After);
OutStoreLog("出料完成 " + MoveInfo.SLog + ": 升降盘定位气缸后退");
OutLog("出料完成 " + MoveInfo.SLog + ": 升降盘定位气缸后退");
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_32_TrayLocationCylinder_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_33_BatchAxisToP1);
OutStoreLog("出料完成 " + MoveInfo.SLog + ":提升伺服到P1点,定位气缸下降");
OutLog("出料完成 " + MoveInfo.SLog + ":提升伺服到P1点,定位气缸下降");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_33_BatchAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_34_OutTopCylinder_Up);
OutStoreLog("出料完成 " + MoveInfo.SLog + ",出口顶升气缸上升,出料缓冲阻挡上升");
OutLog("出料完成 " + MoveInfo.SLog + ",出口顶升气缸上升,出料缓冲阻挡上升");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Down, IO_Type.SL_OutTopCylinder_Up);
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.LOW);
}
......@@ -172,7 +172,7 @@ namespace OnlineStore.DeviceLibrary
{
//TODO
MoveInfo.NextMoveStep(LineMoveStep.FO_36_SideWayLineRun);
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 线体横移电机运转,等待料架离开定位工位");
OutLog("出料完成 " + MoveInfo.SLog + ", 线体横移电机运转,等待料架离开定位工位");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Location_Check, IO_VALUE.LOW));
......@@ -181,7 +181,7 @@ namespace OnlineStore.DeviceLibrary
{
//TODO
MoveInfo.NextMoveStep(LineMoveStep.FO_36_SideWayLineRun);
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 线体横移电机运转,等待料架到达出口");
OutLog("出料完成 " + MoveInfo.SLog + ", 线体横移电机运转,等待料架到达出口");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
MoveInfo.OneWaitCanEndStep = true;
......@@ -192,7 +192,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FO_37_LineStop);
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止 ");
OutLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止 ");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.LOW);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
......@@ -200,7 +200,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_37_LineStop))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_38_TopCylinderDown);
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,出口顶升下降,定位气缸下降, ");
OutLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,出口顶升下降,定位气缸下降, ");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
......@@ -208,17 +208,17 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_38_TopCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_39_OutLineRun);
OutStoreLog("出料完成 " + MoveInfo.SLog + ", 出口线体运转,料架到达出口处, 通知AGV取空料架, ");
OutLog("出料完成 " + MoveInfo.SLog + ", 出口线体运转,料架到达出口处, 通知AGV取空料架, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_40_OutLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_40_OutLineRun);
OutStoreLog("出料完成 " + MoveInfo.SLog + ", AGV到达,继续转动出口线体,送走出料料架, ");
OutLog("出料完成 " + MoveInfo.SLog + ", AGV到达,继续转动出口线体,送走出料料架, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_40_OutLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_41_OutLineRun);
OutStoreLog("上料完成 " + MoveInfo.SLog + ", 料架送出, ");
OutLog("上料完成 " + MoveInfo.SLog + ", 料架送出, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_41_OutLineRun))
{
......
......@@ -74,16 +74,9 @@ namespace OnlineStore.DeviceLibrary
ProvidingEquipMap = new Dictionary<int, ProvidingEquip>();
DisLineMap = new Dictionary<int, DischargeLine>();
List<string> ioList = new List<string>();
ioList = new List<string>(DeviceConfig.ProIOIpMap.Values);
AddDeviceName(ioList, Config.IOIPList);
foreach (MoveEquip_Config config in configList.Values)
{
MoveEquip equip = new MoveEquip(lineConfig.CID, config);
AddDeviceName(ioList, config.IOIPList);
MoveEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip);
}
foreach (FeedingEquip_Config config in feedMap.Values)
{
FeedingEquip equip = new FeedingEquip(lineConfig.CID, config);
......@@ -95,6 +88,14 @@ namespace OnlineStore.DeviceLibrary
FeedingEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip);
}
foreach (MoveEquip_Config config in configList.Values)
{
MoveEquip equip = new MoveEquip(lineConfig.CID, config);
AddDeviceName(ioList, config.IOIPList);
MoveEquipMap.Add(config.Id, equip);
AllEquipMap.Add(config.Id, equip);
}
foreach (ProvidingEquip_Config config in providMap.Values)
{
ProvidingEquip equip = new ProvidingEquip(lineConfig.CID, config);
......@@ -127,7 +128,7 @@ namespace OnlineStore.DeviceLibrary
string[] testDeviceIdList = ids.Split(',');
foreach (string str in testDeviceIdList)
{
{
int id = Convert.ToInt32(str);
if (FeedingEquipMap.ContainsKey(id))
{
......@@ -922,7 +923,7 @@ namespace OnlineStore.DeviceLibrary
public string GetMoveStr()
{
string msg = "";
int tLength = 20;
// int tLength = 20;
//msg += "preTrayNum:".PadRight(tLength, ' ') + preTrayNum + "\n";
//msg += "currTrayNum:".PadRight(tLength, ' ') + currTrayNum + "\n";
......
......@@ -62,7 +62,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
runStatus = LineRunStatus.HomeMoving;
LogInfo("开始原点返回: (上下气缸回原点,阻挡1气缸上升 )开始");
LogInfo("开始原点返回: 上下气缸回原点,阻挡1气缸上升 ");
MoveInfo.NewMove(LineMoveType.ReturnHome);
StartReset();
if ( isDebug)
......@@ -80,7 +80,7 @@ namespace OnlineStore.DeviceLibrary
{
return false;
}
LogInfo("开始重置:清空托盘号,(上下气缸回原点,阻挡1气缸上升 )开始;");
LogInfo("开始重置: 上下气缸回原点,阻挡1气缸上升 ");
runStatus = LineRunStatus.Reset;
SecondMoveInfo.EndMove();
......@@ -130,13 +130,13 @@ namespace OnlineStore.DeviceLibrary
{
case LineMoveStep.MH_UpDownHomeMove:
MoveInfo.NextMoveStep(LineMoveStep.MH_UpDownCylinder_Up);
LogInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始");
DebugInfo(MoveInfo.MoveType+ " : (上下轴原点返回完成,上下轴走到待机点 )开始");
UpdownUpMove();
break;
case LineMoveStep.MH_UpDownCylinder_Up:
MoveInfo.NextMoveStep(LineMoveStep.MH_OtherCylinder_Back);
LogInfo(MoveInfo.MoveType + " : (上升到位,顶升气缸下降,前后气缸回退 )开始");
DebugInfo(MoveInfo.MoveType + " : (上升到位,顶升气缸下降,前后气缸回退 )开始");
CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
......@@ -144,7 +144,7 @@ namespace OnlineStore.DeviceLibrary
case LineMoveStep.MH_OtherCylinder_Back:
LogInfo(MoveInfo.MoveType + " 完成!");
LogInfo(MoveInfo.MoveType + " 完成!");
runStatus = LineRunStatus.Runing;
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
......@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
//如果正在出库中,需要减去托盘号
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
LogInfo("停止运动时出库执行中,减去托盘数;");
DebugInfo("停止运动时出库执行中,减去托盘数;");
//减去需要的盘数
TrayManager.DelNeedEmptyTrayNum();
MoveInfo.EndMove();
......@@ -178,7 +178,7 @@ namespace OnlineStore.DeviceLibrary
runStatus = LineRunStatus.Busy;
SecondMoveInfo.EndMove();
LogInfo("停止运动:(上下气缸上升端,阻挡气缸输入=0 )开始 ");
LogInfo("停止运动:上下气缸上升端,阻挡气缸上升 ,开始 ");
UpdownUpMove();
CylinderMove(MoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
......@@ -238,12 +238,12 @@ namespace OnlineStore.DeviceLibrary
if (ok)
{
LogUtil.info(Name + "开始 执行排队中的出库【" + waitOutParma.ToStr() + "】");
LogUtil.info(Name + "执行排队中的出库【" + waitOutParma.ToStr() + "】");
//出库
bool result = StartOutStoreMove(waitOutParma);
if (!result)
{
LogUtil.info(Name + " 执行排队中的出库【" + waitOutParma.ToStr() + "】失败,重新加入等待队列");
LogUtil.info(Name + " 执行出库【" + waitOutParma.ToStr() + "】失败,重新加入等待队列");
AddWaitOutInfo(waitOutParma);
}
}
......
......@@ -63,32 +63,32 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_50_StartOutProcess))
{
MoveInfo.NextMoveStep(LineMoveStep.MO_51_BeforeAfterCylinderBefore);
OutStoreLog("出库 "+MoveInfo.MoveStep+": 前后气缸前进 )");
OutLog("出库 "+MoveInfo.MoveStep+": 前后气缸前进 )");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_51_BeforeAfterCylinderBefore))
{
MoveInfo.NextMoveStep(LineMoveStep.MO_52_UpDownCylinderDown);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1下降 )");
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸1下降 )");
UpdownDownBoxMove(MoveInfo.MoveParam.PlateH);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_52_UpDownCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.MO_53_UpDownCylinderDownWait);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1下降 后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作)");
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸1下降 后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作)");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_53_UpDownCylinderDownWait))
{
MoveInfo.NextMoveStep(LineMoveStep.MO_54_ClampCylinderSlack);
OutStoreLog("出库 " + MoveInfo.SLog + ": 夹料气缸1夹紧)");
OutLog("出库 " + MoveInfo.SLog + ": 夹料气缸1夹紧)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_54_ClampCylinderSlack))
{
MoveInfo.NextMoveStep(LineMoveStep.MO_55_UpDownCylinderUp);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1上升)");
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸1上升)");
UpdownUpMove();
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
......@@ -96,7 +96,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_55_UpDownCylinderUp))
{
MoveInfo.NextMoveStep(LineMoveStep.MO_56_BeforeAfterCylinderAfter);
OutStoreLog("出库 " + MoveInfo.SLog + ": 前后气缸1后退)");
OutLog("出库 " + MoveInfo.SLog + ": 前后气缸1后退)");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
}
#endregion
......@@ -108,7 +108,7 @@ namespace OnlineStore.DeviceLibrary
{
//去掉直接丢盘处理
MoveInfo.NextMoveStep(LineMoveStep.MO_58_UpDownCylinderDown);
OutStoreLog("出库 " + MoveInfo.SLog + ": 夹具检测编码完成, 上下气缸1下降 )");
OutLog("出库 " + MoveInfo.SLog + ": 夹具检测编码完成, 上下气缸1下降 )");
if (MoveInfo.MoveParam != null)
{
MoveInfo.MoveParam.TrayNumber = SecondMoveInfo.MoveParam.TrayNumber;
......@@ -116,32 +116,13 @@ namespace OnlineStore.DeviceLibrary
else
{
MoveInfo.MoveParam = SecondMoveInfo.MoveParam;
}
UpdownDownMove(MoveInfo.MoveParam.PlateH);
////判断盘号,如果是七寸盘,不需要下降,直接放盘
//bool isNeedPush = MoveInfo.MoveParam.PlateW.Equals(TrayManager.CanPushBagWidth);
//if (isNeedPush)
//{
// MoveInfo.NextMoveStep(LineMoveStep.MO_58_UpDownCylinderDown);
// MoveInfo.EndStepWait();
//}
//else
//{
// MoveInfo.NextMoveStep(LineMoveStep.MO_58_UpDownCylinderDown);
// UpdownDownMove(MoveInfo.MoveParam.PlateH);
// // CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
//}
}
UpdownDownMove(MoveInfo.MoveParam.PlateH);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_58_UpDownCylinderDown))
{
OutStoreLog("出库 " + MoveInfo.SLog + ": 夹料气缸1放松 )");
int bagWidth = MoveInfo.MoveParam.PlateW;
LogInfo("【" + posId + "】出库时,更新盘空满信息 托盘号【" + MoveInfo.MoveParam.TrayNumber + "】,是否有料盘【" + true + "】,出库入库【" + 2 + "】");
TrayManager.UpdateTrayInfo(MoveInfo.MoveParam.TrayNumber, true, ReelType.OutStore, MoveInfo.MoveParam.WareCode, MoveInfo.MoveParam.PosId, MoveInfo.MoveParam.PlateH, bagWidth);
{
OutLog("出库 " + MoveInfo.SLog + ": 夹料气缸1放松,更新托盘【" + MoveInfo.MoveParam.TrayNumber + "】,有料盘,OutStore,【" +MoveInfo.MoveParam.ToStr() + "】");
TrayManager.UpdateTrayInfo(MoveInfo.MoveParam.TrayNumber, true, ReelType.OutStore, MoveInfo.MoveParam.WareCode, MoveInfo.MoveParam.PosId, MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
//出库全部完成
lineStatus = LineStatus.StoreOnline;
......@@ -151,19 +132,19 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_59_ClampCylinderTighten))
{
this.MoveInfo.NextMoveStep(LineMoveStep.MO_60_UpDownCylinderUp);
OutStoreLog("出库 " + MoveInfo.SLog + ": 上下气缸1上升)");
OutLog("出库 " + MoveInfo.SLog + ": 上下气缸1上升)");
UpdownUpMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MO_60_UpDownCylinderUp))
{
// 减去需要的盘数
TrayManager.DelNeedEmptyTrayNum();
OutStoreLog("出库 SecondMove:移栽完成,放行托盘");
SOutLog("出库 :移栽完成,放行托盘");
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
LogInfo("【" + posId + "】出库处理结束,!");
OutLog("出库处理结束!");
lineStatus = LineStatus.StoreOnline;
runStatus = LineRunStatus.Runing;
MoveInfo.EndMove();
......@@ -225,20 +206,20 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_07_UpDownCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_07_UpDownCylinderDownWait);
InStoreLog("入库 " + MoveInfo.SLog + ": 编码与仓位一致,上下气缸1下降后等待0.3秒再夹紧,防止没有下降到位就夹紧");
InLog("入库 " + MoveInfo.SLog + ": 编码与仓位一致,上下气缸1下降后等待0.3秒再夹紧,防止没有下降到位就夹紧");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
//只有当BOX可以进行出入库时,移栽物品,防止卡住
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_07_UpDownCylinderDownWait))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_08_ClampCylinderSlack);
InStoreLog("入库 " + MoveInfo.SLog + ": 夹料气缸1夹紧)");
InLog("入库 " + MoveInfo.SLog + ": 夹料气缸1夹紧)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_08_ClampCylinderSlack))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_09_UpDownCylinderUp);
InStoreLog("入库 " + MoveInfo.SLog + ": 上下气缸1上升)");
InLog("入库 " + MoveInfo.SLog + ": 上下气缸1上升)");
UpdownUpMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_09_UpDownCylinderUp))
......@@ -251,38 +232,38 @@ namespace OnlineStore.DeviceLibrary
//阻挡气缸移动
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
InStoreLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降)");
InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_UP, IO_Type.TopCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_10_WaitBox))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_10_BeforeAfterCylinderBefore);
InStoreLog("入库:(MI_10_BeforeAfterCylinderBefore,前后气缸1前进)");
InLog("入库:(MI_10_BeforeAfterCylinderBefore,前后气缸1前进)");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_10_BeforeAfterCylinderBefore))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_11_UpDownCylinderDown);
InStoreLog("入库 " + MoveInfo.SLog + " ,上下气缸1下降)");
InLog("入库 " + MoveInfo.SLog + " ,上下气缸1下降)");
UpdownDownBoxMove(MoveInfo.MoveParam.PlateH);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_11_UpDownCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_12_ClampCylinderTighten);
InStoreLog("入库 " + MoveInfo.SLog + ",夹料气缸1放松)");
InLog("入库 " + MoveInfo.SLog + ",夹料气缸1放松)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_12_ClampCylinderTighten))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_13_UpdownCylinderUp);
InStoreLog("入库 " + MoveInfo.SLog + ",上下气缸1上升)");
InLog("入库 " + MoveInfo.SLog + ",上下气缸1上升)");
UpdownUpMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_13_UpdownCylinderUp))
{
MoveInfo.NextMoveStep(LineMoveStep.MI_14_BeforeAfterCylinderAfter);
InStoreLog("入库 " + MoveInfo.SLog + ",前后气缸1后退,等待4000 )");
InLog("入库 " + MoveInfo.SLog + ",前后气缸1后退,等待4000 )");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(4000));
//此时box就可以入库操作了 //触发事件,BOX入库
......@@ -294,12 +275,12 @@ namespace OnlineStore.DeviceLibrary
//判断料仓是否在入库中,如果么有在入库中,需要重新发送入库消息
if (!LineServer.IsInStorePro(DeviceID))
{
InStoreLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓还未开始入库,再次发送starIn命令)");
InLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓还未开始入库,再次发送starIn命令)");
LineServer.StartInStore(DeviceID, MoveInfo.MoveParam);
}
else
{
InStoreLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓已开始入库)");
InLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓已开始入库)");
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_15_SendEnd))
......@@ -323,7 +304,16 @@ namespace OnlineStore.DeviceLibrary
{
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")))
{
return true;
//判断是否验证成功,如果验证失败,不入库
if (LineServer.RightInPosId(DeviceID, cc.PosId))
{
return true;
}
else
{
LogUtil.error(Name + "托盘号【"+currTrayNum+"】入库信息【"+cc.ToStr()+"】料仓未验证成功,不拦截托盘,更新此托盘为NG");
TrayManager.UpdateInStoreNG(currTrayNum, true,"Box验证入库失败");
}
}
}
}
......@@ -347,12 +337,6 @@ namespace OnlineStore.DeviceLibrary
LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currTrayNum + "】出库中,拦截 托盘~");
return true;
}
//去掉直接丢料盘处理
//else if (MoveInfo.MoveParam.PlateW.Equals(TrayManager.CanPushBagWidth) && TrayManager.IsCanOutPush(currMoveTrayNum))
//{
// LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currMoveTrayNum + "】需要出库," + TrayManager.CanPushBagWidth + "寸小盘可以直接出库累积~");
// return true;
//}
}
return false;
}
......@@ -363,11 +347,11 @@ namespace OnlineStore.DeviceLibrary
private bool CheckIsNeedInStore()
{
bool isfull = TrayManager.TrayIsFull(currTrayNum);
LogInfo("***************入库*****验证入库编号,托盘号【" + currTrayNum + "】,isfull【" + isfull + "】");
//LogInfo("***************入库*****验证入库编号,托盘号【" + currTrayNum + "】,isfull【" + isfull + "】");
//FixtureCodeInfo code = GetBox().currInOutFixture;
if (!isfull)
{
LogInfo("***************入库*****空盘直接放行");
//LogInfo("***************入库*****空盘直接放行");
return false;
}
InOutParam currCode = null;
......@@ -380,11 +364,10 @@ namespace OnlineStore.DeviceLibrary
for (int i = 0; i < waitInStoreList.Count; i++)
{
InOutParam cc = waitInStoreList[i];
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")))
if (cc.TrayNumber.Equals(currTrayNum) && (!cc.WareCode.Equals("")) && LineServer.RightInPosId(DeviceID, cc.PosId))
{
reIndex = i;
currCode = cc;
LogInfo("*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】 ,开始入库移栽");
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW);
break;
}
......@@ -394,11 +377,12 @@ namespace OnlineStore.DeviceLibrary
waitInStoreList.RemoveAt(reIndex);
if (!LineServer.BoxCanInStore(DeviceID))
{
LogUtil.info(Name + "*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】,BoxCanInStore验证失败,先移栽再等待料仓可入库,开始入库移栽");
LogInfo( "*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】,BoxCanInStore验证失败,先移栽料盘");
return true;
}
else
{
LogInfo("*******托盘" + currTrayNum + "需要入库【" + currCode.ToStr() + "】 ,开始入库移栽");
return true;
}
}
......@@ -557,19 +541,19 @@ namespace OnlineStore.DeviceLibrary
{
SecondMoveInfo.MoveParam = new InOutParam(currTrayNum);
isNeedMove = true;
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】可以放出库托盘,正在出库中,移栽料盘");
LogInfo(SecondMoveInfo.MoveNum + "*************** 空托盘【" + currTrayNum + "】,正在出库中,移栽料盘");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
else if (CheckIsNeedInStore())
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘【" + currTrayNum + "】,有对应的入库任务,等待移栽");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_08_WaitInStore);
isNeedMove = true;
}
else
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘【" + currTrayNum + "】不需要出入库, 放盘通过");
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘【" + currTrayNum + "】不需要出入库, 放盘通过");
}
if (!isNeedMove)
......
......@@ -256,20 +256,20 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_01_UpDownCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_02_UpDownCylinderDownWait);
OutStoreLog("出库 "+MoveInfo.SLog+" : 上下气缸1下降后等待0.3秒再夹紧");
OutLog("出库 "+MoveInfo.SLog+" : 上下气缸1下降后等待0.3秒再夹紧");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
//只有当BOX可以进行出出料时,移栽物品,防止卡住
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_02_UpDownCylinderDownWait))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_03_ClampCylinderSlack);
OutStoreLog("出库 " + MoveInfo.SLog + " : 夹料气缸夹紧)");
OutLog("出库 " + MoveInfo.SLog + " : 夹料气缸夹紧)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Tighten, IO_Type.ClampCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_03_ClampCylinderSlack))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_04_UpDownCylinderUp);
OutStoreLog("出库 " + MoveInfo.SLog + " : 上下气缸上升)");
OutLog("出库 " + MoveInfo.SLog + " : 上下气缸上升)");
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
UpdownUpMove();
}
......@@ -283,7 +283,7 @@ namespace OnlineStore.DeviceLibrary
//阻挡气缸移动
SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
InStoreLog("放托盘(放开阻挡)"+SecondMoveInfo.SLog+" 物品已移走,顶升气缸1下降)");
OutLog("放托盘(放开阻挡)"+ MoveInfo.SLog+" 物品已移走,顶升气缸1下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
if (Config.SidesWayNum <= 0)
{
......@@ -293,33 +293,33 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_05_WaitBox))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_06_BeforeAfterCylinderBefore);
OutStoreLog("出库:PO_06_BeforeAfterCylinderBefore,前后气缸前进)");
OutLog("出库:" + MoveInfo.SLog + " ,前后气缸前进)");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_After, IO_Type.BeforeAfterCylinder_Before);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_06_BeforeAfterCylinderBefore))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_07_UpDownCylinderDown);
OutStoreLog("出库:" + SecondMoveInfo.SLog + " ,上下气缸下降)");
OutLog("出库:" + MoveInfo.SLog + " ,上下气缸下降)");
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
UpdownDownP3Move(MoveInfo.MoveParam.PlateH);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_07_UpDownCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_08_ClampCylinderTighten);
InStoreLog("出料:" + SecondMoveInfo.SLog + ",夹料气缸放松)");
OutLog("出料:" + MoveInfo.SLog + ",夹料气缸放松)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_08_ClampCylinderTighten))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_09_UpdownCylinderUp);
OutStoreLog("出库:" + SecondMoveInfo.SLog + ",上下气缸上升)");
OutLog("出库:" + MoveInfo.SLog + ",上下气缸上升)");
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
UpdownUpMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.PO_09_UpdownCylinderUp))
{
MoveInfo.NextMoveStep(LineMoveStep.PO_10_BeforeAfterCylinderAfter);
OutStoreLog("出库:" + SecondMoveInfo.SLog + ",前后气缸后退,等待4000 )");
OutLog("出库:" + MoveInfo.SLog + ",前后气缸后退,等待4000 )");
CylinderMove(MoveInfo, IO_Type.BeforeAfterCylinder_Before, IO_Type.BeforeAfterCylinder_After);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(4000));
......
......@@ -30,7 +30,7 @@ namespace OnlineStore.DeviceLibrary
}
if (String.IsNullOrEmpty(codeStr))
{
return msg = deviceName + "托盘【" + trayNum + "】 没有扫码到条码";
return msg = deviceName + "未扫到条码";
}
//if (LineManager.Line.runStatus.Equals(LineRunStatus.Wait))
......@@ -43,17 +43,19 @@ namespace OnlineStore.DeviceLibrary
//code: 条码内容
string server = ConfigAppSettings.GetValue(Setting_Init.http_server) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr;
LogUtil.info(deviceName + "托盘【" + trayNum + "】 收到条码<< " + codeStr + ",获取入库PosID:" + server);
LogUtil.info(deviceName + "托盘【" + trayNum + "】 条码<< " + codeStr + ",获取入库PosID:" + server);
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("HttpHelper.Post结果:"+resultStr);
//{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr);
if (serverResult == null)
{
return msg = deviceName + "托盘【" + trayNum + "】 条码【" + codeStr + "】没有收到服务器反馈";
return msg = deviceName + " 条码【" + codeStr + "】没有收到服务器反馈";
}
else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false))
{
return msg = deviceName + "托盘【" + trayNum + "】 条码【" + codeStr + "】 :" + serverResult.msg;
return msg = deviceName + " 条码【" + codeStr + "】 :" + serverResult.msg;
}
if (!serverResult.pos.Equals(""))
......@@ -64,7 +66,7 @@ namespace OnlineStore.DeviceLibrary
string[] posArray = posId.Split('#');
if (!(posArray.Length == 2))
{
return msg = deviceName + "托盘【" + trayNum + "】 入库库位格式错误:条码【" + codeStr + "】库位【" + posId + "】";
return msg = deviceName + " 入库库位格式错误:条码【" + codeStr + "】库位【" + posId + "】";
}
int storeId = int.Parse(posArray[0]);
string wareNum = serverResult.barcode;
......@@ -78,7 +80,7 @@ namespace OnlineStore.DeviceLibrary
moveEquip.SetWarnMsg( "入库库位重复: " + param.ToStr() + " ,入库失败!");
return msg = ("收到服务器入库命令 " + "入库库位重复: " + param.ToStr() + " ,入库失败!");
}
LogUtil.info("更新盘空满信息,托盘号【" + trayNum + "】,是否有料盘【" + true + "】,出库入库【" + 1 + "】");
LogUtil.info("收到入库命令: " + param.ToStr() + " ,更新盘空满信息,托盘号【" + trayNum + "】,有料," + ReelType.InStore + "");
TrayManager.UpdateTrayInfo(trayNum, true, ReelType.InStore, wareNum, posId, plateH, plateW);
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
......@@ -86,6 +88,12 @@ namespace OnlineStore.DeviceLibrary
{
LineServer.CheckInStorePos(storeId, param);
}
lock (moveEquip.waitInListLock)
{
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(moveEquip.Name + " 入库命令: " + " + param.ToStr() + "+ "加入等待列表中!");
moveEquip.waitInStoreList.Add(param);
}
}
}
catch (Exception ex)
......
......@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 放在公共地方,方便存取,夹料编码盘列表,key=编码(1-6),value=是否有物品,true=有物品
/// </summary>
private static ConcurrentDictionary<int, TrayInfo> fixtureCodeFullMap = new ConcurrentDictionary<int, TrayInfo>();
private static ConcurrentDictionary<int, TrayInfo> TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>();
/// <summary>
/// 流水线需要的空盘数量
......@@ -42,6 +42,10 @@ namespace OnlineStore.DeviceLibrary
{
LineRunTest = ConfigAppSettings.GetIntValue(Setting_Init.LineRunTest).Equals(1);
}
public static List<TrayInfo> getTrayList()
{
return new List<TrayInfo>(TrayInfoMap.Values);
}
internal static void AddNeedEmptyTrayNum()
{
Interlocked.Increment(ref LineNeedEmptyTrayNum);
......@@ -58,18 +62,18 @@ namespace OnlineStore.DeviceLibrary
/// <returns>盘上是否有料盘</returns>
internal static bool TrayIsFull(int trayNum)
{
if (fixtureCodeFullMap.ContainsKey(trayNum))
if (TrayInfoMap.ContainsKey(trayNum))
{
return fixtureCodeFullMap[trayNum].IsFull;
return TrayInfoMap[trayNum].IsFull;
}
return false;
}
internal static TrayInfo GetTrayInfo(int trayNum)
{
if (fixtureCodeFullMap.ContainsKey(trayNum))
if (TrayInfoMap.ContainsKey(trayNum))
{
return fixtureCodeFullMap[trayNum];
return TrayInfoMap[trayNum];
}
TrayInfo tray = new TrayInfo(trayNum,false,0);
......@@ -79,56 +83,42 @@ namespace OnlineStore.DeviceLibrary
internal static void UpdateTrayInfo(int trayNum, bool isFull = false, int inOrOut = 0, string wareCode = "", string posId = "", int plateH = 0, int plateW = 0)
{
if (fixtureCodeFullMap.ContainsKey(trayNum))
if (TrayInfoMap.ContainsKey(trayNum))
{
fixtureCodeFullMap[trayNum].IsFull = isFull;
fixtureCodeFullMap[trayNum].InOrOutStore = inOrOut;
TrayInfoMap[trayNum].IsFull = isFull;
TrayInfoMap[trayNum].InOrOutStore = inOrOut;
fixtureCodeFullMap[trayNum].WareCode = wareCode;
fixtureCodeFullMap[trayNum].PosId = posId;
fixtureCodeFullMap[trayNum].PlateH = plateH;
fixtureCodeFullMap[trayNum].PlateW = plateW;
TrayInfoMap[trayNum].WareCode = wareCode;
TrayInfoMap[trayNum].PosId = posId;
TrayInfoMap[trayNum].PlateH = plateH;
TrayInfoMap[trayNum].PlateW = plateW;
}
else
{
TrayInfo fixture = new TrayInfo(trayNum, isFull, inOrOut, wareCode, posId, plateH, plateW);
fixtureCodeFullMap.TryAdd(trayNum, fixture);
}
}
internal static void UpdateTrayCode(int trayNum, string wareCode = "")
{
LogUtil.info("更新托盘【" + trayNum + "】的条码为【" + wareCode + "】");
if (fixtureCodeFullMap.ContainsKey(trayNum))
{
fixtureCodeFullMap[trayNum].WareCode = wareCode;
TrayInfoMap.TryAdd(trayNum, fixture);
}
}
internal static void UpdateInStoreNG(int trayNum, bool isNg = false)
internal static void UpdateInStoreNG(int trayNum, bool isNg ,string msg)
{
LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】");
if (fixtureCodeFullMap.ContainsKey(trayNum))
LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】NgMsg=【" + msg + "】");
if (TrayInfoMap.ContainsKey(trayNum))
{
fixtureCodeFullMap[trayNum].InStoreNG = isNg;
TrayInfoMap[trayNum].InStoreNG = isNg;
TrayInfoMap[trayNum].NgMsg = msg;
}
}
internal static void UpdateTrayPosId(int trayNum, string PosId = "")
{
if (fixtureCodeFullMap.ContainsKey(trayNum))
{
fixtureCodeFullMap[trayNum].PosId = PosId;
}
}
/// <summary>
/// 是否还有有料仓的盘
/// </summary>
internal static bool IsHasFullTray()
{
foreach (int key in fixtureCodeFullMap.Keys)
foreach (int key in TrayInfoMap.Keys)
{
if (fixtureCodeFullMap[key].IsFull)
if (TrayInfoMap[key].IsFull)
{
return true;
}
......@@ -140,9 +130,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
internal static bool IsHasFullOutFixture()
{
foreach (int key in fixtureCodeFullMap.Keys)
foreach (int key in TrayInfoMap.Keys)
{
if (fixtureCodeFullMap[key].IsFull && fixtureCodeFullMap[key].InOrOutStore.Equals(2))
if (TrayInfoMap[key].IsFull && TrayInfoMap[key].InOrOutStore.Equals(2))
{
return true;
}
......@@ -258,7 +248,7 @@ namespace OnlineStore.DeviceLibrary
if (equip.IsDebug || equip.runStatus <= LineRunStatus.Wait)
{
return true;
}
}
}
}
foreach (ProvidingEquip equip in LineManager.Line.ProvidingEquipMap.Values)
......
......@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
{
// Create new modbus master and add event functions
aioBox = new AIOBOX();
aioBox.LogPath( Application.StartupPath+@"\logs\aio\");
// aioBox.LogPath( Application.StartupPath+@"\logs\aio\");
aioBox.IP = ioIp;
// bool rtn = aioBox.AutoIP(ioIp);
......
......@@ -357,7 +357,10 @@ namespace OnlineStore.DeviceLibrary
{
return IOManager.IOValue(IoType, baseConfig.Id);
}
public void DebugInfo(string logInfo)
{
LogUtil.debug(Name + logInfo);
}
public void LogInfo(string logInfo)
{
LogUtil.info(Name + logInfo);
......
......@@ -9,16 +9,16 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 托盘信息
/// </summary>
public class TrayInfo
{
public class TrayInfo
{
public TrayInfo(int trayNum, bool isFull=false, int inOrOut=0 )
{
this.TrayCode = trayNum;
this.IsFull = isFull;
this.InOrOutStore = inOrOut;
}
public TrayInfo (int trayNum, bool isFull , int inOrOut ,string wareCode,string posId,int plateH,int plateW)
public TrayInfo(int trayNum, bool isFull = false, int inOrOut = 0)
{
this.TrayCode = trayNum;
this.IsFull = isFull;
this.InOrOutStore = inOrOut;
}
public TrayInfo(int trayNum, bool isFull, int inOrOut, string wareCode, string posId, int plateH, int plateW)
{
this.TrayCode = trayNum;
this.IsFull = isFull;
......@@ -27,19 +27,34 @@ namespace OnlineStore.DeviceLibrary
this.PosId = posId;
this.PlateH = plateH;
this.PlateW = plateW;
InStoreNG = false;
NgMsg = "";
}
public string ToStr()
{
string type = "无操作";
if (InOrOutStore.Equals(1))
{
type = "入库";
}
else
{
type = "出库";
}
return "托盘【" + TrayCode + "】" + (IsFull ? "有料," : "空,") + type + "," + WareCode + "," + PosId + "," + PlateH + "," + PlateW + "," + InStoreNG + "," + NgMsg;
}
/// <summary>
/// 夹具编码值(1-32?)
/// </summary>
public int TrayCode { get; set; }
/// <summary>
/// 是否有料盘,true=有料盘
/// </summary>
public bool IsFull { get; set; }
/// <summary>
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary>
public int InOrOutStore { get; set; }
/// <summary>
/// 夹具编码值(1-32?)
/// </summary>
public int TrayCode { get; set; }
/// <summary>
/// 是否有料盘,true=有料盘
/// </summary>
public bool IsFull { get; set; }
/// <summary>
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary>
public int InOrOutStore { get; set; }
/// <summary>
/// 物品二维码信息
......@@ -48,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 位置名(对应配置表的位置)
/// </summary>
public string PosId { get; set; }
public string PosId { get; set; }
/// <summary>
/// 料盘高度
/// </summary>
......@@ -61,6 +76,7 @@ namespace OnlineStore.DeviceLibrary
/// 入库失败料盘,未扫到码或获取库位号失败
/// </summary>
public bool InStoreNG = false;
public string NgMsg = "";
public bool EmergencyOut = false;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!