getConsumedGramsRemainder

This commit is contained in:
rusefillc 2024-11-17 13:09:35 -05:00
parent 15bf24eee9
commit a3a76f9e1b
2 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,10 @@ public:
void consumeFuel(float grams, efitick_t nowNt);
uint32_t getConsumedGrams() const;
// in case if integer number of grams moves too slow
float getConsumedGramsRemainder() const {
return m_consumedRemainder;
}
float getConsumptionGramPerSecond() const;
uint32_t getDistanceMeters() const;
uint32_t getIgnitionOnTime() const;

View File

@ -705,6 +705,10 @@ void configureRusefiLuaHooks(lua_State* lState) {
lua_pushnumber(l, engine->module<TripOdometer>()->getConsumedGrams());
return 1;
});
lua_register(lState, "getConsumedGramsRemainder", [](lua_State* l) {
lua_pushnumber(l, engine->module<TripOdometer>()->getConsumedGramsRemainder());
return 1;
});
lua_register(lState, "getConsumptionGramPerSecond", [](lua_State* l) {
lua_pushnumber(l, engine->module<TripOdometer>()->getConsumptionGramPerSecond());
return 1;