public override void UnregisterArchitecture() { foreach (Signal signal in _sensedSignals) { signal.ValueChanged -= signal_SignalValueChanged; } _sensedSignals.Clear(); }
public static bool SimplifyFactors(SignalSet signals) { Signal zero; if (signals.Exists(Std.IsConstantAdditiveIdentity, out zero)) { signals.Clear(); signals.Add(zero); return(true); } return(0 < signals.RemoveAll(Std.IsConstantMultiplicativeIdentity)); }
public override async Task StartAsync(ExamContext context) { //清除历史的信号记录; SignalSet.Clear(); //设置考试里程 context.ExamDistance = (context.ExamTimeMode == ExamTimeMode.Day) ? Settings.ExamDistance : Settings.NightDistance; await ExamManager.StartExamAsync(context); if (context.ExamMode == ExamMode.Training) { await StartTrainingAsync(context); } else { await StartExamAsync(context); } }
public override async Task ReadyStartExamAsync(ExamContext context) { //清除历史的信号记录; SignalSet.Clear(); //设置考试里程 context.ExamDistance = (context.ExamTimeMode == ExamTimeMode.Day) ? Settings.ExamDistance : Settings.NightDistance; await ExamManager.StartExamAsync(context); await Task.Run(() => { while (!(SignalSet.Current != null && SignalSet.Current.Sensor.Brake)) { Thread.Sleep(100); } }); await StartExamItemAutoAsync(context, ExamItemCodes.CommonExamItem); await StartExamItemAutoAsync(context, ExamItemCodes.Start); }
public static bool SimplifyFactors(SignalSet signals) { if (signals == null) { throw new ArgumentNullException("signals"); } if (Std.IsConstantAdditiveIdentity(signals[0])) { signals.Clear(); signals.Add(signals[0]); return(true); } bool altered = false; for (int i = signals.Count - 1; i > 0; i--) //don't touch first item! { if (Std.IsConstantMultiplicativeIdentity(signals[i])) { altered = true; signals.RemoveAt(i); } } return(altered); }
public static bool SimplifyFactors(SignalSet signals) { Signal zero; if(signals.Exists(Std.IsConstantAdditiveIdentity, out zero)) { signals.Clear(); signals.Add(zero); return true; } return 0 < signals.RemoveAll(Std.IsConstantMultiplicativeIdentity); }
public void Reset() { _signals.Clear(); _ports.Clear(); _buses.Clear(); }
public static bool SimplifyFactors(SignalSet signals) { if(signals == null) throw new ArgumentNullException("signals"); if(Std.IsConstantAdditiveIdentity(signals[0])) { signals.Clear(); signals.Add(signals[0]); return true; } bool altered = false; for(int i = signals.Count - 1; i > 0; i--) //don't touch first item! if(Std.IsConstantMultiplicativeIdentity(signals[i])) { altered = true; signals.RemoveAt(i); } return altered; }