Commit 161cd776 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - module input connectors now get updated if they are disconnected.

parent 781f3214
......@@ -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 );
}
......
......@@ -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
......
......@@ -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 )
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment