Example #1
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);
            }
        }
Example #2
0
 private void Init(string[] val)
 {
     if (val.Length != _cCountOfParams)
     {
         throw new ArgumentException(_cCountOfParamsErrorString + _cCountOfParams);
     }
     try
     {
         _frame  = val[0];
         _engine = base.EngineCollection[val[1]];
         val[2]  = val[2].ToLower();
         if (val[2].Contains("top"))
         {
             _injType = InjectorType.TopFeed;
         }
         else if (val[2].Contains("side"))
         {
             _injType = InjectorType.SideFeed;
         }
         else
         {
             _injType = InjectorType.NotSpecified;
         }
         _injCC    = Int32.Parse(val[3]);
         _fuelPump = Int32.Parse(val[4]);
     }
     catch (Exception ex)
     {
         throw new ArgumentException("Invalid prams", ex);
     }
 }
Example #3
0
 /// <summary>Creates a new instance of this class</summary>
 /// <param name="train">The root train</param>
 /// <param name="type">The type of injector</param>
 internal Injector(Train train, InjectorType type)
 {
     this.Type      = type;
     this.Train     = train;
     this.WaterRate = 100;
     this.SteamRate = 100;
 }
Example #4
0
        public static Injector Factory(InjectorType injectorType)
        {
            switch (injectorType)
            {
            case InjectorType.CREATE_REMOTE_THREAD:
                return(new Injector(new CreateRemoteThreadMethod()));

            // case InjectorType.NT_CREATE_THREAD_EX:
            //return new Injector(new NtCreateThreadExInjectionMethod());

            default:
                throw new NotSupportedException(string.Format("Unsupported injection method: {0}", injectorType));
            }
        }
Example #5
0
        private void SetCrankFactor(InjectorType _type)
        {
            switch (_type)
            {
            case InjectorType.Stock:
            case InjectorType.GreenGiants:
                spinEdit2.EditValue = (decimal)9;
                break;

            case InjectorType.Siemens630Dekas:
                spinEdit2.EditValue = (decimal)6;
                break;

            case InjectorType.Siemens875Dekas:
                spinEdit2.EditValue = (decimal)4;
                break;

            case InjectorType.Siemens1000cc:
                spinEdit2.EditValue = (decimal)3.5;
                break;
            }
        }
Example #6
0
 private void Init(string[] val)
 {
     if (val.Length != _cCountOfParams)
         throw new ArgumentException(_cCountOfParamsErrorString + _cCountOfParams);
     try
     {
         _frame = val[0];
         _engine = base.EngineCollection[val[1]];
         val[2] = val[2].ToLower();
         if (val[2].Contains("top"))
             _injType = InjectorType.TopFeed;
         else if (val[2].Contains("side"))
             _injType = InjectorType.SideFeed;
         else
             _injType = InjectorType.NotSpecified;
         _injCC = Int32.Parse(val[3]);
         _fuelPump = Int32.Parse(val[4]);
     }
     catch (Exception ex)
     {
         throw new ArgumentException("Invalid prams", ex);
     }
 }
Example #7
0
        /* public byte[] GetBatteryCorrectionMap(float[] correctionFactors)
        {
            byte[] retval = new byte[22];
            int bcount = 0;
            for (int i = 0; i < 11; i++)
            {
                float val = GetBatteryCorrection(i) / 0.004F;
                int ival = Convert.ToInt32(val);
                byte b1 = (byte)(ival / 256);
                byte b2 = (byte)(ival - (int)b1 * 256);
                retval[bcount++] = b1;
                retval[bcount++] = b2;
            }
            return retval;

        }*/
        private void SetInjectorBatteryCorrectionMap(IECUFile m_file, InjectorType injectorType)
        {
            byte[] batt_korr_tab = new byte[22]; // 11 values, first one is for 15 volt
            float tempvalue = 0;
            switch (injectorType)
            {
                case InjectorType.Stock:
                case InjectorType.Siemens875Dekas:
                case InjectorType.Siemens1000cc:
                    batt_korr_tab.SetValue((byte)0x00, 0); // 15 volt = 0.59
                    batt_korr_tab.SetValue((byte)0x93, 1);
                    batt_korr_tab.SetValue((byte)0x00, 2); // 14 volt = 0.77
                    batt_korr_tab.SetValue((byte)0xC0, 3);
                    batt_korr_tab.SetValue((byte)0x00, 4); // 13 volt = 0.78
                    batt_korr_tab.SetValue((byte)0xC3, 5);
                    batt_korr_tab.SetValue((byte)0x00, 6); // 12 volt = 0.94
                    batt_korr_tab.SetValue((byte)0xEB, 7);
                    batt_korr_tab.SetValue((byte)0x01, 8); // 11 volt = 1.28
                    batt_korr_tab.SetValue((byte)0x40, 9);
                    batt_korr_tab.SetValue((byte)0x01, 10); // 10 volt = 1.50
                    batt_korr_tab.SetValue((byte)0x77, 11);
                    batt_korr_tab.SetValue((byte)0x01, 12); // 9 volt = 1.85
                    batt_korr_tab.SetValue((byte)0xCE, 13);
                    batt_korr_tab.SetValue((byte)0x02, 14); // 8 volt = 2.32
                    batt_korr_tab.SetValue((byte)0x44, 15);
                    batt_korr_tab.SetValue((byte)0x03, 16); // 7 volt = 3.73
                    batt_korr_tab.SetValue((byte)0xA4, 17);
                    batt_korr_tab.SetValue((byte)0x03, 18); // 6 volt = 3.73
                    batt_korr_tab.SetValue((byte)0xA4, 19);
                    batt_korr_tab.SetValue((byte)0x03, 20); // 5 volt = 3.73
                    batt_korr_tab.SetValue((byte)0xA4, 21);
                    break;
                case InjectorType.GreenGiants:
                    batt_korr_tab.SetValue((byte)0x00, 0); // 15 volt = 0.894
                    batt_korr_tab.SetValue((byte)0xDF, 1);
                    batt_korr_tab.SetValue((byte)0x00, 2); // 14 volt = 1.003
                    batt_korr_tab.SetValue((byte)0xFA, 3);
                    batt_korr_tab.SetValue((byte)0x01, 4); // 13 volt = 1.15
                    batt_korr_tab.SetValue((byte)0x1F, 5);
                    batt_korr_tab.SetValue((byte)0x01, 6); // 12 volt = 1.308
                    batt_korr_tab.SetValue((byte)0x47, 7);
                    batt_korr_tab.SetValue((byte)0x01, 8); // 11 volt = 1.521
                    batt_korr_tab.SetValue((byte)0x7C, 9);
                    batt_korr_tab.SetValue((byte)0x01, 10); // 10 volt = 1.768
                    batt_korr_tab.SetValue((byte)0xBA, 11);
                    batt_korr_tab.SetValue((byte)0x02, 12); // 9 volt = 2.102
                    batt_korr_tab.SetValue((byte)0x0D, 13);
                    batt_korr_tab.SetValue((byte)0x02, 14); // 8 volt = 2.545
                    batt_korr_tab.SetValue((byte)0x7C, 15);
                    batt_korr_tab.SetValue((byte)0x03, 16); // 7 volt = 3.216
                    batt_korr_tab.SetValue((byte)0x24, 17);
                    batt_korr_tab.SetValue((byte)0x04, 18); // 6 volt = 4.142
                    batt_korr_tab.SetValue((byte)0x0B, 19);
                    batt_korr_tab.SetValue((byte)0x05, 20); // 5 volt = 5.45
                    batt_korr_tab.SetValue((byte)0x52, 21);
                    break;
                case InjectorType.Siemens630Dekas:
                    batt_korr_tab.SetValue((byte)0x00, 0); // 15 volt = 0.33
                    batt_korr_tab.SetValue((byte)0x52, 1);
                    batt_korr_tab.SetValue((byte)0x00, 2); // 14 volt = 0.433
                    batt_korr_tab.SetValue((byte)0x6C, 3);
                    batt_korr_tab.SetValue((byte)0x00, 4); // 13 volt = 0.548
                    batt_korr_tab.SetValue((byte)0x89, 5);
                    batt_korr_tab.SetValue((byte)0x00, 6); // 12 volt = 0.673
                    batt_korr_tab.SetValue((byte)0xA8, 7);
                    batt_korr_tab.SetValue((byte)0x00, 8); // 11 volt = 0.802
                    batt_korr_tab.SetValue((byte)0xC8, 9);
                    batt_korr_tab.SetValue((byte)0x00, 10); // 10 volt = 0.974
                    batt_korr_tab.SetValue((byte)0xF3, 11);
                    batt_korr_tab.SetValue((byte)0x01, 12); // 9 volt = 1.208
                    batt_korr_tab.SetValue((byte)0x2E, 13);
                    batt_korr_tab.SetValue((byte)0x01, 14); // 8 volt = 1.524
                    batt_korr_tab.SetValue((byte)0x7D, 15);
                    batt_korr_tab.SetValue((byte)0x01, 16); // 7 volt = 2.023
                    batt_korr_tab.SetValue((byte)0xF9, 17);
                    batt_korr_tab.SetValue((byte)0x02, 18); // 6 volt = 2.74
                    batt_korr_tab.SetValue((byte)0xAD, 19);
                    batt_korr_tab.SetValue((byte)0x03, 20); // 5 volt = 3.6
                    batt_korr_tab.SetValue((byte)0x84, 21);
                    break;

            }
            // write to batt_korr_tab
            m_file.WriteData(batt_korr_tab, (uint)m_file.GetFileInfo().GetSymbolAddressFlash("Batt_korr_tab!"));
        }
Example #8
0
 private void SetInjectorBatteryCorrectionMapOld(InjectorType injectorType)
 {
     // set battery correction voltage maps
     /*
      * Siemens deka 875         Siemens Deka 630      stock
      * Batt_korr_table
         15v = 0.62              15v=0.17ms          0.59
         14v = 0.73              14v=0.28ms          0.77
         13v = 0.85              13v=0.38ms          0.78
         12v = 1.00              12v=0.50ms          0.94
         11v = 1.20              11v=0.64ms          1.28
         10v = 1.46              10v=0.83ms          1.50
     */
 }
 private void SetCrankFactor(InjectorType _type)
 {
     switch (_type)
     {
         case InjectorType.Stock:
         case InjectorType.GreenGiants:
             spinEdit2.EditValue = (decimal)9;
             break;
         case InjectorType.Siemens630Dekas:
             spinEdit2.EditValue = (decimal)6;
             break;
         case InjectorType.Siemens875Dekas:
             spinEdit2.EditValue = (decimal)4;
             break;
         case InjectorType.Siemens1000cc:
             spinEdit2.EditValue = (decimal)3.5;
             break;
     }
 }
Example #10
0
        public float DetermineDifferenceInInjectorConstantPercentage(InjectorType injectorTypeFrom, InjectorType injectorTypeTo)
        {
            float retval = 1;
            // Stock = 21
            // Green giants = 20 (minus 1)
            // Siemens 630 = 16 (minus 5)
            // Siemens 875 = 13 (minus 8)
            // Siemens 1000 = 11 (minus 10)

            switch (injectorTypeFrom)
            {
                case InjectorType.Stock:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.GreenGiants:
                            retval = 0.84F; // from stock to GG
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = 0.55F; // from stock to 630s
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = 0.40F; // from stock to 875s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 0.35F; // from stock to 1000s
                            break;
                    }
                    break;
                case InjectorType.GreenGiants:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = 1.2F; // from gg to stock ????
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = 0.66F; // from GG to 630s
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = 0.48F; // from GG to 875s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 0.42F; // from GG to 1000s
                            break;
                    }
                    break;
                case InjectorType.Siemens630Dekas:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = 1.82F; // from 630s to stock ????
                            break;
                        case InjectorType.GreenGiants:
                            retval = 1.53F; // from 630s to GG
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = 0.72F; // from 630s to 875s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 0.63F; // from 630s to 1000s
                            break;
                    }
                    break;
                case InjectorType.Siemens875Dekas:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = 2.53F; // from 875s to stock ????
                            break;
                        case InjectorType.GreenGiants:
                            retval = 2.12F; // from 875s to GG
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = 1.39F; // from 875s to 630s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 0.875F; // from 875s to 1000s
                            break;
                    }
                    break;
                case InjectorType.Siemens1000cc:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = 2.89F; // from 1000s to stock ????
                            break;
                        case InjectorType.GreenGiants:
                            retval = 2.42F; // from 1000s to GG
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = 1.59F; // from 1000s to 630s
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = 1.14F; // from 1000s to 875s
                            break;
                    }
                    break;
            }

            return retval;
        }
Example #11
0
        private float[] CreateDefaultTargetAFRMap(InjectorType injectorType)
        {
            int columns = 0;
            int rows = 0;
            Trionic5Properties props = m_TrionicFile.GetTrionicProperties();

            m_TrionicFile.GetMapMatrixWitdhByName(m_TrionicFile.GetFileInfo().GetInjectionMap(), out columns, out rows);
            if (columns != 0)
            {
                float[] map = new float[rows * columns];

                int[] fuel_xaxis = m_TrionicFile.GetMapXaxisValues(m_TrionicFile.GetFileInfo().GetInjectionMap());
                int[] fuel_yaxis = m_TrionicFile.GetMapYaxisValues(m_TrionicFile.GetFileInfo().GetInjectionMap());

                for (int rpmtel = 0; rpmtel < fuel_yaxis.Length; rpmtel++)
                {
                    for (int maptel = 0; maptel < fuel_xaxis.Length; maptel++)
                    {
                        int mapvalue = (int)fuel_xaxis.GetValue(maptel);
                        int rpmvalue = (int)fuel_yaxis.GetValue(rpmtel);
                        //rpmvalue += (int)fuel_yaxis.GetValue(rpmtel + 1);
                        //rpmvalue *=10;
                        float afrtarget = 14.7F;
                        // now, decrease as mapvalue increases
                        // top MAP should be ~12.0
                        //if (mapvalue > 100)
                        {
                            // positive boost

                            afrtarget -= 3.0F * (float)maptel / (float)columns;
                            // compensate for peak torque (+/- 3000 rpm)
                            if (rpmvalue > 4000) rpmvalue = 4000 - rpmvalue % 4000;
                            if (rpmvalue < 0) rpmvalue = 0;

                            afrtarget += Math.Abs((4000 - (float)rpmvalue) / 4000);
                        }

                        /*else */if (mapvalue < 30)
                        {
                            // vacuum, 15.0
                            afrtarget = 15.0F;
                        }
                        if (props.Lambdacontrol == false)
                        {
                            if (mapvalue < 70 && rpmvalue < 1750) afrtarget = 13.5F;
                            if (rpmvalue < 1000) afrtarget = 13.5F;
                        }
                        if (props.Lambdacontrolduringidle == false)
                        {
                            if (rpmvalue < 1000) afrtarget = 13.5F;
                        }
                        /*if (injectorType == InjectorType.Siemens630Dekas || injectorType == InjectorType.Siemens875Dekas || injectorType == InjectorType.Siemens1000cc)
                        {
                            // because of the opening times of the injector, make the target mixture richer here.
                            if (mapvalue < 70 && rpmvalue < 1750) afrtarget = 13.5F;
                            if (rpmvalue < 1000) afrtarget = 13.5F;
                        }*/
                        // if in closed loop, always 14.7
                        if (props.Lambdacontrol)
                        {
                            if (IsCellClosedLoop(mapvalue, rpmtel))
                            {
                                if (props.Lambdacontrolduringidle == false && rpmvalue < 1000) ;
                                else afrtarget = 14.7F;
                            }
                        }
                        map.SetValue(afrtarget, rpmtel * columns + maptel);
                    }
                }
                return map;
            }
            float[] map2 = new float[1];
            map2.SetValue(0F, 0);
            return map2;
        }
Example #12
0
 public void CreateTargetMap(InjectorType injectorType)
 {
     targetmap = CreateDefaultTargetAFRMap(injectorType);
     SaveTargetAFRMap(Path.GetFileNameWithoutExtension(m_TrionicFile.GetFileInfo().Filename) + "-targetafr.afr", targetmap);
 }
Example #13
0
 public override void WriteInjectorTypeMarker(InjectorType injectorType)
 {
     int address = m_fileInfo.Filelength - 0x1FE;
     if (address > 0)
     {
         writebyteinfile(m_currentFile, address, Convert.ToByte((int)injectorType));
     }
 }
        private void UpdateMaxima(TurboType turbo, InjectorType injectors, MapSensorType mapSensor)
        {
            switch (mapSensor)
            {
            case MapSensorType.MapSensor25:
                // max achievable 400Nm / 1.45 bar
                if (injectors == InjectorType.Stock)
                {
                    spinEdit1.Properties.MaxValue = 400;
                    spinEdit2.Properties.MaxValue = (decimal)1.30;
                }
                else
                {
                    spinEdit1.Properties.MaxValue = 450;
                    spinEdit2.Properties.MaxValue = (decimal)1.45;
                }
                break;

            case MapSensorType.MapSensor30:
                switch (injectors)
                {
                case InjectorType.Stock:
                    spinEdit1.Properties.MaxValue = 400;
                    spinEdit2.Properties.MaxValue = (decimal)1.30;
                    break;

                case InjectorType.GreenGiants:
                    switch (turbo)
                    {
                    case TurboType.Stock:
                    case TurboType.TD0415T:
                        spinEdit1.Properties.MaxValue = 450;
                        spinEdit2.Properties.MaxValue = (decimal)1.45;
                        break;

                    case TurboType.GT28BB:
                    case TurboType.GT28RS:
                    case TurboType.TD0419T:
                        spinEdit1.Properties.MaxValue = 550;
                        spinEdit2.Properties.MaxValue = (decimal)1.70;
                        break;

                    case TurboType.GT3071R:
                    case TurboType.HX35w:
                        spinEdit1.Properties.MaxValue = 550;
                        spinEdit2.Properties.MaxValue = (decimal)1.50;
                        break;

                    case TurboType.HX40w:
                    case TurboType.S400SX371:
                        spinEdit1.Properties.MaxValue = 550;
                        spinEdit2.Properties.MaxValue = (decimal)1.40;
                        break;
                    }
                    break;

                case InjectorType.Siemens630Dekas:
                    // 3.0 bar sensor, 630cc injectors -> max 600Nm
                    switch (turbo)
                    {
                    case TurboType.Stock:
                    case TurboType.TD0415T:
                        spinEdit1.Properties.MaxValue = 450;
                        spinEdit2.Properties.MaxValue = (decimal)1.45;
                        break;

                    case TurboType.GT28BB:
                    case TurboType.GT28RS:
                    case TurboType.TD0419T:
                        spinEdit1.Properties.MaxValue = 580;
                        spinEdit2.Properties.MaxValue = (decimal)1.75;
                        break;

                    case TurboType.GT3071R:
                    case TurboType.HX35w:
                        spinEdit1.Properties.MaxValue = 600;
                        spinEdit2.Properties.MaxValue = (decimal)1.80;
                        break;

                    case TurboType.HX40w:
                    case TurboType.S400SX371:
                        spinEdit1.Properties.MaxValue = 600;
                        spinEdit2.Properties.MaxValue = (decimal)1.70;
                        break;
                    }
                    break;

                case InjectorType.Siemens875Dekas:
                case InjectorType.Siemens1000cc:
                    // 3.0 bar sensor, 630cc injectors -> limit to turbo only
                    switch (turbo)
                    {
                    case TurboType.Stock:
                    case TurboType.TD0415T:
                        spinEdit1.Properties.MaxValue = 450;
                        spinEdit2.Properties.MaxValue = (decimal)1.45;
                        break;

                    case TurboType.GT28BB:
                    case TurboType.GT28RS:
                    case TurboType.TD0419T:
                        spinEdit1.Properties.MaxValue = 580;
                        spinEdit2.Properties.MaxValue = (decimal)1.75;
                        break;

                    case TurboType.GT3071R:
                    case TurboType.HX35w:
                        spinEdit1.Properties.MaxValue = 620;
                        spinEdit2.Properties.MaxValue = (decimal)1.9;
                        break;

                    case TurboType.HX40w:
                    case TurboType.S400SX371:
                        spinEdit1.Properties.MaxValue = 670;
                        spinEdit2.Properties.MaxValue = (decimal)2.0;
                        break;
                    }
                    break;
                }
                break;

            case MapSensorType.MapSensor35:
            case MapSensorType.MapSensor40:
            case MapSensorType.MapSensor50:
                switch (injectors)
                {
                case InjectorType.Stock:
                    spinEdit1.Properties.MaxValue = 400;
                    spinEdit2.Properties.MaxValue = (decimal)1.30;
                    break;

                case InjectorType.GreenGiants:
                    switch (turbo)
                    {
                    case TurboType.Stock:
                    case TurboType.TD0415T:
                        spinEdit1.Properties.MaxValue = 450;
                        spinEdit2.Properties.MaxValue = (decimal)1.45;
                        break;

                    case TurboType.GT28BB:
                    case TurboType.GT28RS:
                    case TurboType.TD0419T:
                        spinEdit1.Properties.MaxValue = 550;
                        spinEdit2.Properties.MaxValue = (decimal)1.70;
                        break;

                    case TurboType.GT3071R:
                    case TurboType.HX35w:
                        spinEdit1.Properties.MaxValue = 550;
                        spinEdit2.Properties.MaxValue = (decimal)1.50;
                        break;

                    case TurboType.HX40w:
                    case TurboType.S400SX371:
                        spinEdit1.Properties.MaxValue = 550;
                        spinEdit2.Properties.MaxValue = (decimal)1.40;
                        break;
                    }
                    break;

                case InjectorType.Siemens630Dekas:
                    // 3.0 bar sensor, 630cc injectors -> max 600Nm
                    switch (turbo)
                    {
                    case TurboType.Stock:
                    case TurboType.TD0415T:
                        spinEdit1.Properties.MaxValue = 450;
                        spinEdit2.Properties.MaxValue = (decimal)1.45;
                        break;

                    case TurboType.GT28BB:
                    case TurboType.GT28RS:
                    case TurboType.TD0419T:
                        spinEdit1.Properties.MaxValue = 580;
                        spinEdit2.Properties.MaxValue = (decimal)1.75;
                        break;

                    case TurboType.GT3071R:
                    case TurboType.HX35w:
                        spinEdit1.Properties.MaxValue = 600;
                        spinEdit2.Properties.MaxValue = (decimal)1.80;
                        break;

                    case TurboType.HX40w:
                    case TurboType.S400SX371:
                        spinEdit1.Properties.MaxValue = 600;
                        spinEdit2.Properties.MaxValue = (decimal)1.70;
                        break;
                    }
                    break;

                case InjectorType.Siemens875Dekas:
                case InjectorType.Siemens1000cc:
                    // 3.0 bar sensor, 630cc injectors -> limit to turbo only
                    switch (turbo)
                    {
                    case TurboType.Stock:
                    case TurboType.TD0415T:
                        spinEdit1.Properties.MaxValue = 450;
                        spinEdit2.Properties.MaxValue = (decimal)1.45;
                        break;

                    case TurboType.GT28BB:
                    case TurboType.GT28RS:
                    case TurboType.TD0419T:
                        spinEdit1.Properties.MaxValue = 580;
                        spinEdit2.Properties.MaxValue = (decimal)1.75;
                        break;

                    case TurboType.GT3071R:
                    case TurboType.HX35w:
                        spinEdit1.Properties.MaxValue = 620;
                        spinEdit2.Properties.MaxValue = (decimal)1.9;
                        break;

                    case TurboType.HX40w:
                    case TurboType.S400SX371:
                        spinEdit1.Properties.MaxValue = 670;
                        spinEdit2.Properties.MaxValue = (decimal)2.2;
                        break;
                    }
                    break;
                }
                break;
            }
            UpdateStage();
        }
 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);
     }
 }
Example #16
0
 //abstract public int GetInjectorType();
 //abstract public void SetInjectorType(InjectorType type);
 public abstract void WriteInjectorTypeMarker(InjectorType injectorType);
Example #17
0
        private void SetInjectorBatteryCorrectionMap(InjectorType injectorType)
        {
            float tempvalue = 0;

            switch (injectorType)
            {
            case InjectorType.Stock:
            case InjectorType.Siemens875Dekas:
            case InjectorType.Siemens1000cc:
                tempvalue       = 3.73F;
                textEdit12.Text = tempvalue.ToString("F3");      // 5 volt
                textEdit13.Text = tempvalue.ToString("F3");      // 6 volt
                textEdit14.Text = tempvalue.ToString("F3");      // 7 volt
                tempvalue       = 2.32F;
                textEdit15.Text = tempvalue.ToString("F3");      // 8 volt
                tempvalue       = 1.85F;
                textEdit16.Text = tempvalue.ToString("F3");      // 9 volt
                tempvalue       = 1.50F;
                textEdit17.Text = tempvalue.ToString("F3");      // 10 volt
                tempvalue       = 1.28F;
                textEdit18.Text = tempvalue.ToString("F3");      // 11 volt
                tempvalue       = 0.94F;
                textEdit19.Text = tempvalue.ToString("F3");      // 12 volt
                tempvalue       = 0.78F;
                textEdit20.Text = tempvalue.ToString("F3");      // 13 volt
                tempvalue       = 0.77F;
                textEdit21.Text = tempvalue.ToString("F3");      // 14 volt
                tempvalue       = 0.59F;
                textEdit22.Text = tempvalue.ToString("F3");      // 15 volt
                break;

            case InjectorType.GreenGiants:
                tempvalue       = 5.45F;
                textEdit12.Text = tempvalue.ToString("F3");      // 5 volt
                tempvalue       = 4.142F;
                textEdit13.Text = tempvalue.ToString("F3");      // 6 volt
                tempvalue       = 3.216F;
                textEdit14.Text = tempvalue.ToString("F3");      // 7 volt
                tempvalue       = 2.545F;
                textEdit15.Text = tempvalue.ToString("F3");      // 8 volt
                tempvalue       = 2.102F;
                textEdit16.Text = tempvalue.ToString("F3");      // 9 volt
                tempvalue       = 1.768F;
                textEdit17.Text = tempvalue.ToString("F3");      // 10 volt
                tempvalue       = 1.521F;
                textEdit18.Text = tempvalue.ToString("F3");      // 11 volt
                tempvalue       = 1.308F;
                textEdit19.Text = tempvalue.ToString("F3");      // 12 volt
                tempvalue       = 1.15F;
                textEdit20.Text = tempvalue.ToString("F3");      // 13 volt
                tempvalue       = 1.003F;
                textEdit21.Text = tempvalue.ToString("F3");      // 14 volt
                tempvalue       = 0.894F;
                textEdit22.Text = tempvalue.ToString("F3");      // 15 volt
                break;

            case InjectorType.Siemens630Dekas:
                tempvalue       = 3.6F;
                textEdit12.Text = tempvalue.ToString("F3");      // 5 volt
                tempvalue       = 2.74F;
                textEdit13.Text = tempvalue.ToString("F3");      // 6 volt
                tempvalue       = 2.023F;
                textEdit14.Text = tempvalue.ToString("F3");      // 7 volt
                tempvalue       = 1.524F;
                textEdit15.Text = tempvalue.ToString("F3");      // 8 volt
                tempvalue       = 1.208F;
                textEdit16.Text = tempvalue.ToString("F3");      // 9 volt
                tempvalue       = 0.974F;
                textEdit17.Text = tempvalue.ToString("F3");      // 10 volt
                tempvalue       = 0.802F;
                textEdit18.Text = tempvalue.ToString("F3");      // 11 volt
                tempvalue       = 0.673F;
                textEdit19.Text = tempvalue.ToString("F3");      // 12 volt
                tempvalue       = 0.548F;
                textEdit20.Text = tempvalue.ToString("F3");      // 13 volt
                tempvalue       = 0.433F;
                textEdit21.Text = tempvalue.ToString("F3");      // 14 volt
                tempvalue       = 0.33F;
                textEdit22.Text = tempvalue.ToString("F3");      // 15 volt
                break;
            }
            // set battery correction voltage maps

            /*
             * Siemens deka 875         Siemens Deka 630      stock
             * Batt_korr_table
             *  15v = 0.62              15v=0.17ms          0.59
             *  14v = 0.73              14v=0.28ms          0.77
             *  13v = 0.85              13v=0.38ms          0.78
             *  12v = 1.00              12v=0.50ms          0.94
             *  11v = 1.20              11v=0.64ms          1.28
             *  10v = 1.46              10v=0.83ms          1.50
             */
        }
 public void SetInjectorType(InjectorType injectors)
 {
     comboBoxEdit2.SelectedIndex = (int)injectors;
 }
 private void UpdateMaxima(TurboType turbo, InjectorType injectors, MapSensorType mapSensor)
 {
     switch (mapSensor)
     {
         case MapSensorType.MapSensor25:
             // max achievable 400Nm / 1.45 bar
             if (injectors == InjectorType.Stock)
             {
                 spinEdit1.Properties.MaxValue = 400;
                 spinEdit2.Properties.MaxValue = (decimal)1.30;
             }
             else
             {
                 spinEdit1.Properties.MaxValue = 450;
                 spinEdit2.Properties.MaxValue = (decimal)1.45;
             }
             break;
         case MapSensorType.MapSensor30:
             switch (injectors)
             {
                 case InjectorType.Stock:
                     spinEdit1.Properties.MaxValue = 400;
                     spinEdit2.Properties.MaxValue = (decimal)1.30;
                     break;
                 case InjectorType.GreenGiants:
                     switch (turbo)
                     {
                         case TurboType.Stock:
                         case TurboType.TD0415T:
                             spinEdit1.Properties.MaxValue = 450;
                             spinEdit2.Properties.MaxValue = (decimal)1.45;
                             break;
                         case TurboType.GT28BB:
                         case TurboType.GT28RS:
                         case TurboType.TD0419T:
                             spinEdit1.Properties.MaxValue = 550;
                             spinEdit2.Properties.MaxValue = (decimal)1.70;
                             break;
                         case TurboType.GT3071R:
                         case TurboType.HX35w:
                             spinEdit1.Properties.MaxValue = 550;
                             spinEdit2.Properties.MaxValue = (decimal)1.50;
                             break;
                         case TurboType.HX40w:
                         case TurboType.S400SX371:
                             spinEdit1.Properties.MaxValue = 550;
                             spinEdit2.Properties.MaxValue = (decimal)1.40;
                             break;
                     }
                     break;
                 case InjectorType.Siemens630Dekas:
                     // 3.0 bar sensor, 630cc injectors -> max 600Nm
                     switch (turbo)
                     {
                         case TurboType.Stock:
                         case TurboType.TD0415T:
                             spinEdit1.Properties.MaxValue = 450;
                             spinEdit2.Properties.MaxValue = (decimal)1.45;
                             break;
                         case TurboType.GT28BB:
                         case TurboType.GT28RS:
                         case TurboType.TD0419T:
                             spinEdit1.Properties.MaxValue = 580;
                             spinEdit2.Properties.MaxValue = (decimal)1.75;
                             break;
                         case TurboType.GT3071R:
                         case TurboType.HX35w:
                             spinEdit1.Properties.MaxValue = 600;
                             spinEdit2.Properties.MaxValue = (decimal)1.80;
                             break;
                         case TurboType.HX40w:
                         case TurboType.S400SX371:
                             spinEdit1.Properties.MaxValue = 600;
                             spinEdit2.Properties.MaxValue = (decimal)1.70;
                             break;
                     }
                     break;
                 case InjectorType.Siemens875Dekas:
                 case InjectorType.Siemens1000cc:
                     // 3.0 bar sensor, 630cc injectors -> limit to turbo only
                     switch (turbo)
                     {
                         case TurboType.Stock:
                         case TurboType.TD0415T:
                             spinEdit1.Properties.MaxValue = 450;
                             spinEdit2.Properties.MaxValue = (decimal)1.45;
                             break;
                         case TurboType.GT28BB:
                         case TurboType.GT28RS:
                         case TurboType.TD0419T:
                             spinEdit1.Properties.MaxValue = 580;
                             spinEdit2.Properties.MaxValue = (decimal)1.75;
                             break;
                         case TurboType.GT3071R:
                         case TurboType.HX35w:
                             spinEdit1.Properties.MaxValue = 620;
                             spinEdit2.Properties.MaxValue = (decimal)1.9;
                             break;
                         case TurboType.HX40w:
                         case TurboType.S400SX371:
                             spinEdit1.Properties.MaxValue = 670;
                             spinEdit2.Properties.MaxValue = (decimal)2.0;
                             break;
                     }
                     break;
             }
             break;
         case MapSensorType.MapSensor35:
         case MapSensorType.MapSensor40:
         case MapSensorType.MapSensor50:
             switch (injectors)
             {
                 case InjectorType.Stock:
                     spinEdit1.Properties.MaxValue = 400;
                     spinEdit2.Properties.MaxValue = (decimal)1.30;
                     break;
                 case InjectorType.GreenGiants:
                     switch (turbo)
                     {
                         case TurboType.Stock:
                         case TurboType.TD0415T:
                             spinEdit1.Properties.MaxValue = 450;
                             spinEdit2.Properties.MaxValue = (decimal)1.45;
                             break;
                         case TurboType.GT28BB:
                         case TurboType.GT28RS:
                         case TurboType.TD0419T:
                             spinEdit1.Properties.MaxValue = 550;
                             spinEdit2.Properties.MaxValue = (decimal)1.70;
                             break;
                         case TurboType.GT3071R:
                         case TurboType.HX35w:
                             spinEdit1.Properties.MaxValue = 550;
                             spinEdit2.Properties.MaxValue = (decimal)1.50;
                             break;
                         case TurboType.HX40w:
                         case TurboType.S400SX371:
                             spinEdit1.Properties.MaxValue = 550;
                             spinEdit2.Properties.MaxValue = (decimal)1.40;
                             break;
                     }
                     break;
                 case InjectorType.Siemens630Dekas:
                     // 3.0 bar sensor, 630cc injectors -> max 600Nm
                     switch (turbo)
                     {
                         case TurboType.Stock:
                         case TurboType.TD0415T:
                             spinEdit1.Properties.MaxValue = 450;
                             spinEdit2.Properties.MaxValue = (decimal)1.45;
                             break;
                         case TurboType.GT28BB:
                         case TurboType.GT28RS:
                         case TurboType.TD0419T:
                             spinEdit1.Properties.MaxValue = 580;
                             spinEdit2.Properties.MaxValue = (decimal)1.75;
                             break;
                         case TurboType.GT3071R:
                         case TurboType.HX35w:
                             spinEdit1.Properties.MaxValue = 600;
                             spinEdit2.Properties.MaxValue = (decimal)1.80;
                             break;
                         case TurboType.HX40w:
                         case TurboType.S400SX371:
                             spinEdit1.Properties.MaxValue = 600;
                             spinEdit2.Properties.MaxValue = (decimal)1.70;
                             break;
                     }
                     break;
                 case InjectorType.Siemens875Dekas:
                 case InjectorType.Siemens1000cc:
                     // 3.0 bar sensor, 630cc injectors -> limit to turbo only
                     switch (turbo)
                     {
                         case TurboType.Stock:
                         case TurboType.TD0415T:
                             spinEdit1.Properties.MaxValue = 450;
                             spinEdit2.Properties.MaxValue = (decimal)1.45;
                             break;
                         case TurboType.GT28BB:
                         case TurboType.GT28RS:
                         case TurboType.TD0419T:
                             spinEdit1.Properties.MaxValue = 580;
                             spinEdit2.Properties.MaxValue = (decimal)1.75;
                             break;
                         case TurboType.GT3071R:
                         case TurboType.HX35w:
                             spinEdit1.Properties.MaxValue = 620;
                             spinEdit2.Properties.MaxValue = (decimal)1.9;
                             break;
                         case TurboType.HX40w:
                         case TurboType.S400SX371:
                             spinEdit1.Properties.MaxValue = 670;
                             spinEdit2.Properties.MaxValue = (decimal)2.2;
                             break;
                     }
                     break;
             }
             break;
     }
     UpdateStage();
 }
Example #20
0
        private void TuneToStage(string m_currentfile, int stage, double maxBoostValue, double maxBoostFirstGear, double maxBoostSecondGear, double maxBoostFirstGearAUT, double fuelCutLevel, double AutoGearBoxPercentage, bool isLpt, TurboType turboType, InjectorType injectorType, MapSensorType mapSensorType)
        {
            m_resume = new Trionic5Resume();
            m_resume.AddToResumeTable("Tuning your binary to stage: " + stage.ToString());
            // get the software ID from the bainery
            string enginetp = readenginetype(m_currentfile);
            string partnumber = readpartnumber(m_currentfile);
            // look up parameters for this sw id
            PartNumberConverter pnc = new PartNumberConverter();
            ECUInformation ecuinfo = pnc.GetECUInfo(partnumber, enginetp);
            File.Copy(m_currentfile, Path.GetDirectoryName(m_currentfile) + "\\" + Path.GetFileNameWithoutExtension(m_currentfile) + DateTime.Now.ToString("yyyyMMddHHmmss") + "beforetuningtostage" + stage.ToString() + ".bin", true);
            m_resume.AddToResumeTable("Backup file created (" + Path.GetFileNameWithoutExtension(m_currentfile) + DateTime.Now.ToString("yyyyMMddHHmmss") + "beforetuningtostage" + stage.ToString() + ".bin" + ")");

            switch (stage)
            {
                case 1:
                    SetRegKonMatFirstGearManual(m_currentfile, 30);
                    SetRegKonMatSecondGearManual(m_currentfile, 45);
                    SetRegKonMatFirstGearAutomatic(m_currentfile, 30);
                    break;
                case 2:
                    SetRegKonMatFirstGearManual(m_currentfile, 45);
                    SetRegKonMatSecondGearManual(m_currentfile, 45);
                    SetRegKonMatFirstGearAutomatic(m_currentfile, 45);
                    break;
                case 3:
                default:
                    SetRegKonMatFirstGearManual(m_currentfile, 45);
                    SetRegKonMatSecondGearManual(m_currentfile, 45);
                    SetRegKonMatFirstGearAutomatic(m_currentfile, 45);
                    break;
            }

            if (CheckBoostRegulationMapEmpty(m_currentfile))
            {
                // empty reg_kon_mat
                switch (stage)
                {
                    case 1:
                        FillRegulationMapValue(m_currentfile, 45);
                        break;
                    case 2:
                        FillRegulationMapValue(m_currentfile, 45);
                        break;
                    case 3:
                    default:
                        FillRegulationMapValue(m_currentfile, 45);
                        break;
                }
            }
            if (CheckBoostRegulationAUTMapEmpty(m_currentfile))
            {
                switch (stage)
                {
                    case 1:
                        FillRegulationAUTMapValue(m_currentfile, 45);
                        break;
                    case 2:
                        FillRegulationAUTMapValue(m_currentfile, 45);
                        break;
                    case 3:
                    default:
                        FillRegulationAUTMapValue(m_currentfile, 45);
                        break;
                }
            }

            if (CheckPIDControlEmpty(m_currentfile))
            {
                FillDefaultPIDControls(m_currentfile);
            }
            if (CheckPIDControlAUTEmpty(m_currentfile))
            {
                FillDefaultPIDAUTControls(m_currentfile);
            }

            //depending on turbotype!!!

            SetBoostRequestMaps(turboType, injectorType, mapSensorType, m_currentfile, maxBoostValue, AutoGearBoxPercentage, isLpt);

            if (/*!isLpt*/true) // don't if T5.2&& m_currentfile_size > 0x20000
            {
                // should be percentages
               /* SetInjectionMap(m_currentfile,15, 15, 255);
                SetInjectionMap(m_currentfile,14, 15, 253);
                SetInjectionMap(m_currentfile,13, 15, 253);
                SetInjectionMap(m_currentfile,12, 15, 249);
                SetInjectionMap(m_currentfile,11, 15, 248);
                SetInjectionMap(m_currentfile,10, 15, 245);
                SetInjectionMap(m_currentfile,9, 15, 236);

                SetInjectionMap(m_currentfile,15, 14, 255);
                SetInjectionMap(m_currentfile,14, 14, 253);
                SetInjectionMap(m_currentfile,13, 14, 253);
                SetInjectionMap(m_currentfile,12, 14, 235);
                SetInjectionMap(m_currentfile,11, 14, 234);
                SetInjectionMap(m_currentfile,10, 14, 226);
                SetInjectionMap(m_currentfile,9, 14, 225);

                SetInjectionMap(m_currentfile,15, 13, 248);
                SetInjectionMap(m_currentfile,14, 13, 245);
                SetInjectionMap(m_currentfile,13, 13, 245);
                SetInjectionMap(m_currentfile,12, 13, 224);
                SetInjectionMap(m_currentfile,11, 13, 217);
                SetInjectionMap(m_currentfile,10, 13, 205);
                SetInjectionMap(m_currentfile,9, 13, 189);

                SetInjectionMap(m_currentfile,15, 12, 219);
                SetInjectionMap(m_currentfile,14, 12, 215);
                SetInjectionMap(m_currentfile,13, 12, 213);
                SetInjectionMap(m_currentfile,12, 12, 206);
                SetInjectionMap(m_currentfile,11, 12, 205);
                SetInjectionMap(m_currentfile,10, 12, 198);
                SetInjectionMap(m_currentfile,9, 12, 176);

                SetInjectionMap(m_currentfile,15, 11, 198);
                SetInjectionMap(m_currentfile,14, 11, 192);
                SetInjectionMap(m_currentfile,13, 11, 191);
                SetInjectionMap(m_currentfile,12, 11, 190);
                SetInjectionMap(m_currentfile,11, 11, 190);
                SetInjectionMap(m_currentfile,10, 11, 183);
                SetInjectionMap(m_currentfile,9, 11, 163);*/
            }

            IncreaseInjectionKnockMap(m_currentfile, 0, 4);
            IncreaseInjectionKnockMap(m_currentfile, 1, 4);
            IncreaseInjectionKnockMap(m_currentfile, 2, 4);

            //SetIgnitionMap(m_currentfile, 15, 17, 1.5);
            //SetIgnitionMap(m_currentfile, 14, 17, 1.0);
            //SetIgnitionMap(m_currentfile, 13, 17, 0.5);
            //byte fuelcut = (byte)((fuelCutLevel + 1) * 100);
            SetBoostLimitMap(m_currentfile, 254 /* fuelcut */);

            //m_resume.m_resume.AddToResumeTable("Updated fuelcut map to: " + fuelCutLevel.ToString() + " bar");
            byte fglimit = (byte)((maxBoostFirstGear + 1) * 100);
            SetFirstGearLimiter(m_currentfile, fglimit);
            m_resume.AddToResumeTable("Updated first gear limiter (MAN) to: " + maxBoostFirstGear.ToString() + " bar");
            byte fgalimit = (byte)((maxBoostFirstGearAUT + 1) * 100);
            SetFirstGearLimiterAutoTrans(m_currentfile, fgalimit);
            m_resume.AddToResumeTable("Updated first gear limiter (AUT) to: " + maxBoostFirstGearAUT.ToString() + " bar");
            byte sglimit = (byte)((maxBoostSecondGear + 1) * 100);
            SetSecondGearLimiter(m_currentfile, sglimit);
            m_resume.AddToResumeTable("Updated second gear limiter (MAN) to: " + maxBoostSecondGear.ToString() + " bar");
            // <Guido> add Max_regl_temp1 Max_regl_temp2
            SetMaxReglTempValues(m_currentfile, 250);

            try
            {
                Trionic5Anomalies anomalies = new Trionic5Anomalies();
                anomalies.CheckBinForAnomalies(m_currentfile, m_resume, false, true, m_fileInformation );
            }
            catch (Exception E)
            {
                Console.WriteLine("CheckBinForAnomalies: " + E.Message);
            }

            // mark this particular file as tuned to stage X, to prevent running the wizard on this file again!
            //enginetp = enginetp.Substring(0, enginetp.Length - 4);
            //enginetp += "T5S" + stage.ToString();
            //writeenginetype(enginetp);
            WriteTunedToStageMarker(m_currentfile, stage);
            m_resume.AddToResumeTable("Updated binary description with tuned stage");
            Trionic5File file = new Trionic5File();
            file.LibraryPath = Application.StartupPath + "\\Binaries";
            file.SetAutoUpdateChecksum(m_autoUpdateChecksum);
            file.UpdateChecksum(m_currentfile);
        }
Example #21
0
        internal void Update(double TimeElapsed, ref double BoilerWaterLevel, ref double BoilerPressure, ref double TanksWaterLevel)
        {
            //Set panel index
            if (PanelIndex != -1)
            {
                Train.Panel[PanelIndex] = Active ? 1 : 0;
            }

            if (LoopSound != -1)
            {
                if (Active == true)
                {
                    if (TogglePlayed == false)
                    {
                        if (PlayOnceSound != -1)
                        {
                            SoundManager.Play(PlayOnceSound, 2.0, 1.0, false);
                        }
                        TogglePlayed = true;
                    }
                    else
                    {
                        if (!SoundManager.IsPlaying(PlayOnceSound) || PlayOnceSound == -1)
                        {
                            SoundManager.Play(LoopSound, 2.0, 1.0, true);
                        }
                    }
                }
                else
                {
                    TogglePlayed = false;
                    if (SoundManager.IsPlaying(LoopSound))
                    {
                        SoundManager.Stop(LoopSound);
                        if (PlayOnceSound != -1)
                        {
                            SoundManager.Play(PlayOnceSound, 2.0, 1.0, false);
                        }
                    }
                }
            }

            if (Active == false)
            {
                return;
            }
            var  waterRate = WaterRate / TimeElapsed;
            var  steamRate = SteamRate / TimeElapsed;
            bool fail      = false;

            if (TanksWaterLevel - waterRate <= 0)
            {
                waterRate = TanksWaterLevel;
                fail      = true;
            }
            else
            {
            }
            switch (Type)
            {
            case InjectorType.ExhaustSteam:
                if (Train.CurrentSpeed > 10 || Train.Handles.PowerNotch > MinimumPowerNotch)
                {
                    BoilerWaterLevel += waterRate;
                    TanksWaterLevel  -= waterRate;
                }
                break;

            case InjectorType.LiveSteam:
                if (BoilerPressure > MinimumPressure)
                {
                    BoilerWaterLevel += waterRate;
                    BoilerPressure   -= steamRate;
                    TanksWaterLevel  -= waterRate;
                }
                break;

            case InjectorType.Failed:
                //Failed injectors still use steam, but give no water
                //TODO: Multiple failure types (No water or steam, proportionate)
                BoilerPressure -= steamRate;
                break;
            }
            if (fail)
            {
                Type = InjectorType.Failed;
            }
        }
Example #22
0
        public TuningResult FreeTuneBinary(IECUFile m_File, double peakTorque, double peakBoost, bool tuneBasedOnTorque, MapSensorType mapType, TurboType turboType, InjectorType injectorType, BPCType valve, int rpmlimiter, int knockTime)
        {
            Trionic5Resume _localResume = new Trionic5Resume();
            m_fileInformation = m_File.GetFileInfo();
            string filename = m_fileInformation.Filename;
            // first set things right by running the tunetostagex wizard
            // generate a nice x_scale for ignition map (18 long)
            PressureToTorque ptt = new PressureToTorque();
            double peak_boost = ptt.CalculatePressureFromTorque(peakTorque, turboType);
            if (!tuneBasedOnTorque) peak_boost = peakBoost;
            double peak_boost_request = peak_boost;
            double correction = 1.0;
            if (mapType == MapSensorType.MapSensor30) correction = 1.2;
            if (mapType == MapSensorType.MapSensor35) correction = 1.4;
            if (mapType == MapSensorType.MapSensor40) correction = 1.6;
            if (mapType == MapSensorType.MapSensor50) correction = 2.0;
            peak_boost_request *= 100;
            peak_boost_request += 100;
            peak_boost_request /= correction;
            peak_boost_request -= 100;
            peak_boost_request /= 100;

            double min_pressure = -1;
            double max_pressure = peak_boost;

            #region preparation

            /********* start of prepare phase *********/
            string enginetp = readenginetype(filename);
            string partnumber = readpartnumber(filename);
            PartNumberConverter pnc = new PartNumberConverter();
            ECUInformation ecuinfo = pnc.GetECUInfo(partnumber, enginetp);
            bool isLpt = true;
            if (ReadTunedToStageMarker(filename) > 0)
            {
                return TuningResult.TuningFailedAlreadyTuned;
            }
            else if (ReadThreeBarConversionMarker(filename) > 0)
            {
                return TuningResult.TuningFailedThreebarSensor;
            }
            Trionic5Properties t5p = m_File.GetTrionicProperties();
            if (ecuinfo.Valid)
            {
                if (ecuinfo.Isaero || ecuinfo.Isfpt)
                {
                    isLpt = false;
                }
            }

            if (t5p.MapSensorType != mapType)
            {
                ConvertFileToThreeBarMapSensor(m_fileInformation, t5p.MapSensorType, mapType);
            }
            // check injector type
            if (t5p.InjectorType != injectorType)
            {
                int inj_konst_diff = DetermineDifferenceInInjectorConstant(t5p.InjectorType, injectorType);
                AddToInjectorConstant(filename, inj_konst_diff);
                SetInjectorBatteryCorrectionMap(m_File, injectorType); //TODO: check this function for correctness!
            }
            /*if (injectorType == InjectorType.Stock) writebyteinfile(filename, GetSymbolAddress("Inj_konst!"), 19);
            else if (injectorType == InjectorType.GreenGiants) writebyteinfile(filename, GetSymbolAddress("Inj_konst!"), 18);
            else if (injectorType == InjectorType.Siemens630Dekas) writebyteinfile(filename, GetSymbolAddress("Inj_konst!"), 15);
            else if (injectorType == InjectorType.Siemens875Dekas) writebyteinfile(filename, GetSymbolAddress("Inj_konst!"), 13);
            else if (injectorType == InjectorType.Siemens875Dekas) writebyteinfile(filename, GetSymbolAddress("Inj_konst!"), 13);*/
            t5p.TurboType = turboType;
            t5p.InjectorType = injectorType;
            t5p.MapSensorType = mapType;
            // determine stage??
            int stage = 0;
            if (peak_boost < 1.2) stage = 1;
            else if (peak_boost < 1.3) stage = 2;
            else if (peak_boost < 1.4) stage = 3;
            else if (peak_boost < 1.5) stage = 4;
            else if (peak_boost < 1.6) stage = 5;
            else if (peak_boost < 1.7) stage = 6;
            else if (peak_boost < 1.8) stage = 7;
            else if (peak_boost < 1.9) stage = 8;
            else stage = 9;

            m_File.SetTrionicOptions(t5p);
            TuneToStage(filename, stage, peak_boost_request, 0.52, 1.0, 0.52, 1.54, 90, isLpt, turboType, injectorType, mapType);
            _localResume.ResumeTuning = m_resume.ResumeTuning.Copy();
            /*********** end of prepare phase **************/

            // set limiter, bpc valve type and knock time
            SetBPCValveType(filename, valve);
            _localResume.AddToResumeTable("Set BPC driving frequencies");
            SetRPMLimiter(filename, rpmlimiter);
            _localResume.AddToResumeTable("Set RPM limiter");
            SetKnockTime(filename, knockTime);
            _localResume.AddToResumeTable("Set knock time value");

            #endregion

            // if mapsensor != stock and injectors are 630 cc or bigger
            if (mapType != MapSensorType.MapSensor25 && (injectorType == InjectorType.Siemens630Dekas || injectorType == InjectorType.Siemens875Dekas || injectorType == InjectorType.Siemens1000cc))
            {
                // now scale it
                double step = (max_pressure - min_pressure) / 17;
                double[] axisforIgnitionMap = new double[18];
                for (int i = 0; i < 18; i++)
                {
                    axisforIgnitionMap.SetValue(min_pressure + (i * step), i);
                }
                byte[] actualAxis = new byte[36];
                int j = 0;
                for (int i = 0; i < 18; i++)
                {
                    double currValue = Convert.ToDouble(axisforIgnitionMap.GetValue(i));
                    currValue *= 100;
                    currValue += 100;
                    if (mapType == MapSensorType.MapSensor30) currValue /= 1.2;
                    else if (mapType == MapSensorType.MapSensor35) currValue /= 1.4;
                    else if (mapType == MapSensorType.MapSensor40) currValue /= 1.6;
                    else if (mapType == MapSensorType.MapSensor50) currValue /= 2.0;
                    int ival = Convert.ToInt32(currValue);
                    byte v1 = (byte)(ival / 256);
                    byte v2 = (byte)(ival - (int)v1 * 256);

                    actualAxis.SetValue(v1, j++);
                    actualAxis.SetValue(v2, j++);
                }
                m_File.WriteData(actualAxis, (uint)m_File.GetFileInfo().GetSymbolAddressFlash("Ign_map_0_x_axis!"));
                _localResume.AddToResumeTable("Generated and saved new ignition map x axis");
                //Generate the ignition map based on the axis values
                GenerateAndSaveNewIgnitionMap(m_File, false);
                _localResume.AddToResumeTable("Generated and saved new ignition map");
                min_pressure = -0.8;
                step = (max_pressure - min_pressure) / 15;
                // now setup x axis for fuel map
                double[] axisforFuelMap = new double[16];
                for (int i = 0; i < 16; i++)
                {
                    axisforFuelMap.SetValue(min_pressure + (i * step), i);
                }
                byte[] actualFuelAxis = new byte[16];
                for (int i = 0; i < 16; i++)
                {
                    double currValue = Convert.ToDouble(axisforFuelMap.GetValue(i));
                    currValue *= 100;
                    currValue += 100;
                    if (mapType == MapSensorType.MapSensor30) currValue /= 1.2;
                    else if (mapType == MapSensorType.MapSensor35) currValue /= 1.4;
                    else if (mapType == MapSensorType.MapSensor40) currValue /= 1.6;
                    else if (mapType == MapSensorType.MapSensor50) currValue /= 2.0;
                    int ival = Convert.ToInt32(currValue);
                    if (ival > 255) ival = 255;
                    actualFuelAxis.SetValue((byte)ival, i);
                }
                m_File.WriteData(actualFuelAxis, (uint)m_File.GetFileInfo().GetSymbolAddressFlash("Fuel_map_xaxis!"));
                _localResume.AddToResumeTable("Generated and saved new fuel map x axis");

                //Generate the ignition map based on the axis values
                GenerateAndSaveNewFuelMap(m_File);
                _localResume.AddToResumeTable("Generated and saved new fuel map");

                min_pressure = -0.3;
                step = (max_pressure - min_pressure) / 11;
                // now setup x axis for fuel map
                double[] axisforFuelKnockMap = new double[12];
                for (int i = 0; i < 12; i++)
                {
                    axisforFuelKnockMap.SetValue(min_pressure + (i * step), i);
                }
                byte[] actualFuelKnockAxis = new byte[12];
                for (int i = 0; i < 12; i++)
                {
                    double currValue = Convert.ToDouble(axisforFuelKnockMap.GetValue(i));
                    currValue *= 100;
                    currValue += 100;
                    if (mapType == MapSensorType.MapSensor30) currValue /= 1.2;
                    else if (mapType == MapSensorType.MapSensor35) currValue /= 1.4;
                    else if (mapType == MapSensorType.MapSensor40) currValue /= 1.6;
                    else if (mapType == MapSensorType.MapSensor50) currValue /= 2.0;
                    int ival = Convert.ToInt32(currValue);
                    if (ival > 255) ival = 255;
                    actualFuelKnockAxis.SetValue((byte)ival, i);
                }
                m_File.WriteData(actualFuelKnockAxis, (uint)m_File.GetFileInfo().GetSymbolAddressFlash("Fuel_knock_xaxis!"));
                _localResume.AddToResumeTable("Generated and saved new fuel knock map x axis");

                //Generate the ignition map based on the axis values
                GenerateAndSaveNewFuelKnockMap(m_File);
                _localResume.AddToResumeTable("Generated and saved new fuel knock map");

                // mesh up a boost request map for this.. already possible
                // adjust peak boost to be scaled for the mapsensor type

                SetBoostRequestMaps(turboType, injectorType, mapType, m_File.GetFileInfo().Filename, peak_boost_request, 100, isLpt);
                _localResume.AddToResumeTable("Generated boost request maps");

            }
            m_resume.ResumeTuning = _localResume.ResumeTuning.Copy();
            return TuningResult.TuningSuccess;
        }
Example #23
0
 //abstract public int GetInjectorType();
 //abstract public void SetInjectorType(InjectorType type);
 abstract public void WriteInjectorTypeMarker(InjectorType injectorType);
 public void SetInjectorType(InjectorType injectors)
 {
     comboBoxEdit2.SelectedIndex = (int)injectors;
 }
Example #25
0
        public int DetermineDifferenceInInjectorConstant(InjectorType injectorTypeFrom, InjectorType injectorTypeTo)
        {
            int retval = 0;
            // Stock = 21
            // Green giants = 20 (minus 1)
            // Siemens 630 = 16 (minus 5)
            // Siemens 875 = 13 (minus 8)
            // Siemens 1000 = 11 (minus 10)

            switch (injectorTypeFrom)
            {
                case InjectorType.Stock:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.GreenGiants:
                            retval = 1; // from stock to GG
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = 5; // from stock to 630s
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = 8; // from stock to 875s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 10; // from stock to 1000s
                            break;
                    }
                    break;
                case InjectorType.GreenGiants:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = -1; // from gg to stock ????
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = 4; // from GG to 630s
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = 7; // from GG to 875s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 9; // from GG to 1000s
                            break;
                    }
                    break;
                case InjectorType.Siemens630Dekas:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = -5; // from 630s to stock ????
                            break;
                        case InjectorType.GreenGiants:
                            retval = -4; // from 630s to GG
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = 3; // from 630s to 875s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 5; // from 630s to 1000s
                            break;
                    }
                    break;
                case InjectorType.Siemens875Dekas:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = -8; // from 875s to stock ????
                            break;
                        case InjectorType.GreenGiants:
                            retval = -7; // from 875s to GG
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = -3; // from 875s to 630s
                            break;
                        case InjectorType.Siemens1000cc:
                            retval = 2; // from 875s to 1000s
                            break;
                    }
                    break;
                case InjectorType.Siemens1000cc:
                    switch (injectorTypeTo)
                    {
                        case InjectorType.Stock:
                            retval = -10; // from 1000s to stock ????
                            break;
                        case InjectorType.GreenGiants:
                            retval = -9; // from 1000s to GG
                            break;
                        case InjectorType.Siemens630Dekas:
                            retval = -5; // from 1000s to 630s
                            break;
                        case InjectorType.Siemens875Dekas:
                            retval = -2; // from 1000s to 875s
                            break;
                    }
                    break;
            }

            return retval;
        }
Example #26
0
 public void CheckTargetAFRMap(InjectorType injectorType)
 {
     if (targetmap.Length == 0)
     {
         targetmap = CreateDefaultTargetAFRMap(injectorType);
     }
     else if (IsAllZero(targetmap))
     {
         targetmap = CreateDefaultTargetAFRMap(injectorType);
     }
     SaveTargetAFRMap(Path.GetFileNameWithoutExtension(m_TrionicFile.GetFileInfo().Filename) + "-targetafr.afr", targetmap);
 }
Example #27
0
        private void SetBoostRequestMaps(TurboType turboType, InjectorType injectorType, MapSensorType mapSensorType, string m_currentfile, double maxBoostValue, double AutoGearBoxPercentage, bool isLpt)
        {
            switch (turboType)
            {
                case TurboType.Stock:
                    SetBoostRequestMap(m_currentfile, 0, 6, maxBoostValue * 0.85, AutoGearBoxPercentage); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 6, maxBoostValue * 0.87, AutoGearBoxPercentage); // low rpm
                    SetBoostRequestMap(m_currentfile, 2, 6, maxBoostValue * 0.89, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 3, 6, maxBoostValue * 0.90, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 4, 6, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 5, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 6, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 7, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 8, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 9, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 6, maxBoostValue * 0.9, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 6, maxBoostValue * 0.8, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 6, maxBoostValue * 0.7, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 6, maxBoostValue * 0.65, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 6, maxBoostValue * 0.6, AutoGearBoxPercentage); // high rpm

                    SetBoostRequestMap(m_currentfile, 0, 7, maxBoostValue * 0.85, AutoGearBoxPercentage); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 7, maxBoostValue * 0.89, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 2, 7, maxBoostValue * 0.9, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 3, 7, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 4, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 5, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 6, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 7, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 8, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 9, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 7, maxBoostValue * 0.9, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 7, maxBoostValue * 0.8, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 7, maxBoostValue * 0.7, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 7, maxBoostValue * 0.65, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 7, maxBoostValue * 0.6, AutoGearBoxPercentage);

                    break;
                case TurboType.TD0415T: // hold longer than stock
                    SetBoostRequestMap(m_currentfile, 0, 6, maxBoostValue * 0.85, AutoGearBoxPercentage); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 6, maxBoostValue * 0.87, AutoGearBoxPercentage); // low rpm
                    SetBoostRequestMap(m_currentfile, 2, 6, maxBoostValue * 0.89, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 3, 6, maxBoostValue * 0.90, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 4, 6, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 5, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 6, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 7, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 8, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 9, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 6, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 6, maxBoostValue * 0.9, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 6, maxBoostValue * 0.80, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 6, maxBoostValue * 0.65, AutoGearBoxPercentage); // high rpm

                    SetBoostRequestMap(m_currentfile, 0, 7, maxBoostValue * 0.85, AutoGearBoxPercentage); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 7, maxBoostValue * 0.89, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 2, 7, maxBoostValue * 0.9, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 3, 7, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 4, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 5, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 6, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 7, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 8, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 9, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 7, maxBoostValue , AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 7, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 7, maxBoostValue * 0.90, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 7, maxBoostValue * 0.80, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 7, maxBoostValue * 0.65, AutoGearBoxPercentage);

                    break;
                case TurboType.TD0419T: // hold longer than stock but spool later
                case TurboType.GT28BB: // hold longer than stock but spool later
                case TurboType.GT28RS: // hold longer than stock but spool later
                    SetBoostRequestMap(m_currentfile, 0, 6, maxBoostValue * 0.60, AutoGearBoxPercentage); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 6, maxBoostValue * 0.60, AutoGearBoxPercentage); // low rpm
                    SetBoostRequestMap(m_currentfile, 2, 6, maxBoostValue * 0.60, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 3, 6, maxBoostValue * 0.65, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 4, 6, maxBoostValue * 0.80, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 5, 6, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 6, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 7, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 8, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 9, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 6, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 6, maxBoostValue * 0.9, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 6, maxBoostValue * 0.85, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 6, maxBoostValue * 0.70, AutoGearBoxPercentage); // high rpm

                    SetBoostRequestMap(m_currentfile, 0, 7, maxBoostValue * 0.60, AutoGearBoxPercentage); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 7, maxBoostValue * 0.60, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 2, 7, maxBoostValue * 0.60, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 3, 7, maxBoostValue * 0.65, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 4, 7, maxBoostValue * 0.80, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 5, 7, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 6, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 7, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 8, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 9, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 7, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 7, maxBoostValue * 0.90, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 7, maxBoostValue * 0.85, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 7, maxBoostValue * 0.70, AutoGearBoxPercentage);
                    break;
                case TurboType.GT3071R: // hold longer than stock
                case TurboType.HX35w: // hold longer than stock
                    SetBoostRequestMap(m_currentfile, 0, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // low rpm
                    SetBoostRequestMap(m_currentfile, 2, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 3, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 4, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 5, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 6, 6, maxBoostValue * 0.65, AutoGearBoxPercentage, 0.8);
                    SetBoostRequestMap(m_currentfile, 7, 6, maxBoostValue * 0.75, AutoGearBoxPercentage, 1.0);
                    SetBoostRequestMap(m_currentfile, 8, 6, maxBoostValue * 0.95, AutoGearBoxPercentage, 1.2);
                    SetBoostRequestMap(m_currentfile, 9, 6, maxBoostValue * 0.98, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 6, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 6, maxBoostValue * 0.80, AutoGearBoxPercentage); // high rpm

                    SetBoostRequestMap(m_currentfile, 0, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // low rpm
                    SetBoostRequestMap(m_currentfile, 2, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 3, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 4, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 5, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 6, 7, maxBoostValue * 0.65, AutoGearBoxPercentage, 0.8);
                    SetBoostRequestMap(m_currentfile, 7, 7, maxBoostValue * 0.75, AutoGearBoxPercentage, 1.0);
                    SetBoostRequestMap(m_currentfile, 8, 7, maxBoostValue * 0.95, AutoGearBoxPercentage, 1.2);
                    SetBoostRequestMap(m_currentfile, 9, 7, maxBoostValue * 0.98, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 7, maxBoostValue * 0.95, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 7, maxBoostValue * 0.80, AutoGearBoxPercentage);
                    break;
                case TurboType.HX40w: // hold longer than stock
                case TurboType.S400SX371:
                    SetBoostRequestMap(m_currentfile, 0, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // low rpm
                    SetBoostRequestMap(m_currentfile, 2, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 3, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 4, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 5, 6, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 6, 6, maxBoostValue * 0.65, AutoGearBoxPercentage, 0.8);
                    SetBoostRequestMap(m_currentfile, 7, 6, maxBoostValue * 0.75, AutoGearBoxPercentage, 1.0);
                    SetBoostRequestMap(m_currentfile, 8, 6, maxBoostValue * 0.95, AutoGearBoxPercentage, 1.2);
                    SetBoostRequestMap(m_currentfile, 9, 6, maxBoostValue * 0.98, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 6, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 6, maxBoostValue * 0.98, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 6, maxBoostValue * 0.93, AutoGearBoxPercentage); // high rpm

                    SetBoostRequestMap(m_currentfile, 0, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // % of max boost
                    SetBoostRequestMap(m_currentfile, 1, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7); // low rpm
                    SetBoostRequestMap(m_currentfile, 2, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 3, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 4, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 5, 7, maxBoostValue * 0.60, AutoGearBoxPercentage, 0.7);
                    SetBoostRequestMap(m_currentfile, 6, 7, maxBoostValue * 0.65, AutoGearBoxPercentage, 0.8);
                    SetBoostRequestMap(m_currentfile, 7, 7, maxBoostValue * 0.75, AutoGearBoxPercentage, 1.0);
                    SetBoostRequestMap(m_currentfile, 8, 7, maxBoostValue * 0.95, AutoGearBoxPercentage, 1.2);
                    SetBoostRequestMap(m_currentfile, 9, 7, maxBoostValue * 0.98, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 10, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 11, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 12, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 13, 7, maxBoostValue, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 14, 7, maxBoostValue * 0.98, AutoGearBoxPercentage);
                    SetBoostRequestMap(m_currentfile, 15, 7, maxBoostValue * 0.93, AutoGearBoxPercentage);
                    break;
            }
            if (isLpt)
            {
                // more columns need adjusting
                SetBoostRequestMap(m_currentfile, 0, 5, maxBoostValue * 0.55, AutoGearBoxPercentage); // % of max boost
                SetBoostRequestMap(m_currentfile, 1, 5, maxBoostValue * 0.55, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 2, 5, maxBoostValue * 0.55, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 3, 5, maxBoostValue * 0.57, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 4, 5, maxBoostValue * 0.58, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 5, 5, maxBoostValue * 0.58, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 6, 5, maxBoostValue * 0.58, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 7, 5, maxBoostValue * 0.57, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 8, 5, maxBoostValue * 0.57, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 9, 5, maxBoostValue * 0.56, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 10, 5, maxBoostValue * 0.53, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 11, 5, maxBoostValue * 0.50, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 12, 5, maxBoostValue * 0.45, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 13, 5, maxBoostValue * 0.40, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 14, 5, maxBoostValue * 0.40, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 15, 5, maxBoostValue * 0.35, AutoGearBoxPercentage);

                SetBoostRequestMap(m_currentfile, 0, 4, maxBoostValue * 0.35, AutoGearBoxPercentage); // 75% of max boost
                SetBoostRequestMap(m_currentfile, 1, 4, maxBoostValue * 0.35, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 2, 4, maxBoostValue * 0.35, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 3, 4, maxBoostValue * 0.30, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 4, 4, maxBoostValue * 0.30, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 5, 4, maxBoostValue * 0.30, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 6, 4, maxBoostValue * 0.30, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 7, 4, maxBoostValue * 0.30, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 8, 4, maxBoostValue * 0.30, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 9, 4, maxBoostValue * 0.30, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 10, 4, maxBoostValue * 0.25, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 11, 4, maxBoostValue * 0.2, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 12, 4, maxBoostValue * 0.18, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 13, 4, maxBoostValue * 0.15, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 14, 4, maxBoostValue * 0.15, AutoGearBoxPercentage);
                SetBoostRequestMap(m_currentfile, 15, 4, maxBoostValue * 0.1, AutoGearBoxPercentage);
            }
        }
Example #28
0
        private void AddFilesToLibrary(string path)
        {
            Application.DoEvents();
            DataTable dt = new DataTable("UserLib");

            dt.Columns.Add("Filename");
            dt.Columns.Add("FilenameNoPath");
            dt.Columns.Add("EngineType");
            dt.Columns.Add("Stage");
            dt.Columns.Add("Injectors");
            dt.Columns.Add("Mapsensor");
            dt.Columns.Add("Torque");
            dt.Columns.Add("E85", Type.GetType("System.Boolean"));
            dt.Columns.Add("T7Valve", Type.GetType("System.Boolean"));
            dt.Columns.Add("Partnumber");
            dt.Columns.Add("SoftwareID");
            dt.Columns.Add("CPU");
            dt.Columns.Add("RAMlocked", Type.GetType("System.Boolean"));
            if (File.Exists(Application.StartupPath + "\\UserLib.xml"))
            {
                dt.ReadXml(Application.StartupPath + "\\UserLib.xml");
            }
            string[] files = Directory.GetFiles(path, "*.bin", SearchOption.AllDirectories);
            foreach (string file in files)
            {
                FileInfo fi = new FileInfo(file);
                this.Text = "User library browser - " + Path.GetFileName(file);
                Application.DoEvents();
                if (fi.Length == 0x20000 || fi.Length == 0x40000)
                {
                    try
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            if (dr["Filename"] != DBNull.Value)
                            {
                                if (dr["Filename"].ToString() == file)
                                {
                                    dt.Rows.Remove(dr);
                                    break;
                                }
                            }
                        }
                        Trionic5File _file = new Trionic5File();
                        _file.SelectFile(file);
                        Trionic5FileInformation m_trionicFileInformation = _file.ParseFile();
                        Trionic5Properties      props = _file.GetTrionicProperties();
                        // get information about the file
                        MapSensorType mapsensor = _file.GetMapSensorType(true);
                        ECUFileType   fileType  = _file.DetermineFileType();
                        //t5p.Enginetype
                        //t5p.Partnumber
                        //t5p.CPUspeed
                        //t5p.SoftwareID
                        //t5p.RAMlocked
                        //TuningStage _stage = m_trionicFile.DetermineTuningStage(out m_maxBoost);
                        int  injkonst      = _file.GetSymbolAsInt("Inj_konst!");
                        bool m_E85         = false;
                        int  max_injection = _file.GetMaxInjection();
                        max_injection *= injkonst;
                        // de maximale waarde uit fuel_map_x_axis! aub
                        byte[] fuelxaxis        = _file.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 = _file.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");
                        }
                        // 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;
                        }



                        // Add info about T5/T7 valve
                        int  frek230 = _file.GetSymbolAsInt("Frek_230!");
                        int  frek250 = _file.GetSymbolAsInt("Frek_250!");
                        bool T7Valve = false;
                        if (fileType == ECUFileType.Trionic52File)
                        {
                            if (frek230 == 728 || frek250 == 935)
                            {
                                T7Valve = false;
                            }
                            else
                            {
                                T7Valve = true;
                            }
                        }
                        else if (fileType == ECUFileType.Trionic55File)
                        {
                            if (frek230 == 90 || frek250 == 70)
                            {
                                T7Valve = false;
                            }
                            else
                            {
                                T7Valve = true;
                            }
                        }
                        int         torque     = 0;
                        float       m_maxBoost = 0;
                        TuningStage _stage     = _file.DetermineTuningStage(out m_maxBoost);

                        PressureToTorque ptt = new PressureToTorque();
                        torque = Convert.ToInt32(ptt.CalculateTorqueFromPressure(m_maxBoost, props.TurboType));
                        dt.Rows.Add(file, Path.GetFileName(file), props.Enginetype, _stage.ToString(), inj_type.ToString(), mapsensor.ToString(), torque.ToString(), m_E85, T7Valve, props.Partnumber, props.SoftwareID, props.CPUspeed, props.RAMlocked);
                    }
                    catch (Exception E)
                    {
                        Console.WriteLine(E.Message);
                    }
                }
            }
            dt.WriteXml(Application.StartupPath + "\\UserLib.xml");
            gridControl1.DataSource = dt;
            gridView1.BestFitColumns();
            this.Text = "User library browser";
        }
        private void SetInjectorBatteryCorrectionMap(InjectorType injectorType)
        {
            float tempvalue = 0;
            switch (injectorType)
            {
                case InjectorType.Stock:
                case InjectorType.Siemens875Dekas:
                case InjectorType.Siemens1000cc:
                    tempvalue = 3.73F;
                    textEdit12.Text = tempvalue.ToString("F3");  // 5 volt
                    textEdit13.Text = tempvalue.ToString("F3");  // 6 volt
                    textEdit14.Text = tempvalue.ToString("F3");  // 7 volt
                    tempvalue = 2.32F;
                    textEdit15.Text = tempvalue.ToString("F3");  // 8 volt
                    tempvalue = 1.85F;
                    textEdit16.Text = tempvalue.ToString("F3");  // 9 volt
                    tempvalue = 1.50F;
                    textEdit17.Text = tempvalue.ToString("F3");  // 10 volt
                    tempvalue = 1.28F;
                    textEdit18.Text = tempvalue.ToString("F3");  // 11 volt
                    tempvalue = 0.94F;
                    textEdit19.Text = tempvalue.ToString("F3");  // 12 volt
                    tempvalue = 0.78F;
                    textEdit20.Text = tempvalue.ToString("F3");  // 13 volt
                    tempvalue = 0.77F;
                    textEdit21.Text = tempvalue.ToString("F3");  // 14 volt
                    tempvalue = 0.59F;
                    textEdit22.Text = tempvalue.ToString("F3");  // 15 volt
                    break;
                case InjectorType.GreenGiants:
                    tempvalue = 5.45F;
                    textEdit12.Text = tempvalue.ToString("F3");  // 5 volt
                    tempvalue = 4.142F;
                    textEdit13.Text = tempvalue.ToString("F3");  // 6 volt
                    tempvalue = 3.216F;
                    textEdit14.Text = tempvalue.ToString("F3");  // 7 volt
                    tempvalue = 2.545F;
                    textEdit15.Text = tempvalue.ToString("F3");  // 8 volt
                    tempvalue = 2.102F;
                    textEdit16.Text = tempvalue.ToString("F3");  // 9 volt
                    tempvalue = 1.768F;
                    textEdit17.Text = tempvalue.ToString("F3");  // 10 volt
                    tempvalue = 1.521F;
                    textEdit18.Text = tempvalue.ToString("F3");  // 11 volt
                    tempvalue = 1.308F;
                    textEdit19.Text = tempvalue.ToString("F3");  // 12 volt
                    tempvalue = 1.15F;
                    textEdit20.Text = tempvalue.ToString("F3");  // 13 volt
                    tempvalue = 1.003F;
                    textEdit21.Text = tempvalue.ToString("F3");  // 14 volt
                    tempvalue = 0.894F;
                    textEdit22.Text = tempvalue.ToString("F3");  // 15 volt
                    break;
                case InjectorType.Siemens630Dekas:
                    tempvalue = 3.6F;
                    textEdit12.Text = tempvalue.ToString("F3");  // 5 volt
                    tempvalue = 2.74F;
                    textEdit13.Text = tempvalue.ToString("F3");  // 6 volt
                    tempvalue = 2.023F;
                    textEdit14.Text = tempvalue.ToString("F3");  // 7 volt
                    tempvalue = 1.524F;
                    textEdit15.Text = tempvalue.ToString("F3");  // 8 volt
                    tempvalue = 1.208F;
                    textEdit16.Text = tempvalue.ToString("F3");  // 9 volt
                    tempvalue = 0.974F;
                    textEdit17.Text = tempvalue.ToString("F3");  // 10 volt
                    tempvalue = 0.802F;
                    textEdit18.Text = tempvalue.ToString("F3");  // 11 volt
                    tempvalue = 0.673F;
                    textEdit19.Text = tempvalue.ToString("F3");  // 12 volt
                    tempvalue = 0.548F;
                    textEdit20.Text = tempvalue.ToString("F3");  // 13 volt
                    tempvalue = 0.433F;
                    textEdit21.Text = tempvalue.ToString("F3");  // 14 volt
                    tempvalue = 0.33F;
                    textEdit22.Text = tempvalue.ToString("F3");  // 15 volt
                    break;

            }
            // set battery correction voltage maps
            /*
             * Siemens deka 875         Siemens Deka 630      stock
             * Batt_korr_table
                15v = 0.62              15v=0.17ms          0.59
                14v = 0.73              14v=0.28ms          0.77
                13v = 0.85              13v=0.38ms          0.78
                12v = 1.00              12v=0.50ms          0.94
                11v = 1.20              11v=0.64ms          1.28
                10v = 1.46              10v=0.83ms          1.50
            */
        }