From 24400a59c99966f8bae707551812ebdbd9f66cff Mon Sep 17 00:00:00 2001 From: nodyang Date: Mon, 28 Aug 2023 16:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=80=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjPressure/FrmPressureUpdate.Designer.cs | 26 ------------------- .../LjPressure/FrmPressureUpdate.cs | 26 +++++++++---------- .../LjPressure/UpAction.cs | 4 +-- .../LjProportional/UpdateAction.cs | 2 +- .../Loading.Designer.cs | 5 ++-- .../Mesnac.Action.ChemicalWeighing/Loading.cs | 4 ++- .../LoadingHelper.cs | 5 +--- Main/MCEdit/Data/MCProject/SCWSProject2.mprj | 1 - 8 files changed, 22 insertions(+), 51 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.Designer.cs index 9187c82..cf067fc 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.Designer.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.Designer.cs @@ -39,8 +39,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure this.btnOK = new System.Windows.Forms.Button(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.Alarm = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); // // HighLimit @@ -104,38 +102,17 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure this.label3.TabIndex = 44; this.label3.Text = "低压设定值:"; // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(39, 90); - this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(59, 12); - this.label1.TabIndex = 43; - this.label1.Text = "超压报警:"; - // - // Alarm - // - this.Alarm.FormattingEnabled = true; - this.Alarm.Location = new System.Drawing.Point(108, 87); - this.Alarm.Name = "Alarm"; - this.Alarm.Size = new System.Drawing.Size(129, 20); - this.Alarm.TabIndex = 51; - this.Alarm.SelectedIndexChanged += new System.EventHandler(this.Alarm_SelectedIndexChanged); - // // FrmPressureUpdate // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(268, 206); - this.Controls.Add(this.Alarm); this.Controls.Add(this.HighLimit); this.Controls.Add(this.LowLimit); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnOK); this.Controls.Add(this.label4); this.Controls.Add(this.label3); - this.Controls.Add(this.label1); this.ForeColor = System.Drawing.SystemColors.ControlText; this.Name = "FrmPressureUpdate"; this.Text = "修改压力参数"; @@ -143,9 +120,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure this.PerformLayout(); } - private System.Windows.Forms.ComboBox Alarm; - - private System.Windows.Forms.Label label1; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.TextBox HighLimit; diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.cs index 6c600a1..fedd25f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/FrmPressureUpdate.cs @@ -34,9 +34,9 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure }); - this.Alarm.DataSource = ls; - Alarm.ValueMember = "Id"; - Alarm.DisplayMember = "Name"; + // this.Alarm.DataSource = ls; + // Alarm.ValueMember = "Id"; + // Alarm.DisplayMember = "Name"; var i = BasePlcHelper.Instance.WatchDog.LastValue.ToInt(); if (i == 0) @@ -52,15 +52,15 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure this.LowLimit.Text = v.LowLimit.ToString(CultureInfo.InvariantCulture); this.HighLimit.Text = v.HighLimit.ToString(CultureInfo.InvariantCulture); - foreach (MyNameValue combo in Alarm.Items) - { - if (combo.Id == v.Alarm) - { - Alarm.SelectedItem = combo; - Alarm.Enabled = false; - break; - } - } + // foreach (MyNameValue combo in Alarm.Items) + // { + // if (combo.Id == v.Alarm) + // { + // Alarm.SelectedItem = combo; + // Alarm.Enabled = false; + // break; + // } + // } } else { @@ -101,7 +101,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure Id = _id, HighLimit = b, LowLimit = a, - Alarm = Convert.ToInt16(Alarm.SelectedValue) + }; PressurePLC.DownToPlc(new List() diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs index a854bb9..907b3ec 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjPressure/UpAction.cs @@ -31,11 +31,12 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure private void DoWord() { LoadingHelper.ShowLoadingScreen(); - var i = BasePlcHelper.Instance.WatchDog.LastValue.ToInt(); + var i = LjHelp.WatchDog; if (i == 0) { LoadingHelper.CloseForm(); MessageBox.Show("PLC通讯失败"); + ICSharpCode.Core.LoggingService.Warn("PLC通讯失败"); return; } @@ -49,7 +50,6 @@ namespace Mesnac.Action.ChemicalWeighing.LjPressure LoadingHelper.CloseForm(); - if (OnHandler != null) { OnHandler(this._runtime.BaseControl.MCRoot, System.EventArgs.Empty); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpdateAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpdateAction.cs index 5ad6dfd..8d27844 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpdateAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjProportional/UpdateAction.cs @@ -19,7 +19,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjProportional base.RunIni(runtime); //必须调用 this._runtime = runtime; DbMCControl materialGridControl = - this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ElectricalSetting") + this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "ProportionalSetting") .FirstOrDefault(); //获取物料数据控件 this._materialGridControl = materialGridControl; diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs index bb41fec..b9fdf03 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.Designer.cs @@ -39,7 +39,7 @@ namespace Mesnac.Action.ChemicalWeighing // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(122, 40); + this.label2.Location = new System.Drawing.Point(85, 30); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(65, 12); this.label2.TabIndex = 0; @@ -55,12 +55,11 @@ namespace Mesnac.Action.ChemicalWeighing this.Text = "Loading"; this.ResumeLayout(false); this.PerformLayout(); - } #endregion private Label label1; - private Label label2; + private System.Windows.Forms.Label label2; } } \ No newline at end of file diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs index cbb43a9..5d6397a 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Loading.cs @@ -8,11 +8,13 @@ namespace Mesnac.Action.ChemicalWeighing public Loading() { InitializeComponent(); + this.ControlBox = true ; + this.MaximizeBox = false; } private void loading_Load(object sender, EventArgs e) { - //this.BackColor = Color.Transparent; + this.Opacity = 1; } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs index f5a871a..f957d38 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LoadingHelper.cs @@ -15,10 +15,7 @@ namespace Mesnac.Action.ChemicalWeighing #endregion - //private LoadingHelper() - //{ - - //} + /// /// 显示loading框 diff --git a/Main/MCEdit/Data/MCProject/SCWSProject2.mprj b/Main/MCEdit/Data/MCProject/SCWSProject2.mprj index 68e5c18..dcaee71 100644 --- a/Main/MCEdit/Data/MCProject/SCWSProject2.mprj +++ b/Main/MCEdit/Data/MCProject/SCWSProject2.mprj @@ -4,7 +4,6 @@ -