Commit 2efb4cde LN

点位调试功能优化,自动出入库bug修改

1 个父辈 c7937a15
......@@ -87,39 +87,60 @@ namespace OnlineStore.DeviceLibrary
{
if (HomeIsEnd(box.Config.UpDown_Axis))
{
CurrStep=(StoreMoveStep.AP_03_MiddleMove);
if (paramInfo.UpdownStartPosition.Equals(0))
{
CurrStep = (StoreMoveStep.AP_04_MiddleMove);
ConfigMoveAxis axis = box.Config.Middle_Axis;
int p = paramInfo.GetCurrMiddleP();
LogUtil.info(LogName + CurrStep + " " + currIndex + ":旋转轴移动到目标位置:" + p);
AxisManager.instance.AbsMove(axis.DeviceName, (short)axis.GetAxisValue(), p, box.Config.MiddleAxis_P1_Speed, axis.AddSpeed, axis.DelSpeed);
}
else
{
CurrStep = (StoreMoveStep.AP_03_UpdownMove);
ConfigMoveAxis iaxis = box.Config.UpDown_Axis;
LogUtil.info(LogName + CurrStep + " " + currIndex + ":升降轴移动到开始位置:" + paramInfo.UpdownStartPosition);
AxisManager.instance.AbsMove(iaxis.DeviceName, (short)iaxis.GetAxisValue(), paramInfo.UpdownStartPosition, box.Config.UpDownAxis_P1_Speed, iaxis.AddSpeed, iaxis.DelSpeed);
}
}
}else if (CurrStep.Equals(StoreMoveStep.AP_03_UpdownMove))
{
if (AbsMoveIsEnd(box.Config.UpDown_Axis, paramInfo.UpdownStartPosition))
{
CurrStep = (StoreMoveStep.AP_04_MiddleMove);
ConfigMoveAxis axis = box.Config.Middle_Axis;
int p = paramInfo.GetCurrMiddleP();
LogUtil.info(LogName + CurrStep + " " + currIndex + ":旋转轴移动到目标位置:" + p);
AxisManager.instance.AbsMove(axis.DeviceName, (short)axis.GetAxisValue(), p, box.Config.MiddleAxis_P1_Speed, axis.AddSpeed, axis.DelSpeed);
}
}
else if (CurrStep.Equals(StoreMoveStep.AP_03_MiddleMove))
else if (CurrStep.Equals(StoreMoveStep.AP_04_MiddleMove))
{
int p = paramInfo.GetCurrMiddleP();
if (AbsMoveIsEnd(box.Config.Middle_Axis, p))
{
CurrStep=(StoreMoveStep.AP_04_InoutToP);
CurrStep=(StoreMoveStep.AP_05_InoutToP);
ConfigMoveAxis iaxis = box.Config.InOut_Axis;
LogUtil.info(LogName + CurrStep + " " + currIndex + ":进出轴移动到目标位置:" + paramInfo.InoutTargetPosition);
AxisManager.instance.AbsMove(iaxis.DeviceName, (short)iaxis.GetAxisValue(), paramInfo.InoutTargetPosition, box.Config.InOutAxis_P1_Speed, iaxis.AddSpeed, iaxis.DelSpeed);
}
}
else if (CurrStep.Equals(StoreMoveStep.AP_04_InoutToP))
else if (CurrStep.Equals(StoreMoveStep.AP_05_InoutToP))
{
if (AbsMoveIsEnd(box.Config.InOut_Axis, paramInfo.InoutTargetPosition))
{
CurrStep=(StoreMoveStep.AP_05_UpdownMove);
CurrStep=(StoreMoveStep.AP_06_UpdownMove);
ConfigMoveAxis axis = box.Config.UpDown_Axis;
LogUtil.info(LogName + CurrStep + " " + currIndex + ":升降轴移动到目标位置:" + paramInfo.UpdownTargetPosition);
AxisManager.instance.AbsMove(axis.DeviceName, (short)axis.GetAxisValue(), paramInfo.UpdownTargetPosition, paramInfo.UpdownSpeed, axis.AddSpeed, axis.DelSpeed);
toolTimer.Interval = 50;
}
}
else if (CurrStep.Equals(StoreMoveStep.AP_05_UpdownMove))
else if (CurrStep.Equals(StoreMoveStep.AP_06_UpdownMove))
{
try
{
......@@ -286,7 +307,7 @@ namespace OnlineStore.DeviceLibrary
{
string msgStr = "请确认以下对点位参数,点击“确定”按钮开始自动校准点位:\r\n";
msgStr += " 进出轴前进位置:" + InoutTargetPosition + "\r\n";
msgStr += " 升降轴目标位置:" + UpdownTargetPosition + ",速度:"+UpdownSpeed+"\r\n";
msgStr += " 升降轴开始位置:"+UpdownStartPosition+",目标位置:" + UpdownTargetPosition + ",速度:"+UpdownSpeed+"\r\n";
msgStr += " 旋转轴位置列表:";
foreach (int mP in MiddlePositionList)
......
......@@ -939,7 +939,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private string autoInoutCode = "AUTOINOUT";
private void InOutEndProcess(StoreMoveType storeMoveType)
private void InOutEndProcess( StoreMoveType storeMoveType)
{
try
{
......@@ -952,47 +952,45 @@ namespace OnlineStore.DeviceLibrary
}
if (storeMoveType.Equals(StoreMoveType.InStore))
{
int newIndex = autoPositionIndex - 1;
int newIndex = autoPositionIndex;
if (newIndex < 0)
{
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{
newIndex = AutoStartIndex;
LogUtil.info( Name + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
LogUtil.info(Name + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
LogUtil.info( Name + "下一个索引不存在,自动 出入库结束!");
LogUtil.info(Name + "下一个索引不存在,自动 出入库结束!");
return;
}
}
autoPositionIndex = newIndex;
string posid = PositionNumList[autoPositionIndex];
InOutPosInfo inoutinfo = new InOutPosInfo(autoInoutCode, posid);
//判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount)
{
LogUtil.info(Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中");
Reset(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(inoutinfo);
}
else if (CurrInOutCount >= Config.Box_ResetMCount)
{
LogUtil.info(Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(inoutinfo);
}
else
{
autoPositionIndex = newIndex;
string posid = PositionNumList[autoPositionIndex];
InOutPosInfo inoutinfo = new InOutPosInfo(autoInoutCode, posid);
//判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount)
{
LogUtil.info( Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把出库信息存入排队列表中");
Reset(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(inoutinfo);
}
else if (CurrInOutCount >= Config.Box_ResetMCount)
{
LogUtil.info( Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动出库:" + posid;
AddWaitOutInfo(inoutinfo);
}
else
{
LogUtil.info( Name + "自动进入下一个出库:posid=" + posid);
autoMsg = "自动出库:" + posid;
StartOutStoreMove(new InOutParam(inoutinfo));
}
LogUtil.info(Name + "自动进入下一个出库:posid=" + posid);
autoMsg = "自动出库:" + posid;
StartOutStoreMove(new InOutParam(inoutinfo));
}
}
else if (storeMoveType.Equals(StoreMoveType.OutStore))
......@@ -1003,46 +1001,28 @@ namespace OnlineStore.DeviceLibrary
if (AutoStartIndex >= 0 && AutoStartIndex < PositionNumList.Count)
{
newIndex = AutoStartIndex;
LogUtil.info( Name + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
LogUtil.info(Name + "下一个索引不存在,重新开始自动出入库,索引【" + AutoStartIndex + "】");
}
else
{
autoNext = false;
autoMsg = "自动出入库结束!";
LogUtil.info( Name + "下一个索引不存在,自动 出入库结束!");
}
}
else
{
string posid = PositionNumList[newIndex];
InOutPosInfo inoutinfo = new InOutPosInfo(autoInoutCode, posid);
//判断是否需要重置
if (CurrInOutACount >= Config.Box_ResetACount)
{
LogUtil.info( Name + "自动进入下一个入库:posid=" + posid + ",当时已经出入库" + CurrInOutACount + "次,需要重置BOX,先把入库信息存入排队列表中");
Reset(false);
autoMsg = "自动入库:" + posid;
AddWaitOutInfo(inoutinfo);
}
else if (CurrInOutCount >= Config.Box_ResetMCount)
{
LogUtil.info( Name + "自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动入库:" + posid;
AddWaitOutInfo(inoutinfo);
}
else
{
LogUtil.info( Name + "自动进入下一个入库:posid=" + posid);
autoMsg = "自动入库:" + posid;
StartInStoreMove(new InOutParam(inoutinfo));
LogUtil.info(Name + "下一个索引不存在,自动 出入库结束!");
return;
}
}
autoPositionIndex = newIndex;
string posid = PositionNumList[newIndex];
InOutPosInfo inoutinfo = new InOutPosInfo(autoInoutCode, posid);
LogUtil.info(Name + "自动进入下一个入库:posid=" + posid);
autoMsg = "自动入库:" + posid;
StartInStoreMove(new InOutParam(inoutinfo));
}
}
catch (Exception ex)
{
LogUtil.error( ex.ToString());
LogUtil.error(" InOutEndProcess Error "+ex.ToString());
}
}
......
......@@ -393,21 +393,25 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
AP_02_UpdownHome,
/// <summary>
/// 位置校准:升降轴移动到开始位置
/// </summary>
AP_03_UpdownMove,
/// <summary>
/// 校准位置:旋转轴选择到对应位置
/// </summary>
AP_03_MiddleMove,
AP_04_MiddleMove,
/// <summary>
/// 校准位置:进出轴到前进位置
/// </summary>
AP_04_InoutToP,
AP_05_InoutToP,
/// <summary>
/// 校准位置:升降轴开始匀速移动到目标位置
/// </summary>
AP_05_UpdownMove,
AP_06_UpdownMove,
/// <summary>
/// 校准位置:保存当前列位置
/// </summary>
AP_06_SaveAndNext,
AP_07_SaveAndNext,
#endregion
}
......
......@@ -48,6 +48,7 @@
this.txtP6Offset = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.group3 = new System.Windows.Forms.GroupBox();
this.btnMStop = new System.Windows.Forms.Button();
this.btnMHome = new System.Windows.Forms.Button();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.Column_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
......@@ -68,7 +69,8 @@
this.panel1 = new System.Windows.Forms.Panel();
this.axisJogControl1 = new OnlineStore.ACSingleStore.AxisJogControl();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.btnMStop = new System.Windows.Forms.Button();
this.txtUpdownStart = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.panelAll.SuspendLayout();
this.group6.SuspendLayout();
this.group2.SuspendLayout();
......@@ -97,7 +99,7 @@
this.panelAll.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panelAll.Location = new System.Drawing.Point(5, 3);
this.panelAll.Name = "panelAll";
this.panelAll.Size = new System.Drawing.Size(1085, 643);
this.panelAll.Size = new System.Drawing.Size(1089, 649);
this.panelAll.TabIndex = 250;
//
// lblMoveInfo
......@@ -114,10 +116,9 @@
//
this.group6.Controls.Add(this.lblFileP);
this.group6.Controls.Add(this.btnOpenFolder);
this.group6.Enabled = false;
this.group6.Location = new System.Drawing.Point(727, 458);
this.group6.Location = new System.Drawing.Point(727, 479);
this.group6.Name = "group6";
this.group6.Size = new System.Drawing.Size(346, 163);
this.group6.Size = new System.Drawing.Size(346, 155);
this.group6.TabIndex = 323;
this.group6.TabStop = false;
this.group6.Text = "第六步:查看位置列表:";
......@@ -135,7 +136,7 @@
//
this.btnOpenFolder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenFolder.Location = new System.Drawing.Point(198, 110);
this.btnOpenFolder.Location = new System.Drawing.Point(198, 104);
this.btnOpenFolder.Name = "btnOpenFolder";
this.btnOpenFolder.Size = new System.Drawing.Size(132, 36);
this.btnOpenFolder.TabIndex = 280;
......@@ -145,12 +146,14 @@
//
// group2
//
this.group2.Controls.Add(this.txtUpdownStart);
this.group2.Controls.Add(this.label1);
this.group2.Controls.Add(this.txtTargetPosition);
this.group2.Controls.Add(this.label14);
this.group2.Controls.Add(this.btnUpdownP);
this.group2.Location = new System.Drawing.Point(6, 85);
this.group2.Name = "group2";
this.group2.Size = new System.Drawing.Size(399, 68);
this.group2.Size = new System.Drawing.Size(399, 113);
this.group2.TabIndex = 322;
this.group2.TabStop = false;
this.group2.Text = "第二步:确认(轴二)升降轴最高位置:";
......@@ -158,7 +161,7 @@
// txtTargetPosition
//
this.txtTargetPosition.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtTargetPosition.Location = new System.Drawing.Point(126, 22);
this.txtTargetPosition.Location = new System.Drawing.Point(126, 65);
this.txtTargetPosition.MaxLength = 30;
this.txtTargetPosition.Name = "txtTargetPosition";
this.txtTargetPosition.Size = new System.Drawing.Size(105, 26);
......@@ -167,7 +170,7 @@
// label14
//
this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label14.Location = new System.Drawing.Point(8, 26);
this.label14.Location = new System.Drawing.Point(8, 69);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(110, 20);
this.label14.TabIndex = 94;
......@@ -178,7 +181,7 @@
//
this.btnUpdownP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdownP.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnUpdownP.Location = new System.Drawing.Point(238, 18);
this.btnUpdownP.Location = new System.Drawing.Point(238, 61);
this.btnUpdownP.Name = "btnUpdownP";
this.btnUpdownP.Size = new System.Drawing.Size(138, 36);
this.btnUpdownP.TabIndex = 259;
......@@ -196,9 +199,9 @@
this.group4.Controls.Add(this.txtP3Offset);
this.group4.Controls.Add(this.txtP6Offset);
this.group4.Controls.Add(this.label9);
this.group4.Location = new System.Drawing.Point(6, 458);
this.group4.Location = new System.Drawing.Point(6, 479);
this.group4.Name = "group4";
this.group4.Size = new System.Drawing.Size(324, 163);
this.group4.Size = new System.Drawing.Size(324, 155);
this.group4.TabIndex = 321;
this.group4.TabStop = false;
this.group4.Text = "第四步:确认点位偏移量:";
......@@ -206,7 +209,7 @@
// label4
//
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(11, 30);
this.label4.Location = new System.Drawing.Point(11, 23);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(160, 20);
this.label4.TabIndex = 282;
......@@ -216,7 +219,7 @@
// txtP4Offset
//
this.txtP4Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP4Offset.Location = new System.Drawing.Point(182, 124);
this.txtP4Offset.Location = new System.Drawing.Point(182, 117);
this.txtP4Offset.MaxLength = 30;
this.txtP4Offset.Name = "txtP4Offset";
this.txtP4Offset.Size = new System.Drawing.Size(105, 26);
......@@ -226,7 +229,7 @@
// txtP5Offset
//
this.txtP5Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP5Offset.Location = new System.Drawing.Point(182, 28);
this.txtP5Offset.Location = new System.Drawing.Point(182, 21);
this.txtP5Offset.MaxLength = 30;
this.txtP5Offset.Name = "txtP5Offset";
this.txtP5Offset.Size = new System.Drawing.Size(105, 26);
......@@ -236,7 +239,7 @@
// label10
//
this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label10.Location = new System.Drawing.Point(11, 126);
this.label10.Location = new System.Drawing.Point(11, 119);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(160, 20);
this.label10.TabIndex = 288;
......@@ -246,7 +249,7 @@
// label5
//
this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(11, 62);
this.label5.Location = new System.Drawing.Point(11, 55);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(160, 20);
this.label5.TabIndex = 284;
......@@ -256,7 +259,7 @@
// txtP3Offset
//
this.txtP3Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP3Offset.Location = new System.Drawing.Point(182, 92);
this.txtP3Offset.Location = new System.Drawing.Point(182, 85);
this.txtP3Offset.MaxLength = 30;
this.txtP3Offset.Name = "txtP3Offset";
this.txtP3Offset.Size = new System.Drawing.Size(105, 26);
......@@ -266,7 +269,7 @@
// txtP6Offset
//
this.txtP6Offset.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtP6Offset.Location = new System.Drawing.Point(182, 60);
this.txtP6Offset.Location = new System.Drawing.Point(182, 53);
this.txtP6Offset.MaxLength = 30;
this.txtP6Offset.Name = "txtP6Offset";
this.txtP6Offset.Size = new System.Drawing.Size(105, 26);
......@@ -276,7 +279,7 @@
// label9
//
this.label9.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.Location = new System.Drawing.Point(11, 94);
this.label9.Location = new System.Drawing.Point(11, 87);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(160, 20);
this.label9.TabIndex = 286;
......@@ -290,18 +293,32 @@
this.group3.Controls.Add(this.dataGridView1);
this.group3.Controls.Add(this.btnAddMiddleP);
this.group3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.group3.Location = new System.Drawing.Point(6, 160);
this.group3.Location = new System.Drawing.Point(6, 204);
this.group3.Name = "group3";
this.group3.Size = new System.Drawing.Size(399, 292);
this.group3.Size = new System.Drawing.Size(399, 269);
this.group3.TabIndex = 320;
this.group3.TabStop = false;
this.group3.Text = "第三步:确认(轴一)旋转轴位置列表:";
//
// btnMStop
//
this.btnMStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnMStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMStop.ForeColor = System.Drawing.Color.Black;
this.btnMStop.Location = new System.Drawing.Point(137, 223);
this.btnMStop.Name = "btnMStop";
this.btnMStop.Size = new System.Drawing.Size(121, 36);
this.btnMStop.TabIndex = 325;
this.btnMStop.Text = "旋转轴停止";
this.btnMStop.UseVisualStyleBackColor = true;
this.btnMStop.Click += new System.EventHandler(this.btnMStop_Click);
//
// btnMHome
//
this.btnMHome.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnMHome.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMHome.ForeColor = System.Drawing.Color.Black;
this.btnMHome.Location = new System.Drawing.Point(11, 242);
this.btnMHome.Location = new System.Drawing.Point(11, 223);
this.btnMHome.Name = "btnMHome";
this.btnMHome.Size = new System.Drawing.Size(121, 36);
this.btnMHome.TabIndex = 324;
......@@ -313,18 +330,21 @@
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.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.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column_Index,
this.Column_position,
this.Column_Del});
this.dataGridView1.Location = new System.Drawing.Point(10, 23);
this.dataGridView1.Location = new System.Drawing.Point(10, 20);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersWidth = 5;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Size = new System.Drawing.Size(375, 213);
this.dataGridView1.Size = new System.Drawing.Size(375, 198);
this.dataGridView1.TabIndex = 323;
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
......@@ -354,9 +374,10 @@
//
// btnAddMiddleP
//
this.btnAddMiddleP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnAddMiddleP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAddMiddleP.ForeColor = System.Drawing.Color.Black;
this.btnAddMiddleP.Location = new System.Drawing.Point(263, 242);
this.btnAddMiddleP.Location = new System.Drawing.Point(263, 223);
this.btnAddMiddleP.Name = "btnAddMiddleP";
this.btnAddMiddleP.Size = new System.Drawing.Size(121, 36);
this.btnAddMiddleP.TabIndex = 322;
......@@ -414,9 +435,9 @@
this.group5.Controls.Add(this.label8);
this.group5.Controls.Add(this.btnStart);
this.group5.Controls.Add(this.btnStop);
this.group5.Location = new System.Drawing.Point(336, 458);
this.group5.Location = new System.Drawing.Point(336, 479);
this.group5.Name = "group5";
this.group5.Size = new System.Drawing.Size(385, 163);
this.group5.Size = new System.Drawing.Size(385, 155);
this.group5.TabIndex = 283;
this.group5.TabStop = false;
this.group5.Text = "第五步:开始校对位置:";
......@@ -427,7 +448,7 @@
this.ioSingle.IOName = "检测信号";
this.ioSingle.IOValue = 0;
this.ioSingle.isCanClick = false;
this.ioSingle.Location = new System.Drawing.Point(6, 129);
this.ioSingle.Location = new System.Drawing.Point(3, 118);
this.ioSingle.Name = "ioSingle";
this.ioSingle.Size = new System.Drawing.Size(220, 28);
this.ioSingle.TabIndex = 289;
......@@ -456,7 +477,7 @@
//
this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStart.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStart.Location = new System.Drawing.Point(224, 40);
this.btnStart.Location = new System.Drawing.Point(228, 40);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(132, 36);
this.btnStart.TabIndex = 88;
......@@ -468,7 +489,7 @@
//
this.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStop.Location = new System.Drawing.Point(224, 90);
this.btnStop.Location = new System.Drawing.Point(228, 90);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(132, 36);
this.btnStop.TabIndex = 257;
......@@ -512,17 +533,24 @@
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// btnMStop
// txtUpdownStart
//
this.btnMStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMStop.ForeColor = System.Drawing.Color.Black;
this.btnMStop.Location = new System.Drawing.Point(137, 242);
this.btnMStop.Name = "btnMStop";
this.btnMStop.Size = new System.Drawing.Size(121, 36);
this.btnMStop.TabIndex = 325;
this.btnMStop.Text = "旋转轴停止";
this.btnMStop.UseVisualStyleBackColor = true;
this.btnMStop.Click += new System.EventHandler(this.btnMStop_Click);
this.txtUpdownStart.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtUpdownStart.Location = new System.Drawing.Point(126, 23);
this.txtUpdownStart.MaxLength = 30;
this.txtUpdownStart.Name = "txtUpdownStart";
this.txtUpdownStart.Size = new System.Drawing.Size(105, 26);
this.txtUpdownStart.TabIndex = 260;
//
// label1
//
this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(8, 27);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(110, 20);
this.label1.TabIndex = 261;
this.label1.Text = "升降轴开始位置:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// FrmTool
//
......@@ -595,6 +623,8 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column_position;
private System.Windows.Forms.DataGridViewLinkColumn Column_Del;
private System.Windows.Forms.Button btnMStop;
private System.Windows.Forms.TextBox txtUpdownStart;
private System.Windows.Forms.Label label1;
}
}
......@@ -21,18 +21,26 @@ namespace OnlineStore.ACSingleStore
{
private BoxAutoPoint autoP;
private string LogName="自动对点位";
private string DefaultfilePath = "";
private bool IsStart = false;
private BoxBean Box = null;
private BoxBean Box = null;
//private PToolInfo workInfo = new PToolInfo();
public FrmTool(BoxBean box, string ioIp, int ioIndex, string name)
{
InitializeComponent();
this.Box = box;
autoP = new BoxAutoPoint(box);
DefaultfilePath = Application.StartupPath + @"\" + box.Name + @"position\";
if (!Directory.Exists(DefaultfilePath))
{
Directory.CreateDirectory(DefaultfilePath);
LogUtil.info(LogName + "创建位置保存文件夹:" + DefaultfilePath);
}
lblFileP.Text = DefaultfilePath;
this.Text = name + "_自动对点位 ";
LogName = this.Text;
txtUpdownStart.Text = 0.ToString();
FrmTool.CheckForIllegalCrossThreadCalls = false;
}
private int P3Offset = 0;
......@@ -44,7 +52,7 @@ namespace OnlineStore.ACSingleStore
AxisManager.instance.IsShowMsg = false;
CheckForIllegalCrossThreadCalls = false;
if (IOManager.instance == null)
{
......@@ -114,7 +122,8 @@ namespace OnlineStore.ACSingleStore
group3.Enabled = !isStart;
group4.Enabled = !isStart;
group5.Enabled = true;
group6.Enabled = !isStart ;
//group6.Enabled = !isStart ;
group6.Enabled = true;
btnStart.Enabled = !isStart;
btnStop.Enabled = isStart;
axisJogControl1.Enabled = !isStart;
......@@ -143,7 +152,7 @@ namespace OnlineStore.ACSingleStore
{
workMoveStatus(false);
}
if (lblFileP.Text.Equals(""))
if (!IsStart)
{
lblMoveInfo.Text = "请按步骤确认位置信息,然后点击“开始校对位置”按钮启动位置校准";
}
......@@ -182,7 +191,14 @@ namespace OnlineStore.ACSingleStore
private void btnOpenFolder_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Explorer.exe", autoP.paramInfo.FileTargetPath);
if (IsStart)
{
System.Diagnostics.Process.Start("Explorer.exe", autoP.paramInfo.FileTargetPath);
}
else
{
System.Diagnostics.Process.Start("Explorer.exe", DefaultfilePath);
}
}
private void btnExit_Click(object sender, EventArgs e)
......@@ -269,13 +285,14 @@ namespace OnlineStore.ACSingleStore
txtInout.Focus();
return;
}
int speed = FormUtil.GetIntValue(txtSpeed);
if (speed <= (0))
int SPostion = FormUtil.GetIntValue(txtUpdownStart);
if (SPostion < 0)
{
MessageBox.Show(ResourceCulture.GetString("请输入正确的速度"), "提示");
txtSpeed.Focus();
MessageBox.Show("请输入正确的升降轴开始位置", "提示");
txtUpdownStart.Focus();
return;
}
txtUpdownStart.Text = SPostion.ToString();
int TPostion = FormUtil.GetIntValue(txtTargetPosition);
if (TPostion <= 0)
{
......@@ -283,7 +300,13 @@ namespace OnlineStore.ACSingleStore
txtTargetPosition.Focus();
return;
}
int speed = FormUtil.GetIntValue(txtSpeed);
if (speed <= (0))
{
MessageBox.Show(ResourceCulture.GetString("请输入正确的速度"), "提示");
txtSpeed.Focus();
return;
}
P3Offset = FormUtil.GetIntValue(txtP3Offset);
P4Offset = FormUtil.GetIntValue(txtP4Offset);
P5Offset = FormUtil.GetIntValue(txtP5Offset);
......@@ -293,6 +316,7 @@ namespace OnlineStore.ACSingleStore
autoP.paramInfo = new PToolInfo();
autoP.paramInfo.InoutTargetPosition = inoutP;
autoP.paramInfo.UpdownStartPosition = SPostion;
autoP.paramInfo.UpdownTargetPosition = TPostion;
autoP.paramInfo.UpdownSpeed = speed;
autoP.paramInfo.MiddlePositionList = new List<int>();
......@@ -324,10 +348,10 @@ namespace OnlineStore.ACSingleStore
autoP.paramInfo.LastValue = IO_VALUE.LOW;
string date = DateTime.Now.ToString("yyyyMMddHHmm");
string filePath = Application.StartupPath + @"\position\"+ date + @"\";
string filePath = DefaultfilePath + date + @"\";
if (Directory.Exists(filePath))
{
DialogResult result = MessageBox.Show("文件夹【" + filePath + "】已存在,将清除文件夹内容,是否确定清除?",
DialogResult result = MessageBox.Show("文件夹【" + filePath + "】已存在,将覆盖文件夹内容,是否确定继续?",
"确认提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (!result.Equals(DialogResult.OK))
{
......@@ -346,7 +370,8 @@ namespace OnlineStore.ACSingleStore
autoP.StopMove();
LogUtil.info(LogName + "开始校对位置:" + msg + " 启动定时器 ");
autoP.Start();
lblFileP.Text = "目标文件夹:" + filePath;
lblFileP.Text = filePath;
IsStart = true;
}
}
......
......@@ -126,15 +126,6 @@
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Index.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_position.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
......
......@@ -58,3 +58,11 @@
自动复位有问题。
保存位置弹出提示框。
20201025
1.点位调试:左右侧BOX位置分文件夹保存。
2.点位调试:增加升降轴开始位置,方便仓门列的库位调试。
3.点位调试:打开文件夹默认可用。
4.自动出入库修改。
......@@ -426,6 +426,11 @@ namespace HuichuanLibrary
Console.WriteLine(BoardName() + msg);
HCLogUtil.info(BoardName() + msg);
}
private static void DebugLog(string msg)
{
Console.WriteLine(BoardName() + msg);
HCLogUtil.debug(BoardName() + msg);
}
}
public class AxisSts
{
......
......@@ -255,7 +255,7 @@ namespace HuichuanLibrary
}
else
{
ShowLog(" Axis[" + axisNo + "] StartPtpMove " + ptpType + " OK");
DebugLog(" Axis[" + axisNo + "] StartPtpMove " + ptpType + " OK");
return true;
}
}
......@@ -274,7 +274,7 @@ namespace HuichuanLibrary
}
else
{
ShowLog(" Axis[" + axisNo + "] SetSingleAxMvPara OK");
DebugLog(" Axis[" + axisNo + "] SetSingleAxMvPara OK");
return true;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!