using Bro.Common.Helper; using Bro.UI.Model.Winform; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Windows.UI.Composition.Interactions; namespace Bro.M141.Process.UI { [MenuNode("State", "设备生产模式", 1, EnumHelper.TopMenu.SystemInfo, MenuNodeType.Form)] //public partial class State : UserControl public partial class State : MenuFormBase { public State() { InitializeComponent(); } M141Process M141Process => Process as M141Process; public override void OnProcessUpdated() { base.OnProcessUpdated(); M141Process.RefreshState += changestate; } private void PLCstate_Load(object sender, EventArgs e) { } public void changestate(string state) { this.Invoke(new Action(() => { comboBox1.Text = state; })); } private void comboBox1_TextChanged(object sender, EventArgs e) { if (comboBox1.Text.Contains("正常")) { M141Process.wirtePLC(3027, 0); M141Process.wirtePLC(3028, 0); } else if (comboBox1.Text.Contains("调试")) { M141Process.wirtePLC(3027, 1); } else { M141Process.wirtePLC(3028, 1); } } } }