REO progress
This commit is contained in:
parent
8de0d0cb39
commit
60939e2260
|
@ -546,7 +546,7 @@
|
|||
#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle"
|
||||
#define GAUGE_NAME_ECU_TEMPERATURE "ECU temperature"
|
||||
#define GAUGE_NAME_ENGINE_LOAD "Engine Load"
|
||||
#define GAUGE_NAME_ETB_DUTY "ETB duty cycle"
|
||||
#define GAUGE_NAME_ETB_DUTY "ETB Duty"
|
||||
#define GAUGE_NAME_ETB_ERROR "ETB position error"
|
||||
#define GAUGE_NAME_ETB_TARGET "ETB position target"
|
||||
#define GAUGE_NAME_FUEL_BARO_CORR "fuel: Barometric pressure correction"
|
||||
|
|
|
@ -546,7 +546,7 @@
|
|||
#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle"
|
||||
#define GAUGE_NAME_ECU_TEMPERATURE "ECU temperature"
|
||||
#define GAUGE_NAME_ENGINE_LOAD "Engine Load"
|
||||
#define GAUGE_NAME_ETB_DUTY "ETB duty cycle"
|
||||
#define GAUGE_NAME_ETB_DUTY "ETB Duty"
|
||||
#define GAUGE_NAME_ETB_ERROR "ETB position error"
|
||||
#define GAUGE_NAME_ETB_TARGET "ETB position target"
|
||||
#define GAUGE_NAME_FUEL_BARO_CORR "fuel: Barometric pressure correction"
|
||||
|
|
|
@ -1449,7 +1449,7 @@ end_struct
|
|||
#define GAUGE_NAME_CPU_TEMP "CPU Temperature"
|
||||
#define GAUGE_NAME_ETB_TARGET "ETB position target"
|
||||
#define GAUGE_NAME_ETB_ERROR "ETB position error"
|
||||
#define GAUGE_NAME_ETB_DUTY "ETB duty cycle"
|
||||
#define GAUGE_NAME_ETB_DUTY "ETB Duty"
|
||||
|
||||
#define GAUGE_NAME_ACCEL_X "Acceleration: X"
|
||||
#define GAUGE_NAME_ACCEL_Y "Acceleration: Y"
|
||||
|
|
|
@ -89,7 +89,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 17:00:00 EDT 2020
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 18:44:35 EDT 2020
|
||||
|
||||
pageSize = 20000
|
||||
page = 1
|
||||
|
@ -2285,7 +2285,7 @@ gaugeCategory = Throttle Body (incl. ETB)
|
|||
|
||||
etbTargetGauge = etbTarget, "ETB position target", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
etbErrorGauge = etb1Error, "ETB position error", "%", -20, 20, -10, -5, 5, 10, 2, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB duty cycle", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB Duty", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
|
||||
gaugeCategory = Sensors - Raw
|
||||
rawTps1PrimaryGauge = rawTps1Primary, "Raw TPS 1 Primary", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
|
|
|
@ -1235,7 +1235,7 @@ gaugeCategory = Sensors - Raw
|
|||
|
||||
; Electronic throttle body
|
||||
entry = etb1Error, "ETB Error", float, "%.3f"
|
||||
entry = etb1DutyCycle, "ETB Duty", float, "%.3f"
|
||||
entry = etb1DutyCycle, @@GAUGE_NAME_ETB_DUTY@@, float, "%.3f"
|
||||
entry = etbTarget, "ETB Target", float, "%.3f"
|
||||
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 17:00:09 EDT 2020
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 18:44:44 EDT 2020
|
||||
|
||||
pageSize = 20000
|
||||
page = 1
|
||||
|
@ -2285,7 +2285,7 @@ gaugeCategory = Throttle Body (incl. ETB)
|
|||
|
||||
etbTargetGauge = etbTarget, "ETB position target", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
etbErrorGauge = etb1Error, "ETB position error", "%", -20, 20, -10, -5, 5, 10, 2, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB duty cycle", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB Duty", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
|
||||
gaugeCategory = Sensors - Raw
|
||||
rawTps1PrimaryGauge = rawTps1Primary, "Raw TPS 1 Primary", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
|
|
|
@ -89,7 +89,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Sun Jun 14 17:00:22 EDT 2020
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Sun Jun 14 18:44:56 EDT 2020
|
||||
|
||||
pageSize = 20000
|
||||
page = 1
|
||||
|
@ -2285,7 +2285,7 @@ gaugeCategory = Throttle Body (incl. ETB)
|
|||
|
||||
etbTargetGauge = etbTarget, "ETB position target", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
etbErrorGauge = etb1Error, "ETB position error", "%", -20, 20, -10, -5, 5, 10, 2, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB duty cycle", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB Duty", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
|
||||
gaugeCategory = Sensors - Raw
|
||||
rawTps1PrimaryGauge = rawTps1Primary, "Raw TPS 1 Primary", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
|
|
|
@ -89,7 +89,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 17:00:05 EDT 2020
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 18:44:40 EDT 2020
|
||||
|
||||
pageSize = 20000
|
||||
page = 1
|
||||
|
@ -2285,7 +2285,7 @@ gaugeCategory = Throttle Body (incl. ETB)
|
|||
|
||||
etbTargetGauge = etbTarget, "ETB position target", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
etbErrorGauge = etb1Error, "ETB position error", "%", -20, 20, -10, -5, 5, 10, 2, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB duty cycle", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB Duty", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
|
||||
gaugeCategory = Sensors - Raw
|
||||
rawTps1PrimaryGauge = rawTps1Primary, "Raw TPS 1 Primary", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
|
|
|
@ -89,7 +89,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 17:00:14 EDT 2020
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 18:44:48 EDT 2020
|
||||
|
||||
pageSize = 20000
|
||||
page = 1
|
||||
|
@ -2285,7 +2285,7 @@ gaugeCategory = Throttle Body (incl. ETB)
|
|||
|
||||
etbTargetGauge = etbTarget, "ETB position target", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
etbErrorGauge = etb1Error, "ETB position error", "%", -20, 20, -10, -5, 5, 10, 2, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB duty cycle", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB Duty", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
|
||||
gaugeCategory = Sensors - Raw
|
||||
rawTps1PrimaryGauge = rawTps1Primary, "Raw TPS 1 Primary", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
|
|
|
@ -89,7 +89,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 17:00:18 EDT 2020
|
||||
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 18:44:52 EDT 2020
|
||||
|
||||
pageSize = 20000
|
||||
page = 1
|
||||
|
@ -2285,7 +2285,7 @@ gaugeCategory = Throttle Body (incl. ETB)
|
|||
|
||||
etbTargetGauge = etbTarget, "ETB position target", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
etbErrorGauge = etb1Error, "ETB position error", "%", -20, 20, -10, -5, 5, 10, 2, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB duty cycle", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
etbDutyCycleGauge = etb1DutyCycle, "ETB Duty", "%", -100, 100, -75, -50, 50, 75, 0, 0
|
||||
|
||||
gaugeCategory = Sensors - Raw
|
||||
rawTps1PrimaryGauge = rawTps1Primary, "Raw TPS 1 Primary", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.config.generated;
|
||||
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 18:37:49 EDT 2020
|
||||
// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun Jun 14 18:44:35 EDT 2020
|
||||
|
||||
// by class com.rusefi.output.FileJavaFieldsConsumer
|
||||
import com.rusefi.config.*;
|
||||
|
@ -541,7 +541,7 @@ public class Fields {
|
|||
public static final String GAUGE_NAME_DWELL_DUTY = "dwell: coil duty cycle";
|
||||
public static final String GAUGE_NAME_ECU_TEMPERATURE = "ECU temperature";
|
||||
public static final String GAUGE_NAME_ENGINE_LOAD = "Engine Load";
|
||||
public static final String GAUGE_NAME_ETB_DUTY = "ETB duty cycle";
|
||||
public static final String GAUGE_NAME_ETB_DUTY = "ETB Duty";
|
||||
public static final String GAUGE_NAME_ETB_ERROR = "ETB position error";
|
||||
public static final String GAUGE_NAME_ETB_TARGET = "ETB position target";
|
||||
public static final String GAUGE_NAME_FUEL_BARO_CORR = "fuel: Barometric pressure correction";
|
||||
|
|
|
@ -95,7 +95,7 @@ public enum Sensor {
|
|||
|
||||
engineMakeCodeNameCrc16("engine crc16", SensorCategory.STATUS, FieldType.INT16, 134, 0, 5),
|
||||
// Errors
|
||||
errorCodeCounter("error counter", SensorCategory.STATUS, FieldType.INT, 136, 0, 5),
|
||||
totalTriggerErrorCounter(GAUGE_NAME_TRG_ERR, SensorCategory.STATUS, FieldType.INT, 136, 0, 5),
|
||||
lastErrorCode("last error", SensorCategory.STATUS, FieldType.INT, 138, 0, 5),
|
||||
|
||||
// Debug
|
||||
|
|
|
@ -18,11 +18,13 @@ import java.util.stream.Collectors;
|
|||
* </p>
|
||||
* Andrey Belomutskiy, (c) 2013-2020
|
||||
*/
|
||||
public class BinarySensorLog extends SensorLog {
|
||||
public class BinarySensorLog implements SensorLog {
|
||||
private final Function<Sensor, Double> valueProvider;
|
||||
private final Collection<Sensor> sensors;
|
||||
private DataOutputStream stream;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private int counter;
|
||||
|
||||
public BinarySensorLog() {
|
||||
|
@ -49,10 +51,10 @@ public class BinarySensorLog extends SensorLog {
|
|||
}
|
||||
|
||||
@Override
|
||||
void writeSensorLogLine() {
|
||||
public void writeSensorLogLine() {
|
||||
if (stream == null) {
|
||||
FileLog.createFolderIfNeeded();
|
||||
String fileName = FileLog.DIR + "rusEFI_gauges_" + FileLog.getDate() + ".mlg";
|
||||
fileName = FileLog.DIR + "rusEFI_gauges_" + FileLog.getDate() + ".mlg";
|
||||
|
||||
try {
|
||||
stream = new DataOutputStream(new FileOutputStream(fileName));
|
||||
|
@ -182,6 +184,10 @@ public class BinarySensorLog extends SensorLog {
|
|||
}
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
private void writeLine(DataOutputStream stream, String name, int length) throws IOException {
|
||||
for (int i = 0; i < name.length(); i++) {
|
||||
stream.write(name.charAt(i));
|
||||
|
|
|
@ -1,4 +1,68 @@
|
|||
package com.rusefi.sensor_logs;
|
||||
|
||||
public class BinarySensorLogRestarter {
|
||||
import com.rusefi.FileLog;
|
||||
import com.rusefi.Timeouts;
|
||||
import com.rusefi.core.Sensor;
|
||||
import com.rusefi.core.SensorCentral;
|
||||
import com.rusefi.tools.online.Online;
|
||||
import com.rusefi.ui.AuthTokenPanel;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class BinarySensorLogRestarter implements SensorLog {
|
||||
private final static Executor UPLOAD_EXECUTOR = Executors.newSingleThreadExecutor();
|
||||
|
||||
private BinarySensorLog logger;
|
||||
|
||||
private long seenRunning;
|
||||
|
||||
@Override
|
||||
public double getSecondsSinceFileStart() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void writeSensorLogLine() {
|
||||
double rpm = SensorCentral.getInstance().getValue(Sensor.RPM);
|
||||
if (rpm > 200) {
|
||||
seenRunning = System.currentTimeMillis();
|
||||
}
|
||||
if (rpm == 0 && seenRunning > 0 && (System.currentTimeMillis() - seenRunning) > 5 * Timeouts.SECOND) {
|
||||
// restart logging 5 seconds after last positive RPM
|
||||
close();
|
||||
}
|
||||
|
||||
if (logger == null) {
|
||||
logger = new BinarySensorLog();
|
||||
}
|
||||
logger.writeSensorLogLine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
if (logger != null) {
|
||||
logger.close();
|
||||
String fileName = logger.getFileName();
|
||||
scheduleUpload(fileName);
|
||||
}
|
||||
logger = null;
|
||||
seenRunning = 0;
|
||||
}
|
||||
|
||||
private void scheduleUpload(String fileName) {
|
||||
FileLog.MAIN.logLine("Will upload " + fileName);
|
||||
UPLOAD_EXECUTOR.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Online.upload(new File(fileName), AuthTokenPanel.getAuthToken());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class BinarySensorLogSandbox {
|
|||
Map<Sensor, Double> values = new HashMap<>();
|
||||
|
||||
Function<Sensor, Double> valueProvider = sensor -> {
|
||||
Double result = values.get(sensor);
|
||||
Double result = values.getOrDefault(sensor, 0.0);
|
||||
Objects.requireNonNull(result, "value for sensor");
|
||||
return result;
|
||||
};
|
||||
|
@ -21,6 +21,14 @@ public class BinarySensorLogSandbox {
|
|||
Sensor.TIME_SECONDS,
|
||||
Sensor.RPM,
|
||||
Sensor.VSS,
|
||||
Sensor.TPS,
|
||||
Sensor.PPS,
|
||||
Sensor.veValue,
|
||||
Sensor.etbTarget,
|
||||
Sensor.etb1DutyCycle,
|
||||
Sensor.totalTriggerErrorCounter,
|
||||
Sensor.AFR,
|
||||
Sensor.TARGET_AFR,
|
||||
Sensor.FIRMWARE_VERSION,
|
||||
Sensor.CLT);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.io.Writer;
|
|||
* </p>
|
||||
* Andrey Belomutskiy, (c) 2013-2020
|
||||
*/
|
||||
public class PlainTextSensorLog extends SensorLog {
|
||||
public class PlainTextSensorLog implements SensorLog {
|
||||
private Writer logFile;
|
||||
|
||||
private long fileStartTime;
|
||||
|
@ -80,7 +80,7 @@ public class PlainTextSensorLog extends SensorLog {
|
|||
}
|
||||
|
||||
@Override
|
||||
void writeSensorLogLine() {
|
||||
public void writeSensorLogLine() {
|
||||
startIfNeeded();
|
||||
if (logFile == null)
|
||||
return;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.rusefi.sensor_logs;
|
||||
|
||||
public abstract class SensorLog {
|
||||
public abstract double getSecondsSinceFileStart();
|
||||
public interface SensorLog {
|
||||
double getSecondsSinceFileStart();
|
||||
|
||||
abstract void writeSensorLogLine();
|
||||
void writeSensorLogLine();
|
||||
|
||||
public abstract void close();
|
||||
void close();
|
||||
}
|
||||
|
|
|
@ -73,14 +73,14 @@ public class SensorLogger {
|
|||
Sensor.debugIntField4,
|
||||
Sensor.debugIntField5,
|
||||
|
||||
Sensor.errorCodeCounter,
|
||||
Sensor.totalTriggerErrorCounter,
|
||||
Sensor.lastErrorCode,
|
||||
|
||||
Sensor.engineMakeCodeNameCrc16,
|
||||
Sensor.tuneCrc16,
|
||||
};
|
||||
|
||||
private static List<SensorLog> sensorLogs = Arrays.asList(new PlainTextSensorLog(), new BinarySensorLog());
|
||||
private static List<SensorLog> sensorLogs = Arrays.asList(new PlainTextSensorLog(), new BinarySensorLogRestarter());
|
||||
|
||||
private static boolean isInitialized;
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class FormulasPane {
|
|||
content.add(topButtonsPanel, BorderLayout.NORTH);
|
||||
|
||||
JPanel bottomPanel = new JPanel(new FlowLayout());
|
||||
bottomPanel.add(new IntGaugeLabel("count", Sensor.errorCodeCounter));
|
||||
bottomPanel.add(new IntGaugeLabel("count", Sensor.totalTriggerErrorCounter));
|
||||
bottomPanel.add(new IntGaugeLabel("error", Sensor.lastErrorCode));
|
||||
|
||||
content.add(bottomPanel, BorderLayout.SOUTH);
|
||||
|
|
Loading…
Reference in New Issue