@@ -68,7 +68,7 @@ void Port::detach(Connection* conn)
6868 connections_.erase (pos);
6969}
7070
71- const Connection* Port::connection (size_t i) const
71+ Connection* Port::connection (size_t i) const
7272{
7373 return connections_[i];
7474}
@@ -154,10 +154,30 @@ boost::signals2::connection InputPort::connectDataOnPortHasChanged(const DataOnP
154154{
155155 return sink ()->connectDataHasChanged ([this , subscriber] (DatatypeHandle data)
156156 {
157- subscriber (this ->id (), data);
157+ std::cout << " connectDataHasChanged" << std::endl;
158+ if (!this ->connections_ .empty ())
159+ {
160+ std::cout << " connectDataHasChanged connections not empty" << std::endl;
161+ auto conn = *this ->connections_ .begin ();
162+ if (!conn->disabled ())
163+ {
164+ std::cout << " enabled: " << conn->id () << std::endl;
165+ subscriber (this ->id (), data);
166+ }
167+ else
168+ {
169+ std::cout << " disabled: " << conn->id () << std::endl;
170+ }
171+ }
172+ std::cout << " connectDataHasChanged connections is empty" << std::endl;
158173 });
159174}
160175
176+ void InputPort::resendNewDataSignal ()
177+ {
178+ sink ()->forceFireDataHasChanged ();
179+ }
180+
161181OutputPort::OutputPort (ModuleInterface* module , const ConstructionParams& params, DatatypeSourceInterfaceHandle source)
162182 : Port(module , params), source_(source)
163183{
@@ -178,8 +198,13 @@ void OutputPort::sendData(DatatypeHandle data)
178198
179199 for (Connection* c : connections_)
180200 {
201+ std::cout << c->id ();
181202 if (c && !c->disabled () && c->iport_ )
203+ {
182204 source_->send (c->iport_ ->sink ());
205+ std::cout << " \t sent." ;
206+ }
207+ std::cout << std::endl;
183208 }
184209}
185210
0 commit comments