示例#1
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);
            }
        }
示例#2
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);
            }
        }
        //public Process MaximDL_Process = new Process();


        public void InitProgramsObj()
        {
            //Cartes du Ciel
            objCdCApp                 = new CdC_ExternatApplication();
            objCdCApp.Name            = "skychart";
            objCdCApp.FullName        = ConfigManagement.getString("programsPath", "CdC") ?? @"c:\Program Files (x86)\Ciel\skychart.exe";
            objCdCApp.ParameterString = "--unique";

            //PHD2
            objPHD2App          = new PHD_ExternatApplication();
            objPHD2App.Name     = "phd2";
            objPHD2App.FullName = ConfigManagement.getString("programsPath", "PHD2") ?? @"c:\Program Files (x86)\PHDGuiding2\phd2.exe";

            //PHDBroker
            objPHDBrokerApp      = new PHDBroker_ExternatApplication();
            objPHDBrokerApp.Name = "PHDBroker_Server";
            //objPHDBrokerApp.FullName = PHDBrokerPath;
            objPHDBrokerApp.FullName = ConfigManagement.getString("programsPath", "PHDBROKER") ?? @"c:\Users\Emchenko Boris\Documents\CCDWare\CCDAutoPilot5\Scripts\PHDBroker_Server.exe";

            //CCDAP
            objCCDAPApp          = new CCDAP_ExternatApplication();
            objCCDAPApp.Name     = "CCDAutoPilot5";
            objCCDAPApp.FullName = ConfigManagement.getString("programsPath", "CCDAP") ?? @"c:\Program Files (x86)\CCDWare\CCDAutoPilot5\CCDAutoPilot5.exe";
            objCCDAPApp.LogPath  = ConfigManagement.getString("programsPath", "CCDAP_Logs") ?? @"c:\Users\Emchenko Boris\Documents\CCDWare\CCDAutoPilot5\Images\CCDAutoPilot_Logs";

            //CCDC
            objCCDCApp                 = new CCDC_ExternatApplication(this);
            objCCDCApp.Name            = "CCDCommander";
            objCCDCApp.FullName        = ConfigManagement.getString("programsPath", "CCDC") ?? @"c:\CCD Commander\CCDCommander.exe";
            objCCDCApp.LogPath         = ConfigManagement.getString("programsPath", "CCDC_Logs") ?? @"c:\CCD Commander\Logs";
            objCCDCApp.ActionsPath     = ConfigManagement.getString("programsPath", "CCDC_Actions") ?? @"c:\CCD Commander\Actions";
            objCCDCApp.ParameterString = objCCDCApp.GetLastActionFile().FullName;

            objCCDCApp.StartGuideScript = ConfigManagement.getString("programsPath", "PHDBrokerGuideStart") ?? @"c:\CCD Commander\auto.vbs";


            //FocusMax
            //objFocusMaxApp = new FocusMax_ExternalApplication(this);
            //objFocusMaxApp.Name = "FocusMax";
            //objFocusMaxApp.FullName = ConfigManagement.getString("programsPath", "FOCUSMAX") ?? @"c:\Program Files (x86)\FocusMax\FocusMax.exe";

            //MaxIm_DL
            objMaxim          = new Maxim_ExternalApplication(this);
            objMaxim.Name     = "MaxIm_DL";
            objMaxim.FullName = ConfigManagement.getString("programsPath", "MAXIMDL") ?? @"c:\Program Files (x86)\Diffraction Limited\MaxIm DL V5\MaxIm_DL.exe";

            //WeatherStation
            objWSApp          = new WeatherStation();
            objWSApp.Name     = "WeatherStation";
            objWSApp.FullName = ConfigManagement.getString("programsPath", "WS") ?? @"C:\Users\Emchenko\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Astromania.info\WeatherStation Monitor.appref-ms";

            //TelescopeTempControl
            objTTCApp          = new TelescopeTempControl();
            objTTCApp.Name     = "TelescopeTempControl";
            objTTCApp.FullName = ConfigManagement.getString("programsPath", "TTC") ?? @"C:\Users\Emchenko\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Astromania.info\TelescopeTempControl.appref-ms";

            //Astrotortilla
            objAstroTortilla                = new AstroTortilla();
            objAstroTortilla.Name           = "Astrotortilla";
            objAstroTortilla.FullName       = ConfigManagement.getString("programsPath", "ASTROTORTILLA") ?? @"c:\Program Files (x86)\AstroTortilla\AstroTortilla.exe";
            objAstroTortilla.FullNameAutoIt = ConfigManagement.getString("programsPath", "ASTROTORTILLA_AUTOIT") ?? @"c:\Program Files (x86)\AstroTortilla\astrotortilla_solve.exe";
        }