Commit 3e9b197e LN

bug修改

1 个父辈 e8b2b136
......@@ -1333,6 +1333,7 @@
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(1326, 170);
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
//
// tabPage9
//
......@@ -1340,7 +1341,7 @@
this.tabPage9.Location = new System.Drawing.Point(4, 29);
this.tabPage9.Name = "tabPage9";
this.tabPage9.Padding = new System.Windows.Forms.Padding(3);
this.tabPage9.Size = new System.Drawing.Size(1332, 181);
this.tabPage9.Size = new System.Drawing.Size(1332, 176);
this.tabPage9.TabIndex = 1;
this.tabPage9.Text = "右侧";
this.tabPage9.UseVisualStyleBackColor = true;
......@@ -1352,8 +1353,9 @@
this.dataGridView2.Location = new System.Drawing.Point(3, 3);
this.dataGridView2.Name = "dataGridView2";
this.dataGridView2.RowTemplate.Height = 23;
this.dataGridView2.Size = new System.Drawing.Size(1326, 175);
this.dataGridView2.Size = new System.Drawing.Size(1326, 170);
this.dataGridView2.TabIndex = 1;
this.dataGridView2.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView2_CellClick);
//
// groupInout
//
......
......@@ -97,6 +97,11 @@ namespace OnlineStore.ACSquareStore
}
foreach (var item in store.posDebug.LPos)
{
string[] arrays = item.PosName.Split('_');
if (arrays.Length >= 2)
{
dataGridView1.Columns[item.Col - 1].HeaderText = arrays[0];
}
dataGridView1.Rows[item.Row - 1].Cells[item.Col - 1].Value = item.PosName;
dataGridView1.Rows[item.Row - 1].Cells[item.Col - 1].Tag = item.PosId;
dataGridView1.Rows[item.Row - 1].Cells[item.Col - 1].Style = GetStyle(item.PosId);
......@@ -324,11 +329,11 @@ namespace OnlineStore.ACSquareStore
{
msg = msg.Replace("自动出库:", "");
msg = msg.Replace("自动入库:", "");
int index = store.PositionNumList.IndexOf(msg);
if (index >= 0 && (!msg.Equals("")))
{
cmbPosition.SelectedIndex = index;
}
//int index = store.PositionNumList.IndexOf(msg);
//if (index >= 0 && (!msg.Equals("")))
//{
// cmbPosition.SelectedIndex = index;
//}
}
catch (Exception ex) { }
}
......@@ -1421,6 +1426,7 @@ namespace OnlineStore.ACSquareStore
txtUpDownP6.Text = ktkPosition.UpDownAxis_OL_P6.ToString();
txtInOutP4.Text = ktkPosition.InOutAxis_P4.ToString();
}
}
static Font font = new Font("宋体", 10);
DataGridViewCellStyle dgv_ok = new DataGridViewCellStyle() { BackColor = Color.LightGreen, Font = font };
......@@ -1441,5 +1447,30 @@ namespace OnlineStore.ACSquareStore
return dgv_none;
}
#endregion
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag == null)
return;
string posid = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag.ToString();
int index = store.PositionNumList.IndexOf(posid);
if (index >= 0 && (!posid.Equals("")))
{
cmbPosition.SelectedIndex = index;
}
//SetData(posid);
}
private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || dataGridView2.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag == null)
return;
string posid = dataGridView2.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag.ToString();
int index = store.PositionNumList.IndexOf(posid);
if (index >= 0 && (!posid.Equals("")))
{
cmbPosition.SelectedIndex = index;
}
}
}
}
......@@ -59,9 +59,29 @@ namespace OnlineStore.AssemblyLine
// ACServerManager.ServoOff(PortName, SlvAddr);
ACServerManager.ServoOff(PortName, SlvAddr);
}
/// <summary>
/// 判断进出轴是否在P1点
/// </summary>
private bool InOutIsIsP1()
{
int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
int currValue = ACServerManager.GetActualtPosition(StoreManager.Config.InOut_Axis.DeviceName, StoreManager.Config.InOut_Axis.GetAxisValue());
if (currValue <= InOutDefaultPosition)
{
return true;
}
MessageBox.Show("叉子不在待机位,请先将叉子退回待机位(" + InOutDefaultPosition + ")", "警告(叉子在待机位时,才能移动升降轴和前后轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
private void btnAxisAMove_Click(object sender, EventArgs e)
{
//判断进出轴是否在待机点
if (!StoreManager.Config.InOut_Axis.IsSameAxis(PortName, SlvAddr) && (!InOutIsIsP1()))
{
return;
}
int position = FormUtil.GetIntValue(txtAPosition);
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【绝对运动】,【" + PortName + "_" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
......@@ -70,6 +90,12 @@ namespace OnlineStore.AssemblyLine
private void btnAxisRMove_Click(object sender, EventArgs e)
{
//判断进出轴是否在待机点
if (!StoreManager.Config.InOut_Axis.IsSameAxis(PortName, SlvAddr) && (!InOutIsIsP1()))
{
return;
}
int position = FormUtil.GetIntValue(txtAPosition);
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【相对运动】,【" + PortName + "_" + SlvAddr + "】位置【" + position + "】速度【" + speed + "】");
......@@ -78,6 +104,13 @@ namespace OnlineStore.AssemblyLine
private void btnAxisVMove_Click(object sender, EventArgs e)
{
//判断进出轴是否在待机点
if (!StoreManager.Config.InOut_Axis.IsSameAxis(PortName, SlvAddr) && (!InOutIsIsP1()))
{
return;
}
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【匀速运动】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.SpeedMove(PortName, SlvAddr, speed);
......@@ -109,6 +142,12 @@ namespace OnlineStore.AssemblyLine
private void btnAxisReturnHome_Click(object sender, EventArgs e)
{
//判断进出轴是否在待机点
if (!StoreManager.Config.InOut_Axis.IsSameAxis(PortName, SlvAddr) && (!InOutIsIsP1()))
{
return;
}
int speed = FormUtil.GetIntValue(txtASpeed);
LogUtil.info("点击【原点返回】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】");
ACServerManager.HomeMove(PortName, SlvAddr, speed);
......@@ -123,7 +162,7 @@ namespace OnlineStore.AssemblyLine
this.txtHomeSingle.Text = ACServerManager.GetHomeSingle(PortName, SlvAddr).ToString();
this.txtLimit1.Text = ACServerManager.GetLimitPositiveSingle(PortName, SlvAddr).ToString();
this.txtLimit2.Text = ACServerManager.GetLimitNegativeSingle(PortName, SlvAddr).ToString();
txtServoStatue.Text = ACServerManager.ServerOnStatus(PortName, SlvAddr) ? "✔" : "✘";
textBoxON.Text = ACServerManager.ServerOnStatus(PortName, SlvAddr) ? "✔" : "✘";
}
......@@ -193,6 +232,11 @@ namespace OnlineStore.AssemblyLine
{
if (btnAddMove.BackColor.Equals(System.Drawing.SystemColors.Control))
{
//判断进出轴是否在待机点
if (!StoreManager.Config.InOut_Axis.IsSameAxis(PortName, SlvAddr) && (!InOutIsIsP1()))
{
return;
}
int speed = FormUtil.GetIntValue(txtMiddleSpeed);
if (speed <= 0)
{
......@@ -218,6 +262,11 @@ namespace OnlineStore.AssemblyLine
{
if (btnDelMove.BackColor.Equals(System.Drawing.SystemColors.Control))
{
//判断进出轴是否在待机点
if (!StoreManager.Config.InOut_Axis.IsSameAxis(PortName, SlvAddr) && (!InOutIsIsP1()))
{
return;
}
int speed = FormUtil.GetIntValue(txtMiddleSpeed);
if (speed <= 0)
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!