console does not work for custom FW #6961

This commit is contained in:
rusefillc 2024-10-01 00:35:21 -04:00
parent c1ba9b1b32
commit 50c11cf778
6 changed files with 14 additions and 15 deletions

View File

@ -70,6 +70,10 @@ public class BinaryProtocol {
public static boolean DISABLE_LOCAL_CONFIGURATION_CACHE; public static boolean DISABLE_LOCAL_CONFIGURATION_CACHE;
public static IniFileProvider iniFileProvider = new RealIniFileProvider(); public static IniFileProvider iniFileProvider = new RealIniFileProvider();
public IniFileModel getIniFile() {
return iniFile;
}
public static String findCommand(byte command) { public static String findCommand(byte command) {
switch (command) { switch (command) {
case Integration.TS_PAGE_COMMAND: case Integration.TS_PAGE_COMMAND:
@ -377,7 +381,7 @@ public class BinaryProtocol {
if (ConnectionAndMeta.saveSettingsToFile()) { if (ConnectionAndMeta.saveSettingsToFile()) {
ConfigurationImageFile.saveToFile(image, CONFIGURATION_RUSEFI_BINARY); ConfigurationImageFile.saveToFile(image, CONFIGURATION_RUSEFI_BINARY);
} }
Msq tune = MsqFactory.valueOf(image, IniFileModelImpl.getInstance()); Msq tune = MsqFactory.valueOf(image, iniFile);
tune.writeXmlFile(CONFIGURATION_RUSEFI_XML); tune.writeXmlFile(CONFIGURATION_RUSEFI_XML);
} catch (Exception e) { } catch (Exception e) {
System.err.println("Ignoring " + e); System.err.println("Ignoring " + e);

View File

@ -10,7 +10,7 @@ public interface rusEFIVersion {
* *** BE CAREFUL WE HAVE SEPARATE AUTOUPDATE_VERSION also managed manually *** * *** BE CAREFUL WE HAVE SEPARATE AUTOUPDATE_VERSION also managed manually ***
* @see com.rusefi.autoupdate.Autoupdate#AUTOUPDATE_VERSION * @see com.rusefi.autoupdate.Autoupdate#AUTOUPDATE_VERSION
*/ */
int CONSOLE_VERSION = 20240930; int CONSOLE_VERSION = 20241001;
AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A"); AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
static long classBuildTimeMillis() { static long classBuildTimeMillis() {

View File

@ -25,7 +25,7 @@ public class OnlineTab {
upload.addActionListener(new AbstractAction() { upload.addActionListener(new AbstractAction() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Msq tune = MsqFactory.valueOf(uiContext.getLinkManager().getCurrentStreamState().getControllerConfiguration(), uiContext.getIni()); Msq tune = MsqFactory.valueOf(uiContext.getLinkManager().getCurrentStreamState().getControllerConfiguration(), null);
Online.uploadTune(tune, content, null); Online.uploadTune(tune, content, null);
} }
}); });

View File

@ -1,7 +1,5 @@
package com.rusefi.ui; package com.rusefi.ui;
import com.opensr5.ini.IniFileModel;
import com.opensr5.ini.IniFileModelImpl;
import com.rusefi.SensorSnifferCentral; import com.rusefi.SensorSnifferCentral;
import com.rusefi.io.CommandQueue; import com.rusefi.io.CommandQueue;
import com.rusefi.io.LinkManager; import com.rusefi.io.LinkManager;
@ -24,8 +22,4 @@ public class UIContext {
public CommandQueue getCommandQueue() { public CommandQueue getCommandQueue() {
return linkManager.getCommandQueue(); return linkManager.getCommandQueue();
} }
public IniFileModel getIni() {
return IniFileModelImpl.getInstance();
}
} }

View File

@ -92,7 +92,7 @@ public class MainFrame {
ConnectionWatchdog.init(linkManager); ConnectionWatchdog.init(linkManager);
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
tabbedPane.settingsTab.showContent(); tabbedPane.settingsTab.showContent(linkManager);
tabbedPane.logsManager.showContent(); tabbedPane.logsManager.showContent();
/** /**
* todo: we are definitely not handling reconnect properly, no code to shut down old instance of server * todo: we are definitely not handling reconnect properly, no code to shut down old instance of server

View File

@ -1,12 +1,11 @@
package com.rusefi.ui.console; package com.rusefi.ui.console;
import com.opensr5.ini.DialogModel; import com.opensr5.ini.DialogModel;
import com.opensr5.ini.IniFileModel;
import com.rusefi.config.Field; import com.rusefi.config.Field;
import com.rusefi.config.FieldType; import com.rusefi.config.FieldType;
import com.rusefi.config.FieldsMap; import com.rusefi.config.FieldsMap;
import com.rusefi.config.generated.Fields;
import com.rusefi.config.generated.Integration; import com.rusefi.config.generated.Integration;
import com.rusefi.io.LinkManager;
import com.rusefi.ui.RecentCommands; import com.rusefi.ui.RecentCommands;
import com.rusefi.ui.UIContext; import com.rusefi.ui.UIContext;
import com.rusefi.ui.config.*; import com.rusefi.ui.config.*;
@ -32,6 +31,7 @@ public class SettingsTab {
private final JButton dialog = new JButton(); private final JButton dialog = new JButton();
private final JPanel dialogBody = new JPanel(); private final JPanel dialogBody = new JPanel();
private final UIContext uiContext; private final UIContext uiContext;
private LinkManager linkManager;
public SettingsTab(UIContext uiContext) { public SettingsTab(UIContext uiContext) {
this.uiContext = uiContext; this.uiContext = uiContext;
@ -42,8 +42,9 @@ public class SettingsTab {
return content; return content;
} }
public void showContent() { public void showContent(LinkManager linkManager) {
final Map<String, DialogModel> dialogs = uiContext.getIni().getDialogs(); this.linkManager = linkManager;
final Map<String, DialogModel> dialogs = linkManager.getBinaryProtocol().getIniFile().getDialogs();
if (dialogs.isEmpty()) { if (dialogs.isEmpty()) {
content.removeAll(); content.removeAll();
content.add(new JLabel("Meta data not found: " + RUSEFI_INI_PREFIX + "*" + RUSEFI_INI_SUFFIX)); content.add(new JLabel("Meta data not found: " + RUSEFI_INI_PREFIX + "*" + RUSEFI_INI_SUFFIX));
@ -135,7 +136,7 @@ public class SettingsTab {
dialog.setText(name); dialog.setText(name);
dialogBody.removeAll(); dialogBody.removeAll();
DialogModel m = uiContext.getIni().getDialogs().get(name); DialogModel m = linkManager.getBinaryProtocol().getIniFile().getDialogs().get(name);
dialogBody.setLayout(new GridLayout(m.getFields().size(), 1)); dialogBody.setLayout(new GridLayout(m.getFields().size(), 1));