Exemple #1
0
        private void LoadOtherParamsFromXML()
        {
            try
            {
                //Filter settings
                ObsControl.objMaxim.TargetCameraSetTemp = ConfigManagement.getDouble("Options", "lastsettemp") ?? Maxim_ExternalApplication.DefaultCameraSetTemp;

                //Devices
                ObsControl.ASCOMFocuser.DRIVER_NAME = ConfigManagement.getString("Devices", "FocuserDriverName") ?? "";
                ObsControl.ASCOMFocuser.Enabled     = ConfigManagement.getBool("Devices", "FocuserAutoConnect") ?? false;

                Logging.AddLog("Program parameters were set according to XML configuration file", LogLevel.Activity);

                //IQP_LoadParamsFromXML();
            }
            catch (Exception ex)
            {
                Logging.AddLog("Couldn't load XML options" + ex.Message, LogLevel.Important, Highlight.Error);
                Logging.AddLog("Exception details: " + ex.ToString(), LogLevel.Debug, Highlight.Error);
            }
        }
Exemple #2
0
        private void IQP_LoadParamsFromXML()
        {
            try
            {
                List <string> dirNodesList = ConfigManagement.getAllSectionNamesList("monitorPath");
                foreach (string curDirNode in dirNodesList)
                {
                    IQP_FileMonitorPath.Add(ConfigManagement.getString("monitorPath", curDirNode));
                }

                ObsControl.objIQPEngine.MonitorObj.settingsScanSubdirs = ConfigManagement.getBool("IQP_options", "ScanSubDirs") ?? false;
                settingsAutoStartMonitoring = ConfigManagement.getBool("IQP_options", "AUTOSTARTMONITORING") ?? false;
                ObsControl.objIQPEngine.ProcessingObj.settingsDSSCLPath = ConfigManagement.getString("IQP_options", "DSS_PATH") ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"\DeepSkyStacker\DeepSkyStackerCL.exe");

                ObsControl.objIQPEngine.ProcessingObj.settingsPublishToGroup = ConfigManagement.getBool("IQP_options", "PUBLISHTOGROUP") ?? true;
                ObsControl.objIQPEngine.WebPublishObj.SetURL(ConfigManagement.getString("publishURL", "url1") ?? "http://localhost");
                ObsControl.objIQPEngine.WebPublishObj.ServerKey = ConfigManagement.getString("publishURL", "key1") ?? "";

                ObsControl.objIQPEngine.ProcessingObj.settingsPublishToPrivate = ConfigManagement.getBool("IQP_options", "PUBLISHTOPRIVATE") ?? true;
                ObsControl.objIQPEngine.WebPublishObj2.SetURL(ConfigManagement.getString("publishURL", "url2") ?? "http://localhost");
                ObsControl.objIQPEngine.WebPublishObj2.ServerKey = ConfigManagement.getString("publishURL", "key2") ?? "";

                //hidden settings
                ObsControl.objIQPEngine.MonitorObj.settingsExtensionToSearch         = ConfigManagement.getString("IQP_options", "extensionsToSearch") ?? "*.fit*";
                ObsControl.objIQPEngine.ProcessingObj.settingsMaxThreads             = (uint)(ConfigManagement.getInt("IQP_options", "checkThreads_max") ?? 1);
                ObsControl.objIQPEngine.ProcessingObj.settingsSkipIMSfiles           = ConfigManagement.getBool("IQP_options", "checkDirIMS") ?? true;
                ObsControl.objIQPEngine.ProcessingObj.settingsDSSForceRecheck        = ConfigManagement.getBool("IQP_options", "alwaysRebuildDSSInfoFile") ?? false;
                ObsControl.objIQPEngine.ProcessingObj.settingsDSSForceRunHidden      = ConfigManagement.getBool("IQP_options", "RunDSSHidden") ?? false;
                ObsControl.objIQPEngine.ProcessingObj.settingsPublishLightFramesOnly = ConfigManagement.getBool("IQP_options", "publishLightFramesOnly") ?? true;
                ObsControl.objIQPEngine.ProcessingObj.settingsDSSInfoFileAutoDelete  = ConfigManagement.getBool("IQP_options", "autoDeleteDSSInfoFile") ?? false;

                //Filter settings
                string st = ConfigManagement.getString("IQP_filters", "excludedirs") ?? "";
                ObsControl.objIQPEngine.MonitorObj.settingsFilterDirName_ExcludeSt = new List <string>(st.Split(';'));
                st = ConfigManagement.getString("IQP_filters", "excludefiles") ?? "";
                ObsControl.objIQPEngine.MonitorObj.settingsFilterFileName_ExcludeSt      = new List <string>(st.Split(';'));
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterObserverTag_Contains = ConfigManagement.getString("IQP_filters", "observer") ?? "";
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterTelescopTag_Contains = ConfigManagement.getString("IQP_filters", "telescop") ?? "";
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterInstrumeTag_Contains = ConfigManagement.getString("IQP_filters", "instrume") ?? "";
                //Filter settings: quality
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterHistoryTag_MaxCount = (UInt16)(ConfigManagement.getInt("IQP_filters", "historycount") ?? 1);
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterStarsNum_MinCount   = (UInt16)(ConfigManagement.getInt("IQP_filters", "minstars") ?? 1);
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterFWHM_MaxVal         = ConfigManagement.getDouble("IQP_filters", "maxfwhm") ?? 10.0;
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterMinAltitude_MinVal  = ConfigManagement.getDouble("IQP_filters", "minaltitude") ?? 19.0;
                ObsControl.objIQPEngine.ProcessingObj.settingsFilterBackground_MaxVal   = ConfigManagement.getDouble("IQP_filters", "maxbackground") ?? 0.30;

                Logging.AddLog("IQP parameters were set according to configuration file", LogLevel.Activity);
            }
            catch (Exception ex)
            {
                Logging.AddLog("Couldn't load options" + ex.Message, LogLevel.Important, Highlight.Error);
                Logging.AddLog("Exception details: " + ex.ToString(), LogLevel.Debug, Highlight.Error);
            }
        }