File: /home/oboss/Users/gec/sources/PUS_Services/Event_Action/event_action-service-tc_parser.ads

1     --% Compilation Unit: Event_Action.Service.TC_Parser
2     --
3     --% Category: Generic Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 1.3 $
8     --
9     --% Author:   $Author: jhl $
10     --
11     --% Revision Log:
12     --    $Log: event_action-service-tc_parser.ads,v $
13     --    Revision 1.3  2003/10/13 11:03:46  jhl
14     --    Removed with's not needed.
15     --
16     --    Revision 1.2  2003/10/09 11:05:22  jhl
17     --    Added Service 13 And 19
18     --
19     --    Revision 1.1.2.3  2003/10/08 11:54:34  gec
20     --    Responded to Post-Review comments, i.e. comments to review comments.
21     --
22     --    Revision 1.1.2.2  2003/10/06 12:17:15  jhl
23     --    Event Action Post Review first update
24     --
25     --    Revision 1.1.2.1  2003/10/01 11:54:31  jhl
26     --    Initial version of service 13 Event Action, and 19 Large Data Transfer.
27     --
28     --    Revision 2.0  2003/04/04 10:08:58  gec
29     --    Initial release serving as baseline for OBOSS-III project.
30     --
31     --    Revision 1.1.1.1  2003/04/04 07:19:20  gec
32     --    Imported using TkCVS
33     --
34     --
35     --
36     --% Project: OBOSS
37     --
38     --% Copyright (C) 2003 by Terma A/S
39     --  Proprietary and intellectual rights of Terma A/S, Denmark,
40     --  are involved in the subject-matter of this material and
41     --  all manufacturing, reproduction, use, disclosure, and
42     --  sales rights pertaining to such subject-matter are
43     --  expressly reserved. This material is submitted for a
44     --  specific purpose as agreed, and the recipient by
45     --  accepting this material agrees that this material will
46     --  not be used, copied, or reproduced in whole or in part
47     --  nor its contents revealed in any manner or to any person,
48     --  except to meet the purpose for which it was submitted and
49     --  subject to the terms of the agreement.
50     --
51     --% Target Dependencies:
52     --    None
53     --% Compiler Dependencies:
54     --    None
55     
56     --~-----------------------------------------------------------------------------
57     
58     with Source_Data_Stream;
59     with PUS_Parser;
60     with Verification_Types;
61     with Mission_Verification_Values;
62     with Event_Action.Service.TC_Verification;
63     private generic package Event_Action.Service.TC_Parser is
64     
65        --% Library Package:
66        --    Parses and interprets a TC PUS Packet
67        --% Active Tasks:
68        -->   None
69        --% Passive Tasks:
70        -->   None
71     
72        -- Exception indicating that the TC source data is inconsistent and can not
73        --+    be parsed.
74        Source_Data_Is_Inconsistent : exception;
75     
76        -- Exception indicating that a list length value in the TC source data is
77        --+    out of range. The TC source data can not be parsed.
78        List_Length_Value_Out_Of_Range : exception;
79     
80        -- Internal TC Source Data abstract data type and associated interpretation
81        --+    function.
82        type Internal_TC_Source_Data is abstract tagged null record;
83        function Interpret_TC
84              (TC             : in     PUS.PUS_Packet;
85               Parsed_TC_Data : in     Internal_TC_Source_Data)
86              return Boolean is abstract;
87     
88        -- Internal TC Source Data helper types
89     
90        type Event_Action_TC is
91           record
92              Event     : Event_Type;
93              Action_TC : PUS.PUS_Packet;
94           end record;
95     
96        -- Types for Add Event TC
97     
98        subtype Add_Event_Range is Positive range 1 .. Max_Add_Events;
99     
100        type Add_Event_Action_TC is array (Add_Event_Range) of Event_Action_TC;
101     
102        -- Types for Delete Event TC
103     
104        subtype Delete_Event_Range is Positive range 1 .. Max_Delete_Events;
105     
106        type Delete_Event is array (Delete_Event_Range) of Event_Type;
107     
108        -- Types for Enable and Disable Event TC
109     
110        subtype Action_Control_Range is Positive range 1 .. Max_Action_Controls;
111     
112        type Action_Control is array (Action_Control_Range) of Event_Type;
113     
114        -- Internal TC Source Data actual inherited types and associated
115        --+    interpretation functions.
116     
117        -- Add Events
118     
119        type Internal_TC_Source_Data_Add_Events is new Internal_TC_Source_Data
120           with record
121              Count : Add_Event_Range;
122              Add   : Add_Event_Action_TC;
123           end record;
124     
125        function Interpret_TC
126              (TC             : in     PUS.PUS_Packet;
127               Parsed_TC_Data : in     Internal_TC_Source_Data_Add_Events)
128              return Boolean;
129     
130        -- Delete Events
131     
132        type Internal_TC_Source_Data_Delete_Events is new Internal_TC_Source_Data
133           with record
134              Count  : Delete_Event_Range;
135              Delete : Delete_Event;
136           end record;
137     
138        function Interpret_TC
139              (TC             : in     PUS.PUS_Packet;
140               Parsed_TC_Data : in     Internal_TC_Source_Data_Delete_Events)
141              return Boolean;
142     
143        -- Clear Detection List
144     
145        type Internal_TC_Source_Data_Clear_Detection_List is new
146              Internal_TC_Source_Data
147           with null record;
148     
149        function Interpret_TC
150              (TC             : in     PUS.PUS_Packet;
151               Parsed_TC_Data : in     Internal_TC_Source_Data_Clear_Detection_List)
152              return Boolean;
153     
154        -- Enable Actions
155     
156        type Internal_TC_Source_Data_Enable_Actions is new Internal_TC_Source_Data
157           with record
158              Count  : Action_Control_Range;
159              Enable : Action_Control;
160           end record;
161     
162        function Interpret_TC
163              (TC             : in     PUS.PUS_Packet;
164               Parsed_TC_Data : in     Internal_TC_Source_Data_Enable_Actions)
165              return Boolean;
166     
167        -- Disable Actions
168     
169        type Internal_TC_Source_Data_Disable_Actions is new Internal_TC_Source_Data
170           with record
171              Count   : Action_Control_Range;
172              Disable : Action_Control;
173           end record;
174     
175        function Interpret_TC
176              (TC             : in     PUS.PUS_Packet;
177               Parsed_TC_Data : in     Internal_TC_Source_Data_Disable_Actions)
178              return Boolean;
179     
180        -- Report Detection List
181     
182        type Internal_TC_Source_Data_Report_Detection_List is new
183              Internal_TC_Source_Data
184           with null record;
185     
186        function Interpret_TC
187              (TC             : in     PUS.PUS_Packet;
188               Parsed_TC_Data
189                              : in     Internal_TC_Source_Data_Report_Detection_List)
190              return Boolean;
191     
192        --% Subprogram:
193        --    Transforms telecommand source data contained in in Src_Data read
194        --+    stream into an internal representation of an event action command
195        --+    (service type 19) of subtype specified by Service_Subtype
196        --% Parameter Constraints:
197        -->   None
198        --% Exceptions Raised:
199        -->   Source_Data_Is_Inconsistent  - Indicates that contents of Src_Data
200        --+    cannot be interpreted as a service request of the subtype given by
201        --+    Service_Subtype
202     
203        function Parse_TC_Source_Data
204              (Service_Subtype : in     PUS_Data_Types.Service_Subtype;
205               Src_Data        : in     Source_Data_Stream.Read_Stream)
206              return Internal_TC_Source_Data'Class;
207     
208        --% Library Package:
209        --    Parser called by function Parse_TC to parse a TC PUS Packet
210     
211        package The_Parser is new PUS_Parser
212                 (Service_Type =>
213                     Event_Action_Service,
214                  Internal_PUS_Source_Data =>
215                     Internal_TC_Source_Data,
216                  Parse_Source_Data =>
217                     Parse_TC_Source_Data,
218                  Unsupported_PUS_Packet_Status_Type =>
219                     Verification_Types.Verification_Status,
220                  Unsupported_PUS_Packet_Status =>
221                     Mission_Verification_Values.Illegal_Command);
222     
223        subtype Internal_TC_Representation is
224              The_Parser.Internal_PUS_Representation;
225     
226        subtype Internal_TC_Representation_Failed is
227              The_Parser.Internal_PUS_Representation_Failed;
228     
229        subtype Internal_TC_Representation_Passed is
230              The_Parser.Internal_PUS_Representation_Passed;
231     
232        --% Subprogram:
233        --    Main parsing function.
234        --% Parameter Constraints:
235        -->   PUS Packet must be a TeleCommand
236        --% Exceptions Raised:
237        -->   None
238     
239        function Parse_TC
240              (TC : in     PUS.PUS_Packet)
241              return Internal_TC_Representation'Class;
242     
243        --% Library package
244        --    Pacakge used for verifying TC execution.
245     
246        package The_TC_Verification is new Event_Action.Service.TC_Verification;
247     
248     end Event_Action.service.tc_Parser;
249     
250     --~-----------------------------------------------------------------------------
251     
252     
253