示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("ctp map to online tuner file converter. ecusystems.ru");

            using (var openFile = new OpenFileDialog())
                using (var saveFile = new SaveFileDialog())
                {
                    openFile.InitialDirectory = saveFile.InitialDirectory = Application.StartupPath;
                    openFile.Filter           = saveFile.Filter = "Map files|*.j5;*.j7|All files|*.*";

                    openFile.Title = "Укажите карту ChipTunerPro 3.21 для преобразования";
                    saveFile.Title = "Укажите имя файла для сохранения карты OnlineTuner";

                    if (openFile.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    if (saveFile.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }

                    var ctpMap = new CtpMap();
                    ctpMap.LoadFromFile(openFile.FileName);

                    ctpMap.SaveToFile(saveFile.FileName, true);
                }
        }
示例#2
0
        private void LoadSupportedRamTables()
        {
            ramTables = new CtpMap();
            var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\tables.map";

            ramTables.LoadFromFile(path);
        }
示例#3
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            using (var openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Title  = "Выберите карту CTP 3.21";
                openFileDialog.Filter = "Map files|*.j5;*.j7|All files|*.*";
                if (openFileDialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                ctpMap.LoadFromFile(openFileDialog.FileName);

                openFileDialog.Title    = "Выберите файл прошивки";
                openFileDialog.Filter   = "buffer files|*.bir;*.bin|all files|*.*";
                openFileDialog.FileName = String.Empty;
                if (openFileDialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                var fileInfo = new FileInfo(openFileDialog.FileName);

                if (fileInfo.Length != 0x10000 && !MapDataHelper.UnpackCtpFirmware(fileInfo, true, this))
                {
                    return;
                }

                buffer = File.ReadAllBytes(openFileDialog.FileName);
            }

            ctpMapTree.LoadMap(ctpMap, true);
            FirmwareHelper.FillRpmRT(buffer, out rpmSampling, out rpmRt32, out rpmRt16);

            for (int i = 0; i < 256; i++)
            {
                quantGrid.Rows[0].Cells[i].Value = rpmSampling[i].ToString();
            }

            for (int i = 0; i < 32; i++)
            {
                quant32Grid.Rows[0].Cells[i].Value = rpmRt32[i].ToString();
            }

            for (int i = 0; i < 16; i++)
            {
                quant16Grid.Rows[0].Cells[i].Value = rpmRt16[i].ToString();
            }
        }
示例#4
0
        private void LoadMap(string path)
        {
            ctpMap.LoadFromFile(path);
            bindingSource1.DataSource = ctpMap.Entries;
            bindingSource1.ResetBindings(false);

            bindingSource2.DataSource =
                ctpMap.Entries.Where(
                    entry =>
                    (entry.Entry2D != null && entry.Entry2D.Convert.ExInfo.CaptureRamId != 0) ||
                    (entry.Entry3D != null && entry.Entry3D.Convert.ExInfo.CaptureRamId != 0));
            bindingSource2.ResetBindings(false);

            bindingSource3.DataSource =
                ctpMap.Entries.Where(
                    entry =>
                    //(entry.Entry1D != null && entry.Entry1D.Const_type > 1) ||
                    (entry.Entry2D != null && entry.Entry2D.Const_type > 1) ||
                    (entry.Entry3D != null && entry.Entry3D.Const_type > 1));
            bindingSource3.ResetBindings(false);

            ctpMapTree.LoadMap(ctpMap);
        }