live data progress

This commit is contained in:
rusefillc 2022-01-10 23:39:27 -05:00
parent cca765ebe6
commit 742bbb372c
4 changed files with 17 additions and 7 deletions

View File

@ -6,7 +6,7 @@ import java.net.URL;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
public class rusEFIVersion { public class rusEFIVersion {
public static final int CONSOLE_VERSION = 20220101; public static final int CONSOLE_VERSION = 20220110;
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A"); public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
public static long classBuildTimeMillis() { public static long classBuildTimeMillis() {

View File

@ -173,7 +173,7 @@ public class LiveDataParserPanel {
} }
@NotNull @NotNull
private static LiveDataParserPanel createLiveDataParserPanel(UIContext uiContext, final live_data_e live_data_e, final Field[] values, String fileName) { public static LiveDataParserPanel createLiveDataParserPanel(UIContext uiContext, final live_data_e live_data_e, final Field[] values, String fileName) {
AtomicReference<byte[]> reference = new AtomicReference<>(); AtomicReference<byte[]> reference = new AtomicReference<>();
LiveDataParserPanel livePanel = new LiveDataParserPanel(uiContext, name -> { LiveDataParserPanel livePanel = new LiveDataParserPanel(uiContext, name -> {

View File

@ -1,7 +1,10 @@
package com.rusefi.ui; package com.rusefi.ui;
import com.rusefi.CodeWalkthrough; import com.rusefi.CodeWalkthrough;
import com.rusefi.config.Field;
import com.rusefi.core.Sensor; import com.rusefi.core.Sensor;
import com.rusefi.enums.live_data_e;
import com.rusefi.ldmp.StateDictionary;
import com.rusefi.livedata.LiveDataParserPanel; import com.rusefi.livedata.LiveDataParserPanel;
import com.rusefi.livedata.LiveDataView; import com.rusefi.livedata.LiveDataView;
import com.rusefi.ui.util.UiUtils; import com.rusefi.ui.util.UiUtils;
@ -35,10 +38,12 @@ public class LiveDataPane {
JPanel leftList = new JPanel(new VerticalFlowLayout()); JPanel leftList = new JPanel(new VerticalFlowLayout());
for (LiveDataView view : LiveDataView.values()) { for (live_data_e view : live_data_e.values()) {
JPanel liveDataParserContent = LiveDataParserPanel.createLiveDataParserContent(uiContext, view); String fileName = StateDictionary.INSTANCE.getFileName(view);
Field[] values = StateDictionary.INSTANCE.getFields(view);
JPanel liveDataParserContent = LiveDataParserPanel.createLiveDataParserPanel(uiContext, view, values, fileName).getContent();
JButton shortCut = new JButton(view.getFileName()); JButton shortCut = new JButton(fileName);
shortCut.addActionListener(new ActionListener() { shortCut.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

View File

@ -2,6 +2,8 @@ package com.rusefi.livedata;
import com.rusefi.CodeWalkthrough; import com.rusefi.CodeWalkthrough;
import com.rusefi.config.Field; import com.rusefi.config.Field;
import com.rusefi.enums.live_data_e;
import com.rusefi.ldmp.StateDictionary;
import com.rusefi.ui.livedata.SourceCodePainter; import com.rusefi.ui.livedata.SourceCodePainter;
import com.rusefi.ui.livedata.VariableValueSource; import com.rusefi.ui.livedata.VariableValueSource;
import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTree;
@ -18,8 +20,11 @@ public class LiveDataConventionTest {
@Test @Test
@Ignore @Ignore
public void assertLiveDataConvention() throws IOException, URISyntaxException { public void assertLiveDataConvention() throws IOException, URISyntaxException {
for (LiveDataView view : LiveDataView.values()) for (live_data_e view : live_data_e.values()) {
assertFile(view.getFileName(), view.getValues()); String fileName = StateDictionary.INSTANCE.getFileName(view);
Field[] values = StateDictionary.INSTANCE.getFields(view);
assertFile(fileName, values);
}
} }
private void assertFile(String fileName, Field[] values) throws IOException, URISyntaxException { private void assertFile(String fileName, Field[] values) throws IOException, URISyntaxException {