+void 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__ << ")"
+ << ": set_open(element = " << element <<
+ ", open = " << open << ")." << endl;
+#endif // DEBUG
+ Glib::Mutex::Lock lock(simulator_mutex);
+ return simulator.set_open(element, open);
+}
+
+const string Plant::get_xml(void) const {
+#ifdef DEBUG
+ cerr << __FILE__ << "(" << __LINE__ << ")"
+ << ": get_xml()." << endl;
+#endif // DEBUG
+ ostringstream oss;
+ ifstream ifs(filename.c_str());
+ // XXX Saco la línea de definición de XML (<?xml ?>), ver si esta hecho muy
+ // feo.
+ ifs.ignore(50, '\n'); // Ignora 50 caracteres o hasta un enter.
+ ifs >> oss.rdbuf();
+ return oss.str();
+}
+
+void Plant::set_frequency(unsigned hz) {
+ Glib::Mutex::Lock lock(wait_time_mutex);
+ wait_time = hz ? (1000000u/hz) : DEFAULT_WAIT_TIME;
+}
+
+void Plant::set_paused(bool paused_) {
+ Glib::Mutex::Lock lock(paused_mutex);
+ paused = paused_;
+}
+