| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using Bro.Common.Model; |
| | | using Bro.UI.Model.Winform; |
| | | using static Bro.Common.Helper.EnumHelper; |
| | | |
| | | namespace Bro.UI.Device.Winform |
| | | { |
| | | public partial class CtrlMotionCardIOStatus : UserControl |
| | | { |
| | | public List<IOItem> _monitorValues { get; set; } |
| | | |
| | | public CtrlMotionCardIOStatus() |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | |
| | | public CtrlMotionCardIOStatus(List<IOItem> monitorValues) |
| | | { |
| | | InitializeComponent(); |
| | | _monitorValues = monitorValues; |
| | | } |
| | | |
| | | private void RefreshIOStatus(object sender, EventArgs e) |
| | | { |
| | | foreach (var ioItem in _monitorValues) |
| | | { |
| | | if (ioItem.IOType == Common.Helper.EnumHelper.IOType.INPUT) |
| | | { |
| | | var ioInArray = groupBoxIOIn.Controls.Find("ioIn" + ioItem.IONum, false); |
| | | if (ioInArray != null && ioInArray.Length == 1) |
| | | { |
| | | var ioIn = ioInArray[0] as IOIndicatorCtrl; |
| | | ioIn.IsOn = ioItem.Value == IOValue.TRUE; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var ioOutArray = groupBoxIOOut.Controls.Find("ioOut" + ioItem.IONum, false); |
| | | if (ioOutArray != null && ioOutArray.Length == 1) |
| | | { |
| | | var ioOut = ioOutArray[0] as IOIndicatorCtrl; |
| | | ioOut.IsOn = ioItem.Value == IOValue.TRUE; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |