Commit b0293b59 LN

界面调整

1 个父辈 73c46d62
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
this.chbAutoIn.Name = "chbAutoIn"; this.chbAutoIn.Name = "chbAutoIn";
this.chbAutoIn.Size = new System.Drawing.Size(154, 24); this.chbAutoIn.Size = new System.Drawing.Size(154, 24);
this.chbAutoIn.TabIndex = 289; this.chbAutoIn.TabIndex = 289;
this.chbAutoIn.Text = "检测到料自动取料"; this.chbAutoIn.Text = "检测到料自动取料";
this.chbAutoIn.UseVisualStyleBackColor = true; this.chbAutoIn.UseVisualStyleBackColor = true;
this.chbAutoIn.CheckedChanged += new System.EventHandler(this.chbAutoIn_CheckedChanged); this.chbAutoIn.CheckedChanged += new System.EventHandler(this.chbAutoIn_CheckedChanged);
// //
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
this.btnUpdateShelf.Name = "btnUpdateShelf"; this.btnUpdateShelf.Name = "btnUpdateShelf";
this.btnUpdateShelf.Size = new System.Drawing.Size(110, 40); this.btnUpdateShelf.Size = new System.Drawing.Size(110, 40);
this.btnUpdateShelf.TabIndex = 281; this.btnUpdateShelf.TabIndex = 281;
this.btnUpdateShelf.Text = "更改料号"; this.btnUpdateShelf.Text = "更改料号";
this.btnUpdateShelf.UseVisualStyleBackColor = false; this.btnUpdateShelf.UseVisualStyleBackColor = false;
this.btnUpdateShelf.Visible = false; this.btnUpdateShelf.Visible = false;
this.btnUpdateShelf.Click += new System.EventHandler(this.btnUpdateShelf_Click); this.btnUpdateShelf.Click += new System.EventHandler(this.btnUpdateShelf_Click);
......
...@@ -526,10 +526,10 @@ namespace OnlineStore.AutoCountClient ...@@ -526,10 +526,10 @@ namespace OnlineStore.AutoCountClient
private void btnUpdateShelf_Click(object sender, EventArgs e) private void btnUpdateShelf_Click(object sender, EventArgs e)
{ {
//string shel = txtShelfID.Text.Trim(); //string shel = txtShelfID.Text.Trim();
//DialogResult result = MessageBox.Show("确定更改当前料号为:" + shel + "?", "", MessageBoxButtons.YesNo); //DialogResult result = MessageBox.Show("确定更改当前料号为:" + shel + "?", "", MessageBoxButtons.YesNo);
//if (result.Equals(DialogResult.Yes)) //if (result.Equals(DialogResult.Yes))
//{ //{
// LogUtil.info(equipBean.Name + "旧料架号【" + equipBean.CurrShelfId + "】手动更改料架号为【" + shel + "】"); // LogUtil.info(equipBean.Name + "旧料串号【" + equipBean.CurrShelfId + "】手动更改料串号为【" + shel + "】");
// equipBean.CurrShelfId = shel; // equipBean.CurrShelfId = shel;
//} //}
} }
...@@ -735,7 +735,7 @@ namespace OnlineStore.AutoCountClient ...@@ -735,7 +735,7 @@ namespace OnlineStore.AutoCountClient
bool isCheck = chbAutoIn.Checked; bool isCheck = chbAutoIn.Checked;
equipBean.AutoInput = isCheck; equipBean.AutoInput = isCheck;
ConfigAppSettings.SaveValue(Setting_Init.AutoInput, (isCheck ? 1 : 0)); ConfigAppSettings.SaveValue(Setting_Init.AutoInput, (isCheck ? 1 : 0));
LogUtil.info(equipBean.Name + "用户切换 检测到料自动取料 =" + isCheck); LogUtil.info(equipBean.Name + "用户切换 检测到料自动取料 =" + isCheck);
} }
} }
......
...@@ -900,7 +900,7 @@ ...@@ -900,7 +900,7 @@
this.chbAutoSend.Name = "chbAutoSend"; this.chbAutoSend.Name = "chbAutoSend";
this.chbAutoSend.Size = new System.Drawing.Size(140, 24); this.chbAutoSend.Size = new System.Drawing.Size(140, 24);
this.chbAutoSend.TabIndex = 290; this.chbAutoSend.TabIndex = 290;
this.chbAutoSend.Text = "放料完成送出料"; this.chbAutoSend.Text = "放料完成送出料";
this.chbAutoSend.UseVisualStyleBackColor = true; this.chbAutoSend.UseVisualStyleBackColor = true;
this.chbAutoSend.CheckedChanged += new System.EventHandler(this.chbAutoSend_CheckedChanged); this.chbAutoSend.CheckedChanged += new System.EventHandler(this.chbAutoSend_CheckedChanged);
// //
...@@ -1432,7 +1432,7 @@ ...@@ -1432,7 +1432,7 @@
this.groupBox9.Controls.Add(this.btnBP1); this.groupBox9.Controls.Add(this.btnBP1);
this.groupBox9.Controls.Add(this.btnBP2); this.groupBox9.Controls.Add(this.btnBP2);
this.groupBox9.Controls.Add(this.txtBP2); this.groupBox9.Controls.Add(this.txtBP2);
this.groupBox9.Location = new System.Drawing.Point(451, 313); this.groupBox9.Location = new System.Drawing.Point(451, 325);
this.groupBox9.Name = "groupBox9"; this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(268, 152); this.groupBox9.Size = new System.Drawing.Size(268, 152);
this.groupBox9.TabIndex = 321; this.groupBox9.TabIndex = 321;
...@@ -1534,7 +1534,7 @@ ...@@ -1534,7 +1534,7 @@
this.btnOpenAllAxis.BackColor = System.Drawing.Color.White; this.btnOpenAllAxis.BackColor = System.Drawing.Color.White;
this.btnOpenAllAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnOpenAllAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenAllAxis.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnOpenAllAxis.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenAllAxis.Location = new System.Drawing.Point(12, 320); this.btnOpenAllAxis.Location = new System.Drawing.Point(12, 332);
this.btnOpenAllAxis.Name = "btnOpenAllAxis"; this.btnOpenAllAxis.Name = "btnOpenAllAxis";
this.btnOpenAllAxis.Size = new System.Drawing.Size(166, 40); this.btnOpenAllAxis.Size = new System.Drawing.Size(166, 40);
this.btnOpenAllAxis.TabIndex = 319; this.btnOpenAllAxis.TabIndex = 319;
...@@ -1547,7 +1547,7 @@ ...@@ -1547,7 +1547,7 @@
this.btnBSave.BackColor = System.Drawing.Color.White; this.btnBSave.BackColor = System.Drawing.Color.White;
this.btnBSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBSave.ForeColor = System.Drawing.Color.Black; this.btnBSave.ForeColor = System.Drawing.Color.Black;
this.btnBSave.Location = new System.Drawing.Point(260, 351); this.btnBSave.Location = new System.Drawing.Point(260, 363);
this.btnBSave.Name = "btnBSave"; this.btnBSave.Name = "btnBSave";
this.btnBSave.Size = new System.Drawing.Size(166, 40); this.btnBSave.Size = new System.Drawing.Size(166, 40);
this.btnBSave.TabIndex = 310; this.btnBSave.TabIndex = 310;
...@@ -1560,7 +1560,7 @@ ...@@ -1560,7 +1560,7 @@
this.btnCloseAxis.BackColor = System.Drawing.Color.White; this.btnCloseAxis.BackColor = System.Drawing.Color.White;
this.btnCloseAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCloseAxis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCloseAxis.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnCloseAxis.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCloseAxis.Location = new System.Drawing.Point(12, 362); this.btnCloseAxis.Location = new System.Drawing.Point(12, 374);
this.btnCloseAxis.Name = "btnCloseAxis"; this.btnCloseAxis.Name = "btnCloseAxis";
this.btnCloseAxis.Size = new System.Drawing.Size(166, 40); this.btnCloseAxis.Size = new System.Drawing.Size(166, 40);
this.btnCloseAxis.TabIndex = 320; this.btnCloseAxis.TabIndex = 320;
...@@ -1827,10 +1827,10 @@ ...@@ -1827,10 +1827,10 @@
// //
// axisMoveControl1 // axisMoveControl1
// //
this.axisMoveControl1.Location = new System.Drawing.Point(3, 4); this.axisMoveControl1.Location = new System.Drawing.Point(3, 5);
this.axisMoveControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.axisMoveControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.axisMoveControl1.Name = "axisMoveControl1"; this.axisMoveControl1.Name = "axisMoveControl1";
this.axisMoveControl1.Size = new System.Drawing.Size(728, 305); this.axisMoveControl1.Size = new System.Drawing.Size(728, 310);
this.axisMoveControl1.TabIndex = 0; this.axisMoveControl1.TabIndex = 0;
// //
// btnStop // btnStop
......
...@@ -727,7 +727,7 @@ namespace OnlineStore.AutoCountClient ...@@ -727,7 +727,7 @@ namespace OnlineStore.AutoCountClient
{ {
bool isCheck = chbAutoSend.Checked; bool isCheck = chbAutoSend.Checked;
equipBean.AutoSendShelfOut = isCheck; equipBean.AutoSendShelfOut = isCheck;
LogUtil.info(equipBean.Name + "用户切换 放料完成送出料 =" + isCheck); LogUtil.info(equipBean.Name + "用户切换 放料完成送出料 =" + isCheck);
} }
} }
......
...@@ -105,9 +105,9 @@ namespace OnlineStore.AutoCountClient ...@@ -105,9 +105,9 @@ namespace OnlineStore.AutoCountClient
this.listView1.Columns.Clear(); this.listView1.Columns.Clear();
AddHealder("设备名称", 90); AddHealder("设备名称", 90);
AddHealder("启用", 50); AddHealder("启用", 50);
AddHealder("报警", 110); AddHealder("报警", 130);
AddHealder("状态", 110); AddHealder("状态", 110);
AddHealder("料盘信息", listView1.Size.Width - 110 - 110 - 50 - 90 - 10); AddHealder("料盘信息", listView1.Size.Width - 110 - 130 - 50 - 90 - 10);
//AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8); //AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8);
AddRow(robot.inputEquip, robot.inputEquip.IsDebug); AddRow(robot.inputEquip, robot.inputEquip.IsDebug);
......
...@@ -91,9 +91,9 @@ ...@@ -91,9 +91,9 @@
this.groupAxis.Controls.Add(this.panel1); this.groupAxis.Controls.Add(this.panel1);
this.groupAxis.Controls.Add(this.lblServerOn); this.groupAxis.Controls.Add(this.lblServerOn);
this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupAxis.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupAxis.Location = new System.Drawing.Point(9, 4); this.groupAxis.Location = new System.Drawing.Point(4, 3);
this.groupAxis.Name = "groupAxis"; this.groupAxis.Name = "groupAxis";
this.groupAxis.Size = new System.Drawing.Size(716, 309); this.groupAxis.Size = new System.Drawing.Size(724, 302);
this.groupAxis.TabIndex = 218; this.groupAxis.TabIndex = 218;
this.groupAxis.TabStop = false; this.groupAxis.TabStop = false;
this.groupAxis.Text = "伺服运动"; this.groupAxis.Text = "伺服运动";
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
this.groupBox1.Controls.Add(this.txtHomeSingle); this.groupBox1.Controls.Add(this.txtHomeSingle);
this.groupBox1.Location = new System.Drawing.Point(553, 12); this.groupBox1.Location = new System.Drawing.Point(553, 12);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(154, 290); this.groupBox1.Size = new System.Drawing.Size(154, 282);
this.groupBox1.TabIndex = 302; this.groupBox1.TabIndex = 302;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "状态"; this.groupBox1.Text = "状态";
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
// //
this.btnGetAlarm.BackColor = System.Drawing.Color.White; this.btnGetAlarm.BackColor = System.Drawing.Color.White;
this.btnGetAlarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnGetAlarm.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGetAlarm.Location = new System.Drawing.Point(35, 251); this.btnGetAlarm.Location = new System.Drawing.Point(35, 245);
this.btnGetAlarm.Name = "btnGetAlarm"; this.btnGetAlarm.Name = "btnGetAlarm";
this.btnGetAlarm.Size = new System.Drawing.Size(110, 34); this.btnGetAlarm.Size = new System.Drawing.Size(110, 34);
this.btnGetAlarm.TabIndex = 284; this.btnGetAlarm.TabIndex = 284;
...@@ -680,7 +680,7 @@ ...@@ -680,7 +680,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.groupAxis); this.Controls.Add(this.groupAxis);
this.Name = "AxisMoveControl"; this.Name = "AxisMoveControl";
this.Size = new System.Drawing.Size(731, 317); this.Size = new System.Drawing.Size(731, 310);
this.groupAxis.ResumeLayout(false); this.groupAxis.ResumeLayout(false);
this.groupAxis.PerformLayout(); this.groupAxis.PerformLayout();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
2.入料模块上料BUG:批量轴上料功能完善。 2.入料模块上料BUG:批量轴上料功能完善。
1.检测到料自动入库时,取料测试按钮不可用。 1.检测到料自动入库时,取料测试按钮不可用。
2.自动入库时,目标位置在界面上可选。 2.自动入库时,目标位置在界面上可选。
3.X光机互锁信号增加验证。 3.X光机互锁信号增加验证。
4.入料模块复位时,需要先下降顶升气缸,防止伺服报警。 4.入料模块复位时,需要先下降顶升气缸,防止伺服报警。
......
...@@ -68,7 +68,7 @@ namespace OnlineStore.Common ...@@ -68,7 +68,7 @@ namespace OnlineStore.Common
public static string ServerAddr = "ServerAddr"; public static string ServerAddr = "ServerAddr";
/// <summary> /// <summary>
/// 检测到料自动入料 /// 检测到料自动入料
/// </summary> /// </summary>
public static string AutoInput = "AutoInput"; public static string AutoInput = "AutoInput";
/// <summary> /// <summary>
......
...@@ -236,15 +236,15 @@ namespace OnlineStore.Common ...@@ -236,15 +236,15 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public static string cutReel = "cutReel"; public static string cutReel = "cutReel";
/// <summary> /// <summary>
/// smallReel: true 小料(7x8),放置到小料 /// smallReel: true 小料(7x8),放置到小料
/// </summary> /// </summary>
public static string smallReel = "smallReel"; public static string smallReel = "smallReel";
/// <summary> /// <summary>
/// rfid: 分配的料RFID /// rfid: 分配的料RFID
/// </summary> /// </summary>
public static string rfid = "rfid"; public static string rfid = "rfid";
/// <summary> /// <summary>
/// rfidLoc: 料的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线, /// rfidLoc: 料的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线 /// 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
/// </summary> /// </summary>
public static string rfidLoc = "rfidLoc"; public static string rfidLoc = "rfidLoc";
......
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
<Compile Include="deviceLibrary\IO\AIOBOX\AIOBOXManager.cs" /> <Compile Include="deviceLibrary\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="deviceLibrary\IO\IOManager.cs" /> <Compile Include="deviceLibrary\IO\IOManager.cs" />
<Compile Include="bean\RobotBean.cs" /> <Compile Include="bean\RobotBean.cs" />
<Compile Include="bean\RobotBean_Partial.cs" />
<Compile Include="bean\X_RAY_Equip.cs" /> <Compile Include="bean\X_RAY_Equip.cs" />
<Compile Include="bean\X_RAY_Equip_Partial.cs" /> <Compile Include="bean\X_RAY_Equip_Partial.cs" />
<Compile Include="bean\EquipBase.cs" /> <Compile Include="bean\EquipBase.cs" />
......
...@@ -16,6 +16,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,6 +16,9 @@ namespace OnlineStore.DeviceLibrary
{ {
public partial class RobotBean : RobotBase public partial class RobotBean : RobotBase
{ {
#region 初始化
public bool IsDebug = false; public bool IsDebug = false;
public InputEquip inputEquip; public InputEquip inputEquip;
...@@ -24,8 +27,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -24,8 +27,6 @@ namespace OnlineStore.DeviceLibrary
public Dictionary<int, EquipBase> equipsMap = new Dictionary<int, EquipBase>(); public Dictionary<int, EquipBase> equipsMap = new Dictionary<int, EquipBase>();
public Robot_Config Config = null; public Robot_Config Config = null;
#region 初始化
private bool canStart = false; private bool canStart = false;
public RobotBean(Robot_Config lineConfig, InputEquip_Config fconfig, XRay_Config xconfig, OutputEquip_Config pconfig) public RobotBean(Robot_Config lineConfig, InputEquip_Config fconfig, XRay_Config xconfig, OutputEquip_Config pconfig)
...@@ -82,6 +83,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,6 +83,7 @@ namespace OnlineStore.DeviceLibrary
} }
return ""; return "";
} }
#region 启动和复位
public override bool StartRun() public override bool StartRun()
{ {
...@@ -107,7 +109,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -107,7 +109,7 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(5); Thread.Sleep(5);
mainTimer.Interval = 1000; mainTimer.Interval = 1000;
maxSeconds = 10; maxSeconds = 10;
alarmType = AlarmType.None; alarmType = AlarmType.None;
mainTimer.Enabled = false; mainTimer.Enabled = false;
isInSuddenDown = false; isInSuddenDown = false;
...@@ -127,7 +129,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -127,7 +129,9 @@ namespace OnlineStore.DeviceLibrary
EquipStartRun(moveEquip); EquipStartRun(moveEquip);
} }
if (runStatus.Equals(RobotRunStatus.Wait)) if (runStatus.Equals(RobotRunStatus.Wait))
{ return false; } {
return false;
}
RFIDManager.Open(new string[] { }); RFIDManager.Open(new string[] { });
mainTimer.Enabled = true; mainTimer.Enabled = true;
return true; return true;
...@@ -145,7 +149,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -145,7 +149,7 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(60); Thread.Sleep(60);
} }
} }
public override bool Reset() public override bool Reset()
{ {
...@@ -165,12 +169,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -165,12 +169,12 @@ namespace OnlineStore.DeviceLibrary
//停止运动 //停止运动
MoveInfo.EndMove(); MoveInfo.EndMove();
runStatus = RobotRunStatus.Reset; runStatus = RobotRunStatus.Reset;
//重置通用处理 //重置通用处理
mainTimer.Interval = 1000; mainTimer.Interval = 1000;
maxSeconds = 10; maxSeconds = 10;
alarmType = AlarmType.None; alarmType = AlarmType.None;
mainTimer.Enabled = false; mainTimer.Enabled = false;
isInSuddenDown = false; isInSuddenDown = false;
...@@ -210,30 +214,64 @@ namespace OnlineStore.DeviceLibrary ...@@ -210,30 +214,64 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.info(Name + "收到复位信号," + equip.Name + " 正常无报警,不需要复位"); LogUtil.info(Name + "收到复位信号," + equip.Name + " 正常无报警,不需要复位");
} }
} }
} }
internal override void StopMove()
protected override void ResetProcess()
{ {
MoveInfo.EndMove(); if (MoveInfo.IsInWait)
foreach (EquipBase equip in this.equipsMap.Values)
{ {
if (!equip.IsDebug) CheckWait(MoveInfo);
}
if (!MoveInfo.IsInWait)
{
bool isOk = true;
string msg = "";
//判断是否所有的已经返回完成
TimeSpan span = DateTime.Now - MoveInfo.LastSetpTime;
foreach (EquipBase moveEquip in this.equipsMap.Values)
{ {
equip.StopRun(); if (moveEquip.runStatus.Equals(RobotRunStatus.HomeMoving) || moveEquip.runStatus.Equals(RobotRunStatus.Reset) || moveEquip.runStatus.Equals(RobotRunStatus.Wait))
{
if (moveEquip.NoAlarm())
{
msg = moveEquip.Name + "复位结束";
isOk = false;
break;
}
else
{
//LogUtil.error(Name + " " + moveEquip.Name + "在复位过程中报警,需要重新复位,调用 moveEquip.Reset();");
//moveEquip.Reset();
////如果小于80秒,继续等待
//if (span.TotalSeconds < 80)
//{
// isOk = false;
// break;
//}
}
}
}
if (isOk)
{
runStatus = RobotRunStatus.Runing;
MoveInfo.EndMove();
mainTimer.Interval = 300;
maxSeconds = 3;
AgvClient.SetCancelState(AgvClient.CurrCancelState);
LogUtil.info(Name + "复位完成 [" + FormUtil.GetSpanStr(span) + "]");
}
else if (span.TotalSeconds > 120)
{
WarnMsg = Name + "[" + MoveInfo.MoveStep + "][" + msg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 903);
Alarm(AlarmType.IoSingleTimeOut);
} }
} }
} }
public override void StopRun() #endregion
{
mainTimer.Enabled = false;
StopMove();
AgvClient.SetCancelState(true);
RFIDManager.Close();
runStatus = RobotRunStatus.Wait;
TimeSpan span = DateTime.Now - StartTime;
LogUtil.info(Name + ",停止运行,总运行时间:" + span.ToString());
}
private bool busyPro = false; private bool busyPro = false;
private DateTime busyProTime = DateTime.Now; private DateTime busyProTime = DateTime.Now;
...@@ -283,59 +321,232 @@ namespace OnlineStore.DeviceLibrary ...@@ -283,59 +321,232 @@ namespace OnlineStore.DeviceLibrary
} }
protected override void ResetProcess() #region 停止运动
internal override void StopMove()
{ {
if (MoveInfo.IsInWait) MoveInfo.EndMove();
foreach (EquipBase equip in this.equipsMap.Values)
{ {
CheckWait(MoveInfo); if (!equip.IsDebug)
{
equip.StopRun();
}
} }
if (!MoveInfo.IsInWait) }
public override void StopRun()
{
mainTimer.Enabled = false;
StopMove();
AgvClient.SetCancelState(true);
RFIDManager.Close();
runStatus = RobotRunStatus.Wait;
TimeSpan span = DateTime.Now - StartTime;
LogUtil.info(Name + ",停止运行,总运行时间:" + span.ToString());
}
#endregion
#region IOTimeOutProcess
private DateTime preIoTimerOutTime = DateTime.Now;
private void IOTimeOutProcess()
{
try
{
TimeSpan span = DateTime.Now - preIoTimerOutTime;
if (span.TotalSeconds > 1 && alarmType.Equals(AlarmType.IoSingleTimeOut))
{
preIoTimerOutTime = DateTime.Now;
if (runStatus < RobotRunStatus.Runing || isInSuddenDown || isNoAirCheck)
{
return;
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
// if (MoveInfo.IsInWait.Equals(false) && SW41_MoveInfo.IsInWait.Equals(false) && SW23_MoveInfo.IsInWait.Equals(false))
{
LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 ");
alarmType = AlarmType.None;
SetWarnMsg("");
}
}
}
catch (Exception ex)
{
LogUtil.error("IOTimeOutProcess出错:", ex);
}
}
#endregion
#region CheckWait
private DateTime preRWTime = DateTime.Now;
private void CheckWait(RobotMoveInfo checkWaitInfo)
{
try
{ {
List<WaitResultInfo> list = checkWaitInfo.WaitList;
if (list.Count <= 0)
{
checkWaitInfo.EndStepWait();
return;
}
//当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - checkWaitInfo.LastSetpTime;
string NotOkMsg = "";
bool isOk = true; bool isOk = true;
string msg = ""; if (checkWaitInfo.OneWaitCanEndStep)
//判断是否所有的已经返回完成
TimeSpan span = DateTime.Now - MoveInfo.LastSetpTime;
foreach (EquipBase moveEquip in this.equipsMap.Values)
{ {
if (moveEquip.runStatus.Equals(RobotRunStatus.HomeMoving) || moveEquip.runStatus.Equals(RobotRunStatus.Reset) || moveEquip.runStatus.Equals(RobotRunStatus.Wait)) isOk = false;
}
foreach (WaitResultInfo wait in list)
{
if (wait == null || wait.IsEnd)
{ {
if (moveEquip.NoAlarm()) continue;
}
NotOkMsg = " [" + wait.ToStr() + "] ";
if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{
NotOkMsg = " [" + IOManager.GetDI(wait.IoType, DeviceID).DisplayStr + "=" + wait.IoValue + "] ";
wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue);
if (!wait.IsEnd)
{ {
msg = moveEquip.Name + "复位结束"; TimeSpan rwSpan = DateTime.Now - preRWTime;
isOk = false; //一分钟还未检测到
if (span.TotalSeconds > RobotManager.Config.IOSingle_TimerOut && NoAlarm())
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "[" + checkWaitInfo.MoveStep + "]等待" + NotOkMsg + " 超时";
Alarm(AlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, 901);
}
//超过报警时长
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < RobotManager.Config.IOSingle_TimerOut * 2)
{
preRWTime = DateTime.Now;
string msg = checkWaitInfo.Name + " " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds, 1) + "秒,重写DO:";
bool isLog = false;
foreach (WaitResultInfo ww in list)
{
if (ww != null && ww.WaitType.Equals(2) && baseConfig.DOList.ContainsKey(ww.IoType))
{
if (IOManager.DOValue(ww.IoType, baseConfig.Id).Equals(ww.IoValue).Equals(false))
{
isLog = true;
IOMove(ww.IoType, ww.IoValue);
msg += ww.ToStr() + ",";
}
}
}
if (isLog)
{
LogUtil.error(msg);
}
}
if (!checkWaitInfo.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
if (wait.IsEnd)
{
if (checkWaitInfo.OneWaitCanEndStep)
{
isOk = true;
break; break;
} }
else }
else
{
if (!checkWaitInfo.OneWaitCanEndStep)
{ {
//LogUtil.error(Name + " " + moveEquip.Name + "在复位过程中报警,需要重新复位,调用 moveEquip.Reset();"); isOk = false;
//moveEquip.Reset(); break;
////如果小于80秒,继续等待
//if (span.TotalSeconds < 80)
//{
// isOk = false;
// break;
//}
} }
} }
} }
if (isOk) if (isOk)
{ {
runStatus = RobotRunStatus.Runing; checkWaitInfo.EndStepWait();
MoveInfo.EndMove();
mainTimer.Interval = 300;
maxSeconds = 3;
AgvClient.SetCancelState(AgvClient.CurrCancelState);
LogUtil.info(Name + "复位完成 [" + FormUtil.GetSpanStr(span) + "]");
} }
else if (span.TotalSeconds > 120) else if (span.TotalSeconds > checkWaitInfo.TimeOutSeconds)
{ {
WarnMsg = Name + "[" + MoveInfo.MoveStep + "][" + msg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒"; WarnMsg = checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 903); LogUtil.error(WarnMsg, 900);
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
} }
} }
catch (Exception ex)
{
LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:", ex);
}
}
#endregion
#region 忙碌处理
public override bool StartLabelling(WorkParam param)
{
return true;
}
protected override void LabellingProcess()
{
}
public override bool StartWorking(WorkParam param)
{
return true;
}
protected override void WorkingProcess()
{
}
private void InOutLog(string msg)
{
LogUtil.debug(Name + msg);
}
#endregion
public DateTime LastAlarmTime = DateTime.Now;
public override void Alarm(AlarmType alarmType)
{
if (alarmType.Equals(AlarmType.None).Equals(false))
{
LastAlarmTime = DateTime.Now;
}
if (this.alarmType.Equals(alarmType))
{
return;
}
if (alarmType.Equals(AlarmType.SuddenStop))
{
isInSuddenDown = true;
}
else if (alarmType.Equals(AlarmType.NoAirCheck))
{
isNoAirCheck = true;
}
this.alarmType = alarmType;
if (alarmType.Equals(AlarmType.SuddenStop) || alarmType.Equals(AlarmType.NoAirCheck) || alarmType.Equals(AlarmType.AxisAlarm))
{
StopMove();
}
} }
} }
} }
\ No newline at end of file \ No newline at end of file
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
partial class RobotBean
{
#region 定时处理方法
private DateTime preIoTimerOutTime = DateTime.Now;
private void IOTimeOutProcess()
{
try
{
TimeSpan span = DateTime.Now - preIoTimerOutTime;
if (span.TotalSeconds > 1 && alarmType.Equals(AlarmType.IoSingleTimeOut))
{
preIoTimerOutTime = DateTime.Now;
if (runStatus < RobotRunStatus.Runing || isInSuddenDown || isNoAirCheck)
{
return;
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
// if (MoveInfo.IsInWait.Equals(false) && SW41_MoveInfo.IsInWait.Equals(false) && SW23_MoveInfo.IsInWait.Equals(false))
{
LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 ");
alarmType = AlarmType.None;
SetWarnMsg("");
}
}
}
catch (Exception ex)
{
LogUtil.error("IOTimeOutProcess出错:", ex);
}
}
private DateTime preRWTime = DateTime.Now;
private void CheckWait(RobotMoveInfo checkWaitInfo)
{
try
{
List<WaitResultInfo> list = checkWaitInfo.WaitList;
if (list.Count <= 0)
{
checkWaitInfo.EndStepWait();
return;
}
//当等待超过一分钟时,需要打印提示
TimeSpan span = DateTime.Now - checkWaitInfo.LastSetpTime;
string NotOkMsg = "";
bool isOk = true;
if (checkWaitInfo.OneWaitCanEndStep)
{
isOk = false;
}
foreach (WaitResultInfo wait in list)
{
if (wait == null || wait.IsEnd)
{
continue;
}
NotOkMsg = " [" + wait.ToStr() + "] ";
if (wait.WaitType.Equals(WaitEnum.W002_IOValue))
{
NotOkMsg = " [" + IOManager.GetDI(wait.IoType, DeviceID).DisplayStr + "=" + wait.IoValue + "] ";
wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue);
if (!wait.IsEnd)
{
TimeSpan rwSpan = DateTime.Now - preRWTime;
//一分钟还未检测到
if (span.TotalSeconds > RobotManager.Config.IOSingle_TimerOut && NoAlarm())
{
ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = Name + "[" + checkWaitInfo.MoveStep + "]等待" + NotOkMsg + " 超时";
Alarm(AlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, 901);
}
//超过报警时长
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < RobotManager.Config.IOSingle_TimerOut * 2)
{
preRWTime = DateTime.Now;
string msg = checkWaitInfo.Name + " " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds,1) + "秒,重写DO:";
bool isLog = false;
foreach (WaitResultInfo ww in list)
{
if (ww != null && ww.WaitType.Equals(2) && baseConfig.DOList.ContainsKey(ww.IoType))
{
if (IOManager.DOValue(ww.IoType, baseConfig.Id).Equals(ww.IoValue).Equals(false))
{
isLog = true;
IOMove(ww.IoType, ww.IoValue);
msg += ww.ToStr() + ",";
}
}
}
if (isLog)
{
LogUtil.error(msg);
}
}
if (!checkWaitInfo.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
else if (wait.WaitType.Equals(WaitEnum.W003_Time))
{
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}
if (wait.IsEnd)
{
if (checkWaitInfo.OneWaitCanEndStep)
{
isOk = true;
break;
}
}
else
{
if (!checkWaitInfo.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
if (isOk)
{
checkWaitInfo.EndStepWait();
}
else if (span.TotalSeconds > checkWaitInfo.TimeOutSeconds)
{
WarnMsg = checkWaitInfo.Name + "[" + checkWaitInfo.MoveStep + "][" + NotOkMsg + "]已等待[" + Math.Round(span.TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, 900);
Alarm(AlarmType.IoSingleTimeOut);
}
}
catch (Exception ex)
{
LogUtil.error(checkWaitInfo.Name + " [" + checkWaitInfo.MoveStep + "] CheckWait 出错:", ex);
}
}
#endregion
public override bool StartLabelling(WorkParam param)
{
return true;
}
protected override void LabellingProcess()
{
}
public override bool StartWorking(WorkParam param)
{
return true;
}
protected override void WorkingProcess()
{
}
private void InOutLog(string msg)
{
LogUtil.debug(Name + msg);
}
public override void Alarm(AlarmType alarmType)
{
}
}
}
...@@ -132,7 +132,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -132,7 +132,7 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("UpdownAxis_P2_R")] [ConfigProAttribute("UpdownAxis_P2_R")]
public int UpdownAxis_P2_R { get; set; } public int UpdownAxis_P2_R { get; set; }
/// <summary> /// <summary>
/// PRO,0,取料升降轴料上方P3取料/放料位置,UpdownAxis_P3,20000,,,,, /// PRO,0,取料升降轴料上方P3取料/放料位置,UpdownAxis_P3,20000,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("UpdownAxis_P3", true)] [ConfigProAttribute("UpdownAxis_P3", true)]
public int UpdownAxis_P3 { get; set; } public int UpdownAxis_P3 { get; set; }
......
...@@ -29,12 +29,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -29,12 +29,12 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary> /// <summary>
/// PRO,0,空料入口AGV站号名称,AgvInName,F3,,,,, /// PRO,0,空料入口AGV站号名称,AgvInName,F3,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("AgvInName")] [ConfigProAttribute("AgvInName")]
public string AgvInName { get; set; } public string AgvInName { get; set; }
/// <summary> /// <summary>
/// PRO,0,料出口AGV站号名称,AgvOutName,F4,,,,, /// PRO,0,料出口AGV站号名称,AgvOutName,F4,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("AgvOutName")] [ConfigProAttribute("AgvOutName")]
public string AgvOutName { get; set; } public string AgvOutName { get; set; }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!