Umstellung auf Floatgenerell bei Speed
Umstellung auf Float bei Beschleunigung Entfernen von minspeed Entfernen nicht notwendiger Konstruktoren in Lokomotive
This commit is contained in:
+3
-18
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,7 @@
|
||||
class Fahrt
|
||||
{
|
||||
public:
|
||||
Fahrt(Locomotive locomotive, MotorDirection Direction, Gleis gleis, Gleisabschnitt gleisabschnitt);
|
||||
Fahrt(Locomotive locomotive, byte speed, MotorDirection Direction, Gleis gleis, Gleisabschnitt gleisabschnitt);
|
||||
Fahrt(Locomotive locomotive, byte speed, MotorDirection Direction, Gleis gleis, Gleisabschnitt gleisabschnitt, float bremsweg);
|
||||
Fahrt(Locomotive locomotive, byte speed, MotorDirection Direction, Gleis gleis, float startbeschleunigung, Gleisabschnitt gleisabschnitt, float bremsweg);
|
||||
void Vorbereiten();
|
||||
void Start();
|
||||
void Loop();
|
||||
@@ -27,6 +25,7 @@ class Fahrt
|
||||
Gleisabschnitt _gleisabschnitt;
|
||||
bool _abschnittErkannt;
|
||||
byte _speed;
|
||||
float _startbeschleunigung;
|
||||
float _bremsweg;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user