IForecourtControl.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/Com/IForecourtControl.cs $
  4. *
  5. * 6 07-11-14 20:20 roger.månsson
  6. * Added SetupLogging method.
  7. *
  8. * 5 07-03-09 15:32 roger.månsson
  9. * Added price poles.
  10. *
  11. * 4 07-02-16 9:59 roger.månsson
  12. * FxCop changes
  13. *
  14. * 3 07-01-05 15:14 roger.månsson
  15. * Added TankGroups property
  16. *
  17. * 2 07-01-05 9:01 roger.månsson
  18. * Documentation changes
  19. */
  20. #endregion
  21. //using Wayne.Lib;
  22. using System.Runtime.InteropServices;
  23. namespace Wayne.ForecourtControl.Com
  24. {
  25. /// <summary>
  26. /// The ForecourtControl object is the main root object to the Forecourtcontrol object hiearchy. It owns a list of pumps, and provides
  27. /// functionality to control the site.
  28. /// </summary>
  29. [ComVisible(true)]
  30. //[InterfaceType( ComInterfaceType.InterfaceIsDual)]
  31. public interface IForecourtControl
  32. {
  33. #region Properties
  34. /// <summary>
  35. /// ClientId in the communicationClientName in the communication to the Forecourt Controller.
  36. /// </summary>
  37. int ClientId { get;}
  38. /// <summary>
  39. /// ClientName in the communication to the Forecourt Controller.
  40. /// </summary>
  41. string ClientName { get;}
  42. /// <summary>
  43. /// Tells whether the site is open or closed.
  44. /// </summary>
  45. bool SiteOpened { get;}
  46. /// <summary>
  47. /// This property tells the operation mode of the site according to the pre-configured pump operation. Typically the configuration has been pre-defined with
  48. /// 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.
  49. /// </summary>
  50. int SiteMode { get;}
  51. /// <summary>
  52. /// The collection of pump objects.
  53. /// </summary>
  54. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
  55. IPump[] Pumps { get;}
  56. /// <summary>
  57. /// A list of the current fuel prices. The fuel prices can be modified when they are reserved through
  58. /// a call to ReserveFuelPricesAsync. The changes are committed through calling the ActivateFuelPricesAsync.
  59. /// </summary>
  60. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
  61. IFuelPrice[] FuelPrices { get;}
  62. /// <summary>
  63. /// A list of the tank groups configured on the station.
  64. /// </summary>
  65. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
  66. ITankGroup[] TankGroups { get;}
  67. /// <summary>
  68. /// A list of the price poles configured at the station.
  69. /// </summary>
  70. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
  71. IPricePole[] PricePoles { get;}
  72. #endregion
  73. #region Methods
  74. #region SetSiteOpened
  75. /// <summary>
  76. /// Opens or closes the station.
  77. /// </summary>
  78. /// <param name="opened">True if the station should be opened, and false if it should be closed.</param>
  79. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  80. void SetSiteOpenedAsync(bool opened, object userToken);
  81. #endregion
  82. #region SetSiteMode
  83. /// <summary>
  84. /// Sets the site mode. The pumps can be set in different modes for different site modes. This
  85. /// enables the option to have different day/night/rush modes of the station.
  86. /// </summary>
  87. /// <param name="siteMode">The new site mode.</param>
  88. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  89. void SetSiteModeAsync(int siteMode, object userToken);
  90. #endregion
  91. #region ReserveFuelPrices
  92. /// <summary>
  93. /// Reserves the fuel prices so they can be changed by this client.
  94. /// </summary>
  95. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  96. void ReserveFuelPricesAsync(object userToken);
  97. #endregion
  98. #region UnreserveFuelPrices
  99. /// <summary>
  100. /// Releases the fuel price reservation. If the fuel prices were no reserved, the function will still return success=true.
  101. /// Changes made to the fuel prices will be undone.
  102. /// </summary>
  103. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  104. void UnreserveFuelPricesAsync(object userToken);
  105. #endregion
  106. #region ActivateFuelPrices
  107. /// <summary>
  108. /// Activates the fuel prices, and triggers a new Fuel period when the prices has been activated.
  109. /// Note that it can take several minutes before all price signs and pumps have been updated.
  110. /// The FuelPrice reservation is released, so UnreserveFuelPricesAsync must not be called afterwards.
  111. /// </summary>
  112. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  113. void ActivateFuelPricesAsync(object userToken);
  114. #endregion
  115. #region SetupLoggin
  116. /// <summary>
  117. /// Sets up the logging for ALL Wayne libraries loaded in the process.
  118. /// </summary>
  119. /// <param name="logConfigFileName">File name and path for the log configuration file.</param>
  120. void SetupLogging(string logConfigFileName);
  121. #endregion
  122. #endregion
  123. #region IConnectable - substitute
  124. /// <summary>
  125. /// Current connection state of the forecourt control.
  126. /// </summary>
  127. DeviceConnectionState ConnectionState { get; }
  128. /// <summary>
  129. /// Tries to connect the forecourt control using the specified connection string.
  130. /// </summary>
  131. /// <param name="connectionString"></param>
  132. void Connect(string connectionString);
  133. /// <summary>
  134. /// Disconnects the forecourt control.
  135. /// </summary>
  136. void Disconnect();
  137. #endregion
  138. }
  139. }