private void Moni(Button btn, int line) { btn.IsEnabled = false; IOCard.Moni(line, () => { App.Current.Dispatcher.Invoke(new Action(() => { btn.IsEnabled = true; })); }); }
public Line(int lineNo, CountHelper count, LineOut lineOut, IOCard ioCard, StopHelper stopHelper) { Name = Config.Trigger[lineNo - 1].Name; OnPropertyChanged(nameof(Name)); LineNo = lineNo; Count = count; LineOut = lineOut; iOCard = ioCard; Stop = stopHelper; traceDataHelper = new TraceDataHelper(); traceDataHelper.Init(); }
void IOInit() { IOCard = new IOCard(); IOCard.OnTrigger += (index) => { if (Stop.IsShowStop) { return; } Trigger.TriggerOn(index); Lines[index].SetReading(); }; IOCard.OnComplate += (index) => { Lines[index].SetDefault(); Count.UpdateToFile(); }; IOCard.OnMoni += () => { MoniVisibility = Visibility.Visible; OnPropertyChanged(nameof(MoniVisibility)); }; OnPropertyChanged(nameof(IOCard)); }