IForecourtControl.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/IForecourtControl.cs $
  4. *
  5. * 5 07-10-18 17:12 roger.månsson
  6. * Added IForecourtControl.OnFuelPriceChange event.
  7. *
  8. * 4 07-03-08 13:08 roger.månsson
  9. * Added PricePoles
  10. *
  11. * 3 07-01-12 15:25 roger.månsson
  12. * Made IDisposable
  13. *
  14. * 2 07-01-05 15:10 roger.månsson
  15. * Added TankGroups property
  16. */
  17. #endregion
  18. using System;
  19. namespace Wayne.ForecourtControl
  20. {
  21. /// <summary>
  22. /// The ForecourtControl object is the main root object to the Forecourtcontrol object hiearchy. It owns a list of pumps, and provides
  23. /// functionality to control the site.
  24. /// </summary>
  25. public interface IForecourtControl : Wayne.Lib.IConnectable,
  26. Wayne.Lib.IIdentifiableEntity,
  27. IDisposable
  28. {
  29. #region Properties
  30. /// <summary>
  31. /// ClientId in the communicationClientName in the communication to the Forecourt Controller.
  32. /// </summary>
  33. int ClientId { get;}
  34. /// <summary>
  35. /// ClientName in the communication to the Forecourt Controller.
  36. /// </summary>
  37. string ClientName { get;}
  38. /// <summary>
  39. /// Tells whether the site is open or closed.
  40. /// </summary>
  41. bool SiteOpened { get;}
  42. /// <summary>
  43. /// This property tells the operation mode of the site according to the pre-configured pump operation. Typically the configuration has been pre-defined with
  44. /// 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.
  45. /// </summary>
  46. int SiteMode { get;}
  47. /// <summary>
  48. /// The collection of pump objects.
  49. /// </summary>
  50. System.Collections.ObjectModel.ReadOnlyCollection<Wayne.ForecourtControl.IPump> Pumps {get;}
  51. /// <summary>
  52. /// The collection of Fuel prices.
  53. /// </summary>
  54. System.Collections.ObjectModel.ReadOnlyCollection<Wayne.ForecourtControl.IFuelPrice> FuelPrices { get;}
  55. /// <summary>
  56. /// The collection of Tank groups.
  57. /// </summary>
  58. System.Collections.ObjectModel.ReadOnlyCollection<Wayne.ForecourtControl.ITankGroup> TankGroups { get;}
  59. /// <summary>
  60. /// The collection of Price poles.
  61. /// </summary>
  62. System.Collections.ObjectModel.ReadOnlyCollection<Wayne.ForecourtControl.IPricePole> PricePoles { get;}
  63. #endregion
  64. #region Methods
  65. /// <summary>
  66. /// Opens or closes the station.
  67. /// </summary>
  68. /// <param name="opened">True if the station should be opened, and false if it should be closed.</param>
  69. /// <param name="requestCompleted">Delegate that will be called on completion.</param>
  70. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  71. void SetSiteOpenedAsync(bool opened, EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  72. /// <summary>
  73. /// Sets the site mode. The pumps can be set in different modes for different site modes. This
  74. /// enables the option to have different day/night/rush modes of the station.
  75. /// </summary>
  76. /// <param name="siteMode">The new site mode.</param>
  77. /// <param name="requestCompleted">Delegate that will becalled on completion.</param>
  78. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  79. void SetSiteModeAsync(int siteMode, EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted,object userToken);
  80. /// <summary>
  81. /// Reserves the fuel prices so they can be changed by this client.
  82. /// </summary>
  83. /// <param name="requestCompleted">Callback delegate that will becalled on completion</param>
  84. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  85. void ReserveFuelPricesAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  86. /// <summary>
  87. /// Releases the fuel price reservation. If the fuel prices were no reserved, the function will still return success=true.
  88. /// Changes made to the fuel prices will be undone.
  89. /// </summary>
  90. /// <param name="requestCompleted">Callback delegate that will becalled on completion</param>
  91. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  92. void UnreserveFuelPricesAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  93. /// <summary>
  94. /// Activates the fuel prices, and triggers a new Fuel period when the prices has been activated.
  95. /// Note that it can take several minutes before all price signs and pumps have been updated.
  96. /// The FuelPrice reservation is released, so UnreserveFuelPricesAsync must not be called afterwards.
  97. /// </summary>
  98. /// <param name="requestCompleted">Callback delegate that will becalled on completion</param>
  99. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  100. void ActivateFuelPricesAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  101. /// <summary>
  102. /// Reserves the pump cluster for the specified terminal number. The terminal device id is 1-based.
  103. /// </summary>
  104. /// <param name="terminalDeviceId"></param>
  105. /// <param name="requestCompleted"></param>
  106. /// <param name="userToken"></param>
  107. void ReservePumpClusterAsync(int terminalDeviceId, EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  108. /// <summary>
  109. /// Unreserves the pump cluster for the specified terminal number. The terminal device id is 1-based.
  110. /// </summary>
  111. /// <param name="terminalDeviceId"></param>
  112. /// <param name="requestCompleted"></param>
  113. /// <param name="userToken"></param>
  114. void UnreservePumpClusterAsync(int terminalDeviceId, EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  115. #endregion
  116. #region Events
  117. /// <summary>
  118. /// Event Fired when the site mode, i.e. the Site mode or the Site open/close mode has changed.
  119. /// </summary>
  120. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "OnSite")]
  121. event EventHandler<SiteModeChangeEventArgs> OnSiteModeChange;
  122. /*
  123. /// <summary>
  124. /// Configuration changed.
  125. /// </summary>
  126. event EventHandler OnConfigurationChange;
  127. */
  128. /// <summary>
  129. /// Event that is raised when an alarm is fired from forecourt controller.
  130. /// </summary>
  131. event EventHandler<AlarmEventArgs> OnAlarm;
  132. /// <summary>
  133. /// Event fired when the fuel prices has been changed on the station and a new fuel price shift has been
  134. /// created.
  135. /// </summary>
  136. event EventHandler<FuelPriceChangeEventArgs> OnFuelPriceChange;
  137. #endregion
  138. }
  139. }