123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- using System;
- //using System.Diagnostics;
- using Wayne.Lib;
- #if _SINP
- using Wayne.ForecourtControl.Nfs;
- #endif
- namespace Wayne.ForecourtControl.Fusion
- {
- internal class FUSIONNozzle : INozzle, IIdentifiableEntity
- {
- // Fields
- private int fuelGrade;
- private int id;
- private NozzleState nozzleState = NozzleState.In;
- private FUSIONPump pump;
- private IIdentifiableEntity parentDevice;
- private int primaryTankGroupId;
- private int primaryTankGroupPercentage;
- private int secondaryTankGroupId;
- // Methods
- public FUSIONNozzle(int id, FUSIONPump pump)
- {
- this.id = id;
- this.pump = pump;
- }
- internal void Dispose()
- {
- }
- public void ReadPumpAccumulatorAsync(EventHandler<AsyncCompletedEventArgs<PumpAccumulatorReading>> accumulatorsRead, object userToken)
- {
- //throw new Exception("The method or operation is not implemented.");
- this.pump.Manager.ifsfManager.GetFuelPointTotals(this.pump.realId, this.id, accumulatorsRead, userToken, this);
- }
- // Properties
- public string EntitySubType
- {
- get
- {
- return "";
- }
- }
- public string EntityType
- {
- get
- {
- return "Nozzle";
- }
- }
- /// <summary>
- /// This is used by the logger and should never be set by implementing classes
- /// </summary>
- public string FullEntityName { get; set; }
- public int FuelGrade
- {
- get
- {
- return this.fuelGrade;
- }
- set
- {
- this.fuelGrade = value;
- }
- }
- public int Id
- {
- get
- {
- if (pump.Manager.IdNozzleShift > 0)
- return this.id + pump.Manager.IdNozzleShift;
- else
- return this.id + pump.Manager.IdShift;
- }
- }
- public int realId
- {
- get
- {
- return this.id;
- }
- set
- {
- this.id = value;
- }
- }
- public IIdentifiableEntity ParentEntity
- {
- get
- {
- return this.parentDevice;
- }
- }
- public int PrimaryTankGroupId
- {
- get
- {
- return this.primaryTankGroupId;
- }
- set
- {
- this.primaryTankGroupId = value;
- }
- }
- public int PrimaryTankGroupPercentage
- {
- get
- {
- return this.primaryTankGroupPercentage;
- }
- set
- {
- this.primaryTankGroupPercentage = value;
- }
- }
- public int SecondaryTankGroupId
- {
- get
- {
- return this.secondaryTankGroupId;
- }
- set
- {
- this.secondaryTankGroupId = value;
- }
- }
- public NozzleState State
- {
- get
- {
- return this.nozzleState;
- }
- set
- {
- Trace.WriteLine(string.Format("old State={0}, new State={1}", nozzleState, value));
- if (this.nozzleState != value)
- {
- this.nozzleState = value;
- pump.NozzleStateChange(this, this.nozzleState);
- }
- }
- }
- }
- }
|