Commit fa5015d9 LN

节拍优化

1 个父辈 f17ebf35
...@@ -30,9 +30,17 @@ ...@@ -30,9 +30,17 @@
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAnalyze)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAnalyze));
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label4 = new System.Windows.Forms.Label();
this.btnExport = new System.Windows.Forms.Button(); this.btnExport = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.Column_Num = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Data = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Count = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Width = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Height = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_ImageName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.txtCode = new System.Windows.Forms.TextBox(); this.txtCode = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.btnBack = new System.Windows.Forms.Button(); this.btnBack = new System.Windows.Forms.Button();
...@@ -42,13 +50,6 @@ ...@@ -42,13 +50,6 @@
this.dtpStartTime = new System.Windows.Forms.DateTimePicker(); this.dtpStartTime = new System.Windows.Forms.DateTimePicker();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.Column_Num = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Data = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Count = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Width = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Height = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_ImageName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.btnExport); this.groupBox1.Controls.Add(this.btnExport);
this.groupBox1.Controls.Add(this.panel2); this.groupBox1.Controls.Add(this.panel2);
this.groupBox1.Controls.Add(this.txtCode); this.groupBox1.Controls.Add(this.txtCode);
...@@ -70,18 +72,29 @@ ...@@ -70,18 +72,29 @@
this.groupBox1.Controls.Add(this.dtpStartTime); this.groupBox1.Controls.Add(this.dtpStartTime);
this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(5, 6); this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(1266, 586); this.groupBox1.Size = new System.Drawing.Size(1271, 591);
this.groupBox1.TabIndex = 1; this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
this.groupBox1.Text = "查看点料记录"; this.groupBox1.Text = "查看点料记录";
// //
// label4
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(7, 67);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(1249, 17);
this.label4.TabIndex = 20;
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnExport // btnExport
// //
this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnExport.Location = new System.Drawing.Point(970, 29); this.btnExport.Location = new System.Drawing.Point(975, 24);
this.btnExport.Name = "btnExport"; this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(114, 35); this.btnExport.Size = new System.Drawing.Size(114, 35);
this.btnExport.TabIndex = 19; this.btnExport.TabIndex = 19;
...@@ -98,7 +111,7 @@ ...@@ -98,7 +111,7 @@
this.panel2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.panel2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panel2.Location = new System.Drawing.Point(8, 87); this.panel2.Location = new System.Drawing.Point(8, 87);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1248, 492); this.panel2.Size = new System.Drawing.Size(1253, 497);
this.panel2.TabIndex = 18; this.panel2.TabIndex = 18;
// //
// dataGridView1 // dataGridView1
...@@ -120,12 +133,61 @@ ...@@ -120,12 +133,61 @@
this.dataGridView1.ReadOnly = true; this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Size = new System.Drawing.Size(1248, 492); this.dataGridView1.Size = new System.Drawing.Size(1253, 497);
this.dataGridView1.TabIndex = 0; this.dataGridView1.TabIndex = 0;
// //
// Column_Num
//
this.Column_Num.HeaderText = "编号";
this.Column_Num.Name = "Column_Num";
this.Column_Num.ReadOnly = true;
this.Column_Num.Width = 60;
//
// Column_Code
//
this.Column_Code.HeaderText = "条码";
this.Column_Code.Name = "Column_Code";
this.Column_Code.ReadOnly = true;
this.Column_Code.Width = 260;
//
// Column_Data
//
this.Column_Data.HeaderText = "时间";
this.Column_Data.Name = "Column_Data";
this.Column_Data.ReadOnly = true;
this.Column_Data.Width = 130;
//
// Column_Count
//
this.Column_Count.HeaderText = "数量";
this.Column_Count.Name = "Column_Count";
this.Column_Count.ReadOnly = true;
this.Column_Count.Width = 80;
//
// Column_Width
//
this.Column_Width.HeaderText = "宽度";
this.Column_Width.Name = "Column_Width";
this.Column_Width.ReadOnly = true;
this.Column_Width.Width = 60;
//
// Column_Height
//
this.Column_Height.HeaderText = "高度";
this.Column_Height.Name = "Column_Height";
this.Column_Height.ReadOnly = true;
this.Column_Height.Width = 60;
//
// Column_ImageName
//
this.Column_ImageName.HeaderText = "点料结果";
this.Column_ImageName.Name = "Column_ImageName";
this.Column_ImageName.ReadOnly = true;
this.Column_ImageName.Width = 550;
//
// txtCode // txtCode
// //
this.txtCode.Location = new System.Drawing.Point(623, 33); this.txtCode.Location = new System.Drawing.Point(623, 28);
this.txtCode.Name = "txtCode"; this.txtCode.Name = "txtCode";
this.txtCode.Size = new System.Drawing.Size(172, 26); this.txtCode.Size = new System.Drawing.Size(172, 26);
this.txtCode.TabIndex = 17; this.txtCode.TabIndex = 17;
...@@ -133,7 +195,7 @@ ...@@ -133,7 +195,7 @@
// label1 // label1
// //
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(573, 36); this.label1.Location = new System.Drawing.Point(573, 31);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 20); this.label1.Size = new System.Drawing.Size(40, 20);
this.label1.TabIndex = 16; this.label1.TabIndex = 16;
...@@ -143,7 +205,7 @@ ...@@ -143,7 +205,7 @@
// //
this.btnBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Location = new System.Drawing.Point(1089, 29); this.btnBack.Location = new System.Drawing.Point(1094, 24);
this.btnBack.Name = "btnBack"; this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(114, 35); this.btnBack.Size = new System.Drawing.Size(114, 35);
this.btnBack.TabIndex = 15; this.btnBack.TabIndex = 15;
...@@ -155,7 +217,7 @@ ...@@ -155,7 +217,7 @@
// //
this.btnSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSearch.Location = new System.Drawing.Point(850, 29); this.btnSearch.Location = new System.Drawing.Point(855, 24);
this.btnSearch.Name = "btnSearch"; this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(114, 35); this.btnSearch.Size = new System.Drawing.Size(114, 35);
this.btnSearch.TabIndex = 7; this.btnSearch.TabIndex = 7;
...@@ -167,7 +229,7 @@ ...@@ -167,7 +229,7 @@
// //
this.dtpEndTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; this.dtpEndTime.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dtpEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpEndTime.Location = new System.Drawing.Point(376, 33); this.dtpEndTime.Location = new System.Drawing.Point(376, 28);
this.dtpEndTime.Name = "dtpEndTime"; this.dtpEndTime.Name = "dtpEndTime";
this.dtpEndTime.Size = new System.Drawing.Size(172, 26); this.dtpEndTime.Size = new System.Drawing.Size(172, 26);
this.dtpEndTime.TabIndex = 5; this.dtpEndTime.TabIndex = 5;
...@@ -175,7 +237,7 @@ ...@@ -175,7 +237,7 @@
// label3 // label3
// //
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(298, 36); this.label3.Location = new System.Drawing.Point(298, 31);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(68, 20); this.label3.Size = new System.Drawing.Size(68, 20);
this.label3.TabIndex = 4; this.label3.TabIndex = 4;
...@@ -185,7 +247,7 @@ ...@@ -185,7 +247,7 @@
// //
this.dtpStartTime.CustomFormat = "yyyy-MM-dd HH:mm:ss"; this.dtpStartTime.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dtpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dtpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpStartTime.Location = new System.Drawing.Point(92, 33); this.dtpStartTime.Location = new System.Drawing.Point(92, 28);
this.dtpStartTime.Name = "dtpStartTime"; this.dtpStartTime.Name = "dtpStartTime";
this.dtpStartTime.Size = new System.Drawing.Size(172, 26); this.dtpStartTime.Size = new System.Drawing.Size(172, 26);
this.dtpStartTime.TabIndex = 3; this.dtpStartTime.TabIndex = 3;
...@@ -193,61 +255,12 @@ ...@@ -193,61 +255,12 @@
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(14, 36); this.label2.Location = new System.Drawing.Point(14, 31);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(68, 20); this.label2.Size = new System.Drawing.Size(68, 20);
this.label2.TabIndex = 1; this.label2.TabIndex = 1;
this.label2.Text = "开始时间:"; this.label2.Text = "开始时间:";
// //
// Column_Num
//
this.Column_Num.HeaderText = "编号";
this.Column_Num.Name = "Column_Num";
this.Column_Num.ReadOnly = true;
this.Column_Num.Width = 60;
//
// Column_Code
//
this.Column_Code.HeaderText = "条码";
this.Column_Code.Name = "Column_Code";
this.Column_Code.ReadOnly = true;
this.Column_Code.Width = 260;
//
// Column_Data
//
this.Column_Data.HeaderText = "时间";
this.Column_Data.Name = "Column_Data";
this.Column_Data.ReadOnly = true;
this.Column_Data.Width = 130;
//
// Column_Count
//
this.Column_Count.HeaderText = "数量";
this.Column_Count.Name = "Column_Count";
this.Column_Count.ReadOnly = true;
this.Column_Count.Width = 80;
//
// Column_Width
//
this.Column_Width.HeaderText = "宽度";
this.Column_Width.Name = "Column_Width";
this.Column_Width.ReadOnly = true;
this.Column_Width.Width = 60;
//
// Column_Height
//
this.Column_Height.HeaderText = "高度";
this.Column_Height.Name = "Column_Height";
this.Column_Height.ReadOnly = true;
this.Column_Height.Width = 60;
//
// Column_ImageName
//
this.Column_ImageName.HeaderText = "点料结果";
this.Column_ImageName.Name = "Column_ImageName";
this.Column_ImageName.ReadOnly = true;
this.Column_ImageName.Width = 550;
//
// FrmAnalyze // FrmAnalyze
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -288,5 +301,6 @@ ...@@ -288,5 +301,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Width; private System.Windows.Forms.DataGridViewTextBoxColumn Column_Width;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Height; private System.Windows.Forms.DataGridViewTextBoxColumn Column_Height;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_ImageName; private System.Windows.Forms.DataGridViewTextBoxColumn Column_ImageName;
private System.Windows.Forms.Label label4;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -77,10 +77,11 @@ namespace OnlineStore.AutoCountClient ...@@ -77,10 +77,11 @@ namespace OnlineStore.AutoCountClient
string endStr = endTime.ToString(str); string endStr = endTime.ToString(str);
bool result = RobotManager.robot.sQLite.Select(code, startStr,endStr, out array); bool result = RobotManager.robot.sQLite.Select(code, startStr,endStr, out array);
LogUtil.error("查数据【" + code + "】【" + startStr + "】【" + endStr + "】结果:" + result + "," + RobotManager.robot.sQLite.ErrInfo); LogUtil.error("查数据【" + code + "】【" + startStr + "】【" + endStr + "】结果:" + result + "," + RobotManager.robot.sQLite.ErrInfo);
if (array != null && array.Length > 0) if (array != null && array.Length > 0)
{ {
LogUtil.info("共查询到【" + array.Length + "】行数据"); LogUtil.info("共查询到【" + array.Length + "】行数据");
label4.Text = "开始时间["+ startStr + "] 结束时间["+ endStr + "] 条码["+ code + "] 共查询到"+ array.Length + "条记录";
this.dataGridView1.Rows.Clear(); this.dataGridView1.Rows.Clear();
int index = 1; int index = 1;
foreach (string[] a in array) foreach (string[] a in array)
......
...@@ -371,7 +371,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -371,7 +371,7 @@ namespace OnlineStore.DeviceLibrary
isOk = false; isOk = false;
WarnMsg = Name + msg; WarnMsg = Name + msg;
Alarm(AlarmType.AxisMoveError); Alarm(AlarmType.AxisMoveError);
LogUtil.error(WarnMsg, moveInfo.ErrorLogType); LogUtil.error(WarnMsg, moveInfo.ErrorLogType, moveInfo.logSeconds());
break; break;
} }
} }
...@@ -390,7 +390,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -390,7 +390,7 @@ namespace OnlineStore.DeviceLibrary
ConfigIO io = Robot.Config.getWaitIO(wait.IoType); ConfigIO io = Robot.Config.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒"; WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
LogUtil.error(WarnMsg, moveInfo.ErrorLogType); LogUtil.error(WarnMsg, moveInfo.ErrorLogType, moveInfo.logSeconds());
if (alarmType.Equals(AlarmType.None)) if (alarmType.Equals(AlarmType.None))
{ {
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
...@@ -481,18 +481,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -481,18 +481,18 @@ namespace OnlineStore.DeviceLibrary
else if (span.TotalSeconds > moveInfo.TimeOutSeconds) else if (span.TotalSeconds > moveInfo.TimeOutSeconds)
{ {
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
int second = 10; //int second = 10;
second = (int)(span.TotalSeconds/ moveInfo.TimeOutSeconds) * 10; //second = (int)(span.TotalSeconds/ moveInfo.TimeOutSeconds) * 10;
if (second > 120) //if (second > 120)
{ //{
second = 120; // second = 120;
} //}
else if (second < 10) //else if (second < 10)
{ //{
second = 10; // second = 10;
} //}
LogUtil.error(WarnMsg, moveInfo.ErrorLogType, second); LogUtil.error(WarnMsg, moveInfo.ErrorLogType, moveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
} }
} }
......
...@@ -329,7 +329,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -329,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = Name + msg; WarnMsg = Name + msg;
Alarm(AlarmType.AxisMoveError); Alarm(AlarmType.AxisMoveError);
LogUtil.error(WarnMsg, moveInfo.ErrorLogType); LogUtil.error(WarnMsg, moveInfo.ErrorLogType, moveInfo.logSeconds());
break; break;
} }
} }
...@@ -348,7 +348,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -348,7 +348,7 @@ namespace OnlineStore.DeviceLibrary
ConfigIO io = baseConfig.getWaitIO(wait.IoType); ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒"; WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时 " + Math.Round(span.TotalSeconds, 1) + "秒";
LogUtil.error( WarnMsg, moveInfo.ErrorLogType); LogUtil.error( WarnMsg, moveInfo.ErrorLogType,moveInfo.logSeconds());
if (NoAlarm()) if (NoAlarm())
{ {
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
...@@ -413,18 +413,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -413,18 +413,18 @@ namespace OnlineStore.DeviceLibrary
{ {
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待" + NotOkMsg
+ "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒"; + "超时[" + Math.Round(span.TotalSeconds, 1) + "]秒";
int second = 10; //int second = 10;
second = (int)(span.TotalSeconds/moveInfo.TimeOutSeconds ) * 10; //second = (int)(span.TotalSeconds/moveInfo.TimeOutSeconds ) * 10;
if (second > 120) //if (second > 120)
{ //{
second = 120; // second = 120;
} //}
else if (second < 10) //else if (second < 10)
{ //{
second = 10; // second = 10;
} //}
LogUtil.error(WarnMsg, moveInfo.ErrorLogType, second); LogUtil.error(WarnMsg, moveInfo.ErrorLogType, moveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
} }
} }
...@@ -450,6 +450,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -450,6 +450,7 @@ namespace OnlineStore.DeviceLibrary
{ {
level = WorkLogLevel; level = WorkLogLevel;
} }
level = WorkLogLevel;
string code = ""; string code = "";
if (MoveInfo.MoveParam != null && MoveInfo.MoveParam.WareCode != null) if (MoveInfo.MoveParam != null && MoveInfo.MoveParam.WareCode != null)
{ {
...@@ -474,6 +475,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -474,6 +475,7 @@ namespace OnlineStore.DeviceLibrary
{ {
level = SecWorkLogLevel; level = SecWorkLogLevel;
} }
level = SecWorkLogLevel;
string code = SecMoveInfo.MoveParam != null ? SecMoveInfo.MoveParam.WareCode : ""; string code = SecMoveInfo.MoveParam != null ? SecMoveInfo.MoveParam.WareCode : "";
if (level.Equals(1)) if (level.Equals(1))
{ {
......
...@@ -139,34 +139,36 @@ namespace OnlineStore.DeviceLibrary ...@@ -139,34 +139,36 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
private void OT02_MoveZToP1()
protected override void WorkingProcess()
{ {
if (MoveInfo.IsInWait) if (MoveZAxis.IsInPosition(Config.MoveZ_P1))
{
CheckWait(MoveInfo);
}
if (MoveInfo.IsInWait)
{ {
return; OT03_MoveXToP2();
} }
else
if (MoveInfo.IsStep(StepEnum.OT01_WaitCheck))
{ {
MoveInfo.NextMoveStep(StepEnum.OT02_MoveZToP1); MoveInfo.NextMoveStep(StepEnum.OT02_MoveZToP1);
WorkLog("取料:取料Z轴到P1 ", 0); WorkLog("取料:取料Z轴到P1 ", 0);
MoveZAxis.AbsMove(MoveInfo, Config.MoveZ_P1, Config.MoveZ_P1Speed); MoveZAxis.AbsMove(MoveInfo, Config.MoveZ_P1, Config.MoveZ_P1Speed);
} }
else if (MoveInfo.IsStep(StepEnum.OT02_MoveZToP1)) }
private void OT03_MoveXToP2()
{
int position = Config.GetMoveXP2(MoveInfo.MoveParam.PlateW);
if (MoveXAxis.IsInPosition(position))
{
OT05_GetImage();
}
else
{ {
MoveInfo.NextMoveStep(StepEnum.OT03_MoveXToP2); MoveInfo.NextMoveStep(StepEnum.OT03_MoveXToP2);
WorkLog("取料:取料X轴到P2 ", 0); WorkLog("取料:取料X轴到P2 ", 0);
MoveXAxis.AbsMove(MoveInfo, Config.GetMoveXP2(MoveInfo.MoveParam.PlateW), Config.MoveX_P2Speed); MoveXAxis.AbsMove(MoveInfo, position, Config.MoveX_P2Speed);
} }
else if (MoveInfo.IsStep(StepEnum.OT03_MoveXToP2)) }
private void OT05_GetImage()
{ {
//MoveInfo.NextMoveStep(StepEnum.OT04_CheckNeedImage);
//WorkLog("取料:判断是否需要拍照 ");
if (MoveInfo.MoveParam.IsNgReel) if (MoveInfo.MoveParam.IsNgReel)
{ {
MoveInfo.NextMoveStep(StepEnum.OT07_MoveZToP2); MoveInfo.NextMoveStep(StepEnum.OT07_MoveZToP2);
...@@ -180,16 +182,38 @@ namespace OnlineStore.DeviceLibrary ...@@ -180,16 +182,38 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
} }
} }
//else if (MoveInfo.IsStep(StepEnum.OT04_CheckNeedImage)) protected override void WorkingProcess()
//{ {
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
}
if (MoveInfo.IsInWait)
{
return;
}
//} if (MoveInfo.IsStep(StepEnum.OT01_WaitCheck))
{
OT02_MoveZToP1();
}
else if (MoveInfo.IsStep(StepEnum.OT02_MoveZToP1))
{
OT03_MoveXToP2();
}
else if (MoveInfo.IsStep(StepEnum.OT03_MoveXToP2))
{
OT05_GetImage();
}
else if (MoveInfo.IsStep(StepEnum.OT05_GetImage)) else if (MoveInfo.IsStep(StepEnum.OT05_GetImage))
{ {
//MoveInfo.NextMoveStep(StepEnum.OT06_MoveXToP2);
//WorkLog("取料:取料X轴运动到P2 ");
//MoveXAxis.AbsMove(MoveInfo, Config.GetMoveXP2(MoveInfo.MoveParam.PlateW), Config.MoveX_P2Speed);
MoveInfo.NextMoveStep(StepEnum.OT06_MoveXToP2); MoveInfo.NextMoveStep(StepEnum.OT07_MoveZToP2);
WorkLog("取料:取料X轴运动到P2 "); WorkLog("取料:取料Z轴到P2 ", 0);
MoveXAxis.AbsMove(MoveInfo, Config.GetMoveXP2(MoveInfo.MoveParam.PlateW), Config.MoveX_P2Speed); MoveZAxis.AbsMove(MoveInfo, Config.GetMoveZP2(MoveInfo.MoveParam.PlateH), Config.MoveZ_P2Speed);
CheckStartLabel(); CheckStartLabel();
////TODO 记录信息,判断贴标模块当前空闲,此时可以打印标签(取码气缸前进,打印标签,取码气缸后退) ////TODO 记录信息,判断贴标模块当前空闲,此时可以打印标签(取码气缸前进,打印标签,取码气缸后退)
...@@ -279,30 +303,42 @@ namespace OnlineStore.DeviceLibrary ...@@ -279,30 +303,42 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StepEnum.OT12_MoveXToP3)) else if (MoveInfo.IsStep(StepEnum.OT12_MoveXToP3))
{ {
//bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_22_WaitTray);
//bool debugOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveParam.IsTest;
//if (shelfOk || debugOk)
//{
// ClearTimeoutAlarm("等待出料料串可放料");
MoveInfo.NextMoveStep(StepEnum.OT13_MoveZToP3);
WorkLog("放料:取料Z轴下降到P3 ");
MoveZAxis.AbsMove(MoveInfo, Config.GetMoveZP3(MoveInfo.MoveParam.PlateH), Config.MoveZ_P3Speed);
//}
//else if (MoveInfo.IsTimeOut(60))
//{
// WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待出料料串可放料(OS_22_WaitTray)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
// LogUtil.error(WarnMsg, MoveInfo.ErrorLogType, MoveInfo.logSeconds());
// Alarm(AlarmType.IoSingleTimeOut);
//}
//CheckStartLabel();
}
else if (MoveInfo.IsStep(StepEnum.OT13_MoveZToP3))
{
bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_22_WaitTray); bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_22_WaitTray);
bool debugOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveParam.IsTest; bool debugOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.None) && MoveInfo.MoveParam.IsTest;
if (shelfOk || debugOk) if (shelfOk || debugOk)
{ {
ClearTimeoutAlarm("等待出料料串可放料"); ClearTimeoutAlarm("等待出料料串可放料");
MoveInfo.NextMoveStep(StepEnum.OT13_MoveZToP3); MoveInfo.NextMoveStep(StepEnum.OT14_Clamping_Relax);
WorkLog("放料:取料Z轴下降到P3 "); WorkLog("放料:取料气缸放松 ", 0);
MoveZAxis.AbsMove(MoveInfo, Config.GetMoveZP3(MoveInfo.MoveParam.PlateH), Config.MoveZ_P3Speed); CylinderMove(MoveInfo, IO_Type.TakeT_Clamping_Work, IO_Type.TakeT_Clamping_Relax);
} }
else if (MoveInfo.IsTimeOut(60)) else if (MoveInfo.IsTimeOut(60))
{ {
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待出料料串可放料(OS_22_WaitTray)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]"; WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "]" + "等待出料料串可放料(OS_22_WaitTray)超时[" + FormUtil.GetSpanStr(MoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, MoveInfo.ErrorLogType,MoveInfo.logSeconds()); LogUtil.error(WarnMsg, MoveInfo.ErrorLogType, MoveInfo.logSeconds());
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
} }
CheckStartLabel(); CheckStartLabel();
} }
else if (MoveInfo.IsStep(StepEnum.OT13_MoveZToP3))
{
MoveInfo.NextMoveStep(StepEnum.OT14_Clamping_Relax);
WorkLog("放料:取料气缸放松 ", 0);
CylinderMove(MoveInfo, IO_Type.TakeT_Clamping_Work, IO_Type.TakeT_Clamping_Relax);
CheckStartLabel();
}
else if (MoveInfo.IsStep(StepEnum.OT14_Clamping_Relax)) else if (MoveInfo.IsStep(StepEnum.OT14_Clamping_Relax))
{ {
bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_22_WaitTray); bool shelfOk = ShelfMoveInfo.MoveType.Equals(RobotMoveType.ShelfPro) && ShelfMoveInfo.IsStep(StepEnum.OS_22_WaitTray);
...@@ -488,10 +524,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -488,10 +524,18 @@ namespace OnlineStore.DeviceLibrary
} }
else if (SecMoveInfo.IsStep(StepEnum.OL08_ZToP1)) else if (SecMoveInfo.IsStep(StepEnum.OL08_ZToP1))
{ {
if (LabelYAxis.IsInPosition(Config.LabelY_P1))
{
SecMoveInfo.NextMoveStep(StepEnum.OL10_WaitCanLabel);
SecWorkLog("贴标: 等待取料机构返回待机点并且空闲");
}
else
{
SecMoveInfo.NextMoveStep(StepEnum.OL09_YToP1); SecMoveInfo.NextMoveStep(StepEnum.OL09_YToP1);
SecWorkLog("贴标: Y轴到P1点",0); SecWorkLog("贴标: Y轴到P1点", 0);
LabelYAxis.AbsMove(SecMoveInfo, Config.LabelY_P1, Config.LabelY_P1Speed); LabelYAxis.AbsMove(SecMoveInfo, Config.LabelY_P1, Config.LabelY_P1Speed);
} }
}
else if (SecMoveInfo.IsStep(StepEnum.OL09_YToP1)) else if (SecMoveInfo.IsStep(StepEnum.OL09_YToP1))
{ {
SecMoveInfo.NextMoveStep(StepEnum.OL10_WaitCanLabel); SecMoveInfo.NextMoveStep(StepEnum.OL10_WaitCanLabel);
......
...@@ -103,14 +103,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,14 +103,14 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.XW02_InDoorOpen)) else if (MoveInfo.IsStep(StepEnum.XW02_InDoorOpen))
{ {
MoveInfo.NextMoveStep(StepEnum.XW04_InLineRun); MoveInfo.NextMoveStep(StepEnum.XW04_InLineRun);
WorkLog("料盘处理:入口和中间皮带线转动,",0); WorkLog("料盘处理:入口和中间皮带线转动", 0);
IOMove(IO_Type.X_InLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_InLine_Run, IO_VALUE.HIGH);
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH);
} }
else if (MoveInfo.IsStep(StepEnum.XW04_InLineRun)) else if (MoveInfo.IsStep(StepEnum.XW04_InLineRun))
{ {
MoveInfo.NextMoveStep(StepEnum.XW05_WaitMCheck); MoveInfo.NextMoveStep(StepEnum.XW05_WaitMCheck);
WorkLog("料盘处理:等待扫描区域信号检测",0); WorkLog("料盘处理:等待扫描区域信号检测", 0);
IOMove(IO_Type.X_InLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_InLine_Run, IO_VALUE.HIGH);
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_ReelCheck, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_ReelCheck, IO_VALUE.HIGH));
...@@ -121,11 +121,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -121,11 +121,11 @@ namespace OnlineStore.DeviceLibrary
Work_ReelInfo = In_ReelInfo.GetReelInfo(); Work_ReelInfo = In_ReelInfo.GetReelInfo();
MoveInfo.MoveParam.SetReelInfo(Work_ReelInfo); MoveInfo.MoveParam.SetReelInfo(Work_ReelInfo);
In_ReelInfo = new ReelInfo(); In_ReelInfo = new ReelInfo();
WorkLog("料盘处理:更新Work_ReelInfo【" + Work_ReelInfo.ToStr() + "】,清空 In_ReelInfo,再转动5秒钟"); WorkLog("料盘处理:更新Work_ReelInfo【" + Work_ReelInfo.ToStr() + "】,清空 In_ReelInfo,左侧皮带线先停止,右侧皮带线再转动2秒钟");
IOMove(IO_Type.X_InLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_InLine_Run, IO_VALUE.LOW);
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_ReelCheck, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.X_ReelCheck, IO_VALUE.HIGH));
} }
else if (MoveInfo.IsStep(StepEnum.XW06_WaitTime)) else if (MoveInfo.IsStep(StepEnum.XW06_WaitTime))
...@@ -279,12 +279,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -279,12 +279,14 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.XW25_WaitTime); MoveInfo.NextMoveStep(StepEnum.XW25_WaitTime);
Out_ReelInfo = Work_ReelInfo.GetReelInfo(); Out_ReelInfo = Work_ReelInfo.GetReelInfo();
Work_ReelInfo = new ReelInfo(); Work_ReelInfo = new ReelInfo();
WorkLog("料盘处理:清空 Work_ReelInfo,更新Out_ReelInfo【" + Out_ReelInfo.ToStr() + "】 再转动8秒"); WorkLog("料盘处理:清空 Work_ReelInfo,更新Out_ReelInfo【" + Out_ReelInfo.ToStr() + "】 ,中间皮带线先停止,出口皮带线 再转动2秒,出口门先关闭,档停先下降");
IOMove(IO_Type.X_MLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_MLine_Run, IO_VALUE.LOW);
IOMove(IO_Type.X_OLine_Run, IO_VALUE.HIGH); IOMove(IO_Type.X_OLine_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Out_TrayCheck, IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Out_TrayCheck, IO_VALUE.HIGH));
CylinderMove(null, IO_Type.X_OutDoor_Down, IO_Type.X_OutDoor_Up);
CylinderMove(null, IO_Type.X_StopCylinder_Up, IO_Type.X_StopCylinder_Down);
} }
else if (MoveInfo.IsStep(StepEnum.XW25_WaitTime)) else if (MoveInfo.IsStep(StepEnum.XW25_WaitTime))
...@@ -297,7 +299,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -297,7 +299,9 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.XW26_OutLineStop)) else if (MoveInfo.IsStep(StepEnum.XW26_OutLineStop))
{ {
MoveInfo.NextMoveStep(StepEnum.XW27_OutDoorClose); MoveInfo.NextMoveStep(StepEnum.XW27_OutDoorClose);
WorkLog("料盘处理:出口门关闭,挡停下降"); WorkLog("料盘处理:中间皮带线,出口皮带线停止,出口门关闭,挡停下降");
IOMove(IO_Type.X_MLine_Run, IO_VALUE.LOW);
IOMove(IO_Type.X_OLine_Run, IO_VALUE.LOW);
CylinderMove(MoveInfo, IO_Type.X_OutDoor_Down, IO_Type.X_OutDoor_Up); CylinderMove(MoveInfo, IO_Type.X_OutDoor_Down, IO_Type.X_OutDoor_Up);
CylinderMove(MoveInfo, IO_Type.X_StopCylinder_Up, IO_Type.X_StopCylinder_Down); CylinderMove(MoveInfo, IO_Type.X_StopCylinder_Up, IO_Type.X_StopCylinder_Down);
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!