From 4d71fd1aea82abd43419532dfbf49601fd9b2689 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Mon, 16 Feb 2015 23:04:20 -0600 Subject: [PATCH] auto-sync --- firmware/console/status_loop.cpp | 3 +++ .../tunerstudio/tunerstudio_configuration.h | 7 ++++--- firmware/controllers/math/speed_density.cpp | 2 +- .../controllers/trigger/trigger_chrysler.cpp | 2 +- firmware/tunerstudio/rusefi.ini | 20 ++++++++++++------- .../ui/src/com/rusefi/AnalogChartPanel.java | 18 +++++++++++------ 6 files changed, 34 insertions(+), 18 deletions(-) diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 750c307248..ce4a3618d2 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -517,6 +517,8 @@ static THD_WORKING_AREA(tsThreadStack, UTILITY_THREAD_STACK_SIZE); #if EFI_TUNER_STUDIO +extern Map3D1616 veMap; + void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputChannels) { #if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) int rpm = getRpmE(engine); @@ -543,6 +545,7 @@ void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputC tsOutputChannels->throttlePositon = tps; tsOutputChannels->massAirFlowVoltage = getMaf(); tsOutputChannels->massAirFlowValue = getRealMaf(); + tsOutputChannels->massAirFlowValue = veMap.getValue(getMap(), rpm); tsOutputChannels->airFuelRatio = getAfr(); tsOutputChannels->v_batt = getVBatt(engineConfiguration); tsOutputChannels->tpsADC = getTPS10bitAdc(PASS_ENGINE_PARAMETER_F); diff --git a/firmware/console/tunerstudio/tunerstudio_configuration.h b/firmware/console/tunerstudio/tunerstudio_configuration.h index 07cb09fea2..3f261dcd5a 100644 --- a/firmware/console/tunerstudio/tunerstudio_configuration.h +++ b/firmware/console/tunerstudio/tunerstudio_configuration.h @@ -16,10 +16,10 @@ /** * this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version */ -#define TS_FILE_VERSION 20150211 +#define TS_FILE_VERSION 20150216 #define PAGE_0_SIZE 15160 -#define TS_OUTPUT_SIZE 116 +#define TS_OUTPUT_SIZE 196 typedef struct { uint16_t values[EGT_CHANNEL_COUNT]; @@ -82,7 +82,8 @@ typedef struct { egt_values_s egtValues; float rpmAcceleration; float massAirFlowValue; - int unused3[1]; + float veValue; + int unused3[20]; } TunerStudioOutputChannels; #endif /* TUNERSTUDIO_CONFIGURATION_H_ */ diff --git a/firmware/controllers/math/speed_density.cpp b/firmware/controllers/math/speed_density.cpp index f3556bb302..dbf44efd3e 100644 --- a/firmware/controllers/math/speed_density.cpp +++ b/firmware/controllers/math/speed_density.cpp @@ -22,7 +22,7 @@ #define rpmMin 500 #define rpmMax 8000 -static Map3D1616 veMap; +Map3D1616 veMap; Map3D1616 ve2Map; Map3D1616 afrMap; diff --git a/firmware/controllers/trigger/trigger_chrysler.cpp b/firmware/controllers/trigger/trigger_chrysler.cpp index 9d7a973b1f..a3625934e7 100644 --- a/firmware/controllers/trigger/trigger_chrysler.cpp +++ b/firmware/controllers/trigger/trigger_chrysler.cpp @@ -18,7 +18,7 @@ void configureNeon2003TriggerShape(TriggerShape *s) { s->gapBothDirections = true; // are these non-default values really needed here now that the gap is finally precise? - s->setTriggerSynchronizationGap2(0.8 * CHRYSLER_NGC_GAP, 1.55 * CHRYSLER_NGC_GAP); + s->setTriggerSynchronizationGap2(0.5 * CHRYSLER_NGC_GAP, 1.5 * CHRYSLER_NGC_GAP); /* s->addEvent(base + 26, T_PRIMARY, TV_HIGH); diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index debb62c48f..ee841dcc3e 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -505,12 +505,12 @@ page = 1 [OutputChannels] ; see TS_FILE_VERSION in firmware code -fileVersion = { 20150211 } +fileVersion = { 20150216 } ochGetCommand = "O" - ochBlockSize = 116 + ochBlockSize = 196 rpm = scalar, U32, 0, "RPM", 1, 0.00000 #if CELSIUS @@ -572,7 +572,9 @@ fileVersion = { 20150211 } egt7 = scalar, S16, 100, "°C", 1, 0 egt8 = scalar, S16, 102, "°C", 1, 0 rpmAcceleration = scalar, F32, 104, "dRpm", 1, 0 - egoCorrection = { 1 } + massAirFlowValue= scalar, F32, 108, "Kg/h", 1, 0 + veValue = scalar, F32, 112, "ratio", 1, 0 + egoCorrection = { 1 } time = { timeNow } ; engineLoad = { algorithm == 0 ? MAF : TPS } @@ -740,9 +742,11 @@ fileVersion = { 20150211 } egt6Gauge = egt6, "EGT#6", "C", 0, 2000 egt7Gauge = egt7, "EGT#7", "C", 0, 2000 egt8Gauge = egt8, "EGT#8", "C", 0, 2000 - vssGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1 - rpmAccelerationGa = rpmAcceleration, "rpm d", "dRpm", 0, 3, 0, 1, 3, 4, 1, 1 - + vssGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1 + rpmAccelerationGa = rpmAcceleration, "rpm d", "dRpm", 0, 3, 0, 1, 3, 4, 1, 1 + massAirFlowValueGa = massAirFlowValue,"Air Flow", "kg/hr", 0, 50, -999, -999, 999, 999, 1, 1 + veValueGauge = veValue, "ratio", "", 5, 25, 9, 9, 20, 20, 1, 1 + [FrontPage] ; Gauges are numbered left to right, top to bottom. ; @@ -802,6 +806,8 @@ fileVersion = { 20150211 } entry = ign_adv, "ignAdv", float, "%.2f" entry = vehicleSpeedKph, "speed", float, "%.2f" entry = rpmAcceleration, "dRPM", float, "%.3f" + entry = massAirFlowValue,"Mass", float, "%.3f" + entry = veValue, "ratio", float, "%.3f" ; tpsADC = U16, "ADC", @@ -1233,4 +1239,4 @@ fileVersion = { 20150211 } dialog = fsioDialog, "FSIO", border panel = fsioIO, West panel = fsioFrequency, Center - panel = fsioSetting, East + panel = fsioSetting, East \ No newline at end of file diff --git a/java_console/ui/src/com/rusefi/AnalogChartPanel.java b/java_console/ui/src/com/rusefi/AnalogChartPanel.java index d1f90ad8b9..36d05ce152 100644 --- a/java_console/ui/src/com/rusefi/AnalogChartPanel.java +++ b/java_console/ui/src/com/rusefi/AnalogChartPanel.java @@ -41,12 +41,18 @@ public class AnalogChartPanel { AnalogChartCentral.addListener(new AnalogChartCentral.AnalogChartListener() { @Override - public void onAnalogChart(String message) { - unpackValues(values, message); - if (!paused) { - processValues(); - UiUtils.trueRepaint(canvas); - } + public void onAnalogChart(final String message) { + // this callback is invoked from the connectivity thread, need to handle in AWT for thread-safety + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + unpackValues(values, message); + if (!paused) { + processValues(); + UiUtils.trueRepaint(canvas); + } + } + }); } });