Commit 25c6335a authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Moving post capture script to sequence queue where it belongs

parent e9a3db10
......@@ -1005,11 +1005,10 @@ bool Capture::setCaptureComplete()
if (checkMeridianFlip())
return true;
// FIXME remove post capture script later
if (Options::postCaptureScript().isEmpty() == false)
if (activeJob->getPostCaptureScript().isEmpty() == false)
{
postCaptureScript.start(Options::postCaptureScript());
appendLogText(i18n("Executing post capture script %1", Options::postCaptureScript()));
postCaptureScript.start(activeJob->getPostCaptureScript());
appendLogText(i18n("Executing post capture script %1", activeJob->getPostCaptureScript()));
}
else
resumeSequence();
......@@ -1472,6 +1471,7 @@ void Capture::addJob(bool preview)
job->setCaptureFilter((FITSScale) filterCombo->currentIndex());
job->setPostCaptureScript(postCaptureScriptIN->text());
job->setFlatFieldDuration(flatFieldDuration);
job->setFlatFieldSource(flatFieldSource);
job->setPreMountPark(preMountPark);
......@@ -2261,6 +2261,10 @@ bool Capture::processJobInfo(XMLEle *root)
{
delayIN->setValue(atoi(pcdataXMLEle(ep)));
}
else if (!strcmp(tagXMLEle(ep), "PostCaptureScript"))
{
postCaptureScriptIN->setText(pcdataXMLEle(ep));
}
else if (!strcmp(tagXMLEle(ep), "FITSDirectory"))
{
fitsDir->setText(pcdataXMLEle(ep));
......@@ -2424,7 +2428,7 @@ bool Capture::saveSequenceQueue(const QString &path)
QTextStream outstream(&file);
outstream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
outstream << "<SequenceQueue version='1.3'>" << endl;
outstream << "<SequenceQueue version='1.4'>" << endl;
outstream << "<GuideDeviation enabled='" << (guideDeviationCheck->isChecked() ? "true" : "false") << "'>" << guideDeviation->value() << "</GuideDeviation>" << endl;
outstream << "<Autofocus enabled='" << (autofocusCheck->isChecked() ? "true" : "false") << "'>" << HFRPixels->value() << "</Autofocus>" << endl;
outstream << "<MeridianFlip enabled='" << (meridianCheck->isChecked() ? "true" : "false") << "'>" << meridianHours->value() << "</MeridianFlip>" << endl;
......@@ -2461,6 +2465,8 @@ bool Capture::saveSequenceQueue(const QString &path)
outstream << "<Count>" << job->getCount() << "</Count>" << endl;
// ms to seconds
outstream << "<Delay>" << job->getDelay()/1000 << "</Delay>" << endl;
if (job->getPostCaptureScript().isEmpty() == false)
outstream << "<PostCaptureScript>" << job->getPostCaptureScript() << "</PostCaptureScript>" << endl;
QString rootDir = job->getRootFITSDir();
outstream << "<FITSDirectory>" << rootDir << "</FITSDirectory>" << endl;
if (job->getISOIndex() != -1)
......@@ -2553,6 +2559,7 @@ void Capture::syncGUIToJob(SequenceJob *job)
ISOCheck->setChecked(tsEnabled);
countIN->setValue(job->getCount());
delayIN->setValue(job->getDelay()/1000);
postCaptureScriptIN->setText(job->getPostCaptureScript());
// Temperature Options
temperatureCheck->setChecked(job->getEnforceTemperature());
......
This diff is collapsed.
......@@ -388,6 +388,16 @@ void SequenceJob::setFilterPostFocusReady(bool value)
}
}
QString SequenceJob::getPostCaptureScript() const
{
return postCaptureScript;
}
void SequenceJob::setPostCaptureScript(const QString &value)
{
postCaptureScript = value;
}
int SequenceJob::getISOIndex() const
{
return isoIndex;
......
......@@ -144,6 +144,9 @@ class SequenceJob : public QObject
bool getFilterPostFocusReady() const;
void setFilterPostFocusReady(bool value);
QString getPostCaptureScript() const;
void setPostCaptureScript(const QString &value);
signals:
void prepareComplete();
void checkFocus();
......@@ -179,6 +182,7 @@ private:
QTableWidgetItem *statusCell;
QString fitsDir;
QString rootFITSDir;
QString postCaptureScript;
bool typePrefixEnabled, filterPrefixEnabled, expPrefixEnabled, timeStampPrefixEnabled;
QString rawPrefix;
......
......@@ -73,8 +73,8 @@ void OpsGuide::slotLoadSettings(Guide::GuiderType guiderType)
LinGuiderR->setChecked(true);
externalHost->setEnabled(true);
externalPort->setEnabled(true);
externalHost->setText(Options::lINGuiderHost());
externalPort->setText(QString::number(Options::lINGuiderPort()));
externalHost->setText(Options::linGuiderHost());
externalPort->setText(QString::number(Options::linGuiderPort()));
break;
}
}
......@@ -100,8 +100,8 @@ void OpsGuide::slotApply()
case Guide::GUIDE_LINGUIDER:
type = Guide::GUIDE_LINGUIDER;
Options::setGuiderType(Guide::GUIDE_LINGUIDER);
Options::setLINGuiderHost(externalHost->text());
Options::setLINGuiderPort(externalPort->text().toInt());
Options::setLinGuiderHost(externalHost->text());
Options::setLinGuiderPort(externalPort->text().toInt());
break;
}
......
......@@ -14,7 +14,7 @@
<string>TabWidget</string>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="generalTab">
<attribute name="title">
......@@ -333,20 +333,6 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Post Capture Script</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="kcfg_PostCaptureScript"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
......@@ -557,7 +543,4 @@
</widget>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="guideButtonGroup"/>
</buttongroups>
</ui>
......@@ -1434,9 +1434,6 @@
<label>Perform auto stretch on captured images in FITS Viewer.</label>
<default>true</default>
</entry>
<entry name="PostCaptureScript" type="String">
<label>Script to execute after an image is captured. The capture process halts until the script is complete.</label>
</entry>
</group>
<group name="Focus">
<entry name="DefaultFocusCCD" type="String">
......@@ -1605,11 +1602,11 @@
<label>PHD2 Event Monitoring Port</label>
<default>4400</default>
</entry>
<entry name="LINGuiderHost" type="String">
<entry name="LinGuiderHost" type="String">
<label>Host name of external lin_guider service</label>
<default>localhost</default>
</entry>
<entry name="LINGuiderPort" type="UInt">
<entry name="LinGuiderPort" type="UInt">
<label>Lin_guider Event Monitoring Port</label>
<default>5656</default>
</entry>
......
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