summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Eriksen <mag.w.eriksen@gmail.com>2016-08-19 19:44:01 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-19 19:44:01 (GMT)
commita29536ce3a2e40ef08794915c203bf0dfc4c9d07 (patch)
treee9a869494598e868803bb2802ca317679825bf2e
parenta57eadaf5454c489876e9893ddc51824417bfb0c (diff)
Change SOURCE_DUSTCAP to SOURCE_FLATCAP and SOURCE_DARKCAP in Ekos capture
REVIEW:128718
-rw-r--r--kstars/ekos/calibrationoptions.ui17
-rw-r--r--kstars/ekos/capture.cpp109
-rw-r--r--kstars/ekos/capture.h2
-rw-r--r--kstars/indi/indicommon.h2
4 files changed, 115 insertions, 15 deletions
diff --git a/kstars/ekos/calibrationoptions.ui b/kstars/ekos/calibrationoptions.ui
index 82a6e13..d7411a2 100644
--- a/kstars/ekos/calibrationoptions.ui
+++ b/kstars/ekos/calibrationoptions.ui
@@ -39,12 +39,22 @@
</widget>
</item>
<item>
- <widget class="QRadioButton" name="deviceSourceC">
+ <widget class="QRadioButton" name="flatDeviceSourceC">
<property name="toolTip">
<string>For dark and bias frames, close the dust cap before proceeding. For flat frames, close the dust cap and turn on the light source.</string>
</property>
<property name="text">
- <string>Dust Cover</string>
+ <string>Dust Cover with Built-in Flat Light</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="darkDeviceSourceC">
+ <property name="toolTip">
+ <string>For dark and bias frames, close the dust cap before proceeding. For flat frames, open the dust cap and turn on the light source.</string>
+ </property>
+ <property name="text">
+ <string>Dust Cover with External Flat Light</string>
</property>
</widget>
</item>
@@ -219,7 +229,8 @@
</customwidgets>
<tabstops>
<tabstop>manualSourceC</tabstop>
- <tabstop>deviceSourceC</tabstop>
+ <tabstop>flatDeviceSourceC</tabstop>
+ <tabstop>darkDeviceSourceC</tabstop>
<tabstop>wallSourceC</tabstop>
<tabstop>azBox</tabstop>
<tabstop>altBox</tabstop>
diff --git a/kstars/ekos/capture.cpp b/kstars/ekos/capture.cpp
index aab8330..dd945bf 100644
--- a/kstars/ekos/capture.cpp
+++ b/kstars/ekos/capture.cpp
@@ -2103,8 +2103,10 @@ bool Capture::processJobInfo(XMLEle *root)
{
if (!strcmp(pcdataXMLEle(typeEP), "Manual"))
flatFieldSource = SOURCE_MANUAL;
- else if (!strcmp(pcdataXMLEle(typeEP), "DustCap"))
- flatFieldSource = SOURCE_DUSTCAP;
+ else if (!strcmp(pcdataXMLEle(typeEP), "FlatCap"))
+ flatFieldSource = SOURCE_FLATCAP;
+ else if (!strcmp(pcdataXMLEle(typeEP), "DarkCap"))
+ flatFieldSource = SOURCE_DARKCAP;
else if (!strcmp(pcdataXMLEle(typeEP), "Wall"))
{
XMLEle *azEP=NULL, *altEP=NULL;
@@ -2291,8 +2293,10 @@ bool Capture::saveSequenceQueue(const QString &path)
outstream << "<FlatSource>" << endl;
if (job->getFlatFieldSource() == SOURCE_MANUAL)
outstream << "<Type>Manual</Type>" << endl;
- else if (job->getFlatFieldSource() == SOURCE_DUSTCAP)
- outstream << "<Type>DustCap</Type>" << endl;
+ else if (job->getFlatFieldSource() == SOURCE_FLATCAP)
+ outstream << "<Type>FlatCap</Type>" << endl;
+ else if (job->getFlatFieldSource() == SOURCE_DARKCAP)
+ outstream << "<Type>DarkCap</Type>" << endl;
else if (job->getFlatFieldSource() == SOURCE_WALL)
{
outstream << "<Type>Wall</Type>" << endl;
@@ -3082,8 +3086,12 @@ void Capture::openCalibrationDialog()
calibrationOptions.manualSourceC->setChecked(true);
break;
- case SOURCE_DUSTCAP:
- calibrationOptions.deviceSourceC->setChecked(true);
+ case SOURCE_FLATCAP:
+ calibrationOptions.flatDeviceSourceC->setChecked(true);
+ break;
+
+ case SOURCE_DARKCAP:
+ calibrationOptions.darkDeviceSourceC->setChecked(true);
break;
case SOURCE_WALL:
@@ -3113,8 +3121,10 @@ void Capture::openCalibrationDialog()
{
if (calibrationOptions.manualSourceC->isChecked())
flatFieldSource = SOURCE_MANUAL;
- else if (calibrationOptions.deviceSourceC->isChecked())
- flatFieldSource = SOURCE_DUSTCAP;
+ else if (calibrationOptions.flatDeviceSourceC->isChecked())
+ flatFieldSource = SOURCE_FLATCAP;
+ else if (calibrationOptions.darkDeviceSourceC->isChecked())
+ flatFieldSource = SOURCE_DARKCAP;
else if (calibrationOptions.wallSourceC->isChecked())
{
dms wallAz, wallAlt;
@@ -3171,7 +3181,7 @@ IPState Capture::processPreCaptureCalibrationStage()
// Park cap, if not parked
// Turn on Light
- case SOURCE_DUSTCAP:
+ case SOURCE_FLATCAP:
if (dustCap)
{
// If cap is not park, park it
@@ -3217,7 +3227,86 @@ IPState Capture::processPreCaptureCalibrationStage()
}
break;
- // Go to wall coordinates
+
+ // Park cap, if not parked and not flat frame
+ // Unpark cap, if flat frame
+ // Turn on Light
+ case SOURCE_DARKCAP:
+ if (dustCap)
+ {
+ // If cap is not park, park it if not flat frame. (external lightsource)
+ if (calibrationStage < CAL_DUSTCAP_PARKING && dustCap->isParked() == false && activeJob->getFrameType() != FRAME_FLAT)
+ {
+ if (dustCap->Park())
+ {
+ calibrationStage = CAL_DUSTCAP_PARKING;
+ appendLogText(i18n("Parking dust cap..."));
+ return IPS_BUSY;
+ }
+ else
+ {
+ appendLogText(i18n("Parking dust cap failed, aborting..."));
+ abort();
+ return IPS_ALERT;
+ }
+ }
+
+ // Wait until cap is parked
+ if (calibrationStage == CAL_DUSTCAP_PARKING)
+ {
+ if (dustCap->isParked() == false)
+ return IPS_BUSY;
+ else
+ {
+ calibrationStage = CAL_DUSTCAP_PARKED;
+ appendLogText(i18n("Dust cap parked."));
+ }
+ }
+
+ // If cap is parked, unpark it if flat frame. (external lightsource)
+ if (calibrationStage < CAL_DUSTCAP_UNPARKING && dustCap->isParked() == true && activeJob->getFrameType() == FRAME_FLAT)
+ {
+ if (dustCap->UnPark())
+ {
+ calibrationStage = CAL_DUSTCAP_UNPARKING;
+ appendLogText(i18n("UnParking dust cap..."));
+ return IPS_BUSY;
+ }
+ else
+ {
+ appendLogText(i18n("UnParking dust cap failed, aborting..."));
+ abort();
+ return IPS_ALERT;
+ }
+ }
+
+ // Wait until cap is parked
+ if (calibrationStage == CAL_DUSTCAP_UNPARKING)
+ {
+ if (dustCap->isParked() == true)
+ return IPS_BUSY;
+ else
+ {
+ calibrationStage = CAL_DUSTCAP_UNPARKED;
+ appendLogText(i18n("Dust cap unparked."));
+ }
+ }
+
+ // If light is not on, turn it on. For flat frames only
+ if (activeJob->getFrameType() == FRAME_FLAT && dustCap->isLightOn() == false)
+ {
+ dustCapLightEnabled = true;
+ dustCap->SetLightEnabled(true);
+ }
+ else if (activeJob->getFrameType() != FRAME_FLAT && dustCap->isLightOn() == true)
+ {
+ dustCapLightEnabled = false;
+ dustCap->SetLightEnabled(false);
+ }
+ }
+ break;
+
+ // Go to wall coordinates
case SOURCE_WALL:
if (currentTelescope)
{
diff --git a/kstars/ekos/capture.h b/kstars/ekos/capture.h
index 8cc12a0..9d87c26 100644
--- a/kstars/ekos/capture.h
+++ b/kstars/ekos/capture.h
@@ -83,7 +83,7 @@ public:
enum { CALIBRATE_NONE, CALIBRATE_START, CALIBRATE_DONE };
typedef enum { MF_NONE, MF_INITIATED, MF_FLIPPING, MF_SLEWING, MF_ALIGNING, MF_GUIDING } MFStage;
- typedef enum { CAL_NONE, CAL_DUSTCAP_PARKING, CAL_DUSTCAP_PARKED, CAL_LIGHTBOX_ON, CAL_SLEWING, CAL_SLEWING_COMPLETE, CAL_MOUNT_PARKING, CAL_MOUNT_PARKED, CAL_DOME_PARKING, CAL_DOME_PARKED, CAL_PRECAPTURE_COMPLETE, CAL_CALIBRATION, CAL_CALIBRATION_COMPLETE, CAL_CAPTURING} CalibrationStage;
+ typedef enum { CAL_NONE, CAL_DUSTCAP_PARKING, CAL_DUSTCAP_PARKED, CAL_LIGHTBOX_ON, CAL_SLEWING, CAL_SLEWING_COMPLETE, CAL_MOUNT_PARKING, CAL_MOUNT_PARKED, CAL_DOME_PARKING, CAL_DOME_PARKED, CAL_PRECAPTURE_COMPLETE, CAL_CALIBRATION, CAL_CALIBRATION_COMPLETE, CAL_CAPTURING, CAL_DUSTCAP_UNPARKING, CAL_DUSTCAP_UNPARKED} CalibrationStage;
Capture();
~Capture();
diff --git a/kstars/indi/indicommon.h b/kstars/indi/indicommon.h
index cee63f3..906ed34 100644
--- a/kstars/indi/indicommon.h
+++ b/kstars/indi/indicommon.h
@@ -147,7 +147,7 @@ typedef enum { SINGLE_BIN, DOUBLE_BIN, TRIPLE_BIN,QUADRAPLE_BIN} CCDBinType;
typedef enum { INDI_SEND_COORDS, INDI_ENGAGE_TRACKING, INDI_SET_PORT, INDI_CONNECT, INDI_DISCONNECT, INDI_SET_FILTER} DeviceCommand;
-typedef enum { SOURCE_MANUAL, SOURCE_DUSTCAP, SOURCE_WALL, SOURCE_DAWN_DUSK } FlatFieldSource;
+typedef enum { SOURCE_MANUAL, SOURCE_FLATCAP, SOURCE_WALL, SOURCE_DAWN_DUSK, SOURCE_DARKCAP } FlatFieldSource;
typedef enum { DURATION_MANUAL, DURATION_ADU } FlatFieldDuration;