Example #1
0
        private void btnAnomaliesChecker_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (m_trionicFile != null)
            {
                if (m_trionicFile.Exists())
                {
                    DataTable dtReport = m_trionicFile.CheckForAnomalies();
                    TuningReport tuningrep = new TuningReport();
                    tuningrep.ReportTitle = "Anomaly report";
                    tuningrep.SetDataSource(dtReport);
                    tuningrep.CreateReport();
                    tuningrep.ShowReportPreview(defaultLookAndFeel1.LookAndFeel);

                }
            }
        }
Example #2
0
        private void RunMapSensorWizard(MapSensorType targetMapSensorType)
        {
            if (m_trionicFile.Exists())
            {
                Trionic5Tuner _tuner = new Trionic5Tuner();
                string targetMapSensorString = "3 bar mapsensor";
                switch (targetMapSensorType)
                {
                    case MapSensorType.MapSensor25:
                        targetMapSensorString = "2.5 bar mapsensor";
                        break;
                    case MapSensorType.MapSensor30:
                        targetMapSensorString = "3.0 bar mapsensor";
                        break;
                    case MapSensorType.MapSensor35:
                        targetMapSensorString = "3.5 bar mapsensor";
                        break;
                    case MapSensorType.MapSensor40:
                        targetMapSensorString = "4.0 bar mapsensor";
                        break;
                    case MapSensorType.MapSensor50:
                        targetMapSensorString = "5.0 bar mapsensor";
                        break;
                }
                MapSensorType fromMapSensortype = m_trionicFile.GetMapSensorType(m_appSettings.AutoDetectMapsensorType);
                frmMapSensorWizard mapSensorWiz = new frmMapSensorWizard();
                mapSensorWiz.SetMapSensorTypes(fromMapSensortype, targetMapSensorType);
                if (mapSensorWiz.ShowDialog() == DialogResult.OK)
                {
                    _tuner.AutoUpdateChecksum = m_appSettings.AutoChecksum;
                    _tuner.ConvertFileToThreeBarMapSensor(m_trionicFileInformation, fromMapSensortype, MapSensorType.MapSensor30);
                    props = m_trionicFile.GetTrionicProperties();
                    m_trionicFile.UpdateChecksum();
                    TuningReport tuningrep = new TuningReport();
                    tuningrep.ReportTitle = targetMapSensorString + " report";
                    tuningrep.DataSource = _tuner.Resume.ResumeTuning;
                    tuningrep.CreateReport();
                    tuningrep.ShowPreview(defaultLookAndFeel1.LookAndFeel);

                }
            }
        }
Example #3
0
        private void RunTuningWizard()
        {
            props = m_trionicFile.GetTrionicProperties();
            if ((int)props.TuningStage > 3)
            {
                frmInfoBox infofail = new frmInfoBox("This file has already been tuned to a higher stage, the tuning wizard will not be started");
                return;
            }

            frmTuningWizard tunWiz = new frmTuningWizard();
            int _currStage = (int)props.TuningStage;
            if (_currStage == 0) _currStage++;
            tunWiz.TuningStage = _currStage;
            tunWiz.SetMapSensorType(props.MapSensorType);
            tunWiz.SetInjectorType(props.InjectorType);
            tunWiz.SetTurboType(props.TurboType);
            ECUFileType fileType = m_trionicFile.DetermineFileType();
            int frek230 = m_trionicFile.GetSymbolAsInt("Frek_230!");
            int frek250 = m_trionicFile.GetSymbolAsInt("Frek_250!");

            int knockTime = m_trionicFile.GetSymbolAsInt("Knock_matrix_time!");
            tunWiz.SetKnockTime(knockTime);
            int rpmLimit = m_trionicFile.GetSymbolAsInt("Rpm_max!");
            tunWiz.SetRPMLimiter(rpmLimit);

            if (fileType == ECUFileType.Trionic52File)
            {
                if (frek230 == 728 || frek250 == 935)
                {
                    //dtReport.Rows.Add("APC valve type: Trionic 5");
                    tunWiz.SetBPCType(BPCType.Trionic5Valve);
                }
                else
                {
                    tunWiz.SetBPCType(BPCType.Trionic7Valve);
                }
            }
            else if (fileType == ECUFileType.Trionic55File)
            {
                if (frek230 == 90 || frek250 == 70)
                {
                    tunWiz.SetBPCType(BPCType.Trionic5Valve);
                }
                else
                {
                    tunWiz.SetBPCType(BPCType.Trionic7Valve);
                }
            }
            if (tunWiz.ShowDialog() == DialogResult.OK)
            {
                Application.DoEvents();
                Trionic5Tuner _tuner = new Trionic5Tuner();
                _tuner.AutoUpdateChecksum = m_appSettings.AutoChecksum;
                frmInfoBox info;
                TuningResult result = TuningResult.TuningFailed;
                if (tunWiz.TuningStage == 4)
                {
                    result = _tuner.FreeTuneBinary(m_trionicFile, tunWiz.GetPeakTorque(), tunWiz.GetPeakBoost(), tunWiz.IsTorqueBased, tunWiz.GetMapSensorType(), tunWiz.GetTurboType(), tunWiz.GetInjectorType(), tunWiz.GetBCVType(), tunWiz.GetRPMLimiter(), tunWiz.GetKnockTime());
                }
                else
                {
                    result = _tuner.TuneFileToStage(tunWiz.TuningStage, m_trionicFile.GetFileInfo().Filename, m_trionicFile, m_trionicFileInformation, true);

                }
                switch (result)
                {
                    case TuningResult.TuningFailed:
                        info = new frmInfoBox("Tuning of the binary file failed!");
                        break;
                    case TuningResult.TuningFailedAlreadyTuned:
                        info = new frmInfoBox("Your binary file was already tuned!");
                        break;
                    case TuningResult.TuningFailedThreebarSensor:
                        info = new frmInfoBox("Your binary file was already tuned (3 bar sensor)!");
                        break;
                    case TuningResult.TuningSuccess:
                        // show report
                        props = m_trionicFile.GetTrionicProperties();
                        TuningReport tuningrep = new TuningReport();
                        tuningrep.ReportTitle = "Tuning report (stage " + tunWiz.TuningStage.ToString() + ")";
                        tuningrep.SetDataSource(_tuner.Resume.ResumeTuning);
                        tuningrep.CreateReport();
                        tuningrep.ShowReportPreview(defaultLookAndFeel1.LookAndFeel);
                        //info = new frmInfoBox("Your binary file was succesfully tuned to stage 1");
                        break;
                    case TuningResult.TuningCancelled:
                        // show report
                        info = new frmInfoBox("Tuning process cancelled by user");
                        break;
                }
            }
        }
Example #4
0
        private void btnTuneToStageX_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // tune with user entered parameters, based in injector type, turbo type, fuel type (to come) etc
            // create a backup!
            // start the parameter screen (user can enter turbo, injector, mapsensor, peak torque and peak power)
            // start the freetune wizard

            frmFreeTuneSettings tunset = new frmFreeTuneSettings();
            props = m_trionicFile.GetTrionicProperties();
            tunset.SetMapSensorType(props.MapSensorType);
            tunset.SetInjectorType(props.InjectorType);
            tunset.SetTurboType(props.TurboType);
            ECUFileType fileType = m_trionicFile.DetermineFileType();
            int frek230 = m_trionicFile.GetSymbolAsInt("Frek_230!");
            int frek250 = m_trionicFile.GetSymbolAsInt("Frek_250!");

            int knockTime = m_trionicFile.GetSymbolAsInt("Knock_matrix_time!");
            tunset.SetKnockTime(knockTime);
            int rpmLimit = m_trionicFile.GetSymbolAsInt("Rpm_max!");
            tunset.SetRPMLimiter(rpmLimit);

            if (fileType == ECUFileType.Trionic52File)
            {
                if (frek230 == 728 || frek250 == 935)
                {
                    //dtReport.Rows.Add("APC valve type: Trionic 5");
                    tunset.SetBPCType(BPCType.Trionic5Valve);
                }
                else
                {
                    tunset.SetBPCType(BPCType.Trionic7Valve);
                }
            }
            else if (fileType == ECUFileType.Trionic55File)
            {
                if (frek230 == 90 || frek250 == 70)
                {
                    tunset.SetBPCType(BPCType.Trionic5Valve);
                }
                else
                {
                    tunset.SetBPCType(BPCType.Trionic7Valve);
                }
            }
            if (tunset.ShowDialog() == DialogResult.OK)
            {
                Trionic5Tuner _tuner = new Trionic5Tuner();
                _tuner.AutoUpdateChecksum = m_appSettings.AutoChecksum;

                TuningResult res = _tuner.FreeTuneBinary(m_trionicFile, tunset.GetPeakTorque(), tunset.GetPeakBoost(), tunset.IsTorqueBased, tunset.GetMapSensorType(), tunset.GetTurboType(), tunset.GetInjectorType(), tunset.GetBCVType(), tunset.GetRPMLimiter(), tunset.GetKnockTime());
                string text = "Tuning process completed!";
                if (res == TuningResult.TuningFailedAlreadyTuned)
                {
                    text = "Tuning process aborted, file is already tuned!";
                }
                else if (res == TuningResult.TuningFailedThreebarSensor)
                {
                    text = "Tuning process aborted, file was converted to another mapsensor type before!";
                }

                props = m_trionicFile.GetTrionicProperties();
                if (_tuner.Resume == null)
                {

                }
                _tuner.Resume.AddToResumeTable(text);
                TuningReport tuningrep = new TuningReport();
                tuningrep.ReportTitle = "Tuning report.. stage " + props.TuningStage.ToString();
                tuningrep.SetDataSource(_tuner.Resume.ResumeTuning);
                tuningrep.CreateReport();
                tuningrep.ShowReportPreview(defaultLookAndFeel1.LookAndFeel);
               //frmInfoBox info = new frmInfoBox(text);
            }
        }
Example #5
0
        private void btnTuneToStage3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Trionic5Tuner _tuner = new Trionic5Tuner();
            _tuner.AutoUpdateChecksum = m_appSettings.AutoChecksum;
            frmInfoBox info;
            TuningResult result = _tuner.TuneFileToStage(3, m_trionicFile.GetFileInfo().Filename, m_trionicFile, m_trionicFileInformation, false);
            switch (result)
            {
                case TuningResult.TuningFailed:
                    info = new frmInfoBox("Tuning of the binary file failed!");
                    break;
                case TuningResult.TuningFailedAlreadyTuned:
                    info = new frmInfoBox("Your binary file was already tuned!");
                    break;
                case TuningResult.TuningFailedThreebarSensor:
                    info = new frmInfoBox("Your binary file was already tuned (3 bar sensor)!");
                    break;
                case TuningResult.TuningSuccess:
                    // show report
                    props = m_trionicFile.GetTrionicProperties();
                    //info = new frmInfoBox("Your binary file was succesfully tuned to stage 3");
                    TuningReport tuningrep = new TuningReport();
                    tuningrep.ReportTitle = "Tuning report (stage III)";
                    tuningrep.SetDataSource(_tuner.Resume.ResumeTuning);
                    tuningrep.CreateReport();
                    tuningrep.ShowReportPreview(defaultLookAndFeel1.LookAndFeel);
                    break;
                case TuningResult.TuningCancelled:
                    // show report
                    info = new frmInfoBox("Tuning process cancelled by user");
                    break;

            }
        }
Example #6
0
        private void btnTuneForE85Fuel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (m_trionicFile.Exists())
            {
                frmE85Wizard e85Wiz = new frmE85Wizard();
                if (e85Wiz.ShowDialog() == DialogResult.OK)
                {
                    Application.DoEvents();
                    if (m_CurrentWorkingProject != "")
                    {
                        if (!Directory.Exists(m_appSettings.ProjectFolder + "\\" + m_CurrentWorkingProject + "\\Backups")) Directory.CreateDirectory(m_appSettings.ProjectFolder + "\\" + m_CurrentWorkingProject + "\\Backups");
                        string filename = m_appSettings.ProjectFolder + "\\" + m_CurrentWorkingProject + "\\Backups\\" + Path.GetFileNameWithoutExtension(GetBinaryForProject(m_CurrentWorkingProject)) + "-backup-" + DateTime.Now.ToString("MMddyyyyHHmmss") + ".BIN";
                        File.Copy(GetBinaryForProject(m_CurrentWorkingProject), filename);
                    }
                    else
                    {
                        // create a backup file in the current working folder
                        string filename = Path.GetDirectoryName(m_trionicFile.GetFileInfo().Filename) + "\\" + Path.GetFileNameWithoutExtension(m_trionicFile.GetFileInfo().Filename) + "-backup-" + DateTime.Now.ToString("MMddyyyyHHmmss") + ".BIN";
                        File.Copy(m_trionicFile.GetFileInfo().Filename, filename);
                    }

                    // do the tune!
                    Trionic5Tuner _tuner = new Trionic5Tuner();
                    Trionic5Properties properties = m_trionicFile.GetTrionicProperties();
                    _tuner.ConvertToE85(m_trionicFile);
                    TuningReport tuningrep = new TuningReport();
                    tuningrep.ReportTitle = "Convert to E85 report";
                    tuningrep.SetDataSource(_tuner.Resume.ResumeTuning);
                    tuningrep.CreateReport();
                    tuningrep.ShowReportPreview(defaultLookAndFeel1.LookAndFeel);
                    //frmInfoBox info = new frmInfoBox("Conversion to E85 fuel done");
                }
            }
        }
Example #7
0
        private void btnMoveSymbolsToAnotherBinary_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //TODO: have the  user select which symbols to move and which not to move (only the different symbols should be listed)
            // ask for another bin file
            Trionic5Resume resume = new Trionic5Resume();

            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "Binary files|*.bin";
            ofd.Multiselect = false;
            if (m_trionicFileInformation.Filename != string.Empty)
            {
                frmTransferDataWizard dataWiz = new frmTransferDataWizard();

                if (dataWiz.ShowDialog() == DialogResult.OK)
                {
                    if (ofd.ShowDialog() == DialogResult.OK)
                    {
                        TransferMapsToNewBinary(ofd.FileName, resume);
                        TuningReport tuningrep = new TuningReport();
                        tuningrep.ReportTitle = "Data transfer report";
                        tuningrep.DataSource = resume.ResumeTuning;
                        tuningrep.CreateReport();
                        tuningrep.ShowPreview(defaultLookAndFeel1.LookAndFeel);
                        frmInfoBox info = new frmInfoBox("Data was transferred to the target binary");
                    }
                    else
                    {
                        return;
                    }
                }

            }
        }
Example #8
0
        private void btnBinExaminor_ItemClick(object sender, ItemClickEventArgs e)
        {
            // well, get the details on the binary and build a report
            // determine mapsensor type, injector type, turbo type, stage and make a report

            if (m_trionicFile != null)
            {
                if (m_trionicFile.Exists())
                {
                    MapSensorType mapsensor = m_trionicFile.GetMapSensorType(true);
                    DataTable dtReport = new DataTable();//m_trionicFile.CheckForAnomalies();
                    dtReport.Columns.Add("Description");

                    dtReport.Rows.Add("");
                    dtReport.Rows.Add("Report for file: " + Path.GetFileName(m_trionicFileInformation.Filename));
                    dtReport.Rows.Add("");

                    ECUFileType fileType = m_trionicFile.DetermineFileType();
                    if (fileType == ECUFileType.Trionic52File)
                    {
                        dtReport.Rows.Add("File type: Trionic 5.2");
                    }
                    else if (fileType == ECUFileType.Trionic55File)
                    {
                        dtReport.Rows.Add("File type: Trionic 5.5");
                    }
                    Trionic5Properties t5p = m_trionicFile.GetTrionicProperties();
                    //m_trionicFileInformation.deter
                    dtReport.Rows.Add("CPU speed: " + t5p.CPUspeed);
                    dtReport.Rows.Add("Data name: " + t5p.Dataname);
                    dtReport.Rows.Add("Engine type: " + t5p.Enginetype);
                    dtReport.Rows.Add("Partnumber: " + t5p.Partnumber);
                    dtReport.Rows.Add("Software ID: " + t5p.SoftwareID);
                    if (t5p.RAMlocked) dtReport.Rows.Add("SRAM is locked");
                    else dtReport.Rows.Add("SRAM is unlocked");
                    float m_maxBoost = 0;
                    TuningStage _stage = m_trionicFile.DetermineTuningStage(out m_maxBoost);
                    switch (_stage)
                    {
                        case TuningStage.Stock:
                            dtReport.Rows.Add("Stage: stock");
                            break;
                        case TuningStage.Stage1:
                            dtReport.Rows.Add("Stage: 1");
                            break;
                        case TuningStage.Stage2:
                            dtReport.Rows.Add("Stage: 2");
                            break;
                        case TuningStage.Stage3:
                            dtReport.Rows.Add("Stage: 3");
                            dtReport.Rows.Add("\tRequires: 3'' turboback exhaust");
                            dtReport.Rows.Add("\tRequires: BCPR7ES plugs");
                            dtReport.Rows.Add("");
                            break;
                        case TuningStage.Stage4:
                            dtReport.Rows.Add("Stage: 4");
                            dtReport.Rows.Add("\tRequires: 3'' turboback exhaust");
                            dtReport.Rows.Add("\tRequires: upgraded intercooler");
                            dtReport.Rows.Add("\tRequires: BCPR7ES plugs");
                            dtReport.Rows.Add("");
                            break;
                        case TuningStage.Stage5:
                            dtReport.Rows.Add("Stage: 5");
                            dtReport.Rows.Add("\tRequires: 3'' turboback exhaust");
                            dtReport.Rows.Add("\tRequires: upgraded intercooler");
                            dtReport.Rows.Add("\tRequires: upgraded pressureplate");
                            dtReport.Rows.Add("\tRequires: GT28 turbo or better");
                            dtReport.Rows.Add("\tRequires: BCPR7ES plugs");
                            dtReport.Rows.Add("");
                            break;
                        case TuningStage.Stage6:
                            dtReport.Rows.Add("Stage: 6");
                            dtReport.Rows.Add("\tRequires: 3'' turboback exhaust");
                            dtReport.Rows.Add("\tRequires: upgraded intercooler");
                            dtReport.Rows.Add("\tRequires: upgraded pressureplate");
                            dtReport.Rows.Add("\tRequires: upgraded fuelpump");
                            dtReport.Rows.Add("\tRequires: wideband lambda");
                            dtReport.Rows.Add("\tRequires: EGT gauge");
                            dtReport.Rows.Add("\tRequires: GT3071r .64 turbo or better");
                            dtReport.Rows.Add("\tRequires: BCPR8ES plugs");
                            dtReport.Rows.Add("");
                            break;
                        case TuningStage.Stage7:
                            dtReport.Rows.Add("Stage: 7");
                            dtReport.Rows.Add("\tRequires: 3'' turboback exhaust");
                            dtReport.Rows.Add("\tRequires: upgraded intercooler");
                            dtReport.Rows.Add("\tRequires: upgraded pressureplate");
                            dtReport.Rows.Add("\tRequires: upgraded fuelpump");
                            dtReport.Rows.Add("\tRequires: wideband lambda");
                            dtReport.Rows.Add("\tRequires: EGT gauge");
                            dtReport.Rows.Add("\tRequires: GT3071r .86 turbo or better");
                            dtReport.Rows.Add("\tRequires: BCPR8ES plugs");
                            dtReport.Rows.Add("");
                            break;
                        case TuningStage.Stage8:
                            dtReport.Rows.Add("Stage: 8");
                            dtReport.Rows.Add("\tRequires: 3'' turboback exhaust");
                            dtReport.Rows.Add("\tRequires: upgraded intercooler");
                            dtReport.Rows.Add("\tRequires: upgraded pressureplate");
                            dtReport.Rows.Add("\tRequires: upgraded fuelpump");
                            dtReport.Rows.Add("\tRequires: tubular exhaust manifold");
                            dtReport.Rows.Add("\tRequires: wideband lambda");
                            dtReport.Rows.Add("\tRequires: EGT gauge");
                            dtReport.Rows.Add("\tRequires: HX40 hybrid (super) turbo or better");
                            dtReport.Rows.Add("\tRequires: BCPR8ES plugs");
                            dtReport.Rows.Add("");
                            break;
                        case TuningStage.StageX:
                            dtReport.Rows.Add("Stage: X");
                            dtReport.Rows.Add("\tRequires: 3'' turboback exhaust");
                            dtReport.Rows.Add("\tRequires: upgraded intercooler");
                            dtReport.Rows.Add("\tRequires: upgraded pressureplate");
                            dtReport.Rows.Add("\tRequires: upgraded fuelpump");
                            dtReport.Rows.Add("\tRequires: tubular exhaust manifold");
                            dtReport.Rows.Add("\tRequires: wideband lambda");
                            dtReport.Rows.Add("\tRequires: EGT gauge");
                            dtReport.Rows.Add("\tRequires: HX40 hybrid (super) turbo or better");
                            dtReport.Rows.Add("");
                            break;
                    }
                    dtReport.Rows.Add("Boost request peak: " + m_maxBoost.ToString("F2") + " bar");

                    if (mapsensor == MapSensorType.MapSensor25)
                    {
                        dtReport.Rows.Add("Mapsensor type: stock 2.5 bar sensor");
                    }
                    else if (mapsensor == MapSensorType.MapSensor30)
                    {
                        dtReport.Rows.Add("Mapsensor type: 3.0 bar sensor");
                    }
                    else if (mapsensor == MapSensorType.MapSensor35)
                    {
                        dtReport.Rows.Add("Mapsensor type: 3.5 bar sensor");
                    }
                    else if (mapsensor == MapSensorType.MapSensor40)
                    {
                        dtReport.Rows.Add("Mapsensor type: 4.0 bar sensor");
                    }
                    else if (mapsensor == MapSensorType.MapSensor50)
                    {
                        dtReport.Rows.Add("Mapsensor type: 5.0 bar sensor");
                    }
                    // determine injector type from file... ?
                    int injkonst = m_trionicFile.GetSymbolAsInt("Inj_konst!");
                    bool m_E85 = false;
                    int max_injection = m_trionicFile.GetMaxInjection();
                    max_injection *= injkonst;
                    // de maximale waarde uit fuel_map_x_axis! aub
                    byte[] fuelxaxis = m_trionicFile.ReadData((uint)m_trionicFileInformation.GetSymbolAddressFlash("Fuel_map_xaxis!"), (uint)m_trionicFileInformation.GetSymbolLength("Fuel_map_xaxis!"));
                    int max_value_x_axis = Convert.ToInt32(fuelxaxis.GetValue(fuelxaxis.Length - 1));
                    if (mapsensor == MapSensorType.MapSensor30)
                    {
                        max_value_x_axis *= 120;
                        max_value_x_axis /= 100;
                    }
                    else if (mapsensor == MapSensorType.MapSensor35)
                    {
                        max_value_x_axis *= 140;
                        max_value_x_axis /= 100;
                    }
                    else if (mapsensor == MapSensorType.MapSensor40)
                    {
                        max_value_x_axis *= 160;
                        max_value_x_axis /= 100;
                    }
                    else if (mapsensor == MapSensorType.MapSensor50)
                    {
                        max_value_x_axis *= 200;
                        max_value_x_axis /= 100;
                    }
                    //Console.WriteLine("max x: " + max_value_x_axis.ToString());
                    float max_support_boost = max_value_x_axis;
                    max_support_boost /= 100;
                    max_support_boost -= 1;
                    float corr_inj = 1.4F / max_support_boost;
                    corr_inj *= 100;
                    //Console.WriteLine("corr_inj = " + corr_inj.ToString());
                    max_injection *= (int)corr_inj;
                    max_injection /= 100;

                   // dtReport.Rows.Add("Max injection: "+ max_injection.ToString());
                    if (max_injection > 7500) m_E85 = true;
                    if (injkonst > 26)
                    {
                        m_E85 = true;
                    }
                    //TODO: nog extra controleren of er andere indicatoren zijn of er E85 gebruikt wordt
                    // we kunnen dit aan de start verrijkingen zien en aan de ontstekingstijdstippen bij
                    // vollast (ontsteking scherper), let op want dit laatste is bij W/M injectie ook zo.
                    // de een na laatste waarde uit Eftersta_fak! geeft een duidelijke indicatie
                    byte[] eftstafak = m_trionicFile.ReadData((uint)m_trionicFileInformation.GetSymbolAddressFlash("Eftersta_fak!"), (uint)m_trionicFileInformation.GetSymbolLength("Eftersta_fak!"));
                    if (eftstafak.Length == 15)
                    {
                        int eftstafakvalue = Convert.ToInt32(eftstafak.GetValue(13));
                        if (eftstafakvalue > 170) m_E85 = true;
                    }
                    if (m_E85)
                    {
                        max_injection *= 10;
                        max_injection /= 14;
                        dtReport.Rows.Add("Probable fuel: E85");
                    }
                    if (!m_E85)
                    {
                        if (m_maxBoost > 1.1)
                        {
                            dtReport.Rows.Add("Probable fuel: Premium quality petrol");
                        }
                        else
                        {
                            dtReport.Rows.Add("Probable fuel: Petrol");
                        }
                    }
                    // get peak from insp_mat and multiply by injector constant
                    InjectorType inj_type = InjectorType.Stock;
                    if (max_injection > 5000) inj_type = InjectorType.Stock;
                    else if (max_injection > 3500) inj_type = InjectorType.GreenGiants;
                    else if (max_injection > 2000) inj_type = InjectorType.Siemens630Dekas;
                    else if (max_injection > 1565) inj_type = InjectorType.Siemens875Dekas;
                    else inj_type = InjectorType.Siemens1000cc;
                    switch (inj_type)
                    {
                        case InjectorType.Stock:
                            dtReport.Rows.Add("Injectors: stock");
                            break;
                        case InjectorType.GreenGiants:
                            dtReport.Rows.Add("Injectors: Green giants (413 cc/min)");
                            break;
                        case InjectorType.Siemens630Dekas:
                            dtReport.Rows.Add("Injectors: Siemens deka 630 cc/min");
                            break;
                        case InjectorType.Siemens875Dekas:
                            dtReport.Rows.Add("Injectors: Siemens deka 875 cc/min");
                            break;
                        case InjectorType.Siemens1000cc:
                            dtReport.Rows.Add("Injectors: Siemens deka 1000 cc/min");
                            break;
                    }

                    // Add info about T5/T7 valve
                    int frek230 = m_trionicFile.GetSymbolAsInt("Frek_230!");
                    int frek250 = m_trionicFile.GetSymbolAsInt("Frek_250!");
                    if (fileType == ECUFileType.Trionic52File)
                    {
                        if (frek230 == 728 || frek250 == 935)
                        {
                            dtReport.Rows.Add("APC valve type: Trionic 5");
                        }
                        else
                        {
                            dtReport.Rows.Add("APC valve type: Trionic 7");
                        }
                    }
                    else if (fileType == ECUFileType.Trionic55File)
                    {
                        if (frek230 == 90 || frek250 == 70)
                        {
                            dtReport.Rows.Add("APC valve type: Trionic 5");
                        }
                        else
                        {
                            dtReport.Rows.Add("APC valve type: Trionic 7");
                        }
                    }

                    TuningReport tuningrep = new TuningReport();
                    tuningrep.ReportTitle = "Examination report";
                    tuningrep.SetDataSource(dtReport);
                    tuningrep.CreateReport();
                    tuningrep.ShowPreview(defaultLookAndFeel1.LookAndFeel);
                    //tuningrep.ShowReportPreview(defaultLookAndFeel1.LookAndFeel);

                }
            }
        }