with Glib; use Glib; with Glib.Object; use Glib.Object; with Gtk.Text_Buffer; use Gtk.Text_Buffer; with Gtk.Widget; use Gtk.Widget; with Gtk.Combo_Box; use Gtk.Combo_Box; with Call_Framework; use Call_Framework; with Call_Framework_Interface; use Call_Framework_Interface; use Call_Framework_Interface.Framework_Request_Package; use Call_Framework_Interface.Framework_Response_Package; with Processors; use Processors; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; with Gtk.Text_Iter; use Gtk.Text_Iter; with Ada.Text_IO; use Ada.Text_IO; with unbounded_strings; use unbounded_strings; with Gtk.Check_Button; use Gtk.Check_Button; with graphical_editor.user_message; use graphical_editor.user_message; with Translate; use Translate; with Framework_Config; use Framework_Config; with graphical_editor.message_text; use graphical_editor.message_text; package body graphical_editor.scheduling_feasibility_widget_callbacks is iter : Gtk_Text_Iter; line_Number : integer := 0; procedure Close_Widget(Object : access Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); my_widget : GObject; begin my_widget:=Get_Object(Object, "window1"); Unref(my_widget); Hide(Gtk_Widget(my_widget)); end Close_Widget; procedure show_scheduling_feasibility(Object : access Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); --begin Test1 : Boolean := False; Test2 : Boolean := False; A_Processor : Generic_Processor_Ptr; Cpu_Index : Gint; --My_Iterator : iterator; My_Iterator : Processors_Iterator; --button1, button2: GObject; procedure Call_Feasibility (Processor_Name : in Unbounded_String) is Response_List : Framework_Response_Table; Request_List : Framework_Request_Table; A_Request : Framework_Request; begin initialize (Response_List); initialize (Request_List); if Test1 then Initialize (A_Request); A_Request.target := Processor_Name; A_Request.statement := Scheduling_Feasibility_Cpu_Utilization; add (Request_List, A_Request); end if; if Test2 then Initialize (A_Request); A_Request.target := Processor_Name; A_Request.statement := Scheduling_Feasibility_Response_Time; add (Request_List, A_Request); end if; Sequential_Framework_Request (Sys, Request_List, Response_List); --Write_Title (Do_Scheduling_Feasibility.Text, Response_List.entries (0).title); --Get_Iter_At_Line (buffer_editor_cheddar, Iter, Gint(line_Number)); --Insert (buffer_editor_cheddar, iter, to_string(Response_List.entries (0).title)); --line_Number := line_Number +1; Write_Title(Response_List); --for J in 0 .. Response_List.nb_entries - 1 loop --Write_Text (Do_Scheduling_Feasibility.Text, Response_List.entries (J).text); --end loop; --for J in 0 .. Response_List.nb_entries - 1 loop -- Get_Iter_At_Line (buffer_editor_cheddar, Iter, Gint(line_Number)); -- Insert (buffer_editor_cheddar, iter, to_string(Response_List.entries (J).text)); -- line_Number := line_Number +1; --end loop; Write_Text(Response_List); end Call_Feasibility; begin if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton2"))) then Test1 := True; end if; if Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton3"))) then Test2 := True; end if; if (Test1 = False) and (Test2 = False) then Show_Message_Box (Lb_Select_Almost_One_Feasilibity_Test (Current_Language)); return; end if; -- Cpu_Index := -- Gint'Val -- (Gint (get_number_of_elements (Sys.Processors)) - -- Gint (Selected_Button -- (Do_Scheduling_Feasibility.Clist_Processor_Menu))); -- Cpu_Index := Cpu_Index - 1; -- get_element_number -- (Sys.Processors, --A_Processor, --Processors_Range (Cpu_Index)); A_Processor := Search_Processor (Sys.Processors, to_Unbounded_String(Get_Active_Text(Gtk_Combo_Box(Get_Object(Object, "combobox1"))))); --put_line(to_string(A_Processor.name)); if not Get_Active (Gtk_Check_Button(Get_Object(Object, "checkbutton1"))) then Call_Feasibility (A_Processor.name); else reset_iterator (Sys.Processors, My_Iterator); loop current_element (Sys.Processors, A_Processor, My_Iterator); Call_Feasibility (A_Processor.name); exit when is_last_element (Sys.Processors, My_Iterator); next_element (Sys.Processors, My_Iterator); end loop; end if; -- Destroy (Do_Scheduling_Feasibility); Close_Widget(Object); end show_scheduling_feasibility; end graphical_editor.scheduling_feasibility_widget_callbacks;