X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/be1908f8097dbbc871bfd7c55432de43d25647b7..a4fcf877753b034b1df7fa73d41388849fbc9000:/Model/src/union.cpp diff --git a/Model/src/union.cpp b/Model/src/union.cpp index 26c404a..58bc8e1 100644 --- a/Model/src/union.cpp +++ b/Model/src/union.cpp @@ -12,6 +12,7 @@ Union::Union(const std::string &_name):Transport(_name) in_on_zero = 0; in_ready = 0; actual_flow = 999999; + updated = false; } Union::~Union() @@ -27,7 +28,6 @@ void Union::recieve_msg(int msg, IConector *who, void *data) for(i=in_list.begin(); i!=in_list.end(); i++) { if ((*i) == who) pos = IN; } - switch (msg) { case MSG_QUERY_MAX_FLOW_OUT: { // Me preguntan por el flujo máximo. @@ -35,6 +35,11 @@ void Union::recieve_msg(int msg, IConector *who, void *data) float m_data = *((float *)data)*2; float tmp; + if (updated) { + who->recieve_msg(MSG_RESPONSE_MAX_FLOW, this, &actual_flow); + break; + } + updated = true; if (m_data == 0) { in_on_zero++; tmp = 0.0f;