public AzureBlobSource() : base("AzureStorageConfiguration.json") { this.Name = "AzureStorage"; this.SourceType = DataSourceType.Blob; this.DeleteSourceFilesWhenComplete = true; this.CurrentImage = -1; // Get the configuration specific to this instance this.Configuration = this.LoadConfiguration(); this.MultiClass = this.Configuration.MultiClass; // Create the storage utils this.AzureStorageUtils = new StorageUtility(this.Configuration); // Prepare the UI control with the right hooks. AzureStorageConfigurationUi configUi = new AzureStorageConfigurationUi(this, this.Configuration); configUi.OnConfigurationSaved += ConfigurationSaved; configUi.OnSourceDataUpdated += UpdateInformationRequested; this.ConfigurationControl = new ConfigurationControlImpl("Azure Storage - Unlabeled Dataset", configUi); // Load the catalogs and initialize if already configured this.CatalogFiles = new List <string>(BlobPersistenceLogger.GetAcquisitionFiles(this.Configuration)); this.CurrentContainer = this.CatalogFiles.FirstOrDefault(); this.InitializeOnNewContainer(); this.ContainerControl = new GenericContainerControl(this); this.ImageControl = new SingleImageControl(this); }
/// <summary> /// Triggered when the data collection routine completes either by completion or cancel. /// </summary> private void DataCollectionJobCompleted() { this.CatalogFiles = new List <string>(BlobPersistenceLogger.GetAcquisitionFiles(this.Configuration)); this.CurrentContainer = this.CatalogFiles.FirstOrDefault(); // Update containers this.ContainerControl?.Refresh(); // Initialize with new data this.InitializeOnNewContainer(); // Notify listeners it just happened. if (this.ConfigurationControl != null) { this.ConfigurationControl.Control.Dispatcher.Invoke(() => { this.ConfigurationControl.OnSourceDataUpdated?.Invoke(this); }); } }