using Mesnac.Action.Base; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Mesnac.Action.ChemicalWeighing.ProjectDebug { class SelectAction : ChemicalWeighingAction, IAction { public void Run(RuntimeParameter runtime) { base.RunIni(runtime); //必须要调用 ComboBox comboBox = base.GetControlById("MCCombobox1") as ComboBox; if (comboBox == null) { ICSharpCode.Core.LoggingService.Warn("{工程调试-打开} 缺少ComboBox控件..."); runtime.IsReturn = false; return; } string str = comboBox.SelectedValue.ToString(); if (str != "" && str != null) { var writeResult16 = BasePlcHelper.Instance.PlcWriteByRunName(str, new object[] { 0 }); } } } }