------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2016, Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR 6285 laboratory, Université de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in AUTHORS.txt and SPONSORS.txt -- -- This program 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. -- -- This program 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 this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ------------------------------------------------------------------------------ -- Last update : -- $Rev: 1249 $ -- $Date: 2014-08-28 07:02:15 +0200 (Fri, 28 Aug 2014) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Gtkada.Builder; use Gtkada.Builder; with Glib; use Glib; with Glib.Object; use Glib.Object; with Gtk; use Gtk; with Gtk.Main; use Gtk.Main; with Editor_Config; use Editor_Config; with graphical_editor.generic_package_widget; use graphical_editor.generic_package_widget; with graphical_editor.user_message; use graphical_editor.user_message; with framework_config; use framework_config; with Translate; use Translate; with time_unit_events; use time_unit_events; with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; with Ada.Numerics.Aux; use Ada.Numerics.Aux; package body graphical_editor.scheduling_option_callbacks is procedure ok(Object : access Gtkada_Builder_Record'Class) is Ok : Boolean; my_widget : GObject; textbuffer_string : unbounded_string; begin if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton1"))) then Schedule_With_Offsets := True; else Schedule_With_Offsets := False; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton2"))) then Schedule_With_Precedencies := True; else Schedule_With_Precedencies := False; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton3"))) then Schedule_With_Resources := True; else Schedule_With_Resources := False; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton16"))) then Is_Global_Predictable_Seed := True; else Is_Global_Predictable_Seed := False; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton15"))) then Has_Global_Seed:= False; else Has_Global_Seed:= True; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton14"))) then draw_core_unit_time_line:=true; else draw_core_unit_time_line:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton17"))) then draw_address_space_time_line:=true; else draw_address_space_time_line:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton18"))) then several_colors_for_time_lines:=true; else several_colors_for_time_lines:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton19"))) then display_wait_for_resource:=true; else display_wait_for_resource:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton20"))) then display_task_activation:=true; else display_task_activation:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton21"))) then display_allocate_resource:=true; else display_allocate_resource:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton24"))) then display_release_resource:=true; else display_release_resource:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton22"))) then display_address_space_activation:=true; else display_address_space_activation:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton23"))) then display_address_space_completion:=true; else display_address_space_completion:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton25"))) then schedule_with_jitters:=true; else schedule_with_jitters:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton26"))) then minimize_preemption:=true; else minimize_preemption:=false; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton27"))) then schedule_with_crpd:=true; else schedule_with_crpd:=false; end if; textbuffer_string:=get_value_buffer_string(Gtk_Text_Buffer(Get_Object(Object, "textbuffer1"))); if textbuffer_string="" then Global_Seed_Value:=0; else to_integer(textbuffer_string, Global_Seed_Value, ok); if not Ok then Show_Message_Box (Lb_Seed (Current_Language) & Lb_Must_Be_Numeric (Current_Language)); return; end if; end if; textbuffer_string:=get_value_buffer_string(Gtk_Text_Buffer(Get_Object(Object, "textbuffer3"))); if textbuffer_string="" then Max_Time_Line_To_Display:=0; else to_integer(textbuffer_string, Max_Time_Line_To_Display, ok); if not Ok then Show_Message_Box (Lb_Max_Time_Line_To_Display (Current_Language) & Lb_Must_Be_Numeric (Current_Language)); return; end if; end if; textbuffer_string:=get_value_buffer_string(Gtk_Text_Buffer(Get_Object(Object, "textbuffer2"))); if textbuffer_string="" then Time_Line_Between_Time_Axis:=0; else to_integer(textbuffer_string, Time_Line_Between_Time_Axis, ok); if not Ok then Show_Message_Box (Lb_Time_Line_Between_Time_Axis (Current_Language) & Lb_Must_Be_Numeric (Current_Language)); return; end if; end if; for I in Time_Unit_Event_Type'Range loop if (I /= Task_Activation) and (I /= Running_Task) and (I /= Address_Space_Activation) and (I /= Wait_For_Memory) then if Get_Active (Event_Check_Button (I)) then Generate_Events (I) := True; else Generate_Events (I) := False; end if; end if; end loop; my_widget:=Get_Object(Object, "window1"); Destroy_cb(Gtk_Widget(my_widget)); gtk.main.main_quit; end ok; procedure cancel(Object : access Gtkada_Builder_Record'Class) is my_widget : GObject; begin my_widget := Get_Object(Object, "window1"); Destroy_cb(Gtk_Widget(my_widget)); gtk.main.main_quit; end cancel; procedure seed(Object : access Gtkada_Builder_Record'Class) is Seed : Generator; Nmb : natural; begin -- Give random value for the schedulers seed -- Reset (Seed); -- range from natural'first .. natural'last Nmb := abs ( Integer (Double (Random (Seed)) * Double (natural'Last - natural'First) + Double (natural'First)) ); Set_Text (Gtk_Text_buffer(Get_Object(Object, "textbuffer1")), Nmb'Img); end seed; end graphical_editor.scheduling_option_callbacks;