only:Improve toolset for default tune canned tune generation #4871

This commit is contained in:
rusefillc 2023-06-17 17:00:25 -04:00
parent 9a27431161
commit e4f20cf49a
5 changed files with 9 additions and 6 deletions

View File

@ -39,7 +39,7 @@ public class FiringOrderTSLogic {
}
private static void readFiringOrders(String fileName, State state) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(fileName));
BufferedReader br = new BufferedReader(new FileReader(RootHolder.ROOT + fileName));
String line;
while ((line = br.readLine()) != null) {

View File

@ -32,7 +32,7 @@ public class IoUtil2 {
}
private static long getCrc32(String fileName) throws IOException {
File file = new File(fileName);
File file = new File(RootHolder.ROOT + fileName);
byte[] fileContent = Files.readAllBytes(file.toPath());
for (int i = 0; i < fileContent.length; i++) {
byte aByte = fileContent[i];

View File

@ -94,8 +94,6 @@ public class ReaderStateImpl implements ReaderState {
@Override
public void doJob() throws IOException {
if (destinations.isEmpty())
throw new IllegalArgumentException("No destinations specified");
for (String prependFile : prependFiles)
variableRegistry.readPrependValues(prependFile);
@ -105,7 +103,7 @@ public class ReaderStateImpl implements ReaderState {
* the destinations/writers
*/
SystemOut.println("Reading definition from " + definitionInputFile);
BufferedReader definitionReader = new BufferedReader(new InputStreamReader(new FileInputStream(definitionInputFile), IoUtils.CHARSET.name()));
BufferedReader definitionReader = new BufferedReader(new InputStreamReader(new FileInputStream(RootHolder.ROOT + definitionInputFile), IoUtils.CHARSET.name()));
readBufferedReader(definitionReader, destinations);
if (destCDefinesFileName != null) {

View File

@ -0,0 +1,5 @@
package com.rusefi;
public class RootHolder {
public static String ROOT = "";
}

View File

@ -61,7 +61,7 @@ public class VariableRegistry {
}
public void readPrependValues(String prependFile) throws IOException {
readPrependValues(new FileReader(prependFile));
readPrependValues(new FileReader(RootHolder.ROOT + prependFile));
}
public void readPrependValues(Reader fileReader) throws IOException {