File: /home/oboss/Users/gec/sources/PUS_Services/On_Board_Scheduler/gen_obs_schedule.ads

1     --% Compilation Unit: Gen_OBS_Schedule
2     --
3     --% Category: Generic Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 2.1 $
8     --
9     --% Author:   $Author: gec $
10     --
11     --% Revision Log:
12     --    $Log: gen_obs_schedule.ads,v $
13     --    Revision 2.1  2003/11/13 14:57:53  gec
14     --    Merged ECSS Migration branch to main trunk.
15     --
16     --    Revision 2.0.8.1  2003/11/13 08:04:56  gec
17     --    Updated On-board Operations Scheduling service in accordance with ECSS-E-70-41A
18     --
19     --    Revision 2.0  2003/04/04 08:51:17  gec
20     --    Initial release of source files serving as baseline for OBOSS-III
21     --+    project.
22     --
23     --    Revision 1.1.1.1  2003/04/04 08:13:13  gec
24     --    Imported using TkCVS
25     --
26     --
27     --
28     --% Project: OBOSS
29     --
30     --% Copyright (C) 2003 by Terma A/S
31     --  Proprietary and intellectual rights of Terma A/S, Denmark,
32     --  are involved in the subject-matter of this material and
33     --  all manufacturing, reproduction, use, disclosure, and
34     --  sales rights pertaining to such subject-matter are
35     --  expressly reserved. This material is submitted for a
36     --  specific purpose as agreed, and the recipient by
37     --  accepting this material agrees that this material will
38     --  not be used, copied, or reproduced in whole or in part
39     --  nor its contents revealed in any manner or to any person,
40     --  except to meet the purpose for which it was submitted and
41     --  subject to the terms of the agreement.
42     --
43     --% Target Dependencies:
44     --    None
45     --% Compiler Dependencies:
46     --    None
47     
48     --~-----------------------------------------------------------------------------
49     
50     with PUS;
51     with On_Board_Scheduling_Types;
52     with PUS_Data_Types;
53     with Mission_Parameters;
54     with Verification_Types;
55     with Task_Priority_Control;
56     generic
57     
58        --% Generic Parameter Constraints:
59        -->   Protected_Task_Priority  - Shall at least be the ceiling of priorities
60        --+    of all tasks using services from the Gen_OBS_Schedule
61     
62        Schedule_Size : in     Natural;
63     
64        -- Max_Number_Of_Telecommands_Due indicates the  maximum number of TCs that
65        --+    may be due at the time Get_Telecommands_Due is called.
66        -- This will be depending on the timetags of commands added to the schedule
67        --+    and the period with which Get_Telecommands_Due is polled.
68        Max_Number_Of_Telecommands_Due : in     Positive;
69     
70        type Sub_Schedule_ID is (<>);
71        All_Sub_Schedules : in     Sub_Schedule_ID;
72     
73        -- Priority assigned to protected object implementing critical region.
74        Protected_Object_Priority
75                                  : in     Task_Priority_Control.
76                                    Passive_Task_Priority;
77     
78     package Gen_OBS_Schedule is
79     
80        --% Library Package:
81        --    Management of the on-board schedule state
82        --% Active Tasks:
83        -->   None
84        --% Passive Tasks:
85        -->   Critical_Region - Protection of schedule state
86     
87        type Detailed_Schedule_Info_Elem is
88           record
89              Sub_Sched_ID     : Sub_Schedule_ID;
90              Scheduling_Event : On_Board_Scheduling_Types.Scheduling_Event_Spec;
91              Time_Tag         : On_Board_Scheduling_Types.CUC_Time;
92              TC_Packet        : PUS.PUS_Packet;
93           end record;
94     
95        type Detailed_Schedule_Info is array (Natural range <>) of
96              Detailed_Schedule_Info_Elem;
97     
98        type Summary_Schedule_Info_Elem is
99           record
100              Sub_Sched_ID     : Sub_Schedule_ID;
101              Scheduling_Event : On_Board_Scheduling_Types.Scheduling_Event_Spec;
102              Time_Tag         : On_Board_Scheduling_Types.CUC_Time;
103              Application_ID   : Mission_Parameters.APID;
104              Seq_Count        : PUS_Data_Types.Sequence_Count;
105           end record;
106     
107        type Summary_Schedule_Info is array (Natural range <>) of
108              Summary_Schedule_Info_Elem;
109     
110        -- Implementation of variable length lists of TCs
111        type TC_List_Range is new
112              Natural range 0 .. Max_Number_Of_Telecommands_Due;
113        -- Range extended to include PUS.Void for safe inicialisation.
114        type TC_List is array (TC_List_Range range <>) of PUS.Optional_PUS_Packet;
115     
116        procedure Initialize;
117     
118     
119        --% Subprogram:
120        --    Enable the on-board schedule
121        --% Parameter Constraints:
122        -->   None
123        --% Exceptions Raised:
124        -->   None
125     
126        function Enable_Schedule
127              return Verification_Types.Verification_Status;
128     
129     
130        --% Subprogram:
131        --    Disable the on-board schedule
132        --% Parameter Constraints:
133        -->   None
134        --% Exceptions Raised:
135        -->   None
136     
137        function Disable_Schedule
138              return Verification_Types.Verification_Status;
139     
140     
141        --% Subprogram:
142        --   Enable a sub-schedule, potentially identifying a collection of
143        --+    destination application proccesses
144        --% Parameter Constraints:
145        -->   None
146        --% Exceptions Raised:
147        -->   None
148     
149        function Enable_Sub_Schedule
150              (Sub_Sch_ID      : in     Sub_Schedule_ID;
151               Number_Of_APIDs : in     Natural;
152               APIDs           : in     On_Board_Scheduling_Types.APID_Set)
153              return Verification_Types.Verification_Status;
154     
155     
156        --% Subprogram:
157        --   Disable a sub-schedule, potentially identifying a collection of
158        --+    destination application proccesses
159        --% Parameter Constraints:
160        -->   None
161        --% Exceptions Raised:
162        -->   None
163     
164        function Disable_Sub_Schedule
165              (Sub_Sch_ID      : in     Sub_Schedule_ID;
166               Number_Of_APIDs : in     Natural;
167               APIDs           : in     On_Board_Scheduling_Types.APID_Set)
168              return Verification_Types.Verification_Status;
169     
170     
171        --% Subprogram:
172        --    Reset the complete on-board schedule
173        --% Parameter Constraints:
174        -->   None
175        --% Exceptions Raised:
176        -->   None
177     
178        function Reset
179              return Verification_Types.Verification_Status;
180     
181     
182        --% Subprogram:
183        --    Insert a telecommand with its scheduling information onto a given
184        --+    sub-schedule
185        --% Parameter Constraints:
186        -->   None
187        --% Exceptions Raised:
188        -->   None
189     
190        function Insert_TC_Packet
191              (Sub_Sch_ID       : in     Sub_Schedule_ID;
192               Scheduling_Event
193                                : in     On_Board_Scheduling_Types.
194                                  Scheduling_Event_Spec;
195               Time_Tag         : in     On_Board_Scheduling_Types.CUC_Time;
196               TC_Packet        : in     PUS.PUS_Packet)
197              return Verification_Types.Verification_Status;
198     
199     
200        --% Subprogram:
201        --    Delete a number of telecommands starting from a given one
202        --% Parameter Constraints:
203        -->   None
204        --% Exceptions Raised:
205        -->   None
206     
207        function Delete_TC_Packets
208              (Application_ID : in     Mission_Parameters.APID;
209               Seq_Count      : in     PUS_Data_Types.Sequence_Count;
210               Number_Of_TCs  : in     Natural)
211              return Verification_Types.Verification_Status;
212     
213     
214        --% Subprogram:
215        --   Delete telecommands whose scheduling time satisfies a given time
216        --+    specification
217        --% Parameter Constraints:
218        -->   None
219        --% Exceptions Raised:
220        -->   None
221     
222        function Delete_TC_Packets_Over_Time
223              (Time_Criteria
224                               : in     On_Board_Scheduling_Types.
225                                 Time_Specification;
226               Sub_Sch_ID      : in     Sub_Schedule_ID;
227               Number_Of_APIDs : in     Natural;
228               APIDs           : in     On_Board_Scheduling_Types.APID_Set)
229              return Verification_Types.Verification_Status;
230     
231     
232        --% Subprogram:
233        --    Report subset of the contents of the on-board schedule in detailed
234        --+    form with a number of telecommands starting from a given one
235        --% Parameter Constraints:
236        -->   None
237        --% Exceptions Raised:
238        -->   None
239     
240        procedure Get_Detailed_Schedule_Info
241              (Application_ID : in     Mission_Parameters.APID;
242               Seq_Count      : in     PUS_Data_Types.Sequence_Count;
243               Number_Of_TCs  : in     Natural;
244               Det_Sch_Info   :    out Detailed_Schedule_Info;
245               Info_Length    :    out Natural;
246               Status         :    out Verification_Types.Verification_Status);
247     
248     
249        --% Subprogram:
250        --    Report the contents of the on-board schedule in detailed form with
251        --+    telecommands whose scheduling time satisfies a given time
252        --+    specification
253        --% Parameter Constraints:
254        -->   None
255        --% Exceptions Raised:
256        -->   None
257     
258        procedure Get_Detailed_Schedule_Over_Time_Info
259              (Time_Criteria
260                               : in     On_Board_Scheduling_Types.
261                                 Time_Specification;
262               Sub_Sch_ID      : in     Sub_Schedule_ID;
263               Number_Of_APIDs : in     Natural;
264               APIDs           : in     On_Board_Scheduling_Types.APID_Set;
265               Det_Sch_Info    :    out Detailed_Schedule_Info;
266               Info_Length     :    out Natural;
267               Status          :    out Verification_Types.Verification_Status);
268     
269     
270        --% Subprogram:
271        --    Report subset of the contents of the on-board schedule in summary form
272        --+    with a number of telecommands starting from a given one
273        --% Parameter Constraints:
274        -->   None
275        --% Exceptions Raised:
276        -->   None
277     
278        procedure Get_Summary_Schedule_Info
279              (Application_ID : in     Mission_Parameters.APID;
280               Seq_Count      : in     PUS_Data_Types.Sequence_Count;
281               Number_Of_TCs  : in     Natural;
282               Sum_Sch_Info   :    out Summary_Schedule_Info;
283               Info_Length    :    out Natural;
284               Status         :    out Verification_Types.Verification_Status);
285     
286     
287        --% Subprogram:
288        --    Report the contents of the on-board schedule in summary form with
289        --+    telecommands whose scheduling time satisfies a given time
290        --+    specification
291        --% Parameter Constraints:
292        -->   None
293        --% Exceptions Raised:
294        -->   None
295     
296        procedure Get_Summary_Schedule_Over_Time_Info
297              (Time_Criteria
298                               : in     On_Board_Scheduling_Types.
299                                 Time_Specification;
300               Sub_Sch_ID      : in     Sub_Schedule_ID;
301               Number_Of_APIDs : in     Natural;
302               APIDs           : in     On_Board_Scheduling_Types.APID_Set;
303               Sum_Sch_Info    :    out Summary_Schedule_Info;
304               Info_Length     :    out Natural;
305               Status          :    out Verification_Types.Verification_Status);
306     
307        --% Subprogram:
308        --    Report the contents of the on-board schedule in detailed form
309        --% Parameter Constraints:
310        -->   None
311        --% Exceptions Raised:
312        -->   None
313     
314        procedure Get_Detailed_Schedule_Info
315              (Det_Sch_Info :    out Detailed_Schedule_Info;
316               Info_Length  :    out Natural;
317               Status       :    out Verification_Types.Verification_Status);
318     
319        --% Subprogram:
320        --    Report the contents of the on-board schedule in summary form
321        --% Parameter Constraints:
322        -->   None
323        --% Exceptions Raised:
324        -->   None
325     
326        procedure Get_Summary_Schedule_Info
327              (Sum_Sch_Info :    out Summary_Schedule_Info;
328               Info_Length  :    out Natural;
329               Status       :    out Verification_Types.Verification_Status);
330     
331        --% Subprogram:
332        --    Extract the telecommands that are due for execution
333        --% Parameter Constraints:
334        -->   None
335        --% Exceptions Raised:
336        -->   None
337     
338        function Get_Telecommands_Due
339              return TC_List;
340     
341     end Gen_OBS_Schedule;
342     
343     --~-----------------------------------------------------------------------------
344