Exemplo n.º 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);

                }
            }
        }
Exemplo n.º 2
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;
                }
            }
        }
Exemplo n.º 3
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;

            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 5
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");
                }
            }
        }