File: /home/oboss/Users/gec/sources/Demonstrator/Power_Conditioning_System/power_conditioning_system-interfaces-pdu_simulator.ads

1     --~-----------------------------------------------------------------------------
2     
3     with Parameter_Structure_Descriptions.Power_Conditioning_System;
4     with Power_Conditioning_System.Interfaces;
5     package Power_Conditioning_System.Interfaces.PDU_Simulator is
6     
7        --% Library Package:
8        --    Low-fidelity simulation of a power distribution unit.
9        --    Simulates 12 power outputs.
10        --    Supports acquisition of digital status telemetry for the individual
11        --+    status for power outputs.
12        --% Active Tasks:
13        -->   None
14        --% Passive Tasks:
15        -->   Power_Distribution_Unit - Critical reqion protecting PDU state.
16     
17        -- Indicates that a command was requested resulting in a state transition
18        --+    not covered by the current low-fidelity simulation.
19        Unsupported_Command_Requested : exception;
20     
21        -- Swicthes are identified based on their associated parameter ID
22        type Switch_ID is new
23              Parameter_Structure_Descriptions.Power_Conditioning_System.
24                 Power_Switch_Parameter_IDs;
25        Switch_1  : constant Switch_ID := 100;
26        Switch_2  : constant Switch_ID := 101;
27        Switch_3  : constant Switch_ID := 102;
28        Switch_4  : constant Switch_ID := 103;
29        Switch_5  : constant Switch_ID := 104;
30        Switch_6  : constant Switch_ID := 105;
31        Switch_7  : constant Switch_ID := 106;
32        Switch_8  : constant Switch_ID := 107;
33        Switch_9  : constant Switch_ID := 108;
34        Switch_10 : constant Switch_ID := 109;
35        Switch_11 : constant Switch_ID := 110;
36        Switch_12 : constant Switch_ID := 111;
37     
38        -- Mode (ON/OFF)
39        type Switch_State is
40              (Off,
41               On);
42     
43        subtype Output_Voltage_Reading is
44              Power_Conditioning_System.Interfaces.Analogue_Status_Data;
45        subtype Output_Current_Reading is
46              Power_Conditioning_System.Interfaces.Analogue_Status_Data;
47     
48        --% Subprogram:
49        --    Execute Command resulting in a change of the simulated PDU state.
50        --% Parameter Constraints:
51        -->   parameter_name  - Constraints
52        --% Exceptions Raised:
53        -->   Unsupported_Command_Requested  - Conditions
54     
55        procedure Assign_Switch_State
56              (Switch : in     Switch_ID;
57               State  : in     Switch_State);
58     
59        --% Subprogram:
60        --    Acquire current switch state for given telemetry channel.
61        --% Parameter Constraints:
62        -->   None
63        --% Exceptions Raised:
64        --    None
65     
66        function Read_Switch_State
67              (Switch : in     Switch_ID)
68              return Switch_State;
69     
70        --% Subprogram:
71        --    Acquire current voltage for given telemetry channel.
72        --% Parameter Constraints:
73        -->   None
74        --% Exceptions Raised:
75        --    None
76     
77        function Read_Output_Voltage
78              (Switch : in     Switch_ID)
79              return Output_Voltage_Reading;
80     
81        --% Subprogram:
82        --    Acquire current current for given telemetry channel.
83        --% Parameter Constraints:
84        -->   None
85        --% Exceptions Raised:
86        --    None
87     
88        function Read_Output_Current
89              (Switch : in     Switch_ID)
90              return Output_Current_Reading;
91     
92     end Power_Conditioning_System.interfaces.pdu_Simulator;
93     
94     --~-----------------------------------------------------------------------------
95