Commit bfcfd5a7 authored by marc's avatar marc
Browse files

initial test, but metaDate in wrong order

parent 148b7e74
...@@ -87,11 +87,16 @@ class DTObservationProgram(Ui_mainWindow): ...@@ -87,11 +87,16 @@ class DTObservationProgram(Ui_mainWindow):
def __init__(self, mainWindow): def __init__(self, mainWindow):
logger.info('Initialization of DTObsGUI') logger.info('Initialization of DTObsGUI')
#self.myDT = telescope(setmode='J2000', consoleHost='consoledemo.dmz.camras.nl') self.myDT = telescope(setmode='J2000', consoleHost='consoledemo.dmz.camras.nl')
self.myMeas = Measurements() self.myMeas = Measurements()
self.myMetaData = MetaData() self.myMetaData = MetaData()
self.radec = None self.radec = None
self.measProgramma = None
self.integrationTime = None
self.outputDir = None
self.outputFile = None
Ui_mainWindow.__init__(self) Ui_mainWindow.__init__(self)
self.setupUi(mainWindow) self.setupUi(mainWindow)
self.actionOpen.triggered.connect(self.openFileNameDialog) self.actionOpen.triggered.connect(self.openFileNameDialog)
...@@ -212,18 +217,18 @@ class DTObservationProgram(Ui_mainWindow): ...@@ -212,18 +217,18 @@ class DTObservationProgram(Ui_mainWindow):
self.myMetaData.operator1 = self.lineEditOperator1.text() self.myMetaData.operator1 = self.lineEditOperator1.text()
self.myMetaData.operator2 = self.lineEditOperator2.text() self.myMetaData.operator2 = self.lineEditOperator2.text()
self.myMetaData.operator3 = self.lineEditOperator3.text() self.myMetaData.operator3 = self.lineEditOperator3.text()
self.myMetaData.tool = measProgrammel self.myMetaData.tool = self.measProgramme
self.myMetaData.integrationTime = intgrationTime self.myMetaData.integrationTime = self.integrationTime
self.myMetaData.outputDirectory = outputDir self.myMetaData.outputDirectory = self.outputDir
self.myMetaData.outputFile = outputFile self.myMetaData.outputFile = self.outputFile
self.myMetaData.RaDEC = self.radec self.myMetaData.RaDEC = self.radec
self.myMetaData.refactionEnabled = self.checkBoxRefractionEnabled.checkStateSet() self.myMetaData.refactionEnabled = self.checkBoxRefractionEnabled.checkStateSet()
self.myMetaData.refactionEnabled = self.checkBoxDTModelEnabled.checkStateSet() self.myMetaData.DTModelEnabled = self.checkBoxDTModel.checkStateSet()
def writeMetaData(self,file): def writeMetaData(self,file):
for key, value in myData.getMetaData().items(): for key, value in self.myMetaData.getMetaData().items():
file.write(str(line)) file.write('#' + str(key) + '\t' + str(value) + '\n')
logging.info('#key: {}\t value: {}'.format(k,v)) logging.info('#key: {}\t value: {}'.format(key,value))
def doMeasurement(self, measnum, progressSignal=None): def doMeasurement(self, measnum, progressSignal=None):
""" """
...@@ -234,23 +239,23 @@ class DTObservationProgram(Ui_mainWindow): ...@@ -234,23 +239,23 @@ class DTObservationProgram(Ui_mainWindow):
data: is the stdout result which need to be stored line by line data: is the stdout result which need to be stored line by line
measFile: result file storing the stdout results including meta data measFile: result file storing the stdout results including meta data
""" """
integrationTime = self.spinBoxIntTime.value() self.integrationTime = self.spinBoxIntTime.value()
measProgramme = self.comboBoxProgramma.currentText() self.measProgramme = self.comboBoxProgramma.currentText()
outputDir = self.lineEditOutputDir.text() self.outputDir = self.lineEditOutputDir.text()
outputFile = '/DT-' + '{:03d}'.format(measnum) + '-' + time.strftime("%Y%m%d") + '.dat' self.outputFile = '/DT-' + '{:03d}'.format(measnum) + '-' + time.strftime("%Y%m%d") + '.dat'
measFile = open(outputDir + outputFile,'w') measFile = open(self.outputDir + self.outputFile,'w')
self.setMetaData(self) self.setMetaData()
self.writeMetaData(self,measFile) self.writeMetaData(measFile)
logging.info("Output to file: {}".format(measFile)) logging.info("Output to file: {}".format(measFile))
self.myMeas.startMeasurement(measProgramme, integrationTime, measFile) self.myMeas.startMeasurement(self.measProgramme, self.integrationTime, measFile)
for sec in range(integrationTime): for sec in range(self.integrationTime):
remainstring = str(int((integrationTime-sec)/60)) + ":" remainstring = str(int((self.integrationTime-sec)/60)) + ":"
remainstring += "{:02}".format((integrationTime-sec)%60) remainstring += "{:02}".format((self.integrationTime-sec)%60)
progressSignal.emit(measnum, int(float(sec)/integrationTime*100), remainstring) progressSignal.emit(measnum, int(float(sec)/self.integrationTime*100), remainstring)
time.sleep(1) time.sleep(1)
measFile.close() measFile.close()
......
...@@ -119,9 +119,9 @@ class Ui_mainWindow(object): ...@@ -119,9 +119,9 @@ class Ui_mainWindow(object):
self.lineEditOperator1 = QtWidgets.QLineEdit(self.gridLayoutWidget_2) self.lineEditOperator1 = QtWidgets.QLineEdit(self.gridLayoutWidget_2)
self.lineEditOperator1.setObjectName("lineEditOperator1") self.lineEditOperator1.setObjectName("lineEditOperator1")
self.gridLayout_3.addWidget(self.lineEditOperator1, 0, 1, 1, 1) self.gridLayout_3.addWidget(self.lineEditOperator1, 0, 1, 1, 1)
self.lineEditoperator2 = QtWidgets.QLineEdit(self.gridLayoutWidget_2) self.lineEditOperator2 = QtWidgets.QLineEdit(self.gridLayoutWidget_2)
self.lineEditoperator2.setObjectName("lineEditoperator2") self.lineEditOperator2.setObjectName("lineEditOperator2")
self.gridLayout_3.addWidget(self.lineEditoperator2, 1, 1, 1, 1) self.gridLayout_3.addWidget(self.lineEditOperator2, 1, 1, 1, 1)
self.lineEditOperator3 = QtWidgets.QLineEdit(self.gridLayoutWidget_2) self.lineEditOperator3 = QtWidgets.QLineEdit(self.gridLayoutWidget_2)
self.lineEditOperator3.setObjectName("lineEditOperator3") self.lineEditOperator3.setObjectName("lineEditOperator3")
self.gridLayout_3.addWidget(self.lineEditOperator3, 2, 1, 1, 1) self.gridLayout_3.addWidget(self.lineEditOperator3, 2, 1, 1, 1)
......
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="lineEditoperator2"/> <widget class="QLineEdit" name="lineEditOperator2"/>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLineEdit" name="lineEditOperator3"/> <widget class="QLineEdit" name="lineEditOperator3"/>
......
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