IFuelling.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/Com/IFuelling.cs $
  4. *
  5. * 4 07-02-27 12:35 roger.månsson
  6. * Set decimal MarshalAs Currency to be better compliant with COM.
  7. *
  8. * 3 07-01-05 15:14 roger.månsson
  9. * Added PumpAccumulator property
  10. *
  11. * 2 07-01-05 9:01 roger.månsson
  12. * Documentation changes
  13. */
  14. #endregion
  15. using System;
  16. using System.Runtime.InteropServices;
  17. namespace Wayne.ForecourtControl.Com
  18. {
  19. /// <summary>
  20. /// Represents a fuelling. It provides properties to display Amount, Volume and so on for a fuelling. It does
  21. /// also give the possibilities to change the state of the fuelling and eventually get it removed when it is paid.
  22. /// </summary>
  23. [System.Runtime.InteropServices.ComVisible(true)]
  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. /// State of the fuelling.
  47. /// </summary>
  48. FuellingState State { get;}
  49. /// <summary>
  50. /// Type of fuelling.
  51. /// </summary>
  52. FuellingType Type { get;}
  53. /// <summary>
  54. /// Filled volume
  55. /// </summary>
  56. decimal Quantity { [return:MarshalAs( UnmanagedType.Currency)] get;}
  57. /// <summary>
  58. /// Filled amount in domestic currency value.
  59. /// </summary>
  60. decimal Amount { [return: MarshalAs(UnmanagedType.Currency)]get;}
  61. /// <summary>
  62. /// Preset value when the fuelling was released.
  63. /// </summary>
  64. decimal PresetValue { [return: MarshalAs(UnmanagedType.Currency)]get;}
  65. /// <summary>
  66. /// Specifies if PresetValue is Amount or Volume.
  67. /// </summary>
  68. PresetType PresetType { get;}
  69. /// <summary>
  70. /// Price used for the fuelling in domestic currency value.
  71. /// </summary>
  72. decimal Price { [return: MarshalAs(UnmanagedType.Currency)]get;}
  73. /// <summary>
  74. /// The date time of when the fuelling was completed.
  75. /// </summary>
  76. DateTime CompletionDateTime { get;}
  77. /// <summary>
  78. /// A status code indicating what caused ending of the fuelling.
  79. /// <list type="bullet">
  80. /// <item>0=Ok</item>
  81. /// <item>1=Timeout</item>
  82. /// <item>2=BNT Timeout</item>
  83. /// <item>3=Disconnected</item>
  84. /// <item>4=BNT disconnected</item>
  85. /// <item>5=Stopped</item>
  86. /// <item>6=Volume or amount decreased</item>
  87. /// <item>7=Pulser error</item>
  88. /// <item>8=Pulser current error</item>
  89. /// <item>9=Zero fuelling</item>
  90. /// <item>10=No decimals set</item>
  91. /// <item>11=Price error</item>
  92. /// <item>12=Volume or amuont garbage</item>
  93. /// <item>13=Display error</item>
  94. /// <item>14=Checksum error</item>
  95. /// </list>
  96. /// </summary>
  97. int CompletionReason { get;}
  98. /// <summary>
  99. /// Fuel grade used.
  100. /// </summary>
  101. int FuelGrade { get;}
  102. /// <summary>
  103. /// PriceGroup used.
  104. /// </summary>
  105. int PriceGroup { get;}
  106. /// <summary>
  107. /// The Fuel period that the fuelling belongs to.
  108. /// </summary>
  109. int FuelPeriodId { get;}
  110. /// <summary>
  111. /// An identifiaction of the authorization that is originally returned in the
  112. /// async callback for the IReservePump.AuthorizeAsync. It is used to match the
  113. /// authorization with the fuelling completion.
  114. /// </summary>
  115. int AuthorizationId { get;}
  116. /// <summary>
  117. /// Pump accumulator read after completed fuelling. May be null if pump accumulator reading not is supported.
  118. /// </summary>
  119. IPumpAccumulatorReading PumpAccumulator { get;}
  120. #endregion
  121. #region Methods
  122. #region Reserve
  123. /// <summary>
  124. /// Reserves the fuelling for exclusive use. When the fuelling is successfully reserved, the ReservedBy property will
  125. /// be set to the ClientId of the reserving client.
  126. /// </summary>
  127. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback.</param>
  128. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
  129. void ReserveAsync(object userToken);
  130. #endregion
  131. #region UnreserveAsync
  132. /// <summary>
  133. /// Cancel fuelling lock.
  134. /// </summary>
  135. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  136. void UnreserveAsync(object userToken);
  137. #endregion
  138. #region Transfer
  139. /// <summary>
  140. /// Changes the state of the fuelling to Transferred.
  141. /// If the fuelling is not already reserved, that is done implicitly, and must succeed before the
  142. /// transfer can succeed.
  143. /// </summary>
  144. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  145. void TransferAsync(object userToken);
  146. #endregion
  147. #region UndoTransfer
  148. /// <summary>
  149. /// Rolls back the transfer and unreserves the fuelling.
  150. /// </summary>
  151. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  152. void UndoTransferAsync(object userToken);
  153. #endregion
  154. #region SetAsPaid
  155. /// <summary>
  156. /// Sets the fuelling to paid state, which means that it will no longer will be availiable in the Fuellings array.
  157. /// </summary>
  158. /// <param name="userToken">A user supplied object that will be returned in the requestCompleted callback</param>
  159. void SetAsPaidAsync(object userToken);
  160. #endregion
  161. #endregion
  162. }
  163. }