X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/bd2c5ebb465f2265d618feefb66479e5259dcfaa..c89fed66c4fa3004270e84562e62b796f1208293:/Model/src/pump.cpp diff --git a/Model/src/pump.cpp b/Model/src/pump.cpp index 93b8b72..7332c91 100644 --- a/Model/src/pump.cpp +++ b/Model/src/pump.cpp @@ -14,6 +14,8 @@ 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() @@ -27,7 +29,6 @@ void Pump::update(int dir) if (updated) return; // Me fijo si me tengo que apagar automaticamente open = input->get_output(); - std::cout << name << " open = " << (open?"true":"false") << std::endl; if (active && open) actual_flow = max_flow; else @@ -43,6 +44,7 @@ void Pump::simulate() std::cout << ((active && open)?" (funcionando)":" (apagada)") << std::endl; #endif updated = false; + color_updated = true; } bool Pump::get_output() @@ -63,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); }