private void CalcCurrentRT(DiagData diagData) { oldRpmThrRtIndex = RpmThrRtIndex; var j7esDiag = diagData as J7esDiagData; if (j7esDiag != null && j7esDiag.RPM_RT != 0) { ThrRtIndex = j7esDiag.THR_RT_16; GbcRtIndex = j7esDiag.GBC_RT_16; RpmRtIndex = j7esDiag.RPM_RT_16; RpmRt32Index = DataHelper.rl(DataHelper.Swap((byte)(j7esDiag.RPM_RT + 4))) & 0x1F; TwatRtIndex = j7esDiag.TWAT_RT; RpmThrRtIndex = j7esDiag.RPM_THR_RT; RpmPressRtIndex = (((byte)(j7esDiag.PRESS_RT + 8)) & 0xF0) + RpmRtIndex; } else { ThrRtIndex = DataHelper.Swap((byte)(thrSampling[Math.Min(diagData.TRT, thrSampling.Length - 1)] + 8)) & 0xF; GbcRtIndex = DataHelper.NearCell(gbcRt, (int)Math.Round(diagData.GBC, MidpointRounding.AwayFromZero)); RpmRtIndex = DataHelper.NearCell(rpmRt16, diagData.RPM); RpmRt32Index = DataHelper.NearCell(rpmRt32, diagData.RPM); TwatRtIndex = DataHelper.NearCell(twatRt, diagData.TWAT); RpmThrRtIndex = 16 * ThrRtIndex + RpmRtIndex; Rpm32PressRtIndex = (((byte)(j7esDiag.PRESS_RT + 8)) & 0xF0) + RpmRt32Index; } Rpm32ThrRtIndex = 32 * ThrRtIndex + RpmRt32Index; RpmGbcRtIndex = onlineManager.OltProtocol.Version == OltProtocolVersion.OltDiagV1 ? diagData.RPM_GBC_RT : 16 * GbcRtIndex + RpmRtIndex; }
private void PrepareFuelCutoff(bool value) { var options = buffer[0x6051]; //bit06 - признак постоянного включения топлива if (DataHelper.IsBitSet(options, 6) == value) { return; } DataHelper.BitSet(ref options, 6, value); onlineManager.OltProtocol.WriteRam(0x6051, new[] { options }); buffer[0x6051] = options; }
private void Prepare() { SWDigest = DataHelper.CalculateCRC(buffer, 0, 0xB0); IsFastRpm = DataHelper.IndexOf(buffer, new byte[] { 0x90, 0x61, 0x3C, 0xE5, 0x55 }) != -1; J7esFlags.Prepare(buffer); FillKGbc(); if (J7esFlags.IsDadMode && !J7esFlags.IsCommonKGBCTable) { kgbc.Address = FirmwareHelper.KGbcJ7esDadAddr; } FirmwareHelper.FillRpmRT(buffer, out rpmSampling, out rpmRt32, out rpmRt16); FillThrRT(); FillGbcRT(); FillTWatRT(); FillPressRT(); FillPoints(); FillGbc(); FillKGbc(); FillKGbcPress(); }
public SettingsViewModel(Helper.DataHelper dataHelper) { // TODO: Complete member initialization this.dataHelper = dataHelper; }