123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- #region --------------- Copyright Dresser Wayne Pignone -------------
- /*
- * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/Com/IForecourtControl.cs $
- *
- * 6 07-11-14 20:20 roger.månsson
- * Added SetupLogging method.
- *
- * 5 07-03-09 15:32 roger.månsson
- * Added price poles.
- *
- * 4 07-02-16 9:59 roger.månsson
- * FxCop changes
- *
- * 3 07-01-05 15:14 roger.månsson
- * Added TankGroups property
- *
- * 2 07-01-05 9:01 roger.månsson
- * Documentation changes
- */
- #endregion
- //using Wayne.Lib;
- using System.Runtime.InteropServices;
- namespace Wayne.ForecourtControl.Com
- {
- /// <summary>
- /// The ForecourtControl object is the main root object to the Forecourtcontrol object hiearchy. It owns a list of pumps, and provides
- /// functionality to control the site.
- /// </summary>
- [ComVisible(true)]
- //[InterfaceType( ComInterfaceType.InterfaceIsDual)]
- public interface IForecourtControl
- {
- #region Properties
- /// <summary>
- /// ClientId in the communicationClientName in the communication to the Forecourt Controller.
- /// </summary>
- int ClientId { get;}
- /// <summary>
- /// ClientName in the communication to the Forecourt Controller.
- /// </summary>
- string ClientName { get;}
- /// <summary>
- /// Tells whether the site is open or closed.
- /// </summary>
- bool SiteOpened { get;}
- /// <summary>
- /// This property tells the operation mode of the site according to the pre-configured pump operation. Typically the configuration has been pre-defined with
- /// day, Night and rush hour operation modes, but this interface does not restrict which site mode that is used as day, night and rush-hour.
- /// </summary>
- int SiteMode { get;}
- /// <summary>
- /// The collection of pump objects.
- /// </summary>
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
- IPump[] Pumps { get;}
- /// <summary>
- /// A list of the current fuel prices. The fuel prices can be modified when they are reserved through
- /// a call to ReserveFuelPricesAsync. The changes are committed through calling the ActivateFuelPricesAsync.
- /// </summary>
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
- IFuelPrice[] FuelPrices { get;}
- /// <summary>
- /// A list of the tank groups configured on the station.
- /// </summary>
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
- ITankGroup[] TankGroups { get;}
- /// <summary>
- /// A list of the price poles configured at the station.
- /// </summary>
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
- IPricePole[] PricePoles { get;}
- #endregion
- #region Methods
- #region SetSiteOpened
- /// <summary>
- /// Opens or closes the station.
- /// </summary>
- /// <param name="opened">True if the station should be opened, and false if it should be closed.</param>
- /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
- void SetSiteOpenedAsync(bool opened, object userToken);
- #endregion
- #region SetSiteMode
- /// <summary>
- /// Sets the site mode. The pumps can be set in different modes for different site modes. This
- /// enables the option to have different day/night/rush modes of the station.
- /// </summary>
- /// <param name="siteMode">The new site mode.</param>
- /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
- void SetSiteModeAsync(int siteMode, object userToken);
- #endregion
- #region ReserveFuelPrices
- /// <summary>
- /// Reserves the fuel prices so they can be changed by this client.
- /// </summary>
- /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
- void ReserveFuelPricesAsync(object userToken);
- #endregion
- #region UnreserveFuelPrices
- /// <summary>
- /// Releases the fuel price reservation. If the fuel prices were no reserved, the function will still return success=true.
- /// Changes made to the fuel prices will be undone.
- /// </summary>
- /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
- void UnreserveFuelPricesAsync(object userToken);
- #endregion
- #region ActivateFuelPrices
- /// <summary>
- /// Activates the fuel prices, and triggers a new Fuel period when the prices has been activated.
- /// Note that it can take several minutes before all price signs and pumps have been updated.
- /// The FuelPrice reservation is released, so UnreserveFuelPricesAsync must not be called afterwards.
- /// </summary>
- /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
- void ActivateFuelPricesAsync(object userToken);
- #endregion
- #region SetupLoggin
- /// <summary>
- /// Sets up the logging for ALL Wayne libraries loaded in the process.
- /// </summary>
- /// <param name="logConfigFileName">File name and path for the log configuration file.</param>
- void SetupLogging(string logConfigFileName);
- #endregion
- #endregion
- #region IConnectable - substitute
- /// <summary>
- /// Current connection state of the forecourt control.
- /// </summary>
- DeviceConnectionState ConnectionState { get; }
- /// <summary>
- /// Tries to connect the forecourt control using the specified connection string.
- /// </summary>
- /// <param name="connectionString"></param>
- void Connect(string connectionString);
- /// <summary>
- /// Disconnects the forecourt control.
- /// </summary>
- void Disconnect();
- #endregion
- }
- }
|