Umstellung auf Floatgenerell bei Speed
Umstellung auf Float bei Beschleunigung Entfernen von minspeed Entfernen nicht notwendiger Konstruktoren in Lokomotive
This commit is contained in:
@@ -2,24 +2,12 @@
|
||||
#include<fahrt.h>
|
||||
#include<locomotive.h>
|
||||
|
||||
Fahrt::Fahrt(Locomotive locomotive, MotorDirection Direction, Gleis gleis, Gleisabschnitt gleisabschnitt): _locomotive(locomotive), _gleis(gleis), _gleisabschnitt(gleisabschnitt)
|
||||
{
|
||||
_direction = Direction;
|
||||
_speed = locomotive.getDefaultSpeed();
|
||||
_bremsweg=0;
|
||||
}
|
||||
|
||||
Fahrt::Fahrt(Locomotive locomotive, byte speed, MotorDirection Direction, Gleis gleis, Gleisabschnitt gleisabschnitt): _locomotive(locomotive), _gleis(gleis), _gleisabschnitt(gleisabschnitt)
|
||||
{
|
||||
_direction = Direction;
|
||||
_speed = speed;
|
||||
_bremsweg=0;
|
||||
}
|
||||
|
||||
Fahrt::Fahrt(Locomotive locomotive, byte speed, MotorDirection Direction, Gleis gleis, Gleisabschnitt gleisabschnitt, float bremsweg): _locomotive(locomotive), _gleis(gleis), _gleisabschnitt(gleisabschnitt)
|
||||
Fahrt::Fahrt(Locomotive locomotive, byte speed, MotorDirection Direction, Gleis gleis, float startbeschleunigung, Gleisabschnitt gleisabschnitt, float bremsweg): _locomotive(locomotive), _gleis(gleis), _gleisabschnitt(gleisabschnitt)
|
||||
{
|
||||
_direction = Direction;
|
||||
_speed = speed;
|
||||
_startbeschleunigung = startbeschleunigung;
|
||||
_bremsweg=bremsweg;
|
||||
}
|
||||
|
||||
@@ -50,10 +38,7 @@ void Fahrt::Loop()
|
||||
delay(20);
|
||||
if (_gleisabschnitt.IstBesetzt() && !_abschnittErkannt)
|
||||
{
|
||||
if (_bremsweg==0)
|
||||
_locomotive.Break();
|
||||
else
|
||||
_locomotive.Accelerate(0, _bremsweg);
|
||||
_locomotive.Accelerate(0, _bremsweg);
|
||||
_abschnittErkannt=true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user