ChangeForm

This commit is contained in:
17860779768 2023-03-09 11:17:44 +08:00
parent 7949ec25c9
commit 332ec0688c
8 changed files with 1253 additions and 150 deletions

View File

@ -1710,7 +1710,7 @@ namespace BRS.Process.A020
else else
{ {
ProcessWriteInt(MelsecPLC, addD3, "int", "0");//D3置0 ProcessWriteInt(MelsecPLC, addD3, "int", "0");//D3置0
ShaftOperateOnce(MelsecPLC, addD1, 500);//D1置1延时500后置0
ProcessWriteInt(MelsecPLC, addD171, "int", "3000");//最大扭矩3000 ProcessWriteInt(MelsecPLC, addD171, "int", "3000");//最大扭矩3000
ProcessWriteInt(MelsecPLC, addD51, "int", "1");//手动拧紧螺丝D51置1 ProcessWriteInt(MelsecPLC, addD51, "int", "1");//手动拧紧螺丝D51置1
@ -1729,6 +1729,85 @@ namespace BRS.Process.A020
} }
});
Task.Run(() =>
{
ShaftOperateOnce(MelsecPLC, addD1, 500);//D1置1延时500后置0
});
IsSingleStepOperating = false;
}
public void ShaftLeftMouseDown(MachineState machineState)
{
if (machineState != MachineState.Ready)
{
LogAsync(DateTime.Now, LogLevel.Error, "机台不在就绪状态,无法启动");
return;
}
LogAsync(DateTime.Now, LogLevel.Information, "流程启动中,请稍候...");
var MelsecPLC = DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
string addD201 = "D201";//通讯故障检查地址
string addD19 = "D19";//急停状态检查地址
string addD1 = "D1";//上位机启动标志位
string addD7 = "D7";//手动自动改变
string addD51 = "D51";//手动拧紧螺丝标志位
string addD53 = "D53";//手动拧紧螺丝标志位
string addD171 = "D171";//最大扭矩设置
string addD351 = "D351";//高速计数器当前值200000一圈360°
string addD251 = "D251";//当前扭矩返回值
string addD3 = "D3";//上机位停止标志位
machineState = MachineState.Running;
ProcessStatus = ProcessStatus.Init;
MachineStateStep = MachineStateStep.Ready;
Task.Run(() =>
{
while (machineState == MachineState.Running && MachineStateStep != MachineStateStep.Pause)
{
string ShaftCommunication = ProcessReadInt(MelsecPLC, addD201, "int");//通讯
if (ShaftCommunication == "111")//如果等于111流程启动
{
string ShaftEmergencyStop = ProcessReadInt(MelsecPLC, addD19, "int");//急停
if (ShaftEmergencyStop != "0")//判断是否急停0不急停1急停
{
LogAsync(DateTime.Now, LogLevel.Warning, "设备急停!");
Thread.Sleep(2000);
continue;
}
else
{
ProcessWriteInt(MelsecPLC, addD3, "int", "0");//D3置0
ProcessWriteInt(MelsecPLC, addD171, "int", "3000");//最大扭矩3000
ProcessWriteInt(MelsecPLC, addD53, "int", "1");//手动拧紧螺丝D51置1
machineState = MachineState.Waiting;//设备启动完成后保持状态,
LogAsync(DateTime.Now, LogLevel.Detail, "设备已启动,请勿其他操作!!");
}
ShaftCommunication = ProcessReadInt(MelsecPLC, addD201, "int");
continue;
}
else
{
LogAsync(DateTime.Now, LogLevel.Warning, "通讯故障!");
return;
}
}
});
Task.Run(() =>
{
ShaftOperateOnce(MelsecPLC, addD1, 500);//D1置1延时500后置0
}); });
IsSingleStepOperating = false; IsSingleStepOperating = false;
@ -1801,6 +1880,75 @@ namespace BRS.Process.A020
IsSingleStepOperating = false; IsSingleStepOperating = false;
}
public void ShaftLeftMouseUp(MachineState machineState)
{
if (machineState != MachineState.Ready)
{
LogAsync(DateTime.Now, LogLevel.Error, "机台不在就绪状态,无法启动");
return;
}
LogAsync(DateTime.Now, LogLevel.Information, "流程启动中,请稍候...");
var MelsecPLC = DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
string addD201 = "D201";//通讯故障检查地址
string addD19 = "D19";//急停状态检查地址
string addD1 = "D1";//上位机启动标志位
string addD7 = "D7";//手动自动改变
string addD51 = "D51";//手动拧紧螺丝标志位
string addD53 = "D53";
string addD171 = "D171";//最大扭矩设置
string addD351 = "D351";//高速计数器当前值200000一圈360°
string addD251 = "D251";//当前扭矩返回值
string addD3 = "D3";//上机位停止标志位
machineState = MachineState.Running;
ProcessStatus = ProcessStatus.Init;
MachineStateStep = MachineStateStep.Ready;
Task.Run(() =>
{
while (machineState == MachineState.Running && MachineStateStep != MachineStateStep.Pause)
{
string ShaftCommunication = ProcessReadInt(MelsecPLC, addD201, "int");//通讯
if (ShaftCommunication == "111")//如果等于111流程启动
{
string ShaftEmergencyStop = ProcessReadInt(MelsecPLC, addD19, "int");//急停
if (ShaftEmergencyStop != "0")//判断是否急停0不急停1急停
{
LogAsync(DateTime.Now, LogLevel.Warning, "设备急停!");
Thread.Sleep(2000);
continue;
}
else
{
ProcessWriteInt(MelsecPLC, addD3, "int", "1");//D3置0
ProcessWriteInt(MelsecPLC, addD53, "int", "0");//手动拧紧螺丝D51置1
machineState = MachineState.Pause;//设备暂停
LogAsync(DateTime.Now, LogLevel.Detail, "设备已关闭");
}
ShaftCommunication = ProcessReadInt(MelsecPLC, addD201, "int");
continue;
}
else
{
LogAsync(DateTime.Now, LogLevel.Warning, "通讯故障!");
return;
}
}
});
IsSingleStepOperating = false;
} }
/// <summary> /// <summary>
/// 进入自动化控制进程,完成系列动作 /// 进入自动化控制进程,完成系列动作
@ -1888,7 +2036,7 @@ namespace BRS.Process.A020
{ {
//按下前先置0按下置1延迟500Ms模拟人工按下效果后置0 //按下前先置0按下置1延迟500Ms模拟人工按下效果后置0
ProcessWriteInt(PLC, Address, "int", "0"); ProcessWriteInt(PLC, Address, "int", "0");
Thread.Sleep(500); //Thread.Sleep(500);
ProcessWriteInt(PLC, Address, "int", "1"); ProcessWriteInt(PLC, Address, "int", "1");
Thread.Sleep(Duration); Thread.Sleep(Duration);
ProcessWriteInt(PLC, Address, "int", "0"); ProcessWriteInt(PLC, Address, "int", "0");

View File

@ -29,26 +29,55 @@ namespace BRS.Process.A020.UI
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
this.TorqueSettingBtn = new Sunny.UI.UIButton(); this.TorqueSettingBtn = new Sunny.UI.UIButton();
this.StartBtn = new Sunny.UI.UIButton(); this.StartBtn = new Sunny.UI.UIButton();
this.ToughBtn = new Sunny.UI.UIButton(); this.ToughBtn = new Sunny.UI.UIButton();
this.LoosenBtn = new Sunny.UI.UIButton(); this.LoosenBtn = new Sunny.UI.UIButton();
this.StopBtn = new Sunny.UI.UIButton(); this.StopBtn = new Sunny.UI.UIButton();
this.ManualOrAuto = new Sunny.UI.UIButton();
this.uiBarChart1 = new Sunny.UI.UIBarChart();
this.uiBarChart2 = new Sunny.UI.UIBarChart();
this.MoveStateLabel = new Sunny.UI.UILabel(); this.MoveStateLabel = new Sunny.UI.UILabel();
this.StopStateLabel = new Sunny.UI.UILabel(); this.StopStateLabel = new Sunny.UI.UILabel();
this.EmengencyStopBtn = new BRS.Process.A020.UI.CircleButton(); this.chart2 = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.StopStateLight = new BRS.Process.A020.UI.CircleButton(); this.uiPanel1 = new Sunny.UI.UIPanel();
this.MoveStateLight = new BRS.Process.A020.UI.CircleButton(); this.AutoLoosenBtn = new Sunny.UI.UIButton();
this.AutoToughBtn = new Sunny.UI.UIButton();
this.uiLabel2 = new Sunny.UI.UILabel();
this.uiLabel1 = new Sunny.UI.UILabel();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.uiButton1 = new Sunny.UI.UIButton();
this.StartBtn1 = new Sunny.UI.UIButton();
this.StopBtn2 = new Sunny.UI.UIButton();
this.ManualToughBtn = new Sunny.UI.UIButton();
this.ManualLoosenBtn = new Sunny.UI.UIButton();
this.AutoToughBtn1 = new Sunny.UI.UIButton();
this.AutoLoosenBtn1 = new Sunny.UI.UIButton();
this.Setting = new Sunny.UI.UIButton();
this.TestBtn = new Sunny.UI.UIButton();
this.ManualBtn1 = new BRS.Process.A020.UI.CircleButton();
this.AutoBtn1 = new BRS.Process.A020.UI.CircleButton();
this.LoosenLight1 = new BRS.Process.A020.UI.CircleButton();
this.ToughLight1 = new BRS.Process.A020.UI.CircleButton();
this.StopStateLight1 = new BRS.Process.A020.UI.CircleButton();
this.MoveStateLight1 = new BRS.Process.A020.UI.CircleButton();
this.ESBtn = new BRS.Process.A020.UI.CircleButton();
((System.ComponentModel.ISupportInitialize)(this.chart2)).BeginInit();
this.uiPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// TorqueSettingBtn // TorqueSettingBtn
// //
this.TorqueSettingBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.TorqueSettingBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.TorqueSettingBtn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.TorqueSettingBtn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TorqueSettingBtn.Location = new System.Drawing.Point(169, 392); this.TorqueSettingBtn.Location = new System.Drawing.Point(164, 318);
this.TorqueSettingBtn.MinimumSize = new System.Drawing.Size(1, 1); this.TorqueSettingBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.TorqueSettingBtn.Name = "TorqueSettingBtn"; this.TorqueSettingBtn.Name = "TorqueSettingBtn";
this.TorqueSettingBtn.RightToLeft = System.Windows.Forms.RightToLeft.No; this.TorqueSettingBtn.RightToLeft = System.Windows.Forms.RightToLeft.No;
@ -60,9 +89,10 @@ namespace BRS.Process.A020.UI
// //
// StartBtn // StartBtn
// //
this.StartBtn.BackColor = System.Drawing.SystemColors.Control;
this.StartBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.StartBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.StartBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.StartBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StartBtn.Location = new System.Drawing.Point(180, 215); this.StartBtn.Location = new System.Drawing.Point(173, 174);
this.StartBtn.MinimumSize = new System.Drawing.Size(1, 1); this.StartBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.StartBtn.Name = "StartBtn"; this.StartBtn.Name = "StartBtn";
this.StartBtn.Size = new System.Drawing.Size(100, 35); this.StartBtn.Size = new System.Drawing.Size(100, 35);
@ -71,14 +101,12 @@ namespace BRS.Process.A020.UI
this.StartBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.StartBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StartBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.StartBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.StartBtn.Click += new System.EventHandler(this.StartBtn_Click); this.StartBtn.Click += new System.EventHandler(this.StartBtn_Click);
this.StartBtn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.StartBtn_MouseDown);
this.StartBtn.MouseUp += new System.Windows.Forms.MouseEventHandler(this.StartBtn_MouseUp);
// //
// ToughBtn // ToughBtn
// //
this.ToughBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.ToughBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.ToughBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.ToughBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ToughBtn.Location = new System.Drawing.Point(367, 215); this.ToughBtn.Location = new System.Drawing.Point(360, 174);
this.ToughBtn.MinimumSize = new System.Drawing.Size(1, 1); this.ToughBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.ToughBtn.Name = "ToughBtn"; this.ToughBtn.Name = "ToughBtn";
this.ToughBtn.Size = new System.Drawing.Size(100, 35); this.ToughBtn.Size = new System.Drawing.Size(100, 35);
@ -86,12 +114,14 @@ namespace BRS.Process.A020.UI
this.ToughBtn.Text = "手动拧紧"; this.ToughBtn.Text = "手动拧紧";
this.ToughBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.ToughBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ToughBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.ToughBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ToughBtn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ToughBtn_MouseDown);
this.ToughBtn.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ToughBtn_MouseUp);
// //
// LoosenBtn // LoosenBtn
// //
this.LoosenBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.LoosenBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.LoosenBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.LoosenBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LoosenBtn.Location = new System.Drawing.Point(367, 293); this.LoosenBtn.Location = new System.Drawing.Point(360, 242);
this.LoosenBtn.MinimumSize = new System.Drawing.Size(1, 1); this.LoosenBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.LoosenBtn.Name = "LoosenBtn"; this.LoosenBtn.Name = "LoosenBtn";
this.LoosenBtn.Size = new System.Drawing.Size(100, 35); this.LoosenBtn.Size = new System.Drawing.Size(100, 35);
@ -99,12 +129,14 @@ namespace BRS.Process.A020.UI
this.LoosenBtn.Text = "手动拧松"; this.LoosenBtn.Text = "手动拧松";
this.LoosenBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.LoosenBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LoosenBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.LoosenBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.LoosenBtn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.LoosenBtn_MouseDown);
this.LoosenBtn.MouseUp += new System.Windows.Forms.MouseEventHandler(this.LoosenBtn_MouseUp);
// //
// StopBtn // StopBtn
// //
this.StopBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.StopBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.StopBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.StopBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StopBtn.Location = new System.Drawing.Point(180, 293); this.StopBtn.Location = new System.Drawing.Point(173, 242);
this.StopBtn.MinimumSize = new System.Drawing.Size(1, 1); this.StopBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.StopBtn.Name = "StopBtn"; this.StopBtn.Name = "StopBtn";
this.StopBtn.Size = new System.Drawing.Size(100, 35); this.StopBtn.Size = new System.Drawing.Size(100, 35);
@ -114,51 +146,10 @@ namespace BRS.Process.A020.UI
this.StopBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.StopBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.StopBtn.Click += new System.EventHandler(this.StopBtn_Click); this.StopBtn.Click += new System.EventHandler(this.StopBtn_Click);
// //
// ManualOrAuto
//
this.ManualOrAuto.Cursor = System.Windows.Forms.Cursors.Hand;
this.ManualOrAuto.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ManualOrAuto.Location = new System.Drawing.Point(367, 400);
this.ManualOrAuto.MinimumSize = new System.Drawing.Size(1, 1);
this.ManualOrAuto.Name = "ManualOrAuto";
this.ManualOrAuto.Size = new System.Drawing.Size(100, 35);
this.ManualOrAuto.TabIndex = 7;
this.ManualOrAuto.Text = "手动/自动";
this.ManualOrAuto.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ManualOrAuto.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// uiBarChart1
//
this.uiBarChart1.Dock = System.Windows.Forms.DockStyle.Right;
this.uiBarChart1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiBarChart1.LegendFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiBarChart1.Location = new System.Drawing.Point(870, 0);
this.uiBarChart1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiBarChart1.Name = "uiBarChart1";
this.uiBarChart1.Size = new System.Drawing.Size(346, 568);
this.uiBarChart1.SubFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiBarChart1.TabIndex = 8;
this.uiBarChart1.Text = "uiBarChart1";
this.uiBarChart1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// uiBarChart2
//
this.uiBarChart2.Dock = System.Windows.Forms.DockStyle.Right;
this.uiBarChart2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiBarChart2.LegendFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiBarChart2.Location = new System.Drawing.Point(524, 0);
this.uiBarChart2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiBarChart2.Name = "uiBarChart2";
this.uiBarChart2.Size = new System.Drawing.Size(346, 568);
this.uiBarChart2.SubFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiBarChart2.TabIndex = 9;
this.uiBarChart2.Text = "uiBarChart2";
this.uiBarChart2.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// MoveStateLabel // MoveStateLabel
// //
this.MoveStateLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.MoveStateLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MoveStateLabel.Location = new System.Drawing.Point(165, 111); this.MoveStateLabel.Location = new System.Drawing.Point(27, 111);
this.MoveStateLabel.Name = "MoveStateLabel"; this.MoveStateLabel.Name = "MoveStateLabel";
this.MoveStateLabel.Size = new System.Drawing.Size(125, 23); this.MoveStateLabel.Size = new System.Drawing.Size(125, 23);
this.MoveStateLabel.TabIndex = 10; this.MoveStateLabel.TabIndex = 10;
@ -169,7 +160,7 @@ namespace BRS.Process.A020.UI
// StopStateLabel // StopStateLabel
// //
this.StopStateLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.StopStateLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StopStateLabel.Location = new System.Drawing.Point(354, 111); this.StopStateLabel.Location = new System.Drawing.Point(178, 111);
this.StopStateLabel.Name = "StopStateLabel"; this.StopStateLabel.Name = "StopStateLabel";
this.StopStateLabel.Size = new System.Drawing.Size(125, 23); this.StopStateLabel.Size = new System.Drawing.Size(125, 23);
this.StopStateLabel.TabIndex = 11; this.StopStateLabel.TabIndex = 11;
@ -177,53 +168,344 @@ namespace BRS.Process.A020.UI
this.StopStateLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.StopStateLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.StopStateLabel.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.StopStateLabel.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
// //
// EmengencyStopBtn // chart2
// //
this.EmengencyStopBtn.BackColor = System.Drawing.Color.Red; chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.True;
this.EmengencyStopBtn.Font = new System.Drawing.Font("宋体", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); chartArea1.AxisX.Title = "时间t";
this.EmengencyStopBtn.Location = new System.Drawing.Point(12, 203); chartArea1.AxisY.Title = "扭矩NW";
this.EmengencyStopBtn.Name = "EmengencyStopBtn"; chartArea1.BackColor = System.Drawing.Color.Transparent;
this.EmengencyStopBtn.Size = new System.Drawing.Size(124, 125); chartArea1.BackImageTransparentColor = System.Drawing.Color.White;
this.EmengencyStopBtn.TabIndex = 12; chartArea1.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
this.EmengencyStopBtn.Text = "急停"; chartArea1.BorderWidth = 2;
this.EmengencyStopBtn.UseVisualStyleBackColor = false; chartArea1.Name = "ChartArea1";
this.chart2.ChartAreas.Add(chartArea1);
this.chart2.Dock = System.Windows.Forms.DockStyle.Right;
legend1.Name = "Legend1";
legend1.Title = "图例";
this.chart2.Legends.Add(legend1);
this.chart2.Location = new System.Drawing.Point(1129, 0);
this.chart2.Name = "chart2";
series1.ChartArea = "ChartArea1";
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
series1.Legend = "Legend1";
series1.Name = "扭矩";
this.chart2.Series.Add(series1);
this.chart2.Size = new System.Drawing.Size(380, 568);
this.chart2.TabIndex = 14;
this.chart2.Text = "扭矩时间变化曲线";
title1.Name = "Title1";
title1.Text = "扭矩-时间变化曲线";
this.chart2.Titles.Add(title1);
// //
// StopStateLight // uiPanel1
// //
this.StopStateLight.Location = new System.Drawing.Point(379, 33); this.uiPanel1.Controls.Add(this.ManualBtn1);
this.StopStateLight.Name = "StopStateLight"; this.uiPanel1.Controls.Add(this.AutoBtn1);
this.StopStateLight.Size = new System.Drawing.Size(76, 75); this.uiPanel1.Controls.Add(this.LoosenLight1);
this.StopStateLight.TabIndex = 1; this.uiPanel1.Controls.Add(this.ToughLight1);
this.StopStateLight.UseVisualStyleBackColor = true; this.uiPanel1.Controls.Add(this.StopStateLight1);
this.uiPanel1.Controls.Add(this.TestBtn);
this.uiPanel1.Controls.Add(this.Setting);
this.uiPanel1.Controls.Add(this.AutoLoosenBtn1);
this.uiPanel1.Controls.Add(this.AutoToughBtn1);
this.uiPanel1.Controls.Add(this.ManualLoosenBtn);
this.uiPanel1.Controls.Add(this.ManualToughBtn);
this.uiPanel1.Controls.Add(this.StopBtn2);
this.uiPanel1.Controls.Add(this.StartBtn1);
this.uiPanel1.Controls.Add(this.MoveStateLight1);
this.uiPanel1.Controls.Add(this.ESBtn);
this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Left;
this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel1.Location = new System.Drawing.Point(0, 0);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.Size = new System.Drawing.Size(634, 568);
this.uiPanel1.TabIndex = 16;
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
// //
// MoveStateLight // AutoLoosenBtn
// //
this.MoveStateLight.Location = new System.Drawing.Point(193, 33); this.AutoLoosenBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.MoveStateLight.Name = "MoveStateLight"; this.AutoLoosenBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MoveStateLight.Size = new System.Drawing.Size(76, 75); this.AutoLoosenBtn.Location = new System.Drawing.Point(360, 442);
this.MoveStateLight.TabIndex = 0; this.AutoLoosenBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.MoveStateLight.UseVisualStyleBackColor = true; this.AutoLoosenBtn.Name = "AutoLoosenBtn";
this.AutoLoosenBtn.Size = new System.Drawing.Size(100, 35);
this.AutoLoosenBtn.TabIndex = 23;
this.AutoLoosenBtn.Text = "自动拧紧";
this.AutoLoosenBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.AutoLoosenBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.AutoLoosenBtn.Click += new System.EventHandler(this.AutoLoosenBtn_Click);
//
// AutoToughBtn
//
this.AutoToughBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.AutoToughBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.AutoToughBtn.Location = new System.Drawing.Point(360, 377);
this.AutoToughBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.AutoToughBtn.Name = "AutoToughBtn";
this.AutoToughBtn.Size = new System.Drawing.Size(100, 35);
this.AutoToughBtn.TabIndex = 22;
this.AutoToughBtn.Text = "自动拧紧";
this.AutoToughBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.AutoToughBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.AutoToughBtn.Click += new System.EventHandler(this.AutoToughBtn_Click);
//
// uiLabel2
//
this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel2.Location = new System.Drawing.Point(476, 111);
this.uiLabel2.Name = "uiLabel2";
this.uiLabel2.Size = new System.Drawing.Size(125, 23);
this.uiLabel2.TabIndex = 19;
this.uiLabel2.Text = "拧松状态指示灯";
this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.uiLabel2.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// uiLabel1
//
this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.Location = new System.Drawing.Point(330, 111);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(125, 23);
this.uiLabel1.TabIndex = 17;
this.uiLabel1.Text = "拧紧状态指示灯";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.uiLabel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// chart1
//
chartArea2.Name = "ChartArea1";
this.chart1.ChartAreas.Add(chartArea2);
this.chart1.Dock = System.Windows.Forms.DockStyle.Left;
legend2.Name = "Legend1";
this.chart1.Legends.Add(legend2);
this.chart1.Location = new System.Drawing.Point(634, 0);
this.chart1.Name = "chart1";
series2.ChartArea = "ChartArea1";
series2.Legend = "Legend1";
series2.Name = "Series1";
this.chart1.Series.Add(series2);
this.chart1.Size = new System.Drawing.Size(400, 568);
this.chart1.TabIndex = 17;
this.chart1.Text = "chart1";
//
// uiButton1
//
this.uiButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Location = new System.Drawing.Point(12, 442);
this.uiButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton1.Name = "uiButton1";
this.uiButton1.Size = new System.Drawing.Size(100, 35);
this.uiButton1.TabIndex = 15;
this.uiButton1.Text = "TestButton";
this.uiButton1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
//
// StartBtn1
//
this.StartBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.StartBtn1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StartBtn1.Location = new System.Drawing.Point(199, 156);
this.StartBtn1.MinimumSize = new System.Drawing.Size(1, 1);
this.StartBtn1.Name = "StartBtn1";
this.StartBtn1.Size = new System.Drawing.Size(100, 35);
this.StartBtn1.TabIndex = 7;
this.StartBtn1.Text = "开始";
this.StartBtn1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StartBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.StartBtn1.Click += new System.EventHandler(this.StartBtn1_Click);
//
// StopBtn2
//
this.StopBtn2.Cursor = System.Windows.Forms.Cursors.Hand;
this.StopBtn2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StopBtn2.Location = new System.Drawing.Point(199, 229);
this.StopBtn2.MinimumSize = new System.Drawing.Size(1, 1);
this.StopBtn2.Name = "StopBtn2";
this.StopBtn2.Size = new System.Drawing.Size(100, 35);
this.StopBtn2.TabIndex = 8;
this.StopBtn2.Text = "停止";
this.StopBtn2.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StopBtn2.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.StopBtn2.Click += new System.EventHandler(this.StopBtn2_Click);
//
// ManualToughBtn
//
this.ManualToughBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.ManualToughBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ManualToughBtn.Location = new System.Drawing.Point(420, 156);
this.ManualToughBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.ManualToughBtn.Name = "ManualToughBtn";
this.ManualToughBtn.Size = new System.Drawing.Size(100, 35);
this.ManualToughBtn.TabIndex = 9;
this.ManualToughBtn.Text = "手动拧紧";
this.ManualToughBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ManualToughBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ManualToughBtn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ManualToughBtn_MouseDown);
this.ManualToughBtn.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ManualToughBtn_MouseUp);
//
// ManualLoosenBtn
//
this.ManualLoosenBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.ManualLoosenBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ManualLoosenBtn.Location = new System.Drawing.Point(420, 229);
this.ManualLoosenBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.ManualLoosenBtn.Name = "ManualLoosenBtn";
this.ManualLoosenBtn.Size = new System.Drawing.Size(100, 35);
this.ManualLoosenBtn.TabIndex = 10;
this.ManualLoosenBtn.Text = "手动拧松";
this.ManualLoosenBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ManualLoosenBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.ManualLoosenBtn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ManualLoosenBtn_MouseDown);
this.ManualLoosenBtn.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ManualLoosenBtn_MouseUp);
//
// AutoToughBtn1
//
this.AutoToughBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.AutoToughBtn1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.AutoToughBtn1.Location = new System.Drawing.Point(420, 364);
this.AutoToughBtn1.MinimumSize = new System.Drawing.Size(1, 1);
this.AutoToughBtn1.Name = "AutoToughBtn1";
this.AutoToughBtn1.Size = new System.Drawing.Size(100, 35);
this.AutoToughBtn1.TabIndex = 11;
this.AutoToughBtn1.Text = "自动拧紧";
this.AutoToughBtn1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.AutoToughBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// AutoLoosenBtn1
//
this.AutoLoosenBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.AutoLoosenBtn1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.AutoLoosenBtn1.Location = new System.Drawing.Point(420, 421);
this.AutoLoosenBtn1.MinimumSize = new System.Drawing.Size(1, 1);
this.AutoLoosenBtn1.Name = "AutoLoosenBtn1";
this.AutoLoosenBtn1.Size = new System.Drawing.Size(100, 35);
this.AutoLoosenBtn1.TabIndex = 12;
this.AutoLoosenBtn1.Text = "自动拧松";
this.AutoLoosenBtn1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.AutoLoosenBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// Setting
//
this.Setting.Cursor = System.Windows.Forms.Cursors.Hand;
this.Setting.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Setting.Location = new System.Drawing.Point(199, 299);
this.Setting.MinimumSize = new System.Drawing.Size(1, 1);
this.Setting.Name = "Setting";
this.Setting.Size = new System.Drawing.Size(100, 35);
this.Setting.TabIndex = 13;
this.Setting.Text = "设置";
this.Setting.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Setting.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// TestBtn
//
this.TestBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.TestBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TestBtn.Location = new System.Drawing.Point(27, 457);
this.TestBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.TestBtn.Name = "TestBtn";
this.TestBtn.Size = new System.Drawing.Size(100, 35);
this.TestBtn.TabIndex = 14;
this.TestBtn.Text = "测试按钮";
this.TestBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TestBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// ManualBtn1
//
this.ManualBtn1.BackColor = System.Drawing.Color.Gray;
this.ManualBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.ManualBtn1.Location = new System.Drawing.Point(491, 284);
this.ManualBtn1.Name = "ManualBtn1";
this.ManualBtn1.Size = new System.Drawing.Size(58, 50);
this.ManualBtn1.TabIndex = 19;
this.ManualBtn1.Text = "手动按钮";
this.ManualBtn1.UseVisualStyleBackColor = false;
this.ManualBtn1.Click += new System.EventHandler(this.ManualBtn1_Click);
//
// AutoBtn1
//
this.AutoBtn1.BackColor = System.Drawing.Color.Gray;
this.AutoBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.AutoBtn1.Location = new System.Drawing.Point(398, 284);
this.AutoBtn1.Name = "AutoBtn1";
this.AutoBtn1.Size = new System.Drawing.Size(58, 50);
this.AutoBtn1.TabIndex = 18;
this.AutoBtn1.Text = "自动按钮";
this.AutoBtn1.UseVisualStyleBackColor = false;
this.AutoBtn1.Click += new System.EventHandler(this.AutoBtn1_Click);
//
// LoosenLight1
//
this.LoosenLight1.BackColor = System.Drawing.Color.Gray;
this.LoosenLight1.Location = new System.Drawing.Point(491, 39);
this.LoosenLight1.Name = "LoosenLight1";
this.LoosenLight1.Size = new System.Drawing.Size(75, 64);
this.LoosenLight1.TabIndex = 17;
this.LoosenLight1.UseVisualStyleBackColor = false;
//
// ToughLight1
//
this.ToughLight1.BackColor = System.Drawing.Color.Gray;
this.ToughLight1.Location = new System.Drawing.Point(341, 39);
this.ToughLight1.Name = "ToughLight1";
this.ToughLight1.Size = new System.Drawing.Size(75, 64);
this.ToughLight1.TabIndex = 16;
this.ToughLight1.UseVisualStyleBackColor = false;
//
// StopStateLight1
//
this.StopStateLight1.BackColor = System.Drawing.Color.Gray;
this.StopStateLight1.Location = new System.Drawing.Point(211, 39);
this.StopStateLight1.Name = "StopStateLight1";
this.StopStateLight1.Size = new System.Drawing.Size(75, 64);
this.StopStateLight1.TabIndex = 15;
this.StopStateLight1.UseVisualStyleBackColor = false;
//
// MoveStateLight1
//
this.MoveStateLight1.BackColor = System.Drawing.Color.Gray;
this.MoveStateLight1.Location = new System.Drawing.Point(67, 39);
this.MoveStateLight1.Name = "MoveStateLight1";
this.MoveStateLight1.Size = new System.Drawing.Size(75, 64);
this.MoveStateLight1.TabIndex = 3;
this.MoveStateLight1.UseVisualStyleBackColor = false;
//
// ESBtn
//
this.ESBtn.BackColor = System.Drawing.Color.Red;
this.ESBtn.Location = new System.Drawing.Point(46, 147);
this.ESBtn.Name = "ESBtn";
this.ESBtn.Size = new System.Drawing.Size(111, 102);
this.ESBtn.TabIndex = 0;
this.ESBtn.Text = "急停";
this.ESBtn.UseVisualStyleBackColor = false;
// //
// 扭矩轴控制 // 扭矩轴控制
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1216, 568); this.ClientSize = new System.Drawing.Size(1509, 568);
this.Controls.Add(this.EmengencyStopBtn); this.Controls.Add(this.chart1);
this.Controls.Add(this.StopStateLabel); this.Controls.Add(this.uiPanel1);
this.Controls.Add(this.MoveStateLabel); this.Controls.Add(this.chart2);
this.Controls.Add(this.uiBarChart2);
this.Controls.Add(this.uiBarChart1);
this.Controls.Add(this.ManualOrAuto);
this.Controls.Add(this.StopBtn);
this.Controls.Add(this.LoosenBtn);
this.Controls.Add(this.ToughBtn);
this.Controls.Add(this.StartBtn);
this.Controls.Add(this.TorqueSettingBtn);
this.Controls.Add(this.StopStateLight);
this.Controls.Add(this.MoveStateLight);
this.Name = "扭矩轴控制"; this.Name = "扭矩轴控制";
this.Text = "ContorlShaft"; this.Text = "ContorlShaft";
this.Load += new System.EventHandler(this._Load);
((System.ComponentModel.ISupportInitialize)(this.chart2)).EndInit();
this.uiPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -237,11 +519,36 @@ namespace BRS.Process.A020.UI
private Sunny.UI.UIButton ToughBtn; private Sunny.UI.UIButton ToughBtn;
private Sunny.UI.UIButton LoosenBtn; private Sunny.UI.UIButton LoosenBtn;
private Sunny.UI.UIButton StopBtn; private Sunny.UI.UIButton StopBtn;
private Sunny.UI.UIButton ManualOrAuto;
private Sunny.UI.UIBarChart uiBarChart1;
private Sunny.UI.UIBarChart uiBarChart2;
private Sunny.UI.UILabel MoveStateLabel; private Sunny.UI.UILabel MoveStateLabel;
private Sunny.UI.UILabel StopStateLabel; private Sunny.UI.UILabel StopStateLabel;
private CircleButton EmengencyStopBtn; private CircleButton EmengencyStopBtn;
private System.Windows.Forms.DataVisualization.Charting.Chart chart2;
private Sunny.UI.UIPanel uiPanel1;
private CircleButton LoosenLight;
private Sunny.UI.UILabel uiLabel2;
private CircleButton TougntLight;
private Sunny.UI.UILabel uiLabel1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.DataVisualization.Charting.Chart chart1;
private Sunny.UI.UIButton AutoToughBtn;
private Sunny.UI.UIButton AutoLoosenBtn;
private CircleButton manualBtn;
private CircleButton AutoBtn;
private Sunny.UI.UIButton uiButton1;
private CircleButton ManualBtn1;
private CircleButton AutoBtn1;
private CircleButton LoosenLight1;
private CircleButton ToughLight1;
private CircleButton StopStateLight1;
private Sunny.UI.UIButton TestBtn;
private Sunny.UI.UIButton Setting;
private Sunny.UI.UIButton AutoLoosenBtn1;
private Sunny.UI.UIButton AutoToughBtn1;
private Sunny.UI.UIButton ManualLoosenBtn;
private Sunny.UI.UIButton ManualToughBtn;
private Sunny.UI.UIButton StopBtn2;
private Sunny.UI.UIButton StartBtn1;
private CircleButton MoveStateLight1;
private CircleButton ESBtn;
} }
} }

View File

@ -1,38 +1,579 @@
using BRS.UI.Model.Winform; using BRS.Common.Base;
using BRS.Common.Interface;
using BRS.Common.PubSub;
using BRS.UI.Model.Winform;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using static BRS.Common.Model.Helper.EnumHelper; using static BRS.Common.Model.Helper.EnumHelper;
namespace BRS.Process.A020.UI namespace BRS.Process.A020.UI
{ {
[MenuNode("ControlShaft", "扭矩轴控制", 5, "View2", true)] [MenuNode("ControlShaft", "扭矩轴控制", 5, "View2", true)]
public partial class : MenuFormBase public partial class : MenuFormBase, IRunCtrl
{ {
private DateTime X_minValue;//横坐标最初值
private bool is_btn_manual { get; set; } = false; private bool is_btn_manual { get; set; } = false;
A020Process ProcessA020 => Process as A020Process; A020Process ProcessA020 => Process as A020Process;
A020Config Config => Process?.IConfig as A020Config; A020Config Config => Process?.IConfig as A020Config;
private bool isSingleStepOperating = false; private bool isSingleStepOperating = false;
public () public ()
{ {
InitializeComponent(); InitializeComponent();
}
public IDevice Device { get; set; }
protected PLCBase PLC
{
get => Device as PLCBase;
}
bool isStart = true;
public (IDevice device)
{
InitializeComponent();
Device = device;
}
private async void StartBtn_Click(object sender, EventArgs e)
{
}
private async void StopBtn_Click(object sender, EventArgs e)
{
}
private void uiButton1_Click(object sender, EventArgs e)
{
//启动一个后台线程
//Task.Run(() =>
//{
// Random random = new Random();
// for (; ; )
// {
// //生成一个四舍五入带2位小数点的随机金额
// double yValue = Math.Round(random.NextDouble() * 100, 2, MidpointRounding.AwayFromZero);
// this.UpdateChart(yValue);
// }
//});
if (uiButton1.Text == "uiButton1")
{
timer1.Start();
uiButton1.Text = "停止";
}
else if (uiButton1.Text == "停止")
{
timer1.Stop();
uiButton1.Text = "uiButton1";
}
}
#if false
/// <summary>
/// 每秒钟不停的更新图形最多允许10个节点
/// </summary>
/// <param name="totalMoney"></param>
private void UpdateChart(double totalMoney)
{
this.Invoke(new Action(() =>
{
Series serie = this.chart2.Series[0];
chart2.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss";
chart2.Series[0].XValueType = ChartValueType.DateTime;//坐标轴type改为时间
serie.Points.SuspendUpdates();
if (serie.Points.Count == 10)
{
serie.Points.RemoveAt(0);
this._pastMoney.RemoveAt(0);
this._maxAxisY = this._pastMoney.Max(q => q);
this._minAxisY = this._pastMoney.Min(q => q);
} }
private void StartBtn_Click(object sender, EventArgs e) //chart2.ChartAreas[0].AxisX.Minimum = DateTime.Now.AddSeconds(-5).ToOADate();
//chart2.ChartAreas[0].AxisX.Maximum = DateTime.Now.ToOADate();
if (this._maxAxisY < totalMoney)
{
this._maxAxisY = totalMoney;
}
if (this._minAxisY > totalMoney)
{
this._minAxisY = totalMoney;
}
//不断的更新图表的最大值和最小值范围,使得折线图总是显示最好看。
this.chart2.ChartAreas[0].AxisY.Maximum = _maxAxisY;
this.chart2.ChartAreas[0].AxisY.Minimum = _minAxisY;
//修改Y轴的值
//string now = DateTime.Now.ToLongTimeString();
////转换time的格式用于输出
//DateTime time = DateTime.Parse(now);
//在点集0(serials[0])中加入新的点XY
//TIP:如果你使用数组存放要绘制的点,每次绘图从上一次绘制结束的位置开始即可
//不需要每次画图都从第一个点开始绘制
//this.chart2.Series[0].Points.AddXY(time, totalMoney);
serie.Points.AddY(totalMoney);
serie.Points.ResumeUpdates();
this._pastMoney.Add(totalMoney);
}));
Thread.Sleep(1000);
}
#endif
private void ToughBtn_MouseDown(object sender, MouseEventArgs e)
{
}
private void _Load(object sender, EventArgs e)
{
InitChart();
}
#if false
private void Init_Chart()
{
#region chart2
chart2.Series[0].IsValueShownAsLabel = true;//让点集0在图像上显示数值
chart2.Series[0].SmartLabelStyle.Enabled = true;
chart2.Series[0].XValueType = ChartValueType.DateTime;//坐标轴type改为时间
//去掉滚动条的按钮
chart2.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.None;
chart2.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = false;
chart2.ChartAreas[0].AxisX.ScrollBar.Size = 10;
chart2.ChartAreas[0].AxisX.ScaleView.MinSizeType = DateTimeIntervalType.Seconds;
chart2.ChartAreas[0].AxisX.ScaleView.SizeType = DateTimeIntervalType.Seconds;
chart2.ChartAreas[0].AxisX.ScaleView.Size = 10;
chart2.ChartAreas[0].AxisX.ScaleView.MinSize = 15;
chart2.ChartAreas[0].AxisX.ScaleView.SmallScrollMinSize = 1;
chart2.ChartAreas[0].AxisX.ScaleView.SmallScrollMinSizeType = DateTimeIntervalType.Seconds;
chart2.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Seconds;
//这个interval可以用来修改显示间隔
chart2.ChartAreas[0].AxisX.Interval = DateTime.Parse("00:00:01").Second;
chart2.ChartAreas[0].AxisX.TitleAlignment = StringAlignment.Near;
chart2.ChartAreas[0].AxisX.MajorGrid.Enabled = true;
chart2.ChartAreas[0].AxisX.MajorGrid.LineWidth = 1;
chart2.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.LightGray;
//显示格式为时:分:秒
chart2.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss";
chart2.ChartAreas[0].AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount;
chart2.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.LightGray;
#endregion
}
#endif
private void timer1_Tick(object sender, EventArgs e)
{
var MelsecPlc = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
this.chart2.Series[0].Points.AddXY(DateTime.Now.ToOADate(), ProcessReadInt(MelsecPlc, "D251", "int"));
this.chart2.ChartAreas[0].AxisX.Maximum = DateTime.Now.AddSeconds(1).ToOADate();//X坐标后移1秒
this.chart2.ChartAreas[0].AxisX.Minimum = DateTime.Now.AddSeconds(-5).ToOADate();//此刻后十秒钟作为最初X轴
this.chart1.Series[0].Points.AddXY(DateTime.Now.ToOADate(), ProcessReadInt(MelsecPlc, "D351", "int"));
this.chart1.ChartAreas[0].AxisX.Maximum = DateTime.Now.AddSeconds(1).ToOADate();//X坐标后移1秒
this.chart1.ChartAreas[0].AxisX.Minimum = DateTime.Now.AddSeconds(-5).ToOADate();//此刻后十秒钟作为最初X轴
}
/// <summary>
///加载窗体时,初始化图表
/// </summary>
private void InitChart()
{
X_minValue = DateTime.Now;//X轴最小刻度
//定义图表区域
this.chart2.ChartAreas.Clear();
this.chart1.ChartAreas.Clear();
ChartArea chartarea1 = new ChartArea("C1");
ChartArea chartarea2 = new ChartArea("C2");
this.chart1.ChartAreas.Add(chartarea2);
this.chart2.ChartAreas.Add(chartarea1);
//定义存储和显示点的容器
this.chart2.Series.Clear();
this.chart1.Series.Clear();
Series series1 = new Series("扭矩");
Series series2 = new Series("角度");
series1.ChartArea = "C1";
series2.ChartArea = "C2";
this.chart2.Series.Add(series1);//添加线可按照相同方式进行添加
this.chart1.Series.Add(series2);
/*允许X轴放大*/
chartarea1.CursorX.IsUserEnabled = true;
chartarea1.CursorX.IsUserSelectionEnabled = true;
chartarea1.CursorX.Interval = 0;
chartarea1.CursorX.IntervalOffset = 0;
chartarea1.CursorX.IntervalType = DateTimeIntervalType.Minutes;
chartarea1.AxisX.ScaleView.Zoomable = true;
chartarea1.AxisX.ScrollBar.IsPositionedInside = false;
chartarea2.CursorX.IsUserEnabled = true;
chartarea2.CursorX.IsUserSelectionEnabled = true;
chartarea2.CursorX.Interval = 0;
chartarea2.CursorX.IntervalOffset = 0;
chartarea2.CursorX.IntervalType = DateTimeIntervalType.Minutes;
chartarea2.AxisX.ScaleView.Zoomable = true;
chartarea2.AxisX.ScrollBar.IsPositionedInside = false;
//设置图表样式
this.chart2.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss";//毫秒格式hh:mm:ss:fff
this.chart2.ChartAreas[0].AxisX.LabelStyle.IntervalType = DateTimeIntervalType.Seconds;
this.chart2.ChartAreas[0].AxisX.LabelStyle.Interval = 1;//坐标间隔为1
this.chart2.ChartAreas[0].AxisX.LabelStyle.IsEndLabelVisible = false;//防止X轴坐标跳跃
this.chart2.ChartAreas[0].AxisX.MajorGrid.IntervalType = DateTimeIntervalType.Seconds;
this.chart2.ChartAreas[0].AxisX.MajorGrid.Interval = 1;//网格间隔
this.chart2.ChartAreas[0].AxisX.Minimum = DateTime.Now.ToOADate();//当前日期
this.chart2.ChartAreas[0].AxisX.Maximum = DateTime.Now.ToOADate();
this.chart1.ChartAreas[0].AxisX.LabelStyle.Format = "HH:mm:ss";//毫秒格式hh:mm:ss:fff
this.chart1.ChartAreas[0].AxisX.LabelStyle.IntervalType = DateTimeIntervalType.Seconds;
this.chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1;//坐标间隔为1
this.chart1.ChartAreas[0].AxisX.LabelStyle.IsEndLabelVisible = false;//防止X轴坐标跳跃
this.chart1.ChartAreas[0].AxisX.MajorGrid.IntervalType = DateTimeIntervalType.Seconds;
this.chart1.ChartAreas[0].AxisX.MajorGrid.Interval = 1;//网格间隔
this.chart1.ChartAreas[0].AxisX.Minimum = DateTime.Now.ToOADate();//当前日期
this.chart1.ChartAreas[0].AxisX.Maximum = DateTime.Now.ToOADate();
//设置标题
this.chart2.Titles.Clear();
this.chart2.Titles.Add("S01");
this.chart2.Titles[0].Text = "扭矩-时间变化曲线";
this.chart2.Titles[0].ForeColor = Color.RoyalBlue;
this.chart2.Titles[0].Font = new Font("Microsoft Sans Serif", 12F);
this.chart1.Titles.Clear();
this.chart1.Titles.Add("S01");
this.chart1.Titles[0].Text = "角度-时间变化曲线";
this.chart1.Titles[0].ForeColor = Color.RoyalBlue;
this.chart1.Titles[0].Font = new Font("Microsoft Sans Serif", 12F);
//设置XY轴名称
this.chart2.ChartAreas[0].AxisX.Title = "时间t";
this.chart2.ChartAreas[0].AxisX.TitleAlignment = StringAlignment.Far;
this.chart2.ChartAreas[0].AxisY.Title = "扭矩N.m";
this.chart2.ChartAreas[0].AxisY.TitleAlignment = StringAlignment.Center;
this.chart1.ChartAreas[0].AxisX.Title = "时间t";
this.chart1.ChartAreas[0].AxisX.TitleAlignment = StringAlignment.Far;
this.chart1.ChartAreas[0].AxisY.Title = "角度(°)";
this.chart1.ChartAreas[0].AxisY.TitleAlignment = StringAlignment.Center;
//设置图表显示样式
this.chart2.Series[0].Color = Color.Red;
this.chart2.Series[0].ChartType = SeriesChartType.Line;
chart2.Series[0].IsValueShownAsLabel = true;//让点集0在图像上显示数值
this.chart2.BackColor = Color.LightBlue;
this.chart1.Series[0].Color = Color.Red;
this.chart1.Series[0].ChartType = SeriesChartType.Line;
chart1.Series[0].IsValueShownAsLabel = true;//让点集0在图像上显示数值
this.chart1.BackColor = Color.LightBlue;
}
//获取扭矩反馈值D251 高速计数器当前值D351
private void uiButton2_Click(object sender, EventArgs e)
{
//ShowdataLab.Text = ProcessReadInt(MelsecPlc, "D251", "int");
}
private void ToughBtn_MouseUp(object sender, MouseEventArgs e)
{
}
#if true
/// <summary>
/// 流程操作
/// </summary>
/// <param name="isStart">是否启动</param>
/// <returns></returns>
private void ProcessOperation(bool isStart)
{
if (isStart)
{
Process.Open();
//await Task.Run(() =>
//{
// Process.Open();
//});
StartBtn.Enabled = true;
StartBtn.BackColor = Color.FromArgb(0x7f, Color.LimeGreen);
}
else
{
//await Task.Run(() => Process.Close());
Process.Close();
StopBtn.BackColor = SystemColors.Control;
StopBtn.Enabled = true;
}
}
#endif
/// <summary>
/// 读取PLC地址
/// </summary>
/// <param name="PLC"></param>
/// <param name="address"></param>
/// <param name="type"></param>
/// <param name="length"></param>
/// <returns></returns>
private string ProcessReadInt(PLCBase PLC, string address, string type, ushort length = 10)
{
Stopwatch sw = new Stopwatch();
if (string.IsNullOrEmpty(address))
{
return "";
}
string resValue = "";
sw.Restart();
switch (type)
{
case "int":
resValue = PLC.ReadInt(address).ToString();
break;
case "string":
resValue = PLC.ReadString(address, length);
break;
case "float":
resValue = PLC.ReadFloat(address).ToString();
break;
default:
break;
}
sw.Stop();
return resValue;
}
/// <summary>
/// 写入PLC地址
/// </summary>
/// <param name="PLC"></param>
/// <param name="address"></param>
/// <param name="type"></param>
/// <param name="value"></param>
private void ProcessWriteInt(PLCBase PLC, string address, string type, string value)
{
Stopwatch sw = new Stopwatch();
if (string.IsNullOrEmpty(address))
{
// MessageBox.Show("PLC地址为空");
return;
}
if (string.IsNullOrEmpty(value))
{
// MessageBox.Show("写入值为空!");
return;
}
sw.Restart();
switch (type)
{
case "int":
PLC.WriteInt(address, int.Parse(value));
break;
case "string":
PLC.WriteString(address, value);
break;
case "float":
PLC.WriteFloat(address, float.Parse(value));
break;
default:
break;
}
sw.Stop();
// lblElapsed.Text = sw.ElapsedMilliseconds.ToString();
}
Stopwatch sw = new Stopwatch();
private void ProcessRead(PLCBase PLC, string address, string type, ushort length = 10)
{
if (string.IsNullOrEmpty(address))
{
return;
}
string resValue = "";
sw.Restart();
switch (type)
{
case "int":
resValue = PLC.ReadInt(address).ToString();
break;
case "string":
resValue = PLC.ReadString(address, length);
break;
case "float":
resValue = PLC.ReadFloat(address).ToString();
break;
default:
break;
}
sw.Stop();
//ShowdataLab.Text += $"【{address}】 {resValue}\r\n";
//ShowdataLab.Text = resValue;
}
private void LoosenBtn_MouseDown(object sender, MouseEventArgs e)
{ {
} }
private void StartBtn_MouseDown(object sender, MouseEventArgs e) private void LoosenBtn_MouseUp(object sender, MouseEventArgs e)
{ {
this.MoveStateLight.BackColor = Color.GreenYellow;
}
private void AutoBtn_Click(object sender, EventArgs e)
{
if (MoveStateLight.BackColor == Color.GreenYellow)
{
this.AutoBtn.BackColor = Color.GreenYellow;//在流程可用时,点击按钮变颜色
this.manualBtn.BackColor = Color.Gray;
}
else
LogAsync(DateTime.Now, LogLevel.Error, "流程未启动,无法选择");
}
private void manualBtn_Click(object sender, EventArgs e)
{
if (MoveStateLight.BackColor == Color.GreenYellow)
{
this.AutoBtn.BackColor = Color.Gray;//在流程可用时,点击按钮变颜色
this.manualBtn.BackColor = Color.GreenYellow;
}
else
LogAsync(DateTime.Now, LogLevel.Error, "流程未启动,无法选择");
}
private void AutoToughBtn_Click(object sender, EventArgs e)
{
}
private void AutoLoosenBtn_Click(object sender, EventArgs e)
{
}
private void StartBtn1_Click(object sender, EventArgs e)
{
if (Process == null)
{
MessageBox.Show("无法操作空流程");
return;
}
StartBtn1.Enabled = false;
try
{
ProcessOperation(true);//点击开始按钮后执行
//if (isStart)
//{
// await ProcessOperation(true);
// //ProcessOperation(true);
//}
}
catch (Exception ex)
{
//MessageBox.Show(ex.GetExceptionMessage());
}
finally
{
this.MoveStateLight1.BackColor = Color.GreenYellow;
this.StopStateLight1.BackColor = Color.Gray;
this.ToughLight1.BackColor = Color.Gray;
this.LoosenLight1.BackColor = Color.Gray;
//当流程启动时,自动手动按钮可用
this.AutoBtn1.Enabled = true;
this.ManualBtn1.Enabled = true;
//设置开始按钮状态
StartBtn1.Enabled = true;
}
}
private void StopBtn2_Click(object sender, EventArgs e)
{
if (Process == null)
{
MessageBox.Show("无法操作空流程");
return;
}
StopBtn2.Enabled = false;
try
{
ProcessOperation(false);
//if (isStart)
//{
// await ProcessOperation(false);
//}
}
catch (Exception ex)
{
//MessageBox.Show(ex.GetExceptionMessage());
}
finally
{
this.StopStateLight1.BackColor = Color.Red;
this.MoveStateLight1.BackColor = Color.Gray;
this.ToughLight1.BackColor = Color.Gray;
this.LoosenLight1.BackColor = Color.Gray;
//将自动手动按钮颜色恢复为灰色
this.AutoBtn1.BackColor = Color.Gray;
this.ManualBtn1.BackColor = Color.Gray;
//点击停止后初始化图表
InitChart();
StopBtn2.Enabled = true;
}
}
/// <summary>
/// 手动拧紧鼠标按下
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ManualToughBtn_MouseDown(object sender, MouseEventArgs e)
{
if (MoveStateLight1.BackColor == Color.GreenYellow && ManualBtn1.BackColor == Color.GreenYellow)
{
timer1.Start();//拧紧按钮按下时开始计时
this.ToughLight1.BackColor = Color.GreenYellow;
this.LoosenLight1.BackColor = Color.Gray;
if (!ProcessA020.IsSingleStepOperating) if (!ProcessA020.IsSingleStepOperating)
{ {
ProcessA020.IsSingleStepOperating = true; ProcessA020.IsSingleStepOperating = true;
@ -41,10 +582,46 @@ namespace BRS.Process.A020.UI
else else
LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。"); LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。");
} }
else
private void StartBtn_MouseUp(object sender, MouseEventArgs e)
{ {
this.MoveStateLight.BackColor = Color.Red; if (AutoBtn1.BackColor == Color.Gray && ManualBtn1.BackColor == Color.Gray)//未选择操作模式
{
LogAsync(DateTime.Now, LogLevel.Error, "当前系统未开启!");
return;
}
else if (AutoBtn1.BackColor == Color.GreenYellow)//选择自动模式
{
LogAsync(DateTime.Now, LogLevel.Error, "当前为自动模式,请勿手动操作");
return;
}
else
{
LogAsync(DateTime.Now, LogLevel.Error, "流程未启动,无法操作");
return;
}
}
}
/// <summary>
/// 手动拧紧鼠标抬起
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ManualToughBtn_MouseUp(object sender, MouseEventArgs e)
{
if (MoveStateLight1.BackColor == Color.Gray && ManualBtn1.BackColor == Color.Gray)
{
return;
}
else if(MoveStateLight1.BackColor == Color.GreenYellow&&ManualBtn1.BackColor==Color.Gray)
{
return;
}
else
{
timer1.Stop();//拧紧按钮松开时结束计时
this.ToughLight1.BackColor = Color.Red;
this.LoosenLight1.BackColor = Color.Gray;
if (!ProcessA020.IsSingleStepOperating) if (!ProcessA020.IsSingleStepOperating)
{ {
ProcessA020.IsSingleStepOperating = true; ProcessA020.IsSingleStepOperating = true;
@ -53,10 +630,88 @@ namespace BRS.Process.A020.UI
else else
LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。"); LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。");
} }
}
private void StopBtn_Click(object sender, EventArgs e) private void ManualLoosenBtn_MouseDown(object sender, MouseEventArgs e)
{ {
this.MoveStateLight.BackColor = Color.Gray; if (MoveStateLight1.BackColor == Color.GreenYellow && ManualBtn1.BackColor == Color.GreenYellow)
{
timer1.Start();//拧松按钮按下时开始计时
this.ToughLight1.BackColor = Color.Gray;
this.LoosenLight1.BackColor = Color.GreenYellow;
if (!ProcessA020.IsSingleStepOperating)
{
ProcessA020.IsSingleStepOperating = true;
ProcessA020.ShaftLeftMouseDown(MachineState.Ready);
}
else
LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。");
}
else
{
if (AutoBtn1.BackColor == Color.Gray && ManualBtn1.BackColor == Color.Gray)//未选择操作模式
{
LogAsync(DateTime.Now, LogLevel.Error, "当前系统未开启!");
return;
}
else if (AutoBtn1.BackColor == Color.GreenYellow)//选择自动模式
{
LogAsync(DateTime.Now, LogLevel.Error, "当前为自动模式,请勿手动操作");
return;
}
else
{
LogAsync(DateTime.Now, LogLevel.Error, "流程未启动,无法操作");
return;
}
}
}
private void ManualLoosenBtn_MouseUp(object sender, MouseEventArgs e)
{
if (MoveStateLight1.BackColor == Color.Gray && ManualBtn1.BackColor == Color.Gray)
{
return;
}
else if (MoveStateLight1.BackColor == Color.GreenYellow && ManualBtn1.BackColor == Color.Gray)
{
return;
}
else
{
timer1.Stop();//拧松按钮松开时结束计时
this.ToughLight1.BackColor = Color.Gray;
this.LoosenLight1.BackColor = Color.Red;
if (!ProcessA020.IsSingleStepOperating)
{
ProcessA020.IsSingleStepOperating = true;
ProcessA020.ShaftLeftMouseUp(MachineState.Ready);
}
else
LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。");
}
}
private void AutoBtn1_Click(object sender, EventArgs e)
{
if (MoveStateLight1.BackColor == Color.GreenYellow)
{
AutoBtn1.BackColor = Color.GreenYellow;
ManualBtn1.BackColor = Color.Gray;
}
else if (StopStateLight1.BackColor == Color.Red)
{
LogAsync(DateTime.Now, LogLevel.Error, "当前流程未启动,无法选择操作模式");
}
}
private void ManualBtn1_Click(object sender, EventArgs e)
{
if (MoveStateLight1.BackColor == Color.GreenYellow)
{
AutoBtn1.BackColor = Color.Gray;
ManualBtn1.BackColor = Color.GreenYellow;
}
} }
} }
} }

View File

@ -117,4 +117,10 @@
<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="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>45</value>
</metadata>
</root> </root>

View File

@ -341,24 +341,12 @@ namespace BRS.Process.A020.UI
private void btn_start_MouseDown(object sender, MouseEventArgs e) private void btn_start_MouseDown(object sender, MouseEventArgs e)
{ {
if (!ProcessA020.IsSingleStepOperating)
{
ProcessA020.IsSingleStepOperating = true;
ProcessA020.ShaftRightMouseDown(MachineState.Ready);
}
else
LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。");
} }
private void btn_start_MouseUp(object sender, MouseEventArgs e) private void btn_start_MouseUp(object sender, MouseEventArgs e)
{ {
if (!ProcessA020.IsSingleStepOperating)
{
ProcessA020.IsSingleStepOperating = true;
ProcessA020.ShaftRightMouseUp(MachineState.Ready);
}
else
LogAsync(DateTime.Now, LogLevel.Error, $"有未完成的操作。");
} }
} }
} }

View File

@ -314,7 +314,6 @@ namespace BRS.Process
//AddRunEventInBuffer(DateTime.Now, DataBase.Models.RunEvent_EventType.ProcessOp, false); //AddRunEventInBuffer(DateTime.Now, DataBase.Models.RunEvent_EventType.ProcessOp, false);
LogAsync(DateTime.Now, LogLevel.Action, "Process Closed"); LogAsync(DateTime.Now, LogLevel.Action, "Process Closed");
} }

View File

@ -38,15 +38,15 @@
this.tsslLoginStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.tsslLoginStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.stsStripLayout = new System.Windows.Forms.StatusStrip(); this.stsStripLayout = new System.Windows.Forms.StatusStrip();
this.tssBtnLayout = new System.Windows.Forms.ToolStripSplitButton(); this.tssBtnLayout = new System.Windows.Forms.ToolStripSplitButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.tsmiSaveLayout = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiSaveLayout = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiResetLayout = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiResetLayout = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiSaveLayoutAs = new System.Windows.Forms.ToolStripMenuItem();
this.stsStripWarning = new System.Windows.Forms.StatusStrip(); this.stsStripWarning = new System.Windows.Forms.StatusStrip();
this.tsslWarning = new System.Windows.Forms.ToolStripStatusLabel(); this.tsslWarning = new System.Windows.Forms.ToolStripStatusLabel();
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.ctmsExit = new System.Windows.Forms.ContextMenuStrip(this.components); this.ctmsExit = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiExitProgram = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiExitProgram = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiSaveLayoutAs = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ststripDevices.SuspendLayout(); this.ststripDevices.SuspendLayout();
this.stsStripLayout.SuspendLayout(); this.stsStripLayout.SuspendLayout();
this.stsStripWarning.SuspendLayout(); this.stsStripWarning.SuspendLayout();
@ -154,20 +154,32 @@
this.tssBtnLayout.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.tssBtnLayout.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
this.tssBtnLayout.Click += new System.EventHandler(this.tssBtnLayout_Click); this.tssBtnLayout.Click += new System.EventHandler(this.tssBtnLayout_Click);
// //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(133, 6);
//
// tsmiSaveLayout // tsmiSaveLayout
// //
this.tsmiSaveLayout.Name = "tsmiSaveLayout"; this.tsmiSaveLayout.Name = "tsmiSaveLayout";
this.tsmiSaveLayout.Size = new System.Drawing.Size(180, 22); this.tsmiSaveLayout.Size = new System.Drawing.Size(136, 22);
this.tsmiSaveLayout.Text = "保存布局"; this.tsmiSaveLayout.Text = "保存布局";
this.tsmiSaveLayout.Click += new System.EventHandler(this.tsmiSaveLayout_Click); this.tsmiSaveLayout.Click += new System.EventHandler(this.tsmiSaveLayout_Click);
// //
// tsmiResetLayout // tsmiResetLayout
// //
this.tsmiResetLayout.Name = "tsmiResetLayout"; this.tsmiResetLayout.Name = "tsmiResetLayout";
this.tsmiResetLayout.Size = new System.Drawing.Size(180, 22); this.tsmiResetLayout.Size = new System.Drawing.Size(136, 22);
this.tsmiResetLayout.Text = "重置布局"; this.tsmiResetLayout.Text = "重置布局";
this.tsmiResetLayout.Click += new System.EventHandler(this.tsmiResetLayout_Click); this.tsmiResetLayout.Click += new System.EventHandler(this.tsmiResetLayout_Click);
// //
// tsmiSaveLayoutAs
//
this.tsmiSaveLayoutAs.Name = "tsmiSaveLayoutAs";
this.tsmiSaveLayoutAs.Size = new System.Drawing.Size(136, 22);
this.tsmiSaveLayoutAs.Text = "布局另存为";
this.tsmiSaveLayoutAs.Click += new System.EventHandler(this.tsmiSaveLayoutAs_Click);
//
// stsStripWarning // stsStripWarning
// //
this.stsStripWarning.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.stsStripWarning.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -217,18 +229,6 @@
this.tsmiExitProgram.Text = "退出程序"; this.tsmiExitProgram.Text = "退出程序";
this.tsmiExitProgram.Click += new System.EventHandler(this.tsmiExitProgram_Click); this.tsmiExitProgram.Click += new System.EventHandler(this.tsmiExitProgram_Click);
// //
// tsmiSaveLayoutAs
//
this.tsmiSaveLayoutAs.Name = "tsmiSaveLayoutAs";
this.tsmiSaveLayoutAs.Size = new System.Drawing.Size(180, 22);
this.tsmiSaveLayoutAs.Text = "布局另存为";
this.tsmiSaveLayoutAs.Click += new System.EventHandler(this.tsmiSaveLayoutAs_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
//
// MainFrm // MainFrm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADm ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADm
CgAAAk1TRnQBSQFMAgEBAgEAAcgBAgHIAQIBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo CgAAAk1TRnQBSQFMAgEBAgEAAegBAgHoAQIBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABYAMAARgDAAEBAQABCAYAAQkYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AwABYAMAARgDAAEBAQABCAYAAQkYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -182,7 +182,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD4 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD4
CAAAAk1TRnQBSQFMAwEBAAHIAQIByAECARgBAAEYAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA CAAAAk1TRnQBSQFMAwEBAAHoAQIB6AECARgBAAEYAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AWADAAEYAwABAQEAAQgGAAEJGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA AWADAAEYAwABAQEAAQgGAAEJGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm