mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
external cargo included in the vehicle load visualization system, cargo model offset parameter
This commit is contained in:
@@ -947,6 +947,7 @@ public:
|
||||
float MaxLoad = 0.f; /*masa w T lub ilosc w sztukach - ladownosc*/
|
||||
std::string LoadAccepted; std::string LoadQuantity; /*co moze byc zaladowane, jednostki miary*/
|
||||
double OverLoadFactor = 0.0; /*ile razy moze byc przekroczona ladownosc*/
|
||||
float LoadMinOffset { 0.f }; // offset applied to cargo model when load amount is 0
|
||||
float LoadSpeed = 0.f; float UnLoadSpeed = 0.f;/*szybkosc na- i rozladunku jednostki/s*/
|
||||
int DoorOpenCtrl = 0; int DoorCloseCtrl = 0; /*0: przez pasazera, 1: przez maszyniste, 2: samoczynne (zamykanie)*/
|
||||
double DoorStayOpen = 0.0; /*jak dlugo otwarte w przypadku DoorCloseCtrl=2*/
|
||||
|
||||
@@ -6624,12 +6624,9 @@ TMoverParameters::signal_departure( bool const State, range_t const Notify ) {
|
||||
void
|
||||
TMoverParameters::update_autonomous_doors( double const Deltatime ) {
|
||||
|
||||
if( ( DoorCloseCtrl != control_t::autonomous )
|
||||
|| ( ( false == DoorLeftOpened )
|
||||
&& ( false == DoorRightOpened ) ) ) {
|
||||
// nothing to do
|
||||
return;
|
||||
}
|
||||
if( DoorCloseCtrl != control_t::autonomous ) { return; }
|
||||
if( ( false == DoorLeftOpened )
|
||||
&& ( false == DoorRightOpened ) ) { return; }
|
||||
|
||||
if( DoorStayOpen > 0.0 ) {
|
||||
// update door timers if the door close after defined time
|
||||
@@ -6641,18 +6638,19 @@ TMoverParameters::update_autonomous_doors( double const Deltatime ) {
|
||||
if( true == DoorLeftOpened ) { DoorLeftOpenTimer = DoorStayOpen; }
|
||||
if( true == DoorRightOpened ) { DoorRightOpenTimer = DoorStayOpen; }
|
||||
}
|
||||
// the door are closed if their timer goes below 0, or if the vehicle is moving at > 5 km/h
|
||||
// the door are closed if their timer goes below 0, or if the vehicle is moving at > 10 km/h
|
||||
auto const closingspeed { 10.0 };
|
||||
// NOTE: timer value of 0 is 'special' as it means the door will stay open until vehicle is moving
|
||||
if( true == DoorLeftOpened ) {
|
||||
if( ( ( DoorStayOpen > 0.0 ) && ( DoorLeftOpenTimer < 0.0 ) )
|
||||
|| ( Vel > 5.0 ) ) {
|
||||
|| ( Vel > closingspeed ) ) {
|
||||
// close the door and set the timer to expired state (closing may happen sooner if vehicle starts moving)
|
||||
DoorLeft( false, range_t::local );
|
||||
}
|
||||
}
|
||||
if( true == DoorRightOpened ) {
|
||||
if( ( ( DoorStayOpen > 0.0 ) && ( DoorRightOpenTimer < 0.0 ) )
|
||||
|| ( Vel > 5.0 ) ) {
|
||||
|| ( Vel > closingspeed ) ) {
|
||||
// close the door and set the timer to expired state (closing may happen sooner if vehicle starts moving)
|
||||
DoorRight( false, range_t::local );
|
||||
}
|
||||
@@ -7576,6 +7574,8 @@ void TMoverParameters::LoadFIZ_Load( std::string const &line ) {
|
||||
extract_value( OverLoadFactor, "OverLoadFactor", line, "" );
|
||||
extract_value( LoadSpeed, "LoadSpeed", line, "" );
|
||||
extract_value( UnLoadSpeed, "UnLoadSpeed", line, "" );
|
||||
|
||||
extract_value( LoadMinOffset, "LoadMinOffset", line, "" );
|
||||
}
|
||||
|
||||
void TMoverParameters::LoadFIZ_Dimensions( std::string const &line ) {
|
||||
|
||||
Reference in New Issue
Block a user