From c10ed2f4fb7fd88cba6cb2eef399f8c3c3c4b7b9 Mon Sep 17 00:00:00 2001 From: tchernobog Date: Sat, 2 Sep 2006 14:48:03 +0000 Subject: [PATCH] - Add debug printout in SimulationWidget - Add holt_widget.{cc,hh} to main executable sources git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1002 3ecf2c5c-341e-0410-92b4-d18e462d057c --- Makefile.am | 2 ++ src/gui_builder.cc | 13 +++++++++---- src/gui_builder.hh | 1 - src/simulation_widget.cc | 4 ++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2b64892..3c33728 100644 --- a/Makefile.am +++ b/Makefile.am @@ -302,6 +302,7 @@ sgpemv2_SOURCES = \ src/configure_policy_dialog.cc \ src/graphical_preferences_editor.cc \ src/gui_builder.cc \ + src/holt_widget.cc \ src/main.cc \ src/parse_opts.cc \ src/resources_widget.cc \ @@ -318,6 +319,7 @@ noinst_HEADERS += \ src/configure_policy_dialog.hh \ src/graphical_preferences_editor.hh \ src/gui_builder.hh \ + src/holt_widget.hh \ src/main.hh \ src/parse_opts.hh \ src/resources_widget.hh \ diff --git a/src/gui_builder.cc b/src/gui_builder.cc index baf8b7d..9ad00c2 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -25,6 +25,7 @@ #include "configure_policy_dialog.hh" #include "graphical_preferences_editor.hh" +#include "holt_widget.hh" #include "schedulables_tree_widget.hh" #include "simulation_widget.hh" #include "resources_widget.hh" @@ -517,7 +518,6 @@ GuiBuilder::GuiBuilder(const std::string& gladefile) // we have to remember to manually show custom added widgets: scheds_tree->show(); - // Resources ListView widget ResourcesWidget* resources_widget = NULL; _refXml->get_widget_derived("Resources.Tree", resources_widget); @@ -527,9 +527,14 @@ GuiBuilder::GuiBuilder(const std::string& gladefile) // Main simulation widget ScrolledWindow* simulation_window = NULL; _refXml->get_widget("SimulationScrolledWindow", simulation_window); - _simulation_widget = manage(new SimulationWidget(Simulation::get_instance())); - simulation_window->add(*_simulation_widget); - _simulation_widget->show(); + SimulationWidget& simulation_widget = *manage(new SimulationWidget(Simulation::get_instance())); + simulation_window->add(simulation_widget); + simulation_widget.show(); + + // Why this works, and SimulationWidget doesn't ?? + // HoltWidget& holt = *manage(new HoltWidget(Simulation::get_instance())); + // simulation_window->add(holt); + // holt.show(); } diff --git a/src/gui_builder.hh b/src/gui_builder.hh index 7450811..34ce26c 100644 --- a/src/gui_builder.hh +++ b/src/gui_builder.hh @@ -64,7 +64,6 @@ namespace sgpem private: Glib::RefPtr _refXml; - SimulationWidget* _simulation_widget; SimulationController _controller; // Used to store the loaded snapshot filename, when !empty diff --git a/src/simulation_widget.cc b/src/simulation_widget.cc index 4ba0227..3594a1c 100644 --- a/src/simulation_widget.cc +++ b/src/simulation_widget.cc @@ -585,6 +585,8 @@ SimulationWidget::draw_widget(cairo_t* ctx) void SimulationWidget::calc_drawing_size(cairo_t* ctx, size_t& width, size_t& height) { + std::cout << "Simulation widget BEFORE calc_drawing_size width=" << width << " height=" << height << std::endl; + if(!_simulation) return; const History& hist = _simulation->get_history(); @@ -605,6 +607,8 @@ SimulationWidget::calc_drawing_size(cairo_t* ctx, size_t& width, size_t& height) height = (1.0 + 3.0 * _n_proc + 3.0) * _y_unit; if(_show_threads) height += _n_thr * _y_unit; + + std::cout << "Simulation widget AFTER calc_drawing_size width=" << width << " height=" << height << std::endl; } void