mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
16
Driver.cpp
16
Driver.cpp
@@ -2733,19 +2733,25 @@ bool TController::IncSpeed()
|
||||
(mvControlling->StLinFlag)) // youBy polecił dodać 2012-09-08 v367
|
||||
// na pozycji 0 przejdzie, a na pozostałych będzie czekać, aż się załączą liniowe (zgaśnie DelayCtrlFlag)
|
||||
if (Ready || (iDrivigFlags & movePress)) {
|
||||
// use series mode to build up speed, when high threshold is set for motor overload relay or if the power station is heavily burdened
|
||||
auto const useseriesmodevoltage { 0.85 * mvControlling->EnginePowerSource.CollectorParameters.MaxV };
|
||||
// use series mode:
|
||||
// to build up speed to 30/40 km/h for passenger/cargo train,
|
||||
// if high threshold is set for motor overload relay,
|
||||
// if the power station is heavily burdened
|
||||
auto const useseriesmodevoltage { 0.80 * mvControlling->EnginePowerSource.CollectorParameters.MaxV };
|
||||
auto const useseriesmode = (
|
||||
( mvOccupied->Vel <= ( ( mvOccupied->BrakeDelayFlag & bdelay_G ) != 0 ? 35 : 25 ) + ( mvControlling->ScndCtrlPos == 0 ? 0 : 5 ) )
|
||||
|| ( mvControlling->Imax > mvControlling->ImaxLo )
|
||||
|| ( fVoltage < useseriesmodevoltage ) );
|
||||
|
||||
// when not in series mode use the first available parallel mode configuration until 50/60 km/h for passenger/cargo train
|
||||
// (if there's only one parallel mode configuration it'll be used regardless of current speed)
|
||||
auto const scndctrl = (
|
||||
( mvControlling->StLinFlag )
|
||||
&& ( mvControlling->RList[ mvControlling->MainCtrlActualPos ].R < 0.01 )
|
||||
&& ( useseriesmode ?
|
||||
mvControlling->RList[ mvControlling->MainCtrlActualPos ].Bn == 1 :
|
||||
mvControlling->RList[ mvControlling->MainCtrlActualPos ].Bn > 1 ) );
|
||||
( ( mvOccupied->Vel <= ( ( mvOccupied->BrakeDelayFlag & bdelay_G ) != 0 ? 55 : 45 ) + ( mvControlling->ScndCtrlPos == 0 ? 0 : 5 ) ) ?
|
||||
mvControlling->RList[ mvControlling->MainCtrlActualPos ].Bn > 1 :
|
||||
mvControlling->MainCtrlPos == mvControlling->MainCtrlPosNo ) ) );
|
||||
|
||||
double Vs = 99999;
|
||||
if( scndctrl ?
|
||||
@@ -3853,7 +3859,7 @@ TController::UpdateSituation(double dt) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if( fVoltage < 0.8 * mvControlling->EnginePowerSource.CollectorParameters.MaxV ) {
|
||||
if( fVoltage < 0.75 * mvControlling->EnginePowerSource.CollectorParameters.MaxV ) {
|
||||
// if the power station is heavily burdened try to reduce the load
|
||||
switch( mvControlling->EngineType ) {
|
||||
|
||||
|
||||
@@ -1149,40 +1149,42 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap
|
||||
hvc = Couplers[ side::front ].power_high.voltage + Couplers[ side::rear ].power_high.voltage;
|
||||
#endif
|
||||
|
||||
if( ( std::abs( PantFrontVolt ) + std::abs( PantRearVolt ) < 1.0 )
|
||||
&& ( hvc > 1.0 ) ) {
|
||||
// bez napiecia, ale jest cos na sprzegach:
|
||||
// przekazywanie pradow
|
||||
for( int side = 0; side < 2; ++side ) {
|
||||
if( std::abs( PantFrontVolt ) + std::abs( PantRearVolt ) < 1.0 ) {
|
||||
// bez napiecia...
|
||||
if( hvc != 0.0 ) {
|
||||
// ...ale jest cos na sprzegach:
|
||||
// przekazywanie pradow
|
||||
for( int side = 0; side < 2; ++side ) {
|
||||
|
||||
Couplers[ side ].power_high.local = false; // power, if any, will be from external source
|
||||
Couplers[ side ].power_high.local = false; // power, if any, will be from external source
|
||||
|
||||
if( ( Couplers[ side ].CouplingFlag & ctrain_power )
|
||||
|| ( ( Heating )
|
||||
&& ( Couplers[ side ].CouplingFlag & ctrain_heating ) ) ) {
|
||||
if( ( Couplers[ side ].CouplingFlag & ctrain_power )
|
||||
|| ( ( Heating )
|
||||
&& ( Couplers[ side ].CouplingFlag & ctrain_heating ) ) ) {
|
||||
#ifdef EU07_USE_OLD_HVCOUPLERS
|
||||
auto const oppositeside = ( Couplers[side].ConnectedNr == side::front ? side::rear : side::front );
|
||||
HVCouplers[ side ][ hvcoupler::current ] =
|
||||
Couplers[side].Connected->HVCouplers[oppositeside][hvcoupler::current] +
|
||||
Itot * HVCouplers[side][hvcoupler::voltage] / hvc; // obciążenie rozkladane stosownie do napiec
|
||||
auto const oppositeside = ( Couplers[side].ConnectedNr == side::front ? side::rear : side::front );
|
||||
HVCouplers[ side ][ hvcoupler::current ] =
|
||||
Couplers[side].Connected->HVCouplers[oppositeside][hvcoupler::current] +
|
||||
Itot * HVCouplers[side][hvcoupler::voltage] / hvc; // obciążenie rozkladane stosownie do napiec
|
||||
#else
|
||||
auto const &connectedsothercoupler =
|
||||
Couplers[ side ].Connected->Couplers[
|
||||
( Couplers[ side ].ConnectedNr == side::front ?
|
||||
side::rear :
|
||||
side::front ) ];
|
||||
Couplers[ side ].power_high.current =
|
||||
connectedsothercoupler.power_high.current
|
||||
+ Itot * Couplers[ side ].power_high.voltage / hvc; // obciążenie rozkladane stosownie do napiec
|
||||
auto const &connectedsothercoupler =
|
||||
Couplers[ side ].Connected->Couplers[
|
||||
( Couplers[ side ].ConnectedNr == side::front ?
|
||||
side::rear :
|
||||
side::front ) ];
|
||||
Couplers[ side ].power_high.current =
|
||||
connectedsothercoupler.power_high.current
|
||||
+ Itot * Couplers[ side ].power_high.voltage / hvc; // obciążenie rozkladane stosownie do napiec
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
#ifdef EU07_USE_OLD_HVCOUPLERS
|
||||
// pierwszy pojazd
|
||||
HVCouplers[side][hvcoupler::current] = Itot * HVCouplers[side][hvcoupler::voltage] / hvc;
|
||||
// pierwszy pojazd
|
||||
HVCouplers[side][hvcoupler::current] = Itot * HVCouplers[side][hvcoupler::voltage] / hvc;
|
||||
#else
|
||||
Couplers[ side ].power_high.current = Itot * Couplers[ side ].power_high.voltage / hvc;
|
||||
Couplers[ side ].power_high.current = Itot * Couplers[ side ].power_high.voltage / hvc;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
12
Segment.cpp
12
Segment.cpp
@@ -36,11 +36,6 @@ TSegment::TSegment(TTrack *owner) :
|
||||
pOwner( owner )
|
||||
{}
|
||||
|
||||
TSegment::~TSegment()
|
||||
{
|
||||
SafeDeleteArray(fTsBuffer);
|
||||
}
|
||||
|
||||
bool TSegment::Init(Math3D::vector3 NewPoint1, Math3D::vector3 NewPoint2, double fNewStep, double fNewRoll1, double fNewRoll2)
|
||||
{ // wersja dla prostego - wyliczanie punktów kontrolnych
|
||||
Math3D::vector3 dir;
|
||||
@@ -140,8 +135,7 @@ bool TSegment::Init( Math3D::vector3 &NewPoint1, Math3D::vector3 NewCPointOut, M
|
||||
*/
|
||||
fStep = fLength / iSegCount; // update step to equalize size of individual pieces
|
||||
|
||||
SafeDeleteArray( fTsBuffer );
|
||||
fTsBuffer = new double[ iSegCount + 1 ];
|
||||
fTsBuffer.resize( iSegCount + 1 );
|
||||
fTsBuffer[ 0 ] = 0.0;
|
||||
for( int i = 1; i < iSegCount; ++i ) {
|
||||
fTsBuffer[ i ] = GetTFromS( i * fStep );
|
||||
@@ -213,7 +207,7 @@ double TSegment::GetTFromS(double const s) const
|
||||
|
||||
do {
|
||||
double fDifference = RombergIntegral(0, fTime) - s;
|
||||
if( ( fDifference > 0 ? fDifference : -fDifference ) < fTolerance ) {
|
||||
if( std::abs( fDifference ) < fTolerance ) {
|
||||
return fTime;
|
||||
}
|
||||
|
||||
@@ -386,7 +380,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori
|
||||
// podany jest przekrój końcowy
|
||||
// podsypka toru jest robiona za pomocą 6 punktów, szyna 12, drogi i rzeki na 3+2+3
|
||||
|
||||
if( !fTsBuffer )
|
||||
if( fTsBuffer.empty() )
|
||||
return false; // prowizoryczne zabezpieczenie przed wysypem - ustalić faktyczną przyczynę
|
||||
|
||||
glm::vec3 pos1, pos2, dir, parallel1, parallel2, pt, norm;
|
||||
|
||||
@@ -40,7 +40,7 @@ class TSegment
|
||||
fRoll1 { 0.f },
|
||||
fRoll2 { 0.f }; // przechyłka na końcach
|
||||
double fLength { -1.0 }; // długość policzona
|
||||
double *fTsBuffer = nullptr; // wartości parametru krzywej dla równych odcinków
|
||||
std::vector<double> fTsBuffer; // wartości parametru krzywej dla równych odcinków
|
||||
double fStep = 0.0;
|
||||
int iSegCount = 0; // ilość odcinków do rysowania krzywej
|
||||
double fDirection = 0.0; // Ra: kąt prostego w planie; dla łuku kąt od Point1
|
||||
@@ -63,7 +63,6 @@ public:
|
||||
bool bCurve = false;
|
||||
|
||||
TSegment(TTrack *owner);
|
||||
~TSegment();
|
||||
bool
|
||||
Init( Math3D::vector3 NewPoint1, Math3D::vector3 NewPoint2, double fNewStep, double fNewRoll1 = 0, double fNewRoll2 = 0);
|
||||
bool
|
||||
@@ -125,7 +124,7 @@ public:
|
||||
inline
|
||||
int
|
||||
RaSegCount() const {
|
||||
return fTsBuffer ? iSegCount : 1; };
|
||||
return ( fTsBuffer.empty() ? 1 : iSegCount ); };
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@@ -6350,6 +6350,7 @@ void TTrain::clear_cab_controls()
|
||||
// hunter-091012
|
||||
ggCabLightButton.Clear();
|
||||
ggCabLightDimButton.Clear();
|
||||
ggBatteryButton.Clear();
|
||||
//-------
|
||||
ggFuseButton.Clear();
|
||||
ggConverterFuseButton.Clear();
|
||||
@@ -6363,9 +6364,15 @@ void TTrain::clear_cab_controls()
|
||||
ggDoorLeftButton.Clear();
|
||||
ggDoorRightButton.Clear();
|
||||
ggTrainHeatingButton.Clear();
|
||||
ggSignallingButton.Clear();
|
||||
ggDoorSignallingButton.Clear();
|
||||
ggDepartureSignalButton.Clear();
|
||||
ggCompressorButton.Clear();
|
||||
ggCompressorLocalButton.Clear();
|
||||
ggConverterButton.Clear();
|
||||
ggConverterOffButton.Clear();
|
||||
ggConverterLocalButton.Clear();
|
||||
ggMainButton.Clear();
|
||||
ggPantFrontButton.Clear();
|
||||
ggPantRearButton.Clear();
|
||||
ggPantSelectedButton.Clear();
|
||||
|
||||
Reference in New Issue
Block a user