2 /* Test pedorro a ver que pasa con lo que esta programado!! */
3 /* Compilar : g++ -Wall -o test -I../include *.cpp */
13 using namespace PlaQui::Model;
15 int main(int argc, char *argv[])
24 Drainage *dren1, *dren2;
27 bomba1 = new Pump("bomba");
28 bomba1->set_max_flow(30);
29 salida1 = new Conduct("salida_1");
30 salida1->set_max_flow(2);
31 salida2 = new Conduct("salida_2");
32 salida2->set_max_flow(5);
33 exclusa1 = new Exclusa("exclusa1");
35 split = new Splitter("splitter");
36 split->set_max_flow(8);
37 entrada = new Conduct("entrada");
38 entrada->set_max_flow(10);
40 dren1 = new Drainage("drenaje1");
41 dren2 = new Drainage("drenaje2");
43 bomba1->connect(exclusa1, IConector::OUT);
44 exclusa1->connect(bomba1, IConector::IN);
45 exclusa1->connect(entrada, IConector::OUT);
46 entrada->connect(exclusa1, IConector::IN);
47 entrada->connect(split, IConector::OUT);
48 split->connect(entrada, IConector::IN);
49 split->connect(salida1, IConector::OUT);
50 split->connect(salida2, IConector::OUT);
51 salida1->connect(split, IConector::IN);
52 salida2->connect(split, IConector::IN);
53 salida1->connect(dren1, IConector::OUT);
54 salida2->connect(dren2, IConector::OUT);
56 //// LOGICA DE CONTROL!!
57 // CONECTO LA SALIDA DE LA EXCLUSA A LA ENTRADA DE LA BOMBA
58 bomba1->connect_input_logic( exclusa1->get_logic_output() );
82 //bomba1->deactivate();
83 // Ahora cierro la exclusa!, la bomba deberia apagarse!!!
97 // TRATANDO DE HACER ANDAR AL UNION
99 Conduct *c1, *c2, *c3;
103 p1 = new Pump("Bomba 1");
104 p1->set_max_flow(100);
105 p2 = new Pump("Bomba 2");
106 p2->set_max_flow(100);
107 c1 = new Conduct("Para B1");
109 c2 = new Conduct("Para B2");
111 c3 = new Conduct("Salida");
113 d1 = new Drainage("Drenaje");
114 u1 = new Union("Union");
117 p1->connect(c1, IConector::OUT);
118 p2->connect(c2, IConector::OUT);
119 c1->connect(p1, IConector::IN);
120 c2->connect(p2, IConector::IN);
122 u1->connect(c1, IConector::IN);
123 u1->connect(c2, IConector::IN);
124 c1->connect(u1, IConector::OUT);
125 c2->connect(u1, IConector::OUT);
127 u1->connect(c3, IConector::OUT);
128 c3->connect(u1, IConector::IN);
130 c3->connect(d1, IConector::OUT);
131 d1->connect(c3, IConector::IN);