16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 22:09:19 +02:00

Merge branch 'tmj-dev' into milek-dev

This commit is contained in:
milek7
2018-06-30 18:49:20 +02:00
6 changed files with 52 additions and 44 deletions

View File

@@ -2733,19 +2733,25 @@ bool TController::IncSpeed()
(mvControlling->StLinFlag)) // youBy polecił dodać 2012-09-08 v367 (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) // na pozycji 0 przejdzie, a na pozostałych będzie czekać, aż się załączą liniowe (zgaśnie DelayCtrlFlag)
if (Ready || (iDrivigFlags & movePress)) { 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 // use series mode:
auto const useseriesmodevoltage { 0.85 * mvControlling->EnginePowerSource.CollectorParameters.MaxV }; // 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 = ( auto const useseriesmode = (
( mvOccupied->Vel <= ( ( mvOccupied->BrakeDelayFlag & bdelay_G ) != 0 ? 35 : 25 ) + ( mvControlling->ScndCtrlPos == 0 ? 0 : 5 ) ) ( mvOccupied->Vel <= ( ( mvOccupied->BrakeDelayFlag & bdelay_G ) != 0 ? 35 : 25 ) + ( mvControlling->ScndCtrlPos == 0 ? 0 : 5 ) )
|| ( mvControlling->Imax > mvControlling->ImaxLo ) || ( mvControlling->Imax > mvControlling->ImaxLo )
|| ( fVoltage < useseriesmodevoltage ) ); || ( 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 = ( auto const scndctrl = (
( mvControlling->StLinFlag ) ( mvControlling->StLinFlag )
&& ( mvControlling->RList[ mvControlling->MainCtrlActualPos ].R < 0.01 ) && ( mvControlling->RList[ mvControlling->MainCtrlActualPos ].R < 0.01 )
&& ( useseriesmode ? && ( useseriesmode ?
mvControlling->RList[ mvControlling->MainCtrlActualPos ].Bn == 1 : 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; double Vs = 99999;
if( scndctrl ? 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 // if the power station is heavily burdened try to reduce the load
switch( mvControlling->EngineType ) { switch( mvControlling->EngineType ) {

View File

@@ -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; hvc = Couplers[ side::front ].power_high.voltage + Couplers[ side::rear ].power_high.voltage;
#endif #endif
if( ( std::abs( PantFrontVolt ) + std::abs( PantRearVolt ) < 1.0 ) if( std::abs( PantFrontVolt ) + std::abs( PantRearVolt ) < 1.0 ) {
&& ( hvc > 1.0 ) ) { // bez napiecia...
// bez napiecia, ale jest cos na sprzegach: if( hvc != 0.0 ) {
// przekazywanie pradow // ...ale jest cos na sprzegach:
for( int side = 0; side < 2; ++side ) { // 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 ) if( ( Couplers[ side ].CouplingFlag & ctrain_power )
|| ( ( Heating ) || ( ( Heating )
&& ( Couplers[ side ].CouplingFlag & ctrain_heating ) ) ) { && ( Couplers[ side ].CouplingFlag & ctrain_heating ) ) ) {
#ifdef EU07_USE_OLD_HVCOUPLERS #ifdef EU07_USE_OLD_HVCOUPLERS
auto const oppositeside = ( Couplers[side].ConnectedNr == side::front ? side::rear : side::front ); auto const oppositeside = ( Couplers[side].ConnectedNr == side::front ? side::rear : side::front );
HVCouplers[ side ][ hvcoupler::current ] = HVCouplers[ side ][ hvcoupler::current ] =
Couplers[side].Connected->HVCouplers[oppositeside][hvcoupler::current] + Couplers[side].Connected->HVCouplers[oppositeside][hvcoupler::current] +
Itot * HVCouplers[side][hvcoupler::voltage] / hvc; // obciążenie rozkladane stosownie do napiec Itot * HVCouplers[side][hvcoupler::voltage] / hvc; // obciążenie rozkladane stosownie do napiec
#else #else
auto const &connectedsothercoupler = auto const &connectedsothercoupler =
Couplers[ side ].Connected->Couplers[ Couplers[ side ].Connected->Couplers[
( Couplers[ side ].ConnectedNr == side::front ? ( Couplers[ side ].ConnectedNr == side::front ?
side::rear : side::rear :
side::front ) ]; side::front ) ];
Couplers[ side ].power_high.current = Couplers[ side ].power_high.current =
connectedsothercoupler.power_high.current connectedsothercoupler.power_high.current
+ Itot * Couplers[ side ].power_high.voltage / hvc; // obciążenie rozkladane stosownie do napiec + Itot * Couplers[ side ].power_high.voltage / hvc; // obciążenie rozkladane stosownie do napiec
#endif #endif
} }
else { else {
#ifdef EU07_USE_OLD_HVCOUPLERS #ifdef EU07_USE_OLD_HVCOUPLERS
// pierwszy pojazd // pierwszy pojazd
HVCouplers[side][hvcoupler::current] = Itot * HVCouplers[side][hvcoupler::voltage] / hvc; HVCouplers[side][hvcoupler::current] = Itot * HVCouplers[side][hvcoupler::voltage] / hvc;
#else #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 #endif
}
} }
} }
} }

View File

@@ -36,11 +36,6 @@ TSegment::TSegment(TTrack *owner) :
pOwner( owner ) pOwner( owner )
{} {}
TSegment::~TSegment()
{
SafeDeleteArray(fTsBuffer);
}
bool TSegment::Init(Math3D::vector3 NewPoint1, Math3D::vector3 NewPoint2, double fNewStep, double fNewRoll1, double fNewRoll2) bool TSegment::Init(Math3D::vector3 NewPoint1, Math3D::vector3 NewPoint2, double fNewStep, double fNewRoll1, double fNewRoll2)
{ // wersja dla prostego - wyliczanie punktów kontrolnych { // wersja dla prostego - wyliczanie punktów kontrolnych
Math3D::vector3 dir; 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 fStep = fLength / iSegCount; // update step to equalize size of individual pieces
SafeDeleteArray( fTsBuffer ); fTsBuffer.resize( iSegCount + 1 );
fTsBuffer = new double[ iSegCount + 1 ];
fTsBuffer[ 0 ] = 0.0; fTsBuffer[ 0 ] = 0.0;
for( int i = 1; i < iSegCount; ++i ) { for( int i = 1; i < iSegCount; ++i ) {
fTsBuffer[ i ] = GetTFromS( i * fStep ); fTsBuffer[ i ] = GetTFromS( i * fStep );
@@ -213,7 +207,7 @@ double TSegment::GetTFromS(double const s) const
do { do {
double fDifference = RombergIntegral(0, fTime) - s; double fDifference = RombergIntegral(0, fTime) - s;
if( ( fDifference > 0 ? fDifference : -fDifference ) < fTolerance ) { if( std::abs( fDifference ) < fTolerance ) {
return fTime; return fTime;
} }
@@ -386,7 +380,7 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori
// podany jest przekrój końcowy // podany jest przekrój końcowy
// podsypka toru jest robiona za pomocą 6 punktów, szyna 12, drogi i rzeki na 3+2+3 // 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ę return false; // prowizoryczne zabezpieczenie przed wysypem - ustalić faktyczną przyczynę
glm::vec3 pos1, pos2, dir, parallel1, parallel2, pt, norm; glm::vec3 pos1, pos2, dir, parallel1, parallel2, pt, norm;

View File

@@ -40,7 +40,7 @@ class TSegment
fRoll1 { 0.f }, fRoll1 { 0.f },
fRoll2 { 0.f }; // przechyłka na końcach fRoll2 { 0.f }; // przechyłka na końcach
double fLength { -1.0 }; // długość policzona 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; double fStep = 0.0;
int iSegCount = 0; // ilość odcinków do rysowania krzywej 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 double fDirection = 0.0; // Ra: kąt prostego w planie; dla łuku kąt od Point1
@@ -63,7 +63,6 @@ public:
bool bCurve = false; bool bCurve = false;
TSegment(TTrack *owner); TSegment(TTrack *owner);
~TSegment();
bool bool
Init( Math3D::vector3 NewPoint1, Math3D::vector3 NewPoint2, double fNewStep, double fNewRoll1 = 0, double fNewRoll2 = 0); Init( Math3D::vector3 NewPoint1, Math3D::vector3 NewPoint2, double fNewStep, double fNewRoll1 = 0, double fNewRoll2 = 0);
bool bool
@@ -125,7 +124,7 @@ public:
inline inline
int int
RaSegCount() const { RaSegCount() const {
return fTsBuffer ? iSegCount : 1; }; return ( fTsBuffer.empty() ? 1 : iSegCount ); };
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@@ -6350,6 +6350,7 @@ void TTrain::clear_cab_controls()
// hunter-091012 // hunter-091012
ggCabLightButton.Clear(); ggCabLightButton.Clear();
ggCabLightDimButton.Clear(); ggCabLightDimButton.Clear();
ggBatteryButton.Clear();
//------- //-------
ggFuseButton.Clear(); ggFuseButton.Clear();
ggConverterFuseButton.Clear(); ggConverterFuseButton.Clear();
@@ -6363,9 +6364,15 @@ void TTrain::clear_cab_controls()
ggDoorLeftButton.Clear(); ggDoorLeftButton.Clear();
ggDoorRightButton.Clear(); ggDoorRightButton.Clear();
ggTrainHeatingButton.Clear(); ggTrainHeatingButton.Clear();
ggSignallingButton.Clear();
ggDoorSignallingButton.Clear();
ggDepartureSignalButton.Clear(); ggDepartureSignalButton.Clear();
ggCompressorButton.Clear(); ggCompressorButton.Clear();
ggCompressorLocalButton.Clear();
ggConverterButton.Clear(); ggConverterButton.Clear();
ggConverterOffButton.Clear();
ggConverterLocalButton.Clear();
ggMainButton.Clear();
ggPantFrontButton.Clear(); ggPantFrontButton.Clear();
ggPantRearButton.Clear(); ggPantRearButton.Clear();
ggPantSelectedButton.Clear(); ggPantSelectedButton.Clear();

View File

@@ -1 +1 @@
#define VERSION_INFO "M7 27.06.2018, based on tmj 30e31cd" #define VERSION_INFO "M7 30.06.2018, based on tmj 5dfbd5b"