- 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
This commit is contained in:
tchernobog 2006-09-02 14:48:03 +00:00
parent 64839353bb
commit c10ed2f4fb
4 changed files with 15 additions and 5 deletions

View File

@ -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 \

View File

@ -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();
}

View File

@ -64,7 +64,6 @@ namespace sgpem
private:
Glib::RefPtr<Gnome::Glade::Xml> _refXml;
SimulationWidget* _simulation_widget;
SimulationController _controller;
// Used to store the loaded snapshot filename, when !empty

View File

@ -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