IPumpEvents.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/Com/IPumpEvents.cs $
  4. *
  5. * 9 07-02-27 12:35 roger.månsson
  6. * Set decimal MarshalAs Currency to be better compliant with COM.
  7. *
  8. * 8 07-02-26 14:06 roger.månsson
  9. * Added marshalAs Currency on decimal parameters.
  10. *
  11. * 7 07-02-16 9:59 roger.månsson
  12. * FxCop changes
  13. *
  14. * 6 07-02-02 17:17 roger.månsson
  15. * Renamed OnReadPumpAccumulatorsCompleted->OnReadPumpAccumulatorCompleted
  16. *
  17. * 5 07-01-09 9:28 roger.månsson
  18. * Documentation fixes
  19. *
  20. * 4 07-01-08 16:11 roger.månsson
  21. * Added support for the SignalEvent/OnEventOccured on the pump
  22. * interfaces.
  23. *
  24. * 3 07-01-05 15:15 roger.månsson
  25. * Changed sender type to IPump
  26. *
  27. * 2 07-01-05 9:01 roger.månsson
  28. * Documentation changes
  29. */
  30. #endregion
  31. using System.Runtime.InteropServices;
  32. using System.Diagnostics.CodeAnalysis;
  33. namespace Wayne.ForecourtControl.Com
  34. {
  35. /// <summary>
  36. /// Event interface for an IPump object. Contains the events that can be fired from a pump object.
  37. /// </summary>
  38. [ComVisible(true)]
  39. [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
  40. public interface IPumpEvents
  41. {
  42. #region Response events
  43. /// <summary>
  44. /// Event invoked when a Reserve request has completed.
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="success">True if the request succeeded.</param>
  48. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  49. void OnReserveCompleted(IPump sender, bool success, object userToken);
  50. /// <summary>
  51. /// Event invoked when a Suspend request has completed.
  52. /// </summary>
  53. /// <param name="sender"></param>
  54. /// <param name="success">True if the request succeeded.</param>
  55. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  56. void OnSuspendCompleted(IPump sender, bool success, object userToken);
  57. /// <summary>
  58. /// Event invoked when a Resume request has completed.
  59. /// </summary>
  60. /// <param name="sender"></param>
  61. /// <param name="success">True if the request succeeded.</param>
  62. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  63. void OnResumeCompleted(IPump sender, bool success, object userToken);
  64. /// <summary>
  65. /// Event invoked when a Stop request has completed.
  66. /// </summary>
  67. /// <param name="sender"></param>
  68. /// <param name="success">True if the request succeeded.</param>
  69. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  70. void OnStopCompleted(IPump sender, bool success, object userToken);
  71. /// <summary>
  72. /// Event invoked when a SetBlocked request has completed.
  73. /// </summary>
  74. /// <param name="sender"></param>
  75. /// <param name="success">True if the request succeeded.</param>
  76. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  77. void OnSetBlockedCompleted(IPump sender, bool success, object userToken);
  78. /// <summary>
  79. /// Event invoked when a SetPriceGroup request has completed.
  80. /// </summary>
  81. /// <param name="sender"></param>
  82. /// <param name="success">True if the request succeeded.</param>
  83. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  84. void OnSetPriceGroupCompleted(IPump sender, bool success, object userToken);
  85. /// <summary>
  86. /// Event invoked when an Unreserve request has completed.
  87. /// </summary>
  88. /// <param name="sender"></param>
  89. /// <param name="success">True if the request succeeded.</param>
  90. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  91. void OnUnreserveCompleted(IPump sender, bool success, object userToken);
  92. /// <summary>
  93. /// Event invoked when an Authorize request has completed.
  94. /// </summary>
  95. /// <param name="sender"></param>
  96. /// <param name="success">True if the request succeeded.</param>
  97. /// <param name="authorizationId">Unique Id that identifies the authorization. Used to match an authorization to its fuelling later.</param>
  98. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  99. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Interoperability", "CA1406:AvoidInt64ArgumentsForVB6Clients")]
  100. void OnAuthorizeCompleted(IPump sender, bool success, int authorizationId, object userToken);
  101. /// <summary>
  102. /// Event invoked when an AuthorizeUpdate request has completed.
  103. /// </summary>
  104. /// <param name="sender"></param>
  105. /// <param name="success">True if the request succeeded.</param>
  106. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  107. void OnAuthorizeUpdateCompleted(IPump sender, bool success, object userToken);
  108. /// <summary>
  109. /// Event invoked when an Unauthorize request has completed.
  110. /// </summary>
  111. /// <param name="sender"></param>
  112. /// <param name="success">True if the request succeeded.</param>
  113. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  114. void OnUnauthorizeCompleted(IPump sender, bool success, object userToken);
  115. /// <summary>
  116. /// Event invoked when an SignalEvent request completed.
  117. /// </summary>
  118. /// <param name="sender"></param>
  119. /// <param name="success">True if the request succeeded.</param>
  120. /// <param name="userToken">Token object that was supplied in the asynchronous request.</param>
  121. void OnSignalEventCompleted(IPump sender, bool success, object userToken);
  122. #endregion
  123. #region Unsolicited events
  124. /// <summary>
  125. /// Event fired when the pump state has changed.
  126. /// </summary>
  127. /// <param name="sender">The object that fired the event.</param>
  128. /// <param name="newPumpState">The new pump state.</param>
  129. void OnStateChange(IPump sender, PumpState newPumpState);
  130. /// <summary>
  131. /// Event fired when a nozzle state changes.
  132. /// </summary>
  133. /// <param name="sender"></param>
  134. /// <param name="nozzle"></param>
  135. /// <param name="newNozzleState"></param>
  136. void OnNozzleStateChanged(IPump sender, INozzle nozzle, NozzleState newNozzleState);
  137. /// <summary>
  138. /// Event fired when the fuelling data for a fuelling ( current fuelling ) changes.
  139. /// </summary>
  140. /// <param name="sender">Pump object that fired the event.</param>
  141. /// <param name="fuelling">The fuelling which data changed.</param>
  142. /// <param name="amount">The new amount.</param>
  143. /// <param name="quantity">The new quantity.</param>
  144. void OnFuellingDataChanged(IPump sender, IFuelling fuelling, [param: MarshalAs(UnmanagedType.Currency)] decimal amount, [param: MarshalAs(UnmanagedType.Currency)] decimal quantity);
  145. /// <summary>
  146. /// Event fired when a fuelling's state has changed.
  147. /// </summary>
  148. /// <param name="sender">Pump object that fired the event.</param>
  149. /// <param name="fuelling">The fuelling which state changed.</param>
  150. /// <param name="newState">New state of the fuelling.</param>
  151. void OnFuellingStateChanged(IPump sender, IFuelling fuelling, FuellingState newState);
  152. /// <summary>
  153. /// Event that is fired when a client has signalled an event using the SignalEventAsync method or from inside the forecourt
  154. /// controller.
  155. /// </summary>
  156. /// <param name="sender"></param>
  157. /// <param name="eventType">Type of the event that occured.</param>
  158. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Occured")]
  159. void OnEventOccured(IPump sender, PumpEventType eventType);
  160. #endregion
  161. }
  162. }