IFuelling.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/IFuelling.cs $
  4. *
  5. * 6 08-01-03 16:28 roger.månsson
  6. * Added PriceRevision
  7. *
  8. * 5 07-12-20 12:11 roger.månsson
  9. * Added ReservingDeviceId to IFuelling.
  10. *
  11. * 4 07-01-05 15:10 roger.månsson
  12. *
  13. * 3 07-01-05 8:59 roger.månsson
  14. * Changed docs
  15. */
  16. #endregion
  17. using System;
  18. namespace Wayne.ForecourtControl
  19. {
  20. /// <summary>
  21. /// Represents a fuelling. It provides properties to display Amount, Volume and so on for a fuelling. If the fuelling
  22. /// is reserved, the fuelling can be manipulated through the IReservedFuelling interface.
  23. /// </summary>
  24. public interface IFuelling
  25. {
  26. #region Properties
  27. /// <summary>
  28. /// Fuelling sequence number is a unique number created for ever
  29. /// completed fuelling. Begins to count from 1 at system cold-start
  30. /// </summary>
  31. int FuellingSequenceNumber { get;}
  32. /// <summary>
  33. /// Reference to the owning pump.
  34. /// </summary>
  35. IPump Pump { get;}
  36. /// <summary>
  37. /// The Nozzle object on which this fuelling was made
  38. /// </summary>
  39. INozzle Nozzle { get;}
  40. /// <summary>
  41. /// 0 if not reserved, else it contains the ClientId of the application
  42. /// that has reserved the fuelling.
  43. /// </summary>
  44. int ReservedBy { get;}
  45. /// <summary>
  46. /// "" if not reserved, else it contains the Id of the application
  47. /// that has authorized the fuelling.
  48. /// </summary>
  49. int AuthorizedBy { get; }
  50. /// <summary>
  51. /// State of the fuelling.
  52. /// </summary>
  53. FuellingState State { get;}
  54. /// <summary>
  55. /// Type of fuelling.
  56. /// </summary>
  57. FuellingType Type { get;}
  58. /// <summary>
  59. /// Filled volume
  60. /// </summary>
  61. decimal Quantity { get;}
  62. /// <summary>
  63. /// Filled amount in domestic currency value.
  64. /// </summary>
  65. decimal Amount { get;}
  66. /// <summary>
  67. /// Preset value when the fuelling was released.
  68. /// </summary>
  69. decimal PresetValue { get;}
  70. /// <summary>
  71. /// Specifies if PresetValue is Amount or Volume.
  72. /// </summary>
  73. PresetType PresetType { get;}
  74. /// <summary>
  75. /// Price used for the fuelling in domestic currency value.
  76. /// </summary>
  77. decimal Price { get;}
  78. /// <summary>
  79. /// The date time of when the fuelling was completed.
  80. /// </summary>
  81. DateTime CompletionDateTime { get;}
  82. /// <summary>
  83. /// A status code indicating what caused ending of the fuelling.
  84. /// <list type="bullet">
  85. /// <item>0=Ok</item>
  86. /// <item>1=Timeout</item>
  87. /// <item>2=BNT Timeout</item>
  88. /// <item>3=Disconnected</item>
  89. /// <item>4=BNT disconnected</item>
  90. /// <item>5=Stopped</item>
  91. /// <item>6=Volume or amount decreased</item>
  92. /// <item>7=Pulser error</item>
  93. /// <item>8=Pulser current error</item>
  94. /// <item>9=Zero fuelling</item>
  95. /// <item>10=No decimals set</item>
  96. /// <item>11=Price error</item>
  97. /// <item>12=Volume or amuont garbage</item>
  98. /// <item>13=Display error</item>
  99. /// <item>14=Checksum error</item>
  100. /// </list>
  101. /// </summary>
  102. int CompletionReason { get;}
  103. /// <summary>
  104. /// Fuel grade used.
  105. /// </summary>
  106. int FuelGrade { get;}
  107. /// <summary>
  108. /// PriceGroup used.
  109. /// </summary>
  110. int PriceGroup { get;}
  111. /// <summary>
  112. /// The Fuel period that the fuelling belongs to.
  113. /// </summary>
  114. int FuelPeriodId { get;}
  115. /// <summary>
  116. /// An identifiaction of the authorization that is originally returned in the
  117. /// async callback for the IReservePump.AuthorizeAsync. It is used to match the
  118. /// authorization with the fuelling completion.
  119. /// </summary>
  120. long AuthorizationId { get;}
  121. /// <summary>
  122. /// Pump accumulator read after completed fuelling. May be null if pump accumulator reading not is supported.
  123. /// </summary>
  124. PumpAccumulatorReading PumpAccumulator { get;}
  125. /// <summary>
  126. /// Device Id that was supplied in the reservation of the pump before authorization of the fuelling.
  127. /// </summary>
  128. byte ReservingDeviceId { get;}
  129. /// <summary>
  130. /// Internal Price revision number that was active when the fuelling took place.
  131. /// </summary>
  132. byte PriceRevision { get;}
  133. /// <summary>
  134. /// Receipt lines to be printed for this fuelling. Contains signing information according to the appropriate regulations. Made for MID approval.
  135. /// </summary>
  136. string SignedReceiptLines { get; }
  137. /// <summary>
  138. /// Wide format for eceipt lines to be printed for this fuelling. Contains signing information according to the appropriate regulations. Made for MID approval.
  139. /// </summary>
  140. string SignedReceiptLinesWide { get; }
  141. #endregion
  142. #region Methods
  143. /// <summary>
  144. /// Reserves the fuelling for exclusive use. When the fuelling is successfully reserved, the ReservedBy property will
  145. /// be set to the ClientId of the reserving client.
  146. /// </summary>
  147. /// <param name="fuellingReserveCompleted">Callback delegate that will be called on completion.</param>
  148. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback.</param>
  149. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
  150. void ReserveAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> fuellingReserveCompleted, object userToken);
  151. /// <summary>
  152. /// Cancel fuelling lock.
  153. /// </summary>
  154. /// <param name="requestCompleted"></param>
  155. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  156. void UnreserveAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  157. /// <summary>
  158. /// Changes the state of the fuelling to Transferred.
  159. /// If the fuelling is not already reserved, that is done implicitly, and must succeed before the
  160. /// transfer can succeed.
  161. /// </summary>
  162. /// <param name="requestCompleted">Callback delegate that will be called on completion.</param>
  163. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  164. void TransferAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  165. /// <summary>
  166. /// Rolls back the transfer and unreserves the fuelling.
  167. /// </summary>
  168. /// <param name="requestCompleted">Callback delegate that will be called on completion.</param>
  169. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  170. void UndoTransferAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  171. /// <summary>
  172. /// Sets the fuelling to paid state, which means that it will no longer will be availiable in the Fuellings array.
  173. /// </summary>
  174. /// <param name="requestCompleted">Callback delegate that will be called on completion.</param>
  175. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  176. void SetAsPaidAsync(EventHandler<Wayne.Lib.AsyncCompletedEventArgs> requestCompleted, object userToken);
  177. #endregion
  178. }
  179. }