------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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-2020, 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 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$ -- $Date$ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with call_scheduling_framework; use call_scheduling_framework; with framework; use framework; with framework_config; use framework_config; with translate; use translate; with multiprocessor_services; use multiprocessor_services; with multiprocessor_services_interface; use multiprocessor_services_interface; use multiprocessor_services_interface.scheduling_result_per_processor_package; with multiprocessor_services; use multiprocessor_services; with graphical_editor.message_text; use graphical_editor.message_text; with Gtkada.Dialogs; use Gtkada.Dialogs; with Gtk; use Gtk; with Gtk.Main; use Gtk.Main; with Ada.Text_IO; use Ada.Text_IO; package body graphical_editor is procedure do_new is begin if (not is_saved) then if (not is_new) then if Message_Dialog (To_String (lb_not_saved_project (current_language) & ASCII.LF & lb_continue (current_language)), confirmation, Button_Yes or Button_Cancel, Button_Cancel, "", "") /= Button_Yes then return; end if; end if; end if; initialize (sys); xml_project_file_name := To_Unbounded_String (""); initialize (aadl_project_file_name); xml_event_table_file_name := To_Unbounded_String ("default_event_table.xml"); is_saved := False; is_new := True; starting_text; event_table_file_name := empty_string; initialize (sched.all); end do_new; procedure do_open is begin if (not is_saved) then if (not is_new) then if Message_Dialog (To_String (lb_not_saved_project (current_language) & ASCII.LF & lb_continue (current_language)), confirmation, Button_Yes or Button_Cancel, Button_Cancel, "", "") /= Button_Yes then return; end if; end if; end if; initialize (sys); xml_project_file_name := To_Unbounded_String (""); initialize (aadl_project_file_name); xml_event_table_file_name := To_Unbounded_String ("default_event_table.xml"); is_saved := False; is_new := True; event_table_file_name := empty_string; initialize (sched.all); starting_text; end do_open; procedure do_save is begin if (xml_project_file_name /= To_Unbounded_String ("")) then systems.write_to_xml_file (sys, xml_project_file_name); is_saved := True; end if; end do_save; procedure do_aadl_export is begin null; end do_aadl_export; procedure do_aadl_import is begin if (not is_saved) then if (not is_new) then if Message_Dialog (To_String (lb_not_saved_project (current_language) & ASCII.LF & lb_continue (current_language)), confirmation, Button_Yes or Button_Cancel, Button_Cancel, "", "") /= Button_Yes then return; end if; end if; end if; end do_aadl_import; --procedure Do_Save_As is --begin -- null; --end Do_Save_As; procedure do_exit is begin if (not is_saved) then if (not is_new) then if Message_Dialog (To_String (lb_not_saved_project (current_language) & ASCII.LF & lb_continue (current_language)), confirmation, Button_Yes or Button_Cancel, Button_Cancel, "", "") = Button_Yes then Gtk.Main.Gtk_Exit (0); else return; end if; end if; end if; Gtk.Main.Gtk_Exit (0); end do_exit; function display_zoom return Unbounded_String is result : Unbounded_String := To_Unbounded_String (""); begin case zoom_level is when -5 => result := To_Unbounded_String ("3 %"); when -4 => result := To_Unbounded_String ("6 %"); when -3 => result := To_Unbounded_String ("12 %"); when -2 => result := To_Unbounded_String ("25 %"); when -1 => result := To_Unbounded_String ("50 %"); when 0 => result := To_Unbounded_String ("100 %"); when +1 => result := To_Unbounded_String ("200 %"); when +2 => result := To_Unbounded_String ("400 %"); when +3 => result := To_Unbounded_String ("800 %"); when +4 => result := To_Unbounded_String ("1600 %"); when +5 => result := To_Unbounded_String ("3200 %"); end case; return result; end display_zoom; end graphical_editor;