diff --git a/java_console/inifile/src/main/java/com/opensr5/ini/IniFileMetaInfoImpl.java b/java_console/inifile/src/main/java/com/opensr5/ini/IniFileMetaInfoImpl.java index 35c7b2ae2b..40344af168 100644 --- a/java_console/inifile/src/main/java/com/opensr5/ini/IniFileMetaInfoImpl.java +++ b/java_console/inifile/src/main/java/com/opensr5/ini/IniFileMetaInfoImpl.java @@ -25,7 +25,11 @@ public class IniFileMetaInfoImpl implements IniFileMetaInfo { public IniFileMetaInfoImpl(RawIniFile file) { nPages = file.getSimpleIntegerProperty("nPages", 1); - ochBlockSize = file.getSimpleIntegerProperty("ochBlockSize"); + try { + ochBlockSize = file.getSimpleIntegerProperty("ochBlockSize"); + } catch (Throwable e) { + throw new IllegalStateException("Error while reading " + file.msg); + } blockingFactor = file.getSimpleIntegerProperty("blockingFactor", DEFAULT_BLOCKING_FACTOR); diff --git a/java_console/inifile/src/main/java/com/opensr5/ini/IniFileReader.java b/java_console/inifile/src/main/java/com/opensr5/ini/IniFileReader.java index 844ebc47f7..ebef0515bb 100644 --- a/java_console/inifile/src/main/java/com/opensr5/ini/IniFileReader.java +++ b/java_console/inifile/src/main/java/com/opensr5/ini/IniFileReader.java @@ -79,10 +79,13 @@ public class IniFileReader { return c == ' ' || c == '\t' || c == '=' || c == ','; } + public static RawIniFile read(InputStream in) { + return read(in, "unknown"); + } /** * Just grabs an collection of lines, no parsing logic here */ - public static RawIniFile read(InputStream in) { + public static RawIniFile read(InputStream in, String msg) { List lines = new ArrayList<>(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); @@ -97,13 +100,13 @@ public class IniFileReader { } catch (IOException e) { throw new IllegalStateException(e); } - return new RawIniFile(lines); + return new RawIniFile(lines, msg); } public static RawIniFile read(File input) { try { InputStream in = new FileInputStream(input); - return read(in); + return read(in, input.getAbsolutePath()); } catch (FileNotFoundException e) { throw new IllegalStateException(e); } diff --git a/java_console/inifile/src/main/java/com/opensr5/ini/RawIniFile.java b/java_console/inifile/src/main/java/com/opensr5/ini/RawIniFile.java index 7ad9f0007b..9006710e9b 100644 --- a/java_console/inifile/src/main/java/com/opensr5/ini/RawIniFile.java +++ b/java_console/inifile/src/main/java/com/opensr5/ini/RawIniFile.java @@ -18,6 +18,7 @@ public class RawIniFile { * A list of lines. Lines which are only a comment were filtered out already. */ private final List lines; + final String msg; /** * Often we want to look-up line by first token. @@ -25,8 +26,9 @@ public class RawIniFile { */ private final Map asSet = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); - public RawIniFile(List lines) { + public RawIniFile(List lines, String msg) { this.lines = lines; + this.msg = msg; for (Line line : lines) { if (line.tokens.length > 1) diff --git a/java_console/io/src/main/java/com/rusefi/binaryprotocol/RealIniFileProvider.java b/java_console/io/src/main/java/com/rusefi/binaryprotocol/RealIniFileProvider.java index 5fe5ec8f12..e10e52c8b1 100644 --- a/java_console/io/src/main/java/com/rusefi/binaryprotocol/RealIniFileProvider.java +++ b/java_console/io/src/main/java/com/rusefi/binaryprotocol/RealIniFileProvider.java @@ -1,10 +1,14 @@ package com.rusefi.binaryprotocol; +import com.devexperts.logging.Logging; import com.opensr5.ini.IniFileModel; import com.opensr5.ini.IniFileModelImpl; import com.rusefi.core.SignatureHelper; +import static com.devexperts.logging.Logging.getLogging; + public class RealIniFileProvider implements IniFileProvider { + private static final Logging log = getLogging(RealIniFileProvider.class); @Override public IniFileModel provide(String signature) { /** @@ -14,6 +18,7 @@ public class RealIniFileProvider implements IniFileProvider { */ String localIniFile = SignatureHelper.downloadIfNotAvailable(SignatureHelper.getUrl(signature)); if (localIniFile == null) { + log.info("Failed to download " + signature + " maybe custom board?"); // 4th option: current folder localIniFile = IniFileModelImpl.findIniFile("."); } diff --git a/java_console/shared_io/src/main/java/com/rusefi/core/FindFileHelper.java b/java_console/shared_io/src/main/java/com/rusefi/core/FindFileHelper.java index bd67f85115..64eaad8aa9 100644 --- a/java_console/shared_io/src/main/java/com/rusefi/core/FindFileHelper.java +++ b/java_console/shared_io/src/main/java/com/rusefi/core/FindFileHelper.java @@ -17,6 +17,7 @@ public class FindFileHelper { @Nullable public static String findFile(String fileDirectory, String prefix, String suffix) { File dir = new File(fileDirectory); + log.info("Scanning " + dir.getAbsolutePath() + " for " + prefix + "/" + suffix); if (!dir.isDirectory()) { throw new IllegalStateException("Not a directory: " + fileDirectory); } diff --git a/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java b/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java index f723813884..43855214a8 100644 --- a/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java +++ b/java_console/shared_io/src/main/java/com/rusefi/core/rusEFIVersion.java @@ -10,7 +10,7 @@ public interface rusEFIVersion { * *** BE CAREFUL WE HAVE SEPARATE AUTOUPDATE_VERSION also managed manually *** * @see com.rusefi.autoupdate.Autoupdate#AUTOUPDATE_VERSION */ - int CONSOLE_VERSION = 20241031; + int CONSOLE_VERSION = 20241120; AtomicReference firmwareVersion = new AtomicReference<>("N/A"); static long classBuildTimeMillis() { diff --git a/java_tools/.idea/misc.xml b/java_tools/.idea/misc.xml index eca22b7b73..f99ad97b1a 100644 --- a/java_tools/.idea/misc.xml +++ b/java_tools/.idea/misc.xml @@ -1,4 +1,5 @@ + - + \ No newline at end of file diff --git a/java_tools/.idea/vcs.xml b/java_tools/.idea/vcs.xml index 352bda3e22..4db9c4e4aa 100644 --- a/java_tools/.idea/vcs.xml +++ b/java_tools/.idea/vcs.xml @@ -17,8 +17,6 @@ - - @@ -35,4 +33,4 @@ - + \ No newline at end of file