Commit 4e0a0248 LN

1

1 个父辈 1d5d2575
......@@ -46,7 +46,7 @@
this.label8 = new System.Windows.Forms.Label();
this.btnOpenAxis = new System.Windows.Forms.Button();
this.btnCloseAxis = new System.Windows.Forms.Button();
this.lblCountPulse = new System.Windows.Forms.TextBox();
this.txtP = new System.Windows.Forms.TextBox();
this.txtASpeed = new System.Windows.Forms.TextBox();
this.label47 = new System.Windows.Forms.Label();
this.btnAxisVMove = new System.Windows.Forms.Button();
......@@ -65,6 +65,11 @@
this.label49 = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.axis_4_Alarm = new UserFromControl.IOStatusControl();
this.txt4Target = new System.Windows.Forms.TextBox();
this.lblTargetP4 = new System.Windows.Forms.TextBox();
this.lblActual4 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.axis_1_Alarm = new UserFromControl.IOStatusControl();
this.axis_3_Alarm = new UserFromControl.IOStatusControl();
this.axis_2_Alarm = new UserFromControl.IOStatusControl();
......@@ -73,12 +78,12 @@
this.txtInoutTarget = new System.Windows.Forms.TextBox();
this.txtUpdownTarget = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.lblCountPulse1 = new System.Windows.Forms.TextBox();
this.lblOutPulse1 = new System.Windows.Forms.TextBox();
this.lblCountPulse3 = new System.Windows.Forms.TextBox();
this.lblOutPulse3 = new System.Windows.Forms.TextBox();
this.lblCountPulse2 = new System.Windows.Forms.TextBox();
this.lblOutPulse2 = new System.Windows.Forms.TextBox();
this.lblTargetP1 = new System.Windows.Forms.TextBox();
this.lblActual1 = new System.Windows.Forms.TextBox();
this.lblTargetP3 = new System.Windows.Forms.TextBox();
this.lblActual3 = new System.Windows.Forms.TextBox();
this.lblTargetP2 = new System.Windows.Forms.TextBox();
this.lblActual2 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
......@@ -135,6 +140,7 @@
this.chbAuto = new System.Windows.Forms.CheckBox();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.tabControl1 = new System.Windows.Forms.TabControl();
......@@ -188,7 +194,6 @@
this.btnSetNum = new System.Windows.Forms.Button();
this.btnClearL = new System.Windows.Forms.Button();
this.btnLogDebug = new System.Windows.Forms.Button();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.groupAxis.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupInout.SuspendLayout();
......@@ -245,7 +250,7 @@
this.groupAxis.Controls.Add(this.label8);
this.groupAxis.Controls.Add(this.btnOpenAxis);
this.groupAxis.Controls.Add(this.btnCloseAxis);
this.groupAxis.Controls.Add(this.lblCountPulse);
this.groupAxis.Controls.Add(this.txtP);
this.groupAxis.Controls.Add(this.txtASpeed);
this.groupAxis.Controls.Add(this.label47);
this.groupAxis.Controls.Add(this.btnAxisVMove);
......@@ -462,13 +467,13 @@
this.btnCloseAxis.UseVisualStyleBackColor = false;
this.btnCloseAxis.Click += new System.EventHandler(this.btnCloseAxis_Click);
//
// lblCountPulse
// txtP
//
this.lblCountPulse.Location = new System.Drawing.Point(232, 164);
this.lblCountPulse.Name = "lblCountPulse";
this.lblCountPulse.ReadOnly = true;
this.lblCountPulse.Size = new System.Drawing.Size(87, 23);
this.lblCountPulse.TabIndex = 38;
this.txtP.Location = new System.Drawing.Point(232, 164);
this.txtP.Name = "txtP";
this.txtP.ReadOnly = true;
this.txtP.Size = new System.Drawing.Size(87, 23);
this.txtP.TabIndex = 38;
//
// txtASpeed
//
......@@ -707,6 +712,11 @@
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.axis_4_Alarm);
this.groupBox1.Controls.Add(this.txt4Target);
this.groupBox1.Controls.Add(this.lblTargetP4);
this.groupBox1.Controls.Add(this.lblActual4);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.axis_1_Alarm);
this.groupBox1.Controls.Add(this.axis_3_Alarm);
this.groupBox1.Controls.Add(this.axis_2_Alarm);
......@@ -715,12 +725,12 @@
this.groupBox1.Controls.Add(this.txtInoutTarget);
this.groupBox1.Controls.Add(this.txtUpdownTarget);
this.groupBox1.Controls.Add(this.label12);
this.groupBox1.Controls.Add(this.lblCountPulse1);
this.groupBox1.Controls.Add(this.lblOutPulse1);
this.groupBox1.Controls.Add(this.lblCountPulse3);
this.groupBox1.Controls.Add(this.lblOutPulse3);
this.groupBox1.Controls.Add(this.lblCountPulse2);
this.groupBox1.Controls.Add(this.lblOutPulse2);
this.groupBox1.Controls.Add(this.lblTargetP1);
this.groupBox1.Controls.Add(this.lblActual1);
this.groupBox1.Controls.Add(this.lblTargetP3);
this.groupBox1.Controls.Add(this.lblActual3);
this.groupBox1.Controls.Add(this.lblTargetP2);
this.groupBox1.Controls.Add(this.lblActual2);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label1);
......@@ -734,6 +744,50 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "伺服状态";
//
// axis_4_Alarm
//
this.axis_4_Alarm.IOName = "";
this.axis_4_Alarm.IOValue = 0;
this.axis_4_Alarm.isCanClick = false;
this.axis_4_Alarm.Location = new System.Drawing.Point(432, 39);
this.axis_4_Alarm.Name = "axis_4_Alarm";
this.axis_4_Alarm.Size = new System.Drawing.Size(43, 39);
this.axis_4_Alarm.TabIndex = 271;
//
// txt4Target
//
this.txt4Target.Location = new System.Drawing.Point(409, 143);
this.txt4Target.Name = "txt4Target";
this.txt4Target.ReadOnly = true;
this.txt4Target.Size = new System.Drawing.Size(87, 23);
this.txt4Target.TabIndex = 270;
//
// lblTargetP4
//
this.lblTargetP4.Location = new System.Drawing.Point(409, 115);
this.lblTargetP4.Name = "lblTargetP4";
this.lblTargetP4.ReadOnly = true;
this.lblTargetP4.Size = new System.Drawing.Size(87, 23);
this.lblTargetP4.TabIndex = 269;
//
// lblActual4
//
this.lblActual4.Location = new System.Drawing.Point(409, 87);
this.lblActual4.Name = "lblActual4";
this.lblActual4.ReadOnly = true;
this.lblActual4.Size = new System.Drawing.Size(87, 23);
this.lblActual4.TabIndex = 268;
//
// label7
//
this.label7.AutoSize = true;
this.label7.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label7.Location = new System.Drawing.Point(406, 14);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(71, 17);
this.label7.TabIndex = 267;
this.label7.Text = "轴四:压紧轴";
//
// axis_1_Alarm
//
this.axis_1_Alarm.IOName = "";
......@@ -808,53 +862,53 @@
this.label12.TabIndex = 258;
this.label12.Text = "出入库目标值:";
//
// lblCountPulse1
// lblTargetP1
//
this.lblCountPulse1.Location = new System.Drawing.Point(105, 116);
this.lblCountPulse1.Name = "lblCountPulse1";
this.lblCountPulse1.ReadOnly = true;
this.lblCountPulse1.Size = new System.Drawing.Size(87, 23);
this.lblCountPulse1.TabIndex = 257;
this.lblTargetP1.Location = new System.Drawing.Point(105, 116);
this.lblTargetP1.Name = "lblTargetP1";
this.lblTargetP1.ReadOnly = true;
this.lblTargetP1.Size = new System.Drawing.Size(87, 23);
this.lblTargetP1.TabIndex = 257;
//
// lblOutPulse1
// lblActual1
//
this.lblOutPulse1.Location = new System.Drawing.Point(105, 88);
this.lblOutPulse1.Name = "lblOutPulse1";
this.lblOutPulse1.ReadOnly = true;
this.lblOutPulse1.Size = new System.Drawing.Size(87, 23);
this.lblOutPulse1.TabIndex = 256;
this.lblActual1.Location = new System.Drawing.Point(105, 88);
this.lblActual1.Name = "lblActual1";
this.lblActual1.ReadOnly = true;
this.lblActual1.Size = new System.Drawing.Size(87, 23);
this.lblActual1.TabIndex = 256;
//
// lblCountPulse3
// lblTargetP3
//
this.lblCountPulse3.Location = new System.Drawing.Point(306, 116);
this.lblCountPulse3.Name = "lblCountPulse3";
this.lblCountPulse3.ReadOnly = true;
this.lblCountPulse3.Size = new System.Drawing.Size(87, 23);
this.lblCountPulse3.TabIndex = 178;
this.lblTargetP3.Location = new System.Drawing.Point(306, 116);
this.lblTargetP3.Name = "lblTargetP3";
this.lblTargetP3.ReadOnly = true;
this.lblTargetP3.Size = new System.Drawing.Size(87, 23);
this.lblTargetP3.TabIndex = 178;
//
// lblOutPulse3
// lblActual3
//
this.lblOutPulse3.Location = new System.Drawing.Point(306, 88);
this.lblOutPulse3.Name = "lblOutPulse3";
this.lblOutPulse3.ReadOnly = true;
this.lblOutPulse3.Size = new System.Drawing.Size(87, 23);
this.lblOutPulse3.TabIndex = 177;
this.lblActual3.Location = new System.Drawing.Point(306, 88);
this.lblActual3.Name = "lblActual3";
this.lblActual3.ReadOnly = true;
this.lblActual3.Size = new System.Drawing.Size(87, 23);
this.lblActual3.TabIndex = 177;
//
// lblCountPulse2
// lblTargetP2
//
this.lblCountPulse2.Location = new System.Drawing.Point(207, 116);
this.lblCountPulse2.Name = "lblCountPulse2";
this.lblCountPulse2.ReadOnly = true;
this.lblCountPulse2.Size = new System.Drawing.Size(87, 23);
this.lblCountPulse2.TabIndex = 176;
this.lblTargetP2.Location = new System.Drawing.Point(207, 116);
this.lblTargetP2.Name = "lblTargetP2";
this.lblTargetP2.ReadOnly = true;
this.lblTargetP2.Size = new System.Drawing.Size(87, 23);
this.lblTargetP2.TabIndex = 176;
//
// lblOutPulse2
// lblActual2
//
this.lblOutPulse2.Location = new System.Drawing.Point(206, 88);
this.lblOutPulse2.Name = "lblOutPulse2";
this.lblOutPulse2.ReadOnly = true;
this.lblOutPulse2.Size = new System.Drawing.Size(87, 23);
this.lblOutPulse2.TabIndex = 175;
this.lblActual2.Location = new System.Drawing.Point(206, 88);
this.lblActual2.Name = "lblActual2";
this.lblActual2.ReadOnly = true;
this.lblActual2.Size = new System.Drawing.Size(87, 23);
this.lblActual2.TabIndex = 175;
//
// label4
//
......@@ -1701,6 +1755,11 @@
this.显示ToolStripMenuItem.Text = "显示";
this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(107, 6);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -2322,11 +2381,6 @@
this.btnLogDebug.UseVisualStyleBackColor = true;
this.btnLogDebug.Click += new System.EventHandler(this.开启DEBUGToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(107, 6);
//
// FrmStoreBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
......@@ -2387,7 +2441,7 @@
private System.Windows.Forms.ComboBox cmbPosition;
private System.Windows.Forms.Label label43;
private System.Windows.Forms.Label label42;
private System.Windows.Forms.TextBox lblCountPulse;
private System.Windows.Forms.TextBox txtP;
private System.Windows.Forms.Button btnComAlarmClear;
private System.Windows.Forms.GroupBox groupAxis;
public System.Windows.Forms.Button btnComP1;
......@@ -2441,12 +2495,12 @@
private System.Windows.Forms.Button btnSavePosition;
public System.Windows.Forms.Button btnCloseAxis;
public System.Windows.Forms.Button btnOpenAxis;
private System.Windows.Forms.TextBox lblCountPulse3;
private System.Windows.Forms.TextBox lblOutPulse3;
private System.Windows.Forms.TextBox lblCountPulse2;
private System.Windows.Forms.TextBox lblOutPulse2;
private System.Windows.Forms.TextBox lblCountPulse1;
private System.Windows.Forms.TextBox lblOutPulse1;
private System.Windows.Forms.TextBox lblTargetP3;
private System.Windows.Forms.TextBox lblActual3;
private System.Windows.Forms.TextBox lblTargetP2;
private System.Windows.Forms.TextBox lblActual2;
private System.Windows.Forms.TextBox lblTargetP1;
private System.Windows.Forms.TextBox lblActual1;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtJiange;
private System.Windows.Forms.Label label9;
......@@ -2540,6 +2594,11 @@
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtServoStatue;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private UserFromControl.IOStatusControl axis_4_Alarm;
private System.Windows.Forms.TextBox txt4Target;
private System.Windows.Forms.TextBox lblTargetP4;
private System.Windows.Forms.TextBox lblActual4;
private System.Windows.Forms.Label label7;
}
}
......@@ -17,6 +17,7 @@ using OnlineStore.DeviceLibrary;
using System.IO.Ports;
using OnlineStore.LoadCSVLibrary;
using CodeLibrary;
using UserFromControl;
namespace OnlineStore.ACSingleStore
{
......@@ -193,9 +194,9 @@ namespace OnlineStore.ACSingleStore
// {
// lblServerOn.Text = "伺服ON";
// int lOutPulse = ACServerManager.GetTargetPosition(portName, SlvAddr);
// lblOutPulse.Text = string.Format("{0:d}", lOutPulse);
// lblActual.Text = string.Format("{0:d}", lOutPulse);
// int lCountPulse = ACServerManager.GetActualtPosition(portName, SlvAddr);
// lblCountPulse.Text = string.Format("{0:d}", lCountPulse);
// lblTargetP.Text = string.Format("{0:d}", lCountPulse);
// }
// else
// {
......@@ -326,50 +327,30 @@ namespace OnlineStore.ACSingleStore
{
txtServoStatue.Text = "✘";
}
string deviceName = GetPortName();
if (ACServerManager.ServerOnStatus(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue()))
{
axis_1_Alarm.IOValue = ACServerManager.GetAlarmStatus(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue());
axis_1_Alarm.ShowData();
int lOutPulse1 = ACServerManager.GetTargetPosition(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue());
lblOutPulse1.Text = string.Format("{0:d}", lOutPulse1);
int lCountPulse1 = ACServerManager.GetActualtPosition(store.Config.Middle_Axis.DeviceName, store.Config.Middle_Axis.GetAxisValue());
lblCountPulse1.Text = string.Format("{0:d}", lCountPulse1);
txtMiddleTarget.Text = store.Config.Middle_Axis.TargetPosition.ToString();
if ( store.Config.Middle_Axis.IsSameAxis(portName,SlvAddr))
{
lblCountPulse.Text = lblCountPulse1.Text;
}
ReadA(store.Config.Middle_Axis, lblActual1, lblTargetP1, txtMiddleTarget, axis_1_Alarm);
ReadA(store.Config.UpDown_Axis, lblActual2, lblTargetP2, txtUpdownTarget, axis_2_Alarm);
ReadA(store.Config.InOut_Axis, lblActual3, lblTargetP3, txtInoutTarget, axis_3_Alarm);
ReadA(store.Config.Comp_Axis, lblActual4, lblTargetP4, txt4Target, axis_4_Alarm);
}
if (ACServerManager.ServerOnStatus(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue()))
{
axis_2_Alarm.IOValue = ACServerManager.GetAlarmStatus(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue());
axis_2_Alarm.ShowData();
int lOutPulse2 = ACServerManager.GetTargetPosition(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue());
lblOutPulse2.Text = string.Format("{0:d}", lOutPulse2);
int lCountPulse2 = ACServerManager.GetActualtPosition(store.Config.UpDown_Axis.DeviceName, store.Config.UpDown_Axis.GetAxisValue());
lblCountPulse2.Text = string.Format("{0:d}", lCountPulse2);
txtInoutTarget.Text = store.Config.InOut_Axis.TargetPosition.ToString();
if ( store.Config.UpDown_Axis.IsSameAxis(portName, SlvAddr))
private void ReadA(ConfigMoveAxis axis,TextBox lblActual, TextBox lblTarget,TextBox lblT, IOStatusControl sta)
{
lblCountPulse.Text = lblCountPulse2.Text;
}
}
if (ACServerManager.ServerOnStatus(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue()))
string portName = GetPortName();
int SlvAddr = GetSlaveAddr();
if (ACServerManager.ServerOnStatus(axis.DeviceName, axis.GetAxisValue()))
{
axis_3_Alarm.IOValue = ACServerManager.GetAlarmStatus(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue());
int lOutPulse3 = ACServerManager.GetTargetPosition(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue());
lblOutPulse3.Text = string.Format("{0:d}", lOutPulse3);
int lCountPulse3 = ACServerManager.GetActualtPosition(store.Config.InOut_Axis.DeviceName, store.Config.InOut_Axis.GetAxisValue());
lblCountPulse3.Text = string.Format("{0:d}", lCountPulse3);
txtUpdownTarget.Text = store.Config.UpDown_Axis.TargetPosition.ToString();
if ( store.Config.InOut_Axis.IsSameAxis(portName, SlvAddr))
sta.IOValue = ACServerManager.GetAlarmStatus(axis.DeviceName, axis.GetAxisValue());
int tP = ACServerManager.GetTargetPosition(axis.DeviceName, axis.GetAxisValue());
lblTarget.Text = string.Format("{0:d}", tP);
int aP = ACServerManager.GetActualtPosition(axis.DeviceName, axis.GetAxisValue());
lblActual.Text = string.Format("{0:d}", aP);
lblT.Text = axis.TargetPosition.ToString();
if (axis.IsSameAxis(portName, SlvAddr))
{
lblCountPulse.Text = lblCountPulse3.Text;
txtP.Text = lblActual.Text;
}
}
}
private void Bt_ClearCounter_Click(object sender, EventArgs e)
{
string portName = txtAxisDeviceName.Text;
......@@ -495,22 +476,37 @@ namespace OnlineStore.ACSingleStore
{
if (this.cmbAxisList.SelectedIndex >= 0)
{
ConfigMoveAxis SlvAddr = store.moveAxisList[cmbAxisList.SelectedIndex];
txtAxisDeviceName.Text = SlvAddr.DeviceName;
txtAxisValue.Text = SlvAddr.GetAxisValue().ToString();
txtASpeed.Text = SlvAddr.TargetSpeed.ToString();
//if (SlvAddr.Equals(store.Config.InOut_Axis))
//{
// txtASpeed.Text = store.Config.InOutAxis_P1_Speed.ToString();
//}
//else if (SlvAddr.Equals(store.Config.Middle_Axis))
//{
// txtASpeed.Text = store.Config.MiddleAxis_P1_Speed.ToString();
//}
//else if (SlvAddr.Equals(store.Config.UpDown_Axis))
//{
// txtASpeed.Text = store.Config.UpDownAxis_P1_Speed.ToString();
//}
ConfigMoveAxis axis = store.moveAxisList[cmbAxisList.SelectedIndex];
txtAxisDeviceName.Text = axis.DeviceName;
txtAxisValue.Text = axis.GetAxisValue().ToString();
txtASpeed.Text = axis.TargetSpeed.ToString();
Color color = Color.Black;
if (store.Config.Middle_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Red;
}
else if (store.Config.UpDown_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Blue;
}
else if (store.Config.InOut_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Green;
}
else if (store.Config.Comp_Axis.IsSameAxis(axis.DeviceName, axis.GetAxisValue()))
{
color = Color.Purple;
}
btnOpenAxis.ForeColor = color;
btnCloseAxis.ForeColor = color;
btnAxisAMove.ForeColor = color;
btnAxisRMove.ForeColor = color;
btnAxisVMove.ForeColor = color;
btnAxisReturnHome.ForeColor = color;
btnAxisStop.ForeColor = color;
btnComAlarmClear.ForeColor = color;
btnReadPosition.ForeColor = color;
btnGetAlarm.ForeColor = color;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!