public LiveDataViewModel(IConfigService config, IDataAquisition dataAquisition, ISequenceRunner runner, IEventAggregator eventAggregator) : base(config, dataAquisition, runner) { AddToGraphCommand = new DelegateCommand <Tuple <InputChannel, int> >(param => { eventAggregator.GetEvent <AddToGraphEvent>().Publish((param.Item1, param.Item2)); }); eventAggregator.GetEvent <GraphCreatedEvent>().Subscribe(id => GraphIds.Add(id)); }
public ChannelPresenterViewModelBase(IConfigService config, IDataAquisition dataAquisition, ISequenceRunner runner) { UpdateLiveChannelsFromConfig(config.Config); config.ConfigFileLoaded += (o, e) => UpdateLiveChannelsFromConfig(config.Config); dataAquisition.ChannelValueUpdated += ChannelValueUpdated; SendOutputValueCommand = new DelegateCommand <LiveChannel>(SendOutputValue, channel => channel != null && EnableOutputToggling); runner.SequenceRunningStateChanged += (o, e) => EnableOutputToggling = !e.Status; this.dataAquisition = dataAquisition; }
public LiveViewModel(ISequenceRunner runner, ISequencePersistence sequencePersistence, ISequenceEditorService fileEditorService, IDataAquisition dataAquisition, IConfigService configService = null) { this.runner = runner; this.sequencePersistence = sequencePersistence; this.fileEditorService = fileEditorService; OpenSequenceCommand = new DelegateCommand(OpenSequence); StartServiceCommand = new DelegateCommand(StartService); StartStopRecCommand = new DelegateCommand(StartStopRecord); RunSequenceCommand = new DelegateCommand <Sequence>(runner.RunSequence); PauseServiceCommand = new DelegateCommand(PauseService); this.dataAquisition = dataAquisition; this.configService = configService; }
public SchematicViewModel(IConfigService config, IDataAquisition dataAquisition, ISequenceRunner runner) : base(config, dataAquisition, runner) { Channels.CollectionChanged += (o, e) => { if (e.NewItems != null) { foreach (LiveChannel item in e.NewItems) { item.Channel.PropertyChanged += NotifyUpdated; } } if (e.OldItems != null) { foreach (LiveChannel item in e.OldItems) { item.Channel.PropertyChanged -= NotifyUpdated; } } RaiseUpdates(); }; }
public SequenceRunner(IDataAquisition dataService, IConfigService configService) { this.Service = dataService; this.config = configService; }
public GraphsViewModel(IEventAggregator eventAggregator, IDataAquisition dataAquisition) { eventAggregator.GetEvent <AddToGraphEvent>().Subscribe((param) => AddToGraph(param.channel, param.graphId)); this.eventAggregator = eventAggregator; dataAquisition.ChannelValueUpdated += (o, e) => RecordValue(e.Channel, e.Value, e.Time); }