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