auto-sync
This commit is contained in:
parent
3cc4e99473
commit
f6a18d97b6
|
@ -19,6 +19,12 @@
|
||||||
class FuelSchedule {
|
class FuelSchedule {
|
||||||
public:
|
public:
|
||||||
ActuatorEventList events;
|
ActuatorEventList events;
|
||||||
|
|
||||||
|
void addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
|
||||||
|
injection_mode_e mode);
|
||||||
|
void registerInjectionEvent(engine_configuration_s const *e, trigger_shape_s *s,
|
||||||
|
io_pin_e pin, float angle);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,9 +53,6 @@ public:
|
||||||
|
|
||||||
void initializeIgnitionActions(float advance, float dwellAngle, engine_configuration_s *engineConfiguration,
|
void initializeIgnitionActions(float advance, float dwellAngle, engine_configuration_s *engineConfiguration,
|
||||||
engine_configuration2_s *engineConfiguration2, IgnitionEventList *list);
|
engine_configuration2_s *engineConfiguration2, IgnitionEventList *list);
|
||||||
void addFuelEvents(engine_configuration_s const *e,
|
|
||||||
trigger_shape_s * ts,
|
|
||||||
FuelSchedule *fs, injection_mode_e mode);
|
|
||||||
|
|
||||||
void setDefaultNonPersistentConfiguration(engine_configuration2_s *engineConfiguration2);
|
void setDefaultNonPersistentConfiguration(engine_configuration2_s *engineConfiguration2);
|
||||||
void printConfiguration(engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2);
|
void printConfiguration(engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2);
|
||||||
|
|
|
@ -171,8 +171,9 @@ void initializeIgnitionActions(float advance, float dwellAngle, engine_configura
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void registerInjectionEvent(engine_configuration_s const *e, trigger_shape_s *s, ActuatorEventList *list,
|
void FuelSchedule::registerInjectionEvent(engine_configuration_s const *e, trigger_shape_s *s,
|
||||||
io_pin_e pin, float angle) {
|
io_pin_e pin, float angle) {
|
||||||
|
ActuatorEventList *list = &events;
|
||||||
|
|
||||||
if (!isPinAssigned(pin)) {
|
if (!isPinAssigned(pin)) {
|
||||||
// todo: extact method for this index math
|
// todo: extact method for this index math
|
||||||
|
@ -182,10 +183,9 @@ static void registerInjectionEvent(engine_configuration_s const *e, trigger_shap
|
||||||
registerActuatorEventExt(e, s, list->getNextActuatorEvent(), injectonSignals.add(pin), angle);
|
registerActuatorEventExt(e, s, list->getNextActuatorEvent(), injectonSignals.add(pin), angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
|
void FuelSchedule::addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
|
||||||
FuelSchedule *fs,
|
|
||||||
injection_mode_e mode) {
|
injection_mode_e mode) {
|
||||||
ActuatorEventList *list = &fs->events;
|
ActuatorEventList *list = &events;
|
||||||
;
|
;
|
||||||
list->resetEventList();
|
list->resetEventList();
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ void addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
|
||||||
for (int i = 0; i < e->cylindersCount; i++) {
|
for (int i = 0; i < e->cylindersCount; i++) {
|
||||||
io_pin_e pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + getCylinderId(e->firingOrder, i) - 1);
|
io_pin_e pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + getCylinderId(e->firingOrder, i) - 1);
|
||||||
float angle = baseAngle + i * 720.0 / e->cylindersCount;
|
float angle = baseAngle + i * 720.0 / e->cylindersCount;
|
||||||
registerInjectionEvent(e, s, list, pin, angle);
|
registerInjectionEvent(e, s, pin, angle);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IM_SIMULTANEOUS:
|
case IM_SIMULTANEOUS:
|
||||||
|
@ -205,7 +205,7 @@ void addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
|
||||||
|
|
||||||
for (int j = 0; j < e->cylindersCount; j++) {
|
for (int j = 0; j < e->cylindersCount; j++) {
|
||||||
io_pin_e pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + j);
|
io_pin_e pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + j);
|
||||||
registerInjectionEvent(e, s, list, pin, angle);
|
registerInjectionEvent(e, s, pin, angle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -214,13 +214,13 @@ void addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
|
||||||
int index = i % (e->cylindersCount / 2);
|
int index = i % (e->cylindersCount / 2);
|
||||||
io_pin_e pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + index);
|
io_pin_e pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + index);
|
||||||
float angle = baseAngle + i * 720.0 / e->cylindersCount;
|
float angle = baseAngle + i * 720.0 / e->cylindersCount;
|
||||||
registerInjectionEvent(e, s, list, pin, angle);
|
registerInjectionEvent(e, s, pin, angle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* also fire the 2nd half of the injectors so that we can implement a batch mode on individual wires
|
* also fire the 2nd half of the injectors so that we can implement a batch mode on individual wires
|
||||||
*/
|
*/
|
||||||
pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + index + (e->cylindersCount / 2));
|
pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + index + (e->cylindersCount / 2));
|
||||||
registerInjectionEvent(e, s, list, pin, angle);
|
registerInjectionEvent(e, s, pin, angle);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -356,9 +356,9 @@ engine_configuration2_s *engineConfiguration2 = engine->engineConfiguration2;
|
||||||
trigger_shape_s * ts = &engineConfiguration2->triggerShape;
|
trigger_shape_s * ts = &engineConfiguration2->triggerShape;
|
||||||
|
|
||||||
injectonSignals.clear();
|
injectonSignals.clear();
|
||||||
addFuelEvents(engineConfiguration, ts, &engineConfiguration2->crankingInjectionEvents,
|
engineConfiguration2->crankingInjectionEvents.addFuelEvents(engineConfiguration, ts,
|
||||||
engineConfiguration->crankingInjectionMode);
|
engineConfiguration->crankingInjectionMode);
|
||||||
addFuelEvents(engineConfiguration, ts, &engineConfiguration2->injectionEvents,
|
engineConfiguration2->injectionEvents.addFuelEvents(engineConfiguration, ts,
|
||||||
engineConfiguration->injectionMode);
|
engineConfiguration->injectionMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import javax.swing.*;
|
||||||
* @see WavePanel
|
* @see WavePanel
|
||||||
*/
|
*/
|
||||||
public class Launcher extends FrameHelper {
|
public class Launcher extends FrameHelper {
|
||||||
public static final int CONSOLE_VERSION = 20141105;
|
public static final int CONSOLE_VERSION = 20141107;
|
||||||
public static final boolean SHOW_STIMULATOR = true;
|
public static final boolean SHOW_STIMULATOR = true;
|
||||||
private final String port;
|
private final String port;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi;
|
||||||
|
|
||||||
import com.irnems.FileLog;
|
import com.irnems.FileLog;
|
||||||
import com.rusefi.io.tcp.TcpConnector;
|
import com.rusefi.io.tcp.TcpConnector;
|
||||||
|
import com.rusefi.ui.widgets.URLLabel;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
@ -28,7 +29,7 @@ public class VersionChecker {
|
||||||
private static final VersionChecker instance = new VersionChecker();
|
private static final VersionChecker instance = new VersionChecker();
|
||||||
|
|
||||||
|
|
||||||
private final Map<String, Integer> map = new HashMap<>();
|
private final Map<String, String> map = new HashMap<>();
|
||||||
private int previousReportedVersion;
|
private int previousReportedVersion;
|
||||||
|
|
||||||
private VersionChecker() {
|
private VersionChecker() {
|
||||||
|
@ -59,14 +60,22 @@ public class VersionChecker {
|
||||||
while ((line = s.readLine()) != null) {
|
while ((line = s.readLine()) != null) {
|
||||||
String[] pair = line.split("=");
|
String[] pair = line.split("=");
|
||||||
if (pair.length == 2)
|
if (pair.length == 2)
|
||||||
map.put(pair[0], TcpConnector.parseIntWithReason(pair[1], "VC value"));
|
map.put(pair[0], pair[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final Integer javaVersion = map.get(JAVA_CONSOLE_TAG);
|
final Integer javaVersion = TcpConnector.parseIntWithReason(map.get(JAVA_CONSOLE_TAG), "VC value");
|
||||||
System.out.println("Server recommends java_console version " + javaVersion + " or newer");
|
System.out.println("Server recommends java_console version " + javaVersion + " or newer");
|
||||||
showUpdateWarningIfNeeded("dev console", javaVersion, CONSOLE_VERSION);
|
showUpdateWarningIfNeeded("dev console", javaVersion, CONSOLE_VERSION);
|
||||||
System.out.println("Server recommends firmware " + map.get(FIRMWARE_TAG) + " or newer");
|
System.out.println("Server recommends firmware " + map.get(FIRMWARE_TAG) + " or newer");
|
||||||
|
|
||||||
|
String criticalUrl = map.get("critical_url");
|
||||||
|
if (criticalUrl != null && !criticalUrl.trim().isEmpty()) {
|
||||||
|
JPanel panel = new JPanel(new BorderLayout());
|
||||||
|
panel.add(new JLabel("WARNING! CRITICAL ISSUE! Are you sure you want to run rusEfi?"), BorderLayout.NORTH);
|
||||||
|
panel.add(new URLLabel(criticalUrl, criticalUrl), BorderLayout.CENTER);
|
||||||
|
JOptionPane.showMessageDialog(getPaneParent(), panel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void showUpdateWarningIfNeeded(final String componentName, final Integer latestVersion, final int currentVersion) {
|
private static void showUpdateWarningIfNeeded(final String componentName, final Integer latestVersion, final int currentVersion) {
|
||||||
|
@ -75,25 +84,29 @@ public class VersionChecker {
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Component parent = JFrame.getFrames()[0];
|
|
||||||
String message = "It's time to update " + componentName + "!\r\n" +
|
String message = "It's time to update " + componentName + "!\r\n" +
|
||||||
"Your version: " + currentVersion + "\r\n" +
|
"Your version: " + currentVersion + "\r\n" +
|
||||||
"Latest version: " + latestVersion;
|
"Latest version: " + latestVersion;
|
||||||
JOptionPane.showMessageDialog(parent, message, "Update", JOptionPane.WARNING_MESSAGE);
|
JOptionPane.showMessageDialog(getPaneParent(), message, "Update", JOptionPane.WARNING_MESSAGE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Component getPaneParent() {
|
||||||
|
return JFrame.getFrames()[0];
|
||||||
|
}
|
||||||
|
|
||||||
public static VersionChecker getInstance() {
|
public static VersionChecker getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFirmwareVersion(String firmwareString) {
|
public void onFirmwareVersion(String firmwareString) {
|
||||||
Integer latestVersion = map.get(FIRMWARE_TAG);
|
String suggestedFirmware = map.get(FIRMWARE_TAG);
|
||||||
if (latestVersion == null) {
|
if (suggestedFirmware == null) {
|
||||||
// no version file yet? nothing to bother about
|
// no version file yet? nothing to bother about
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int latestVersion = TcpConnector.parseIntWithReason(suggestedFirmware, "VC value");
|
||||||
String[] tokens = firmwareString.split("[@\\s]");
|
String[] tokens = firmwareString.split("[@\\s]");
|
||||||
int version;
|
int version;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue