Exemplo n.º 1
0
        /// <summary>
        /// Determines which command to run.
        /// </summary>
        private static bool Run(string[] args)
        {
            if (args.Length < 1)
            {
                SharpTune.Program.RomModGui();
                return(true);
            }

            SharpTuner.Init();

            if (args[0] == "ecumaptool")
            {
                return(EcuMapTool.Run(Utils.ShiftLeftTruncate(args)));
            }
            else if (args[0] == "rommod")
            {
                return(SharpTune.RomMod.RomMod.Run(Utils.ShiftLeftTruncate(args)));
            }
            else if (args[0] == "xmltoidc")
            {
                //TODO FIX THIS!!
                //NSFW.XMLtoIDC.Run(args);
            }
            else if (args.Length == 2 && args[0] == "help")
            {
                PrintHelp(args[1]);
                return(true);
            }
            else if (args[0] == "deftools")
            {
                Trace.WriteLine("Running definition tools!");
                return(DefinitionTools.DefinitionTool(args));
            }
            return(false);
        }
Exemplo n.º 2
0
        //Trace.WriteLine("Convert .map file to C defines header (.h) and section file (.txt) using .xml translation: IDAtoHEW <file.xml> <file.map> <file.h> <file.txt>");
        //        Trace.WriteLine("Convert .map file to IDC script: IDAtoHEW <file.map> <file.idc>");
        //        Trace.WriteLine("Convert .h file to IDC script: IDAtoHEW <file.h> <file.idc>");

        private void button2_Click(object sender, EventArgs e)
        {
            switch (mode)
            {
            case "header":
                EcuMapTool.Run(availableDevices, new string[] { textBox1.Text, output + Path.GetFileName(textBox1.Text) + "_converted.idc" });
                //call header->idc
                break;

            case "map":
                if (convertToComboBox.SelectedItem.ToString() == mapoutputs[0])
                {
                    EcuMapTool.Run(availableDevices, new string[] { translationTextBox.Text, textBox1.Text, output + Path.GetFileName(textBox1.Text) + "_converted.h", output + Path.GetFileName(textBox1.Text) + "_converted_sections.txt" });
                    break;
                    //call map->hew
                }
                else
                {
                    EcuMapTool.Run(availableDevices, new string[] { textBox1.Text, output + Path.GetFileName(textBox1.Text) + "_converted.idc" });
                    //cal map>idc
                    break;
                }

            default:
                MessageBox.Show("Error! check your settings & files!!");
                Trace.WriteLine("Error! check your settings & files!!");
                return;
            }
            MessageBox.Show("Finished Conversion!");
            Trace.WriteLine("Finished Conversion!");
        }
Exemplo n.º 3
0
 /// <summary>
 /// Determines which command to run.
 /// </summary>
 private static bool Run(string[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     sharpTuner = new SharpTuner();
     if (args.Length < 1)
     {
         Application.Run(sharpTuner.mainWindow);
         return(true);
     }
     else
     {
         sharpTuner.Init();
         if (args[0] == "ecumaptool")
         {
             return(EcuMapTool.Run(sharpTuner.AvailableDevices, Utils.ShiftLeftTruncate(args)));
         }
         else if (args[0] == "rommod")
         {
             return(SharpTune.RomMod.RomMod.Run(sharpTuner.AvailableDevices, Utils.ShiftLeftTruncate(args)));
         }
         else if (args[0] == "xmlconvertor")
         {
             ECU      di  = new ECU(sharpTuner, args[1]);
             XMLtoIDC xti = new XMLtoIDC(di);
             //TODO clean up this routine: xti.Run(args);
         }
         else if (args.Length == 2 && args[0] == "help")
         {
             PrintHelp_RomMod(args[1]);
             return(true);
         }
     }
     return(false);
 }