Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
5ca3f3ba
Commit
5ca3f3ba
authored
Oct 13, 2016
by
eric pellegrini
Browse files
Modified the sendMessage call according to the wx pubusb API
parent
5428380b
Changes
15
Hide whitespace changes
Inline
Side-by-side
MDANSE/GUI/DataTreePanel.py
View file @
5ca3f3ba
...
...
@@ -71,16 +71,17 @@ class DataTreePanel(wx.Panel):
PUBLISHER
.
unsubscribe
(
self
.
msg_delete_input_data
,
'msg_delete_input_data'
)
event
.
Skip
()
def
msg_load_input_data
(
self
,
data
):
def
msg_load_input_data
(
self
,
message
):
data
=
message
.
data
if
data
is
None
:
return
self
.
add_data
(
data
)
def
msg_delete_input_data
(
self
,
data
):
def
msg_delete_input_data
(
self
,
message
):
data
=
message
.
data
item
=
self
.
get_tree_item
(
self
.
_root
,
data
)
if
item
is
None
:
...
...
@@ -111,7 +112,7 @@ class DataTreePanel(wx.Panel):
yield
item
item
=
self
.
_tree
.
GetNextSibling
(
item
)
def
add_data
(
self
,
data
):
def
add_data
(
self
,
data
):
dataItem
=
wx
.
TreeItemData
(
data
.
name
)
...
...
MDANSE/GUI/Plugins/AnimationPlugin.py
View file @
5ca3f3ba
...
...
@@ -149,8 +149,9 @@ class AnimationPlugin(ComponentPlugin):
self
.
speedSlider
.
SetValue
(
int
(
self
.
speedEntry
.
GetValue
()))
self
.
_parent
.
change_frame_rate
()
def
msg_timer
(
self
,
plugin
):
def
msg_timer
(
self
,
message
):
plugin
=
message
.
data
if
not
plugin
.
is_parent
(
self
):
return
...
...
@@ -171,8 +172,9 @@ class AnimationPlugin(ComponentPlugin):
self
.
_parent
.
start_stop_animation
()
def
msg_update_animation_icon
(
self
,
plugin
):
def
msg_update_animation_icon
(
self
,
message
):
plugin
=
message
.
data
if
not
plugin
.
is_parent
(
self
):
return
...
...
@@ -181,8 +183,9 @@ class AnimationPlugin(ComponentPlugin):
else
:
self
.
startStop
.
SetBitmapLabel
(
ICONS
[
"play"
,
32
,
32
])
def
msg_set_trajectory
(
self
,
plugin
):
def
msg_set_trajectory
(
self
,
message
):
plugin
=
message
.
data
if
not
plugin
.
is_parent
(
self
):
return
...
...
MDANSE/GUI/Plugins/AtomSelectionPlugin.py
View file @
5ca3f3ba
...
...
@@ -344,7 +344,7 @@ class AtomSelectionPlugin(UserDefinitionPlugin):
self
.
_selectionSummary
.
Clear
()
PUBLISHER
.
sendMessage
(
'msg_clear_selection'
,
plugin
=
self
)
PUBLISHER
.
sendMessage
(
'msg_clear_selection'
,
data
=
self
)
def
on_display_keyword_values
(
self
,
event
=
None
):
...
...
@@ -384,7 +384,7 @@ class AtomSelectionPlugin(UserDefinitionPlugin):
def
msg_select_atoms_from_viewer
(
self
,
message
):
dataPlugin
,
selection
=
message
dataPlugin
,
selection
=
message
.
data
if
dataPlugin
!=
get_data_plugin
(
self
):
return
...
...
@@ -397,7 +397,7 @@ class AtomSelectionPlugin(UserDefinitionPlugin):
_
,
self
.
_selection
=
self
.
_query
.
parse
()
PUBLISHER
.
sendMessage
(
"msg_set_selection"
,
plugin
=
self
)
PUBLISHER
.
sendMessage
(
"msg_set_selection"
,
data
=
self
)
@
property
def
selection
(
self
):
...
...
MDANSE/GUI/Plugins/IPlugin.py
View file @
5ca3f3ba
...
...
@@ -158,7 +158,7 @@ class IPlugin(wx.Panel):
self
.
_currentWindow
=
self
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
plugin
=
self
)
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
data
=
self
)
def
build_dialog
(
self
):
...
...
@@ -198,6 +198,6 @@ class IPlugin(wx.Panel):
self
.
_currentWindow
=
window
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
plugin
=
window
)
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
data
=
window
)
\ No newline at end of file
MDANSE/GUI/Plugins/JobPlugin.py
View file @
5ca3f3ba
...
...
@@ -123,7 +123,7 @@ class JobPlugin(ComponentPlugin):
time
.
sleep
(
1
)
PUBLISHER
.
sendMessage
(
"msg_start_job"
,
message
=
None
)
PUBLISHER
.
sendMessage
(
"msg_start_job"
,
data
=
None
)
def
on_save
(
self
,
event
=
None
):
...
...
@@ -152,7 +152,7 @@ class JobPlugin(ComponentPlugin):
self
.
_parent
.
mgr
.
Update
()
PUBLISHER
.
sendMessage
(
"msg_set_data"
,
plugin
=
self
)
PUBLISHER
.
sendMessage
(
"msg_set_data"
,
data
=
self
)
def
on_close
(
self
,
event
):
...
...
@@ -179,7 +179,7 @@ class JobFrame(wx.Frame):
plugin
=
REGISTRY
[
'plugin'
][
self
.
_jobType
](
self
)
PUBLISHER
.
sendMessage
(
"msg_set_data"
,
plugin
=
plugin
)
PUBLISHER
.
sendMessage
(
"msg_set_data"
,
data
=
plugin
)
if
__name__
==
"__main__"
:
...
...
MDANSE/GUI/Plugins/MolecularViewerPlugin.py
View file @
5ca3f3ba
...
...
@@ -231,8 +231,9 @@ class MolecularViewerPanel(ComponentPlugin):
del
self
.
_surface
self
.
_surface
=
None
def
msg_set_selection
(
self
,
plugin
):
def
msg_set_selection
(
self
,
message
):
plugin
=
message
.
data
if
not
self
.
is_parent
(
plugin
):
return
...
...
@@ -240,7 +241,7 @@ class MolecularViewerPanel(ComponentPlugin):
def
on_show_selection_box
(
self
,
message
):
window
,
show
=
message
window
,
show
=
message
.
data
if
get_data_plugin
(
self
)
!=
get_data_plugin
(
window
):
return
...
...
@@ -249,7 +250,7 @@ class MolecularViewerPanel(ComponentPlugin):
def
on_enable_picking
(
self
,
message
):
window
,
state
=
message
window
,
state
=
message
.
data
if
get_data_plugin
(
self
)
!=
get_data_plugin
(
window
):
return
...
...
@@ -334,7 +335,7 @@ class MolecularViewerPanel(ComponentPlugin):
self
.
_trajectoryLoaded
=
True
PUBLISHER
.
sendMessage
(
'msg_set_trajectory'
,
plugin
=
self
)
PUBLISHER
.
sendMessage
(
'msg_set_trajectory'
,
data
=
self
)
def
color_string_to_RGB
(
self
,
s
):
...
...
@@ -597,7 +598,7 @@ class MolecularViewerPanel(ComponentPlugin):
self
.
set_configuration
(
self
.
_timerCounter
)
self
.
_timerCounter
+=
1
PUBLISHER
.
sendMessage
(
"msg_timer"
,
plugin
=
self
)
PUBLISHER
.
sendMessage
(
"msg_timer"
,
data
=
self
)
def
set_rendering_mode
(
self
,
mode
):
if
not
self
.
_trajectoryLoaded
:
...
...
@@ -677,7 +678,7 @@ class MolecularViewerPanel(ComponentPlugin):
self
.
show_selection
(
list
(
self
.
__pickedAtoms
))
PUBLISHER
.
sendMessage
(
'msg_select_atoms_from_viewer'
,
message
=
(
self
.
dataplugin
,
list
(
self
.
__pickedAtoms
)))
PUBLISHER
.
sendMessage
(
'msg_select_atoms_from_viewer'
,
data
=
(
self
.
dataplugin
,
list
(
self
.
__pickedAtoms
)))
def
box_atoms
(
self
,
atomsList
):
...
...
@@ -733,7 +734,7 @@ class MolecularViewerPanel(ComponentPlugin):
UD_STORE
.
save
()
PUBLISHER
.
sendMessage
(
"msg_set_ud"
)
PUBLISHER
.
sendMessage
(
"msg_set_ud"
,
data
=
None
)
LOGGER
(
'User definition %r successfully set.'
%
name
,
'info'
,[
'console'
])
...
...
@@ -784,15 +785,16 @@ class MolecularViewerPanel(ComponentPlugin):
self
.
stop_animation
()
if
check
:
PUBLISHER
.
sendMessage
(
"msg_switch_viewers_state"
,
viewer
=
self
)
PUBLISHER
.
sendMessage
(
"msg_switch_viewers_state"
,
data
=
self
)
PUBLISHER
.
sendMessage
(
'msg_animate_trajectory'
,
plugin
=
self
)
PUBLISHER
.
sendMessage
(
'msg_animate_trajectory'
,
data
=
self
)
def
msg_switch_viewers_state
(
self
,
viewer
):
def
msg_switch_viewers_state
(
self
,
message
):
if
not
self
.
_animationLoop
:
return
viewer
=
message
.
data
if
viewer
==
self
:
return
...
...
@@ -1002,8 +1004,9 @@ class MolecularViewerPanel(ComponentPlugin):
return
assembly
def
msg_clear_selection
(
self
,
plugin
):
def
msg_clear_selection
(
self
,
message
):
plugin
=
message
.
data
if
not
self
.
is_parent
(
plugin
):
return
...
...
MDANSE/GUI/Plugins/UserDefinitionPlugin.py
View file @
5ca3f3ba
...
...
@@ -87,7 +87,7 @@ class UserDefinitionPlugin(ComponentPlugin):
UD_STORE
.
set_definition
(
self
.
_target
,
self
.
type
,
name
,
value
)
PUBLISHER
.
sendMessage
(
"msg_set_ud"
)
PUBLISHER
.
sendMessage
(
"msg_set_ud"
,
data
=
None
)
LOGGER
(
'User definition %r successfully set.'
%
name
,
'info'
,[
'console'
])
...
...
MDANSE/GUI/PluginsTreePanel.py
View file @
5ca3f3ba
...
...
@@ -169,11 +169,12 @@ class PluginsTreePanel(wx.Panel):
self
.
set_plugins_tree
(
subnode
,
v
)
def
msg_set_plugins_tree
(
self
,
plugin
):
def
msg_set_plugins_tree
(
self
,
message
):
if
self
.
_tree
.
GetCount
()
!=
0
:
self
.
_tree
.
DeleteChildren
(
self
.
_root
)
plugin
=
message
.
data
if
plugin
is
None
:
return
...
...
MDANSE/GUI/UserDefinitionViewer.py
View file @
5ca3f3ba
...
...
@@ -203,7 +203,7 @@ class UserDefinitionViewer(wx.Dialog):
self
.
_udTree
.
clear
()
self
.
_info
.
Clear
()
PUBLISHER
.
sendMessage
(
"msg_set_ud"
)
PUBLISHER
.
sendMessage
(
"msg_set_ud"
,
data
=
None
)
def
on_save_ud
(
self
,
event
):
...
...
MDANSE/GUI/Widgets/AtomSelectionWidget.py
View file @
5ca3f3ba
...
...
@@ -129,7 +129,7 @@ class AtomSelectionWidget(UserDefinitionWidget):
else
:
return
uds
def
msg_set_ud
(
self
):
def
msg_set_ud
(
self
,
message
):
uds
=
UD_STORE
.
filter
(
self
.
_basename
,
self
.
type
)
...
...
MDANSE/GUI/Widgets/IWidget.py
View file @
5ca3f3ba
...
...
@@ -108,8 +108,9 @@ class IWidget(wx.Panel):
def
set_data
(
self
,
datakey
):
pass
def
_set_data
(
self
,
plugin
):
def
_set_data
(
self
,
message
):
plugin
=
message
.
data
if
not
plugin
.
is_parent
(
self
):
return
...
...
MDANSE/GUI/Widgets/McStasInstrumentWidget.py
View file @
5ca3f3ba
...
...
@@ -80,7 +80,7 @@ class McStasInstrumentWidget(IWidget):
self
.
_instrument
.
Append
(
path
)
self
.
_instrument
.
Select
(
self
.
_instrument
.
GetCount
()
-
1
)
PUBLISHER
.
sendMessage
(
"msg_set_instrument"
,
message
=
(
self
,
instrParams
))
PUBLISHER
.
sendMessage
(
"msg_set_instrument"
,
data
=
(
self
,
instrParams
))
def
on_select_instrument
(
self
,
event
):
...
...
MDANSE/GUI/Widgets/NetCDFInputFileWidget.py
View file @
5ca3f3ba
...
...
@@ -64,7 +64,7 @@ class NetCDFInputWidget(IWidget):
filename
=
event
.
GetString
()
PUBLISHER
.
sendMessage
(
"msg_set_netcdf"
,
message
=
(
self
,
filename
))
PUBLISHER
.
sendMessage
(
"msg_set_netcdf"
,
data
=
(
self
,
filename
))
def
set_data
(
self
,
datakey
):
...
...
@@ -77,7 +77,7 @@ class NetCDFInputWidget(IWidget):
self
.
_selectNetCDF
.
SetStringSelection
(
datakey
)
PUBLISHER
.
sendMessage
(
"msg_set_netcdf"
,
message
=
(
self
,
datakey
))
PUBLISHER
.
sendMessage
(
"msg_set_netcdf"
,
data
=
(
self
,
datakey
))
def
get_widget_value
(
self
):
...
...
MDANSE/GUI/Widgets/UserDefinitionWidget.py
View file @
5ca3f3ba
...
...
@@ -59,7 +59,7 @@ class UserDefinitionDialog(wx.Dialog):
self
.
_plugin
.
set_trajectory
(
trajectory
)
PUBLISHER
.
sendMessage
(
"msg_set_data"
,
plugin
=
self
.
_plugin
)
PUBLISHER
.
sendMessage
(
"msg_set_data"
,
data
=
self
.
_plugin
)
@
property
def
plugin
(
self
):
...
...
@@ -129,7 +129,7 @@ class UserDefinitionWidget(IWidget):
self
.
msg_set_ud
()
def
msg_set_ud
(
self
):
def
msg_set_ud
(
self
,
message
):
uds
=
UD_STORE
.
filter
(
self
.
_basename
,
self
.
type
)
...
...
MDANSE/GUI/WorkingPanel.py
View file @
5ca3f3ba
...
...
@@ -121,7 +121,7 @@ class WorkingPanel(wx.Panel):
dataPlugin
=
self
.
_notebook
.
GetPage
(
self
.
_notebook
.
GetSelection
())
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
plugin
=
dataPlugin
)
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
data
=
dataPlugin
)
def
on_close_page
(
self
,
event
):
...
...
@@ -131,5 +131,5 @@ class WorkingPanel(wx.Panel):
return
if
self
.
_notebook
.
GetPageCount
()
==
1
:
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
plugin
=
None
)
PUBLISHER
.
sendMessage
(
'msg_set_plugins_tree'
,
data
=
None
)
\ No newline at end of file
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