X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/f61a5ebd00d4620af70c3780ba821f5af68def1c..66124e5142afe9748ba184592792fe307fd4a3b5:/Model/src/drainage.cpp?ds=inline diff --git a/Model/src/drainage.cpp b/Model/src/drainage.cpp index 09fd79d..22b57b0 100644 --- a/Model/src/drainage.cpp +++ b/Model/src/drainage.cpp @@ -8,8 +8,7 @@ Drainage::Drainage(const std::string &_name):Drain(_name),Control(_name) { in_slots = 1; out_slots = 0; - // FIXME hacer INFINITO! - capacity = 99999; + capacity = INFINITO; actual_flow = 0.0f; } @@ -27,14 +26,11 @@ void Drainage::update(int dir) void Drainage::simulate() { - std::list::iterator i = in_list.begin(); - if (i != in_list.end()) { - PlantItem *o = (PlantItem *)(*i); - set_color( o->get_color() ); - } +#ifdef DEBUG std::cout << name << "::Flujo recibido = " << actual_flow << std::endl; +#endif updated = false; - actual_flow = 0; + color_updated = false; } void Drainage::recieve_msg(int msg, IConector *who, void *data) @@ -44,8 +40,7 @@ void Drainage::recieve_msg(int msg, IConector *who, void *data) case MSG_QUERY_MAX_FLOW_OUT: // FIXME Hacer INFINITO !!! actual_flow = *((float *)data); - tmp = 999999; - who->recieve_msg(MSG_RESPONSE_MAX_FLOW, this, &tmp); + who->recieve_msg(MSG_RESPONSE_MAX_FLOW, this, &actual_flow); updated = true; break; default: