Commit fd3ae9fc authored by marc's avatar marc

added current setpoint as default setpoint for single shot measument

parent 6d8a3062
......@@ -91,18 +91,44 @@ class DTObservationProgram(Ui_mainWindow):
def __init__(self, mainWindow):
logger.info('Initialization of DTObsGUI')
self.demo = config.getboolean('TestConfig','demo')
if consoleHost is None:
consoleHost = config.get('Console','HostName')
if consoleHost == 'console':
if socket.gethostname()=="mercurius":
logging.warning("You are using the actual console, not a demo!")
else:
raise ValueError("Talking to the actual console can only be done from mercurius")
logger.debug('Demo status is: {}'.format(self.demo))
if not self.demo:
if True or self.actualconsole:
self.myDT = telescope(setmode='J2000', consoleHost='console')
else:
self.myDT = telescope(setmode='J2000', consoleHost='consoledemo.dmz.camras.nl')
self.myDT = telescope(setmode='J2000', consoleHost=consoleHost)
'''
telescopeMode and telescopeOffser required for meta data
'''
self.telescopeMode = 'J2000'
self.telescopeOffset = None
self.telescopeOffset = Non
'''
As part of the init the current setpoint will be loaded as a single shot measurement.
This enables the operator to manually define the setpoint using the Console
'''
self.myDT.setRaDec(self.myDT.getSetpoint_RaDec)
self.radec = SkyCoord(self.myDT.getSetpoint_RaDec)
(raStr, decStr) = self.radec.to_string('hmsdms').split()
self.tableWidgetPointings.insertRow(rowPosition)
self.tableWidgetPointings.setItem(rowPosition, 0, QTableWidgetItem(raStr))
self.tableWidgetPointings.setItem(rowPosition, 1, QTableWidgetItem(decStr))
self.tableWidgetPointings.setItem(rowPosition, 2, QTableWidgetItem(""))
self.tableWidgetPointings.setItem(rowPosition, 3, QTableWidgetItem(""))
else:
self.telescopeMode = None
self.telescopeOffset = None
self.myMeas = Measurements()
self.myMetaData = MetaData()
self.myBackend = Backend(setmode='Pulsar')
......@@ -328,13 +354,13 @@ class DTObservationProgram(Ui_mainWindow):
'''
Read the selected Backend mode from the GUI backend checkbox group
'''
if self.checkBoxPulsar.isChecked():
if self.radioButtonPulsar.isChecked():
self.GUIbackendMode = 'Pulsar'
if self.checkBoxHI.isChecked():
if self.radioButtonHydrogenLine.isChecked():
self.GUIbackendMode = 'Hydrogen'
if self.checkBoxSDR.isChecked():
if self.radioButtonSDR.isChecked():
self.GUIbackendMode = 'SDR'
if self.checkBoxRaw.isChecked():
if self.radioButtonRaw.isChecked():
self.GUIbackendMode = 'Raw'
def startMeasurement(self):
......
......@@ -2,4 +2,9 @@
LogLevel: INFO
[TestConfig]
demo: False
#demo: False
demo: True
[Console]
consoleHost: http://charon.camras.nl/consoledemo
#consoleHost: console
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/dtobswindow.ui'
# Form implementation generated from reading ui file 'dtobswindow.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
......@@ -161,35 +161,26 @@ class Ui_mainWindow(object):
self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.checkBoxPulsar = QtWidgets.QCheckBox(self.groupBox)
self.checkBoxPulsar.setChecked(True)
self.checkBoxPulsar.setAutoExclusive(True)
self.checkBoxPulsar.setObjectName("checkBoxPulsar")
self.verticalLayout.addWidget(self.checkBoxPulsar)
self.checkBoxHI = QtWidgets.QCheckBox(self.groupBox)
self.checkBoxHI.setEnabled(True)
self.checkBoxHI.setChecked(False)
self.checkBoxHI.setAutoExclusive(True)
self.checkBoxHI.setObjectName("checkBoxHI")
self.verticalLayout.addWidget(self.checkBoxHI)
self.checkBoxSDR = QtWidgets.QCheckBox(self.groupBox)
self.checkBoxSDR.setAutoExclusive(True)
self.checkBoxSDR.setObjectName("checkBoxSDR")
self.verticalLayout.addWidget(self.checkBoxSDR)
self.checkBoxRaw = QtWidgets.QCheckBox(self.groupBox)
self.checkBoxRaw.setAutoExclusive(True)
self.checkBoxRaw.setTristate(False)
self.checkBoxRaw.setObjectName("checkBoxRaw")
self.verticalLayout.addWidget(self.checkBoxRaw)
self.radioButtonPulsar = QtWidgets.QRadioButton(self.groupBox)
self.radioButtonPulsar.setObjectName("radioButtonPulsar")
self.verticalLayout.addWidget(self.radioButtonPulsar)
self.radioButtonHydrogenLine = QtWidgets.QRadioButton(self.groupBox)
self.radioButtonHydrogenLine.setObjectName("radioButtonHydrogenLine")
self.verticalLayout.addWidget(self.radioButtonHydrogenLine)
self.radioButtonSDR = QtWidgets.QRadioButton(self.groupBox)
self.radioButtonSDR.setObjectName("radioButtonSDR")
self.verticalLayout.addWidget(self.radioButtonSDR)
self.radioButtonRaw = QtWidgets.QRadioButton(self.groupBox)
self.radioButtonRaw.setObjectName("radioButtonRaw")
self.verticalLayout.addWidget(self.radioButtonRaw)
self.line = QtWidgets.QFrame(self.groupBox)
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.verticalLayout.addWidget(self.line)
self.radioButtonLSR = QtWidgets.QRadioButton(self.groupBox)
self.radioButtonLSR.setAutoExclusive(False)
self.radioButtonLSR.setObjectName("radioButtonLSR")
self.verticalLayout.addWidget(self.radioButtonLSR)
self.checkBox = QtWidgets.QCheckBox(self.groupBox)
self.checkBox.setObjectName("checkBox")
self.verticalLayout.addWidget(self.checkBox)
self.horizontalLayout.addLayout(self.verticalLayout)
self.toolBox.addItem(self.toolBoxBackEnd, "")
self.gridLayout.addWidget(self.toolBox, 6, 0, 1, 1)
......@@ -325,7 +316,7 @@ class Ui_mainWindow(object):
self.menubar.addAction(self.menuHelp.menuAction())
self.retranslateUi(mainWindow)
self.toolBox.setCurrentIndex(1)
self.toolBox.setCurrentIndex(2)
QtCore.QMetaObject.connectSlotsByName(mainWindow)
mainWindow.setTabOrder(self.lineEditOperator1, self.lineEditOperator2)
mainWindow.setTabOrder(self.lineEditOperator2, self.lineEditOperator3)
......@@ -339,11 +330,6 @@ class Ui_mainWindow(object):
mainWindow.setTabOrder(self.spinBoxCentralFrequency, self.checkBoxRefraction)
mainWindow.setTabOrder(self.checkBoxRefraction, self.checkBoxDTModel)
mainWindow.setTabOrder(self.checkBoxDTModel, self.lineEditOutputDir)
mainWindow.setTabOrder(self.lineEditOutputDir, self.checkBoxPulsar)
mainWindow.setTabOrder(self.checkBoxPulsar, self.checkBoxHI)
mainWindow.setTabOrder(self.checkBoxHI, self.checkBoxSDR)
mainWindow.setTabOrder(self.checkBoxSDR, self.checkBoxRaw)
mainWindow.setTabOrder(self.checkBoxRaw, self.radioButtonLSR)
def retranslateUi(self, mainWindow):
_translate = QtCore.QCoreApplication.translate
......@@ -370,11 +356,11 @@ class Ui_mainWindow(object):
self.checkBoxDTModel.setText(_translate("mainWindow", "DT Model enabled"))
self.toolBox.setItemText(self.toolBox.indexOf(self.toolBoxMeasurement), _translate("mainWindow", "Measurement Settings"))
self.groupBox.setTitle(_translate("mainWindow", "Mode"))
self.checkBoxPulsar.setText(_translate("mainWindow", "Pulsar (default)"))
self.checkBoxHI.setText(_translate("mainWindow", "Hydrogen Line"))
self.checkBoxSDR.setText(_translate("mainWindow", "Software Defined Radio"))
self.checkBoxRaw.setText(_translate("mainWindow", "Raw"))
self.radioButtonLSR.setText(_translate("mainWindow", "Local &Standard of Rest Compensation"))
self.radioButtonPulsar.setText(_translate("mainWindow", "P&ulsar (default)"))
self.radioButtonHydrogenLine.setText(_translate("mainWindow", "Hydrogen Line"))
self.radioButtonSDR.setText(_translate("mainWindow", "Software Defined Radio"))
self.radioButtonRaw.setText(_translate("mainWindow", "Raw"))
self.checkBox.setText(_translate("mainWindow", "Local &Standard of Rest Compensation"))
self.toolBox.setItemText(self.toolBox.indexOf(self.toolBoxBackEnd), _translate("mainWindow", "BackEnd Settings"))
item = self.tableWidgetPointings.horizontalHeaderItem(0)
item.setText(_translate("mainWindow", "RA"))
......@@ -414,13 +400,3 @@ class Ui_mainWindow(object):
self.actionTestPointings.setText(_translate("mainWindow", "&TestPointings"))
self.actionNew.setText(_translate("mainWindow", "&New"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
mainWindow = QtWidgets.QMainWindow()
ui = Ui_mainWindow()
ui.setupUi(mainWindow)
mainWindow.show()
sys.exit(app.exec_())
......@@ -124,7 +124,7 @@
<enum>QFrame::NoFrame</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="toolBoxMetaData">
<property name="geometry">
......@@ -412,55 +412,31 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxPulsar">
<widget class="QRadioButton" name="radioButtonPulsar">
<property name="text">
<string>Pulsar (default)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
<string>P&amp;ulsar (default)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxHI">
<property name="enabled">
<bool>true</bool>
</property>
<widget class="QRadioButton" name="radioButtonHydrogenLine">
<property name="text">
<string>Hydrogen Line</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxSDR">
<widget class="QRadioButton" name="radioButtonSDR">
<property name="text">
<string>Software Defined Radio</string>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxRaw">
<widget class="QRadioButton" name="radioButtonRaw">
<property name="text">
<string>Raw</string>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item>
......@@ -471,13 +447,10 @@
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonLSR">
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Local &amp;Standard of Rest Compensation</string>
</property>
<property name="autoExclusive">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
......@@ -776,11 +749,6 @@
<tabstop>checkBoxRefraction</tabstop>
<tabstop>checkBoxDTModel</tabstop>
<tabstop>lineEditOutputDir</tabstop>
<tabstop>checkBoxPulsar</tabstop>
<tabstop>checkBoxHI</tabstop>
<tabstop>checkBoxSDR</tabstop>
<tabstop>checkBoxRaw</tabstop>
<tabstop>radioButtonLSR</tabstop>
</tabstops>
<resources/>
<connections/>
......
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