X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/844c2c14792f3f8fb9f805c00b0a5206a24b28ba..fb8d2fb83534b0ca76f81e6d107e38d002642a46:/Model/src/tank.cpp?ds=sidebyside diff --git a/Model/src/tank.cpp b/Model/src/tank.cpp index 93c8564..3f2fe43 100644 --- a/Model/src/tank.cpp +++ b/Model/src/tank.cpp @@ -52,8 +52,10 @@ void Tank::simulate() // le resto lo que entrego litros -= actual_out_flow; +#ifdef DEBUG std::cout << name << "Capacidad: " << capacity; std::cout << " Litros : " << litros << std::endl; +#endif updated = false; } @@ -69,6 +71,9 @@ void Tank::recieve_msg(int msg, IConector *who, void *data) switch (msg) { case MSG_QUERY_MAX_FLOW_OUT: + if (updated) { + who->recieve_msg(MSG_RESPONSE_MAX_FLOW, this, &actual_in_flow); + } actual_in_flow = capacity - litros; if (*((float *)data) < actual_in_flow) actual_in_flow = *((float *)data);