Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thopri
PyNEMO
Commits
c766adb7
Commit
c766adb7
authored
5 years ago
by
James Harle
Browse files
Options
Download
Email Patches
Plain Diff
final QT4 > QT5 updates to make GUI work + addition of tide_model
namelist entry to the variable info for the GUI
parent
5de9b807
master
IMMERSE
github/fork/vleguenn/feature/update_README
0.2.0
0.1.0
1 merge request
!47
Py nemo3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
22 deletions
+23
-22
pynemo/gui/nemo_bdy_input_window.py
pynemo/gui/nemo_bdy_input_window.py
+3
-3
pynemo/gui/nemo_bdy_mask_gui.py
pynemo/gui/nemo_bdy_mask_gui.py
+1
-1
pynemo/gui/nemo_bdy_namelist_edit.py
pynemo/gui/nemo_bdy_namelist_edit.py
+14
-14
pynemo/pynemo_settings_editor.py
pynemo/pynemo_settings_editor.py
+3
-3
pynemo/variable.info
pynemo/variable.info
+2
-1
No files found.
pynemo/gui/nemo_bdy_input_window.py
View file @
c766adb7
...
...
@@ -43,15 +43,15 @@ class InputWindow(QtWidgets.QDialog):
self
.
mpl_widget
.
set_mask_settings
(
float
(
setup
.
settings
[
'mask_max_depth'
]),
float
(
setup
.
settings
[
'mask_shelfbreak_dist'
]))
splitter
=
Qt
Gui
.
QSplitter
(
Qt
.
Horizontal
)
splitter
=
Qt
Widgets
.
QSplitter
(
Qt
.
Horizontal
)
splitter
.
addWidget
(
self
.
nl_editor
)
splitter
.
addWidget
(
self
.
mpl_widget
)
hbox
=
Qt
Gui
.
QHBoxLayout
()
hbox
=
Qt
Widgets
.
QHBoxLayout
()
hbox
.
addWidget
(
splitter
)
self
.
setLayout
(
hbox
)
#set the Dialog title
self
.
setWindowTitle
(
"PyNEMO Settings Editor"
)
Qt
Gui
.
QApplication
.
setStyle
(
Qt
Gui
.
QStyleFactory
.
create
(
'Cleanlooks'
))
Qt
Widgets
.
QApplication
.
setStyle
(
Qt
Widgets
.
QStyleFactory
.
create
(
'Cleanlooks'
))
#show the window
self
.
show
()
This diff is collapsed.
Click to expand it.
pynemo/gui/nemo_bdy_mask_gui.py
View file @
c766adb7
...
...
@@ -51,7 +51,7 @@ class MatplotlibWidget(QtWidgets.QWidget):
self
.
toolbar
.
drawing_tool
.
connect
(
self
.
drawing_tool_callback
)
self
.
axes
=
self
.
figure
.
add_subplot
(
111
)
self
.
cbar
=
None
layout
=
Qt
Gui
.
QVBoxLayout
()
layout
=
Qt
Widgets
.
QVBoxLayout
()
layout
.
addWidget
(
self
.
toolbar
)
layout
.
addWidget
(
self
.
canvas
)
self
.
setLayout
(
layout
)
...
...
This diff is collapsed.
Click to expand it.
pynemo/gui/nemo_bdy_namelist_edit.py
View file @
c766adb7
...
...
@@ -35,25 +35,25 @@ class NameListEditor(QtWidgets.QWidget):
'''
Initialises the UI components of the GUI
'''
client
=
Qt
Gui
.
QWidget
(
self
)
client
=
Qt
Widgets
.
QWidget
(
self
)
# Create the Layout to Grid
grid
=
Qt
Gui
.
QGridLayout
()
grid
=
Qt
Widgets
.
QGridLayout
()
# Loop through the settings and create widgets for each setting
index
=
0
for
setting
in
self
.
settings
:
# initialises setting Widget
label
=
Qt
Gui
.
QLabel
(
setting
)
qlabel
=
Qt
Gui
.
QPushButton
(
""
)
qlabel
.
setIcon
(
self
.
style
().
standardIcon
(
Qt
Gui
.
QStyle
.
SP_MessageBoxQuestion
))
label
=
Qt
Widgets
.
QLabel
(
setting
)
qlabel
=
Qt
Widgets
.
QPushButton
(
""
)
qlabel
.
setIcon
(
self
.
style
().
standardIcon
(
Qt
Widgets
.
QStyle
.
SP_MessageBoxQuestion
))
if
type
(
self
.
settings
[
setting
]).
__name__
in
[
'str'
,
'float'
,
'double'
,
'int'
,
'time'
,
'dict'
]:
text
=
Qt
Gui
.
QLineEdit
(
self
)
text
=
Qt
Widgets
.
QLineEdit
(
self
)
text
.
setText
(
str
(
self
.
settings
[
setting
]))
text
.
textChanged
.
connect
(
lambda
value
=
setting
,
\
var_name
=
setting
:
self
.
label_changed
(
value
,
var_name
))
if
setting
in
self
.
bool_settings
:
chkbox
=
Qt
Gui
.
QCheckBox
(
self
)
chkbox
=
Qt
Widgets
.
QCheckBox
(
self
)
chkbox
.
setChecked
(
self
.
bool_settings
[
setting
])
chkbox
.
stateChanged
.
connect
(
lambda
value
=
setting
,
\
var_name
=
setting
:
\
...
...
@@ -61,7 +61,7 @@ class NameListEditor(QtWidgets.QWidget):
grid
.
addWidget
(
chkbox
,
index
,
0
)
elif
type
(
self
.
settings
[
setting
]).
__name__
==
'bool'
:
text
=
Qt
Gui
.
QComboBox
(
self
)
text
=
Qt
Widgets
.
QComboBox
(
self
)
text
.
insertItem
(
0
,
'True'
)
text
.
insertItem
(
1
,
'False'
)
if
self
.
settings
[
setting
]:
...
...
@@ -84,22 +84,22 @@ class NameListEditor(QtWidgets.QWidget):
client
.
setLayout
(
grid
)
#scrollbars
scroll_area
=
Qt
Gui
.
QScrollArea
(
self
)
scroll_area
=
Qt
Widgets
.
QScrollArea
(
self
)
#scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll_area
.
setWidget
(
client
)
#save cancel buttons
btn_widget
=
Qt
Gui
.
QWidget
(
self
)
hbox_layout
=
Qt
Gui
.
QHBoxLayout
(
self
)
btn_save
=
Qt
Gui
.
QPushButton
(
'Save'
)
btn_widget
=
Qt
Widgets
.
QWidget
(
self
)
hbox_layout
=
Qt
Widgets
.
QHBoxLayout
(
self
)
btn_save
=
Qt
Widgets
.
QPushButton
(
'Save'
)
btn_save
.
clicked
.
connect
(
self
.
_btn_save_callback
)
self
.
btn_cancel
=
Qt
Gui
.
QPushButton
(
'Close'
)
self
.
btn_cancel
=
Qt
Widgets
.
QPushButton
(
'Close'
)
self
.
btn_cancel
.
clicked
.
connect
(
self
.
_btn_cancel_callback
)
hbox_layout
.
addWidget
(
btn_save
)
hbox_layout
.
addWidget
(
self
.
btn_cancel
)
btn_widget
.
setLayout
(
hbox_layout
)
box_layout
=
Qt
Gui
.
QVBoxLayout
(
self
)
box_layout
=
Qt
Widgets
.
QVBoxLayout
(
self
)
box_layout
.
addWidget
(
scroll_area
)
box_layout
.
addWidget
(
btn_widget
)
btn_widget
.
setMaximumWidth
(
400
)
...
...
This diff is collapsed.
Click to expand it.
pynemo/pynemo_settings_editor.py
View file @
c766adb7
...
...
@@ -5,7 +5,7 @@ Created on 7 Jan 2015
'''
# pylint: disable=E1103
# pylint: disable=no-name-in-module
from
PyQt5
import
QtGui
from
PyQt5
import
QtGui
,
QtWidgets
from
.gui.nemo_bdy_input_window
import
InputWindow
from
.
import
nemo_bdy_setup
...
...
@@ -16,7 +16,7 @@ def open_settings_window(fname):
""" Main method which starts a Qt application and gives user
an option to pick a namelist.bdy file to edit. Once user selects it
it will open a dialog box where users can edit the parameters"""
app
=
Qt
Gui
.
QApplication
(
sys
.
argv
)
app
=
Qt
Widgets
.
QApplication
(
sys
.
argv
)
if
fname
is
None
:
fname
=
QtGui
.
QFileDialog
.
getOpenFileName
(
None
,
'Open file'
)
...
...
@@ -29,7 +29,7 @@ def open_settings_dialog(setup):
""" This method is to start the settings window using the setup settings provided
in the input. On clicking the cancel button it doesn't shutdown the applicaiton
but carries on with the execution"""
app
=
Qt
Gui
.
QApplication
(
sys
.
argv
)
app
=
Qt
Widgets
.
QApplication
(
sys
.
argv
)
ex
=
InputWindow
(
setup
)
ex
.
nl_editor
.
btn_cancel
.
clicked
.
connect
(
app
.
quit
)
return
app
.
exec_
(),
ex
.
mpl_widget
.
mask
...
...
This diff is collapsed.
Click to expand it.
pynemo/variable.info
View file @
c766adb7
...
...
@@ -28,6 +28,7 @@ ln_tra = boundary conditions for T and S
ln_ice = ice boundary condition
nn_rimwidth = width of the relaxation zone
ln_tide = if .true. : produce bdy tidal conditions
sn_tide_model = 'FES'
clname(0) = constituent name
ln_trans =
nn_year_000 = year start
...
...
@@ -47,4 +48,4 @@ nn_alpha = Euler rotation angle
nn_beta = Euler rotation angle
nn_gamma = Euler rotation angle
rn_mask_max_depth = Maximum depth to be ignored for the mask
rn_mask_shelfbreak_dist = Distance from the shelf break
\ No newline at end of file
rn_mask_shelfbreak_dist = Distance from the shelf break
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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