Пример #1
0
 /// <summary>
 /// Only update the contour plot and timeseries.  This will need each ensemble.
 /// The profile plots only need the last ensemble.
 /// </summary>
 /// <param name="ensembles">Event that contains the Ensembles to display.</param>
 /// <param name="maxEnsembles">Maximum ensembles to display.</param>
 public void DisplayBulkData(Cache <long, DataSet.Ensemble> ensembles, int maxEnsembles)
 {
     //Task.Run(() => DisplayData(ensemble));
     //DisplayData(ensemble);
     try
     {
         AmpltiduePlot.AddIncomingDataBulk(ensembles, _Config.SubSystem, _Config, maxEnsembles);
     }
     catch (Exception e)
     {
         log.Error("Error adding ensemble to Heatmap plots.", e);
     }
 }
Пример #2
0
        /// <summary>
        /// Execute the displaying of the data async.
        /// </summary>
        private void ProcessDataThread()
        {
            while (_continue)
            {
                // Wakeup the thread with a signal
                // Have a 2 second timeout to see if we need to shutdown the thread
                _eventWaitData.WaitOne(2000);

                while (!_buffer.IsEmpty)
                {
                    // Get the latest data from the buffer
                    DataSet.Ensemble ensemble = null;
                    if (_buffer.TryDequeue(out ensemble))
                    {
                        // Verify the ensemble is good
                        if (ensemble == null || ensemble.EnsembleData == null || !ensemble.IsEnsembleAvail)
                        {
                            //_isProcessingBuffer = false;
                            continue;
                        }

                        // If no subsystem is given, then a project is not selected
                        // So receive all data and display
                        // If the serial number is not set, this may be an old ensemble
                        // Try to display it anyway
                        if (!_Config.SubSystem.IsEmpty() && !ensemble.EnsembleData.SysSerialNumber.IsEmpty())
                        {
                            // Verify the subsystem matches this viewmodel's subystem.
                            if ((_Config.SubSystem != ensemble.EnsembleData.GetSubSystem()) ||     // Check if Subsystem matches
                                (_Config != ensemble.EnsembleData.SubsystemConfig))                // Check if Subsystem Config matches
                            {
                                //_isProcessingBuffer = false;
                                continue;
                            }
                        }

                        try
                        {
                            Task.Run(() => AmpltiduePlot.AddIncomingData(ensemble, MaxEnsembles));
                        }
                        catch (Exception e)
                        {
                            log.Error("Error adding ensemble to plots.", e);
                        }
                    }
                }
            }

            return;
        }
Пример #3
0
 /// <summary>
 /// Clear the plot.
 /// </summary>
 public void ClearPlots()
 {
     AmpltiduePlot.ClearIncomingData();
 }