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
fd3ae9fc
Commit
fd3ae9fc
authored
Mar 10, 2018
by
marc
Browse files
added current setpoint as default setpoint for single shot measument
parent
6d8a3062
Changes
4
Hide whitespace changes
Inline
Side-by-side
DTObs.py
View file @
fd3ae9fc
...
...
@@ -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
.
actual
console
:
self
.
myDT
=
telescope
(
setmode
=
'J2000'
,
consoleHost
=
'console'
)
el
se
:
self
.
myDT
=
telescope
(
setmode
=
'J2000'
,
consoleHost
=
'consoledemo.dmz.camras.nl'
)
self
.
myDT
=
telescope
(
setmode
=
'J2000'
,
consoleHost
=
console
Host
)
'''
t
el
escopeMode 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
.
checkBox
Pulsar
.
isChecked
():
if
self
.
radioButton
Pulsar
.
isChecked
():
self
.
GUIbackendMode
=
'Pulsar'
if
self
.
checkBoxHI
.
isChecked
():
if
self
.
radioButtonHydrogenLine
.
isChecked
():
self
.
GUIbackendMode
=
'Hydrogen'
if
self
.
checkBox
SDR
.
isChecked
():
if
self
.
radioButton
SDR
.
isChecked
():
self
.
GUIbackendMode
=
'SDR'
if
self
.
checkBox
Raw
.
isChecked
():
if
self
.
radioButton
Raw
.
isChecked
():
self
.
GUIbackendMode
=
'Raw'
def
startMeasurement
(
self
):
...
...
dtobsgui.ini
View file @
fd3ae9fc
...
...
@@ -2,4 +2,9 @@
LogLevel:
INFO
[TestConfig]
demo:
False
#demo: False
demo:
True
[Console]
consoleHost:
http://charon.camras.nl/consoledemo
#consoleHost: console
ui/dtobswindow.py
View file @
fd3ae9fc
# -*- 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
.
checkBox
Pulsar
.
setText
(
_translate
(
"mainWindow"
,
"Pulsar (default)"
))
self
.
checkBoxHI
.
setText
(
_translate
(
"mainWindow"
,
"Hydrogen Line"
))
self
.
checkBox
SDR
.
setText
(
_translate
(
"mainWindow"
,
"Software Defined Radio"
))
self
.
checkBox
Raw
.
setText
(
_translate
(
"mainWindow"
,
"Raw"
))
self
.
radioButtonLSR
.
setText
(
_translate
(
"mainWindow"
,
"Local &Standard of Rest Compensation"
))
self
.
radioButton
Pulsar
.
setText
(
_translate
(
"mainWindow"
,
"P
&
ulsar (default)"
))
self
.
radioButtonHydrogenLine
.
setText
(
_translate
(
"mainWindow"
,
"Hydrogen Line"
))
self
.
radioButton
SDR
.
setText
(
_translate
(
"mainWindow"
,
"Software Defined Radio"
))
self
.
radioButton
Raw
.
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_
())
ui/dtobswindow.ui
View file @
fd3ae9fc
...
...
@@ -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=
"Q
CheckBox"
name=
"checkBox
Pulsar"
>
<widget
class=
"Q
RadioButton"
name=
"radioButton
Pulsar"
>
<property
name=
"text"
>
<string>
Pulsar (default)
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
<property
name=
"autoExclusive"
>
<bool>
true
</bool>
<string>
P
&
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=
"Q
CheckBox"
name=
"checkBox
SDR"
>
<widget
class=
"Q
RadioButton"
name=
"radioButton
SDR"
>
<property
name=
"text"
>
<string>
Software Defined Radio
</string>
</property>
<property
name=
"autoExclusive"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<widget
class=
"Q
CheckBox"
name=
"checkBox
Raw"
>
<widget
class=
"Q
RadioButton"
name=
"radioButton
Raw"
>
<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=
"Q
RadioButton"
name=
"radioButtonLSR
"
>
<widget
class=
"Q
CheckBox"
name=
"checkBox
"
>
<property
name=
"text"
>
<string>
Local
&
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/>
...
...
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