Commit 1608f7cb authored by marc's avatar marc
Browse files

initial init

parent 5b13c4ff
......@@ -19,12 +19,17 @@ class CreatePointings(Ui_FormCreatePoinings):
logging.info('CreatePointings Intialized')
Ui_FormCreatePoinings.__init__(self)
self.setupUi(formCreatePointings)
self.target = SkyCoord.from_name(self.comboBox.currentText())
self.target = SkyCoord.from_name('M87')
(self.raStr, self.decStr) = self.target.to_string('hmsdms').split()
self.lineEditRA.setText(self.raStr)
self.lineEditDec.setText(self.decStr)
self.target = SkyCoord(0 * u.radian,0 * u.radian)
try:
#self.target = SkyCoord.from_name(self.comboBox.currentText())
(self.raStr, self.decStr) = self.target.to_string('hmsdms').split()
self.lineEditRA.setText(self.raStr)
self.lineEditDec.setText(self.decStr)
except socket.gaierror as e:
raise URLError("Could not connect to Internet" + str(e))
raise NameError("Could not connect to Internet" + str(e))
self.target = Null
'''
Define slot and connections for GUI
'''
......
......@@ -11,17 +11,18 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_FormCreatePoinings(object):
def setupUi(self, FormCreatePoinings):
FormCreatePoinings.setObjectName("FormCreatePoinings")
FormCreatePoinings.resize(482, 241)
self.widget = QtWidgets.QWidget(FormCreatePoinings)
self.widget.setGeometry(QtCore.QRect(10, 10, 463, 220))
self.widget.setObjectName("widget")
self.gridLayout = QtWidgets.QGridLayout(self.widget)
FormCreatePoinings.resize(590, 270)
FormCreatePoinings.setMinimumSize(QtCore.QSize(590, 270))
FormCreatePoinings.setMaximumSize(QtCore.QSize(590, 270))
self.layoutWidget = QtWidgets.QWidget(FormCreatePoinings)
self.layoutWidget.setGeometry(QtCore.QRect(11, 11, 571, 245))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget)
self.gridLayout.setObjectName("gridLayout")
self.label_6 = QtWidgets.QLabel(self.widget)
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 0, 0, 1, 1)
self.comboBox = QtWidgets.QComboBox(self.widget)
self.comboBox = QtWidgets.QComboBox(self.layoutWidget)
self.comboBox.setToolTip("")
self.comboBox.setLayoutDirection(QtCore.Qt.LeftToRight)
self.comboBox.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContentsOnFirstShow)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
......@@ -29,65 +30,90 @@ class Ui_FormCreatePoinings(object):
self.comboBox.addItem("")
self.comboBox.addItem("")
self.gridLayout.addWidget(self.comboBox, 0, 1, 1, 1)
self.label = QtWidgets.QLabel(self.widget)
self.label = QtWidgets.QLabel(self.layoutWidget)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
self.lineEditRA = QtWidgets.QLineEdit(self.widget)
self.lineEditRA.setObjectName("lineEditRA")
self.gridLayout.addWidget(self.lineEditRA, 1, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(self.widget)
self.gridLayout.addWidget(self.label, 1, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(self.layoutWidget)
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.lineEditDec = QtWidgets.QLineEdit(self.widget)
self.lineEditDec.setObjectName("lineEditDec")
self.gridLayout.addWidget(self.lineEditDec, 2, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.widget)
self.gridLayout.addWidget(self.label_2, 1, 2, 1, 1)
self.label_5 = QtWidgets.QLabel(self.layoutWidget)
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 6, 0, 1, 1)
self.lineEditRA = QtWidgets.QLineEdit(self.layoutWidget)
self.lineEditRA.setAlignment(QtCore.Qt.AlignCenter)
self.lineEditRA.setObjectName("lineEditRA")
self.gridLayout.addWidget(self.lineEditRA, 2, 2, 1, 1)
self.label_3 = QtWidgets.QLabel(self.layoutWidget)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setWordWrap(True)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
self.lineEditRaDistance = QtWidgets.QLineEdit(self.widget)
self.lineEditRaDistance.setObjectName("lineEditRaDistance")
self.gridLayout.addWidget(self.lineEditRaDistance, 3, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(self.widget)
self.label_7.setObjectName("label_7")
self.gridLayout.addWidget(self.label_7, 3, 2, 1, 1)
self.lineEditRaSteps = QtWidgets.QLineEdit(self.widget)
self.lineEditRaSteps.setObjectName("lineEditRaSteps")
self.gridLayout.addWidget(self.lineEditRaSteps, 3, 3, 1, 1)
self.label_4 = QtWidgets.QLabel(self.widget)
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 4, 0, 1, 1)
self.lineEditDecDistance = QtWidgets.QLineEdit(self.widget)
self.lineEditDecDistance.setObjectName("lineEditDecDistance")
self.gridLayout.addWidget(self.lineEditDecDistance, 4, 1, 1, 1)
self.label_8 = QtWidgets.QLabel(self.widget)
self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1)
self.buttonBoxCreatePointings = QtWidgets.QDialogButtonBox(self.layoutWidget)
self.buttonBoxCreatePointings.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBoxCreatePointings.setObjectName("buttonBoxCreatePointings")
self.gridLayout.addWidget(self.buttonBoxCreatePointings, 6, 1, 1, 1)
self.label_9 = QtWidgets.QLabel(self.layoutWidget)
self.label_9.setAlignment(QtCore.Qt.AlignCenter)
self.label_9.setWordWrap(True)
self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.label_9, 2, 0, 1, 1)
self.lineEditDec = QtWidgets.QLineEdit(self.layoutWidget)
self.lineEditDec.setAlignment(QtCore.Qt.AlignCenter)
self.lineEditDec.setObjectName("lineEditDec")
self.gridLayout.addWidget(self.lineEditDec, 2, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(self.layoutWidget)
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 0, 0, 1, 1)
self.label_8 = QtWidgets.QLabel(self.layoutWidget)
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
self.label_8.setWordWrap(True)
self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 4, 2, 1, 1)
self.lineEditDecSteps = QtWidgets.QLineEdit(self.widget)
self.lineEditDecSteps.setObjectName("lineEditDecSteps")
self.gridLayout.addWidget(self.lineEditDecSteps, 4, 3, 1, 1)
self.label_5 = QtWidgets.QLabel(self.widget)
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 5, 0, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(self.widget)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 5, 1, 1, 1)
self.pushButton = QtWidgets.QPushButton(self.widget)
self.pushButton.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton, 5, 3, 1, 1)
self.gridLayout.addWidget(self.label_8, 3, 0, 1, 1)
self.doubleSpinBoxDistanceRA = QtWidgets.QDoubleSpinBox(self.layoutWidget)
self.doubleSpinBoxDistanceRA.setAlignment(QtCore.Qt.AlignCenter)
self.doubleSpinBoxDistanceRA.setButtonSymbols(QtWidgets.QAbstractSpinBox.PlusMinus)
self.doubleSpinBoxDistanceRA.setMinimum(0.1)
self.doubleSpinBoxDistanceRA.setMaximum(2.0)
self.doubleSpinBoxDistanceRA.setSingleStep(0.1)
self.doubleSpinBoxDistanceRA.setProperty("value", 0.5)
self.doubleSpinBoxDistanceRA.setObjectName("doubleSpinBoxDistanceRA")
self.gridLayout.addWidget(self.doubleSpinBoxDistanceRA, 4, 1, 1, 1)
self.doubleSpinBoxDistanceDec = QtWidgets.QDoubleSpinBox(self.layoutWidget)
self.doubleSpinBoxDistanceDec.setAlignment(QtCore.Qt.AlignCenter)
self.doubleSpinBoxDistanceDec.setButtonSymbols(QtWidgets.QAbstractSpinBox.PlusMinus)
self.doubleSpinBoxDistanceDec.setMinimum(0.1)
self.doubleSpinBoxDistanceDec.setMaximum(2.0)
self.doubleSpinBoxDistanceDec.setSingleStep(0.1)
self.doubleSpinBoxDistanceDec.setProperty("value", 0.5)
self.doubleSpinBoxDistanceDec.setObjectName("doubleSpinBoxDistanceDec")
self.gridLayout.addWidget(self.doubleSpinBoxDistanceDec, 4, 2, 1, 1)
self.spinBoxStepsRA = QtWidgets.QSpinBox(self.layoutWidget)
self.spinBoxStepsRA.setAlignment(QtCore.Qt.AlignCenter)
self.spinBoxStepsRA.setMaximum(30)
self.spinBoxStepsRA.setObjectName("spinBoxStepsRA")
self.gridLayout.addWidget(self.spinBoxStepsRA, 3, 1, 1, 1)
self.spinBoxStepsDec = QtWidgets.QSpinBox(self.layoutWidget)
self.spinBoxStepsDec.setAlignment(QtCore.Qt.AlignCenter)
self.spinBoxStepsDec.setMaximum(30)
self.spinBoxStepsDec.setObjectName("spinBoxStepsDec")
self.gridLayout.addWidget(self.spinBoxStepsDec, 3, 2, 1, 1)
self.retranslateUi(FormCreatePoinings)
QtCore.QMetaObject.connectSlotsByName(FormCreatePoinings)
FormCreatePoinings.setTabOrder(self.comboBox, self.spinBoxStepsRA)
FormCreatePoinings.setTabOrder(self.spinBoxStepsRA, self.spinBoxStepsDec)
FormCreatePoinings.setTabOrder(self.spinBoxStepsDec, self.doubleSpinBoxDistanceRA)
FormCreatePoinings.setTabOrder(self.doubleSpinBoxDistanceRA, self.doubleSpinBoxDistanceDec)
FormCreatePoinings.setTabOrder(self.doubleSpinBoxDistanceDec, self.lineEditDec)
FormCreatePoinings.setTabOrder(self.lineEditDec, self.lineEditRA)
def retranslateUi(self, FormCreatePoinings):
_translate = QtCore.QCoreApplication.translate
FormCreatePoinings.setWindowTitle(_translate("FormCreatePoinings", "Create Pointings"))
self.label_6.setText(_translate("FormCreatePoinings", "Object"))
self.comboBox.setItemText(0, _translate("FormCreatePoinings", "M1"))
self.comboBox.setItemText(1, _translate("FormCreatePoinings", "M13"))
self.comboBox.setItemText(2, _translate("FormCreatePoinings", "M31"))
......@@ -95,12 +121,11 @@ class Ui_FormCreatePoinings(object):
self.comboBox.setItemText(4, _translate("FormCreatePoinings", "M101"))
self.label.setText(_translate("FormCreatePoinings", "RA"))
self.label_2.setText(_translate("FormCreatePoinings", "DEC"))
self.label_3.setText(_translate("FormCreatePoinings", "RA Distance"))
self.label_7.setText(_translate("FormCreatePoinings", "RA Steps"))
self.label_4.setText(_translate("FormCreatePoinings", "DEC distance"))
self.label_8.setText(_translate("FormCreatePoinings", "DEC Steps"))
self.label_5.setText(_translate("FormCreatePoinings", "Create Pointings"))
self.pushButton.setText(_translate("FormCreatePoinings", "Clear Settings"))
self.label_3.setText(_translate("FormCreatePoinings", "Distance between pointings (degree)"))
self.label_9.setText(_translate("FormCreatePoinings", "Central Pointing"))
self.label_6.setText(_translate("FormCreatePoinings", "Object"))
self.label_8.setText(_translate("FormCreatePoinings", "Number of Steps"))
if __name__ == "__main__":
......
......@@ -6,35 +6,40 @@
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>241</height>
<width>475</width>
<height>264</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>590</width>
<height>270</height>
</size>
</property>
<property name="windowTitle">
<string>Create Pointings</string>
</property>
<widget class="QWidget" name="">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>463</width>
<height>220</height>
<x>11</x>
<y>11</y>
<width>461</width>
<height>245</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Object</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox">
<property name="toolTip">
<string extracomment="Select Object"/>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
<item>
<property name="text">
<string>M1</string>
......@@ -62,7 +67,7 @@
</item>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>RA</string>
......@@ -72,10 +77,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditRA"/>
</item>
<item row="2" column="0">
<item row="1" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>DEC</string>
......@@ -85,82 +87,162 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditDec"/>
<item row="6" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Create Pointings</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="2">
<widget class="QLineEdit" name="lineEditRA">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>RA Distance</string>
<string>Distance between pointings (degree)</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEditRaDistance"/>
<item row="6" column="1">
<widget class="QDialogButtonBox" name="buttonBoxCreatePointings">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_7">
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>RA Steps</string>
<string>Central Pointing</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLineEdit" name="lineEditRaSteps"/>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditDec">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>DEC distance</string>
<string>Object</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEditDecDistance"/>
</item>
<item row="4" column="2">
<item row="3" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>DEC Steps</string>
<string>Number of Steps</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLineEdit" name="lineEditDecSteps"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Create Pointings</string>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBoxDistanceRA">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>2.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QDoubleSpinBox" name="doubleSpinBoxDistanceDec">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>2.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBoxStepsRA">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="maximum">
<number>30</number>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Clear Settings</string>
<item row="3" column="2">
<widget class="QSpinBox" name="spinBoxStepsDec">
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="maximum">
<number>30</number>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<tabstops>
<tabstop>comboBox</tabstop>
<tabstop>spinBoxStepsRA</tabstop>
<tabstop>spinBoxStepsDec</tabstop>
<tabstop>doubleSpinBoxDistanceRA</tabstop>
<tabstop>doubleSpinBoxDistanceDec</tabstop>
<tabstop>lineEditDec</tabstop>
<tabstop>lineEditRA</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
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