Commit 4f79d184 authored by marc's avatar marc
Browse files

added demo parameter to ignore telescope class and extended metadata

parent c5491a31
......@@ -88,6 +88,9 @@ class DTObservationProgram(Ui_mainWindow):
def __init__(self, mainWindow):
logger.info('Initialization of DTObsGUI')
self.demo = config.getboolean('TestConfig','demo')
logging.debug('Demo status is: {}'.format(self.demo))
if self.demo == False:
self.myDT = telescope(setmode='J2000', consoleHost='consoledemo.dmz.camras.nl')
self.myMeas = Measurements()
......@@ -136,6 +139,7 @@ class DTObservationProgram(Ui_mainWindow):
self.inputFile,_ = QFileDialog.getOpenFileName(None, 'Open File', "templates","Meas Files (*.dat);;All Files (*)")
if self.inputFile:
self.loadPointingsInTable(self.inputFile)
logging.info('Selected data file is: {}'.format(self.inputFile))
def loadPointingsInTable(self,fileName):
reader = csv.reader(open(self.inputFile),delimiter='\t')
......@@ -195,6 +199,7 @@ class DTObservationProgram(Ui_mainWindow):
def goToSetpoints(self, setpoints, oneSetpointCompleteSignal=None, progressSignal=None):
""" Send a list of setpoints to the telescope """
for setpoint_nr, setpoint in enumerate(setpoints):
if self.demo == False:
self.myDT.setRaDec(setpoint)
oneSetpointCompleteSignal.emit(setpoint_nr, 'Slewing')
time.sleep(3)
......@@ -236,7 +241,11 @@ class DTObservationProgram(Ui_mainWindow):
self.myMetaData.integrationTime = self.integrationTime
self.myMetaData.outputDirectory = self.outputDir
self.myMetaData.outputFile = self.outputFile
self.myMetaData.RaDEC = self.radec
self.myMetaData.radecSetpoint = self.radec
self.myMetaData.radecActual = self.radec
'''
TODO: read radec Actual from telescope class
'''
self.myMetaData.refractionEnabled = self.checkBoxRefraction.isChecked()
logging.debug('checkBoxRefraction Setting is {}:'.format(self.checkBoxRefraction.isChecked()))
self.myMetaData.DTModelEnabled = self.checkBoxDTModel.isChecked()
......
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