protected virtual void OnIgnitionCellChanged(IgnitionCellIndex newIgnitionCell) { if (IgnitionCellChanged == null) { return; } IgnitionCellChanged(this, new EventArgs <IgnitionCellIndex>(newIgnitionCell)); }
private void UpdateAdvance(IgnitionCellIndex cellIndex, byte advance) { if (AdvanceMap[cellIndex.MapIndex] == advance) { return; } AdvanceMap[cellIndex.MapIndex] = advance; OnIgnitionCellUpdated(cellIndex); }
private void PopulateIgnitionMap(byte[] ignitionMap) { for (byte loadIndex = 0; loadIndex < 10; loadIndex++) { for (byte rpmIndex = 0; rpmIndex < 10; rpmIndex++) { IgnitionCellIndex cellIndex = new IgnitionCellIndex(loadIndex, rpmIndex); UpdateAdvance(cellIndex, ignitionMap[cellIndex.MapIndex]); } } }
protected virtual void OnIgnitionCellUpdated(IgnitionCellIndex cellIndex) { if (IgnitionCellUpdated == null) { return; } if (!LoadInProgress) { SavedState = SavedStates.Dirty; } IgnitionCellUpdated(this, new EventArgs <IgnitionCellIndex>(cellIndex)); }
public void Reset() { IgnitionAdvance = 0; Rpm = 0; Load = 0; IgnitionCell = new IgnitionCellIndex(byte.MaxValue, byte.MaxValue); IgnitionConfiguration = IgnitionConfiguration.Unknown; AuxiliaryInput = 0; AdvanceCorrectionBin = 0; AdvanceCorrection = 0; UserOutput1State = BitState.Inactive; UserOutput2State = BitState.Inactive; UserOutput3State = BitState.Inactive; UserOutput4State = BitState.Inactive; ShiftLightState = BitState.Inactive; RevLimitState = BitState.Inactive; }
internal void Populate(GetStateResponse response, EdisType edisType) { IgnitionAdvance = response.CurrentIgnitionAdvance; Rpm = response.GetCurrentRpmValue(edisType); Load = response.CurrentLoadValue; IgnitionCell = new IgnitionCellIndex(response.CurrentLoadBin, response.CurrentRpmBin); UserOutput1State = response.UserOutput1; UserOutput2State = response.UserOutput2; UserOutput3State = response.UserOutput3; UserOutput4State = response.UserOutput4; ShiftLightState = response.ShiftLightState; RevLimitState = response.RevLimitState; IgnitionConfiguration = response.IgnitionConfiguration; AuxiliaryInput = response.AuxiliaryInputValue; AdvanceCorrectionBin = response.CurrentAdvanceCorrectionBin; AdvanceCorrection = response.CurrentAdvanceCorrectionValue; }
public byte this[IgnitionCellIndex cellIndex] { get { return(AdvanceMap[cellIndex.MapIndex]); } set { UpdateAdvance(cellIndex, value); } }