/// <summary> /// Process the incoming data. This will screen and average the data. /// </summary> /// <param name="data">Data to display.</param> /// <param name="origDataFormat">Originial Format of the data.</param> private void ProcessEnsemble(DataSet.Ensemble data, AdcpCodec.CodecEnum origDataFormat) { // Distribute the dataset to all subscribers if (data != null) { // Publish the ensemble before it is screened and averaged _events.PublishOnBackgroundThread(new EnsembleRawEvent(data.Clone(), EnsembleSource.Playback, EnsembleType.Single, origDataFormat)); // Make a copy of the ensemble to pass to all the views DataSet.Ensemble newEnsemble = data.Clone(); // Lock the ensemble lock (newEnsemble.SyncRoot) { // Vessel Mount Options VesselMountScreen(ref newEnsemble); // Screen the data _screenDataVM.ScreenData(ref newEnsemble, origDataFormat); // Average the data _averagingVM.AverageEnsemble(newEnsemble); // Create and Ensembl event EnsembleEvent ensEvent = new EnsembleEvent(newEnsemble, EnsembleSource.Playback); // Publish the ensemble after screening and averging the data _events.PublishOnBackgroundThread(ensEvent); // Display the ensemble _pm.DisplayEnsemble(ensEvent); } } }