123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- using Edge.Core.Parser;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Wayne.FDCPOSLibrary;
- namespace Edge.Core.IndustryStandardInterface.Pump
- {
-
-
-
-
- public interface IFdcPumpController
- {
- event EventHandler<FdcPumpControllerOnStateChangeEventArg> OnStateChange;
- event EventHandler<FdcTransactionDoneEventArg> OnCurrentFuellingStatusChange;
-
-
-
-
-
- void OnFdcServerInit(Dictionary<string, object> parameters);
- string Name { get; }
-
-
-
-
-
-
-
-
- int PumpId { get; }
-
-
-
-
-
-
-
- int PumpPhysicalId { get; }
- IEnumerable<LogicalNozzle> Nozzles { get; }
-
-
-
-
- int AmountDecimalDigits { get; }
-
-
-
- int VolumeDecimalDigits { get; }
-
-
-
- int PriceDecimalDigits { get; }
- int VolumeTotalizerDecimalDigits { get; }
- Task<LogicalDeviceState> QueryStatusAsync();
-
-
-
-
- Task<Tuple<int, int>> QueryTotalizerAsync(byte logicalNozzleId);
-
- Task<bool> SuspendFuellingAsync();
- Task<bool> ResumeFuellingAsync();
- Task<bool> ChangeFuelPriceAsync(int newPriceWithoutDecimalPoint, byte logicalNozzleId);
- Task<bool> AuthorizeAsync(byte logicalNozzleId);
- Task<bool> UnAuthorizeAsync(byte logicalNozzleId);
- Task<bool> AuthorizeWithAmountAsync(int moneyAmountWithoutDecimalPoint, byte logicalNozzleId);
- Task<bool> AuthorizeWithVolumeAsync(int volumnWithoutDecimalPoint, byte logicalNozzleId);
-
-
-
-
-
- Task<bool> FuelingRoundUpByAmountAsync(int amount);
-
-
-
-
-
- Task<bool> FuelingRoundUpByVolumeAsync(int volume);
-
-
-
-
-
- Task<bool> LockNozzleAsync(byte logicalNozzleId);
-
-
-
-
-
- Task<bool> UnlockNozzleAsync(byte logicalNozzleId);
- }
-
-
-
-
-
- public class LogicalNozzle
- {
- private LogicalNozzle() { }
-
-
-
-
-
-
-
- public LogicalNozzle(int pumpId, byte physicalId, byte logicalId, int? realPriceOnPhysicalPump)
- {
- if (logicalId < 1) throw new ArgumentException("Nozzle logical id must be >=1");
- this.PumpId = pumpId;
- this.RealPriceOnPhysicalPump = realPriceOnPhysicalPump;
- this.PhysicalId = physicalId;
- this.LogicalId = logicalId;
- }
- public int PumpId { get; }
-
-
-
-
-
-
-
-
- public byte PhysicalId { get; }
-
-
-
-
-
-
- public byte LogicalId { get; }
-
-
-
-
-
-
-
- public int? RealPriceOnPhysicalPump { get; set; }
-
-
-
-
-
-
- public int? ExpectingPriceOnFcSide { get; set; }
-
-
-
- public int? VolumeTotalizer { get; set; }
- public LogicalDeviceState? LogicalState { get; set; }
- }
- public class FdcTransactionDoneEventArg : System.EventArgs
- {
- public FdcTransactionDoneEventArg(FdcTransaction transaction)
- {
- this.Transaction = transaction;
- }
- public FdcTransaction Transaction { get; private set; }
- }
- public class FdcTransaction
- {
- public LogicalNozzle Nozzle { get; set; }
-
-
-
- public int Amount { get; set; }
-
-
-
- public int Volumn { get; set; }
-
-
-
- public int Price { get; set; }
- public int Barcode { get; set; }
-
-
-
-
-
-
-
-
- public int SequenceNumberGeneratedOnPhysicalPump { get; set; }
-
-
-
-
- public int? AmountTotalizer { get; set; }
-
-
-
-
- public int? VolumeTotalizer { get; set; }
-
-
-
-
- public bool Finished { get; set; }
-
-
-
-
- public DateTime? SaleStartTime { get; set; }
-
-
-
-
- public DateTime? SaleEndTime { get; set; }
- }
- }
|