------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 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 graphical_editor.user_message; use graphical_editor.user_message; with editor_config; use editor_config; 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)); 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;