PumpAccumulatorReading.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/PumpAccumulatorReading.cs $
  4. *
  5. * 1 07-01-05 15:12 roger.månsson
  6. * Created
  7. */
  8. #endregion
  9. namespace Wayne.ForecourtControl
  10. {
  11. /// <summary>
  12. /// Data structure for one pump accumulator reading.
  13. /// </summary>
  14. public class PumpAccumulatorReading : Com.IPumpAccumulatorReading
  15. {
  16. #region Fields
  17. IPump pump;
  18. INozzle nozzle;
  19. int fuelPeriodId;
  20. PumpAccumulatorReadingType type;
  21. decimal quantity;
  22. decimal amount;
  23. string originalTransactionData;
  24. Com.IPump comPump;
  25. Com.INozzle comNozzle;
  26. #endregion
  27. #region Construction
  28. /// <summary>
  29. /// Private constructor called by the public constructors.
  30. /// </summary>
  31. /// <param name="fuelPeriodId"></param>
  32. /// <param name="type"></param>
  33. /// <param name="quantity"></param>
  34. /// <param name="amount"></param>
  35. private PumpAccumulatorReading(int fuelPeriodId, PumpAccumulatorReadingType type,
  36. decimal quantity, decimal amount)
  37. {
  38. this.fuelPeriodId = fuelPeriodId;
  39. this.type = type;
  40. this.quantity = quantity;
  41. this.amount = amount;
  42. }
  43. /// <summary>
  44. /// Constructor for the .Net version
  45. /// </summary>
  46. /// <param name="pump"></param>
  47. /// <param name="nozzle"></param>
  48. /// <param name="fuelPeriodId"></param>
  49. /// <param name="type"></param>
  50. /// <param name="quantity"></param>
  51. /// <param name="amount"></param>
  52. public PumpAccumulatorReading(IPump pump, INozzle nozzle, int fuelPeriodId,
  53. PumpAccumulatorReadingType type, decimal quantity, decimal amount, string originalTransactionData)
  54. : this(fuelPeriodId, type, quantity, amount)
  55. {
  56. this.pump = pump;
  57. this.nozzle = nozzle;
  58. this.originalTransactionData = originalTransactionData;
  59. }
  60. /// <summary>
  61. /// Constructor for the COM version
  62. /// </summary>
  63. /// <param name="pump"></param>
  64. /// <param name="nozzle"></param>
  65. /// <param name="fuelPeriodId"></param>
  66. /// <param name="type"></param>
  67. /// <param name="quantity"></param>
  68. /// <param name="amount"></param>
  69. public PumpAccumulatorReading(Com.IPump pump, Com.INozzle nozzle, int fuelPeriodId,
  70. PumpAccumulatorReadingType type, decimal quantity, decimal amount)
  71. : this(fuelPeriodId, type, quantity, amount)
  72. {
  73. this.comPump = pump;
  74. this.comNozzle = nozzle;
  75. }
  76. /// <summary>
  77. /// Constructor used to only transfer Original transaction data
  78. /// </summary>
  79. /// <param name="originalTransactionData"></param>
  80. public PumpAccumulatorReading(string originalTransactionData)
  81. {
  82. this.originalTransactionData = originalTransactionData;
  83. }
  84. #endregion
  85. #region Properties
  86. /// <summary>
  87. /// Pump that made the reading.
  88. /// </summary>
  89. public IPump Pump
  90. {
  91. get { return pump; }
  92. }
  93. /// <summary>
  94. /// The nozzle that the reading was done for.
  95. /// </summary>
  96. public INozzle Nozzle
  97. {
  98. get { return nozzle; }
  99. }
  100. /// <summary>
  101. /// Fuel period that the reading was made in.
  102. /// </summary>
  103. public int FuelPeriodId
  104. {
  105. get { return fuelPeriodId; }
  106. }
  107. /// <summary>
  108. /// Type of accumulator reading.
  109. /// </summary>
  110. public PumpAccumulatorReadingType Type
  111. {
  112. get { return type; }
  113. }
  114. /// <summary>
  115. /// Read quantity
  116. /// </summary>
  117. public decimal Quantity
  118. {
  119. get { return quantity; }
  120. }
  121. /// <summary>
  122. /// Read amount
  123. /// </summary>
  124. public decimal Amount
  125. {
  126. get { return amount; }
  127. }
  128. #endregion
  129. #region IPumpAccumulatorReading Members
  130. Wayne.ForecourtControl.Com.IPump Wayne.ForecourtControl.Com.IPumpAccumulatorReading.Pump
  131. {
  132. get { return comPump; }
  133. }
  134. Wayne.ForecourtControl.Com.INozzle Wayne.ForecourtControl.Com.IPumpAccumulatorReading.Nozzle
  135. {
  136. get { return comNozzle; }
  137. }
  138. /// <summary>
  139. /// Original transaction from pump
  140. /// </summary>
  141. public string OriginalTransactionData
  142. {
  143. get { return originalTransactionData; }
  144. }
  145. #endregion
  146. }
  147. }