From cb1d85a4cc31429da7d41b497db795bc20df707e Mon Sep 17 00:00:00 2001 From: tchernobog Date: Wed, 6 Sep 2006 14:51:53 +0000 Subject: [PATCH] - Add a widget to show the ReadyQueue - Change slightly the gradients of the SimulationWidget to make them more aggressive. Bite, Fido! :-) git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1025 3ecf2c5c-341e-0410-92b4-d18e462d057c --- Makefile.am | 2 + glade/main-window.glade | 1080 ++++++++++++++-------------------- src/gui_builder.cc | 16 +- src/ready_queue_widget.cc | 73 +++ src/ready_queue_widget.hh | 46 ++ src/simulation_controller.cc | 3 + src/simulation_widget.cc | 233 +------- 7 files changed, 584 insertions(+), 869 deletions(-) create mode 100644 src/ready_queue_widget.cc create mode 100644 src/ready_queue_widget.hh diff --git a/Makefile.am b/Makefile.am index c474e00..12701f7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -306,6 +306,7 @@ sgpemv2_SOURCES = \ src/holt_widget.cc \ src/main.cc \ src/parse_opts.cc \ + src/ready_queue_widget.cc \ src/resources_widget.cc \ src/schedulable_state_widget.cc \ src/schedulables_tree_widget.cc \ @@ -323,6 +324,7 @@ noinst_HEADERS += \ src/holt_widget.hh \ src/main.hh \ src/parse_opts.hh \ + src/ready_queue_widget.hh \ src/resources_widget.hh \ src/schedulable_state_widget.hh \ src/schedulables_tree_widget.hh \ diff --git a/glade/main-window.glade b/glade/main-window.glade index 00561d3..a401c52 100644 --- a/glade/main-window.glade +++ b/glade/main-window.glade @@ -1,655 +1,451 @@ - - - + + + - - - SGPEMv2 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 800 - 600 - True - False - gtk-dialog-warning - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - - - - True - False - 0 - - - - True - - - - True - _File - True - - - - - - - True - gtk-open - True - - - - - - True - gtk-save - True - - - - - - True - gtk-save-as - True - - - - - - True - gtk-close - True - - - - - - True - - - - - - True - gtk-quit - True - - - - - - - - - - True - _Edit - True - - - - - - - True - gtk-preferences - True - - - - - - - - - - True - _View - True - - - - - - - True - Enable/disable threads visualization in Graphs - Show _Threads - True - - - - - - True - Show/Hide holt graph window - Show _Holt Graph - True - - - - - - - - - - True - _Simulation - True - - - - - - - True - gtk-media-play - True - - - - - - True - False - gtk-media-pause - True - - - - - - True - False - gtk-media-stop - True - - - - - - - True - - - - - - True - Continuous mode - True - True - - - - - - - - - - True - _Help - True - - - - - - - True - gtk-about - True - - - - - - - - - 0 - False - True - - - - - - True - GTK_ORIENTATION_HORIZONTAL - GTK_TOOLBAR_BOTH - True - True - - - - True - gtk-open - True - True - False - - - False - True - - - - - - True - gtk-save - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - Start the simulation - gtk-media-play - True - True - False - - - False - True - - - - - - True - False - gtk-media-pause - True - True - False - - - False - True - - - - - - True - False - gtk-media-stop - True - True - False - - - False - True - - - - - - True - True - True - True - - - False - False - - - - - - True - Scheduling Policy - True - gtk-convert - True - True - False - - - False - False - - - - - - True - True - True - True - - - False - False - - - - - - True - Resource Scheduling - True - gtk-select-color - True - True - False - - - False - False - - - - - 0 - False - True - - - - - - 1 - True - True - 200 - - - - True - - - - True - 0 - 0 - GTK_SHADOW_NONE - - - - True - 0 - 0 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_OUT - GTK_CORNER_TOP_LEFT - - - - - - - - - - - - True - <i>Schedulables</i> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 0 - 2 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - True - False - - - - - - True - 0 - 0 - GTK_SHADOW_NONE - - - - True - 0 - 0 - 1 - 1 - 0 - 0 - 12 - 0 - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_OUT - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - False - False - False - - - - - - - - - - True - <i>Resources</i> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 0 - 2 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - label_item - - - - - True - False - - - - - False - False - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - - - - True - True - - - - - 0 - True - True - - - - - - True - True - - - 0 - False - True - GTK_PACK_END - - - - - - True - <b>Ready queue: {</b> <b>}</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0 - 7 - 2 - PANGO_ELLIPSIZE_END - -1 - True - 0 - - - 0 - False - True - - - - - - - - False - Application Name - University of Padova, dept. of Pure and Applied Mathematics - An educational simulator for process scheduling policies in a monoprocessor computer. - SGPEMv2 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the terms of the GNU General Public License; for details see file COPYING contained in the source package. - Filippo Paparella <ironpipp@gmail.com> + + SGPEMv2 + 800 + 600 + gtk-dialog-warning + + + True + + + True + + + True + _File + True + + + + + True + gtk-open + True + True + + + + + True + gtk-save + True + True + + + + + True + gtk-save-as + True + True + + + + + True + gtk-close + True + True + + + + + True + + + + + True + gtk-quit + True + True + + + + + + + + + True + _Edit + True + + + + + True + gtk-preferences + True + True + + + + + + + + + True + _View + True + + + + + True + Enable/disable threads visualization in Graphs + Show _Threads + True + + + + + True + Show/Hide holt graph window + Show _Holt Graph + True + + + + + + + + + True + _Simulation + True + + + + + True + gtk-media-play + True + True + + + + + True + False + gtk-media-pause + True + True + + + + + True + False + gtk-media-stop + True + True + + + + + + True + + + + + True + True + Continuous mode + True + + + + + + + + + True + _Help + True + + + + + True + gtk-about + True + True + + + + + + + + + False + + + + + True + GTK_TOOLBAR_BOTH + + + True + gtk-open + + + + + True + gtk-save + + + + + True + + + + + True + gtk-media-play + Start the simulation + + + + + True + False + gtk-media-pause + + + + + True + False + gtk-media-stop + + + + + True + + + + + True + Scheduling Policy + True + gtk-convert + + + + + True + + + + + True + Resource Scheduling + True + gtk-select-color + + + + + False + 1 + + + + + True + + + False + 3 + + + + + True + True + 1 + 200 + + + True + + + True + 0,000000 + 0,000000 + GTK_SHADOW_NONE + + + True + 0,000000 + 0,000000 + 12 + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_OUT + + + + + + + + + + True + 0,000000 + 0,000000 + 2 + <i>Schedulables</i> + True + + + label_item + + + + + False + + + + + True + 0,000000 + 0,000000 + GTK_SHADOW_NONE + + + True + 0,000000 + 0,000000 + 12 + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_OUT + + + True + True + + + + + + + + + True + 0,000000 + 0,000000 + 2 + <i>Resources</i> + True + + + label_item + + + + + False + + + + + False + False + + + + + True + True + GTK_POLICY_AUTOMATIC + + + + + + + + 2 + + + + + True + + + False + GTK_PACK_END + 2 + + + + + + + University of Padova, dept. of Pure and Applied Mathematics + An educational simulator for process scheduling policies in a monoprocessor computer. + SGPEMv2 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the terms of the GNU General Public License; for details see file COPYING contained in the source package. + Filippo Paparella <ironpipp@gmail.com> Paolo Santi <psanti@studenti.math.unipd.it> Matteo Settenvini <matteo@member.fsf.org> Marco Trevisan <mtrevisa@studenti.math.unipd.it> Djina Verbanac <betalgez@yahoo.com> Luca Vezzaro <lvezzaro@studenti.math.unipd.it> - Giovanni Giacobbi <ggiacobb@studenti.math.unipd.it> + Giovanni Giacobbi <ggiacobb@studenti.math.unipd.it> Filippo Paparella <ironpipp@gmail.com> Paolo Santi <psanti@studenti.math.unipd.it> Matteo Settenvini <matteo@member.fsf.org> Marco Trevisan <mtrevisa@studenti.math.unipd.it> Djina Verbanac <betalgez@yahoo.com> Luca Vezzaro <lvezzaro@studenti.math.unipd.it> - translator-credits - - - - True - False - 12 - - - - - - - - True - GTK_BUTTONBOX_END - - - 0 - False - True - GTK_PACK_END - - - - - - + translator-credits + + + True + 12 + + + + + + True + GTK_BUTTONBOX_END + + + False + GTK_PACK_END + + + + + diff --git a/src/gui_builder.cc b/src/gui_builder.cc index 094df00..151e8bb 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -27,6 +27,7 @@ #include "graphical_preferences_editor.hh" #include "holt_container_window.hh" #include "holt_widget.hh" +#include "ready_queue_widget.hh" #include "schedulables_tree_widget.hh" #include "simulation_widget.hh" #include "resources_widget.hh" @@ -576,15 +577,18 @@ GuiBuilder::GuiBuilder(const std::string& gladefile) _simulation_widget->set_show_threads(_show_threads); _simulation_widget->show(); - // Why this works, and SimulationWidget doesn't ?? - // HoltWidget& holt = *manage(new HoltWidget(Simulation::get_instance())); - // simulation_window->add(holt); - // holt.show(); - // temporary test on holt widget... + // ReadyQueue custom label widget + ReadyQueueWidget& rq_widget = *manage(new ReadyQueueWidget(Simulation::get_instance().get_history())); + HBox* rqb; + _refXml->get_widget("ReadyQueueBox", rqb); + rqb->pack_start(rq_widget); + rq_widget.show(); + + + // HoltGraph container window _holt_container.set_keep_above(); _holt_container.get_holt_widget().set_show_threads(_show_threads); - // _holt_container.set_deletable(false); _holt_container.show(); } diff --git a/src/ready_queue_widget.cc b/src/ready_queue_widget.cc new file mode 100644 index 0000000..dee519b --- /dev/null +++ b/src/ready_queue_widget.cc @@ -0,0 +1,73 @@ +// src/ready_queue_widget.cc - Copyright 2005, 2006, University +// of Padova, dept. of Pure and Applied +// Mathematics +// +// This file is part of SGPEMv2. +// +// This is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// SGPEMv2 is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with SGPEMv2; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#include "gettext.h" + +#include "ready_queue_widget.hh" + +#include "backend/history.hh" +#include "backend/environment.hh" +#include "backend/ready_queue.hh" +#include "backend/thread.hh" + +#include +#include + +#include + +using namespace sgpem; + +static const Glib::ustring string_start = _("Ready queue: { "); +static const Glib::ustring string_end = " }"; +static const Glib::ustring separator = " ~ "; + +ReadyQueueWidget::ReadyQueueWidget(History& history) + : Gtk::Label(string_start + string_end), _h(history) +{ + _h.attach(*this); + + set_use_markup(true); + set_justify(Gtk::JUSTIFY_LEFT); + set_padding(5, 3); +} + + +ReadyQueueWidget::~ReadyQueueWidget() +{ + _h.detach(*this); +} + + +void +ReadyQueueWidget::update(const History& changed_history) +{ + Glib::ustring text(string_start); + + const ReadyQueue& rq = changed_history.get_last_environment().get_sorted_queue(); + size_t size = rq.size(); + + for(size_t i = 0; i < size; ++i) + text += Glib::Markup::escape_text(rq.get_item_at(i).get_name()) + separator; + + text += string_end; + + set_markup(text); +} + diff --git a/src/ready_queue_widget.hh b/src/ready_queue_widget.hh new file mode 100644 index 0000000..b911836 --- /dev/null +++ b/src/ready_queue_widget.hh @@ -0,0 +1,46 @@ +// src/ready_queue_widget.hh - Copyright 2005, 2006, University +// of Padova, dept. of Pure and Applied +// Mathematics +// +// This file is part of SGPEMv2. +// +// This is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// SGPEMv2 is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with SGPEMv2; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#ifndef READY_QUEUE_WIDGET_HH +#define READY_QUEUE_WIDGET_HH 1 + +#include "config.h" + +#include + +#include "backend/history_observer.hh" + +namespace sgpem +{ + class ReadyQueueWidget : public HistoryObserver, public Gtk::Label + { + public: + ReadyQueueWidget(History& history); + virtual ~ReadyQueueWidget(); + + virtual void update(const History& changed_history); + private: + History& _h; + }; + +} //~ namespace sgpem + + +#endif //~ READY_QUEUE_WIDGET_HH diff --git a/src/simulation_controller.cc b/src/simulation_controller.cc index bc17e55..10bb911 100644 --- a/src/simulation_controller.cc +++ b/src/simulation_controller.cc @@ -38,7 +38,10 @@ #include #include + +#ifndef NDEBUG #include +#endif using namespace sgpem; using Gnome::Glade::Xml; diff --git a/src/simulation_widget.cc b/src/simulation_widget.cc index 44709df..cfa9975 100644 --- a/src/simulation_widget.cc +++ b/src/simulation_widget.cc @@ -164,7 +164,6 @@ SimulationWidget::draw_widget(cairo_t* ctx) void SimulationWidget::draw_names(cairo_t* ctx) { - // std::cout << " SimulationWidget::draw_names " << std::endl; // show processes (and thread) names... // useful constants @@ -331,7 +330,10 @@ SimulationWidget::draw_bars(cairo_t* ctx) from_time = 1; } +#ifndef NDEBUG std::cout << " SimulationWidget::draw_bars from:" << from_time << " to:" << hist_front << std::endl; +#endif + for(unsigned int t=from_time; t<=hist_front; t++) { // draw schedulables bars @@ -373,12 +375,6 @@ void SimulationWidget::draw_instant_rect(cairo_t* ctx, double x, double y, double w, double h, Schedulable::state state) { - - -// _ready_process_gradient = cairo_pattern_create_linear(0, 0, 0, _yu_process_bar_height * _y_unit); -// _running_process_gradient = cairo_pattern_create_linear(0, 0, 0, _yu_process_bar_height * _y_unit); -// _blocked_process_gradient = cairo_pattern_create_linear(0, 0, 0, _yu_process_bar_height * _y_unit); - cairo_matrix_t matrix; switch(state) @@ -429,212 +425,10 @@ SimulationWidget::draw_instant_rect(cairo_t* ctx, double x, double y, } // ~ switch(state) } -// OLD - START *************** -/* -void -SimulationWidget::draw_widget(cairo_t* ctx) -{ - - const History& hist = _simulation->get_history(); - const Environment::Processes& processes = hist.get_last_environment().get_processes(); - if(_n_proc<1) // nothing to draw - return; - - double text_maxw = 0; - bool* terminated = 0; - double top_margin = _y_unit; - double left_margin = _x_unit; - double top_graph_margin = 1.0 * _y_unit; //3.0 * _y_unit; - double left_graph_margin = 11.0 * _x_unit; - double process_label_delta = 1.0 * _y_unit; - double process_bar_delta = 1.0 * _y_unit; - double process_bar_height = 1.0 * _y_unit; - double process_height = process_bar_height + 2*process_bar_delta; - double thread_bar_height = 1.0 * _y_unit; - Simulation::state sim_state = _simulation->get_state(); - cairo_text_extents_t extents; - int item_index; - if(_n_proc+_n_thr>0) - terminated = new bool[_n_proc+_n_thr]; - - // show processes names... - // set clip region to cut long names - cairo_rectangle(ctx, 0, top_graph_margin, - left_graph_margin - _x_unit, _n_proc*process_height + _n_thr*thread_bar_height); - cairo_clip(ctx); // set the rectangular clip region - - - - - { // draw schedulables names block - item_index = 0; - double ypos = top_graph_margin; // height of process bar - const Environment::Processes& processes = hist.get_last_environment().get_processes(); - Environment::Processes::const_iterator proc_iter = processes.begin(); - while(proc_iter!=processes.end()) - { - Process* p = (*proc_iter); - proc_iter++; - ypos += process_bar_delta; // white row before - cairo_move_to(ctx, left_margin, ypos); - cairo_show_text(ctx,p->get_name().c_str()); - ypos += process_bar_delta; // height of process bar - terminated[item_index] = false; - item_index++; - if(_show_threads) - { - const std::vector& tvect = p->get_threads(); - std::vector::const_iterator thr_iter = tvect.begin(); - while(thr_iter!=tvect.end()) - { - Thread* t = (*thr_iter); - thr_iter++; - cairo_move_to(ctx, left_margin+_x_unit, ypos); - cairo_show_text(ctx,t->get_name().c_str()); - ypos += thread_bar_height; // height of process bar - terminated[item_index] = false; - item_index++; - } - } - ypos += process_bar_delta; // white row after - } // ~ while(proc_iter!=processes.end()) - } // ~ draw schedulables names block - - - cairo_reset_clip(ctx); // remove clip region - - // std::cout << " draw_widget not_stop " << std::endl; - unsigned int pos = _simulation->get_history().get_front(); - - // show grid - cairo_save(ctx); - cairo_set_line_width(ctx, 0.5*cairo_get_line_width(ctx)); - // _n_proc+1 horizontal lines - for(int i=0; i<=_n_proc; i++) - { - cairo_move_to(ctx, left_graph_margin, top_graph_margin + process_height*i); - cairo_line_to(ctx, left_graph_margin + (pos+2)*_x_unit, top_graph_margin + process_height*i); - } - // opening vertical line - cairo_move_to(ctx, left_graph_margin, top_graph_margin); - cairo_line_to(ctx, left_graph_margin, top_graph_margin + process_height*_n_proc); - cairo_stroke(ctx); - - // closing vertical line - if(sim_state!=Simulation::state_stopped) - { - double dashes = 1.5; - cairo_set_dash(ctx, &dashes, 1, 0.0); - } - cairo_move_to(ctx, left_graph_margin + (pos+2)*_x_unit, top_graph_margin); - cairo_line_to(ctx, left_graph_margin + (pos+2)*_x_unit, top_graph_margin + process_height*_n_proc); - cairo_stroke(ctx); - cairo_restore(ctx); - - item_index = 0; - for(int t=1; t<=pos; t++) - { - double ypos = top_graph_margin; - const Environment::Processes& processes = hist.get_environment_at(t).get_processes(); - double xpos = left_graph_margin + t*_x_unit; - Environment::Processes::const_iterator proc_iter = processes.begin(); - while(proc_iter!=processes.end()) - { - Process* p = (*proc_iter); - proc_iter++; - ypos += process_bar_delta; // space y before process bar - Schedulable::state st = p->get_state(); - // Schedulable::state st = processes[i]->get_state(); - switch(st) - { - case Schedulable::state_running: - cairo_set_source_rgb(ctx, 0, 1, 0); - cairo_rectangle(ctx, xpos, ypos, _x_unit, _y_unit); - cairo_fill(ctx); - break; - case Schedulable::state_ready: - cairo_set_source_rgb(ctx, 1, 1, 0); - cairo_rectangle(ctx, xpos, ypos, _x_unit, _y_unit); - cairo_fill(ctx); - break; - case Schedulable::state_blocked: - cairo_set_source_rgb(ctx, 1, 0, 0); - cairo_rectangle(ctx, xpos, ypos, _x_unit, _y_unit); - cairo_fill(ctx); - break; - case Schedulable::state_future: - break; - case Schedulable::state_terminated: - if(!terminated[item_index]) - { - cairo_set_source_rgb(ctx, 0, 0, 0); - cairo_rectangle(ctx, xpos, ypos, _x_unit, _y_unit); - cairo_fill(ctx); - } - terminated[item_index] = true; - break; - } - ypos += process_bar_delta; // height of process bar - item_index++; - if(_show_threads) - { - const std::vector& tvect = p->get_threads(); - std::vector::const_iterator thr_iter = tvect.begin(); - while(thr_iter!=tvect.end()) - { - Thread* t = (*thr_iter); - thr_iter++; - Schedulable::state thr_state = t->get_state(); - switch(thr_state) - { - case Schedulable::state_running: - cairo_set_source_rgb(ctx, 0, 1, 0); - cairo_rectangle(ctx, xpos, ypos+_y_unit/3.0, _x_unit, _y_unit/3.0); - cairo_fill(ctx); - break; - case Schedulable::state_ready: - cairo_set_source_rgb(ctx, 1, 1, 0); - cairo_rectangle(ctx, xpos, ypos+_y_unit/3.0, _x_unit, _y_unit/3.0); - cairo_fill(ctx); - break; - case Schedulable::state_blocked: - cairo_set_source_rgb(ctx, 1, 0, 0); - cairo_rectangle(ctx, xpos, ypos+_y_unit/3.0, _x_unit, _y_unit/3.0); - cairo_fill(ctx); - break; - case Schedulable::state_future: - break; - case Schedulable::state_terminated: - if(!terminated[item_index]) - { - cairo_set_source_rgb(ctx, 0, 0, 0); - cairo_rectangle(ctx, xpos, ypos+_y_unit/3.0, _x_unit, _y_unit/3.0); - cairo_fill(ctx); - } - terminated[item_index] = true; - break; - } // ~ switch(thr_state) - thread - item_index++; - ypos += thread_bar_height; // height of process bar - } // ~ while(thr_iter!=tvect.end()) - } - } - } // ~ for(int t=1; t<=pos; t++) - - - - delete[] terminated; - -} // ~ draw_widget -// OLD - END ****************** - -*/ 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(); @@ -642,7 +436,6 @@ SimulationWidget::calc_drawing_size(cairo_t* ctx, size_t& width, size_t& height) int pos = _simulation->get_history().get_front(); cairo_text_extents_t extents; - // std::cout << " x_unit: " << std::endl; Glib::ustring val("999"); cairo_text_extents(ctx, val.c_str(), &extents); if(_x_unitget_history(); @@ -684,8 +474,6 @@ SimulationWidget::count_elements() _n_thr += p->get_threads().size(); } - std::cout << " _n_proc=" << _n_proc << " _n_thr=" << _n_thr << std::endl; - // count_elements(); } void @@ -694,17 +482,20 @@ SimulationWidget::make_gradients() _ready_process_gradient = cairo_pattern_create_linear(0, 0, 0, _yu_process_bar_height * _y_unit); // yellow - cairo_pattern_add_color_stop_rgba(_ready_process_gradient, 0.00, 1.0, 1.0, 0.5, 0.7); - cairo_pattern_add_color_stop_rgba(_ready_process_gradient, 1.00, 1.0, 1.0, 0.0, 1.0); + cairo_pattern_add_color_stop_rgb(_ready_process_gradient, 0.0, 1.00, 1.00, 0.0); + cairo_pattern_add_color_stop_rgb(_ready_process_gradient, 0.3, 0.85, 0.85, 0.0); + cairo_pattern_add_color_stop_rgb(_ready_process_gradient, 1.0, 1.00, 1.00, 0.0); _running_process_gradient = cairo_pattern_create_linear(0, 0, 0, _yu_process_bar_height * _y_unit); // green - cairo_pattern_add_color_stop_rgba(_running_process_gradient, 0.00, 0.5, 1.0, 0.5, 0.7); - cairo_pattern_add_color_stop_rgba(_running_process_gradient, 1.00, 0.0, 1.0, 0.0, 1.0); + cairo_pattern_add_color_stop_rgb(_running_process_gradient, 0.0, 0.0, 0.7, 0.0); + cairo_pattern_add_color_stop_rgb(_running_process_gradient, 0.3, 0.0, 1.0, 0.0); + cairo_pattern_add_color_stop_rgb(_running_process_gradient, 1.0, 0.0, 0.7, 0.0); _blocked_process_gradient = cairo_pattern_create_linear(0, 0, 0, _yu_process_bar_height * _y_unit); // red - cairo_pattern_add_color_stop_rgba(_blocked_process_gradient, 0.00, 1.0, 0.5, 0.5, 0.7); - cairo_pattern_add_color_stop_rgba(_blocked_process_gradient, 1.00, 1.0, 0.0, 0.0, 1.0); + cairo_pattern_add_color_stop_rgb(_blocked_process_gradient, 0.0, 0.7, 0.0, 0.0); + cairo_pattern_add_color_stop_rgb(_blocked_process_gradient, 0.3, 1.0, 0.0, 0.0); + cairo_pattern_add_color_stop_rgb(_blocked_process_gradient, 1.0, 0.7, 0.0, 0.0); }