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

build 190215. timetable consist data tweaks

This commit is contained in:
tmj-fstate
2019-02-15 20:03:32 +01:00
parent c40b54fd93
commit bc7df7fa59
5 changed files with 34 additions and 13 deletions

View File

@@ -1030,9 +1030,9 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
+ ": at " + std::to_string(simulation::Time.data().wHour) + ":" + std::to_string(simulation::Time.data().wMinute)
+ " next " + asNextStop); // informacja
#endif
// update brake settings and ai braking tables
// update consist weight, brake settings and ai braking tables
// NOTE: this calculation is expected to run after completing loading/unloading
AutoRewident(); // nastawianie hamulca do jazdy pociągowej
CheckVehicles(); // nastawianie hamulca do jazdy pociągowej
if( static_cast<int>( std::floor( std::abs( sSpeedTable[ i ].evEvent->input_value( 1 ) ) ) ) % 2 ) {
// nie podjeżdżać do semafora, jeśli droga nie jest wolna

View File

@@ -207,29 +207,47 @@ timetable_panel::update() {
auto textline = " -> " + nextstation;
text_lines.emplace_back( textline, Global.UITextColor );
text_lines.emplace_back( "", Global.UITextColor );
}
}
if( is_expanded ) {
text_lines.emplace_back( "", Global.UITextColor );
if( vehicle->MoverParameters->CategoryFlag == 1 ) {
// consist data
auto consistmass { owner->fMass };
auto consistlength { owner->fLength };
if( ( owner->mvControlling->TrainType != dt_DMU )
&& ( owner->mvControlling->TrainType != dt_EZT )
&& ( owner->pVehicles[end::front] != owner->pVehicles[end::rear] ) ) {
//odejmij lokomotywy czynne, a przynajmniej aktualną
consistmass -= owner->pVehicle->MoverParameters->TotalMass;
// subtract potential other half of a two-part vehicle
auto const *previous { owner->pVehicle->PrevC( coupling::permanent ) };
if( previous != nullptr ) { consistmass -= previous->MoverParameters->TotalMass; }
auto const *next { owner->pVehicle->NextC( coupling::permanent ) };
if( next != nullptr ) { consistmass -= next->MoverParameters->TotalMass; }
// consistlength -= owner->pVehicle->MoverParameters->Dim.L;
}
std::snprintf(
m_buffer.data(), m_buffer.size(),
locale::strings[ locale::string::driver_timetable_consistdata ].c_str(),
static_cast<int>( table->LocLoad ),
static_cast<int>( consistmass / 1000 ),
static_cast<int>( consistlength ) );
text_lines.emplace_back( m_buffer.data(), Global.UITextColor );
text_lines.emplace_back( "", Global.UITextColor );
}
if( 0 == table->StationCount ) {
// only bother if there's stations to list
text_lines.emplace_back( locale::strings[ locale::string::driver_timetable_notimetable ], Global.UITextColor );
}
else {
auto const readycolor { glm::vec4( 84.0f / 255.0f, 164.0f / 255.0f, 132.0f / 255.0f, 1.f ) };
text_lines.emplace_back("Brutto rozkl. " + to_string(table->LocLoad), Global.UITextColor);
auto fMass = owner->fMass / 1000;
if (owner->mvControlling->TrainType & (dt_DMU + dt_EZT) == 0)
{
//odejmij lokomotywy czynne, a przynajmniej aktualną
}
text_lines.emplace_back("Brutto rzecz. " + to_string(fMass,0), Global.UITextColor);
text_lines.emplace_back("Dl.poc. rzecz. " + to_string(owner->fLength,0), Global.UITextColor);
// header
text_lines.emplace_back( "+-----+------------------------------------+-------+-----+", Global.UITextColor );

View File

@@ -41,6 +41,7 @@ init() {
"Timetable",
"Time: %d:%02d:%02d",
"(no timetable)",
"Consist weight: %d t (specified) %d t (actual)\nConsist length: %d m",
"Transcripts",
@@ -183,6 +184,7 @@ init() {
"Rozklad jazdy",
"Godzina: %d:%02d:%02d",
"(brak rozkladu)",
"Brutto: %d t (rozkladowe) %d t (rzeczywiste)\nDlugosc pociagu: %d m",
"Transkrypcje",

View File

@@ -30,6 +30,7 @@ enum string {
driver_timetable_header,
driver_timetable_time,
driver_timetable_notimetable,
driver_timetable_consistdata,
driver_transcripts_header,

View File

@@ -1,5 +1,5 @@
#pragma once
#define VERSION_MAJOR 19
#define VERSION_MINOR 129
#define VERSION_MINOR 215
#define VERSION_REVISION 0