rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
live_data.cpp
Go to the documentation of this file.
1#include "pch.h"
2
3#include "live_data.h"
4
5#include "tunerstudio.h"
10#include "fuel_computer.h"
13#include "vvt_generated.h"
16
17template<>
19 return &engine->outputChannels;
20}
21
22template<>
24 return &engine->module<KnockController>().unmock();
25}
26
27template<>
29#if EFI_TCU
30 GearControllerBase *gearController = engine->gearController;
31 return gearController == nullptr ? nullptr : gearController->transmissionController;
32#else
33 return nullptr;
34#endif // EFI_TCU
35}
36
37template<>
39#if EFI_HPFP
40 return &engine->module<HpfpController>().unmock();
41#else
42 return nullptr; // explicit null to confirm that this struct is handled
43#endif // EFI_HPFP
44}
45
46template<>
48#if EFI_LAUNCH_CONTROL
49 return &engine->launchController;
50#else
51 return nullptr;
52#endif
53}
54
55template<>
57#if EFI_LAUNCH_CONTROL
59#else
60 return nullptr;
61#endif
62}
63
64template<>
66#if EFI_ANTILAG_SYSTEM
68#else
69 return nullptr;
70#endif
71}
72
73template<>
75 return &engine->module<InjectorModelPrimary>().unmock();
76}
77
78template<>
80#if EFI_BOOST_CONTROL
81 return &engine->module<BoostController>().unmock();
82#else
83 return nullptr;
84#endif
85}
86
87template<>
88const ac_control_s* getLiveData(size_t) {
89 return &engine->module<AcController>().unmock();
90}
91
92template<>
94#if EFI_ENGINE_CONTROL
95 return &engine->fuelComputer;
96#else
97 return nullptr;
98#endif
99}
100
101#ifdef MODULE_FAN_CONTROL
102template<>
103const fan_control_s* getLiveData(size_t idx) {
104 switch (idx) {
105 case 0: return &engine->module<FanControl1>().unmock();
106 case 1: return &engine->module<FanControl2>().unmock();
107 default: return nullptr;
108 }
109}
110#endif
111
112#ifdef MODULE_FUEL_PUMP
113template<>
115 return &engine->module<FuelPumpController>().unmock();
116}
117#endif
118
119template<>
120const main_relay_s* getLiveData(size_t) {
121 return &engine->module<MainRelayController>().unmock();
122}
123
124template<>
126 return &engine->engineState;
127}
128
129template<>
131 return &engine->module<PrimeController>().unmock();
132}
133
134template<>
136 return &engine->module<TpsAccelEnrichment>().unmock();
137}
138
139template<>
141#if EFI_LAUNCH_CONTROL
142 return &engine->module<NitrousController>().unmock();
143#else
144 return nullptr;
145#endif // EFI_LAUNCH_CONTROL
146}
147
148template<>
149const dc_motors_s* getLiveData(size_t) {
150 return &engine->dc_motors;
151}
152
153template<>
155#if EFI_SHAFT_POSITION_INPUT
156 return &engine->triggerCentral;
157#else
158 return nullptr;
159#endif
160}
161
162template<>
163const trigger_state_s* getLiveData(size_t idx) {
164#if EFI_SHAFT_POSITION_INPUT
165 switch (idx) {
166 case 0: return &engine->triggerCentral.triggerState;
167 case 1: return &engine->triggerCentral.vvtState[0][0];
168 case 2: return &engine->triggerCentral.vvtState[0][1];
169 case 3: return &engine->triggerCentral.vvtState[1][0];
170 case 4: return &engine->triggerCentral.vvtState[1][1];
171 default: return nullptr;
172 }
173#else
174 UNUSED(idx);
175 return nullptr;
176#endif
177}
178
179template<>
180const vvt_s* getLiveData(size_t idx) {
181#if EFI_VVT_PID
182 switch (idx) {
183 case 0: return &engine->module<VvtController1>().unmock();
184 case 1: return &engine->module<VvtController2>().unmock();
185 case 2: return &engine->module<VvtController3>().unmock();
186 case 3: return &engine->module<VvtController4>().unmock();
187 default: return nullptr;
188 }
189#else
190 UNUSED(idx);
191 return nullptr;
192#endif
193}
194
195template<>
197#if EFI_SHAFT_POSITION_INPUT
199#else
200 return nullptr;
201#endif
202}
203
204template<>
206#if EFI_ENGINE_CONTROL
208#else
209 return nullptr;
210#endif
211}
212
213template<>
214const idle_state_s* getLiveData(size_t) {
215#if EFI_IDLE_CONTROL
216 return &engine->module<IdleController>().unmock();
217#else
218 return nullptr;
219#endif
220}
221
222template<>
224 return &engine->ignitionState;
225}
226
227template<>
228const sent_state_s* getLiveData(size_t) {
229#if EFI_SENT_SUPPORT
230 return &engine->sent_state;
231#else
232 return nullptr;
233#endif
234}
235
236template<>
238#if EFI_IDLE_CONTROL
239 return &engine->m_ltit;
240#else
241 return nullptr;
242#endif
243}
244
245template<>
247#if EFI_IDLE_CONTROL
248 return &engine->module<ThrottleModel>().unmock();
249#else
250 return nullptr;
251#endif
252}
253
254template<>
256#if EFI_SHAFT_POSITION_INPUT
257 return &engine->lambdaMonitor;
258#else
259 return nullptr;
260#endif
261}
262
263#ifndef BOARD_MC33810_COUNT
264 #define BOARD_MC33810_COUNT 0
265#endif
266
267template<>
268const mc33810_state_s* getLiveData(size_t idx) {
269#if (BOARD_MC33810_COUNT > 0)
270 return mc33810getLiveData(idx);
271#else
272 UNUSED(idx);
273 return nullptr;
274#endif
275}
276
277static const FragmentEntry fragments[] = {
278// This header is generated - do not edit by hand!
279#include "live_data_fragments.h"
280};
281
282FragmentList getLiveDataFragments() {
283 return { fragments, efi::size(fragments) };
284}
285
286template<>
288#if EFI_LTFT_CONTROL
289 engine->module<LongTermFuelTrim>()->onLiveDataRead();
290 return &engine->module<LongTermFuelTrim>().unmock();
291#else
292 return nullptr;
293#endif
294}
295
296template<>
298#if EFI_LTFT_CONTROL
299 return &engine->module<ShortTermFuelTrim>().unmock();
300#else
301 return nullptr;
302#endif
303}
304
305template<>
307#if EFI_LTFT_CONTROL
308 return &engine->module<ExampleModule>().unmock();
309#else
310 return nullptr;
311#endif
312}
313
314template<>
316#if MODULE_VVL_CONTROLLER
317 return &engine->module<VvlController>().unmock();
318#else
319 return nullptr;
320#endif
321}
FuelComputer fuelComputer
Definition engine.h:139
TriggerCentral triggerCentral
Definition engine.h:318
dc_motors_s dc_motors
Definition engine.h:346
GearControllerBase * gearController
Definition engine.h:210
FuelSchedule injectionEvents
Definition engine.h:288
LongTermIdleTrim m_ltit
Definition engine.h:135
IgnitionState ignitionState
Definition engine.h:239
sent_state_s sent_state
Definition engine.h:348
LaunchControlBase launchController
Definition engine.h:220
EngineState engineState
Definition engine.h:344
AntilagSystemBase antilagController
Definition engine.h:228
LambdaMonitor lambdaMonitor
Definition engine.h:236
TunerStudioOutputChannels outputChannels
Definition engine.h:109
constexpr auto & module()
Definition engine.h:200
ShiftTorqueReductionController shiftTorqueReductionController
Definition engine.h:221
InjectionEvent elements[MAX_CYLINDER_COUNT]
TransmissionControllerBase * transmissionController
WallFuel & getWallFuel()
VvtTriggerDecoder vvtState[BANKS_COUNT][CAMS_PER_BANK]
PrimaryTriggerDecoder triggerState
static EngineAccessor engine
Definition engine.h:413
UNUSED(samplingTimeSeconds)
const output_channels_s * getLiveData(size_t)
Definition live_data.cpp:18
static const FragmentEntry fragments[]
FragmentList getLiveDataFragments()
const mc33810_state_s * mc33810getLiveData(size_t idx)
Definition mc33810.cpp:1021