// *******************************************************************************************
// **                                                                                       **
// **      IGeneralIO.cs
// **      4/14/2023
// **                                                                                       **
// **      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 2023.
// **                                                                                       **
// **      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.                                                                       **
// **                                                                                       **
// **      CAPITAL EQUIPMENT/SOFTWARE: THIS TECHNICAL DATA WAS DEVELOPED OR ACQUIRED        **
// **      EXCLUSIVELY AT CONTRACTOR EXPENSE AND IS INTENDED FOR USE ON MULTIPLE            **
// **      PROJECTS/PROGRAMS.                                                               **
// **                                                                                       **
// *******************************************************************************************

using System;
using System.Collections.Generic;
using Raytheon.Communication;
using Raytheon.Instruments;

namespace Raytheon.Instruments
{
   /// <summary>
   /// IGeneralIO - base interface for an IO type instrument
   /// </summary>
   [UmsContract]
   public interface IGeneralIO : IInstrument
   {
      /// <summary>
      /// Gets the bit's current state
      /// </summary>
      /// <param name="signalName"></param>
      /// <returns>
      /// the bit's current <see cref="BitState" />
      /// </returns>
      [UmsCommand( "IGeneralIO.GetBitState" )]
      IODatatypes.BitState GetBitState(string signalName);

      /// <summary>
      /// Get signal names 
      /// </summary>
      /// <param></param>
      /// <returns>
      /// </returns>
      [UmsCommand("IGeneralIO.GetSignalNames")]
      List<string> GetSignalNames();

      /// <summary>
      /// Gets the number of input bits.
      /// </summary>
      /// <value>
      /// The number input bits.
      /// </value>
      UInt32 NumberOfInputBits
      {
         [UmsCommand( "IGeneralIO.GetNumberOfInputBits" )]
         get;
      }

      /// <summary>
      /// Gets the number of output bits.
      /// </summary>
      /// <value>
      /// The number output bits.
      /// </value>
      UInt32 NumberOfOutputBits
      {
         [UmsCommand( "IGeneralIO.GetNumberOfOutputBits" )]
         get;
      }

      /// <summary>
      /// Sets the bit to high or low <see cref="BitState"/>.
      /// </summary>
      /// <remarks>
      /// Only allowed on output bits
      /// </remarks>
      /// <param name="signalName"></param>
      /// <param name="state">The state <see cref="BitState"/>.</param>
      [UmsCommand( "IGeneralIO.SetBit" )]
      void SetBit(string signalName, IODatatypes.BitState state);

      /// <summary>
      /// Command an output bit to logic Z state
      /// </summary>
      /// <param name="signalName">The output bit number</param>
      [UmsCommand( "IGeneralIO.SetTristate" )]
      void SetTristate(string signalName);

      //*** possible enhancements
      //bool ConfigureBitType(UInt32 bit, GeneralIo.BitType type);
      //bool[] GetBits();
      //GeneralIo.BitType GetBitType(UInt32 bit);
      //void SetBits(bool[] all);
      //bool MaskBits(specialobj[] obj); //maybe an object with bit# and value?
   }
}
