File: /home/oboss/Users/gec/sources/PUS_Services/On_Board_Scheduler/on_board_scheduling_parser.ads
1 --% Compilation Unit: On_Board_Scheduling_Parser
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: on_board_scheduling_parser.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:19 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:14 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 PUS_Data_Types;
52 with On_Board_Scheduling_Types;
53 with External_On_Board_Scheduling_Types;
54 with Mission_Parameters;
55 with Verification_Types;
56 generic
57
58 --% Generic Parameter Constraints:
59 --> None
60
61 Max_List_Length : in Positive;
62
63 type Sub_Schedule_ID is (<>);
64 All_Sub_Schedules : in Sub_Schedule_ID;
65 type Sub_Schedule_ID_Rep is array (Sub_Schedule_ID) of
66 External_On_Board_Scheduling_Types.Sub_Schedule_ID;
67 Sub_Schedule_ID_Rep_Vals : in Sub_Schedule_ID_Rep;
68
69 package On_Board_Scheduling_Parser is
70
71 --% Library Package:
72 -- Parsing of the source data part of TCs and unparsing of the source
73 --+ data part of TMs related to on-board scheduling
74 --% Active Tasks:
75 --> None
76 --% Passive Tasks:
77 --> None
78
79 -- Indicates that unparsing of internal TM representation failed
80 Unparsing_Failed : exception;
81
82 type List_Length is new On_Board_Scheduling_Types.List_Length;
83
84 -- Types related to internal representation of Telecommands
85
86 subtype APID_Index is List_Length range 1 .. List_Length(Max_List_Length);
87 type APID_List is array (APID_Index) of Mission_Parameters.APID;
88
89 type Sub_Schedule_And_APIDs is
90 record
91 Sub_Sched_ID : Sub_Schedule_ID;
92 Number_Of_APIDs : List_Length;
93 APIDs : APID_List;
94 end record;
95
96 subtype Schedule_Control_Index is
97 List_Length range 1 .. List_Length(Max_List_Length);
98 type Sub_Schedule_And_APIDs_List is array (Schedule_Control_Index) of
99 Sub_Schedule_And_APIDs;
100
101 type Scheduling_Control_Params is
102 record
103 Number_Of_Sub_Schedules : List_Length;
104 Sub_Schedules_Info : Sub_Schedule_And_APIDs_List;
105 end record;
106
107 type Packet_Scheduling_Info is
108 record
109 Scheduling_Event : On_Board_Scheduling_Types.Scheduling_Event_Spec;
110 Time_Tag : On_Board_Scheduling_Types.CUC_Time;
111 TC_Packet : PUS.PUS_Packet;
112 end record;
113
114 subtype Packet_Scheduling_Index is
115 List_Length range 1 .. List_Length(Max_List_Length);
116 type Packet_Scheduling_Info_List is array (Packet_Scheduling_Index) of
117 Packet_Scheduling_Info;
118
119 type Packet_Insertion_Specs is
120 record
121 Number_Of_Packets : List_Length;
122 Packet_Insertions : Packet_Scheduling_Info_List;
123 end record;
124
125 type TC_Schedule_Selection_Elem is
126 record
127 Application_ID : Mission_Parameters.APID;
128 Seq_Count : PUS_Data_Types.Sequence_Count;
129 Number_Of_TCs : List_Length;
130 end record;
131
132 subtype TC_Schedule_Selection_Index is
133 List_Length range 1 .. List_Length(Max_List_Length);
134 type TC_Schedule_Selection is array (TC_Schedule_Selection_Index) of
135 TC_Schedule_Selection_Elem;
136
137 type TC_Schedule_Selection_Spec is
138 record
139 Number_Of_Elems : List_Length;
140 Selection : TC_Schedule_Selection;
141 end record;
142
143 type TC_Schedule_Selection_Over_Time is
144 record
145 Time_Range : On_Board_Scheduling_Types.Temporal_Range_Type;
146 Selection : Scheduling_Control_Params;
147 Time_Spec : On_Board_Scheduling_Types.Time_Specification;
148 end record;
149
150 type TC_Subservice is
151 (Enable_Release,
152 Disable_Release,
153 Reset_Command_Schedule,
154 Insert_Telecommands_In_Command_Schedule,
155 Delete_Telecommands,
156 Delete_Telecommands_Over_Time_Period,
157 Report_Command_Schedule_Detailed,
158 Report_Command_Schedule_Summary,
159 Report_Subset_Of_Command_Schedule_Detailed,
160 Report_Subset_Of_Command_Schedule_Summary,
161 Report_Command_Schedule_Detailed_Over_Time,
162 Report_Command_Schedule_Summary_Over_Time);
163
164 type Internal_TC_Source_Data
165 (Subservice : TC_Subservice := TC_Subservice'First) is
166 record
167 case Subservice is
168 when Enable_Release =>
169 Enabling_Def : Scheduling_Control_Params;
170 when Disable_Release =>
171 Disabling_Def : Scheduling_Control_Params;
172 when Reset_Command_Schedule =>
173 null;
174 when Insert_Telecommands_In_Command_Schedule =>
175 Sub_Sched_ID : Sub_Schedule_ID;
176 Insertions : Packet_Insertion_Specs;
177 when Delete_Telecommands =>
178 Deletion_Spec : TC_Schedule_Selection_Spec;
179 when Delete_Telecommands_Over_Time_Period =>
180 Deletion_Over_Time_Spec : TC_Schedule_Selection_Over_Time;
181 when Report_Command_Schedule_Detailed =>
182 null;
183 when Report_Command_Schedule_Summary =>
184 null;
185 when Report_Subset_Of_Command_Schedule_Detailed =>
186 Report_Detailed_Spec : TC_Schedule_Selection_Spec;
187 when Report_Subset_Of_Command_Schedule_Summary =>
188 Report_Summary_Spec : TC_Schedule_Selection_Spec;
189 when Report_Command_Schedule_Detailed_Over_Time =>
190 Report_Detailed_Over_Time_Spec
191 : TC_Schedule_Selection_Over_Time
192 ;
193 when Report_Command_Schedule_Summary_Over_Time =>
194 Report_Summary_Over_Time_Spec : TC_Schedule_Selection_Over_Time;
195 end case;
196 end record;
197
198 type Interpretation_Result is
199 (Failed,
200 Passed);
201
202 type Internal_TC_Representation
203 (Result : Interpretation_Result := Failed;
204 Subservice : TC_Subservice := TC_Subservice'First) is
205 record
206 case Result is
207 when Failed =>
208 Status : Verification_Types.Verification_Status;
209 when Passed =>
210 Src_Data : Internal_TC_Source_Data (Subservice);
211 end case;
212 end record;
213
214 -- Types related to internal representation of telemetry
215
216
217 type Detailed_Schedule_Info_Elem is
218 record
219 Sub_Sched_ID : Sub_Schedule_ID;
220 Scheduling_Event : On_Board_Scheduling_Types.Scheduling_Event_Spec;
221 Time_Tag : On_Board_Scheduling_Types.CUC_Time;
222 TC_Packet : PUS.PUS_Packet;
223 end record;
224
225 subtype Detailed_Schedule_Info_Index is
226 List_Length range 1 .. List_Length(Max_List_Length);
227 type Detailed_Schedule_Info is array (Detailed_Schedule_Info_Index) of
228 Detailed_Schedule_Info_Elem;
229
230 type Detailed_Schedule_Report is
231 record
232 Number_Of_Elems : List_Length := 0;
233 Selection : Detailed_Schedule_Info;
234 end record;
235
236 type Summary_Schedule_Info_Elem is
237 record
238 Sub_Sched_ID : Sub_Schedule_ID;
239 Scheduling_Event : On_Board_Scheduling_Types.Scheduling_Event_Spec;
240 Time_Tag : On_Board_Scheduling_Types.CUC_Time;
241 Application_ID : Mission_Parameters.APID;
242 Seq_Count : PUS_Data_Types.Sequence_Count;
243 end record;
244
245 subtype Summary_Schedule_Info_Index is
246 List_Length range 1 .. List_Length(Max_List_Length);
247 type Summary_Schedule_Info is array (Summary_Schedule_Info_Index) of
248 Summary_Schedule_Info_Elem;
249
250 type Summary_Schedule_Report is
251 record
252 Number_Of_Elems : List_Length := 0;
253 Selection : Summary_Schedule_Info;
254 end record;
255
256
257 --% Subprogram:
258 -- Transform the source data part of an on-board scheduling TC into its
259 --+ internal representation
260 --% Parameter Constraints:
261 --> None
262 --% Exceptions Raised:
263 --> None
264
265 function Parse_TC
266 (TC : in PUS.PUS_Packet)
267 return Internal_TC_Representation;
268
269
270 --% Subprogram:
271 -- Produce a telemetry packet with a given detailed schedule report as
272 --+ its source data
273 --% Parameter Constraints:
274 --> None
275 --% Exceptions Raised:
276 --> Unparsing_Failed - When a Detailed Schedule Report cannot be written
277 --+ to Src_Data
278 --> Source_Data_Stream.Write_Stream_Exhausted - When there is not
279 --+ sufficient space for the value on Src_Data
280 --> Source_Data_Stream.No_Streams_Available - Heap of source streams has
281 --+ been exhausted
282 --> PUS_State.No_Packets_Available - Heap of PUS packets has been
283 --+ exhausted
284
285 function Unparse_Detailed_Schedule_Report
286 (Appl_ID : in Mission_Parameters.APID;
287 Det_Sched_Rep : in Detailed_Schedule_Report)
288 return PUS.PUS_Packet;
289
290
291 --% Subprogram:
292 -- Produce a telemetry packet with a given summary schedule report as its
293 --+ source data
294 --% Parameter Constraints:
295 --> None
296 --% Exceptions Raised:
297 --> Unparsing_Failed - When a Summary Schedule Report cannot be written
298 --+ to Src_Data
299 --> Source_Data_Stream.Write_Stream_Exhausted - When there is not
300 --+ sufficient space for the value on Src_Data
301 --> Source_Data_Stream.No_Streams_Available - Heap of source streams has
302 --+ been exhausted
303 --> PUS_State.No_Packets_Available - Heap of PUS packets has been
304 --+ exhausted
305
306 function Unparse_Summary_Schedule_Report
307 (Appl_ID : in Mission_Parameters.APID;
308 Sum_Sched_Rep : in Summary_Schedule_Report)
309 return PUS.PUS_Packet;
310
311 procedure Initialize;
312
313 end On_Board_Scheduling_Parser;
314
315 --~-----------------------------------------------------------------------------
316