/// <summary> /// Test PHD CONNECT /// </summary> /// <returns></returns> internal TestResultClass TestPHD2Connect() { TestResultClass TestResult = new TestResultClass(); TestResult.res = false; TestResult.AddStr("TestEquipment: PHD2 connect test started"); //run test Thread.Sleep(ConfigManagement.getInt("scenarioMainParams", "PHD_CONNECT_PAUSE") ?? 300); //wait a bit string stout = ""; string res = ObsControl.objPHD2App.CMD_GetCurrentProfile(); //check result try { if (res != String.Empty) { TestResult.AddStr("TestEquipment: phd2 equipment list: " + res + ""); TestResult.res = true; TestResult.AddStr("TestEquipment: PHD2 connect test passed"); } else { TestResult.AddStr("TestEquipment: PHD2 connect failed"); } } catch (Exception Ex) { TestResult.AddStr("TestEquipment: PHD2 connect test failed"); } return(TestResult); }
private void linkPHD2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { ObsControl.CommandParser.ParseSingleCommand2("PHD2_RUN"); Thread.Sleep(ConfigManagement.getInt("scenarioMainParams", "PHD_CONNECT_PAUSE") ?? 0); ObsControl.CommandParser.ParseSingleCommand2("PHD2_CONNECT"); }
/// <summary> /// Init observatory activity. OBSOLETE /// </summary> public void StartUpObservatory_old() { //1. Switch on power if (ConfigManagement.getBool("scenarioMainParams", "POWER_ON") ?? false) { Logging.AddLog("StartUp run: Switching power on", LogLevel.Debug); CommandParser.ParseSingleCommand2("POWER_MOUNT_ON"); CommandParser.ParseSingleCommand2("POWER_CAMERA_ON"); CommandParser.ParseSingleCommand2("POWER_FOCUSER_ON"); } //2.1 Run PHD2 if (ConfigManagement.getBool("scenarioMainParams", "PHD2_RUN") ?? false) { Logging.AddLog("StartUp run: Start PHD2", LogLevel.Debug); CommandParser.ParseSingleCommand2("PHD2_RUN"); } Thread.Sleep(ConfigManagement.getInt("scenarioMainParams", "PHD_CONNECT_PAUSE") ?? 300); //2.2 PHD2 Connect equipment if (ConfigManagement.getBool("scenarioMainParams", "PHD2_CONNECT") ?? false) { Logging.AddLog("StartUp run: connect equipment in PHD2", LogLevel.Debug); CommandParser.ParseSingleCommand2("PHD2_CONNECT"); } //2.3 Rub broker app if (ConfigManagement.getBool("scenarioMainParams", "PHDBROKER_RUN") ?? false) { Logging.AddLog("StartUp run: run PHD Broker", LogLevel.Debug); CommandParser.ParseSingleCommand2("PHDBROKER_RUN"); } //3. Run MaximDL if (ConfigManagement.getBool("scenarioMainParams", "MAXIM_RUN") ?? false) { Logging.AddLog("StartUp run: Start Maxim DL", LogLevel.Debug); CommandParser.ParseSingleCommand2("MAXIM_RUN"); } //3.1. CameraConnect if (ConfigManagement.getBool("scenarioMainParams", "MAXIM_CAMERA_CONNECT") ?? false) { Logging.AddLog("StartUp run: Maxim Camera connect", LogLevel.Debug); CommandParser.ParseSingleCommand2("MAXIM_CAMERA_CONNECT"); //ParentMainForm.AppendLogText("Camera connected"); } //3.2. Set camera cooler if (ConfigManagement.getBool("scenarioMainParams", "MAXIM_CAMERA_SETCOOLING") ?? false) { CommandParser.ParseSingleCommand2("MAXIM_CAMERA_SETCOOLING"); } //3.3. Connect telescope to Maxim if (ConfigManagement.getBool("scenarioMainParams", "MAXIM_TELESCOPE_CONNECT") ?? false) { CommandParser.ParseSingleCommand2("MAXIM_TELESCOPE_CONNECT"); } //4. Run FocusMax if (ConfigManagement.getBool("scenarioMainParams", "FOCUSMAX_RUN") ?? false) { Logging.AddLog("StartUp run: Start Focus Max", LogLevel.Debug); CommandParser.ParseSingleCommand2("FOCUSMAX_RUN"); //ParentMainForm.AppendLogText("FocusMax started"); } //5. Connect focuser in Maxim to FocusMax if (ConfigManagement.getBool("scenarioMainParams", "MAXIM_FOCUSER_CONNECT") ?? false) { CommandParser.ParseSingleCommand2("MAXIM_FOCUSER_CONNECT"); } //Thread.Sleep(2000); //6. Run Cartes du Ciel if (ConfigManagement.getBool("scenarioMainParams", "CdC_RUN") ?? false) { CommandParser.ParseSingleCommand2("CdC_RUN"); } //8. Start CCDAP if (ConfigManagement.getBool("scenarioMainParams", "CCDAP_RUN") ?? false) { CommandParser.ParseSingleCommand2("CCDAP_RUN"); } //8. Start CCDC if (ConfigManagement.getBool("scenarioMainParams", "CCDC_RUN") ?? false) { CommandParser.ParseSingleCommand2("CCDC_RUN"); } //7. Connect telescope in Program if (ConfigManagement.getBool("scenarioMainParams", "OBS_TELESCOPE_CONNECT") ?? false) { CommandParser.ParseSingleCommand2("OBS_TELESCOPE_CONNECT"); } Thread.Sleep(ConfigManagement.getInt("scenarioMainParams", "CDC_CONNECT_PAUSE") ?? 0); //6.1. Connect telescope in Cartes du Ciel (to give time for CdC to run) if (ConfigManagement.getBool("scenarioMainParams", "CdC_TELESCOPE_CONNECT") ?? false) { CommandParser.ParseSingleCommand2("CdC_TELESCOPE_CONNECT"); } }
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); } }