------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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-2023, Frank Singhoff, Alain Plantec, Jerome Legrand, -- Hai Nam Tran, Stephane Rubini -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR 6285, 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 README.md -- -- 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: 3952 $ -- $Date: 2021-06-17 16:58:40 +0200 (jeu., 17 juin 2021) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with processor_set; use processor_set; use processor_set.generic_processor_set; with task_set; use task_set; use task_set.generic_task_set; with resource_set; use resource_set; use resource_set.generic_resource_set; with message_set; use message_set; use message_set.generic_message_set; with buffer_set; use buffer_set; use buffer_set.generic_buffer_set; with translate; use translate; with framework_config; use framework_config; with objects; use objects; with editor_config; use editor_config; with graphical_editor.user_message; use graphical_editor.user_message; package body graphical_editor.select_time_line.callbacks is procedure on_ok_pressed (object : access gtk_button_record'class) is an_object : generic_object_ptr; a_name : Unbounded_String; a_type : Unbounded_String; number_of_object_to_display : Natural := 0; begin reset (time_line_to_display); -- First, check we require not too much object to be displayed -- for i in 0 .. select_time_line.nb_entries - 1 loop if Get_Active (select_time_line.entries (i).display_time_line) then number_of_object_to_display := number_of_object_to_display + 1; end if; end loop; if number_of_object_to_display > editor_config.max_time_line_to_display then show_message_box (lb_can_not_display_so_much_time_line (current_language) & editor_config.max_time_line_to_display'img & ")" ); return; end if; if number_of_object_to_display = 0 then show_message_box (lb_select_at_least_one_time_line (current_language)); return; end if; -- Scan the widget to store each task/message/buffer/resource to display -- for i in 0 .. select_time_line.nb_entries - 1 loop if Get_Active (select_time_line.entries (i).display_time_line) then a_name := To_Unbounded_String (Get_Text (graphical_editor.select_time_line.select_time_line.entries (i) .object_name)); a_type := To_Unbounded_String (Get_Text (graphical_editor.select_time_line.select_time_line.entries (i) .object_type)); if (a_type = lb_task (current_language)) then an_object := generic_object_ptr (search_task (sys.tasks, a_name)); else if (a_type = lb_buffer (current_language)) then an_object := generic_object_ptr (search_buffer (sys.buffers, a_name)); else if (a_type = lb_message (current_language)) then an_object := generic_object_ptr (search_message (sys.messages, a_name)); else if (a_type = lb_resource (current_language)) then an_object := generic_object_ptr (search_resource (sys.resources, a_name)); end if; end if; end if; end if; add (time_line_to_display, an_object); end if; end loop; -- Display Time line -- graphical_editor.select_time_line.select_time_line.to_be_called.all; Destroy (graphical_editor.select_time_line.select_time_line); end on_ok_pressed; end graphical_editor.select_time_line.callbacks;