Example #1
0
        private void DecodeVIN()
        {
            textEdit1.Text     = textEdit1.Text.ToUpper();
            lblBody.Text       = "---";
            lblCarModel.Text   = "---";
            lblEngineType.Text = "---";
            lblMakeyear.Text   = "---";
            lblPlant.Text      = "---";
            lblSeries.Text     = "---";
            lblTurbo.Text      = "---";
            lblChecksum.Text   = "Not verified";

            VINCarInfo carinfo = VINDecoder.DecodeVINNumber(textEdit1.Text);

            lblBody.Text       = carinfo.Body;
            lblCarModel.Text   = carinfo.CarModel.ToString();
            lblEngineType.Text = carinfo.EngineType.ToString();
            lblMakeyear.Text   = carinfo.Makeyear.ToString();
            lblPlant.Text      = carinfo.PlantInfo;
            lblSeries.Text     = carinfo.Series;
            lblTurbo.Text      = carinfo.TurboModel.ToString().Replace("_", "-");
            lblGearbox.Text    = carinfo.GearboxDescription;
            if (carinfo.CalculatedChecksum != '*')
            {
                lblChecksum.Text = carinfo.CalculatedChecksum == textEdit1.Text[8] ? "Valid" : "WRONG! Expected: " + carinfo.CalculatedChecksum + " but found: " + textEdit1.Text[8];
            }
        }
Example #2
0
 public void DecodeVINNumberTestW0L0ZCF3551095720()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "W0L0ZCF3551095720";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.OpelVectra, actual.CarModel);
     Assert.AreEqual(2005, actual.Makeyear);
     Assert.AreEqual(VINEngineType.Z20NET, actual.EngineType);
     Assert.AreEqual(VINTurboModel.GarrettGT2052, actual.TurboModel);
     // Serialnumber not decoded 095720
 }
Example #3
0
 public void DecodeVINNumberTest()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "YS3EB55A143012475";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.Saab95, actual.CarModel);
     Assert.AreEqual(2004, actual.Makeyear);
     Assert.AreEqual("5 door combi coupe", actual.Body);
     Assert.AreEqual(VINEngineType.B235L, actual.EngineType);
     Assert.AreEqual(VINTurboModel.GarrettT17, actual.TurboModel);
     Assert.AreEqual("5 speed manual / front wheel drive", actual.GearboxDescription);
     Assert.AreEqual("Trollhättan line A (9-5)", actual.PlantInfo);
     Assert.AreEqual("Model series I, Driver and passenger airbags", actual.Series);
     // Serialnumber not decoded 012475
 }
Example #4
0
 private void DecodeVIN()
 {
     lblBody.Text = "---";
     lblCarModel.Text = "---";
     lblEngineType.Text = "---";
     lblMakeyear.Text = "---";
     lblPlant.Text = "---";
     lblSeries.Text = "---";
     lblTurbo.Text = "---";
     VINDecoder decoder = new VINDecoder();
     VINCarInfo carinfo = decoder.DecodeVINNumber(textEdit1.Text);
     lblBody.Text = carinfo.Body;
     lblCarModel.Text = carinfo.CarModel.ToString();
     lblEngineType.Text = carinfo.EngineType.ToString();
     lblMakeyear.Text = carinfo.Makeyear.ToString();
     lblPlant.Text = carinfo.PlantInfo;
     lblSeries.Text = carinfo.Series;
     lblTurbo.Text = carinfo.TurboModel.ToString().Replace("_","-");
     lblGearbox.Text = carinfo.GearboxDescription;
 }
Example #5
0
        private void DecodeVIN()
        {
            lblBody.Text       = "---";
            lblCarModel.Text   = "---";
            lblEngineType.Text = "---";
            lblMakeyear.Text   = "---";
            lblPlant.Text      = "---";
            lblSeries.Text     = "---";
            lblTurbo.Text      = "---";
            VINDecoder decoder = new VINDecoder();
            VINCarInfo carinfo = decoder.DecodeVINNumber(textEdit1.Text);

            lblBody.Text       = carinfo.Body;
            lblCarModel.Text   = carinfo.CarModel.ToString();
            lblEngineType.Text = carinfo.EngineType.ToString();
            lblMakeyear.Text   = carinfo.Makeyear.ToString();
            lblPlant.Text      = carinfo.PlantInfo;
            lblSeries.Text     = carinfo.Series;
            lblTurbo.Text      = carinfo.TurboModel.ToString().Replace("_", "-");
            lblGearbox.Text    = carinfo.GearboxDescription;
        }
Example #6
0
 public void DecodeVINNumberTestYS3EB59A553505541()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "YS3EB59A553505541";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.Saab95, actual.CarModel);
     Assert.AreEqual(2005, actual.Makeyear);
     Assert.AreEqual("5 door combi coupe", actual.Body);
     Assert.AreEqual(VINEngineType.B235L, actual.EngineType);
     Assert.AreEqual(VINTurboModel.MitsubishiTD04HL_15T_5, actual.TurboModel);
     Assert.AreEqual("5 speed automatic / front wheel drive", actual.GearboxDescription);
     Assert.AreEqual("Trollhättan line A (9-5)", actual.PlantInfo);
     Assert.AreEqual("Model series I, Driver and passenger airbags", actual.Series);
     // Serialnumber not decoded 505541
 }
Example #7
0
 public void DecodeVINNumberTestYSCFD56S782300776()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "YSCFD56S782300776";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.CadillacBTS, actual.CarModel);
     Assert.AreEqual(2008, actual.Makeyear);
     Assert.AreEqual("5 door combi coupe", actual.Body);
     Assert.AreEqual(VINEngineType.B207L, actual.EngineType);
     Assert.AreEqual(VINTurboModel.Unknown, actual.TurboModel);
     Assert.AreEqual("6 speed manual / front wheel drive", actual.GearboxDescription);
     Assert.AreEqual("Trollhättan line B (900 / 9-3)", actual.PlantInfo);
     Assert.AreEqual("Model series II, Driver and passenger airbags", actual.Series);
     // Serialnumber not decoded 300776
 }
Example #8
0
 public void DecodeVINNumberTestYS3GR4BJ0B4001333()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "YS3GR4BJ0B4001333";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.Saab95new, actual.CarModel);
     Assert.AreEqual(2011, actual.Makeyear);
     Assert.AreEqual("4 door sedan (SN)", actual.Body);
     Assert.AreEqual(VINEngineType.A28NER_LAU, actual.EngineType);
     Assert.AreEqual(VINTurboModel.MitsubishiTD04HL_19TK3, actual.TurboModel);
     Assert.AreEqual("6 speed automatic / all wheel drive", actual.GearboxDescription);
     Assert.AreEqual("Trollhättan (9-5)", actual.PlantInfo);
     Assert.AreEqual("Saab 9-5 Aero", actual.Series);
     // Serialnumber not decoded 001333
 }
Example #9
0
 public void DecodeVINNumberTestYS3GP4AR2B4002240()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "YS3GP4AR2B4002240";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.Saab95new, actual.CarModel);
     Assert.AreEqual(2011, actual.Makeyear);
     Assert.AreEqual("4 door sedan (SN)", actual.Body);
     Assert.AreEqual(VINEngineType.A20NFT_LHU_BP, actual.EngineType);
     Assert.AreEqual(VINTurboModel.BorgWarnerK04_2277DCB, actual.TurboModel);
     Assert.AreEqual("6 speed automatic / front wheel drive", actual.GearboxDescription);
     Assert.AreEqual("Trollhättan (9-5)", actual.PlantInfo);
     Assert.AreEqual("Saab 9-5 Vector", actual.Series);
     // Serialnumber not decoded 002240
 }
Example #10
0
 public void DecodeVINNumberTestYS3FM52RX81130440()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "YS3FM52RX81130440";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.Saab93new, actual.CarModel);
     Assert.AreEqual(2008, actual.Makeyear);
     Assert.AreEqual("5 door combi coupe", actual.Body);
     Assert.AreEqual(VINEngineType.B284R, actual.EngineType);
     Assert.AreEqual(VINTurboModel.MitsubishiTD04HL_15TK, actual.TurboModel);
     Assert.AreEqual("6 speed automatic / all wheel drive", actual.GearboxDescription);
     Assert.AreEqual("Trollhättan line A (9-3)", actual.PlantInfo);
     Assert.AreEqual("Saab 9-3 TurboX", actual.Series);
     // Serialnumber not decoded 130440
 }
Example #11
0
 public void DecodeVINNumberTestYS3FD5NT8B1306559()
 {
     VINDecoder target = new VINDecoder();
     string VINNumber = "YS3FD5NT8B1306559";
     VINCarInfo actual;
     actual = target.DecodeVINNumber(VINNumber);
     Assert.AreEqual(VINCarModel.Saab93new, actual.CarModel);
     Assert.AreEqual(2011, actual.Makeyear);
     Assert.AreEqual("5 door combi coupe", actual.Body);
     Assert.AreEqual(VINEngineType.B207S, actual.EngineType);
     Assert.AreEqual(VINTurboModel.MitsubishiTD04L_14T, actual.TurboModel);
     Assert.AreEqual("6 speed manual / all wheel drive", actual.GearboxDescription);
     Assert.AreEqual("Trollhättan line A (9-3)", actual.PlantInfo);
     Assert.AreEqual("Saab 9-3 X", actual.Series);
     // Serialnumber not decoded 306559
 }
Example #12
0
        private void btnConvertOriFiles_ItemClick(object sender, ItemClickEventArgs e)
        {
            // get all files in subfolder Binaries\Ori and convert the filenames
            string[] files = Directory.GetFiles(System.Windows.Forms.Application.StartupPath + "\\Binaries\\Ori", "*.bin");
            foreach (string file in files)
            {
                logger.Debug("Handling: " + Path.GetFileName(file));
                m_currentfile = file;
                TryToOpenFile(m_currentfile, out m_symbols, m_currentfile_size);
                // now get the details
                if (m_currentfile != "")
                {
                    T8Header t8header = new T8Header();

                    t8header.init(m_currentfile);
                    frmAirmassResult res = new frmAirmassResult();
                    res.Currentfile = m_currentfile;
                    res.Symbols = m_symbols;
                    res.Calculate();
                    int peak_airmass = res.PeakAirmass;
                    string newFilename = t8header.PartNumber.Trim() + "_" + t8header.SoftwareVersion.Trim() /*+ "_" + t8header.HardwareID.Trim() + "_" + t8header.DeviceType.Trim() + "_" + peak_airmass.ToString() + "mgc.bin"*/ + ".BIN";

                    if (!File.Exists(System.Windows.Forms.Application.StartupPath + "\\Binaries\\" + newFilename))
                    {
                        File.Copy(file, System.Windows.Forms.Application.StartupPath + "\\Binaries\\" + newFilename);

                        // test
                        VINDecoder dec = new VINDecoder();
                        VINCarInfo info = dec.DecodeVINNumber(t8header.ChassisID);
                        AddToPartnumberCollectionFile(t8header.PartNumber.Trim(), info.Makeyear, t8header.SoftwareVersion.Trim());
                        AddToPartnumberConverterFile(t8header.PartNumber.Trim(), info.EngineType, info.CarModel, t8header.SoftwareVersion.Trim());
                        // test

                    }
                    else
                    {
                        logger.Debug("File already existed: " + newFilename);
                    }
                    /*frminfo.ProgrammerName = t8header.ProgrammerName;
                    frminfo.ProgrammingDevice = t8header.ProgrammerDevice;
                    frminfo.PartNumber = t8header.PartNumber;
                    frminfo.ReleaseDate = t8header.ReleaseDate;
                    frminfo.SoftwareID = t8header.SoftwareVersion;
                    frminfo.ChassisID = t8header.ChassisID;
                    frminfo.EngineType = t8header.CarDescription;
                    frminfo.ImmoID = t8header.ImmobilizerID;
                    frminfo.HardwareID = t8header.HardwareID;
                    frminfo.HardwareType = t8header.DeviceType;
                    frminfo.ECUDescription = t8header.EcuDescription;
                    frminfo.InterfaceDevice = t8header.InterfaceDevice;
                    frminfo.NumberOfFlashBlocks = t8header.NumberOfFlashBlocks.ToString();*/
                }
            }
            logger.Debug("All done");
        }
Example #13
0
        private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            // show firmware information
            if (m_currentfile != string.Empty)
            {
                if (File.Exists(m_currentfile))
                {
                    frmFirmwareInformation frminfo = new frmFirmwareInformation();
                    T8Header t8header = new T8Header();
                    t8header.init(m_currentfile);
                    frminfo.Filename = m_currentfile;
                    frminfo.ProgrammerName = t8header.ProgrammerName;
                    frminfo.ProgrammingDevice = t8header.ProgrammerDevice;
                    frminfo.PartNumber = t8header.PartNumber;
                    frminfo.ReleaseDate = t8header.ReleaseDate;
                    frminfo.SoftwareID = t8header.SoftwareVersion.Trim();
                    // determine engine type / MY by software version
                    // and determine engine type MY by VIN number
                    string engineTypeBySWVersion = string.Empty;
                    string engineTypeByVIN = string.Empty;
                    VINDecoder decoder = new VINDecoder();
                    VINCarInfo carinfo = decoder.DecodeVINNumber(t8header.ChassisID);
                    engineTypeByVIN = carinfo.EngineType + " MY" + carinfo.Makeyear.ToString() + " " + carinfo.GearboxDescription;
                    frminfo.EngineTypeByVIN = engineTypeByVIN;
                    string swversion = t8header.SoftwareVersion.Trim();
                    engineTypeBySWVersion = DetermineCarInfoBySWVersion(swversion);
                    frminfo.ChassisID = t8header.ChassisID;
                    frminfo.EngineTypeBySoftwareVersion = engineTypeBySWVersion;//t8header.CarDescription;
                    frminfo.ImmoID = t8header.ImmobilizerID;
                    frminfo.HardwareID = t8header.HardwareID;
                    frminfo.HardwareType = t8header.DeviceType;
                    frminfo.ECUDescription = t8header.EcuDescription;
                    frminfo.InterfaceDevice = t8header.InterfaceDevice;
                    frminfo.NumberOfFlashBlocks = t8header.NumberOfFlashBlocks.ToString();

                    if (frminfo.ShowDialog() == DialogResult.OK)
                    {
                        t8header.ImmobilizerID = frminfo.ImmoID;
                        t8header.SoftwareVersion = frminfo.SoftwareID;
                        t8header.CarDescription = frminfo.EngineTypeBySoftwareVersion;
                        t8header.ChassisID = frminfo.ChassisID;
                        t8header.ReleaseDate = frminfo.ReleaseDate;
                        t8header.ProgrammerDevice = frminfo.ProgrammingDevice;
                        t8header.ProgrammerName = frminfo.ProgrammerName;
                        t8header.PartNumber = frminfo.PartNumber;
                        t8header.DeviceType = frminfo.HardwareType;
                        t8header.HardwareID = frminfo.HardwareID;
                        t8header.InterfaceDevice = frminfo.InterfaceDevice;
                        t8header.EcuDescription = frminfo.ECUDescription;
                        // only if enabled
                        if (frminfo.ChangeVINAndImmo)
                        {
                            t8header.UpdateVinAndImmoCode();
                        }
                        // We don't want this code atm, it's a bit unsafe
            #if (DEBUG)
                        //t8header.UpdatePIarea();
            #endif
                        UpdateChecksum(m_currentfile, m_appSettings.AutoChecksum);
                    }
                }
            }
        }
        private void LoadCompressorMapWithDetails()
        {
            // we should get the top line like for the chart

            if (gridControl1.DataSource != null)
            {
                TurboType tt = TurboType.TD0415T;
                if (ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.T25_55 || ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.T25_60 || ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.GT17)
                {
                    tt = TurboType.Stock;
                }
                else if (ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.TD04 || ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.TD0416T)
                {
                    tt = TurboType.TD0415T;
                }
                else if (ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.TD0418T || ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.TD0419T)
                {
                    tt = TurboType.TD0419T;
                }
                else if (ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.GT2871R || ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.GT28RS)
                {
                    tt = TurboType.GT28RS;
                }
                else if (ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.GT3071R86 || ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.GT30R)
                {
                    tt = TurboType.GT3071R;
                }
                else if (ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.GT40R || ctrlCompressorMap1.Compressor == ctrlCompressorMap.CompressorMap.HX40W)
                {
                    tt = TurboType.HX40w;
                }
                DataTable dt = (DataTable)gridControl1.DataSource;
                double[] boost_req = new double[dt.Columns.Count];
                /*PressureToTorque ptt = new PressureToTorque();

                 <GS-09032011> changed to airmass calculation
                for (int i = 0; i < dt.Rows[0].ItemArray.Length; i++)
                {
                    double o = Convert.ToDouble(dt.Rows[0].ItemArray.GetValue(i));
                    // we get the airmass from this.. now convert to boost pressure
                    double trq = AirmassToTorque(Convert.ToInt32(o), Convert.ToInt32(x_axisvalues.GetValue(i)), checkEdit7.Checked);
                    double val = ptt.CalculatePressureFromTorque(trq, tt );
                    boost_req.SetValue(val, i);
                }*/

                for (int i = 0; i < dt.Rows[0].ItemArray.Length; i++)
                {
                    double o = Convert.ToDouble(dt.Rows[0].ItemArray.GetValue(i));
                    boost_req.SetValue(o, i);
                }
                ctrlCompressorMap1.Boost_request = boost_req;
                // set rpm range
                ctrlCompressorMap1.Rpm_points = pedal_Xaxis;

                if (!ctrlCompressorMap1.IsInitiallyLoaded)
                {
                    T8Header header = new T8Header();
                    header.init(m_currentfile);
                    // Partnumber
                    //PartNumberConverter pnc = new PartNumberConverter();
                    //ECUInformation ecuinfo = pnc.GetECUInfo(header.PartNumber.Trim(), "");
                    //ecuinfo.Turbomodel;
                    // VIN
                    VINDecoder decoder = new VINDecoder();
                    VINCarInfo carinfo = decoder.DecodeVINNumber(header.ChassisID);
                    if (carinfo.TurboModel == VINTurboModel.MitsubishiTD04L_14T)
                    {
                        ctrlCompressorMap1.SetCompressorType(ctrlCompressorMap.CompressorMap.TD04);
                    }
                    else
                    {
                        ctrlCompressorMap1.SetCompressorType(ctrlCompressorMap.CompressorMap.GT17);
                    }

                    ctrlCompressorMap1.Current_engineType = ctrlCompressorMap.EngineType.Liter2;
                }

                ctrlCompressorMap1.IsInitiallyLoaded = true;
                ctrlCompressorMap1.Redraw();
            }
        }