Commit 66cc9577 authored by marc's avatar marc
Browse files

completed Popen CLI, but now endless loop

parent 40b9848d
......@@ -18,7 +18,6 @@ from ui.dtobswindow import Ui_mainWindow
from telescope import telescope
from astropy import units as u
from astropy.coordinates import SkyCoord
from docutils.nodes import option
'''
Setup logging
......@@ -187,7 +186,7 @@ class DTObservationProgram(Ui_mainWindow):
Dumping data into file including meta-data
measProgramm: cli command read from comboBoxProgramma
integrationTime: string read from spinBoxIntTime
measprog: result of measurement of which
measurement: result of measurement of which
data: is the stdout result which need to be stored line by line
measFile: result file stroing the stdout results including meta data
"""
......@@ -204,15 +203,17 @@ class DTObservationProgram(Ui_mainWindow):
measFile.write("#Dec: xyz\n")
measFile.write("#Integration time: " + str(integrationTime) + "\n")
measFile.write("#Programme: " + measProgramme + "\n")
self.measprog = subprocess.Popen([measProgramme, str(integrationTime)], stdout=subprocess.PIPE)
measCLI = measProgramme +" "+ str(integrationTime)
logging.info(measCLI)
print(measCLI)
self.measurement = subprocess.Popen(measProgramme, stdout=subprocess.PIPE)
for sec in range(integrationTime):
remainstring = str(int((integrationTime-sec)/60)) + ":"
remainstring += "{:02}".format((integrationTime-sec)%60)
progressSignal.emit(measnum, int(float(sec)/integrationTime*100), remainstring)
time.sleep(1)
self.measprog.wait()
measResults = self.measprog.stdout
self.measurement.wait()
measResults = self.measurement.stdout
""" Write results into file"""
for line in measResults:
......
Markdown is supported
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