show progress reason from iobcobthread

This commit is contained in:
Milos Kozak 2018-05-02 18:39:37 +02:00
parent e42d5f1204
commit 4cc952900d
2 changed files with 6 additions and 1 deletions

View file

@ -371,6 +371,10 @@ public class MainApp extends Application {
return engineeringMode || !devBranch; return engineeringMode || !devBranch;
} }
public static boolean isDev() {
return devBranch;
}
public String getLogDirectory() { public String getLogDirectory() {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
return lc.getProperty("EXT_FILES_DIR"); return lc.getProperty("EXT_FILES_DIR");

View file

@ -98,7 +98,8 @@ public class IobCobThread extends Thread {
AutosensData previous = autosensDataTable.get(prevDataTime); AutosensData previous = autosensDataTable.get(prevDataTime);
// start from oldest to be able sub cob // start from oldest to be able sub cob
for (int i = bucketed_data.size() - 4; i >= 0; i--) { for (int i = bucketed_data.size() - 4; i >= 0; i--) {
MainApp.bus().post(new EventIobCalculationProgress(i + "/" + bucketed_data.size())); String progress = i + (MainApp.isDev() ? " (" + from + ")" : "");
MainApp.bus().post(new EventIobCalculationProgress(progress));
if (iobCobCalculatorPlugin.stopCalculationTrigger) { if (iobCobCalculatorPlugin.stopCalculationTrigger) {
iobCobCalculatorPlugin.stopCalculationTrigger = false; iobCobCalculatorPlugin.stopCalculationTrigger = false;