Esempio n. 1
0
        public override void SetTrionicOptions(Trionic5Properties properties)
        {
            // save the settings in properties into the binary file
            //TODO: check which entries are changed and which are not.
            // non changed should not be saved
            Trionic5Properties _oriProperties = GetTrionicProperties();
            //        if (_oriProperties.Carmodel != properties.Carmodel) writecarmodel(properties.Carmodel);
            if(_oriProperties.Enginetype != properties.Enginetype) writeenginetype(properties.Enginetype);
            if(_oriProperties.Partnumber != properties.Partnumber) writepartnumber(properties.Partnumber);
            if(_oriProperties.SoftwareID != properties.SoftwareID) writesoftwareid(properties.SoftwareID);
            if(_oriProperties.VSSCode != properties.VSSCode) writeimmocode(properties.VSSCode);
            if(_oriProperties.Dataname != properties.Dataname) writedataname(properties.Dataname);
            if(_oriProperties.VSSactive != properties.VSSactive) SetVSSEnabled(properties.VSSactive);
            if (_oriProperties.Tank_diagnosticsactive != properties.Tank_diagnosticsactive) SetTankDiagnosticsEnabled(properties.Tank_diagnosticsactive);
            if(_oriProperties.AutomaticTransmission != properties.AutomaticTransmission) SetAutoGearboxEnabled(properties.AutomaticTransmission);
            if(_oriProperties.Heatedplates != properties.Heatedplates) SetHeatplatesEnabled(properties.Heatedplates);
            if(_oriProperties.Accelerationsenrichment != properties.Accelerationsenrichment) SetPgmStatusValue(PGMStatusbit.Accelerationsenrichment, properties.Accelerationsenrichment);
            if (_oriProperties.Adaptionofidlecontrol != properties.Adaptionofidlecontrol) SetPgmStatusValue(PGMStatusbit.Adaptionofidlecontrol, properties.Adaptionofidlecontrol);
            if (_oriProperties.Adaptivity != properties.Adaptivity) SetPgmStatusValue(PGMStatusbit.Adaptivity, properties.Adaptivity);
            if (_oriProperties.Adaptivitywithclosedthrottle != properties.Adaptivitywithclosedthrottle) SetPgmStatusValue(PGMStatusbit.Adaptivitywithclosedthrottle, properties.Adaptivitywithclosedthrottle);
            if (_oriProperties.Afterstartenrichment != properties.Afterstartenrichment) SetPgmStatusValue(PGMStatusbit.Afterstartenrichment, properties.Afterstartenrichment);
            if (_oriProperties.APCcontrol != properties.APCcontrol) SetPgmStatusValue(PGMStatusbit.APCcontrol, properties.APCcontrol);
            if (_oriProperties.ConstantinjectiontimeE51 != properties.ConstantinjectiontimeE51) SetPgmStatusValue(PGMStatusbit.ConstantinjectiontimeE51, properties.ConstantinjectiontimeE51);
            if (_oriProperties.Constantinjtimeduringidle != properties.Constantinjtimeduringidle) SetPgmStatusValue(PGMStatusbit.Constantinjtimeduringidle, properties.Constantinjtimeduringidle);
            if (_oriProperties.Decelerationsenleanment != properties.Decelerationsenleanment) SetPgmStatusValue(PGMStatusbit.Decelerationsenleanment, properties.Decelerationsenleanment);
            if (_oriProperties.Enrichmentduringstart != properties.Enrichmentduringstart) SetPgmStatusValue(PGMStatusbit.Enrichmentduringstart, properties.Enrichmentduringstart);
            if (_oriProperties.ETS != properties.ETS) SetPgmStatusValue(PGMStatusbit.ETS, properties.ETS);
            if (_oriProperties.FactortolambdawhenACisengaged != properties.FactortolambdawhenACisengaged) SetPgmStatusValue(PGMStatusbit.FactortolambdawhenACisengaged, properties.FactortolambdawhenACisengaged);
            if (_oriProperties.Factortolambdawhenthrottleopening != properties.Factortolambdawhenthrottleopening) SetPgmStatusValue(PGMStatusbit.Factortolambdawhenthrottleopening, properties.Factortolambdawhenthrottleopening);
            if (_oriProperties.Fueladjustingduringidle != properties.Fueladjustingduringidle) SetPgmStatusValue(PGMStatusbit.Fueladjustingduringidle, properties.Fueladjustingduringidle);
            if (_oriProperties.Fuelcut != properties.Fuelcut) SetPgmStatusValue(PGMStatusbit.Fuelcut, properties.Fuelcut);
            if (_oriProperties.Globaladaption != properties.Globaladaption) SetPgmStatusValue(PGMStatusbit.Globaladaption, properties.Globaladaption);
            if (_oriProperties.Higheridleduringstart != properties.Higheridleduringstart) SetPgmStatusValue(PGMStatusbit.Higheridleduringstart, properties.Higheridleduringstart);
            if (_oriProperties.Idlecontrol != properties.Idlecontrol) SetPgmStatusValue(PGMStatusbit.Idlecontrol, properties.Idlecontrol);
            if (_oriProperties.Interpolationofdelay != properties.Interpolationofdelay) SetPgmStatusValue(PGMStatusbit.Interpolationofdelay, properties.Interpolationofdelay);
            if (_oriProperties.Lambdacontrol != properties.Lambdacontrol) SetPgmStatusValue(PGMStatusbit.Lambdacontrol, properties.Lambdacontrol);
            if (_oriProperties.Lambdacontrolduringidle != properties.Lambdacontrolduringidle) SetPgmStatusValue(PGMStatusbit.Lambdacontrolduringidle, properties.Lambdacontrolduringidle);
            if (_oriProperties.Lambdacontrolduringtransients != properties.Lambdacontrolduringtransients) SetPgmStatusValue(PGMStatusbit.Lambdacontrolduringtransients, properties.Lambdacontrolduringtransients);
            if (_oriProperties.Loadcontrol != properties.Loadcontrol) SetPgmStatusValue(PGMStatusbit.Loadcontrol, properties.Loadcontrol);
            if (_oriProperties.Purge != properties.Purge) SetPgmStatusValue(PGMStatusbit.Purge, properties.Purge);
            if (_oriProperties.Tempcompwithactivelambdacontrol != properties.Tempcompwithactivelambdacontrol) SetPgmStatusValue(PGMStatusbit.Tempcompwithactivelambdacontrol, properties.Tempcompwithactivelambdacontrol);
            if (_oriProperties.Temperaturecompensation != properties.Temperaturecompensation) SetPgmStatusValue(PGMStatusbit.Temperaturecompensation, properties.Temperaturecompensation);
            if (_oriProperties.ThrottleAccRetadjustsimultMY95 != properties.ThrottleAccRetadjustsimultMY95) SetPgmStatusValue(PGMStatusbit.ThrottleAccRetadjustsimultMY95, properties.ThrottleAccRetadjustsimultMY95);
            if (_oriProperties.Usesseparateinjmapduringidle != properties.Usesseparateinjmapduringidle) SetPgmStatusValue(PGMStatusbit.Usesseparateinjmapduringidle, properties.Usesseparateinjmapduringidle);
            if (_oriProperties.WOTenrichment != properties.WOTenrichment) SetPgmStatusValue(PGMStatusbit.WOTenrichment, properties.WOTenrichment);
            if (GetSymbolLength("Pgm_mod!") > 4)
            {
                if (_oriProperties.Loadbufferduringidle != properties.Loadbufferduringidle) SetPgmStatusValue(PGMStatusbit.Loadbufferduringidle, properties.Loadbufferduringidle);
                if (_oriProperties.Constidleignangleduringgearoneandtwo != properties.Constidleignangleduringgearoneandtwo) SetPgmStatusValue(PGMStatusbit.Constidleignangleduringgearoneandtwo, properties.Constidleignangleduringgearoneandtwo);
                if (_oriProperties.NofuelcutR12 != properties.NofuelcutR12) SetPgmStatusValue(PGMStatusbit.NofuelcutR12, properties.NofuelcutR12);
                if (_oriProperties.Airpumpcontrol != properties.Airpumpcontrol) SetPgmStatusValue(PGMStatusbit.Airpumpcontrol, properties.Airpumpcontrol);
                if (_oriProperties.Normalasperatedengine != properties.Normalasperatedengine) SetPgmStatusValue(PGMStatusbit.Normalasperatedengine, properties.Normalasperatedengine);
                if (_oriProperties.Knockregulatingdisabled != properties.Knockregulatingdisabled) SetPgmStatusValue(PGMStatusbit.Knockregulatingdisabled, properties.Knockregulatingdisabled);
                if (_oriProperties.Constantangle != properties.Constantangle) SetPgmStatusValue(PGMStatusbit.Constantangle, properties.Constantangle);
                if (_oriProperties.PurgevalveMY94 != properties.PurgevalveMY94) SetPgmStatusValue(PGMStatusbit.PurgevalveMY94, properties.PurgevalveMY94);
            }
            if(_oriProperties.RAMlocked != properties.RAMlocked) writeramlockedflag(properties.RAMlocked);
            if (_oriProperties.SecondO2Enable != properties.SecondO2Enable) writesecondo2sensorenabled(properties.SecondO2Enable);
            if (_oriProperties.InjectorType != properties.InjectorType)
            {
                //TODO: we need to do something here ... injector indicator was changed.. ask user?
                // the injector type was changed, we need to check injector constant to verify settings (or better yet, injection duration)
                // if the injector duration is off, we need to do our magic and determine new settings based on old->new injector type

                WriteInjectorTypeMarker(properties.InjectorType);
            }
            if (_oriProperties.TurboType != properties.TurboType)
            {
                //TODO: we need to do something here ... turbo type changed, ask user?
                WriteTurboTypeMarker(properties.TurboType);
                Trionic5Tuner tun = new Trionic5Tuner();

                tun.LiftBoostRequestForTurboType(properties.TurboType);
            }
            if (_oriProperties.TuningStage != properties.TuningStage)
            {
                //TODO: we need to do something here ... tuning stage changed, ask user?
                // well, we might need to run the tuning wizard to set it to stage properties.TuningStage
                /*TuningStage stage = DetermineTuningStage();
                if (stage != properties.TuningStage)
                {
                    Trionic5Tuner tun = new Trionic5Tuner();
                    tun.TuneFileToStage((int)properties.TuningStage, m_currentFile, this, m_fileInfo, true);
                    Console.WriteLine("Silently tuned to stage " + properties.TuningStage.ToString());
                }*/
                WriteTuningStageMarker(properties.TuningStage);
            }
            if (_oriProperties.SyncDateTime != properties.SyncDateTime) SetMemorySyncDate(properties.SyncDateTime);
            if (_oriProperties.MapSensorType != properties.MapSensorType)
            {
                //TODO: we need to do something here ... mapsensor type changed, ask user?
                // we need to check settings in the binary here to verify whether the bin is already set for the chosen mapsensor type
                // if not, we need to do our magic here and update the bin to the new mapsensor type
                /*MapSensorType _detectedType = DetermineMapSensorType();
                if (_detectedType != properties.MapSensorType)
                {
                    // run a wizard in the background to match the selected mapsensor type
                    Trionic5Tuner tun = new Trionic5Tuner();
                    //tun.
                    //Console.WriteLine("Altering mapsensor type, running wizard " + _detectedType.ToString() + " to " + properties.MapSensorType.ToString());
                    tun.ConvertFileToThreeBarMapSensor(m_fileInfo, _detectedType, properties.MapSensorType);
                }*/
                WriteThreeBarConversionMarker(m_currentFile, properties.MapSensorType);
            }
            if (_oriProperties.HardcodedRPMLimit != properties.HardcodedRPMLimit)
            {
                SetHardcodedRPMLimit(m_currentFile, properties.HardcodedRPMLimit);
            }
            updatechecksum(m_currentFile);
        }
Esempio n. 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);

                }
            }
        }
Esempio n. 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;
                }
            }
        }
Esempio n. 4
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;

            }
        }
Esempio n. 5
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);
            }
        }
Esempio n. 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");
                }
            }
        }
Esempio n. 7
0
        private void btnFreeTune_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // 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();
            Trionic5Properties 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();
                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!";
                }
                frmInfoBox info = new frmInfoBox(text);
            }
        }
Esempio n. 8
0
        private void btnChangeRegkonMatRange_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Trionic5Tuner tuner = new Trionic5Tuner();
            tuner.AutoUpdateChecksum = m_appSettings.AutoChecksum;
            //Make this stuff user selectable!
            frmBoostBiasWizard boostrangeWiz = new frmBoostBiasWizard();
            int originalStep = m_trionicFile.GetRegulationDivisorValue();
            boostrangeWiz.RangeStep = originalStep;
            //boostrangeWiz.HardcodedRPMLimit = m_trionicFile.GetHardcodedRPMLimit(m_trionicFileInformation.Filename);
            if (boostrangeWiz.ShowDialog() == DialogResult.OK)
            {
                if (tuner.SetBoostRegulationDivisor(boostrangeWiz.RangeStep, originalStep, m_trionicFileInformation))
                {
                    // save
                    m_trionicFile.SetRegulationDivisorValue(boostrangeWiz.RangeStep);
                    //m_trionicFile.SetHardcodedRPMLimit(m_trionicFileInformation.Filename, boostrangeWiz.HardcodedRPMLimit);
                    frmInfoBox info = new frmInfoBox("Boost bias range has been changed");
                }
                m_trionicFile.UpdateChecksum(); //<GS-28112009>

            }
        }
Esempio n. 9
0
        private void btnBoostAdaptionWizard_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // <GS-10012011> create new wizard here

            Trionic5Tuner tuner = new Trionic5Tuner();
            tuner.AutoUpdateChecksum = m_appSettings.AutoChecksum;
            //Make this stuff user selectable!
            frmBoostAdaptionWizard boostAdaptWiz = new frmBoostAdaptionWizard();
            boostAdaptWiz.ManualRPMLow = m_trionicFile.GetManualRpmLow();
            boostAdaptWiz.ManualRPMHigh = m_trionicFile.GetManualRpmHigh();
            boostAdaptWiz.AutomaticRPMLow = m_trionicFile.GetAutoRpmLow();
            boostAdaptWiz.AutomaticRPMHigh = m_trionicFile.GetAutoRpmHigh();
            boostAdaptWiz.BoostError = m_trionicFile.GetMaxBoostError();
            if (boostAdaptWiz.ShowDialog() == DialogResult.OK)
            {
                tuner.Ori_boostError = m_trionicFile.GetMaxBoostError();
                tuner.Ori_rpmHighAut = m_trionicFile.GetAutoRpmHigh();
                tuner.Ori_rpmHighManual = m_trionicFile.GetManualRpmHigh();
                tuner.Ori_rpmLowAut = m_trionicFile.GetAutoRpmLow();
                tuner.Ori_rpmLowManual = m_trionicFile.GetManualRpmLow();
                if (tuner.SetBoostAdaptionParameters(boostAdaptWiz.ManualRPMLow, boostAdaptWiz.ManualRPMHigh, boostAdaptWiz.AutomaticRPMLow, boostAdaptWiz.AutomaticRPMHigh, boostAdaptWiz.BoostError, m_trionicFileInformation))
                {
                    // save
                    m_trionicFile.SetAutoRpmHigh(boostAdaptWiz.AutomaticRPMHigh);
                    m_trionicFile.SetAutoRpmLow(boostAdaptWiz.AutomaticRPMLow);
                    m_trionicFile.SetManualRpmHigh(boostAdaptWiz.ManualRPMHigh);
                    m_trionicFile.SetManualRpmLow(boostAdaptWiz.ManualRPMLow);
                    m_trionicFile.SetMaxBoostError(boostAdaptWiz.BoostError);
                    frmInfoBox info = new frmInfoBox("Boost adaption ranges were set");
                }
                m_trionicFile.UpdateChecksum(); //<GS-28112009>

            }
        }
Esempio n. 10
0
 private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
 {
     // user change injector type
     if (!_progChanges)
     {
         // calculate the new proposed injector constant
         _injectorType = (InjectorType)comboBoxEdit1.SelectedIndex;
         if (_oriinjectorType == _injectorType)
         {
             _injectorConstant = _oriinjectorConstant;
         }
         else
         {
             Trionic5Tuner _tun = new Trionic5Tuner();
             int diffInInjConstant = _tun.DetermineDifferenceInInjectorConstant(_oriinjectorType, _injectorType);
             //<GS-04082010> the diff percentage seemed to cause trouble!
             /*
             float percentageToCompensate = _tun.DetermineDifferenceInInjectorConstantPercentage(_oriinjectorType, _injectorType);
             // substract difference
             _injectorConstant = (int)Math.Round(((float)_oriinjectorConstant * percentageToCompensate));
             _injectorConstant++;*/
             _injectorConstant = _oriinjectorConstant - diffInInjConstant;
         }
         //<GS-17052010> _injectorConstant = _oriinjectorConstant - diffInInjConstant;
         //labelControl3.Text = _injectorConstant.ToString();
         spinEdit1.EditValue = _injectorConstant;
         // set the correction factor for the selected injectortype
         SetInjectorBatteryCorrectionMap(_injectorType);
         SetCrankFactor(_injectorType);
     }
 }