示例#1
0
        /// <summary>
        /// Initialize the view model.
        /// </summary>
        public ViewDataProfile3DViewModel(SubsystemDataConfig config)
            : base("3D Profile")
        {
            // Set Subsystem
            _Config = config;
            //_displayCounter = 0;

            // Get PulseManager
            _pm = IoC.Get <PulseManager>();
            _pm.RegisterDisplayVM(this);

            // Get the Event Aggregator
            _events = IoC.Get <IEventAggregator>();

            _buffer = new ConcurrentQueue <DataSet.Ensemble>();

            // Initialize the thread
            _continue               = true;
            _eventWaitData          = new EventWaitHandle(false, EventResetMode.AutoReset);
            _processDataThread      = new Thread(ProcessDataThread);
            _processDataThread.Name = string.Format("3D Profile Plot View: {0}", config.DescString());
            _processDataThread.Start();

            // Get the options from the database
            GetOptionsFromDatabase();

            VelPlot = new Profile3DPlotViewModel();

            // Close the VM
            CloseVMCommand = ReactiveCommand.Create();
            CloseVMCommand.Subscribe(_ => _events.PublishOnUIThread(new CloseVmEvent(_Config)));

            // Register to receive data
            _events.Subscribe(this);
        }
示例#2
0
        /// <summary>
        /// Initialize the view model.
        /// </summary>
        public BackscatterViewModel(SubsystemDataConfig config)
            : base("Backscatter")
        {
            // Set Subsystem
            _Config = config;
            //_displayCounter = 0;

            // Get PulseManager
            _pm = IoC.Get <PulseManager>();
            _pm.RegisterDisplayVM(this);

            // Get the Event Aggregator
            _events = IoC.Get <IEventAggregator>();

            _buffer = new ConcurrentQueue <DataSet.Ensemble>();

            // Initialize the thread
            _continue               = true;
            _eventWaitData          = new EventWaitHandle(false, EventResetMode.AutoReset);
            _processDataThread      = new Thread(ProcessDataThread);
            _processDataThread.Name = string.Format("Backscatter View: {0}", config.DescString());
            _processDataThread.Start();

            // Get the options from the database
            GetOptionsFromDatabase();

            AmpltiduePlot = new HeatmapPlotViewModel(HeatmapPlotSeries.HeatmapPlotType.Amplitude, _options.AmplitudeSeriesOptions);
            AmpltiduePlot.AddSeries(_options.AmplitudeSeriesOptions);
            AmpltiduePlot.UpdateOptionsEvent += AmplitudeVelPlot_UpdateOptionsEvent;

            // Close the VM
            CloseVMCommand = ReactiveCommand.Create();
            CloseVMCommand.Subscribe(_ => _events.PublishOnUIThread(new CloseVmEvent(_Config)));

            _events.Subscribe(this);
        }