X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/950f83d0e71dc886fcf5be9889796c5b2a85fa4c..78a6866a5076cee1015d8985b5bbbb84adf32576:/Model/src/pump.cpp diff --git a/Model/src/pump.cpp b/Model/src/pump.cpp index fb355a0..7332c91 100644 --- a/Model/src/pump.cpp +++ b/Model/src/pump.cpp @@ -14,10 +14,14 @@ Pump::Pump(const std::string &_name):Source(_name),Control(_name) input = new ByPass(); output = new ByPass(); ((ByPass *)output)->set_control(this); + /* El color de la bomba siempre esta actualizado */ + color_updated = true; } Pump::~Pump() { + delete input; + delete output; } void Pump::update(int dir) @@ -36,8 +40,11 @@ void Pump::update(int dir) void Pump::simulate() { +#ifdef DEBUG std::cout << ((active && open)?" (funcionando)":" (apagada)") << std::endl; +#endif updated = false; + color_updated = true; } bool Pump::get_output() @@ -58,6 +65,10 @@ void Pump::recieve_msg(int msg, IConector *who, void *data) if (tmp < actual_flow) actual_flow = tmp; } break; + case MSG_RESPONSE_COLOR: + /* Por las dudas, la bomba no debe cambiar de color */ + ; + break; default: Source::recieve_msg(msg, who, data); }