--------------------------------------------- ----------------------------------- ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real time scheduling analysis tool. -- This program provides services to automatically check performances -- of real time architectures. -- -- Copyright (C) 2002-2010, by Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- the LISyC Team, University of Western Britanny. -- -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- 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: 523 $ -- $Date: 2012-09-26 15:09:39 +0200 (mer. 26 sept. 2012) $ -- $Author: fotsing $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; 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 Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; with Call_Scheduling_Framework; use Call_Scheduling_Framework; with Multiprocessor_Services; use Multiprocessor_Services; with Multiprocessor_Services_Interface; use Multiprocessor_Services_Interface; use Multiprocessor_Services_Interface.Scheduling_Result_Per_Processor_Package; with Framework_Config; use Framework_Config; with Project; use Project; with unbounded_strings; use unbounded_strings; with Mmi_Tools; use Mmi_Tools; with Translate; use Translate; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; package body Draw_Time_Line_From_To_Pkg.Callbacks is procedure On_Cancel_Pressed (Object : access Gtk_Button_Record'Class) is begin Destroy (Draw_Time_Line_From_To); end On_Cancel_Pressed; procedure On_Ok_Pressed (Object : access Gtk_Button_Record'Class) is Draw_From, Draw_To : Unbounded_String; Draw_From_Time : Integer := 0; Draw_To_Time : Integer := 0; Ok : Boolean; begin Draw_From := To_Unbounded_String (Get_Text (Draw_Time_Line_From_To.Draw_From_Entry)); Draw_To := To_Unbounded_String (Get_Text (Draw_Time_Line_From_To.Draw_To_Entry)); to_integer (Draw_From, Draw_From_Time, Ok); if not Ok then Show_Message_Box (Lb_Double_Quote & Lb_Draw_From (Current_Language) & Lb_Double_Quote & Lb_Must_Be_Numeric (Current_Language)); return; end if; to_integer (Draw_To, Draw_To_Time, Ok); if not Ok then Show_Message_Box (Lb_Double_Quote & Lb_Draw_To (Current_Language) & Lb_Double_Quote & Lb_Must_Be_Numeric (Current_Language)); return; end if; if (Draw_To_Time <= 0) then Show_Message_Box (Lb_Double_Quote & Lb_Draw_To (Current_Language) & Lb_Double_Quote & Lb_Must_Be (Current_Language) & To_Unbounded_String (" > 0")); return; end if; if (Draw_From_Time < 0) then Show_Message_Box (Lb_Double_Quote & Lb_Draw_From (Current_Language) & Lb_Double_Quote & Lb_Must_Be (Current_Language) & To_Unbounded_String (" >= 0")); return; end if; if (Draw_From_Time > Draw_To_Time) then Show_Message_Box (Lb_Double_Quote & Lb_Draw_From (Current_Language) & Lb_Must_Be (Current_Language) & Lb_Double_Quote & To_Unbounded_String (" <= ") & Lb_Double_Quote & Lb_Draw_To (Current_Language) & Lb_Double_Quote); return; end if; if (Draw_To_Time - Draw_From_Time > 1500) then Show_Message_Box (Lb_Draw_Time_Line_Too_Large (Current_Language)); return; end if; Draw_Time_Line (Draw_Time_Line_From_To.Draw_Scheduling, Sys.Tasks, Sys.Resources, Sys.Messages, Sys.Buffers, Draw_To_Time, Draw_From_Time, Call_Scheduling_Framework.Sched); Destroy (Draw_Time_Line_From_To); end On_Ok_Pressed; end Draw_Time_Line_From_To_Pkg.Callbacks;