in_slots = 1;
out_slots = 2;
max_flow = actual_flow = 0.0f;
+ updated = true;
}
Splitter::~Splitter()
switch (msg) {
case MSG_QUERY_MAX_FLOW_OUT: {
+ if (updated) {
+ who->recieve_msg(MSG_RESPONSE_MAX_FLOW, this, &actual_flow);
+ }
// Me preguntan por el flujo máximo.
// Primero me actualizo, y luego respondo
actual_flow = *((float *)data);
break;
case MSG_RESPONSE_MAX_FLOW: {
float max = *((float *)data);
+#ifdef DEBUG
+ std::cout << name << ":Split " << max << std::endl;
+#endif
if (pos == OUT) {
if (max < actual_flow) actual_flow = max;
if (max_flow < actual_flow) actual_flow = max_flow;
return;
}
+ std::list<IConector *>::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 actual = " << actual_flow << std::endl;
+#endif
updated = false;
}