//###########################################################################//
// RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
// PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS
// AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO
// UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO
// RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS
// CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS
// OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON
// COMPANY.
//
// THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. GOVERNMENT
//
// UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.
//
// WARNING: THIS DOCUMENT CONTAINS TECHNICAL DATA AND / OR TECHNOLOGY WHOSE
// EXPORT OR DISCLOSURE TO NON-U.S. PERSONS, WHEREVER LOCATED, IS RESTRICTED
// BY THE INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) (22 C.F.R. SECTION
// 120-130) OR THE EXPORT ADMINISTRATION REGULATIONS (EAR) (15 C.F.R. SECTION
// 730-774). THIS DOCUMENT CANNOT BE EXPORTED (E.G., PROVIDED TO A SUPPLIER
// OUTSIDE OF THE UNITED STATES) OR DISCLOSED TO A NON-U.S. PERSON, WHEREVER
// LOCATED, UNTIL A FINAL JURISDICTION AND CLASSIFICATION DETERMINATION HAS
// BEEN COMPLETED AND APPROVED BY RAYTHEON, AND ANY REQUIRED U.S. GOVERNMENT
// APPROVALS HAVE BEEN OBTAINED. VIOLATIONS ARE SUBJECT TO SEVERE CRIMINAL
// PENALTIES.
//
// DOD 5220.22-M, INDUSTRIAL SECURITY MANUAL, CHAPTER 5, SECTION 1 THROUGH 9 :
// FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN OR DOD 5200.1-R,
// INFORMATION SECURITY PROGRAM, CHAPTER 6. FOR UNCLASSIFIED, LIMITED DOCUMENTS
// DESTROY BY ANY  METHOD THAT WILL PREVENT DISCLOSURE OF CONTENTS OR
// RECONSTRUCTION OF THE DOCUMENT.
//############################################################################//

using Raytheon.Communication;
using Raytheon.Units;

namespace Raytheon.Instruments
{
   /// <summary>
   /// An interface for all Eload classes to implement.
   /// </summary>
   [UmsContract]
   public interface IEload : IInstrument
   {
      /// <summary>
      /// Turn off the Eload module.
      /// </summary>
      [UmsCommand( "IEload.Disable" )]
      void Disable( );

      /// <summary>
      /// Turn on the Eload module.
      /// </summary>
      [UmsCommand( "IEload.Enable" )]
      void Enable( );

      /// <summary>
      /// Queries IO with command
      /// </summary>
      /// <param name="command"></param>
      /// <returns></returns>
      [UmsCommand( "IEload.IOQuery" )]
      string IOQuery( string command );

      /// <summary>
      /// Writes IO
      /// </summary>
      /// <param name="command"></param>
      [UmsCommand( "IEload.IOWrite" )]
      void IOWrite( string command );
      
      /// <summary>
      /// Query if the Eload module input is on.
      /// </summary>
      /// <returns>Status of Eload. True = On, False = Off.</returns>
      [UmsCommand( "IEload.IsInputOn" )]
      bool IsInputOn( );

      /// <summary>
      /// Reads the current of the Eload module.
      /// </summary>
      /// <returns>The current (Amps)</returns>
      [UmsCommand( "IEload.ReadCurrent" )]
      Current ReadCurrent( );

      /// <summary>
      /// Reads the mode of the Eload module.
      /// </summary>
      /// <returns>The mode.</returns>
      [UmsCommand( "IEload.ReadMode" )]
      EloadModuleMode ReadMode( );

      /// <summary>
      /// Reads the overcurrent setting from an Eload module.
      /// </summary>
      /// <returns>The current (Amps).</returns>
      [UmsCommand( "IEload.ReadOverCurrentProtection" )]
      Current ReadOverCurrentProtection( );

      /// <summary>
      /// Reads the overvoltage setting from an Eload module.
      /// </summary>
      /// <returns>The voltage (Volts).</returns>
      [UmsCommand( "IEload.ReadOverVoltageProtection" )]
      Voltage ReadOverVoltageProtection( );

      /// <summary>
      /// Query the Eload module for the resistance.
      /// </summary>
      /// <returns>The resistance (Ohms).</returns>
      [UmsCommand( "IEload.ReadResistance" )]
      Resistance ReadResistance( );

      /// <summary>
      /// Queries the Eload module for the setpoint value. Depends on operation mode.
      /// </summary>
      /// <returns>The setpoint value.</returns>
      [UmsCommand( "IEload.ReadSetpoint" )]
      double ReadSetpoint( );

      /// <summary>
      /// Query the Eload module for the voltage.
      /// </summary>
      /// <returns>The voltage (Volts).</returns>
      [UmsCommand( "IEload.ReadVoltage" )]
      Voltage ReadVoltage( );

      /// <summary>
      /// Reads the protection status from an Eload module.
      /// </summary>
      /// <returns>The protection status register</returns>
      [UmsCommand( "IEload.ReadProtectionStatus" )]
      ushort ReadProtectionStatus( );

      /// <summary>
      /// Resets the Eload setpoint and mode to config file values
      /// </summary>
      [UmsCommand( "IEload.SetInitialSetting" )]
      void SetInitialSetting( );

      /// <summary>
      /// Change the mode for the Eload module.
      /// </summary>
      /// <param name="mode">The desired Eload module mode.</param>
      [UmsCommand( "IEload.SetMode" )]
      void SetMode( EloadModuleMode mode );

      /// <summary>
      /// Change the setpoint and operation mode of the Eload module.
      /// </summary>
      /// <param name="newSetpoint">The new setpoint.</param>
      /// <param name="mode">The new mode.</param>
      [UmsCommand( "IELoad.SetSetpoint" )]
      void SetSetpoint( double newSetpoint, EloadModuleMode mode );
   }
}
