[OpenWalnut-Dev] [OWci] r7349: [ADD] modules can be made active or inactive via script

Sebastian Eichelbaum openwalnut at nemtics.com
Tue May 5 16:49:06 CEST 2015


Hi

Please be so kind to copy this changeset into the default branch. You could use hg graft to achieve this easily:

# Switch to target branch
hg branch default

# Cherry-pick changeset XYZ12....
hg graft -r XYZ1212341234


Thanks!
Best,
Sebastian

On Mon, 04 May 2015, reichenbach at informatik.uni-leipzig.de wrote:

>*Branch screenshot_format_from_script*
>[ADD] modules can be made active or inactive via script
>
>changeset 7349:8d3906bbe9dd in /srv/hg/ow (Mon May 04 19:22:28 2015 +0200):
>
>http://www.openwalnut.org/projects/openwalnut/repository/revisions/7349
>
>diffstat:
>
> src/core/kernel/WModule.cpp                            |  5 +++++
> src/core/kernel/WModule.h                              |  7 +++++++
> src/core/scripting/python/WScriptInterpreterPython.cpp |  3 ++-
> src/core/scripting/wrappers/WModuleWrapper.cpp         |  6 ++++++
> src/core/scripting/wrappers/WModuleWrapper.h           |  7 +++++++
> 5 files changed, 27 insertions(+), 1 deletions(-)
>
>diffs (75 lines):
>
>diff -r 9512a64531a6 -r 8d3906bbe9dd src/core/kernel/WModule.cpp
>--- a/src/core/kernel/WModule.cpp	Wed Apr 29 13:41:01 2015 +0200
>+++ b/src/core/kernel/WModule.cpp	Mon May 04 19:22:28 2015 +0200
>@@ -603,6 +603,11 @@
>     return m_libPath;
> }
>
>+void WModule::setActive( bool active )
>+{
>+    m_active->set( active, true );
>+}
>+
> void WModule::setPackageName( std::string name )
> {
>     m_packageName = name;
>diff -r 9512a64531a6 -r 8d3906bbe9dd src/core/kernel/WModule.h
>--- a/src/core/kernel/WModule.h	Wed Apr 29 13:41:01 2015 +0200
>+++ b/src/core/kernel/WModule.h	Mon May 04 19:22:28 2015 +0200
>@@ -428,6 +428,13 @@
>      */
>     const WRequirement* checkRequirements() const;
>
>+    /**
>+     * Set whether this module shall be active. Deactivating a module will deactivate its graphics, etc.
>+     *
>+     * \param active true, if the module should be active, false otherwise
>+     */
>+    void setActive( bool active = true );
>+
> protected:
>     /**
>      * Entry point after loading the module. Runs in separate thread.
>diff -r 9512a64531a6 -r 8d3906bbe9dd src/core/scripting/python/WScriptInterpreterPython.cpp
>--- a/src/core/scripting/python/WScriptInterpreterPython.cpp	Wed Apr 29 13:41:01 2015 +0200
>+++ b/src/core/scripting/python/WScriptInterpreterPython.cpp	Mon May 04 19:22:28 2015 +0200
>@@ -137,7 +137,8 @@
>                                      .def( "getProperties", &WModuleWrapper::getProperties )
>                                      .def( "getInformationProperties", &WModuleWrapper::getInformationProperties )
>                                      .def( "getInputConnector", &WModuleWrapper::getInputConnector )
>-                                     .def( "getOutputConnector", &WModuleWrapper::getOutputConnector );
>+                                     .def( "getOutputConnector", &WModuleWrapper::getOutputConnector )
>+                                     .def( "active", &WModuleWrapper::setActive );
>
>     // bind the kernel's root container to the "rootContainer" variable in the python namespace
>     // this allows access to the modules via this variable
>diff -r 9512a64531a6 -r 8d3906bbe9dd src/core/scripting/wrappers/WModuleWrapper.cpp
>--- a/src/core/scripting/wrappers/WModuleWrapper.cpp	Wed Apr 29 13:41:01 2015 +0200
>+++ b/src/core/scripting/wrappers/WModuleWrapper.cpp	Mon May 04 19:22:28 2015 +0200
>@@ -72,3 +72,9 @@
> {
>     return WOutputConnectorWrapper( m_module->getOutputConnector( name ) );
> }
>+
>+void WModuleWrapper::setActive( bool active )
>+{
>+    m_module->setActive( active );
>+}
>+
>diff -r 9512a64531a6 -r 8d3906bbe9dd src/core/scripting/wrappers/WModuleWrapper.h
>--- a/src/core/scripting/wrappers/WModuleWrapper.h	Wed Apr 29 13:41:01 2015 +0200
>+++ b/src/core/scripting/wrappers/WModuleWrapper.h	Mon May 04 19:22:28 2015 +0200
>@@ -107,6 +107,13 @@
>      */
>     WOutputConnectorWrapper getOutputConnector( std::string const& name );
>
>+    /**
>+     * Set whether this module shall be active. Deactivating a module will deactivate its graphics, etc.
>+     *
>+     * \param active true, if the module should be active, false otherwise
>+     */
>+    void setActive( bool active );
>+
> private:
>     //! A pointer to the module.
>     boost::shared_ptr< WModule > m_module;
>_______________________________________________
>All-openwalnut-commits mailing list
>All-openwalnut-commits at lists.informatik.uni-leipzig.de
>http://lists.informatik.uni-leipzig.de/mailman/listinfo/all-openwalnut-commits

-- 
Dr. rer. nat. Sebastian Eichelbaum
Nemtics Visualization - Software | Training | Consulting
  
http://www.sebastian-eichelbaum.de
http://www.nemtics.com
sebastian.eichelbaum at nemtics.com
+49 176 34541337
  
Gohliser Straße 20 - D-04105 Leipzig


More information about the OpenWalnut-Dev mailing list