Commit 9055e8f5 LN

增加点动按钮

1 个父辈 fbff763e
...@@ -87,6 +87,8 @@ ...@@ -87,6 +87,8 @@
this.cmbMoveType = new System.Windows.Forms.ComboBox(); this.cmbMoveType = new System.Windows.Forms.ComboBox();
this.label19 = new System.Windows.Forms.Label(); this.label19 = new System.Windows.Forms.Label();
this.cmbTargetType = new System.Windows.Forms.ComboBox(); this.cmbTargetType = new System.Windows.Forms.ComboBox();
this.btnjogF = new System.Windows.Forms.Button();
this.btnjog = new System.Windows.Forms.Button();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudMaxSpeed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudMaxSpeed)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudStartSpeed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudStartSpeed)).BeginInit();
...@@ -621,6 +623,8 @@ ...@@ -621,6 +623,8 @@
// //
// groupBox5 // groupBox5
// //
this.groupBox5.Controls.Add(this.btnjog);
this.groupBox5.Controls.Add(this.btnjogF);
this.groupBox5.Controls.Add(this.txtHomeMoveSpeed); this.groupBox5.Controls.Add(this.txtHomeMoveSpeed);
this.groupBox5.Controls.Add(this.label2); this.groupBox5.Controls.Add(this.label2);
this.groupBox5.Controls.Add(this.btnHomeMove); this.groupBox5.Controls.Add(this.btnHomeMove);
...@@ -661,7 +665,7 @@ ...@@ -661,7 +665,7 @@
// btnHomeMove // btnHomeMove
// //
this.btnHomeMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnHomeMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnHomeMove.Location = new System.Drawing.Point(282, 121); this.btnHomeMove.Location = new System.Drawing.Point(288, 121);
this.btnHomeMove.Name = "btnHomeMove"; this.btnHomeMove.Name = "btnHomeMove";
this.btnHomeMove.Size = new System.Drawing.Size(136, 45); this.btnHomeMove.Size = new System.Drawing.Size(136, 45);
this.btnHomeMove.TabIndex = 53; this.btnHomeMove.TabIndex = 53;
...@@ -672,7 +676,7 @@ ...@@ -672,7 +676,7 @@
// btnSpeedMove // btnSpeedMove
// //
this.btnSpeedMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnSpeedMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSpeedMove.Location = new System.Drawing.Point(282, 21); this.btnSpeedMove.Location = new System.Drawing.Point(288, 21);
this.btnSpeedMove.Name = "btnSpeedMove"; this.btnSpeedMove.Name = "btnSpeedMove";
this.btnSpeedMove.Size = new System.Drawing.Size(136, 45); this.btnSpeedMove.Size = new System.Drawing.Size(136, 45);
this.btnSpeedMove.TabIndex = 42; this.btnSpeedMove.TabIndex = 42;
...@@ -683,7 +687,7 @@ ...@@ -683,7 +687,7 @@
// btnAbsMove // btnAbsMove
// //
this.btnAbsMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnAbsMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAbsMove.Location = new System.Drawing.Point(282, 70); this.btnAbsMove.Location = new System.Drawing.Point(288, 70);
this.btnAbsMove.Name = "btnAbsMove"; this.btnAbsMove.Name = "btnAbsMove";
this.btnAbsMove.Size = new System.Drawing.Size(136, 45); this.btnAbsMove.Size = new System.Drawing.Size(136, 45);
this.btnAbsMove.TabIndex = 41; this.btnAbsMove.TabIndex = 41;
...@@ -694,9 +698,9 @@ ...@@ -694,9 +698,9 @@
// btnStopMove // btnStopMove
// //
this.btnStopMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnStopMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStopMove.Location = new System.Drawing.Point(428, 70); this.btnStopMove.Location = new System.Drawing.Point(431, 70);
this.btnStopMove.Name = "btnStopMove"; this.btnStopMove.Name = "btnStopMove";
this.btnStopMove.Size = new System.Drawing.Size(136, 45); this.btnStopMove.Size = new System.Drawing.Size(136, 96);
this.btnStopMove.TabIndex = 35; this.btnStopMove.TabIndex = 35;
this.btnStopMove.Text = "停止运动"; this.btnStopMove.Text = "停止运动";
this.btnStopMove.UseVisualStyleBackColor = true; this.btnStopMove.UseVisualStyleBackColor = true;
...@@ -705,7 +709,7 @@ ...@@ -705,7 +709,7 @@
// btnRelMove // btnRelMove
// //
this.btnRelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnRelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRelMove.Location = new System.Drawing.Point(428, 21); this.btnRelMove.Location = new System.Drawing.Point(431, 21);
this.btnRelMove.Name = "btnRelMove"; this.btnRelMove.Name = "btnRelMove";
this.btnRelMove.Size = new System.Drawing.Size(136, 45); this.btnRelMove.Size = new System.Drawing.Size(136, 45);
this.btnRelMove.TabIndex = 34; this.btnRelMove.TabIndex = 34;
...@@ -803,6 +807,30 @@ ...@@ -803,6 +807,30 @@
this.cmbTargetType.TabIndex = 25; this.cmbTargetType.TabIndex = 25;
this.cmbTargetType.Visible = false; this.cmbTargetType.Visible = false;
// //
// btnjogF
//
this.btnjogF.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnjogF.Location = new System.Drawing.Point(6, 121);
this.btnjogF.Name = "btnjogF";
this.btnjogF.Size = new System.Drawing.Size(136, 45);
this.btnjogF.TabIndex = 56;
this.btnjogF.Text = "点动-";
this.btnjogF.UseVisualStyleBackColor = true;
this.btnjogF.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnjogF_MouseDown);
this.btnjogF.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnjogF_MouseUp);
//
// btnjog
//
this.btnjog.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnjog.Location = new System.Drawing.Point(143, 121);
this.btnjog.Name = "btnjog";
this.btnjog.Size = new System.Drawing.Size(136, 45);
this.btnjog.TabIndex = 57;
this.btnjog.Text = "点动+";
this.btnjog.UseVisualStyleBackColor = true;
this.btnjog.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnjog_MouseDown);
this.btnjog.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnjog_MouseUp);
//
// FrmPusicanTest // FrmPusicanTest
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -899,5 +927,7 @@ ...@@ -899,5 +927,7 @@
private System.Windows.Forms.ComboBox cmbPostionList; private System.Windows.Forms.ComboBox cmbPostionList;
private System.Windows.Forms.LinkLabel linkPosSave; private System.Windows.Forms.LinkLabel linkPosSave;
private System.Windows.Forms.TextBox txtPosValue; private System.Windows.Forms.TextBox txtPosValue;
private System.Windows.Forms.Button btnjogF;
private System.Windows.Forms.Button btnjog;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -77,8 +77,12 @@ namespace TSA_V ...@@ -77,8 +77,12 @@ namespace TSA_V
btnSetPosition.Enabled = open; btnSetPosition.Enabled = open;
btnHomeMove.Enabled = open; btnHomeMove.Enabled = open;
llblClearp.Enabled = open; llblClearp.Enabled = open;
linkP1.Enabled = open; linkP1.Enabled = open;
btnjog.Enabled = open;
btnjogF.Enabled = open;
linkSetP1.Enabled = true; linkSetP1.Enabled = true;
lblP1.Enabled = true; lblP1.Enabled = true;
txtCurrP1.Enabled = true; txtCurrP1.Enabled = true;
...@@ -94,6 +98,46 @@ namespace TSA_V ...@@ -94,6 +98,46 @@ namespace TSA_V
{ {
return FormUtil.GetuIntValue(txtNode); return FormUtil.GetuIntValue(txtNode);
} }
private void showConfigParam()
{
uint nodeId = GetSelectNode();
int addSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_AddSpeed, nodeId.ToString());
int delSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_DelSpeed, nodeId.ToString());
int maxPhase = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_MaxPhaseCurrent, nodeId.ToString());
int startSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_HomeStartSpeed, nodeId.ToString());
int stopSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_HomeStopSpeed, nodeId.ToString());
int maxSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_MaxSpeed, nodeId.ToString());
int microValue = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_MicroStepping, nodeId.ToString());
int delValue = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_DelPhaseCurrent, nodeId.ToString());
if (nodeId.Equals(LWidthManager.Line_NodeAddr))
{
if (ConfigAppSettings.GetIntValue(Setting_Init.Line_HomeStartSpeed, nodeId.ToString()) != 0)
{
startSpeed = ConfigAppSettings.GetIntValue(Setting_Init.Line_HomeStartSpeed, nodeId.ToString());
stopSpeed = ConfigAppSettings.GetIntValue(Setting_Init.Line_HomeStopSpeed, nodeId.ToString());
maxSpeed = ConfigAppSettings.GetIntValue(Setting_Init.Line_MaxSpeed, nodeId.ToString());
}
if (ConfigAppSettings.GetIntValue(Setting_Init.Line_MaxPhaseCurrent, nodeId.ToString()) > 0)
{
addSpeed = ConfigAppSettings.GetIntValue(Setting_Init.Line_AddSpeed, nodeId.ToString());
delSpeed = ConfigAppSettings.GetIntValue(Setting_Init.Line_DelSpeed, nodeId.ToString());
maxPhase = ConfigAppSettings.GetIntValue(Setting_Init.Line_MaxPhaseCurrent, nodeId.ToString());
microValue = ConfigAppSettings.GetIntValue(Setting_Init.Line_MicroStepping, nodeId.ToString());
delValue = ConfigAppSettings.GetIntValue(Setting_Init.Line_DelPhaseCurrent, nodeId.ToString());
}
}
this.nudMaxSpeed.Text = maxSpeed.ToString();
this.nudAddSpeed.Text = addSpeed.ToString();
this.nudDelSpeed.Text = delSpeed.ToString();
this.nudStartSpeed.Text = startSpeed.ToString();
this.nudStopSpeed.Text = stopSpeed.ToString();
this.cmbXiFen.Text = microValue.ToString();
this.nudFengzhi.Text = maxPhase.ToString();
this.nudShuaijian.Text = delValue.ToString();
}
private void btnReadAll_Click(object sender, EventArgs e) private void btnReadAll_Click(object sender, EventArgs e)
{ {
uint nodeid = GetSelectNode(); uint nodeid = GetSelectNode();
...@@ -221,6 +265,7 @@ namespace TSA_V ...@@ -221,6 +265,7 @@ namespace TSA_V
txtHomeMoveSpeed.Text = ConfigAppSettings.GetValue(Setting_Init.RotateNode_HomeSpeed); txtHomeMoveSpeed.Text = ConfigAppSettings.GetValue(Setting_Init.RotateNode_HomeSpeed);
ShowP1(true,(int)nodeid); ShowP1(true,(int)nodeid);
} }
showConfigParam();
if (btnReadAll.Enabled) if (btnReadAll.Enabled)
{ {
btnReadAll_Click(null, null); btnReadAll_Click(null, null);
...@@ -239,7 +284,7 @@ namespace TSA_V ...@@ -239,7 +284,7 @@ namespace TSA_V
lblPosL.Visible = v; lblPosL.Visible = v;
cmbPostionList.Visible = v; cmbPostionList.Visible = v;
txtPosValue.Visible = v; txtPosValue.Visible = v;
linkPosSave.Visible = v; linkPosSave.Visible = v;
if (v) if (v)
{ {
...@@ -269,7 +314,19 @@ namespace TSA_V ...@@ -269,7 +314,19 @@ namespace TSA_V
{ {
cmbPostionList.SelectedIndex = 0; cmbPostionList.SelectedIndex = 0;
} }
if (Setting_NInit.App_IsDebug)
{
}
else
{
linkSetP1.Visible = false;
linkP1.Visible = false;
linkPosSave.Visible = false;
}
} }
} }
private void checkBox1_CheckedChanged(object sender, EventArgs e) private void checkBox1_CheckedChanged(object sender, EventArgs e)
...@@ -394,6 +451,55 @@ namespace TSA_V ...@@ -394,6 +451,55 @@ namespace TSA_V
} }
} }
} }
private void btnjogF_MouseDown(object sender, MouseEventArgs e)
{
if (btnjogF.BackColor.Equals(Color.Black))
{
uint nodeid = GetSelectNode();
int speed = Math.Abs((int)nudMaxSpeed.Value)/5*-1;
if (speed == 0)
{
return;
}
btnjogF.BackColor = Color.Green;
PUSICANControl.VolMove(nodeid, speed);
}
}
private void btnjogF_MouseUp(object sender, MouseEventArgs e)
{
if (btnjogF.BackColor == Color.Green)
{
btnjogF.BackColor = Color.Black;
PUSICANControl.StopMove(GetSelectNode());
}
}
private void btnjog_MouseDown(object sender, MouseEventArgs e)
{
if (btnjog.BackColor.Equals(Color.Black))
{
uint nodeid = GetSelectNode();
int speed = Math.Abs(Convert.ToInt32(nudMaxSpeed.Text)) /5* 1;
if (speed == 0)
{
return;
}
btnjog.BackColor = Color.Green;
PUSICANControl.VolMove(nodeid, speed);
}
}
private void btnjog_MouseUp(object sender, MouseEventArgs e)
{
if (btnjog.BackColor == Color.Green)
{
btnjog.BackColor = Color.Black;
PUSICANControl.StopMove(GetSelectNode());
}
}
} }
} }
...@@ -1040,3 +1040,5 @@ FrmPusicanTest_lblP1_Text 待机点: Standby Point: 待机点: ...@@ -1040,3 +1040,5 @@ FrmPusicanTest_lblP1_Text 待机点: Standby Point: 待机点:
FrmPusicanTest_linkP1_Text 设置为待机点 Set as Standby Point 设置为待机点 FrmPusicanTest_linkP1_Text 设置为待机点 Set as Standby Point 设置为待机点
FrmPusicanTest_linkPosSave_Text 保存 Save 保存 FrmPusicanTest_linkPosSave_Text 保存 Save 保存
FrmPusicanTest_lblPosL_Text 库位列表: Location List: 库位列表: FrmPusicanTest_lblPosL_Text 库位列表: Location List: 库位列表:
FrmPusicanTest_btnjog_Text 点动+ JOG+ 点动+
FrmPusicanTest_btnjogF_Text 点动- JOG- 点动-
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!