From ea73629e106c1ba77bcd09feac7e22035f28b7d7 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 20 Nov 2003 03:30:18 +0000 Subject: [PATCH] Se arregla un bug y se ponen caudales > 0 en el ejemplo :) --- Server/include/plaqui/server/plant.h | 7 ++++++ Server/src/plant.cpp | 18 ++++++++++++++++ Server/tests/prueba.xml | 32 ++++++++++++++-------------- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/Server/include/plaqui/server/plant.h b/Server/include/plaqui/server/plant.h index 72959ca..78dea2f 100644 --- a/Server/include/plaqui/server/plant.h +++ b/Server/include/plaqui/server/plant.h @@ -107,6 +107,13 @@ namespace Server { bool transmission_stop(const string& host, const Connection::Port& port); + /** + * Borra una transmisión de la lista de transmisiones al finalizar. + * + * \param transmission Transmisión a eliminar. + */ + bool on_transmission_finished(Transmitter* transmission); + /** * Abre (o cierra) un elemento de la planta. * diff --git a/Server/src/plant.cpp b/Server/src/plant.cpp index b01f1a5..ce9f737 100644 --- a/Server/src/plant.cpp +++ b/Server/src/plant.cpp @@ -153,6 +153,24 @@ bool Plant::transmission_stop(const string& host, return false; // No la encontró. } +bool Plant::on_transmission_finished(Transmitter* transmission) { +#ifdef DEBUG + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": on_transmission_finished(transmission = " + << transmission << ")" << endl; +#endif // DEBUG + Glib::Mutex::Lock lock(transmissions_mutex); + transmissions.remove(transmission); +#ifdef DEBUG + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": lista de conexiones" << endl; + for (TransmitterList::const_iterator i = transmissions.begin(); + i != transmissions.end(); i++) { + cerr << "\t " << *i << endl; + } +#endif // DEBUG +} + bool Plant::set_open(const std::string& element, bool open) { #ifdef DEBUG cerr << __FILE__ << "(" << __LINE__ << ")" diff --git a/Server/tests/prueba.xml b/Server/tests/prueba.xml index 49861cb..6b4e36c 100644 --- a/Server/tests/prueba.xml +++ b/Server/tests/prueba.xml @@ -1,7 +1,7 @@ - 0,00 + 50,00 0 0 @@ -15,7 +15,7 @@ 64 - 0,00 + 40,00 bomba0 tubo2 @@ -25,7 +25,7 @@ 64 - 0,00 + 40,00 codo1 division3 @@ -41,13 +41,13 @@ codo4 tubo2 - 0,00 + 40,00 2 128 224 - 0,00 + 40,00 tubo5 division3 @@ -57,7 +57,7 @@ 256 - 0,00 + 30,00 codo4 tanque6 @@ -67,8 +67,8 @@ 320 - 0,00 - 0,00 + 150,00 + 75,00 0 0 @@ -83,7 +83,7 @@ 416 - 0,00 + 40,00 exclusa18 drenaje8 @@ -101,7 +101,7 @@ 512 - 0,00 + 20,00 tubo10 division3 @@ -111,7 +111,7 @@ 224 - 0,00 + 25,00 codo12 codo9 @@ -127,13 +127,13 @@ exclusa13 tubo15 - 0,00 + 45,00 0 320 64 - 0,00 + 30,00 tubo10 union11 @@ -153,7 +153,7 @@ 64 - 0,00 + 15,00 0 0 @@ -167,7 +167,7 @@ 64 - 0,00 + 20,00 union11 codo16 @@ -177,7 +177,7 @@ 128 - 0,00 + 25,00 drenaje17 tubo15 -- 2.43.0