add to gui
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "engine.h"
|
||||
#include "iostream"
|
||||
|
||||
void Engine::step(double dt, double load_torque_nm) {
|
||||
// TODO: replace with real combustion/friction torque model driven
|
||||
@@ -17,6 +18,16 @@ double Engine::torque_nm() const {
|
||||
return m_torque_nm;
|
||||
}
|
||||
|
||||
void Engine::set_throttle(double throttle) {
|
||||
m_throttle = throttle;
|
||||
}
|
||||
|
||||
double Engine::get_throttle() {
|
||||
return m_throttle;
|
||||
}
|
||||
|
||||
void Engine::reset() {
|
||||
m_rpm = 0;
|
||||
m_oil_temp = 0;
|
||||
m_coolant_capacity = 0;
|
||||
}
|
||||
|
||||
+13
-1
@@ -11,12 +11,24 @@ public:
|
||||
double rpm() const;
|
||||
double torque_nm() const; // net torque produced this step
|
||||
|
||||
void set_throttle(double throttle);
|
||||
double get_throttle();
|
||||
void reset();
|
||||
|
||||
private:
|
||||
double m_rpm = 0.0;
|
||||
double m_torque_nm = 0.0;
|
||||
|
||||
static constexpr double kIdleRpm = 900.0;
|
||||
// Fluids
|
||||
double m_oil_capacity = 0.0;
|
||||
double m_coolant_capacity = 0.0;
|
||||
|
||||
double m_oil_temp = 0.0;
|
||||
double m_coolant_temp = 0.0;
|
||||
|
||||
// User Input
|
||||
double m_throttle = 0.0;
|
||||
|
||||
static constexpr double kIdleRpm = 1700.0;
|
||||
static constexpr double kCrankInertiaKgm2 = 0.15; // placeholder
|
||||
};
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user