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> 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"; } } /// /// This is used by the logger and should never be set by implementing classes /// 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); } } } } }