mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
Separate FFList from DEList, add FFEDList (ffBrakeList)
Added a new optional section to .fiz files: `ffBrakeList`. It is used instead of `ffList` whenever the vehicle has its ED braking engaged. Example (dynamic/pkp/elf_v1/inverter_kp.fiz): ``` ffList: Size=3 0 2.0 33.7 2.08 34.0 2.12 130.4 8.10 endff ffBrakeList: Size=4 0 2.0 33.7 2.08 34.8 2.08 34.8 2.17 130.4 8.10 endff ```
This commit is contained in:
@@ -609,6 +609,13 @@ struct TDEScheme
|
|||||||
double Umax = 0.0; /*napiecie maksymalne*/
|
double Umax = 0.0; /*napiecie maksymalne*/
|
||||||
double Imax = 0.0; /*prad maksymalny*/
|
double Imax = 0.0; /*prad maksymalny*/
|
||||||
};
|
};
|
||||||
|
typedef TDEScheme TDESchemeTable[33]; /*tablica WWList dla silnikow spalinowych*/
|
||||||
|
struct TFFScheme
|
||||||
|
{
|
||||||
|
double v = 0.0; // parametr wejsciowy
|
||||||
|
double freq = 0.0; // wyjscie: czestotliwosc falownika
|
||||||
|
};
|
||||||
|
typedef TFFScheme TFFSchemeTable[33];
|
||||||
|
|
||||||
struct TWiperScheme
|
struct TWiperScheme
|
||||||
{
|
{
|
||||||
@@ -619,8 +626,6 @@ struct TWiperScheme
|
|||||||
};
|
};
|
||||||
typedef TWiperScheme TWiperSchemeTable[16];
|
typedef TWiperScheme TWiperSchemeTable[16];
|
||||||
|
|
||||||
|
|
||||||
typedef TDEScheme TDESchemeTable[33]; /*tablica rezystorow rozr.*/
|
|
||||||
struct TShuntScheme
|
struct TShuntScheme
|
||||||
{
|
{
|
||||||
double Umin = 0.0;
|
double Umin = 0.0;
|
||||||
@@ -1373,6 +1378,10 @@ class TMoverParameters
|
|||||||
bool Flat = false;
|
bool Flat = false;
|
||||||
double Vhyp = 1.0;
|
double Vhyp = 1.0;
|
||||||
TDESchemeTable DElist;
|
TDESchemeTable DElist;
|
||||||
|
TFFSchemeTable FFlist;
|
||||||
|
int FFListSize = 0;
|
||||||
|
TFFSchemeTable FFEDlist;
|
||||||
|
int FFEDListSize = 0;
|
||||||
TWiperSchemeTable WiperList;
|
TWiperSchemeTable WiperList;
|
||||||
int WiperListSize;
|
int WiperListSize;
|
||||||
|
|
||||||
@@ -2063,6 +2072,7 @@ private:
|
|||||||
void LoadFIZ_UCList(std::string const &Input);
|
void LoadFIZ_UCList(std::string const &Input);
|
||||||
void LoadFIZ_DList( std::string const &Input );
|
void LoadFIZ_DList( std::string const &Input );
|
||||||
void LoadFIZ_FFList( std::string const &Input );
|
void LoadFIZ_FFList( std::string const &Input );
|
||||||
|
void LoadFIZ_FFEDList( std::string const &Input );
|
||||||
void LoadFIZ_WiperList(std::string const &Input);
|
void LoadFIZ_WiperList(std::string const &Input);
|
||||||
void LoadFIZ_LightsList( std::string const &Input );
|
void LoadFIZ_LightsList( std::string const &Input );
|
||||||
void LoadFIZ_CompressorList(std::string const &Input);
|
void LoadFIZ_CompressorList(std::string const &Input);
|
||||||
@@ -2084,6 +2094,7 @@ private:
|
|||||||
bool readHTCList(std::string const &line);
|
bool readHTCList(std::string const &line);
|
||||||
bool readPmaxList(std::string const &line);
|
bool readPmaxList(std::string const &line);
|
||||||
bool readFFList( std::string const &line );
|
bool readFFList( std::string const &line );
|
||||||
|
bool readFFEDList( std::string const &line );
|
||||||
bool readWWList( std::string const &line );
|
bool readWWList( std::string const &line );
|
||||||
bool readWiperList( std::string const &line );
|
bool readWiperList( std::string const &line );
|
||||||
bool readLightsList( std::string const &Input );
|
bool readLightsList( std::string const &Input );
|
||||||
|
|||||||
@@ -6432,21 +6432,24 @@ double TMoverParameters::TractionForce( double dt ) {
|
|||||||
EnginePower = abs(eimv[eimv_Ic] * eimv[eimv_U] * NPoweredAxles) / 1000;
|
EnginePower = abs(eimv[eimv_Ic] * eimv[eimv_U] * NPoweredAxles) / 1000;
|
||||||
// power inverters
|
// power inverters
|
||||||
auto const tmpV { std::abs( eimv[ eimv_fp ] ) };
|
auto const tmpV { std::abs( eimv[ eimv_fp ] ) };
|
||||||
|
auto const useFFEDList = FFEDListSize > 0 && DynamicBrakeFlag;
|
||||||
|
auto const list = useFFEDList ? FFEDlist : FFlist;
|
||||||
|
auto const listSize = useFFEDList ? FFEDListSize : FFListSize;
|
||||||
|
|
||||||
if( ( RlistSize > 0 )
|
if( ( listSize > 0 )
|
||||||
&& ( ( std::abs( eimv[ eimv_If ] ) > 1.0 )
|
&& ( ( std::abs( eimv[ eimv_If ] ) > 1.0 )
|
||||||
&& ( tmpV > 0.0001 ) ) ) {
|
&& ( tmpV > 0.0001 ) ) ) {
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while( ( i < RlistSize - 1 )
|
while( ( i < listSize - 1 )
|
||||||
&& ( DElist[ i + 1 ].RPM < tmpV ) ) {
|
&& ( list[ i + 1 ].v < tmpV ) ) {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
InverterFrequency =
|
InverterFrequency =
|
||||||
( tmpV - DElist[ i ].RPM )
|
( tmpV - list[ i ].v )
|
||||||
/ std::max( 1.0, ( DElist[ i + 1 ].RPM - DElist[ i ].RPM ) )
|
/ std::max( 1.0, ( list[ i + 1 ].v - list[ i ].v ) )
|
||||||
* ( DElist[ i + 1 ].GenPower - DElist[ i ].GenPower )
|
* ( list[ i + 1 ].freq - list[ i ].freq )
|
||||||
+ DElist[ i ].GenPower;
|
+ list[ i ].freq;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
InverterFrequency = 0.0;
|
InverterFrequency = 0.0;
|
||||||
@@ -8928,7 +8931,7 @@ bool startBPT;
|
|||||||
bool startMPT, startMPT0;
|
bool startMPT, startMPT0;
|
||||||
bool startRLIST, startUCLIST;
|
bool startRLIST, startUCLIST;
|
||||||
bool startDIZELMOMENTUMLIST, startDIZELV2NMAXLIST, startHYDROTCLIST, startPMAXLIST;
|
bool startDIZELMOMENTUMLIST, startDIZELV2NMAXLIST, startHYDROTCLIST, startPMAXLIST;
|
||||||
bool startDLIST, startFFLIST, startWWLIST, startWiperList;
|
bool startDLIST, startFFLIST, startFFEDLIST, startWWLIST, startWiperList;
|
||||||
bool startLIGHTSLIST;
|
bool startLIGHTSLIST;
|
||||||
bool startCOMPRESSORLIST;
|
bool startCOMPRESSORLIST;
|
||||||
int LISTLINE;
|
int LISTLINE;
|
||||||
@@ -9269,13 +9272,32 @@ bool TMoverParameters::readFFList( std::string const &line ) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int idx = LISTLINE++;
|
int idx = LISTLINE++;
|
||||||
if( idx >= sizeof( DElist ) / sizeof( TDEScheme ) ) {
|
if( idx >= sizeof( FFlist ) / sizeof( TFFScheme ) ) {
|
||||||
WriteLog( "Read FList: number of entries exceeded capacity of the data table" );
|
WriteLog( "Read FList: number of entries exceeded capacity of the data table" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
parser
|
parser
|
||||||
>> DElist[ idx ].RPM
|
>> FFlist[ idx ].v
|
||||||
>> DElist[ idx ].GenPower;
|
>> FFlist[ idx ].freq;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TMoverParameters::readFFEDList( std::string const &line ) {
|
||||||
|
|
||||||
|
cParser parser( line );
|
||||||
|
if( false == parser.getTokens( 2, false ) ) {
|
||||||
|
WriteLog( "Read FList: arguments missing in line " + std::to_string( LISTLINE + 1 ) );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
int idx = LISTLINE++;
|
||||||
|
if( idx >= sizeof( FFEDlist ) / sizeof( TFFScheme ) ) {
|
||||||
|
WriteLog( "Read FList: number of entries exceeded capacity of the data table" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
parser
|
||||||
|
>> FFEDlist[ idx ].v
|
||||||
|
>> FFEDlist[ idx ].freq;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -9481,6 +9503,7 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
startHYDROTCLIST = false;
|
startHYDROTCLIST = false;
|
||||||
startPMAXLIST = false;
|
startPMAXLIST = false;
|
||||||
startFFLIST = false;
|
startFFLIST = false;
|
||||||
|
startFFEDLIST = false;
|
||||||
startWWLIST = false;
|
startWWLIST = false;
|
||||||
startWiperList = false;
|
startWiperList = false;
|
||||||
startLIGHTSLIST = false;
|
startLIGHTSLIST = false;
|
||||||
@@ -9581,6 +9604,7 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
if( issection( "endff", inputline ) ) {
|
if( issection( "endff", inputline ) ) {
|
||||||
startBPT = false;
|
startBPT = false;
|
||||||
startFFLIST = false;
|
startFFLIST = false;
|
||||||
|
startFFEDLIST = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (issection("endwl", inputline))
|
if (issection("endwl", inputline))
|
||||||
@@ -9877,6 +9901,13 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( issection( "ffBrakeList:", inputline ) ) {
|
||||||
|
startBPT = false;
|
||||||
|
startFFEDLIST = true; LISTLINE = 0;
|
||||||
|
LoadFIZ_FFEDList( inputline );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if( issection( "WWList:", inputline ) )
|
if( issection( "WWList:", inputline ) )
|
||||||
{
|
{
|
||||||
startBPT = false;
|
startBPT = false;
|
||||||
@@ -9959,6 +9990,10 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
|||||||
readFFList( inputline );
|
readFFList( inputline );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if( true == startFFEDLIST ) {
|
||||||
|
readFFEDList( inputline );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if( true == startWWLIST ) {
|
if( true == startWWLIST ) {
|
||||||
readWWList( inputline );
|
readWWList( inputline );
|
||||||
continue;
|
continue;
|
||||||
@@ -11315,8 +11350,11 @@ void TMoverParameters::LoadFIZ_DList( std::string const &Input ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TMoverParameters::LoadFIZ_FFList( std::string const &Input ) {
|
void TMoverParameters::LoadFIZ_FFList( std::string const &Input ) {
|
||||||
|
extract_value( FFListSize, "Size", Input, "" );
|
||||||
|
}
|
||||||
|
|
||||||
extract_value( RlistSize, "Size", Input, "" );
|
void TMoverParameters::LoadFIZ_FFEDList( std::string const &Input ) {
|
||||||
|
extract_value( FFEDListSize, "Size", Input, "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user