Example #1
0
        private void buttonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            // show the flashblock browser
            DataTable dt = new DataTable();

            dt.Columns.Add("Blocknumber", Type.GetType("System.Int32"));
            dt.Columns.Add("Blocktype");
            dt.Columns.Add("Address");
            dt.Columns.Add("VIN");
            dt.Columns.Add("ECU type");
            dt.Columns.Add("Interface");
            dt.Columns.Add("SecretCode");
            T8Header t8header = new T8Header();

            t8header.init(m_filename);

            foreach (FlashBlock fb in t8header.FlashBlocks)
            {
                string vin           = string.Empty;
                string ecudescr      = string.Empty;
                string interfacetype = string.Empty;
                string secretcode    = string.Empty;
                fb.DecodeBlock(out vin, out ecudescr, out interfacetype, out secretcode);
                dt.Rows.Add(fb.BlockNumber, fb.BlockType.ToString(), fb.BlockAddress.ToString("X8"), vin, ecudescr, interfacetype, secretcode);
            }
            frmFlashBlockBrowser browser = new frmFlashBlockBrowser();

            browser.SetData(dt);
            browser.ShowDialog();
        }
        private void buttonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            // show the flashblock browser
            DataTable dt = new DataTable();
            dt.Columns.Add("Blocknumber", Type.GetType("System.Int32"));
            dt.Columns.Add("Blocktype");
            dt.Columns.Add("Address");
            dt.Columns.Add("VIN");
            dt.Columns.Add("ECU type");
            dt.Columns.Add("Interface");
            dt.Columns.Add("SecretCode");
            T8Header t8header = new T8Header();
            t8header.init(m_filename);

            foreach (FlashBlock fb in t8header.FlashBlocks)
            {
                string vin = string.Empty;
                string ecudescr = string.Empty;
                string interfacetype = string.Empty;
                string secretcode = string.Empty;
                fb.DecodeBlock(out vin, out ecudescr, out interfacetype, out secretcode);
                dt.Rows.Add(fb.BlockNumber, fb.BlockType.ToString(), fb.BlockAddress.ToString("X8"), vin, ecudescr, interfacetype, secretcode);
            }
            frmFlashBlockBrowser browser = new frmFlashBlockBrowser();
            browser.SetData(dt);
            browser.ShowDialog();
        }