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
OpenWalnut
OpenWalnut Core
Commits
161cd776
Commit
161cd776
authored
Dec 01, 2010
by
Sebastian Eichelbaum
Browse files
[CHANGE] - module input connectors now get updated if they are disconnected.
parent
781f3214
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
src/kernel/WModuleConnector.cpp
src/kernel/WModuleConnector.cpp
+1
-1
src/kernel/WModuleConnector.h
src/kernel/WModuleConnector.h
+10
-9
src/kernel/WModuleInputConnector.cpp
src/kernel/WModuleInputConnector.cpp
+5
-0
src/modules/textureMapper/WMTextureMapper.cpp
src/modules/textureMapper/WMTextureMapper.cpp
+2
-2
No files found.
src/kernel/WModuleConnector.cpp
View file @
161cd776
...
...
@@ -282,7 +282,7 @@ void WModuleConnector::disconnect( boost::shared_ptr<WModuleConnector> con, bool
con
->
m_connected
.
erase
(
shared_from_this
()
);
lock
.
unlock
();
// signal closed connection
// signal
"
closed connection
"
signal_ConnectionClosed
(
shared_from_this
(),
con
);
con
->
signal_ConnectionClosed
(
shared_from_this
(),
con
);
}
...
...
src/kernel/WModuleConnector.h
View file @
161cd776
...
...
@@ -277,6 +277,16 @@ protected:
*/
virtual
void
notifyConnectionClosed
(
boost
::
shared_ptr
<
WModuleConnector
>
here
,
boost
::
shared_ptr
<
WModuleConnector
>
there
);
/**
* Signal emitted whenever connection has been established.
*/
t_GenericSignalType
signal_ConnectionEstablished
;
/**
* Signal emitted whenever connection has been closed.
*/
t_GenericSignalType
signal_ConnectionClosed
;
private:
/**
...
...
@@ -289,15 +299,6 @@ private:
*/
std
::
string
m_description
;
/**
* Signal emitted whenever connection has been established.
*/
t_GenericSignalType
signal_ConnectionEstablished
;
/**
* Signal emitted whenever connection has been closed.
*/
t_GenericSignalType
signal_ConnectionClosed
;
};
#endif // WMODULECONNECTOR_H
...
...
src/kernel/WModuleInputConnector.cpp
View file @
161cd776
...
...
@@ -42,12 +42,17 @@ WModuleInputConnector::WModuleInputConnector( boost::shared_ptr< WModule > modul
// setup conditions
m_dataChangedCondition
=
boost
::
shared_ptr
<
WCondition
>
(
new
WCondition
()
);
// if connection is closed, also fire "data change"
signal_ConnectionClosed
.
connect
(
boost
::
bind
(
&
WModuleInputConnector
::
setUpdated
,
this
)
);
signal_ConnectionClosed
.
connect
(
boost
::
bind
(
&
WCondition
::
notify
,
m_dataChangedCondition
)
);
}
WModuleInputConnector
::~
WModuleInputConnector
()
{
// cleanup
m_DataChangedConnection
.
disconnect
();
signal_ConnectionClosed
.
disconnect_all_slots
();
}
bool
WModuleInputConnector
::
connectable
(
boost
::
shared_ptr
<
WModuleConnector
>
con
)
...
...
src/modules/textureMapper/WMTextureMapper.cpp
View file @
161cd776
...
...
@@ -138,11 +138,10 @@ void WMTextureMapper::moduleMain()
{
boost
::
shared_ptr
<
WDataSetSingle
>
dataSet
=
m_input
->
getData
();
debugLog
()
<<
"Registering new texture"
;
// de-register at datahandler
if
(
m_lastDataSet
)
{
debugLog
()
<<
"Removing previous texture."
;
WDataHandler
::
deregisterDataSet
(
m_lastDataSet
);
}
...
...
@@ -154,6 +153,7 @@ void WMTextureMapper::moduleMain()
// register new
if
(
m_lastDataSet
->
isTexture
()
)
{
debugLog
()
<<
"Registering new texture"
;
WDataHandler
::
registerDataSet
(
m_lastDataSet
);
}
else
...
...
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