Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
marc
dtObsGUI
Commits
cfb2d8b8
Commit
cfb2d8b8
authored
Nov 04, 2017
by
marc
Browse files
Added File New and additional meta data
parent
08a5f2b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
DTObs.py
View file @
cfb2d8b8
...
...
@@ -92,6 +92,11 @@ class DTObservationProgram(Ui_mainWindow):
logging
.
debug
(
'Demo status is: {}'
.
format
(
self
.
demo
))
if
self
.
demo
==
False
:
self
.
myDT
=
telescope
(
setmode
=
'J2000'
,
consoleHost
=
'consoledemo.dmz.camras.nl'
)
self
.
telescopeMode
=
'J2000'
self
.
telescopeOffset
=
None
else
:
self
.
telescopeMode
=
None
self
.
telescopeOffset
=
None
self
.
myMeas
=
Measurements
()
self
.
myMetaData
=
MetaData
()
...
...
@@ -113,6 +118,7 @@ class DTObservationProgram(Ui_mainWindow):
'''
Define slot and connections for GUI
'''
self
.
actionNew
.
triggered
.
connect
(
self
.
newPointingsDialog
)
self
.
actionOpen
.
triggered
.
connect
(
self
.
openFileNameDialog
)
self
.
actionClose
.
triggered
.
connect
(
self
.
closeMeasurement
)
self
.
actionQuit
.
triggered
.
connect
(
self
.
quitDTObs
)
...
...
@@ -131,12 +137,15 @@ class DTObservationProgram(Ui_mainWindow):
indexNR
+=
1
self
.
threadpool
=
QThreadPool
()
def
newPointingsDialog
(
self
):
pass
def
openFileNameDialog
(
self
):
'''
Clear tableWidget and read pointings from file
'''
self
.
inputFile
,
_
=
QFileDialog
.
getOpenFileName
(
None
,
'Open File'
,
"templates"
,
"
Meas
Files (*.
da
t);;All Files (*)"
)
self
.
inputFile
,
_
=
QFileDialog
.
getOpenFileName
(
None
,
'Open File'
,
"templates"
,
"
Pointing
Files (*.
pn
t);;All Files (*)"
)
if
self
.
inputFile
:
self
.
loadPointingsInTable
(
self
.
inputFile
)
logging
.
info
(
'Selected data file is: {}'
.
format
(
self
.
inputFile
))
...
...
@@ -243,6 +252,9 @@ class DTObservationProgram(Ui_mainWindow):
self
.
myMetaData
.
outputFile
=
self
.
outputFile
self
.
myMetaData
.
radecSetpoint
=
self
.
radec
self
.
myMetaData
.
radecActual
=
self
.
radec
self
.
myMetaData
.
telescopeMode
=
self
.
telescopeMode
self
.
myMetaData
.
telescopeOffset
=
self
.
telescopeOffset
'''
TODO: read radec Actual from telescope class
'''
...
...
@@ -350,8 +362,7 @@ class DTObservationProgram(Ui_mainWindow):
if
__name__
==
'__main__'
:
app
=
QApplication
(
sys
.
argv
)
mainWindow
=
QMainWindow
()
prog
=
DTObservationProgram
(
mainWindow
)
mainWindow
.
show
()
sys
.
exit
(
app
.
exec_
())
ui/dtobswindow.py
View file @
cfb2d8b8
...
...
@@ -30,9 +30,6 @@ class Ui_mainWindow(object):
self
.
pushButtonStartMeasurement
.
setPalette
(
palette
)
self
.
pushButtonStartMeasurement
.
setObjectName
(
"pushButtonStartMeasurement"
)
self
.
gridLayout
.
addWidget
(
self
.
pushButtonStartMeasurement
,
7
,
0
,
1
,
1
)
self
.
label_4
=
QtWidgets
.
QLabel
(
self
.
centralwidget
)
self
.
label_4
.
setObjectName
(
"label_4"
)
self
.
gridLayout
.
addWidget
(
self
.
label_4
,
0
,
1
,
1
,
1
,
QtCore
.
Qt
.
AlignHCenter
)
self
.
pushButtonStopMeasurement
=
QtWidgets
.
QPushButton
(
self
.
centralwidget
)
palette
=
QtGui
.
QPalette
()
brush
=
QtGui
.
QBrush
(
QtGui
.
QColor
(
255
,
0
,
0
))
...
...
@@ -47,43 +44,6 @@ class Ui_mainWindow(object):
self
.
pushButtonStopMeasurement
.
setPalette
(
palette
)
self
.
pushButtonStopMeasurement
.
setObjectName
(
"pushButtonStopMeasurement"
)
self
.
gridLayout
.
addWidget
(
self
.
pushButtonStopMeasurement
,
8
,
0
,
1
,
1
)
self
.
tableWidgetPointings
=
QtWidgets
.
QTableWidget
(
self
.
centralwidget
)
self
.
tableWidgetPointings
.
setObjectName
(
"tableWidgetPointings"
)
self
.
tableWidgetPointings
.
setColumnCount
(
4
)
self
.
tableWidgetPointings
.
setRowCount
(
0
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
0
,
item
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
1
,
item
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
2
,
item
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
3
,
item
)
self
.
gridLayout
.
addWidget
(
self
.
tableWidgetPointings
,
6
,
1
,
1
,
1
)
self
.
toolBox
=
QtWidgets
.
QToolBox
(
self
.
centralwidget
)
self
.
toolBox
.
setEnabled
(
True
)
self
.
toolBox
.
setMinimumSize
(
QtCore
.
QSize
(
280
,
0
))
...
...
@@ -233,6 +193,46 @@ class Ui_mainWindow(object):
self
.
horizontalLayout
.
addLayout
(
self
.
verticalLayout
)
self
.
toolBox
.
addItem
(
self
.
toolBoxBackEnd
,
""
)
self
.
gridLayout
.
addWidget
(
self
.
toolBox
,
6
,
0
,
1
,
1
)
self
.
tableWidgetPointings
=
QtWidgets
.
QTableWidget
(
self
.
centralwidget
)
self
.
tableWidgetPointings
.
setObjectName
(
"tableWidgetPointings"
)
self
.
tableWidgetPointings
.
setColumnCount
(
4
)
self
.
tableWidgetPointings
.
setRowCount
(
0
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
0
,
item
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
1
,
item
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
2
,
item
)
item
=
QtWidgets
.
QTableWidgetItem
()
item
.
setTextAlignment
(
QtCore
.
Qt
.
AlignCenter
)
font
=
QtGui
.
QFont
()
font
.
setBold
(
True
)
font
.
setWeight
(
75
)
item
.
setFont
(
font
)
item
.
setBackground
(
QtGui
.
QColor
(
255
,
170
,
127
))
self
.
tableWidgetPointings
.
setHorizontalHeaderItem
(
3
,
item
)
self
.
gridLayout
.
addWidget
(
self
.
tableWidgetPointings
,
6
,
1
,
3
,
1
)
self
.
label_4
=
QtWidgets
.
QLabel
(
self
.
centralwidget
)
self
.
label_4
.
setObjectName
(
"label_4"
)
self
.
gridLayout
.
addWidget
(
self
.
label_4
,
5
,
1
,
1
,
1
)
mainWindow
.
setCentralWidget
(
self
.
centralwidget
)
self
.
menubar
=
QtWidgets
.
QMenuBar
(
mainWindow
)
self
.
menubar
.
setGeometry
(
QtCore
.
QRect
(
0
,
0
,
856
,
29
))
...
...
@@ -295,6 +295,9 @@ class Ui_mainWindow(object):
self
.
actionM101
.
setObjectName
(
"actionM101"
)
self
.
actionTestPointings
=
QtWidgets
.
QAction
(
mainWindow
)
self
.
actionTestPointings
.
setObjectName
(
"actionTestPointings"
)
self
.
actionNew
=
QtWidgets
.
QAction
(
mainWindow
)
self
.
actionNew
.
setObjectName
(
"actionNew"
)
self
.
menuFile
.
addAction
(
self
.
actionNew
)
self
.
menuFile
.
addAction
(
self
.
actionOpen
)
self
.
menuFile
.
addAction
(
self
.
actionSave
)
self
.
menuFile
.
addAction
(
self
.
actionSave_As
)
...
...
@@ -324,21 +327,29 @@ class Ui_mainWindow(object):
self
.
retranslateUi
(
mainWindow
)
self
.
toolBox
.
setCurrentIndex
(
1
)
QtCore
.
QMetaObject
.
connectSlotsByName
(
mainWindow
)
mainWindow
.
setTabOrder
(
self
.
lineEditOperator1
,
self
.
lineEditOperator2
)
mainWindow
.
setTabOrder
(
self
.
lineEditOperator2
,
self
.
lineEditOperator3
)
mainWindow
.
setTabOrder
(
self
.
lineEditOperator3
,
self
.
textEditDescription
)
mainWindow
.
setTabOrder
(
self
.
textEditDescription
,
self
.
pushButtonStartMeasurement
)
mainWindow
.
setTabOrder
(
self
.
pushButtonStartMeasurement
,
self
.
pushButtonStopMeasurement
)
mainWindow
.
setTabOrder
(
self
.
pushButtonStopMeasurement
,
self
.
comboBoxProgramma
)
mainWindow
.
setTabOrder
(
self
.
comboBoxProgramma
,
self
.
pushButtonOutputDirectory
)
mainWindow
.
setTabOrder
(
self
.
pushButtonOutputDirectory
,
self
.
spinBoxIntTime
)
mainWindow
.
setTabOrder
(
self
.
spinBoxIntTime
,
self
.
spinBoxCentralFrequency
)
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
mainWindow
.
setWindowTitle
(
_translate
(
"mainWindow"
,
"DT Observation Application"
))
self
.
pushButtonStartMeasurement
.
setText
(
_translate
(
"mainWindow"
,
"Start Measurement"
))
self
.
label_4
.
setText
(
_translate
(
"mainWindow"
,
"Observation Progress and Status"
))
self
.
pushButtonStopMeasurement
.
setText
(
_translate
(
"mainWindow"
,
"Stop"
))
item
=
self
.
tableWidgetPointings
.
horizontalHeaderItem
(
0
)
item
.
setText
(
_translate
(
"mainWindow"
,
"RA"
))
item
=
self
.
tableWidgetPointings
.
horizontalHeaderItem
(
1
)
item
.
setText
(
_translate
(
"mainWindow"
,
"Dec"
))
item
=
self
.
tableWidgetPointings
.
horizontalHeaderItem
(
2
)
item
.
setText
(
_translate
(
"mainWindow"
,
"Status"
))
item
=
self
.
tableWidgetPointings
.
horizontalHeaderItem
(
3
)
item
.
setText
(
_translate
(
"mainWindow"
,
"Result File"
))
self
.
groupBox_3
.
setTitle
(
_translate
(
"mainWindow"
,
"GroupBox"
))
self
.
label_8
.
setText
(
_translate
(
"mainWindow"
,
"Desciption: "
))
self
.
label
.
setText
(
_translate
(
"mainWindow"
,
"Operator 3"
))
...
...
@@ -365,6 +376,15 @@ class Ui_mainWindow(object):
self
.
checkBoxRaw
.
setText
(
_translate
(
"mainWindow"
,
"Raw"
))
self
.
radioButtonLSR
.
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"
))
item
=
self
.
tableWidgetPointings
.
horizontalHeaderItem
(
1
)
item
.
setText
(
_translate
(
"mainWindow"
,
"Dec"
))
item
=
self
.
tableWidgetPointings
.
horizontalHeaderItem
(
2
)
item
.
setText
(
_translate
(
"mainWindow"
,
"Status"
))
item
=
self
.
tableWidgetPointings
.
horizontalHeaderItem
(
3
)
item
.
setText
(
_translate
(
"mainWindow"
,
"Result File"
))
self
.
label_4
.
setText
(
_translate
(
"mainWindow"
,
"Observation Progress and Status"
))
self
.
menuFile
.
setTitle
(
_translate
(
"mainWindow"
,
"Fi&le"
))
self
.
menuEdit
.
setTitle
(
_translate
(
"mainWindow"
,
"E&dit"
))
self
.
menuHelp
.
setTitle
(
_translate
(
"mainWindow"
,
"He&lp"
))
...
...
@@ -392,6 +412,7 @@ class Ui_mainWindow(object):
self
.
actionM31Template
.
setText
(
_translate
(
"mainWindow"
,
"&M31"
))
self
.
actionM101
.
setText
(
_translate
(
"mainWindow"
,
"M&101"
))
self
.
actionTestPointings
.
setText
(
_translate
(
"mainWindow"
,
"&TestPointings"
))
self
.
actionNew
.
setText
(
_translate
(
"mainWindow"
,
"&New"
))
if
__name__
==
"__main__"
:
...
...
ui/dtobswindow.ui
View file @
cfb2d8b8
...
...
@@ -59,13 +59,6 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
alignment=
"Qt::AlignHCenter"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Observation Progress and Status
</string>
</property>
</widget>
</item>
<item
row=
"8"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"pushButtonStopMeasurement"
>
<property
name=
"palette"
>
...
...
@@ -110,94 +103,6 @@
</property>
</widget>
</item>
<item
row=
"6"
column=
"1"
>
<widget
class=
"QTableWidget"
name=
"tableWidgetPointings"
>
<column>
<property
name=
"text"
>
<string>
RA
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
Dec
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
Status
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
Result File
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
</widget>
</item>
<item
row=
"6"
column=
"0"
>
<widget
class=
"QToolBox"
name=
"toolBox"
>
<property
name=
"enabled"
>
...
...
@@ -582,6 +487,101 @@
</widget>
</widget>
</item>
<item
row=
"6"
column=
"1"
rowspan=
"3"
>
<widget
class=
"QTableWidget"
name=
"tableWidgetPointings"
>
<column>
<property
name=
"text"
>
<string>
RA
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
Dec
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
Status
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
<column>
<property
name=
"text"
>
<string>
Result File
</string>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"textAlignment"
>
<set>
AlignCenter
</set>
</property>
<property
name=
"background"
>
<color>
<red>
255
</red>
<green>
170
</green>
<blue>
127
</blue>
</color>
</property>
</column>
</widget>
</item>
<item
row=
"5"
column=
"1"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Observation Progress and Status
</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget
class=
"QMenuBar"
name=
"menubar"
>
...
...
@@ -597,6 +597,7 @@
<property
name=
"title"
>
<string>
Fi
&
le
</string>
</property>
<addaction
name=
"actionNew"
/>
<addaction
name=
"actionOpen"
/>
<addaction
name=
"actionSave"
/>
<addaction
name=
"actionSave_As"
/>
...
...
@@ -755,7 +756,32 @@
<string>
&
TestPointings
</string>
</property>
</action>
<action
name=
"actionNew"
>
<property
name=
"text"
>
<string>
&
New
</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>
lineEditOperator1
</tabstop>
<tabstop>
lineEditOperator2
</tabstop>
<tabstop>
lineEditOperator3
</tabstop>
<tabstop>
textEditDescription
</tabstop>
<tabstop>
pushButtonStartMeasurement
</tabstop>
<tabstop>
pushButtonStopMeasurement
</tabstop>
<tabstop>
comboBoxProgramma
</tabstop>
<tabstop>
pushButtonOutputDirectory
</tabstop>
<tabstop>
spinBoxIntTime
</tabstop>
<tabstop>
spinBoxCentralFrequency
</tabstop>
<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/>
</ui>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment