------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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: 3657 $ -- $Date: 2020-12-13 13:25:49 +0100 (dim., 13 déc. 2020) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Text_IO; use Ada.Text_IO; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GNAT.Current_Exception; use GNAT.Current_Exception; with Glib; use Glib; with Glib.Object; use Glib.Object; with Gtk; use Gtk; with Gtk.Main; use Gtk.Main; with Gtk.Drawing_Area; use Gtk.Drawing_Area; with Gtk.Handlers; use Gtk.Handlers; with Gdk; use Gdk; with Gdk.Color; use Gdk.Color; with Gdk.Window; use Gdk.Window; with Pango.Font; use Pango.Font; with Gdk.Event; use Gdk.Event; with editor_config; use editor_config; with framework_config; use framework_config; with translate; use translate; with xml_generic_parsers; use xml_generic_parsers; with xml_generic_parsers.architecture; use xml_generic_parsers.architecture; with multiprocessor_services; use multiprocessor_services; with graphical_editor.user_message; use graphical_editor.user_message; with graphical_editor.generic_package_widget; use graphical_editor.generic_package_widget; with graphical_editor.scheduling_simulations_callbacks; use graphical_editor.scheduling_simulations_callbacks; with graphical_editor.draw_scheduling; use graphical_editor.draw_scheduling; package body graphical_editor.event_tables_callbacks is draw_from_time : Integer := 0; draw_to_time : Integer := 0; procedure draw_time_line_from_event_table (object : access gtkada_builder_record'Class) is draw_from, draw_to : Unbounded_String; ok : Boolean; begin Hide (gtk_widget (Get_Object (object, "window1"))); draw_from := suppress_space (get_value_buffer_string (gtk_text_buffer (Get_Object (object, "textbuffer1")))); draw_to := suppress_space (get_value_buffer_string (gtk_text_buffer (Get_Object (object, "textbuffer2")))); 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) & lb_greater_than (current_language) & " 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) & lb_greater_or_equal_than (current_language) & " 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 & lb_greater_or_equal_than (current_language) & lb_double_quote & lb_draw_to (current_language) & lb_double_quote); return; end if; if (draw_to_time - draw_from_time > max_time_line_size_to_display) then show_message_box (lb_draw_time_line_too_large (current_language)); return; end if; graphical_editor.draw_scheduling.clear_time_line; graphical_editor.draw_scheduling.draw_scheduling_events (draw_to_time, draw_from_time); end draw_time_line_from_event_table; procedure close_widget (object : access gtkada_builder_record'Class) is my_widget : gobject; begin my_widget := Get_Object (object, "window1"); Unref (my_widget); Hide (gtk_widget (my_widget)); Destroy (gtk_widget (my_widget)); end close_widget; end graphical_editor.event_tables_callbacks;