private void AddPartNumber(string part, string my)
        {
            PartNumberConverter pnc     = new PartNumberConverter();
            ECUInformation      ecuinfo = new ECUInformation();

            ecuinfo = pnc.GetECUInfo(part, "");
            dt.Rows.Add(ecuinfo.Carmodel.ToString(), ecuinfo.Enginetype.ToString(), part, ecuinfo.Turbomodel.ToString(), ecuinfo.Isturbo.ToString(), ecuinfo.Bhp.ToString(), ecuinfo.Torque.ToString(), ecuinfo.Softwareversion, ecuinfo.EmissionVariant.ToString().Replace('_', ' ').Replace("x", " ").Replace("None", ""), my);
        }
        private void ConvertPartNumber()
        {
            PartNumberConverter pnc     = new PartNumberConverter();
            ECUInformation      ecuinfo = pnc.GetECUInfo(buttonEdit1.Text, "");

            lblCarModel.Text   = "---";
            lblEngineType.Text = "---";


            lblPower.Text = "---";



            lblTorque.Text     = "---";
            checkEdit1.Checked = false;
            checkEdit2.Checked = false;

            checkEdit4.Checked = false;
            checkEdit5.Checked = false;

            if (ecuinfo.Valid)
            {
                lblCarModel.Text   = ecuinfo.Carmodel.ToString();
                lblEngineType.Text = ecuinfo.Enginetype.ToString();


                lblPower.Text = ecuinfo.Bhp.ToString() + " bhp";
                //lblStageI.Text = ecuinfo.Stage1boost.ToString() + " bar";
                //lblStageII.Text = ecuinfo.Stage2boost.ToString() + " bar";
                //lblStageIII.Text = ecuinfo.Stage3boost.ToString() + " bar";
                if (ecuinfo.Is2point3liter)
                {
                    checkEdit1.Checked = false;
                    checkEdit2.Checked = true;
                }
                else
                {
                    checkEdit1.Checked = true;
                    checkEdit2.Checked = false;
                }
                if (ecuinfo.Isturbo)
                {
                    checkEdit4.Checked = true;
                }
                if (ecuinfo.Isfpt)
                {
                    checkEdit5.Checked = true;
                    checkEdit4.Checked = true;
                }
                if (ecuinfo.Isaero)
                {
                    checkEdit4.Checked = true;
                    checkEdit5.Checked = true;
                }

                lblTorque.Text = ecuinfo.Torque.ToString() + " Nm";
                if (System.IO.File.Exists(Path.Combine(Application.StartupPath, "Binaries\\" + buttonEdit1.Text + ".BIN")))
                {
                    simpleButton2.Enabled = true;
                    simpleButton3.Enabled = true;
                    simpleButton4.Enabled = true;
                }
                else
                {
                    simpleButton2.Enabled = false;
                    simpleButton3.Enabled = false;
                    simpleButton4.Enabled = false;
                }
            }
            else
            {
                MessageBox.Show("The entered partnumber was not recognized by T7Suite");
            }
        }
Esempio n. 3
0
        private void ConvertPartNumber()
        {
            PartNumberConverter pnc     = new PartNumberConverter();
            ECUInformation      ecuinfo = pnc.GetECUInfo(buttonEdit1.Text, "");

            lblBaseBoost.Text      = "---";
            lblCarModel.Text       = "---";
            lblEngineType.Text     = "---";
            lblMaxBoostAUT.Text    = "---";
            lblMaxBoostManual.Text = "---";
            lblPower.Text          = "---";
            lblStageI.Text         = "---";
            lblStageII.Text        = "---";
            lblStageIII.Text       = "---";
            lblTorque.Text         = "---";
            checkEdit1.Checked     = false;
            checkEdit2.Checked     = false;
            checkEdit3.Checked     = false;
            checkEdit4.Checked     = false;
            checkEdit5.Checked     = false;
            checkEdit6.Checked     = false;
            lblRegion.Text         = "---";
            lblMYs.Text            = "---";
            lblEcuType.Visible     = false;
            lblEcuType.Text        = "---";

            if (ecuinfo.Valid)
            {
                lblBaseBoost.Text      = ecuinfo.Baseboost.ToString() + " bar";
                lblCarModel.Text       = ecuinfo.Carmodel.ToString();
                lblEngineType.Text     = ecuinfo.Enginetype.ToString();
                lblMaxBoostAUT.Text    = ecuinfo.Max_stock_boost_automatic.ToString() + " bar";
                lblMaxBoostManual.Text = ecuinfo.Max_stock_boost_manual.ToString() + " bar";
                lblPower.Text          = ecuinfo.Bhp.ToString() + " bhp";
                lblStageI.Text         = ecuinfo.Stage1boost.ToString() + " bar";
                lblStageII.Text        = ecuinfo.Stage2boost.ToString() + " bar";
                lblStageIII.Text       = ecuinfo.Stage3boost.ToString() + " bar";
                lblEcuType.Text        = ecuinfo.Ecutype;
                if (lblEcuType.Text == "T5.2")
                {
                    lblEcuType.Visible = true;
                }
                if (ecuinfo.MakeYearFrom != ecuinfo.MakeYearUpto)
                {
                    lblMYs.Text = ecuinfo.MakeYearFrom.ToString() + "-" + ecuinfo.MakeYearUpto.ToString();
                }
                else
                {
                    lblMYs.Text = ecuinfo.MakeYearFrom.ToString();
                }
                lblRegion.Text     = ecuinfo.Region;
                checkEdit6.Checked = ecuinfo.HighAltitude;

                if (ecuinfo.Is2point3liter)
                {
                    checkEdit1.Checked = false;
                    checkEdit2.Checked = true;
                }
                else
                {
                    checkEdit1.Checked = true;
                    checkEdit2.Checked = false;
                }
                if (ecuinfo.Isturbo)
                {
                    checkEdit4.Checked = true;
                }
                if (ecuinfo.Isfpt)
                {
                    checkEdit5.Checked = true;
                    checkEdit4.Checked = true;
                }
                if (ecuinfo.Isaero)
                {
                    checkEdit3.Checked = true;
                    checkEdit4.Checked = true;
                    checkEdit5.Checked = true;
                }

                lblTorque.Text = ecuinfo.Torque.ToString() + " Nm";
                if (System.IO.File.Exists(Path.Combine(Application.StartupPath, "Binaries\\" + buttonEdit1.Text + ".BIN")))
                {
                    simpleButton2.Enabled = true;
                    simpleButton3.Enabled = true;
                }
                else
                {
                    simpleButton2.Enabled = false;
                    simpleButton3.Enabled = false;
                }
            }
            else
            {
                MessageBox.Show("The entered partnumber was not recognized by T5Suite");
            }
        }
Esempio n. 4
0
        private void barButtonItem28_ItemClick(object sender, ItemClickEventArgs e)
        {
            // tune to stage 1!!!
            if (File.Exists(m_currentfile))
            {
                // read tuned marker to see if binary has been tuned before
                T8Header fh = new T8Header();
                fh.init(m_currentfile);
                PartNumberConverter pnc = new PartNumberConverter();
                ECUInformation ecuinfo = pnc.GetECUInfo(fh.PartNumber, "");

                // start window to ask user for desired horses (depending on E85 usage?)
                frmTuneBinary frmTune = new frmTuneBinary();
                if (frmTune.ShowDialog() == DialogResult.OK)
                {
                    int desiredHP = frmTune.DesiredHP;
                    bool carRunsE85 = frmTune.CarRunsE85;

                    // convert HP to torque and airmass
                    //int torque = PowerToTorque(desiredHP, 6000);
                    //int peaktorque = (110 * torque) / 100;
                    int peaktorque = frmTune.PeakTorque;
                    int maxairmass = TorqueToAirmass(peaktorque, carRunsE85);

                    // give user a warning if airmass/c > 1300 mg/c
                    if (maxairmass > 1300)
                    {
                        MessageBox.Show("Your maximum requested airmass exceeds 1300 mg/c [" + maxairmass.ToString() + " mg/c]. Please make sure all your other maps will support this airflow!", "Warning!", MessageBoxButtons.OK);
                    }

                    string msg = "Partnumber not recognized, tuning will continue anyway, please verify settings afterwards";
                    msg += Environment.NewLine + " desired airmass " + maxairmass.ToString() + " mg/c and peak torque " + peaktorque.ToString() + " Nm";
                    if (ecuinfo.Valid)
                    {
                        msg = "Partnumber " + fh.PartNumber + ", carmodel " + ecuinfo.Carmodel.ToString() + ", engine " + ecuinfo.Enginetype.ToString();
                        msg += Environment.NewLine + " desired airmass " + maxairmass.ToString() + " mg/c and peak torque " + peaktorque.ToString() + " Nm";
                    }
                    PSTaskDialog.cTaskDialog.ForceEmulationMode = false;
                    PSTaskDialog.cTaskDialog.EmulatedFormWidth = 600;
                    PSTaskDialog.cTaskDialog.UseToolWindowOnXP = false;
                    PSTaskDialog.cTaskDialog.VerificationChecked = true;
                    PSTaskDialog.cTaskDialog.ShowTaskDialogBox("Tune me up™ wizard", "This wizard will tune your binary.", "Several maps will be altered" + Environment.NewLine + msg, "Happy driving!!!\nDilemma © 2009", "The author does not take responsibility for any damage done to your car or other objects in any form!", "Show me a summary after tuning", "", "Yes, tune me up!|No thanks!", eTaskDialogButtons.None, eSysIcons.Information, eSysIcons.Warning);
                    switch (PSTaskDialog.cTaskDialog.CommandButtonResult)
                    {
                        case 0:
                            // tune to stage x
                            // must use fixed maps, scaled to be good for the current airmass (e.g. pedalrequest map)
                            //TuneToStageNew(1, maxairmass, peaktorque, desiredHP, ecuinfo.Enginetype, carRunsE85);
                            TuneMeUp(maxairmass, peaktorque, desiredHP, ecuinfo.Enginetype, carRunsE85);
                            break;
                        case 1:
                            // cancel
                            break;
                    }
                    if (PSTaskDialog.cTaskDialog.VerificationChecked && PSTaskDialog.cTaskDialog.CommandButtonResult != 1)
                    {
                        TuningReport tuningrep = new TuningReport();
                        tuningrep.DataSource = resumeTuning;
                        tuningrep.CreateReport();
                        tuningrep.ShowPreview(defaultLookAndFeel1.LookAndFeel);
                    }
                }
            }
        }