Commit a29536ce authored by Magnus Eriksen's avatar Magnus Eriksen Committed by Jasem Mutlaq
Browse files

Change SOURCE_DUSTCAP to SOURCE_FLATCAP and SOURCE_DARKCAP in Ekos capture

REVIEW:128718
parent a57eadaf
......@@ -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>
......
......@@ -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)
{
......
......@@ -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();
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment