/// <summary> /// Process all the ensembles in batches. This will ensure that not all the data is read /// in at one time. /// </summary> /// <param name="index">Index in the total ensemble list.</param> /// <param name="batch_size">Batch size.</param> /// <param name="origDataFormat">Format of the data.</param> private void ProcessEnsembleBatch(long index, uint batch_size, AdcpCodec.CodecEnum origDataFormat) { // Get all the data from the files Cache <long, DataSet.Ensemble> data = _pm.SelectedProject.GetEnsembles(index, batch_size); // Store the new screened data Cache <long, DataSet.Ensemble> screenData = new Cache <long, DataSet.Ensemble>(batch_size); // Screen all the data for (int x = 0; x < data.Count(); x++) { // Make a copy of the ensemble to pass to all the views DataSet.Ensemble newEnsemble = data.IndexValue(x).Clone(); lock (newEnsemble.SyncRoot) { // Vessel Mount Options VesselMountScreen(ref newEnsemble); // Screen the data _screenDataVM.ScreenData(ref newEnsemble, origDataFormat); // Add the screened ensemble to the list screenData.Add(data.IndexKey(x), newEnsemble); } } // Publish all the ensembles //_events.PublishOnBackgroundThread(new BulkEnsembleEvent(screenData, EnsembleSource.Playback)); _pm.DisplayEnsembleBulk(new BulkEnsembleEvent(screenData, EnsembleSource.Playback)); }