Exemple #1
0
        public void LoadDefaultSettings()
        {
            var settings = new DicomServerSettings()
            {
                ListeningEnabled       = false,
                AETitle                = "PSDICOM",
                ListenPort             = 4006,
                ImageStoragePath       = @"c:\dicom",
                ImageStorageSizeMB     = 1024,
                AutoDecompress         = false,
                PromiscuousMode        = false,
                StoreMetadataOnlyFiles = false,
                VerboseLogging         = false
            };

            this.UseSettings(settings);
        }
Exemple #2
0
        public void LoadSettingsFromDatabase()
        {
            var settings = new DicomServerSettings()
            {
                ListeningEnabled       = this._db.GetOptionBool(Option_ListeningEnabled, false),
                AETitle                = this._db.GetOption(Option_AETitle, "PSDICOM"),
                ListenPort             = this._db.GetOptionInt(Option_ListenPort, 4006),
                ImageStoragePath       = this._db.GetOption(Option_ImageStoragePath, @"c:\dicom"),
                ImageStorageSizeMB     = this._db.GetOptionInt(Option_PruneDBSizeMB, 1024),
                AutoDecompress         = this._db.GetOptionBool(Option_AutoDecompress, false),
                PromiscuousMode        = this._db.GetOptionBool(Option_PromiscuousMode, false),
                StoreMetadataOnlyFiles = this._db.GetOptionBool(Option_StoreMetadataOnlyFiles, false),
                VerboseLogging         = this._db.GetOptionBool(Option_VerboseLogging, false)
            };

            this.UseSettings(settings);
        }
Exemple #3
0
        public void UseSettings(DicomServerSettings settings)
        {
            this._settings = settings;

            if (this._db.IsSetup)
            {
                // Always re-save to DB, even if we just loaded it, in case we've transformed data or we're saving defaults
                this._db.SetOption(Option_ListeningEnabled, settings.ListeningEnabled);
                this._db.SetOption(Option_AETitle, settings.AETitle);
                this._db.SetOption(Option_ListenPort, settings.ListenPort);
                this._db.SetOption(Option_ImageStoragePath, settings.ImageStoragePath);
                this._db.SetOption(Option_PruneDBSizeMB, (int)settings.ImageStorageSizeMB);
                this._db.SetOption(Option_AutoDecompress, settings.AutoDecompress);
                this._db.SetOption(Option_PromiscuousMode, settings.PromiscuousMode);
                this._db.SetOption(Option_StoreMetadataOnlyFiles, settings.StoreMetadataOnlyFiles);
                this._db.SetOption(Option_VerboseLogging, settings.VerboseLogging);
            }

            this._listener.VerboseLogging = this._settings.VerboseLogging;

            this._db.PruneDBSizeMB = (uint)this._settings.ImageStorageSizeMB;
        }