summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-28 10:04:15 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-28 10:04:15 (GMT)
commit22e7fe356e902bc69b1e3b3e988677bb04be6ca1 (patch)
tree2bb8d2b2d8835f268cda4e6e4b7dbcd9492b8878
parent13c10740057b9a8feddacf51d8e8f16b09263fef (diff)
Add temporary post capture script
-rw-r--r--kstars/ekos/capture.cpp17
-rw-r--r--kstars/ekos/capture.h7
-rw-r--r--kstars/ekos/opsekos.ui20
-rw-r--r--kstars/kstars.kcfg3
4 files changed, 43 insertions, 4 deletions
diff --git a/kstars/ekos/capture.cpp b/kstars/ekos/capture.cpp
index 202c0d9..958f92d 100644
--- a/kstars/ekos/capture.cpp
+++ b/kstars/ekos/capture.cpp
@@ -189,6 +189,9 @@ Capture::Capture()
connect(meridianHours, SIGNAL(valueChanged(double)), this, SLOT(setDirty()));
connect(parkCheck, SIGNAL(toggled(bool)), this, SLOT(setDirty()));
+
+ // FIXME remove this later
+ connect(&postCaptureScript, SIGNAL(finished(int)), this, SLOT(postScriptFinished(int)));
}
Capture::~Capture()
@@ -866,7 +869,14 @@ void Capture::newFITS(IBLOB *bp)
if (checkMeridianFlip())
return;
- resumeSequence();
+ // FIXME remove post capture script later
+ if (Options::postCaptureScript().isEmpty() == false)
+ {
+ postCaptureScript.start(Options::postCaptureScript());
+ appendLogText(i18n("Executing post capture script %1", Options::postCaptureScript()));
+ }
+ else
+ resumeSequence();
}
void Capture::processJobCompletion()
@@ -3564,5 +3574,10 @@ void Capture::startPostFilterAutoFocus()
emit checkFocus(0.1);
}
+void Capture::postScriptFinished(int exitCode)
+{
+ appendLogText(i18n("Post capture script finished with code %1. Resuming sequence...", exitCode));
+ resumeSequence();
+}
}
diff --git a/kstars/ekos/capture.h b/kstars/ekos/capture.h
index c52da35..8c8214e 100644
--- a/kstars/ekos/capture.h
+++ b/kstars/ekos/capture.h
@@ -425,6 +425,9 @@ private slots:
// Send image info
void sendNewImage(QImage *image, ISD::CCDChip *myChip);
+ // Temporary for post capture script
+ void postScriptFinished(int exitCode);
+
signals:
void newLog();
void exposureComplete();
@@ -547,6 +550,10 @@ private:
bool ignoreJobProgress;
+ // Temporary Only
+ QProcess postCaptureScript;
+
+
};
}
diff --git a/kstars/ekos/opsekos.ui b/kstars/ekos/opsekos.ui
index d61c681..15a47e7 100644
--- a/kstars/ekos/opsekos.ui
+++ b/kstars/ekos/opsekos.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>502</width>
- <height>444</height>
+ <height>470</height>
</rect>
</property>
<property name="windowTitle">
@@ -84,7 +84,7 @@
<attribute name="title">
<string>Modules</string>
</attribute>
- <layout class="QVBoxLayout" name="verticalLayout_8">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
@@ -152,7 +152,7 @@
<property name="title">
<string>Capture</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_5">
+ <layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
@@ -240,6 +240,20 @@
</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>
</layout>
</widget>
</item>
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 3b2013a..674bdd1 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1401,6 +1401,9 @@
<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">