diff --git a/src/backend/concrete_simulation.cc b/src/backend/concrete_simulation.cc index 8ae3847..55650cd 100644 --- a/src/backend/concrete_simulation.cc +++ b/src/backend/concrete_simulation.cc @@ -209,10 +209,12 @@ ConcreteSimulation::get_history() const void ConcreteSimulation::set_policy(CPUPolicy* p) throw(CPUPolicyException) { + stop(); + // NOTE: restoring of the previous policy is done here because I // couldn't think of a clean way to do it // inside activate_policy() - + try { CPUPoliciesGatekeeper::get_instance().activate_policy(&_history, p); @@ -253,6 +255,7 @@ ConcreteSimulation::get_policy() void ConcreteSimulation::set_resource_policy(ResourcePolicy* p) { + stop(); ResourcePoliciesGatekeeper::get_instance().activate_policy(&_history, p); _resource_policy = p; } diff --git a/src/holt_widget.cc b/src/holt_widget.cc index 940a3c9..84da713 100644 --- a/src/holt_widget.cc +++ b/src/holt_widget.cc @@ -208,9 +208,9 @@ void HoltSchedulable::draw(cairo_t *cr) break; case Schedulable::state_blocked: // cairo_set_source_rgb (cr, 1, 0, 0); - // blue - cairo_pattern_add_color_stop_rgba(gradient, 0.00, 0.5, 0.5, 1.0, 0.7); - cairo_pattern_add_color_stop_rgba(gradient, 1.00, 0.0, 0.0, 1.0, 1.0); + // red + cairo_pattern_add_color_stop_rgba(gradient, 0.00, 1.0, 0.5, 0.5, 0.7); + cairo_pattern_add_color_stop_rgba(gradient, 1.00, 1.0, 0.0, 0.0, 1.0); cairo_set_source(cr, gradient); break; case Schedulable::state_future: @@ -276,8 +276,8 @@ void HoltRequest::draw(cairo_t *cr) switch(_state) { case Request::state_unallocable: - // blue - cairo_set_source_rgb(cr, 0, 0, 1); + // red + cairo_set_source_rgb(cr, 1, 0, 0); arrow(cr, schedulable, resource); break; case Request::state_allocated: diff --git a/src/simulation_widget.cc b/src/simulation_widget.cc index 452ce76..44709df 100644 --- a/src/simulation_widget.cc +++ b/src/simulation_widget.cc @@ -703,8 +703,8 @@ SimulationWidget::make_gradients() cairo_pattern_add_color_stop_rgba(_running_process_gradient, 1.00, 0.0, 1.0, 0.0, 1.0); _blocked_process_gradient = cairo_pattern_create_linear(0, 0, 0, _yu_process_bar_height * _y_unit); - // blue - cairo_pattern_add_color_stop_rgba(_blocked_process_gradient, 0.00, 0.5, 0.5, 1.0, 0.7); - cairo_pattern_add_color_stop_rgba(_blocked_process_gradient, 1.00, 0.0, 0.0, 1.0, 1.0); + // 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); }