Commit a64e5a52 张东亮

1

1 个父辈 7071a551
......@@ -39,6 +39,7 @@
this.btnDis = new System.Windows.Forms.Button();
this.btnInit = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnSwitch = new System.Windows.Forms.Button();
this.btnRollerRun = new System.Windows.Forms.Button();
this.btnTranverseRun = new System.Windows.Forms.Button();
this.btnTranverse = new System.Windows.Forms.Button();
......@@ -222,6 +223,7 @@
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox2.Controls.Add(this.btnSwitch);
this.groupBox2.Controls.Add(this.btnRollerRun);
this.groupBox2.Controls.Add(this.btnTranverseRun);
this.groupBox2.Controls.Add(this.btnTranverse);
......@@ -242,10 +244,21 @@
this.groupBox2.Controls.Add(this.groupBox1);
this.groupBox2.Location = new System.Drawing.Point(10, 132);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(434, 551);
this.groupBox2.Size = new System.Drawing.Size(434, 604);
this.groupBox2.TabIndex = 276;
this.groupBox2.TabStop = false;
//
// btnSwitch
//
this.btnSwitch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSwitch.Location = new System.Drawing.Point(22, 413);
this.btnSwitch.Name = "btnSwitch";
this.btnSwitch.Size = new System.Drawing.Size(132, 39);
this.btnSwitch.TabIndex = 290;
this.btnSwitch.Text = "料串切换气缸前进";
this.btnSwitch.UseVisualStyleBackColor = true;
this.btnSwitch.Click += new System.EventHandler(this.btnSwitch_Forward_Click);
//
// btnRollerRun
//
this.btnRollerRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
......@@ -282,7 +295,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(248, 441);
this.label1.Location = new System.Drawing.Point(247, 496);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(25, 17);
this.label1.TabIndex = 286;
......@@ -296,7 +309,7 @@
0,
0,
0});
this.numericUpDown1.Location = new System.Drawing.Point(181, 436);
this.numericUpDown1.Location = new System.Drawing.Point(180, 491);
this.numericUpDown1.Maximum = new decimal(new int[] {
300000,
0,
......@@ -319,7 +332,7 @@
// btnStopTDown
//
this.btnStopTDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStopTDown.Location = new System.Drawing.Point(279, 430);
this.btnStopTDown.Location = new System.Drawing.Point(278, 485);
this.btnStopTDown.Name = "btnStopTDown";
this.btnStopTDown.Size = new System.Drawing.Size(127, 39);
this.btnStopTDown.TabIndex = 284;
......@@ -336,7 +349,7 @@
"分盘1进料线_阻挡",
"分盘1进料线_出口阻挡",
"分盘2出料线_阻挡"});
this.cmbStopList.Location = new System.Drawing.Point(22, 435);
this.cmbStopList.Location = new System.Drawing.Point(21, 490);
this.cmbStopList.Name = "cmbStopList";
this.cmbStopList.Size = new System.Drawing.Size(153, 28);
this.cmbStopList.TabIndex = 283;
......@@ -345,7 +358,7 @@
//
this.btnCloseA.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCloseA.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseA.Location = new System.Drawing.Point(22, 495);
this.btnCloseA.Location = new System.Drawing.Point(22, 548);
this.btnCloseA.Name = "btnCloseA";
this.btnCloseA.Size = new System.Drawing.Size(173, 39);
this.btnCloseA.TabIndex = 282;
......@@ -357,7 +370,7 @@
//
this.btnClearL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnClearL.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClearL.Location = new System.Drawing.Point(301, 495);
this.btnClearL.Location = new System.Drawing.Point(301, 548);
this.btnClearL.Name = "btnClearL";
this.btnClearL.Size = new System.Drawing.Size(104, 39);
this.btnClearL.TabIndex = 14;
......@@ -369,7 +382,7 @@
//
this.btnLogDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnLogDebug.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLogDebug.Location = new System.Drawing.Point(196, 495);
this.btnLogDebug.Location = new System.Drawing.Point(196, 548);
this.btnLogDebug.Name = "btnLogDebug";
this.btnLogDebug.Size = new System.Drawing.Size(104, 39);
this.btnLogDebug.TabIndex = 13;
......@@ -503,7 +516,7 @@
this.richTextBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.richTextBox1.Location = new System.Drawing.Point(450, 215);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(728, 468);
this.richTextBox1.Size = new System.Drawing.Size(728, 521);
this.richTextBox1.TabIndex = 256;
this.richTextBox1.Text = "";
this.richTextBox1.VisibleChanged += new System.EventHandler(this.richTextBox1_VisibleChanged);
......@@ -645,7 +658,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1184, 687);
this.ClientSize = new System.Drawing.Size(1184, 740);
this.Controls.Add(this.groupBox5);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.richTextBox1);
......@@ -725,6 +738,7 @@
private System.Windows.Forms.Button btnRollerRun;
private System.Windows.Forms.Button btnTranverseRun;
private System.Windows.Forms.Button btnTranverse;
private System.Windows.Forms.Button btnSwitch;
}
}
......@@ -428,13 +428,13 @@ namespace OnlineStore.DISTLineClient
{
if (btnTranverse.Text.Equals("横移机构下降"))
{
IOManager.IOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.LOW);
BtnMove(btnTranverse, "横移机构下降", "横移机构上升", IO_Type.Traverse_Up_SOL);
IOManager.IOMove(IO_Type.Traverse_Down_SOL,IO_VALUE.LOW);
}
else
{
IOManager.IOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.LOW);
BtnMove(btnTranverse, "横移机构上升", "横移机构下降", IO_Type.Traverse_Down_SOL);
IOManager.IOMove(IO_Type.Traverse_Up_SOL,IO_VALUE.LOW);
}
}
......@@ -448,5 +448,19 @@ namespace OnlineStore.DISTLineClient
BtnMove(btnRollerRun, "滚筒电机运转", "滚筒电机停止", IO_Type.Roller_Run);
}
private void btnSwitch_Forward_Click(object sender, EventArgs e)
{
if (btnSwitch.Text.Equals("料串切换气缸前进"))
{
IOManager.IOMove(IO_Type.Switch_Forward, IO_VALUE.LOW);
BtnMove(btnSwitch, "料串切换气缸前进", "料串切换气缸后退", IO_Type.Switch_Back);
}
else
{
IOManager.IOMove(IO_Type.Switch_Back, IO_VALUE.LOW);
BtnMove(btnSwitch, "料串切换气缸后退", "料串切换气缸前进", IO_Type.Switch_Forward);
}
}
}
}
......@@ -301,6 +301,7 @@ namespace OnlineStore.DeviceLibrary
IOManager.CIOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW);
LogUtil.info(" 分盘1线体出口无料架,下降 [" + IO_Type.L1_StopDown + "] [" + StopDownMS + "] 秒");
ol_lastSendShelfTime = DateTime.Now;
StopIOMove(IO_Type.L1_OutStopDown, StopDownMS);
StopIOMove(IO_Type.L1_StopDown, StopDownMS);
}
}
......@@ -316,7 +317,8 @@ namespace OnlineStore.DeviceLibrary
if (IOManager.IOValue(IO_Type.L1_InCheck).Equals(IO_VALUE.LOW))
{
AgvClient.NeedEnter(Config.L1_AgvName, "");
} else
}
else
{
AgvClient.SetToNone(Config.L1_AgvName, "");
}
......@@ -373,43 +375,70 @@ namespace OnlineStore.DeviceLibrary
private static void TranverseProcess()
{
LogUtil.info(" TranverseProcess");
if(IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.PackingShelf_Sig).Equals(IO_VALUE.HIGH))
{
IOManager.CIOMove(IO_Type.Switch_Forward, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.Switch_Back, IO_VALUE.HIGH);
LogUtil.info(" 横移包装料架");
while(IOManager.IOValue(IO_Type.Switch_Back_Sig).Equals(IO_VALUE.LOW))
{
}
LogUtil.info(" 料串气缸到达后退端");
}
else if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.PackingShelf_Sig).Equals(IO_VALUE.LOW))
{
IOManager.CIOMove(IO_Type.Switch_Back, IO_VALUE.LOW);
Thread.Sleep(500);
IOManager.CIOMove(IO_Type.Switch_Forward, IO_VALUE.HIGH);
LogUtil.info(" 横移料串");
while (IOManager.IOValue(IO_Type.Switch_Forward_Sig).Equals(IO_VALUE.LOW))
{
}
LogUtil.info(" 料串气缸到达前进端");
}
if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
{
IOManager.CIOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.LOW);
Thread.Sleep(1000);
IOManager.IOMove(IO_Type.Traverse_Up_SOL,IO_VALUE.HIGH);
Thread.Sleep(1000);
Thread.Sleep(500);
IOManager.IOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.HIGH);
Thread.Sleep(500);
LogUtil.info(" 横移机构上升");
if (IOManager.IOValue(IO_Type.L1_UpDown_Up_Sig).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_UpDown_Up_Sig).Equals(IO_VALUE.HIGH))
while (IOManager.IOValue(IO_Type.L2_UpDown_Up_Sig).Equals(IO_VALUE.LOW))
{
}
IOManager.IOMove(IO_Type.Traverse_Run, IO_VALUE.HIGH);
IOManager.IOMove(IO_Type.Roller_Run, IO_VALUE.HIGH);
LogUtil.info(" 滚筒电机、横移机构电机运行");
}
}
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
while(IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
while (IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
{
if(stopwatch.Elapsed.TotalMinutes >=1)
if (stopwatch.Elapsed.TotalMinutes >= 2)
{
stopwatch.Stop();
IOManager.CIOMove(IO_Type.Traverse_Run, IO_VALUE.LOW);
IOManager.CIOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
LogUtil.info(" 横移机构转移料架超时 [" + IO_Type.L1_StopDown + "] [" + stopwatch.Elapsed.TotalMinutes + "] 分");
break;
//stopwatch.Stop();
//IOManager.CIOMove(IO_Type.Traverse_Run, IO_VALUE.LOW);
//IOManager.CIOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
LogUtil.info(" 横移机构转移料架超时 [" + IO_Type.L1_StopDown + "] 大于2分钟");
//break;
}
}
stopwatch.Stop();
Thread.Sleep(5000);
IOManager.IOMove(IO_Type.Traverse_Run, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.Roller_Run, IO_VALUE.LOW);
LogUtil.info(" 滚筒、横移电机停止");
IOManager.CIOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.HIGH);
Thread.Sleep(1000);
IOManager.CIOMove(IO_Type.Traverse_Down_SOL, IO_VALUE.HIGH);
IOManager.CIOMove(IO_Type.Traverse_Up_SOL, IO_VALUE.LOW);
Thread.Sleep(1000);
LogUtil.info(" 横移机构下降");
LogUtil.info(" TranverseProcess Finish");
}
private Task TranverseTask = new Task(new Action(TranverseProcess));
private Task TranverseTask;
//private void LedProcess()
//{
// try
......@@ -445,6 +474,7 @@ namespace OnlineStore.DeviceLibrary
//}
//private IO_VALUE LastResetValue = IO_VALUE.LOW;
private Stopwatch ol_tranverseShelfWatch = new Stopwatch();
public void IoCheckProcess()
{
DateTime time = DateTime.Now;
......@@ -453,25 +483,25 @@ namespace OnlineStore.DeviceLibrary
{
if (IOManager.IOValue(IO_Type.L1_OutCheck).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.L2_InCheck).Equals(IO_VALUE.LOW))
{
//if (LineManager.checkWatch(il_manualCheckWatch, 2000))
//{
// IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW);
// IOManager.IOMove(IO_Type.L1_OutStopDown, IO_VALUE.HIGH);
//}
if(TranverseTask.Status.Equals(TaskStatus.Created))
if (LineManager.checkWatch(ol_tranverseShelfWatch, 2000))
{
if (TranverseTask == null)
{
TranverseTask.Start();
TranverseTask = Task.Factory.StartNew(new Action(TranverseProcess));
il_lastCallAgvTime = DateTime.Now;
}
else if(TranverseTask.IsCompleted)
else if (TranverseTask.IsCompleted)
{
TranverseTask.Start();
TranverseTask = Task.Factory.StartNew(new Action(TranverseProcess));
il_lastCallAgvTime = DateTime.Now;
}
}
}
}
else
{
//IOManager.CIOMove(IO_Type.L1_OutStopDown, IO_VALUE.LOW);
//IOManager.IOMove(IO_Type.L1_StopDown, IO_VALUE.LOW);
ol_tranverseShelfWatch.Stop();
}
//if (runStatus.Equals(RunStatus.Wait))
//{
......@@ -622,7 +652,7 @@ namespace OnlineStore.DeviceLibrary
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("rfid", rfid);
string addr = GetAddr(api_communication, paramMap ) ;
string addr = GetAddr(api_communication, paramMap);
string resultStr = HttpHelper.Post(addr, "");
string log = "distRfid 【" + addr + "】【" + resultStr + "】";
if (lastLog.Equals(log).Equals(false))
......
......@@ -93,8 +93,8 @@ namespace OnlineStore.DeviceLibrary
{
Task.Factory.StartNew(delegate
{
// SetStatus(id, "", ClientAction.MayEnter);
LogUtil.info(logName + " ,等待OutL_InCheck");
SetStatus(id, "", ClientAction.MayEnter);
LogUtil.info(logName + " ,等待L1_InCheck");
try
{
WaitUtil.Wait(60000, delegate
......@@ -133,7 +133,7 @@ namespace OnlineStore.DeviceLibrary
LineManager.DISTLine.UpdateSleep(false);
LineManager.DISTLine.StopIOMove(IO_Type.L2_OutStopDown, 1500);
//agvClient.MayLeave(id);
// SetStatus(id, shefId, ClientAction.MayLeave);
SetStatus(id, shefId, ClientAction.MayLeave);
LogUtil.info(logName + "下降 L2_OutStopDown , " + shefId);
Task.Factory.StartNew(delegate
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!