TS gauges section should be auto-generated #4972

This commit is contained in:
Andrey 2023-01-16 00:24:42 -05:00
parent 61305c7d56
commit b6dbb5479e
3 changed files with 10 additions and 7 deletions

View File

@ -2,15 +2,15 @@ struct_no_prefix ignition_state_s
float baseDwell
floatms_t sparkDwell;@@GAUGE_COIL_DWELL_TIME@@
angle_t dwellAngle;ignition dwell duration\nas crankshaft angle\nNAN if engine is stopped\nSee also sparkDwell
int16_t autoscale cltTimingCorrection;;"deg",{1/@@PACK_MULT_PERCENT@@}, 0, -20, 20, 2, Timing
int16_t autoscale timingIatCorrection;;"deg",{1/@@PACK_MULT_PERCENT@@}, 0, -20, 20, 2
int16_t autoscale timingPidCorrection;;"deg",{1/@@PACK_MULT_PERCENT@@}, 0, -20, 20, 2
int16_t autoscale cltTimingCorrection;;"deg",{1/@@PACK_MULT_PERCENT@@}, 0, -20, 20, 2, @@GAUGE_CATEGORY_TIMING@@
int16_t autoscale timingIatCorrection;;"deg",{1/@@PACK_MULT_PERCENT@@}, 0, -20, 20, 2, @@GAUGE_CATEGORY_TIMING@@
int16_t autoscale timingPidCorrection;;"deg",{1/@@PACK_MULT_PERCENT@@}, 0, -20, 20, 2, @@GAUGE_CATEGORY_TIMING@@
float dwellVoltageCorrection
float luaTimingAdd;
float luaTimingMult;
float luaTimingAdd;;"deg",{1, 0, -20, 20, 2, @@GAUGE_CATEGORY_TIMING@@
float luaTimingMult;;"deg",{1, 0, -20, 20, 2, @@GAUGE_CATEGORY_TIMING@@
! ignition_state
end_struct

View File

@ -1812,6 +1812,8 @@ end_struct
#define GAUGE_NAME_TRG_ERR "Trigger Error Counter"
#define GAUGE_NAME_TRG_GAP "Trigger Sync Latest Ratio"
#define GAUGE_CATEGORY_TIMING "Timing"
#define GAUGE_NAME_VVT_B1I "VVT: bank 1 intake"
#define GAUGE_NAME_VVT_B1E "VVT: bank 1 exhaust"
#define GAUGE_NAME_VVT_B2I "VVT: bank 2 intake"

View File

@ -164,14 +164,15 @@ public class OutputsTest {
public void sensorStruct() {
String test = "struct total\n" +
" struct pid_status_s\n" +
" \tfloat iTerm;;\"v\", 1, 0, -10000, 10000, 4, Alternator\n" +
" \tfloat dTerm;;\"v\", 1, 0, -10000, 10000, 4, Alternator\n" +
" \tfloat iTerm;;\"v\", 1, 0, -10000, 10000, 4, @@GAUGE_CATEGORY@@\n" +
" \tfloat dTerm;;\"v\", 1, 0, -10000, 10000, 4, @@GAUGE_CATEGORY@@\n" +
" end_struct\n" +
"\tpid_status_s alternatorStatus\n" +
"\tpid_status_s idleStatus\n" +
"end_struct\n";
ReaderStateImpl state = new ReaderStateImpl();
state.getVariableRegistry().register("GAUGE_CATEGORY", "Alternator");
DataLogConsumer dataLogConsumer = new DataLogConsumer(null);
GaugeConsumer gaugeConsumer = new GaugeConsumer(null);
state.readBufferedReader(test, dataLogConsumer, gaugeConsumer);