Whatever we call it, no matter how we do it - we need live data / remote view into rusEFI actual state #3353

progress
This commit is contained in:
rusefillc 2021-10-14 15:53:14 -04:00
parent 6aef432417
commit 6d01c5ea83
3 changed files with 5 additions and 8 deletions

View File

@ -13,7 +13,7 @@ public enum StateDictionary {
INSTANCE;
public static final int NONE = -1;
private Map<Integer, Field[]> map = new HashMap<>();
private final Map<Integer, Field[]> map = new HashMap<>();
StateDictionary() {
register(Fields.LDS_SPEED_DENSITY_STATE_INDEX, EngineState.VALUES); // 2
@ -26,6 +26,7 @@ public enum StateDictionary {
// LDS_ALTERNATOR_PID_STATE_INDEX
// LDS_CJ125_PID_STATE_INDEX
register(Fields.LDS_TRIGGER_STATE_STATE_INDEX, TriggerState.VALUES); // 11
register(Fields.LDS_AC_STATE, AcControl.VALUES); // 12
}
private void register(int ldsIndex, Field[] values) {

View File

@ -30,6 +30,9 @@ import static com.devexperts.logging.Logging.getLogging;
import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
/**
* this panel shows a live view of rusEFI firmware C/C++ code
*/
public class LiveDataParserPanel {
private static final Logging log = getLogging(LiveDataParserPanel.class);
@ -58,14 +61,10 @@ public class LiveDataParserPanel {
applyVariables(valueSource, sourceCode, new SourceCodePainter() {
@Override
public void paint(Color color, Range range) {
AttributeSet s = sc.addAttribute(oldSet, StyleConstants.Background, color);
style.setCharacterAttributes(range.getStart(), range.getLength(), s, true);
}
}, tree);
} catch (IOException | URISyntaxException e) {
log.warn("Error reading: " + e);
}

View File

@ -1,7 +1,5 @@
package com.rusefi.livedata;
import com.rusefi.core.ValueSource;
import com.rusefi.ui.livedata.LiveDataParserTest;
import com.rusefi.ui.livedata.VariableValueSource;
import com.rusefi.ui.util.FrameHelper;
@ -21,7 +19,6 @@ public class LiveDataParserSandbox {
}
};
new FrameHelper().showFrame(new LiveDataParserPanel(valueSource).getContent());
}
}