cheddar_3.3.0_aea10b3c/graphical_editor/graphical_editor-cheddar_callbacks-edit_menu.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 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 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.edit_menu is



   procedure core (object : access gtkada_builder_record'class) is
   begin
      graphical_editor.cores.show_core_widget;
   end core;

   procedure event_analyzer (object : access gtkada_builder_record'class) is
   begin
      graphical_editor.event_analyzers.show_event_analyzer_widget;
   end event_analyzer;

   procedure message (object : access gtkada_builder_record'class) is
   begin
      graphical_editor.messages.show_message_widget;
   end message;

   procedure precedence_dependency
     (object : access gtkada_builder_record'class)
   is
   begin
      if (get_number_of_elements (sys.tasks) = 0) then
         show_message_box (lb_define_tasks_before (current_language));
         return;
      else
         graphical_editor.precedence_dependency.show_precedency_widget;
      end if;
   end precedence_dependency;

   procedure resource_dependency
     (object : access gtkada_builder_record'class)
   is
   begin
      if (get_number_of_elements (sys.resources) = 0) then
         show_message_box (lb_define_resources_before (current_language));
         return;
      else
         graphical_editor.resource_dependency.show_resource_widget;
      end if;
   end resource_dependency;

   procedure black_board_buffer_dependency
     (object : access gtkada_builder_record'class)
   is
   begin
      if (get_number_of_elements (sys.buffers) = 0) then
         show_message_box (lb_define_buffers_before (current_language));
         return;
      else
         graphical_editor.black_board_buffer_dependency
           .show_black_board_buffer_widget;
      end if;
   end black_board_buffer_dependency;

   procedure queueing_buffer_dependency
     (object : access gtkada_builder_record'class)
   is
   begin
      if (get_number_of_elements (sys.buffers) = 0) then
         show_message_box (lb_define_buffers_before (current_language));
         return;
      else
         graphical_editor.queueing_buffer_dependency
           .show_queueing_buffer_widget;
      end if;
   end queueing_buffer_dependency;

   procedure asynchronous_communication_dependency
     (object : access gtkada_builder_record'class)
   is
   begin
      if (get_number_of_elements (sys.messages) = 0) then
         show_message_box (lb_define_messages_before (current_language));
         return;
      else
         graphical_editor.asynchronous_communication_dependency
           .show_asynchronous_communication_widget;
      end if;
   end asynchronous_communication_dependency;

   procedure time_triggered_dependency
     (object : access gtkada_builder_record'class)
   is
   begin
      if (get_number_of_elements (sys.tasks) = 0) then
         show_message_box (lb_define_tasks_before (current_language));
         return;
      else
         graphical_editor.time_triggered_communication_dependency
           .show_time_triggered_widget;
      end if;
   end time_triggered_dependency;

   procedure resource (object : access gtkada_builder_record'class) is
   begin
      if (get_number_of_elements (sys.tasks) = 0) then
         show_message_box (lb_define_tasks_before (current_language));
         return;
      else
         graphical_editor.resources.show_resource_widget;
      end if;
   end resource;

   procedure address_space (object : access gtkada_builder_record'class) is
   begin
      if (get_number_of_elements (sys.processors) = 0) then
         show_message_box (lb_define_processors_before (current_language));
         return;
      else
         graphical_editor.address_spaces.show_address_space_widget;
      end if;
   end address_space;

   procedure task_group (object : access gtkada_builder_record'class) is
   begin
      if (get_number_of_elements (sys.tasks) = 0) then
         show_message_box (lb_define_tasks_before (current_language));
         return;
      else
         graphical_editor.task_groups.show_task_group_widget;
      end if;
   end task_group;

   procedure taskc (object : access gtkada_builder_record'class) is
   begin
      if (get_number_of_elements (sys.address_spaces) = 0) then
         show_message_box (lb_define_address_spaces_before (current_language));
         return;
      else
         graphical_editor.tasks.show_task_widget;
      end if;
   end taskc;

   procedure processor (object : access gtkada_builder_record'class) is
   begin
      if (get_number_of_elements (sys.core_units) = 0) then
         show_message_box (lb_define_core_units_before (current_language));
         return;
      else
         graphical_editor.processors.show_processor_widget;
      end if;
   end processor;

   procedure cache (object : access gtkada_builder_record'class) is
   begin
      graphical_editor.caches.show_cache_widget;
   end cache;

    procedure buffer (Object : access Gtkada_Builder_Record'Class) is
    begin
        graphical_editor.buffers.Show_Buffer_Widget;
    end buffer;

   procedure network (object : access gtkada_builder_record'class) is
   begin
      if (get_number_of_elements (sys.processors) = 0) then
         show_message_box (lb_define_processors_before (current_language));
         return;
      else
         graphical_editor.networks.show_network_widget;
      end if;
   end network;




   
end graphical_editor.cheddar_callbacks.edit_menu;