- Pump *pump = dynamic_cast<Pump *>(find(name));
-
- if (!pump) {
- // Ups!, "name" no era un Pump!!!
+ IConector *tmp = find(name);
+ Pump *p;
+ Exclusa *e;
+ if ((p = dynamic_cast<Pump*>(tmp))) {
+ if (open) {
+ p->activate();
+ } else {
+ p->deactivate();
+ }
+ } else if ((e = dynamic_cast<Exclusa*>(tmp))) {
+ if (open) {
+ e->open();
+ } else {
+ e->close();
+ }
+ } else {