Commit 89d5e6a8 LN

压力传感器值显示到设置界面

1 个父辈 1b3123b8
......@@ -144,7 +144,7 @@ namespace DeviceLibrary
int errorCount = Math.Abs(outCount - wait.TargetPosition);
if (errorCount <= wait.AxisInfo.CanErrorCountMax)
{
LogUtil.info($"{wait.AxisInfo.Explain},到达目标:errorCount:{errorCount},停止上升");
LogUtil.info($"{wait.AxisInfo.Explain},到达目标: 差异:{errorCount},停止上升");
axisBean.StopAxisCheckMove();
wait.IsEnd = true;
}
......
......@@ -46,7 +46,7 @@ namespace DeviceLibrary
bool result = rGB_Controller.OpenPort(port, out msg);
if (result)
{
LogUtil.error("LED灯初始化成功");
LogUtil.info("LED灯初始化成功");
rgbLedInitOk = true;
ledRgbTimer = new System.Threading.Timer(new TimerCallback(RgbLedProcess), null, 0, 500);
GC.KeepAlive(ledRgbTimer);
......
......@@ -34,9 +34,16 @@ namespace TheMachineNView
this.button_positiontool = new System.Windows.Forms.Button();
this.lbl_hmdstate = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tp = new System.Windows.Forms.TableLayoutPanel();
this.tpold = new System.Windows.Forms.TableLayoutPanel();
this.cb_usefixpos = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.tp = new System.Windows.Forms.TableLayoutPanel();
this.lblYa = new System.Windows.Forms.Label();
this.lblMaxY = new System.Windows.Forms.Label();
this.lblMaxSet = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.uC_LedConfig1 = new TheMachineNView.UC_LedConfig();
this.uC_SetUserPassword1 = new TheMachineNView.UC_SetUserPassword();
this.tp.SuspendLayout();
......@@ -45,22 +52,22 @@ namespace TheMachineNView
// chbAutoRun
//
this.chbAutoRun.AutoSize = true;
this.tp.SetColumnSpan(this.chbAutoRun, 2);
this.chbAutoRun.Location = new System.Drawing.Point(10, 134);
this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10);
this.chbAutoRun.Dock = System.Windows.Forms.DockStyle.Fill;
this.chbAutoRun.Location = new System.Drawing.Point(234, 122);
this.chbAutoRun.Margin = new System.Windows.Forms.Padding(10, 1, 1, 1);
this.chbAutoRun.Name = "chbAutoRun";
this.chbAutoRun.Size = new System.Drawing.Size(84, 16);
this.chbAutoRun.Size = new System.Drawing.Size(211, 38);
this.chbAutoRun.TabIndex = 1;
this.chbAutoRun.Text = "开机自启动";
this.chbAutoRun.UseVisualStyleBackColor = true;
//
// button_positiontool
//
this.tp.SetColumnSpan(this.button_positiontool, 2);
this.button_positiontool.Location = new System.Drawing.Point(10, 42);
this.button_positiontool.Margin = new System.Windows.Forms.Padding(10);
this.button_positiontool.Dock = System.Windows.Forms.DockStyle.Fill;
this.button_positiontool.Location = new System.Drawing.Point(448, 122);
this.button_positiontool.Margin = new System.Windows.Forms.Padding(1);
this.button_positiontool.Name = "button_positiontool";
this.button_positiontool.Size = new System.Drawing.Size(181, 36);
this.button_positiontool.Size = new System.Drawing.Size(228, 38);
this.button_positiontool.TabIndex = 4;
this.button_positiontool.Text = "库位定位辅助工具";
this.button_positiontool.UseVisualStyleBackColor = true;
......@@ -68,55 +75,49 @@ namespace TheMachineNView
//
// lbl_hmdstate
//
this.lbl_hmdstate.AutoSize = true;
this.tp.SetColumnSpan(this.lbl_hmdstate, 2);
this.lbl_hmdstate.Location = new System.Drawing.Point(10, 10);
this.lbl_hmdstate.Margin = new System.Windows.Forms.Padding(10);
this.tp.SetColumnSpan(this.lbl_hmdstate, 3);
this.lbl_hmdstate.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbl_hmdstate.Location = new System.Drawing.Point(4, 2);
this.lbl_hmdstate.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.lbl_hmdstate.Name = "lbl_hmdstate";
this.lbl_hmdstate.Size = new System.Drawing.Size(53, 12);
this.lbl_hmdstate.Size = new System.Drawing.Size(670, 37);
this.lbl_hmdstate.TabIndex = 5;
this.lbl_hmdstate.Tag = "not";
this.lbl_hmdstate.Text = "当前状态";
this.lbl_hmdstate.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// tp
// tpold
//
this.tp.AutoSize = true;
this.tp.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tp.ColumnCount = 2;
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tp.Controls.Add(this.button_positiontool, 0, 5);
this.tp.Controls.Add(this.lbl_hmdstate, 0, 4);
this.tp.Controls.Add(this.cb_usefixpos, 0, 6);
this.tp.Controls.Add(this.chbAutoRun, 0, 7);
this.tp.Location = new System.Drawing.Point(8, 3);
this.tp.Name = "tp";
this.tp.RowCount = 9;
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tp.Size = new System.Drawing.Size(286, 160);
this.tp.TabIndex = 6;
this.tpold.AutoSize = true;
this.tpold.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tpold.ColumnCount = 2;
this.tpold.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tpold.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tpold.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tpold.Location = new System.Drawing.Point(8, 3);
this.tpold.Name = "tpold";
this.tpold.RowCount = 4;
this.tpold.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tpold.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tpold.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tpold.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tpold.Size = new System.Drawing.Size(0, 0);
this.tpold.TabIndex = 6;
//
// cb_usefixpos
//
this.cb_usefixpos.AutoSize = true;
this.tp.SetColumnSpan(this.cb_usefixpos, 2);
this.cb_usefixpos.Location = new System.Drawing.Point(10, 98);
this.cb_usefixpos.Margin = new System.Windows.Forms.Padding(10);
this.cb_usefixpos.Dock = System.Windows.Forms.DockStyle.Fill;
this.cb_usefixpos.Location = new System.Drawing.Point(11, 122);
this.cb_usefixpos.Margin = new System.Windows.Forms.Padding(10, 1, 1, 1);
this.cb_usefixpos.Name = "cb_usefixpos";
this.cb_usefixpos.Size = new System.Drawing.Size(96, 16);
this.cb_usefixpos.Size = new System.Drawing.Size(211, 38);
this.cb_usefixpos.TabIndex = 6;
this.cb_usefixpos.Text = "启用校准库位";
this.cb_usefixpos.UseVisualStyleBackColor = true;
......@@ -132,22 +133,115 @@ namespace TheMachineNView
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click_1);
//
// tp
//
this.tp.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tp.ColumnCount = 3;
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.tp.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 34F));
this.tp.Controls.Add(this.button_positiontool, 2, 3);
this.tp.Controls.Add(this.lbl_hmdstate, 0, 0);
this.tp.Controls.Add(this.chbAutoRun, 1, 3);
this.tp.Controls.Add(this.lblYa, 0, 2);
this.tp.Controls.Add(this.lblMaxY, 1, 2);
this.tp.Controls.Add(this.lblMaxSet, 2, 2);
this.tp.Controls.Add(this.label5, 2, 1);
this.tp.Controls.Add(this.label3, 1, 1);
this.tp.Controls.Add(this.label1, 0, 1);
this.tp.Controls.Add(this.cb_usefixpos, 0, 3);
this.tp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tp.Location = new System.Drawing.Point(8, 12);
this.tp.Name = "tp";
this.tp.RowCount = 4;
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tp.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tp.Size = new System.Drawing.Size(678, 162);
this.tp.TabIndex = 10;
//
// lblYa
//
this.lblYa.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblYa.Location = new System.Drawing.Point(4, 82);
this.lblYa.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.lblYa.Name = "lblYa";
this.lblYa.Size = new System.Drawing.Size(216, 37);
this.lblYa.TabIndex = 1;
this.lblYa.Text = "0";
this.lblYa.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblMaxY
//
this.lblMaxY.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblMaxY.Location = new System.Drawing.Point(227, 82);
this.lblMaxY.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.lblMaxY.Name = "lblMaxY";
this.lblMaxY.Size = new System.Drawing.Size(216, 37);
this.lblMaxY.TabIndex = 3;
this.lblMaxY.Text = "0";
this.lblMaxY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblMaxSet
//
this.lblMaxSet.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblMaxSet.Location = new System.Drawing.Point(450, 82);
this.lblMaxSet.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.lblMaxSet.Name = "lblMaxSet";
this.lblMaxSet.Size = new System.Drawing.Size(224, 37);
this.lblMaxSet.TabIndex = 5;
this.lblMaxSet.Text = "0";
this.lblMaxSet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label5
//
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Location = new System.Drawing.Point(450, 42);
this.label5.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(224, 37);
this.label5.TabIndex = 4;
this.label5.Text = "设置最大压力:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(227, 42);
this.label3.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(216, 37);
this.label3.TabIndex = 2;
this.label3.Text = "历史最大压力值:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(4, 42);
this.label1.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(216, 37);
this.label1.TabIndex = 0;
this.label1.Text = "压力传感器当前值:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uC_LedConfig1
//
this.uC_LedConfig1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.uC_LedConfig1.AutoScroll = true;
this.uC_LedConfig1.Config = null;
this.uC_LedConfig1.Location = new System.Drawing.Point(0, 203);
this.uC_LedConfig1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uC_LedConfig1.Location = new System.Drawing.Point(4, 203);
this.uC_LedConfig1.Name = "uC_LedConfig1";
this.uC_LedConfig1.Size = new System.Drawing.Size(679, 427);
this.uC_LedConfig1.Size = new System.Drawing.Size(693, 427);
this.uC_LedConfig1.TabIndex = 9;
this.uC_LedConfig1.Tag = "not";
//
// uC_SetUserPassword1
//
this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uC_SetUserPassword1.Location = new System.Drawing.Point(5, 654);
this.uC_SetUserPassword1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uC_SetUserPassword1.Location = new System.Drawing.Point(9, 640);
this.uC_SetUserPassword1.Margin = new System.Windows.Forms.Padding(5);
this.uC_SetUserPassword1.Name = "uC_SetUserPassword1";
this.uC_SetUserPassword1.Size = new System.Drawing.Size(393, 237);
......@@ -158,12 +252,13 @@ namespace TheMachineNView
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScroll = true;
this.Controls.Add(this.tp);
this.Controls.Add(this.uC_LedConfig1);
this.Controls.Add(this.uC_SetUserPassword1);
this.Controls.Add(this.button1);
this.Controls.Add(this.tp);
this.Controls.Add(this.tpold);
this.Name = "SettingControl";
this.Size = new System.Drawing.Size(682, 908);
this.Size = new System.Drawing.Size(700, 908);
this.Load += new System.EventHandler(this.SettingControl_Load);
this.tp.ResumeLayout(false);
this.tp.PerformLayout();
......@@ -177,10 +272,17 @@ namespace TheMachineNView
private System.Windows.Forms.Button button_positiontool;
private System.Windows.Forms.Label lbl_hmdstate;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TableLayoutPanel tp;
private System.Windows.Forms.TableLayoutPanel tpold;
private System.Windows.Forms.CheckBox cb_usefixpos;
private System.Windows.Forms.Button button1;
private UC_SetUserPassword uC_SetUserPassword1;
private UC_LedConfig uC_LedConfig1;
private System.Windows.Forms.TableLayoutPanel tp;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblMaxSet;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label lblMaxY;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblYa;
}
}
......@@ -37,14 +37,30 @@ namespace TheMachineNView
if (!RobotManage.haveFixpos)
cb_usefixpos.Visible = false;
}
private void SettingControl_Load(object sender, EventArgs e)
private void SShow(bool isShow)
{
lblMaxSet.Visible = isShow;
lblMaxY.Visible = isShow;
lblYa.Visible = isShow;
label1.Visible = isShow;
label3.Visible = isShow;
label5.Visible = isShow;
}
private void SettingControl_Load(object sender, EventArgs e)
{
//Config.PropertyBind("Device_Humiture_Port", cb_tempsensorport, "SelectedItem", "SelectedIndexChanged");
Config.PropertyBind("Device_Use_Fixpos", cb_usefixpos, "Checked", "CheckedChanged");
if (Setting_Init.Device_WeightSensor_PortName == "" )
{
SShow(false);
tp.RowStyles[1].Height = 0;
tp.RowStyles[2].Height = 0;
tp.AutoSize = true;
}
else
{ SShow(true); }
}
......@@ -119,6 +135,19 @@ namespace TheMachineNView
}
var t = HumitureController.LastData;
lbl_hmdstate.Text += $"{crc.GetString(L.temp, "温度")}:{t.Temperate}℃, {crc.GetString(L.humidity, "湿度")}:{t.Humidity}%";
if (Setting_Init.Device_WeightSensor_PortName == "" || RobotManage.oKLE_WeightSensor == null || (!RobotManage.oKLE_WeightSensor.IsPortOpen))
{
lblYa.Text = "";
lblMaxY.Text = "";
lblMaxSet.Text = "";
}
else
{
lblYa.Text =Math.Round( RobotManage.oKLE_WeightSensor.GetWeight(),2).ToString();
lblMaxY.Text = Math.Round(RobotManage.oKLE_WeightSensor.PeakWeight(), 2).ToString();
lblMaxSet.Text = Setting_Init.Device_WeightSensor_MaxValue.ToString();
}
}
private void button1_Click_1(object sender, EventArgs e)
......
......@@ -450,4 +450,7 @@ FlipDoor_R_Axis 右翻转托盘 Right Flip Tray
StringDoor_Axis 料串口折叠门 String Folding Door
FrmPositionTool_groupBox6_groupBox1_ioStatusControl1_label1_Text 检测信号 Detection Signal
Res0001 设备未启动 Device Not Started
stringDoorSafety 料串门光栅被遮挡 The grating of the string door is obstructed.
\ No newline at end of file
stringDoorSafety 料串门光栅被遮挡 The grating of the string door is obstructed.
Form1_tabc_tab_setting__SettingControl_tp_label5_Text 设置最大压力: Set maximum pressure:
Form1_tabc_tab_setting__SettingControl_tp_label3_Text 历史最大压力值: Historical maximum pressure value:
Form1_tabc_tab_setting__SettingControl_tp_label1_Text 压力传感器当前值: Current value of pressure sensor:
......@@ -454,3 +454,6 @@ StringDoor_Axis 料串口折叠门 ストリングドア
FrmPositionTool_groupBox6_groupBox1_ioStatusControl1_label1_Text 检测信号 検出信号
Res0001 设备未启动 デバイスは始まっていません
stringDoorSafety 料串门光栅被遮挡 料串口折叠门のグリッドが遮られています
Form1_tabc_tab_setting__SettingControl_tp_label5_Text 设置最大压力: 最大圧力を設定する:
Form1_tabc_tab_setting__SettingControl_tp_label3_Text 历史最大压力值: 過去の最大圧力値:
Form1_tabc_tab_setting__SettingControl_tp_label1_Text 压力传感器当前值: 圧力センサーの現在の値:
\ No newline at end of file
......@@ -438,4 +438,7 @@ FlipDoor_R_Axis 右翻转托盘
StringDoor_Axis 料串口折叠门
FrmPositionTool_groupBox6_groupBox1_ioStatusControl1_label1_Text 检测信号
Res0001 设备未启动
stringDoorSafety 料串门光栅被遮挡
stringDoorSafety 料串门光栅被遮挡
Form1_tabc_tab_setting__SettingControl_tp_label5_Text 设置最大压力:
Form1_tabc_tab_setting__SettingControl_tp_label3_Text 历史最大压力值:
Form1_tabc_tab_setting__SettingControl_tp_label1_Text 压力传感器当前值:
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!