decompile_fsio_line

This commit is contained in:
rusefillc 2020-12-12 10:40:55 -05:00
parent c28a62d87d
commit d375bfefac
3 changed files with 15 additions and 1 deletions

View File

@ -4,4 +4,4 @@
# (max(90, min(coolant, 110)) - 90) / 20 would be in 0 to 1 range
# (max(90, min(coolant, 110)) - 90) / 20 * 0.8 would be in 0 to 0.8 range
java -jar ../java_console_binary/rusefi_console.jar compile "0.15 + (max(90, min(coolant, 110)) - 90) / 20 * 0.8"
java -jar ../java_console_binary/rusefi_console.jar compile_fsio_line "0.15 + (max(90, min(coolant, 110)) - 90) / 20 * 0.8"

View File

@ -0,0 +1,2 @@
java -jar ../java_console_binary/rusefi_console.jar decompile_fsio_line "map 40 < rpm 2000 > clt 70 > & & 1 0 if"

View File

@ -61,6 +61,7 @@ public class ConsoleTools {
registerTool("get_xml_tune_crc", ConsoleTools::calcXmlImageTuneCrc, "Calculate tune CRC for given XML tune");
registerTool("compile_fsio_line", ConsoleTools::invokeCompileExpressionTool, "Convert a line to RPN form.");
registerTool("decompile_fsio_line", ConsoleTools::invokeDecompileExpressionTool, "Convert a line from RPN form.");
registerTool("compile_fsio_file", ConsoleTools::runCompileTool, "Convert all lines from a file to RPN form.");
registerTool("network_connector", strings -> NetworkConnectorStartup.start(), "Connect your rusEFI ECU to rusEFI Online");
@ -308,6 +309,17 @@ public class ConsoleTools {
return CompileTool.run(Arrays.asList(args).subList(1, args.length));
}
private static void invokeDecompileExpressionTool(String[] args) {
if (args.length != 2) {
System.err.println("input RPN parameter expected");
System.exit(-1);
}
String rpn = args[1];
String humanForm = InfixConverter.getHumanInfixFormOrError(rpn);
System.out.println(humanForm);
}
private static void invokeCompileExpressionTool(String[] args) {
if (args.length != 2) {
System.err.println("input expression parameter expected");