with Gtk.Menu_Item; use Gtk.Menu_Item; with Gtk; use Gtk; with Gtk.Main; use Gtk.Main; with Glib.Error; use Glib.Error; with Gtk.Widget; use Gtk.Widget; with Gtk.Dialog; use Gtk.Dialog; with Gtk.About_Dialog; use Gtk.About_Dialog; with Gtk.Label; use Gtk.Label; with Glib.Object; use Glib.Object; with Gtk.Text_Buffer; use Gtk.Text_Buffer; with Gtk.Combo_Box; use Gtk.Combo_Box; with Gtk.Text_Iter; use Gtk.Text_Iter; with Gtk.List_Store; use Gtk.List_Store; with Gtk.Tree_Model; use Gtk.Tree_Model; with Gtk.Tree_View; use Gtk.Tree_View; with Gtk.Tree_View_Column; use Gtk.Tree_View_Column; with Glib; use Glib; with Glib.Object; use Glib.Object; with Glib.Values; use Glib.Values; with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with unbounded_strings; use unbounded_strings; with Processors; use Processors; with Processor_set; use Processor_set; with Processors.extended; use Processors.extended; with unbounded_strings; use unbounded_strings; with core_units; use core_units; use core_units.Core_Units_Table_Package; with Framework_Config; use Framework_Config; with Buffer_Set; use Buffer_Set; use Buffer_Set.Generic_Buffer_Set; with Resource_Set; use Resource_Set; use Resource_Set.Generic_Resource_Set; with graphical_editor.user_message; use graphical_editor.user_message; with GNAT.Current_Exception; use GNAT.Current_Exception; with Translate; use Translate; with Networks; use Networks; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with Scheduler; use Scheduler; with Scheduler.user_defined.interpreted.pipeline; use Scheduler.user_defined.interpreted.pipeline; with Scheduler.user_defined.interpreted.Automata; use Scheduler.user_defined.interpreted.Automata; with Scheduler_Interface; use Scheduler_Interface; with Network_Set; use Network_Set; package body graphical_editor.processors is PACKAGE Es_Entiers IS NEW Ada.Text_IO.Integer_IO(Integer); use Es_Entiers; procedure Initialize_Processor(my_tab: in out table_widget_id ; Object : access Gtkada_Builder_Record'Class) is ob1: GObject:= Get_Object(Object, "textbuffer1"); --ob2: GObject:= Get_Object(Object, "combobox4"); ob2: GObject:= Get_Object(Object, "textbuffer3"); ob3: GObject:= Get_Object(Object, "combobox1"); ob4: GObject:= Get_Object(Object, "combobox2"); ob5: GObject:= Get_Object(Object, "liststore4"); ob6: GObject:= Get_Object(Object, "treeview2"); ob7: GObject:= Get_Object(Object, "liststore3"); ob8: GObject:= Get_Object(Object, "treeview1"); wid1: t_widget := (ptype => buffer_string, buffer_value => Gtk_Text_Buffer(ob1)); --wid2: t_widget := (ptype => combo, combo_value => Gtk_Combo_Box(ob2)); wid2: t_widget := (ptype => buffer_string, buffer_value => Gtk_Text_Buffer(ob2)); wid3: t_widget := (ptype => combo, combo_value => Gtk_Combo_Box(ob3)); wid4: t_widget := (ptype => combo, combo_value => Gtk_Combo_Box(ob4)); wid5: t_widget := (ptype => lists, list_value => Gtk_List_Store(ob5)); wid6: t_widget := (ptype => view, view_value => Gtk_Tree_View(ob6)); wid7: t_widget := (ptype => lists, list_value => Gtk_List_Store(ob7)); wid8: t_widget := (ptype => view, view_value => Gtk_Tree_View(ob8)); wid9: t_widget := (ptype => window, window_value => processor_window); begin my_tab(1..processor_table_length) := (new t_widget'(wid1), new t_widget'(wid2), new t_widget'(wid3), new t_widget'(wid4), new t_widget'(wid5), new t_widget'(wid6), new t_widget'(wid7), new t_widget'(wid8), new t_widget'(wid9)); end initialize_Processor; procedure Check_Processor(my_tab: in out table_widget_id ; Object : access Gtkada_Builder_Record'Class; Error_Message: in out Unbounded_String; Ok: in out Boolean) is core_name_value: GValue; processor_name, migration_string, processor_string: Unbounded_String; network_name: Unbounded_String; a_Core : Core_Unit_Ptr; number_rows : integer; Cores: Core_Units_Table; tree_iter_inter: Gtk_Tree_Iter; a_migration: migrations_Type; a_processor_type : processors_type; begin processor_name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(1).buffer_value)); if (processor_name = "") then Ok := False; Error_Message := Lb_processor_name_Mandatory (Current_Language); return; end if; --network_name := to_unbounded_string(Get_Active_Text(Gtk_Combo_Box(my_tab(2).combo_value))); network_name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(2).buffer_value)); migration_string := to_unbounded_string(Get_Active_Text(Gtk_Combo_Box(my_tab(4).combo_value))); if (migration_string = "") then Ok := False; Error_Message := Lb_migration_type_Mandatory (Current_Language); return; end if; a_migration := get_compatible_migration(Get_Active_Text(Gtk_Combo_Box(my_tab(4).combo_value))); processor_string := to_unbounded_string(Get_Active_Text(Gtk_Combo_Box(my_tab(3).combo_value))); if (processor_string = "") then Ok := False; Error_Message := Lb_processor_type_Mandatory (Current_Language); return; end if; a_processor_type := get_compatible_processor(Get_Active_Text(Gtk_Combo_Box(my_tab(3).combo_value))); number_rows:= get_number_elements(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); if number_rows = 1 then tree_iter_inter := Get_Iter_First (Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); Gtk.Tree_Model.Get_Value(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter, 0, core_name_value); A_Core := Search_core_unit(sys.Core_units, to_Unbounded_String(Get_String(core_name_value))); Check_Processor (Sys.Processors, processor_name, network_name, a_Core ); else tree_iter_inter := Get_Iter_First (Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); for i in 1..number_rows loop Gtk.Tree_Model.Get_Value(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter, 0, core_name_value); A_Core := Search_core_unit(sys.Core_units, to_Unbounded_String(Get_String(core_name_value))); Core_Units_Table_Package.Add(Cores, A_Core); next(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter); end loop; Check_processor (Sys.Processors, processor_name, network_name, Cores, a_migration, a_processor_type); end if; exception when Processor_Set.Invalid_Parameter => begin Ok := False; Error_Message := To_Unbounded_String (Exception_Message); return; end; when others => begin Ok := False; Error_Message := To_Unbounded_String (Exception_Message); end; end Check_Processor; procedure Add_In_Sys_Processor(my_tab: in out table_widget_id ; Object : access Gtkada_Builder_Record'Class) is processor_name, network_name : Unbounded_String; Cores: Core_Units_Table; a_migration: migrations_Type; a_processor_type : processors_type; tree_iter_inter: Gtk_Tree_Iter; core_name_value: GValue; number_rows : integer; a_Core : Core_Unit_Ptr; begin processor_name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(1).buffer_value)); network_name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(2).buffer_value)); a_migration := get_compatible_migration(Get_Active_Text(Gtk_Combo_Box(my_tab(4).combo_value))); a_processor_type := get_compatible_processor(Get_Active_Text(Gtk_Combo_Box(my_tab(3).combo_value))); number_rows:= get_number_elements(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); if number_rows = 0 then Show_Message_Box (Lb_Define_core_units_Before (Current_Language)); return; end if; if number_rows = 1 then tree_iter_inter := Get_Iter_First (Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); Gtk.Tree_Model.Get_Value(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter, 0, core_name_value); A_Core := Search_core_unit(sys.Core_units, to_Unbounded_String(Get_String(core_name_value))); if get_compatible_processor(a_processor_type) /= to_unbounded_string("Monocore Type") then Show_Message_Box (lb_create_only_one_core_unit (Current_Language)); return; end if; if get_compatible_migration(a_migration) /= to_unbounded_string("No Migration Type") then Show_Message_Box (lb_create_only_one_core_unit (Current_Language)); return; end if; Add_Processor (Sys.Processors, processor_name, network_name, a_Core ); else tree_iter_inter := Get_Iter_First (Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); for i in 1..number_rows loop Gtk.Tree_Model.Get_Value(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter, 0, core_name_value); A_Core := Search_core_unit(sys.Core_units, to_Unbounded_String(Get_String(core_name_value))); Core_Units_Table_Package.Add(Cores, A_Core); next(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter); end loop; if get_compatible_migration(a_migration) = to_unbounded_string("No Migration Type") then Show_Message_Box (lb_Migration_Type_Not_Allow_With_Several_Cores (Current_Language)); return; end if; if get_compatible_processor(a_processor_type) = to_unbounded_string("Monocore Type") then Show_Message_Box (lb_Processor_Type_Not_Allow_With_Several_Cores (Current_Language)); return; end if; Add_processor (Sys.Processors, processor_name, network_name, Cores, a_migration, a_processor_type); end if; exception when Processor_set.Invalid_Parameter => begin Show_Message_Box (Exception_Message); return; end; when others => begin Show_Message_Box (Exception_Name & Exception_Message); return; end; end Add_In_Sys_Processor; procedure Deleted_In_Sys_Processor(my_tab: in out table_widget_id ; Object : access Gtkada_Builder_Record'Class) is A_processor : Generic_Processor_Ptr; name : unbounded_string; begin name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(1).buffer_value)); A_processor := Search_processor (Sys.processors, name); delete (Sys.processors, A_processor); end Deleted_In_Sys_Processor; procedure Show_In_Sys_Processor(my_tab: in out table_widget_id ; Object : access Gtkada_Builder_Record'Class) is A_processor : Generic_Processor_Ptr; name : unbounded_string; The_Cores : Core_Units_Table; a_Core : Core_Unit_Ptr; tree_iter: Gtk_Tree_Iter; liststore: GObject; begin name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(1).buffer_value)); A_processor := Search_processor (Sys.processors, name); The_Cores := build_core_table (A_processor); liststore:= Get_Object(Object, "liststore4"); Gtk.List_Store.Clear(Gtk_List_Store(liststore)); for i in 0..The_Cores.Nb_Entries -1 loop a_core := The_cores.Entries(i); Append(Gtk_List_Store(liststore), tree_iter); Gtk.List_Store.Set(Gtk_List_Store(liststore), tree_iter, 0, To_String (a_core.name)); end loop; end Show_In_Sys_Processor; --verfier que le modify marche bien quand le core est changé ... -- recuperer le processeur buffer de core ... procedure Modify_In_Sys_Processor(my_tab: in out table_widget_id ; Object : access Gtkada_Builder_Record'Class; name: unbounded_string) is A_processor, A_processor_Buffer : Generic_Processor_Ptr; number_rows : integer; tree_iter_inter: Gtk_Tree_Iter; core_name_value: GValue; a_Core : Core_Unit_Ptr; Cores: Core_Units_Table; begin A_processor := Search_processor (Sys.processors, name); A_processor_Buffer := A_processor; A_processor_Buffer.cheddar_private_id := A_processor.cheddar_private_id; A_Processor_Buffer.name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(1).buffer_value)); A_Processor_Buffer.network_name := get_value_buffer_string(Gtk_Text_Buffer(my_tab(2).buffer_value)); A_Processor_Buffer.migration_type := get_compatible_migration(Get_Active_Text(Gtk_Combo_Box(my_tab(4).combo_value))); A_Processor_Buffer.processor_type := get_compatible_processor(Get_Active_Text(Gtk_Combo_Box(my_tab(3).combo_value))); number_rows:= get_number_elements(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); if number_rows = 1 then tree_iter_inter := Get_Iter_First (Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); Gtk.Tree_Model.Get_Value(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter, 0, core_name_value); A_Core := Search_core_unit(sys.Core_units, to_Unbounded_String(Get_String(core_name_value))); if get_compatible_processor(A_Processor_Buffer.processor_type) /= to_unbounded_string("Monocore Type") then Show_Message_Box (lb_create_only_one_core_unit (Current_Language)); return; end if; if get_compatible_migration(A_Processor_Buffer.migration_type) /= to_unbounded_string("No Migration Type") then Show_Message_Box (lb_create_only_one_core_unit (Current_Language)); return; end if; Mono_Core_Processor_Ptr(A_Processor_Buffer).core := A_core; Check_Processor (Sys.Processors, A_Processor_Buffer.name, A_Processor_Buffer.network_name, a_Core ); Delete (Sys.Processors, A_processor); add (Sys.Processors, A_Processor_Buffer); else tree_iter_inter := Get_Iter_First (Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value))); for i in 1..number_rows loop Gtk.Tree_Model.Get_Value(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter, 0, core_name_value); A_Core := Search_core_unit(sys.Core_units, to_Unbounded_String(Get_String(core_name_value))); Core_Units_Table_Package.Add(Cores, A_Core); next(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(my_tab(6).view_value)), tree_iter_inter); end loop; if get_compatible_migration(A_Processor_Buffer.migration_type) = to_unbounded_string("No Migration Type") then Show_Message_Box (lb_Migration_Type_Not_Allow_With_Several_Cores (Current_Language)); return; end if; if get_compatible_processor(A_Processor_Buffer.processor_type) = to_unbounded_string("Monocore Type") then Show_Message_Box (lb_Processor_Type_Not_Allow_With_Several_Cores (Current_Language)); return; end if; Multi_Cores_Processor_Ptr(A_Processor_Buffer).cores := Cores; Check_processor (Sys.Processors, A_Processor_Buffer.name, A_Processor_Buffer.network_name, Cores, A_Processor_Buffer.migration_type, A_Processor_Buffer.processor_type); Delete (Sys.Processors, A_processor); add (Sys.Processors, A_Processor_Buffer); end if; exception when Processor_set.Invalid_Parameter => begin Show_Message_Box (Exception_Message); return; end; when others => begin Show_Message_Box (Exception_Name & Exception_Message); return; end; end Modify_In_Sys_Processor; function get_compatible_processor(myprocessor: GValue) return processors_type is myprocessor_proc : processors_Type; begin if to_Unbounded_String(Get_String(myprocessor)) = to_Unbounded_String("Monocore Type") then myprocessor_proc := monocore_type; end if; if to_Unbounded_String(Get_String(myprocessor)) = to_Unbounded_String("Identical Multicores Type") then myprocessor_proc := identical_multicores_type; end if; if to_Unbounded_String(Get_String(myprocessor)) = to_Unbounded_String("Uniform Multicores Type") then myprocessor_proc := uniform_multicores_type; end if; if to_Unbounded_String(Get_String(myprocessor)) = to_Unbounded_String("Unrelated Multicores Type") then myprocessor_proc := unrelated_multicores_types; end if; return myprocessor_proc; end get_compatible_processor; function get_compatible_migration(my_migration_string: String) return migrations_Type is my_migration : migrations_Type; begin if to_Unbounded_String(my_migration_string) = to_Unbounded_String("No Migration Type") then my_migration := no_migration_type; end if; if to_Unbounded_String(my_migration_string) = to_Unbounded_String("Job Level Migration Type") then my_migration := job_level_migration_type; end if; if to_Unbounded_String(my_migration_string) = to_Unbounded_String("Time Unit Migration Type") then my_migration := time_unit_migration_type; end if; return my_migration; end get_compatible_migration; function get_compatible_migration(mymigration: GValue) return migrations_type is mymigration_proc: migrations_type; begin if to_Unbounded_String(Get_String(mymigration)) = to_Unbounded_String("No Migration Type") then mymigration_proc := no_migration_type; end if; if to_Unbounded_String(Get_String(mymigration)) = to_Unbounded_String("Job Level Migration Type") then mymigration_proc := job_level_migration_type; end if; if to_Unbounded_String(Get_String(mymigration)) = to_Unbounded_String("Time Unit Migration Type") then mymigration_proc := time_unit_migration_type; end if; return mymigration_proc; end get_compatible_migration; package processor_callbacks is new generic_callbacks(Number_of_widget => processor_table_length, Initialize => initialize_Processor, Check => Check_Processor, Add_In_Sys => Add_In_Sys_Processor, Deleted_In_Sys => Deleted_In_Sys_Processor, Modify_In_Sys => Modify_In_Sys_Processor, Show_In_Sys => Show_In_Sys_Processor); use processor_callbacks; procedure Add_View_Core (Object : access Gtkada_Builder_Record'Class) is tree_iter: Gtk_Tree_Iter; core_name: Unbounded_String; core_name_value : Gvalue; number_rows : integer; ok: boolean := false; i: integer:= 0; tree_iter_inter: Gtk_Tree_Iter; liststore : GObject; begin liststore:= Get_Object(Object, "liststore4"); core_name := to_unbounded_string(Get_Active_Text(Gtk_Combo_Box(Get_Object(Object, "combobox3")))); if (core_name = "") then Show_Message_Box (Lb_Define_core_units_Before (Current_Language)); return; end if; number_rows:= get_number_elements(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(Gtk_Tree_view(Get_Object(Object, "treeview2"))))); if number_rows = 0 then Append(Gtk_List_Store(liststore), tree_iter); Gtk.List_Store.Set(Gtk_List_Store(liststore), tree_iter, 0, Get_Active_Text(Gtk_Combo_Box(Get_Object(Object, "combobox3")))); else tree_iter_inter := Get_Iter_First (Gtk_Tree_Model(Gtk.Tree_View.Get_Model(Gtk_Tree_view(Get_Object(Object, "treeview2"))))); while i <= number_rows and ok = false and tree_iter_inter /= Null_Iter loop Gtk.Tree_Model.Get_Value(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(Gtk_Tree_view(Get_Object(Object, "treeview2")))), tree_iter_inter, 0, core_name_value); --A_Core := Search_core_unit(sys.Core_units, to_Unbounded_String(Get_String(core_name_value))); --Core_Units_Table_Package.Add(Cores, A_Core); if core_name = to_Unbounded_String(Get_String(core_name_value)) then ok := true; exit; end if; next(Gtk_Tree_Model(Gtk.Tree_View.Get_Model(Gtk_Tree_view(Get_Object(Object, "treeview2")))), tree_iter_inter); i := i+1; end loop; if ok = false then Append(Gtk_List_Store(liststore), tree_iter); Gtk.List_Store.Set(Gtk_List_Store(liststore), tree_iter, 0, Get_Active_Text(Gtk_Combo_Box(Get_Object(Object, "combobox3")))); end if; end if; end Add_View_Core; procedure Delete_View_Core (Object : access Gtkada_Builder_Record'Class) is tree_iter: Gtk_Tree_Iter; path: Gtk_Tree_Path; focus: Gtk_Tree_View_Column; begin Get_Cursor(Gtk_Tree_View(Get_Object(Object, "treeview2")), path, focus); if path /= null and focus /= null then tree_iter:= get_iter(Gtk_Tree_Model(Get_Object(Object, "liststore4")), path); Gtk.List_Store.Remove(Gtk_List_Store(Get_Object(Object, "liststore4")), tree_iter); Set_Active(Gtk_Combo_Box(Get_Object(Object, "combobox3")), Gint(-1)); end if; end Delete_View_Core; procedure Show_Lign_Core (Object : access Gtkada_Builder_Record'Class) is tree_iter: Gtk_Tree_Iter; path1: Gtk_Tree_Path; focus1: Gtk_Tree_View_Column; combo_text: unbounded_string; begin Get_Cursor(Gtk_Tree_View(get_object(object, "treeview2")), path1, focus1); if path1 /= null and focus1 /= null then tree_iter:= get_iter(Gtk_Tree_Model(get_object(object, "liststore4")), path1); combo_text := to_unbounded_string(Gtk.Tree_Model.Get_String(Gtk_Tree_Model(get_object(object, "liststore4")), tree_iter, 0)); Set_Active(Gtk_Combo_Box(get_object(object, "combobox3")), Gint(get_int_combo(Gtk_Combo_Box(get_object(object, "combobox3")), combo_text))); end if; end Show_Lign_Core; function get_compatible_processor(my_processor: Processors_type) return unbounded_string is my_processor_string: Unbounded_String; begin if my_processor = monocore_type then my_processor_string:= to_Unbounded_String("Monocore Type"); end if; if my_processor = identical_multicores_type then my_processor_string:= to_Unbounded_String("Identical Multicores Type"); end if; if my_processor = uniform_multicores_type then my_processor_string:= to_Unbounded_String("Uniform Multicores Type"); end if; if my_processor = unrelated_multicores_types then my_processor_string:= to_Unbounded_String("Unrelated Multicores Type"); end if; return my_processor_string; end get_compatible_processor; function get_compatible_processor(my_processor_string: String) return processors_Type is my_processor : processors_Type; begin if to_Unbounded_String(my_processor_string) = to_Unbounded_String("Monocore Type") then my_processor := monocore_type; end if; if to_Unbounded_String(my_processor_string) = to_Unbounded_String("Identical Multicores Type") then my_processor := identical_multicores_type; end if; if to_Unbounded_String(my_processor_string) = to_Unbounded_String("Uniform Multicores Type") then my_processor := uniform_multicores_type; end if; if to_Unbounded_String(my_processor_string) = to_Unbounded_String("Unrelated Multicores Type") then my_processor := unrelated_multicores_types; end if; return my_processor; end get_compatible_processor; function get_compatible_migration(mymigration: migrations_type) return unbounded_string is mymigration_string: Unbounded_String; begin if mymigration = no_migration_type then mymigration_string:= to_Unbounded_String("No Migration Type"); end if; if mymigration = job_level_migration_type then mymigration_string:= to_Unbounded_String("Job Level Migration Type"); end if; if mymigration = time_unit_migration_type then mymigration_string:= to_Unbounded_String("Time Unit Migration Type"); end if; return mymigration_string; end get_compatible_migration; procedure Show_Processor_Widget is Builder : Gtkada_Builder; Error : Glib.Error.GError; tree_iter: Gtk_Tree_Iter; liststore: GObject; A_Processor : Generic_Processor_Ptr; My_Iterator : Processors_Iterator; A_Core : Core_Unit_Ptr; My_Core_Iterator : core_units_Iterator; my_combo: GObject; My_Network_Iterator : Network_Iterator; begin Gtk.Main.Init; Gtk_New (Builder); Error := Add_From_File (Builder, to_string(Glade_path) & "processor.glade"); if Error /= null then Ada.Text_IO.Put_Line ("Error : " & Get_Message (Error)); Error_Free (Error); return; end if; Sys_buffer := sys; -- add values in network combo ... -- my_combo_net := Get_Object(Builder, "combobox4"); -- reset_iterator (sys.networks, My_Network_Iterator); -- if not is_empty (sys.networks) then -- loop -- current_element (sys.networks, A_network, My_network_Iterator); -- -- Append_Text (Gtk_Combo_Box(my_combo_net), To_String(A_network.name)); -- exit when is_last_element (sys.networks, My_network_Iterator); -- next_element (sys.networks, My_network_Iterator); -- end loop; -- else -- Show_Message_Box -- (Lb_Define_networks_Before (Current_Language)); -- end if; -- add values in core combo ... my_combo := Get_Object(Builder, "combobox3"); reset_iterator (sys.Core_units, My_Core_Iterator); if not is_empty (sys.Core_units) then loop current_element (sys.Core_units, A_Core, My_Core_Iterator); Append_Text (Gtk_Combo_Box(my_combo), To_String(A_Core.name)); exit when is_last_element (sys.Core_units, My_Core_Iterator); next_element (sys.Core_units, My_Core_Iterator); end loop; else Show_Message_Box (Lb_Define_core_units_Before (Current_Language)); end if; Set_Active (Gtk_Combo_Box(Get_Object(Builder, "combobox1")), 0); Set_Active (Gtk_Combo_Box(Get_Object(Builder, "combobox2")), 0); liststore:= Get_Object(Builder, "liststore3"); reset_iterator (sys.Processors, My_Iterator); if not is_empty (sys.Processors) then loop current_element (sys.Processors, A_Processor, My_Iterator); Append(Gtk_List_Store(liststore), tree_iter); Gtk.List_Store.Set(Gtk_List_Store(liststore), tree_iter, 0, To_String (A_Processor.name)); Gtk.List_Store.Set(Gtk_List_Store(liststore), tree_iter, 1, To_String (A_Processor.network_name)); Gtk.List_Store.Set(Gtk_List_Store(liststore), tree_iter, 2, To_String(get_compatible_processor(A_Processor.processor_type))); Gtk.List_Store.Set(Gtk_List_Store(liststore), tree_iter, 3, To_String(get_compatible_migration(A_Processor.migration_type))); exit when is_last_element (sys.Processors, My_Iterator); next_element (sys.Processors, My_Iterator); end loop; end if; Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_button6_clicked", Handler => processor_callbacks.Add_View'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_button4_clicked", Handler => processor_callbacks.Delected_Lign_Selected'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_button2_clicked", Handler => processor_callbacks.Cancel_View'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_treeview1_cursor_changed", Handler => processor_callbacks.Show_Lign_Selected'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_treeview2_cursor_changed", Handler => Show_Lign_Core'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_button5_clicked", Handler => processor_callbacks.Modify_Lign'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_button1_clicked", Handler => processor_callbacks.Close_View'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_button8_clicked", Handler => Add_View_Core'Access); Gtkada.Builder.Register_Handler (Builder => Builder, Handler_Name => "on_button7_clicked", Handler => Delete_View_Core'Access); Do_Connect (Builder); Gtk.Widget.Show_All (Get_Widget (Builder, "window1")); Gtk.Main.Main; Unref (Builder); end Show_Processor_Widget; end graphical_editor.processors;