Exemple #1
0
        //Constructor,Constructor Injection is used to decouple ViewModel and Model.
        public MainWindowViewModel(SignalBase inputSignal)
        {
            //Initialize Property
            signalSimplingPoint = new SimplingPoint(DateTime.Now, 0.0, 0.0, 0.0);

            Signal_Y1_Input = true;
            Signal_Y2_Input = true;
            Signal_Y3_Input = true;

            samplingPeriodItem = new ObservableCollection <string>()
            {
                "1s", "800ms", "600ms", "400ms", "200ms"
            };
            samplingPeriodArray = new double[] { 1.0, 0.8, 0.6, 0.4, 0.2 };
            samplingPeriodIndex = 3;

            statusTip = "Ready";

            saveEnabled = false;

            historyData = new List <SimplingPoint>();

            isStarted = false;

            Start_StopCommand = new RelayCommand(Start_Stop);
            SaveCommand       = new RelayCommand(SaveHistoryData);

            //Update View based on the signal
            signal = inputSignal;
            signal.TiggerTimer.Interval = TimeSpan.FromSeconds(0.5);
            signal.Changed += UpdateData;
        }
 public SignalEventArgs(SimplingPoint simplingArgs)
 {
     SimplingArgs = simplingArgs;
 }