Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 4afc161e authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

start working on engine model

parent 3dad929f
No related branches found
No related tags found
No related merge requests found
......@@ -4,11 +4,32 @@ using TUGraz.VectoCore.Models.SimulationComponent.Data;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{
public class CombustionEngine : VectoSimulationComponent, ICombustionEngine, ITnOutPort
public class CombustionEngine : VectoSimulationComponent, ICombustionEngine, ITnOutPort
{
public CombustionEngine(CombustionEngineData data)
public enum EngineState
{
Idle,
Drag,
FullDrag,
Load,
FullLoad,
Stopped,
Undef
}
private CombustionEngineData _data;
private EngineState _state;
private double _currentEnginePower;
private double _currentEngineSpeed;
public CombustionEngine(CombustionEngineData data)
{
_data = data;
_state = EngineState.Idle;
_currentEnginePower = 0;
_currentEngineSpeed = _data.IdleSpeed;
}
......@@ -20,13 +41,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public override void CommitSimulationStep(IModalDataWriter writer)
{
writer[ModalResultField.FC] = 1;
writer[ModalResultField.FC_AUXc] = 2;
writer[ModalResultField.FC_WHTCc] = 3;
writer[ModalResultField.FCAUXc] = 2;
writer[ModalResultField.FCWHTCc] = 3;
}
public void Request(TimeSpan absTime, TimeSpan dt, double torque, double engineSpeed)
{
//throw new NotImplementedException();
}
// accelleration los rotation engine
//Return (ENG.I_mot * (nU - nUBefore) * 0.01096 * ((nU + nUBefore) / 2)) * 0.001
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment