//////////////////////////////////////////////////////////
//  ThalesPowerSystemIF.idl
//  Gil Jones
//  03/07/02
//
//  This includes Thales power board specific definitions.
////////////////////////////////////////////////////////////

#include "PowerSystemIF.idl"


interface ThalesPowerSystemIF : PowerSystemIF {
    
    /*******from WaterAlarmIF**********/
    
    //enum Events {
    //  Alarm1On,
    //  Alarm1Off,
    //  Alarm2On,
    //  Alarm2Off,
    //  Alarm3On,
    //  Alarm3Off,
    //  Alarm4On,
    //  Alarm4Off
    //};
    
     struct AlarmState {
	  boolean alarm1;
	  boolean alarm2;
	  boolean alarm3;
	  boolean alarm4;
     };
    
    ////////////////////////////////////////////////////////////
    // Gets the status of all 4 water alarms
    DeviceIF::Status getWaterAlarmStatus( out AlarmState state );
    
    ////////////////////////////////////////////////////////////
    // Gets the status of one of the alarms
    DeviceIF::Status getWaterAlarmStatus( in long whichAlarm, out boolean state );
    
    
    /**********from DropWeightIF************/
    
    // enum Event {
    //  Online,
    //  Offline,
    //  Installed,
    //  Released
    // };
    
    // Emergency needs to be assigned an appropriate value.
     enum Weight {
	 Unassigned = 0,
	 Ascend    = 10,
	 AbortAscend = 12,
	 Descend   = 13,
	 AbortDescend = 15,
	 Emergency
     };

    //redundent assignments for output
    enum WeightOutputIndex {
	AscendIndex = 0,
	DescendIndex,
	AbortAscendIndex,
	AbortDescendIndex,
	EmergencyIndex 
    };

     struct WeightStruct {
	  Name name;
	  boolean isFiring;
	  boolean hasFired;
     };
    
    //see DropWeightIF.idl for full comments

    /////////////////////////////////////////////////////////
    // Returns the number of dropWeights registered.  Note that the weights
    // themselves are number 'C-style', starting at 0 and going to (count-1)
    short dropWeightCount();
    
    /////////////////////////////////////////////////////////
    // For a given index number (0 to (count-1)), return the name.
    // If the weight is undefined, the name will be returned unchanged.
    // Returns 0 on success, -1 on failure.
    short findByIndex( in short index, out Name name );
    
    /////////////////////////////////////////////////////////
    //  For a given name, returns the matching index number.
    // Note this search is case-insensitive.
    // index is set to -1 if the name cannot be found.
    // Returns 0 on success, 1 on failure.
    short findByName( in Name name, out short index );
    
    /////////////////////////////////////////////////////////
    // Get the whole thing
    short getInfo( in short index, out WeightStruct info );
    short getInfo( in Name name, out WeightStruct info );
    
    /////////////////////////////////////////////////////////
    // Release drop-weight
    void fire(in short index);
    void fire(in Name name );
    
    /////////////////////////////////////////////////////////
    // Stop, as necessary
    void unfire( in short index );
    void unfire( in Name name );

    /////////////////////////////////////////////////////////
    // Weight released?
    boolean isFiring(in short index);
    boolean isFiring(in Name name);
        
    boolean hasFired( in short index );
    boolean hasFired( in Name name );

    
};
