Commit 76a05e6f LN

增加旋转轴回原点。删除修改。增加编号

1 个父辈 2e8cf5a3
...@@ -189,8 +189,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,8 +189,8 @@ namespace OnlineStore.DeviceLibrary
strList.Add(resultstr); strList.Add(resultstr);
index++; index++;
} }
int count = paramInfo.CurrIndex + 1;
string fileName = "position_" + paramInfo.GetCurrMiddleP()+ ".csv"; string fileName = "position"+count+"_" + paramInfo.GetCurrMiddleP()+ ".csv";
string filePath = paramInfo.FileTargetPath + fileName; string filePath = paramInfo.FileTargetPath + fileName;
try try
{ {
...@@ -284,10 +284,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -284,10 +284,10 @@ namespace OnlineStore.DeviceLibrary
public DateTime LastTime = DateTime.Now; public DateTime LastTime = DateTime.Now;
public string ParamStr() public string ParamStr()
{ {
string msgStr = "请确认以下对点位参数,点击确定按钮开始自动校准点位:\r\n"; string msgStr = "请确认以下对点位参数,点击“确定”按钮开始自动校准点位:\r\n";
msgStr += "\t进出轴前进位置:" + InoutTargetPosition + "\r\n"; msgStr += " 进出轴前进位置:" + InoutTargetPosition + "\r\n";
msgStr += "\t升降轴目标位置:" + UpdownTargetPosition + ",速度:"+UpdownSpeed+"\r\n"; msgStr += " 升降轴目标位置:" + UpdownTargetPosition + ",速度:"+UpdownSpeed+"\r\n";
msgStr += "\t旋转轴位置列表:"; msgStr += " 旋转轴位置列表:";
foreach (int mP in MiddlePositionList) foreach (int mP in MiddlePositionList)
{ {
...@@ -299,8 +299,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -299,8 +299,8 @@ namespace OnlineStore.DeviceLibrary
msgStr = msgStr.Substring(0, msgStr.Length - 1); msgStr = msgStr.Substring(0, msgStr.Length - 1);
} }
msgStr += "\r\n"; msgStr += "\r\n";
msgStr += "\t点位偏移量:P3["+P3Offset+"],P4["+P4Offset+"],P5["+P5Offset+"],P6["+P6Offset+"]\r\n"; msgStr += " 点位偏移量:P3[" + P3Offset+"],P4["+P4Offset+"],P5["+P5Offset+"],P6["+P6Offset+"]\r\n";
msgStr += "\t文件保存位置:" + FileTargetPath; msgStr += " 文件保存位置:" + FileTargetPath;
return msgStr; return msgStr;
} }
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.panelAll = new System.Windows.Forms.Panel(); this.panelAll = new System.Windows.Forms.Panel();
this.lblMoveInfo = new System.Windows.Forms.Label();
this.group6 = new System.Windows.Forms.GroupBox(); this.group6 = new System.Windows.Forms.GroupBox();
this.lblFileP = new System.Windows.Forms.Label();
this.btnOpenFolder = new System.Windows.Forms.Button(); this.btnOpenFolder = new System.Windows.Forms.Button();
this.group2 = new System.Windows.Forms.GroupBox(); this.group2 = new System.Windows.Forms.GroupBox();
this.txtTargetPosition = new System.Windows.Forms.TextBox(); this.txtTargetPosition = new System.Windows.Forms.TextBox();
...@@ -46,7 +48,9 @@ ...@@ -46,7 +48,9 @@
this.txtP6Offset = new System.Windows.Forms.TextBox(); this.txtP6Offset = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.group3 = new System.Windows.Forms.GroupBox(); this.group3 = new System.Windows.Forms.GroupBox();
this.btnMHome = new System.Windows.Forms.Button();
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.Column_Index = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_position = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column_position = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Del = new System.Windows.Forms.DataGridViewLinkColumn(); this.Column_Del = new System.Windows.Forms.DataGridViewLinkColumn();
this.btnAddMiddleP = new System.Windows.Forms.Button(); this.btnAddMiddleP = new System.Windows.Forms.Button();
...@@ -64,8 +68,7 @@ ...@@ -64,8 +68,7 @@
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.axisJogControl1 = new OnlineStore.ACSingleStore.AxisJogControl(); this.axisJogControl1 = new OnlineStore.ACSingleStore.AxisJogControl();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.lblFileP = new System.Windows.Forms.Label(); this.btnMStop = new System.Windows.Forms.Button();
this.lblMoveInfo = new System.Windows.Forms.Label();
this.panelAll.SuspendLayout(); this.panelAll.SuspendLayout();
this.group6.SuspendLayout(); this.group6.SuspendLayout();
this.group2.SuspendLayout(); this.group2.SuspendLayout();
...@@ -97,6 +100,16 @@ ...@@ -97,6 +100,16 @@
this.panelAll.Size = new System.Drawing.Size(1085, 643); this.panelAll.Size = new System.Drawing.Size(1085, 643);
this.panelAll.TabIndex = 250; this.panelAll.TabIndex = 250;
// //
// lblMoveInfo
//
this.lblMoveInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblMoveInfo.ForeColor = System.Drawing.Color.Blue;
this.lblMoveInfo.Location = new System.Drawing.Point(422, 379);
this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(498, 67);
this.lblMoveInfo.TabIndex = 324;
this.lblMoveInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// group6 // group6
// //
this.group6.Controls.Add(this.lblFileP); this.group6.Controls.Add(this.lblFileP);
...@@ -109,6 +122,15 @@ ...@@ -109,6 +122,15 @@
this.group6.TabStop = false; this.group6.TabStop = false;
this.group6.Text = "第六步:查看位置列表:"; this.group6.Text = "第六步:查看位置列表:";
// //
// lblFileP
//
this.lblFileP.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblFileP.Location = new System.Drawing.Point(6, 28);
this.lblFileP.Name = "lblFileP";
this.lblFileP.Size = new System.Drawing.Size(324, 67);
this.lblFileP.TabIndex = 281;
this.lblFileP.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// btnOpenFolder // btnOpenFolder
// //
this.btnOpenFolder.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnOpenFolder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
...@@ -263,6 +285,8 @@ ...@@ -263,6 +285,8 @@
// //
// group3 // group3
// //
this.group3.Controls.Add(this.btnMStop);
this.group3.Controls.Add(this.btnMHome);
this.group3.Controls.Add(this.dataGridView1); this.group3.Controls.Add(this.dataGridView1);
this.group3.Controls.Add(this.btnAddMiddleP); this.group3.Controls.Add(this.btnAddMiddleP);
this.group3.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.group3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
...@@ -273,17 +297,31 @@ ...@@ -273,17 +297,31 @@
this.group3.TabStop = false; this.group3.TabStop = false;
this.group3.Text = "第三步:确认(轴一)旋转轴位置列表:"; this.group3.Text = "第三步:确认(轴一)旋转轴位置列表:";
// //
// btnMHome
//
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.Name = "btnMHome";
this.btnMHome.Size = new System.Drawing.Size(121, 36);
this.btnMHome.TabIndex = 324;
this.btnMHome.Text = "旋转轴回原点";
this.btnMHome.UseVisualStyleBackColor = true;
this.btnMHome.Click += new System.EventHandler(this.btnMHome_Click);
//
// dataGridView1 // dataGridView1
// //
this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false; this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column_Index,
this.Column_position, this.Column_position,
this.Column_Del}); this.Column_Del});
this.dataGridView1.Location = new System.Drawing.Point(10, 23); this.dataGridView1.Location = new System.Drawing.Point(10, 23);
this.dataGridView1.MultiSelect = false; this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersWidth = 5;
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(375, 213); this.dataGridView1.Size = new System.Drawing.Size(375, 213);
...@@ -291,6 +329,12 @@ ...@@ -291,6 +329,12 @@
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating); this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
// //
// Column_Index
//
this.Column_Index.HeaderText = "编号";
this.Column_Index.Name = "Column_Index";
this.Column_Index.Width = 60;
//
// Column_position // Column_position
// //
this.Column_position.HeaderText = "位置"; this.Column_position.HeaderText = "位置";
...@@ -312,9 +356,9 @@ ...@@ -312,9 +356,9 @@
// //
this.btnAddMiddleP.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnAddMiddleP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAddMiddleP.ForeColor = System.Drawing.Color.Black; this.btnAddMiddleP.ForeColor = System.Drawing.Color.Black;
this.btnAddMiddleP.Location = new System.Drawing.Point(247, 242); this.btnAddMiddleP.Location = new System.Drawing.Point(263, 242);
this.btnAddMiddleP.Name = "btnAddMiddleP"; this.btnAddMiddleP.Name = "btnAddMiddleP";
this.btnAddMiddleP.Size = new System.Drawing.Size(138, 36); this.btnAddMiddleP.Size = new System.Drawing.Size(121, 36);
this.btnAddMiddleP.TabIndex = 322; this.btnAddMiddleP.TabIndex = 322;
this.btnAddMiddleP.Text = "加入实时位置"; this.btnAddMiddleP.Text = "加入实时位置";
this.btnAddMiddleP.UseVisualStyleBackColor = true; this.btnAddMiddleP.UseVisualStyleBackColor = true;
...@@ -468,24 +512,17 @@ ...@@ -468,24 +512,17 @@
this.timer1.Interval = 1000; this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// lblFileP // btnMStop
//
this.lblFileP.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblFileP.Location = new System.Drawing.Point(6, 28);
this.lblFileP.Name = "lblFileP";
this.lblFileP.Size = new System.Drawing.Size(324, 67);
this.lblFileP.TabIndex = 281;
this.lblFileP.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lblMoveInfo
// //
this.lblMoveInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnMStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblMoveInfo.ForeColor = System.Drawing.Color.Blue; this.btnMStop.ForeColor = System.Drawing.Color.Black;
this.lblMoveInfo.Location = new System.Drawing.Point(422, 379); this.btnMStop.Location = new System.Drawing.Point(137, 242);
this.lblMoveInfo.Name = "lblMoveInfo"; this.btnMStop.Name = "btnMStop";
this.lblMoveInfo.Size = new System.Drawing.Size(498, 67); this.btnMStop.Size = new System.Drawing.Size(121, 36);
this.lblMoveInfo.TabIndex = 324; this.btnMStop.TabIndex = 325;
this.lblMoveInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.btnMStop.Text = "旋转轴停止";
this.btnMStop.UseVisualStyleBackColor = true;
this.btnMStop.Click += new System.EventHandler(this.btnMStop_Click);
// //
// FrmTool // FrmTool
// //
...@@ -551,10 +588,13 @@ ...@@ -551,10 +588,13 @@
private System.Windows.Forms.GroupBox group6; private System.Windows.Forms.GroupBox group6;
private AxisJogControl axisJogControl1; private AxisJogControl axisJogControl1;
private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_position;
private System.Windows.Forms.DataGridViewLinkColumn Column_Del;
private System.Windows.Forms.Label lblFileP; private System.Windows.Forms.Label lblFileP;
private System.Windows.Forms.Label lblMoveInfo; private System.Windows.Forms.Label lblMoveInfo;
private System.Windows.Forms.Button btnMHome;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Index;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_position;
private System.Windows.Forms.DataGridViewLinkColumn Column_Del;
private System.Windows.Forms.Button btnMStop;
} }
} }
...@@ -208,8 +208,8 @@ namespace OnlineStore.ACSingleStore ...@@ -208,8 +208,8 @@ namespace OnlineStore.ACSingleStore
DataGridViewRow view = new DataGridViewRow(); DataGridViewRow view = new DataGridViewRow();
view.CreateCells(dataGridView1); view.CreateCells(dataGridView1);
view.Cells[0].Value = dataGridView1.Rows.Count + 1;
view.Cells[0].Value = p; view.Cells[1].Value = p;
dataGridView1.Rows.Add(view); dataGridView1.Rows.Add(view);
} }
...@@ -220,15 +220,16 @@ namespace OnlineStore.ACSingleStore ...@@ -220,15 +220,16 @@ namespace OnlineStore.ACSingleStore
{ {
string name = this.dataGridView1.Columns[e.ColumnIndex].Name; string name = this.dataGridView1.Columns[e.ColumnIndex].Name;
int rowIndex = e.RowIndex; int rowIndex = e.RowIndex;
if (dataGridView1.Equals(this.Column_Del.Name)) if (name.Equals(this.Column_Del.Name))
{ {
if (MessageBox.Show("确认要删除该行数据吗?", "提示?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) DialogResult dialogResult = MessageBox.Show("确认要删除该行数据吗?", "提示?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
{ if (dialogResult.Equals(DialogResult.OK))
return;
}
else
{ {
this.dataGridView1.Rows.RemoveAt(rowIndex); this.dataGridView1.Rows.RemoveAt(rowIndex);
for (int index = 0; index < dataGridView1.Rows.Count; index++)
{
dataGridView1.Rows[index].Cells[0].Value = (index + 1);
}
} }
} }
} }
...@@ -342,6 +343,7 @@ namespace OnlineStore.ACSingleStore ...@@ -342,6 +343,7 @@ namespace OnlineStore.ACSingleStore
DialogResult result1 = MessageBox.Show(msg, "请确认对点位参数", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); DialogResult result1 = MessageBox.Show(msg, "请确认对点位参数", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (result1.Equals(DialogResult.OK)) if (result1.Equals(DialogResult.OK))
{ {
autoP.StopMove();
LogUtil.info(LogName + "开始校对位置:" + msg + " 启动定时器 "); LogUtil.info(LogName + "开始校对位置:" + msg + " 启动定时器 ");
autoP.Start(); autoP.Start();
lblFileP.Text = "目标文件夹:" + filePath; lblFileP.Text = "目标文件夹:" + filePath;
...@@ -349,6 +351,20 @@ namespace OnlineStore.ACSingleStore ...@@ -349,6 +351,20 @@ namespace OnlineStore.ACSingleStore
} }
#endregion #endregion
private void btnMHome_Click(object sender, EventArgs e)
{
LogUtil.info(LogName + "点击:旋转轴回原点");
ConfigMoveAxis axis = Box.Config.Middle_Axis;
AxisManager.instance.HomeMove(axis.DeviceName, axis.GetAxisValue(),axis.HomeHighSpeed,axis.HomeLowSpeed,axis.HomeAddSpeed);
}
private void btnMStop_Click(object sender, EventArgs e)
{
LogUtil.info(LogName + "点击:旋转轴停止");
ConfigMoveAxis axis = Box.Config.Middle_Axis;
AxisManager.instance.SuddenStop(axis.DeviceName, axis.GetAxisValue());
}
} }
public class ResourceCulture public class ResourceCulture
......
...@@ -117,12 +117,18 @@ ...@@ -117,12 +117,18 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<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"> <metadata name="Column_position.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column_Del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </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"> <metadata name="Column_position.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!