cheddar_3.3.0_aea10b3c/graphical_editor/graphical_editor-cheddar_callbacks.adb

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 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 GNAT.OS_Lib;                       use GNAT.OS_Lib;
with Ada.Direct_IO;
with Ada.Exceptions;                   use Ada.Exceptions;
with Ada.Text_IO;                      use Ada.Text_IO;
with Ada.Text_IO.Text_Streams;         use Ada.Text_IO.Text_Streams;

with graphical_editor.scheduling_refs; use graphical_editor.scheduling_refs;
with graphical_editor.manuals;         use graphical_editor.manuals;
with graphical_editor.about;         use graphical_editor.about;
with graphical_editor.caches;          use graphical_editor.caches;
with graphical_editor.cores;           use graphical_editor.cores;
with graphical_editor.address_spaces;  use graphical_editor.address_spaces;
with graphical_editor.processors;      use graphical_editor.processors;
with graphical_editor.networks;        use graphical_editor.networks;
with graphical_editor.aadl_options;    use graphical_editor.aadl_options;
with graphical_editor.tasks;           use graphical_editor.tasks;
with graphical_editor.task_groups;     use graphical_editor.task_groups;
with graphical_editor.messages;        use graphical_editor.messages;
with graphical_editor.precedence_dependency;
use graphical_editor.precedence_dependency;
with graphical_editor.queueing_buffer_dependency;
use graphical_editor.queueing_buffer_dependency;
with graphical_editor.black_board_buffer_dependency;
use graphical_editor.black_board_buffer_dependency;
with graphical_editor.resource_dependency;
use graphical_editor.resource_dependency;
with graphical_editor.asynchronous_communication_dependency;
use graphical_editor.asynchronous_communication_dependency;
with graphical_editor.time_triggered_communication_dependency;
use graphical_editor.time_triggered_communication_dependency;
with graphical_editor.resources;       use graphical_editor.resources;
with graphical_editor.buffers;         use graphical_editor.buffers;
with graphical_editor.event_tables;    use graphical_editor.event_tables;
with graphical_editor.event_analyzers; use graphical_editor.event_analyzers;
with graphical_editor.analysis_on_event_table;
use graphical_editor.analysis_on_event_table;
with graphical_editor.scheduling_simulations;
use graphical_editor.scheduling_simulations;
with graphical_editor.scheduling_options;
use graphical_editor.scheduling_options;
with graphical_editor.feasibility_test_options;
use graphical_editor.feasibility_test_options;
with graphical_editor.priorities; use graphical_editor.priorities;
with graphical_editor.scheduling_feasibility_widgets;
use graphical_editor.scheduling_feasibility_widgets;
with graphical_editor.message_text;    use graphical_editor.message_text;
with graphical_editor.file_selector;   use graphical_editor.file_selector;
with graphical_editor.draw_scheduling; use graphical_editor.draw_scheduling;
with graphical_editor.user_message;    use graphical_editor.user_message;

with Gtk.Main;
with Glib;                             use Glib;
with Glib.Object;                      use Glib.Object;
with Gtk.Widget;                       use Gtk.Widget;
with Gdk.Window;                       use Gdk.Window;
with Gdk.Color;                        use Gdk.Color;
with Gdk.Event;                        use Gdk.Event;
with Gtk.Text_Iter;                 use Gtk.Text_Iter;
with Gtk.Tooltip; use Gtk.Tooltip;
with gtk.file_chooser_dialog; use gtk.file_chooser_dialog;
with gtk.file_chooser; use gtk.file_chooser;

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 call_scheduling_framework; use call_scheduling_framework;
with tasks;                     use tasks;
with task_set;                  use task_set;
use task_set.generic_task_set;
with buffers;    use buffers;
with buffer_set; use buffer_set;
use buffer_set.generic_buffer_set;
with address_spaces;    use address_spaces;
with address_space_set; use address_space_set;
use address_space_set.generic_address_space_set;
with resources;    use resources;
with resource_set; use resource_set;
use resource_set.generic_resource_set;
with messages;    use messages;
with message_set; use message_set;
use message_set.generic_message_set;
with processors;    use processors;
with processor_set; use processor_set;
use processor_set.generic_processor_set;
use processor_set.generic_core_unit_set;
with task_group_set; use task_group_set;
use task_group_set.generic_task_group_set;
with multiprocessor_services;           use multiprocessor_services;
with multiprocessor_services_interface; use multiprocessor_services_interface;
use multiprocessor_services_interface.scheduling_result_per_processor_package;
with graphical_editor.user_message; use graphical_editor.user_message;
with translate;                     use translate;
with framework_config;              use framework_config;
with time_unit_events;              use time_unit_events;
with call_memory_framework;         use call_memory_framework;
use call_memory_framework.buffer_result_package;
with graphical_editor.scheduling_simulations_callbacks;
use graphical_editor.scheduling_simulations_callbacks;
with cache_set;   use cache_set;
with network_set; use network_set;
use network_set.generic_network_set;
with caches;                   use caches;
with caches;                   use caches.cache_blocks_table_package;
with cache_access_profile_set; use cache_access_profile_set;
with cache_access_profile_set;
use cache_access_profile_set.cache_access_profile_set;
with io_tools;                         use io_tools;


package body graphical_editor.cheddar_callbacks is

  

   procedure clear_workspace is
   begin
      Set_Text (buffer_editor_cheddar, "");
      graphical_editor.draw_scheduling.clear_time_line;
   end clear_workspace;

   procedure clear_workspace (object : access gtkada_builder_record'class) is
   begin
      clear_workspace;
   end clear_workspace;

     procedure initialyse_system (object : access gtkada_builder_record'class) is
   begin
      clear_workspace;
      do_new;
      Set_Text
        (model_file_name_entry,
         To_String (simple_name (xml_project_file_name)));
   end initialyse_system;

   function new_quit
     (object : access gtkada_builder_record'class) return Boolean
   is
   begin
      do_exit;
      return True;
   end new_quit;

   procedure new_quit_proc (object : access gtkada_builder_record'class) is
   begin
      do_exit;
   end new_quit_proc;

   procedure quit (object : access gtkada_builder_record'class) is
   begin
      Os_Exit (0);
   end quit;

   function quitaboutdialog
     (object : access gtkada_builder_record'class) return Boolean
   is
   begin
      Gtk.Main.Main_Quit;
      return False;
   end quitaboutdialog;

end graphical_editor.cheddar_callbacks;