mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-17 23:39:18 +02:00
General lights overhaul
Add modern light switcher Available fiz variables with defualt parameters Headlights: LampRed=255 LampGreen=255 LampBlue=255 DimmedMultiplier=0.6 NormalMultiplier=1.0 HighbeamDimmedMultiplier=2.5 HighBeamMultiplier=2.8 Switches: ModernDimmer=No ModernDimmerOffPosition=Yes
This commit is contained in:
@@ -205,6 +205,8 @@ enum light {
|
||||
rearendsignals = ( 1 << 6 ),
|
||||
auxiliary_left = ( 1 << 7 ),
|
||||
auxiliary_right = ( 1 << 8 ),
|
||||
highbeamlight_left = ( 1 << 9 ),
|
||||
highbeamlight_right = ( 1 << 10 )
|
||||
};
|
||||
|
||||
// door operation methods; exclusive
|
||||
@@ -1705,6 +1707,26 @@ public:
|
||||
int iProblem = 0; // flagi problemów z taborem, aby AI nie musiało porównywać; 0=może jechać
|
||||
int iLights[2]; // bity zapalonych świateł tutaj, żeby dało się liczyć pobór prądu
|
||||
|
||||
// Status nowszego hebelka od przyciemniania swiatel/swiatel dlugich
|
||||
// 0 - swiatla wylaczone (opcja dziala tylko gdy w fiz zdefiniowano OffState w sekcji Switches; w przeciwnym wypadku pstryk startuje z wartoscia == 1
|
||||
// 1 - swiatla normalne przyciemnione
|
||||
// 2 - swiatla normalne
|
||||
// 3 - swiatla dlugie przyciemnione
|
||||
// 4 - swiatla dlugie normalne
|
||||
int modernDimmerState{0};
|
||||
bool modernContainOffPos = true;
|
||||
bool enableModernDimmer = false;
|
||||
|
||||
// Barwa reflektora
|
||||
int refR{255}; // Czerwony
|
||||
int refG{255}; // Zielony
|
||||
int refB{255}; // Niebieski
|
||||
|
||||
double dimMultiplier{0.6f}; // mnoznik swiatel przyciemnionych
|
||||
double normMultiplier{1.0f}; // mnoznik swiatel zwyklych
|
||||
double highDimMultiplier{2.5f}; // mnoznik dlugich przyciemnionych
|
||||
double highMultiplier{2.8f}; // mnoznik dlugich
|
||||
|
||||
plc::basic_controller m_plc;
|
||||
|
||||
int AIHintPantstate{ 0 }; // suggested pantograph setup
|
||||
@@ -1969,6 +1991,7 @@ private:
|
||||
void LoadFIZ_DCEMUED(std::string const &line);
|
||||
void LoadFIZ_SpringBrake(std::string const &line);
|
||||
void LoadFIZ_Light( std::string const &line );
|
||||
void LoadFIZ_Headlights(std::string const &Line);
|
||||
void LoadFIZ_Clima( std::string const &line );
|
||||
void LoadFIZ_Power( std::string const &Line );
|
||||
void LoadFIZ_SpeedControl( std::string const &Line );
|
||||
|
||||
@@ -9666,6 +9666,14 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (issection("Headlights:", inputline))
|
||||
{
|
||||
startBPT = false;
|
||||
fizlines.emplace("Headlights", inputline);
|
||||
LoadFIZ_Headlights(inputline);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (issection("Blending:", inputline)) {
|
||||
|
||||
startBPT = false; LISTLINE = 0;
|
||||
@@ -10026,6 +10034,18 @@ void TMoverParameters::LoadFIZ_Load( std::string const &line ) {
|
||||
extract_value( UnLoadSpeed, "UnLoadSpeed", line, "" );
|
||||
}
|
||||
|
||||
void TMoverParameters::LoadFIZ_Headlights(std::string const &line)
|
||||
{
|
||||
extract_value(refR, "LampRed", line, "");
|
||||
extract_value(refG, "LampGreen", line, "");
|
||||
extract_value(refB, "LampBlue", line, "");
|
||||
|
||||
extract_value(dimMultiplier, "DimmedMultiplier", line, "");
|
||||
extract_value(normMultiplier, "NormalMultiplier", line, "");
|
||||
extract_value(highDimMultiplier, "HighbeamDimmedMultiplier", line, "");
|
||||
extract_value(highMultiplier, "HighBeamMultiplier", line, "");
|
||||
}
|
||||
|
||||
void TMoverParameters::LoadFIZ_Dimensions( std::string const &line ) {
|
||||
|
||||
extract_value( Dim.L, "L", line, "" );
|
||||
@@ -11120,6 +11140,12 @@ void TMoverParameters::LoadFIZ_Switches( std::string const &Input ) {
|
||||
extract_value( UniversalResetButtonFlag[ 0 ], "RelayResetButton1", Input, "" );
|
||||
extract_value( UniversalResetButtonFlag[ 1 ], "RelayResetButton2", Input, "" );
|
||||
extract_value( UniversalResetButtonFlag[ 2 ], "RelayResetButton3", Input, "" );
|
||||
extract_value(enableModernDimmer, "ModernDimmer", Input, "");
|
||||
extract_value(modernContainOffPos, "ModernDimmerOffPosition", Input, "");
|
||||
if (!modernContainOffPos)
|
||||
modernDimmerState = 1;
|
||||
if (!enableModernDimmer)
|
||||
modernDimmerState = 2;
|
||||
// pantograph presets
|
||||
{
|
||||
auto &presets { PantsPreset.first };
|
||||
|
||||
Reference in New Issue
Block a user