mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 20:59:19 +02:00
completed .fiz file loader; minor parser enhancement, wheel slip and schedule loader bug fixes.
This commit is contained in:
10
Driver.cpp
10
Driver.cpp
@@ -1276,8 +1276,8 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
||||
VelSignal = -1.0; // aby stojący ruszył
|
||||
if (sSpeedTable[i].fDist < 0.0) // jeśli przejechany
|
||||
{
|
||||
if (v != 0 ? VelSignal = -1.0 : VelSignal = 0.0)
|
||||
; // ustawienie, gdy przejechany jest lepsze niż
|
||||
VelSignal = (v != 0 ? -1.0 : 0.0);
|
||||
// ustawienie, gdy przejechany jest lepsze niż
|
||||
// wcale, ale to jeszcze nie to
|
||||
if (sSpeedTable[i].iFlags & spEvent) // jeśli event
|
||||
if ((sSpeedTable[i].evEvent != eSignSkip) ?
|
||||
@@ -2322,15 +2322,15 @@ bool TController::IncBrake()
|
||||
{
|
||||
case Individual:
|
||||
if (mvOccupied->LocalBrake == ManualBrake)
|
||||
OK = mvOccupied->IncManualBrakeLevel(1 + floor(0.5 + fabs(AccDesired)));
|
||||
OK = mvOccupied->IncManualBrakeLevel( 1 + static_cast<int>( std::floor( 0.5 + std::fabs(AccDesired))) );
|
||||
else
|
||||
OK = mvOccupied->IncLocalBrakeLevel(1 + floor(0.5 + fabs(AccDesired)));
|
||||
OK = mvOccupied->IncLocalBrakeLevel( 1 + static_cast<int>( std::floor( 0.5 + std::fabs(AccDesired))) );
|
||||
break;
|
||||
case Pneumatic:
|
||||
if ((mvOccupied->Couplers[0].Connected == NULL) &&
|
||||
(mvOccupied->Couplers[1].Connected == NULL))
|
||||
OK = mvOccupied->IncLocalBrakeLevel(
|
||||
1 + floor(0.5 + fabs(AccDesired))); // hamowanie lokalnym bo luzem jedzie
|
||||
1 + static_cast<int>( std::floor( 0.5 + std::fabs(AccDesired))) ); // hamowanie lokalnym bo luzem jedzie
|
||||
else
|
||||
{
|
||||
if (mvOccupied->BrakeCtrlPos + 1 == mvOccupied->BrakeCtrlPosNo)
|
||||
|
||||
2
Driver.h
2
Driver.h
@@ -387,7 +387,7 @@ class TController
|
||||
bool IsStop();
|
||||
bool Primary()
|
||||
{
|
||||
return this ? bool(iDrivigFlags & movePrimary) : false;
|
||||
return this ? ((iDrivigFlags & movePrimary) != 0) : false;
|
||||
};
|
||||
int inline DrivigFlags()
|
||||
{
|
||||
|
||||
39
DynObj.cpp
39
DynObj.cpp
@@ -1873,13 +1873,13 @@ TDynamicObject::Init(std::string Name, // nazwa pojazdu, np. "EU07-424"
|
||||
{
|
||||
if (Cab == 0)
|
||||
MoverParameters->BrakeCtrlPos =
|
||||
floor(MoverParameters->Handle->GetPos(bh_NP));
|
||||
static_cast<int>( std::floor(MoverParameters->Handle->GetPos(bh_NP)) );
|
||||
else
|
||||
MoverParameters->BrakeCtrlPos = floor(MoverParameters->Handle->GetPos(bh_RP));
|
||||
MoverParameters->BrakeCtrlPos = static_cast<int>( std::floor(MoverParameters->Handle->GetPos(bh_RP)) );
|
||||
}
|
||||
else
|
||||
MoverParameters->BrakeCtrlPos =
|
||||
floor(MoverParameters->Handle->GetPos(bh_NP));
|
||||
static_cast<int>( std::floor(MoverParameters->Handle->GetPos(bh_NP)) );
|
||||
|
||||
MoverParameters->BrakeLevelSet(
|
||||
MoverParameters->BrakeCtrlPos); // poprawienie hamulca po ewentualnym
|
||||
@@ -2920,7 +2920,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
||||
// 1. najpierw daj kazdemu tyle samo
|
||||
int i = 0;
|
||||
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0, 4); p;
|
||||
(kier > 0 ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||
p = (kier == true ? p->NextC(4) : p->PrevC(4)) )
|
||||
{
|
||||
float Nmax = ((p->MoverParameters->P2FTrans * p->MoverParameters->MaxBrakePress[0] -
|
||||
p->MoverParameters->BrakeCylSpring) *
|
||||
@@ -2948,7 +2948,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
||||
i = 0;
|
||||
float przek = 0;
|
||||
for (TDynamicObject *p = GetFirstDynamic(MoverParameters->ActiveCab < 0 ? 1 : 0, 4); p;
|
||||
(kier > 0 ? p = p->NextC(4) : p = p->PrevC(4)))
|
||||
p = (kier == true ? p->NextC(4) : p->PrevC(4)) )
|
||||
{
|
||||
if ((FzEP[i] > 0.01) &&
|
||||
(FzEP[i] >
|
||||
@@ -3302,13 +3302,16 @@ bool TDynamicObject::Update(double dt, double dt1)
|
||||
switch (i) // numer pantografu
|
||||
{ // trzeba usunąć to rozróżnienie
|
||||
case 0:
|
||||
if (Global::bLiveTraction ? false :
|
||||
!p->hvPowerWire) // jeśli nie ma drutu, może pooszukiwać
|
||||
if( ( Global::bLiveTraction == false )
|
||||
&& ( p->hvPowerWire == nullptr ) ) {
|
||||
// jeśli nie ma drutu, może pooszukiwać
|
||||
MoverParameters->PantFrontVolt =
|
||||
(p->PantWys >= 1.2) ? 0.95 * MoverParameters->EnginePowerSource.MaxVoltage :
|
||||
( p->PantWys >= 1.2 ) ?
|
||||
0.95 * MoverParameters->EnginePowerSource.MaxVoltage :
|
||||
0.0;
|
||||
else if (MoverParameters->PantFrontUp ? (PantDiff < 0.01) :
|
||||
false) // tolerancja niedolegania
|
||||
}
|
||||
else if( ( true == MoverParameters->PantFrontUp )
|
||||
&& ( PantDiff < 0.01 ) ) // tolerancja niedolegania
|
||||
{
|
||||
if ((MoverParameters->PantFrontVolt == 0.0) &&
|
||||
(MoverParameters->PantRearVolt == 0.0))
|
||||
@@ -3328,12 +3331,16 @@ bool TDynamicObject::Update(double dt, double dt1)
|
||||
MoverParameters->PantFrontVolt = 0.0;
|
||||
break;
|
||||
case 1:
|
||||
if (Global::bLiveTraction ? false :
|
||||
!p->hvPowerWire) // jeśli nie ma drutu, może pooszukiwać
|
||||
if( ( false == Global::bLiveTraction )
|
||||
&& ( nullptr == p->hvPowerWire ) ) {
|
||||
// jeśli nie ma drutu, może pooszukiwać
|
||||
MoverParameters->PantRearVolt =
|
||||
(p->PantWys >= 1.2) ? 0.95 * MoverParameters->EnginePowerSource.MaxVoltage :
|
||||
( p->PantWys >= 1.2 ) ?
|
||||
0.95 * MoverParameters->EnginePowerSource.MaxVoltage :
|
||||
0.0;
|
||||
else if (MoverParameters->PantRearUp ? (PantDiff < 0.01) : false)
|
||||
}
|
||||
else if ( ( true == MoverParameters->PantRearUp )
|
||||
&& ( PantDiff < 0.01 ) )
|
||||
{
|
||||
if ((MoverParameters->PantRearVolt == 0.0) &&
|
||||
(MoverParameters->PantFrontVolt == 0.0))
|
||||
@@ -4372,7 +4379,6 @@ void TDynamicObject::LoadMMediaFile(std::string BaseDir, std::string TypeName,
|
||||
pants = NULL; // wskaźnik pierwszego obiektu animującego dla pantografów
|
||||
cParser parser( TypeName + ".mmd", cParser::buffer_FILE, BaseDir );
|
||||
std::string token;
|
||||
int i;
|
||||
do {
|
||||
token = "";
|
||||
parser.getTokens(); parser >> token;
|
||||
@@ -4387,7 +4393,8 @@ void TDynamicObject::LoadMMediaFile(std::string BaseDir, std::string TypeName,
|
||||
iMultiTex = 1;
|
||||
asModel.erase( asModel.length() - 1 );
|
||||
}
|
||||
if ((i = asModel.find(',')) != std::string::npos)
|
||||
std::size_t i = asModel.find( ',' );
|
||||
if ( i != std::string::npos )
|
||||
{ // Ra 2015-01: może szukać przecinka w
|
||||
// nazwie modelu, a po przecinku była by
|
||||
// liczba
|
||||
|
||||
@@ -543,8 +543,6 @@ struct TTransmision
|
||||
|
||||
enum TCouplerType { NoCoupler, Articulated, Bare, Chain, Screw, Automatic };
|
||||
|
||||
//class TMoverParameters; // wyforwardowanie klasy coby typ byl widoczny w ponizszej strukturze
|
||||
|
||||
struct TCoupling {
|
||||
/*parametry*/
|
||||
double SpringKB = 1.0; /*stala sprezystosci zderzaka/sprzegu, %tlumiennosci */
|
||||
@@ -673,7 +671,7 @@ public:
|
||||
int MainCtrlPosNo = 0; /*ilosc pozycji nastawnika*/
|
||||
int ScndCtrlPosNo = 0;
|
||||
int LightsPosNo = 0; // NOTE: values higher than 0 seem to break the current code for light switches
|
||||
int LightsDefPos = 0;
|
||||
int LightsDefPos = 1;
|
||||
bool LightsWrap = false;
|
||||
int Lights[2][17]; // pozycje świateł, przód - tył, 1 .. 16
|
||||
bool ScndInMain = false; /*zaleznosc bocznika od nastawnika*/
|
||||
@@ -748,7 +746,7 @@ public:
|
||||
/*- dla lokomotyw z silnikami indukcyjnymi -*/
|
||||
double eimc[26];
|
||||
/*-dla wagonow*/
|
||||
long MaxLoad = 0.0; /*masa w T lub ilosc w sztukach - ladownosc*/
|
||||
double MaxLoad = 0.0; /*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*/
|
||||
double LoadSpeed = 0.0; double UnLoadSpeed = 0.0;/*szybkosc na- i rozladunku jednostki/s*/
|
||||
@@ -907,7 +905,7 @@ public:
|
||||
double eAngle = 1.5;
|
||||
|
||||
/*-dla wagonow*/
|
||||
long Load = 0.0; /*masa w T lub ilosc w sztukach - zaladowane*/
|
||||
double Load = 0.0; /*masa w T lub ilosc w sztukach - zaladowane*/
|
||||
std::string LoadType; /*co jest zaladowane*/
|
||||
int LoadStatus = 0; //+1=trwa rozladunek,+2=trwa zaladunek,+4=zakończono,0=zaktualizowany model
|
||||
double LastLoadChangeTime = 0.0; //raz (roz)ładowania
|
||||
@@ -1066,8 +1064,8 @@ public:
|
||||
bool FuseOn(void); //bezpiecznik nadamiary
|
||||
bool FuseFlagCheck(void); // sprawdzanie flagi nadmiarowego
|
||||
void FuseOff(void); // wylaczenie nadmiarowego
|
||||
int ShowCurrent(int AmpN); //pokazuje bezwgl. wartosc pradu na wybranym amperomierzu
|
||||
int ShowCurrentP(int AmpN); //pokazuje bezwgl. wartosc pradu w wybranym pojezdzie //Q 20160722
|
||||
double ShowCurrent( int AmpN ); //pokazuje bezwgl. wartosc pradu na wybranym amperomierzu
|
||||
double ShowCurrentP(int AmpN); //pokazuje bezwgl. wartosc pradu w wybranym pojezdzie //Q 20160722
|
||||
|
||||
/*!o pokazuje bezwgl. wartosc obrotow na obrotomierzu jednego z 3 pojazdow*/
|
||||
/*function ShowEngineRotation(VehN:int): integer; //Ra 2014-06: przeniesione do C++*/
|
||||
@@ -1107,28 +1105,46 @@ public:
|
||||
|
||||
/*funkcje ladujace pliki opisujace pojazd*/
|
||||
bool LoadFIZ(std::string chkpath); //Q 20160717 bool LoadChkFile(std::string chkpath);
|
||||
bool CheckLocomotiveParameters( bool ReadyFlag, int Dir );
|
||||
std::string EngineDescription( int what );
|
||||
private:
|
||||
void LoadFIZ_Param( std::string const &line );
|
||||
void LoadFIZ_Load( std::string const &line );
|
||||
void LoadFIZ_Dimensions( std::string const &line );
|
||||
void LoadFIZ_Wheels( std::string const &line );
|
||||
void LoadFIZ_Brake( std::string const &line );
|
||||
void LoadFIZ_BuffCoupl( std::string const &line, int const Index );
|
||||
void LoadFIZ_Doors( std::string const &line );
|
||||
void LoadFIZ_BuffCoupl( std::string const &line, int const Index );
|
||||
void LoadFIZ_TurboPos( std::string const &line );
|
||||
void LoadFIZ_Cntrl( std::string const &line );
|
||||
void LoadFIZ_Light( std::string const &line );
|
||||
void LoadFIZ_Security( std::string const &line );
|
||||
void LoadFIZ_Clima( std::string const &line );
|
||||
void LoadFIZ_Power( std::string const &Line );
|
||||
void LoadFIZ_Engine( std::string const &Input );
|
||||
void LoadFIZ_Switches( std::string const &Input );
|
||||
void LoadFIZ_MotorParamTable( std::string const &Input );
|
||||
void LoadFIZ_Circuit( std::string const &Input );
|
||||
void LoadFIZ_RList( std::string const &Input );
|
||||
void LoadFIZ_DList( std::string const &Input );
|
||||
void LoadFIZ_LightsList( std::string const &Input );
|
||||
void LoadFIZ_PowerParamsDecode( TPowerParameters &Powerparameters, std::string const Prefix, std::string const &Input );
|
||||
TPowerType LoadFIZ_PowerDecode( std::string const &Power );
|
||||
TPowerSource LoadFIZ_SourceDecode( std::string const &Source );
|
||||
TEngineTypes LoadFIZ_EngineDecode( std::string const &Engine );
|
||||
bool readMPT0( std::string const &line );
|
||||
bool readMPT( std::string const &line ); //Q 20160717
|
||||
bool readMPTElectricSeries( std::string const &line );
|
||||
bool readMPTDieselElectric( std::string const &line );
|
||||
bool readMPTDieselEngine( std::string const &line );
|
||||
bool readRList(int const ln, std::string const &line); //Q 20160718
|
||||
bool readBPT(/*int const ln,*/ std::string const &line); //Q 20160721
|
||||
bool readRList( std::string const &Input );
|
||||
bool readDList( std::string const &line );
|
||||
bool readFFList( std::string const &line );
|
||||
bool readWWList( std::string const &line );
|
||||
bool readLightsList( std::string const &Input );
|
||||
void BrakeValveDecode( std::string const &s ); //Q 20160719
|
||||
void BrakeSubsystemDecode(); //Q 20160719
|
||||
void PowerParamDecode(std::string lines, std::string prefix, TPowerParameters &PowerParamDecode); //Q 20160719
|
||||
TPowerSource PowerSourceDecode(std::string s); //Q 20160719
|
||||
TPowerType PowerDecode(std::string s); //Q 20160719
|
||||
TEngineTypes EngineDecode(std::string s); //Q 20160721
|
||||
bool CheckLocomotiveParameters(bool ReadyFlag, int Dir);
|
||||
std::string EngineDescription(int what);
|
||||
};
|
||||
|
||||
extern double Distance(TLocation Loc1, TLocation Loc2, TDimension Dim1, TDimension Dim2);
|
||||
@@ -1136,16 +1152,7 @@ extern double Distance(TLocation Loc1, TLocation Loc2, TDimension Dim1, TDimensi
|
||||
template <typename _Type>
|
||||
bool getkeyval( _Type &Variable, std::string const &Key, std::string const &Input, std::string const &Default ) {
|
||||
|
||||
std::string value;
|
||||
auto lookup = Input.find( Key + "=" );
|
||||
if( lookup != std::string::npos ) {
|
||||
value = Input.substr( Input.find_first_not_of( ' ', lookup + Key.size() + 1 ) );
|
||||
lookup = value.find( ' ' );
|
||||
if( lookup != std::string::npos ) {
|
||||
// trim everything past the value
|
||||
value.erase( lookup );
|
||||
}
|
||||
}
|
||||
auto value = extract_value( Key, Input );
|
||||
if( false == value.empty() ) {
|
||||
// set the specified variable to retrieved value
|
||||
std::stringstream converter;
|
||||
@@ -1163,3 +1170,20 @@ bool getkeyval( _Type &Variable, std::string const &Key, std::string const &Inpu
|
||||
return false; // supplied the default
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
std::string
|
||||
extract_value( std::string const &Key, std::string const &Input ) {
|
||||
|
||||
std::string value;
|
||||
auto lookup = Input.find( Key + "=" );
|
||||
if( lookup != std::string::npos ) {
|
||||
value = Input.substr( Input.find_first_not_of( ' ', lookup + Key.size() + 1 ) );
|
||||
lookup = value.find( ' ' );
|
||||
if( lookup != std::string::npos ) {
|
||||
// trim everything past the value
|
||||
value.erase( lookup );
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
2537
McZapkie/Mover.cpp
2537
McZapkie/Mover.cpp
File diff suppressed because it is too large
Load Diff
@@ -51,16 +51,16 @@ double PF_old(double P1, double P2, double S)
|
||||
|
||||
double PF(double P1, double P2, double S, double DP)
|
||||
{
|
||||
double PH = Max0R(P1, P2) + 1; // wyzsze cisnienie absolutne
|
||||
double PH = std::max(P1, P2) + 1; // wyzsze cisnienie absolutne
|
||||
double PL = P1 + P2 - PH + 2; // nizsze cisnienie absolutne
|
||||
double sg = PL / PH; // bezwymiarowy stosunek cisnien
|
||||
double FM = PH * 197 * S * Sign(P2 - P1); // najwyzszy mozliwy przeplyw, wraz z kierunkiem
|
||||
if ((sg > 0.5)) // jesli ponizej stosunku krytycznego
|
||||
if ((PH - PL) < DP) // niewielka roznica cisnien
|
||||
return (1 - sg) / DPL * FM * 2 * sqrt((DP) * (PH - DP));
|
||||
return (1 - sg) / DPL * FM * 2 * std::sqrt((DP) * (PH - DP));
|
||||
// return 1/DPL*(PH-PL)*fm*2*SQRT((sg)*(1-sg));
|
||||
else
|
||||
return FM * 2 * sqrt((sg) * (1 - sg));
|
||||
return FM * 2 * std::sqrt((sg) * (1 - sg));
|
||||
else // powyzej stosunku krytycznego
|
||||
return FM;
|
||||
}
|
||||
@@ -69,15 +69,15 @@ double PF1(double P1, double P2, double S)
|
||||
{
|
||||
static double const DPS = 0.001;
|
||||
|
||||
double PH = Max0R(P1, P2) + 1; // wyzsze cisnienie absolutne
|
||||
double PH = std::max(P1, P2) + 1; // wyzsze cisnienie absolutne
|
||||
double PL = P1 + P2 - PH + 2; // nizsze cisnienie absolutne
|
||||
double sg = PL / PH; // bezwymiarowy stosunek cisnien
|
||||
double FM = PH * 197 * S * Sign(P2 - P1); // najwyzszy mozliwy przeplyw, wraz z kierunkiem
|
||||
if ((sg > 0.5)) // jesli ponizej stosunku krytycznego
|
||||
if ((sg < DPS)) // niewielka roznica cisnien
|
||||
return (1 - sg) / DPS * FM * 2 * sqrt((DPS) * (1 - DPS));
|
||||
return (1 - sg) / DPS * FM * 2 * std::sqrt((DPS) * (1 - DPS));
|
||||
else
|
||||
return FM * 2 * sqrt((sg) * (1 - sg));
|
||||
return FM * 2 * std::sqrt((sg) * (1 - sg));
|
||||
else // powyzej stosunku krytycznego
|
||||
return FM;
|
||||
}
|
||||
@@ -96,9 +96,9 @@ double PFVa(double PH, double PL, double S, double LIM,
|
||||
FM = FM * (LIM - PL) / DP; // jesli jestesmy przy nastawieniu, to zawor sie przymyka
|
||||
if ((sg > 0.5)) // jesli ponizej stosunku krytycznego
|
||||
if ((PH - PL) < DPL) // niewielka roznica cisnien
|
||||
return (PH - PL) / DPL * FM * 2 * sqrt((sg) * (1 - sg)); // BUG: (1-sg) can be < 0, leading to sqrt(-x)
|
||||
return (PH - PL) / DPL * FM * 2 * std::sqrt((sg) * (1 - sg)); // BUG: (1-sg) can be < 0, leading to sqrt(-x)
|
||||
else
|
||||
return FM * 2 * sqrt( (sg) * ( 1 - sg ) ); // BUG: (1-sg) can be < 0, leading to sqrt(-x)
|
||||
return FM * 2 * std::sqrt( (sg) * ( 1 - sg ) ); // BUG: (1-sg) can be < 0, leading to sqrt(-x)
|
||||
else // powyzej stosunku krytycznego
|
||||
return FM;
|
||||
}
|
||||
@@ -120,9 +120,9 @@ double PFVd(double PH, double PL, double S, double LIM,
|
||||
FM = FM * (PH - LIM) / DP; // jesli jestesmy przy nastawieniu, to zawor sie przymyka
|
||||
if ((sg > 0.5)) // jesli ponizej stosunku krytycznego
|
||||
if ((PH - PL) < DPL) // niewielka roznica cisnien
|
||||
return (PH - PL) / DPL * FM * 2 * sqrt((sg) * (1 - sg));
|
||||
return (PH - PL) / DPL * FM * 2 * std::sqrt((sg) * (1 - sg));
|
||||
else
|
||||
return FM * 2 * sqrt((sg) * (1 - sg));
|
||||
return FM * 2 * std::sqrt((sg) * (1 - sg));
|
||||
else // powyzej stosunku krytycznego
|
||||
return FM;
|
||||
}
|
||||
@@ -2749,8 +2749,8 @@ double TFD1::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
|
||||
// MaxBP:=4;
|
||||
// temp:=Min0R(i_bcp*MaxBP,Min0R(5.0,HP));
|
||||
temp = Min0R(i_bcp * MaxBP, HP); // 0011
|
||||
DP = 10 * Min0R(abs(temp - BP), 0.1) * PF(temp, BP, 0.0006 * (2 + int(temp > BP))) * dt * Speed;
|
||||
temp = std::min(i_bcp * MaxBP, HP); // 0011
|
||||
DP = 10.0 * std::min(std::abs(temp - BP), 0.1) * PF(temp, BP, 0.0006 * (temp > BP ? 3.0 : 2.0) ) * dt * Speed;
|
||||
BP = BP - DP;
|
||||
return -DP;
|
||||
}
|
||||
|
||||
@@ -2558,11 +2558,11 @@ void TTrain::UpdateMechPosition(double dt)
|
||||
{
|
||||
if( iVel > 0.0 ) {
|
||||
// acceleration-driven base shake
|
||||
shake += 1.5 * MechSpring.ComputateForces(
|
||||
shake += 1.25 * MechSpring.ComputateForces(
|
||||
vector3(
|
||||
-mvControlled->AccN * dt * 5.0, // highlight side sway
|
||||
mvControlled->AccV * dt,
|
||||
-mvControlled->AccS * dt * 2.5 ), // accent acceleration/deceleration
|
||||
-mvControlled->AccS * dt * 1.25 ), // accent acceleration/deceleration
|
||||
pMechShake );
|
||||
|
||||
if( Random( iVel ) > 25.0 ) {
|
||||
@@ -2575,7 +2575,7 @@ void TTrain::UpdateMechPosition(double dt)
|
||||
pMechShake );
|
||||
// * (( 200 - DynamicObject->MyTrack->iQualityFlag ) * 0.0075 ); // scale to 75-150% based on track quality
|
||||
}
|
||||
shake *= 1.25;
|
||||
// shake *= 1.25;
|
||||
}
|
||||
vMechVelocity -= (shake + vMechVelocity * 100) * (fMechSpringX + fMechSpringY + fMechSpringZ) / (200);
|
||||
// shake *= 0.95 * dt; // shake damping
|
||||
|
||||
11
mtable.cpp
11
mtable.cpp
@@ -401,11 +401,14 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax)
|
||||
}
|
||||
while (s.find("|") == std::string::npos)
|
||||
fin >> s;
|
||||
fin >> record->StationWare;
|
||||
do
|
||||
{
|
||||
// stationware. added fix for empty entry
|
||||
fin >> s;
|
||||
} while (!((s == "1") || (s == "2") || fin.bad()));
|
||||
while( false == ( ( s == "1" )
|
||||
|| ( s == "2" )
|
||||
|| fin.bad() ) ) {
|
||||
record->StationWare += s;
|
||||
fin >> s;
|
||||
}
|
||||
record->TrackNo = atoi(s.c_str());
|
||||
fin >> s;
|
||||
if (s != "|")
|
||||
|
||||
4
parser.h
4
parser.h
@@ -134,7 +134,9 @@ cParser::operator>>( bool &Right ) {
|
||||
|
||||
if( true == this->tokens.empty() ) { return *this; }
|
||||
|
||||
Right = ( this->tokens.front() == "true" );
|
||||
Right = ( ( this->tokens.front() == "true" )
|
||||
|| ( this->tokens.front() == "yes" )
|
||||
|| ( this->tokens.front() == "1" ) );
|
||||
this->tokens.pop_front();
|
||||
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user