mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-27 21:45:16 +01:00
* test(scenarios): AI through a section without voltage and with interlocked line contactors Scenario cases for the parts of #272 (line breaker ahead of the pantographs, PantRequiresMain) and #276 (line contactors interlocked with the vehicle's own converter, LineContactorsInterlock) that had not been run in the simulator before. They all run the AI on the timetable run of td.scn. - ep05_td_dead_section: an EP05 runs under power into a 61 m span of overhead wire that has no voltage. Its line breaker stays closed, the traction force drops to 0, and behind the span the AI takes power again and stops at Przystanek. eu07_td_dead_section is the same run with an EU07, as a reference for the old behaviour: its line breaker opens after 0.2 s and the AI closes it again. - ep05_td_neutral_section: the same span, with the track under it marked overhead 0. The AI coasts from before the dead wire. - ep05_td_section_insulator: a 1 m section insulator, run under power. The 0.2 s voltage hold keeps the traction force up past it. - et42_td_converter_interlock(_cold): an ET42 with the interlock starts up and runs its timetable. - ep05_td_interlock_dead_section_cold: both keys on one EP05, starting cold, with the dead span on its way. - ep05_td_timetable: the plain timetable run of the EP05, as a reference. The runner gets vehicle_variants, a vehicle of the case's own made from one of the game's with .fiz replacements. The game's ET42 data doesn't have the interlock key yet. The runner also gets two new checks: traction (the traction force between two distances travelled) and master_controller. The local converter switch of #276 can't be covered: only the cab can set it, and in test mode nobody sits in a cab. * feat(physics): the genset of a dual-mode vehicle, a second source of the traction circuit (GE#536) A vehicle with induction motors and pantographs can have a diesel generator set as well (Power: GensetPower and the other Genset* keys, Cntrl. GensetStart). The traction selector picks the source of the traction circuit: the catenary through the pantographs, as before, or the genset. It moves only with the line breaker open. - the genset starts on request with the battery on, cranks for GensetStartTime, then runs at idle and up to full revolutions with the traction demand; stopped, it coasts down. It gives its regulated voltage from the idle revolutions up. - on the genset the line breaker closes only on a running genset, the undervoltage trip works at half its voltage, the traction power is capped at the genset's power at its present revolutions times GensetPmaxRatio, braking sends nothing back, and the pantographs' pressure switch is left out. The genset's voltage goes to the train's high voltage line as the pantographs' does. - the commands TractionMode and GensetSwitch pass along the train and can come from a scenery's PutValues. Nothing changes without GensetPower: the selector stays on the catenary and every new branch is unreachable. The keys are ignored, with a line in the log, on a vehicle which isn't an induction motor one fed by pantographs. * feat(cab): the traction selector and the genset switch of a dual-mode vehicle (GE#536) New commands tractionmodetoggle, tractionmodecatenary, tractionmodegenset (shift+G toggles) and gensettoggle, gensetenable, gensetdisable (ctrl+G toggles), and the two-state cab switches tractionmode_sw: and genset_sw:. The selector switch doesn't move while the line breaker is closed. Both act on the whole train, as the fuel pump switch does. A cab without the switches works as before. * test: the genset of a dual-mode vehicle (GE#536) The game's E6ACT with the genset of the E6ACTad "last mile" set in the test (520 kW, the rest assumed): the keys and their defaults, the selector's interlock with the line breaker, the start, the power cap at the wheels, the revolutions following the demand, the stop opening the line breaker, the automatic start, the battery, the pantographs' pressure switch, braking with nothing sent back, the genset feeding the next car through the high voltage coupling, the commands along the train and from a scenery. A run from the catenary is the same, step for step, with the genset keys as without them. * test(scenarios): traction_power check, and an E6ACTad timetable run on its genset (GE#536) traction_power checks the power at the wheels, the traction force times the vehicle speed, against a ceiling and optionally a peak to reach. e6actad_genset_td_timetable runs the td/rozklad timetable with an E6ACTad switched to its genset by the scenery (PutValues from event0 of its track); e6actad_catenary_td_timetable is the same vehicle left on the catenary. Both need a temporary vehicle variant in the game's data, which the README describes; it isn't in the SVN. * test(scenarios): the genset cases make their own E6ACTad variant The two E6ACTad cases needed a vehicle variant placed in the game's dynamic/ by hand. They now make it for the run with vehicle_variants. vehicle_variants takes an optional fiz_from: a file to copy instead of the vehicle's own .fiz, named in full, while the .mmd still comes from "from". e6actad.fiz only includes e6acta.fiz.inc, and the genset keys can't go on a second Power: line after the include, which would load the power source again; so the variant is e6acta.fiz.inc with the keys added to its Cntrl. and Power: lines. Cases without fiz_from work as before. * fix(physics): the genset's traction current isn't taken from the wire (GE#536) On the genset the pantographs still handed the traction current to the wire and the energy meter, so a dual-mode vehicle under a wire loaded the substation while its genset did the work. The current now comes from CatenaryCurrent(): on the catenary the expression DynObj had, on the genset only a heating fed straight from the pantographs. A selector command refused with the line breaker closed is no longer passed down the train, and a car whose genset starts on its own passes the start switch on to the cars behind. The cab's genset switch moves only when the request was taken, so it no longer sticks on an automatic-start car.
448 lines
16 KiB
C++
448 lines
16 KiB
C++
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
/*
|
|
MaSzyna EU07 locomotive simulator
|
|
Copyright (C) 2001-2004 Marcin Wozniak, Maciej Czapkiewicz and others
|
|
*/
|
|
|
|
#include "stdafx.h"
|
|
#include "utilities/translation.h"
|
|
#include "utilities/Logs.h"
|
|
#include "utilities/Globals.h"
|
|
#include "MOVER.h"
|
|
|
|
void locale::init()
|
|
{
|
|
std::fstream stream("lang/" + Global.asLang + ".po", std::ios_base::in | std::ios_base::binary);
|
|
|
|
if (!stream.is_open()) {
|
|
WriteLog("translation: cannot open lang file: lang/" + Global.asLang + ".po");
|
|
return;
|
|
}
|
|
|
|
crashreport_add_info("translation", Global.asLang);
|
|
|
|
while (parse_translation(stream));
|
|
|
|
// texts of the scenery editor, kept apart from the translation of the simulator
|
|
std::fstream editor("lang/editor_" + Global.asLang + ".po", std::ios_base::in | std::ios_base::binary);
|
|
if (editor.is_open())
|
|
while (parse_translation(editor));
|
|
|
|
WriteLog("translation: " + std::to_string(lang_mapping.size()) + " strings and " + std::to_string(plural_mapping.size()) + " plural strings loaded");
|
|
}
|
|
|
|
const std::string& locale::lookup_s(const std::string &msg, bool constant)
|
|
{
|
|
if (constant) {
|
|
auto it = pointer_cache.find(&msg);
|
|
if (it != pointer_cache.end())
|
|
return *(const std::string *)it->second;
|
|
}
|
|
|
|
auto it = lang_mapping.find(msg);
|
|
if (it != lang_mapping.end()) {
|
|
if (constant)
|
|
pointer_cache.emplace(&msg, &it->second);
|
|
return it->second;
|
|
}
|
|
|
|
if (constant)
|
|
pointer_cache.emplace(&msg, &msg);
|
|
return msg;
|
|
}
|
|
|
|
const char* locale::lookup_c(const char *msg, bool constant)
|
|
{
|
|
if (constant) {
|
|
auto it = pointer_cache.find(msg);
|
|
if (it != pointer_cache.end())
|
|
return (const char*)it->second;
|
|
}
|
|
|
|
auto it = lang_mapping.find(std::string(msg));
|
|
if (it != lang_mapping.end()) {
|
|
if (constant)
|
|
pointer_cache.emplace(msg, it->second.c_str());
|
|
return it->second.c_str();
|
|
}
|
|
|
|
if (constant)
|
|
pointer_cache.emplace(msg, msg);
|
|
return msg;
|
|
}
|
|
|
|
const char* locale::lookup_n(const char *singular, const char *plural, long long n)
|
|
{
|
|
auto cached = plural_cache.find(singular);
|
|
if (cached == plural_cache.end()) {
|
|
auto it = plural_mapping.find(std::string(singular));
|
|
cached = plural_cache.emplace(singular, it != plural_mapping.end() ? &it->second : nullptr).first;
|
|
}
|
|
|
|
if (cached->second == nullptr)
|
|
return n == 1 ? singular : plural;
|
|
|
|
auto const &forms = *cached->second;
|
|
auto const form = std::min(plural_form(n), forms.size() - 1);
|
|
return forms[form].empty() ? (n == 1 ? singular : plural) : forms[form].c_str();
|
|
}
|
|
|
|
std::size_t locale::plural_form(long long n) const
|
|
{
|
|
n = std::llabs(n);
|
|
if (Global.asLang.compare(0, 2, "pl") == 0) {
|
|
if (n == 1)
|
|
return 0;
|
|
auto const units = n % 10;
|
|
auto const tens = n % 100;
|
|
return units >= 2 && units <= 4 && (tens < 10 || tens >= 20) ? 1 : 2;
|
|
}
|
|
return n == 1 ? 0 : 1;
|
|
}
|
|
|
|
bool locale::parse_translation(std::istream &stream)
|
|
{
|
|
std::string line;
|
|
|
|
std::string msgid;
|
|
std::string msgstr;
|
|
std::string msgctxt;
|
|
std::vector<std::string> forms;
|
|
char last = 'x';
|
|
|
|
auto const commit = [&]() {
|
|
if (!msgid.empty() && !forms.empty())
|
|
plural_mapping.emplace(msgid, std::move(forms));
|
|
else if (!msgid.empty() && !msgstr.empty()) {
|
|
// TODO: context support is incomplete
|
|
if (!msgctxt.empty())
|
|
lang_mapping.emplace(msgctxt + "\x1d" + msgid, msgstr);
|
|
else
|
|
lang_mapping.emplace(msgid, msgstr);
|
|
}
|
|
};
|
|
|
|
while (std::getline(stream, line)) {
|
|
if (line.size() > 0 && line[0] == '#')
|
|
continue;
|
|
|
|
if (line.starts_with("msgid_plural"))
|
|
last = 'p';
|
|
else if (line.starts_with("msgid"))
|
|
last = 'i';
|
|
else if (line.starts_with("msgstr[")) {
|
|
last = 'n';
|
|
forms.resize(std::max<std::size_t>(forms.size(), std::atoi(line.c_str() + 7) + 1));
|
|
}
|
|
else if (line.starts_with("msgstr"))
|
|
last = 's';
|
|
else if (line.starts_with("msgctxt"))
|
|
last = 'c';
|
|
|
|
if (line.size() > 1 && last != 'x') {
|
|
if (last == 'i')
|
|
msgid += parse_c_literal(line);
|
|
else if (last == 's')
|
|
msgstr += parse_c_literal(line);
|
|
else if (last == 'n')
|
|
forms.back() += parse_c_literal(line);
|
|
else if (last == 'c')
|
|
msgctxt += parse_c_literal(line);
|
|
}
|
|
else {
|
|
commit();
|
|
return true;
|
|
}
|
|
}
|
|
|
|
if (!msgid.empty()) {
|
|
commit();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
std::string locale::parse_c_literal(const std::string &str)
|
|
{
|
|
std::istringstream stream(str);
|
|
std::string out;
|
|
|
|
bool active = false;
|
|
bool escape = false;
|
|
|
|
char c;
|
|
while ((c = stream.get()) != std::char_traits<char>::eof()) {
|
|
if (!escape && c == '"')
|
|
active = !active;
|
|
else if (active && !escape && c == '\\')
|
|
escape = true;
|
|
else if (active && escape) {
|
|
if (c == 'r')
|
|
out += '\r';
|
|
else if (c == 'n')
|
|
out += '\n';
|
|
else if (c == 't')
|
|
out += '\t';
|
|
else if (c == '\\')
|
|
out += '\\';
|
|
else if (c == '?')
|
|
out += '?';
|
|
else if (c == '\'')
|
|
out += '\'';
|
|
else if (c == '"')
|
|
out += '"';
|
|
else if (c == 'x') {
|
|
char n1 = stream.get() - 48;
|
|
char n2 = stream.get() - 48;
|
|
if (n1 > 9)
|
|
n1 -= 7;
|
|
if (n1 > 16)
|
|
n1 -= 32;
|
|
if (n2 > 9)
|
|
n2 -= 7;
|
|
if (n2 > 16)
|
|
n2 -= 32;
|
|
out += n1 << 4 | n2;
|
|
}
|
|
escape = false;
|
|
}
|
|
else if (active)
|
|
out += c;
|
|
}
|
|
|
|
return out;
|
|
}
|
|
|
|
std::string locale::label_cab_control(std::string const &Label)
|
|
{
|
|
if( Label.empty() ) { return ""; }
|
|
|
|
static std::unordered_map<std::string, std::string> cabcontrols_labels = {
|
|
{ "mainctrl:", STRN("master controller") },
|
|
{ "jointctrl:", STRN("master controller") },
|
|
{ "scndctrl:", STRN("second controller") },
|
|
{ "shuntmodepower:", STRN("shunt mode power") },
|
|
{ "tempomat_sw:", STRN("cruise control") },
|
|
{ "tempomatoff_sw:", STRN("cruise control") },
|
|
{ "speedinc_bt:", STRN("cruise control (speed)") },
|
|
{ "speeddec_bt:", STRN("cruise control (speed)") },
|
|
{ "speedctrlpowerinc_bt:", STRN("cruise control (power)") },
|
|
{ "speedctrlpowerdec_bt:", STRN("cruise control (power)") },
|
|
{ "speedbutton0:", STRN("cruise control (speed)") },
|
|
{ "speedbutton1:", STRN("cruise control (speed)") },
|
|
{ "speedbutton2:", STRN("cruise control (speed)") },
|
|
{ "speedbutton3:", STRN("cruise control (speed)") },
|
|
{ "speedbutton4:", STRN("cruise control (speed)") },
|
|
{ "speedbutton5:", STRN("cruise control (speed)") },
|
|
{ "speedbutton6:", STRN("cruise control (speed)") },
|
|
{ "speedbutton7:", STRN("cruise control (speed)") },
|
|
{ "speedbutton8:", STRN("cruise control (speed)") },
|
|
{ "speedbutton9:", STRN("cruise control (speed)") },
|
|
{ "distancecounter_sw:", STRN("distance counter") },
|
|
{ "dirkey:", STRN("reverser") },
|
|
{ "dirbackward_bt:", STRN("reverser") },
|
|
{ "dirforward_bt:", STRN("reverser") },
|
|
{ "dirneutral_bt:", STRN("reverser") },
|
|
{ "brakectrl:", STRN("train brake") },
|
|
{ "localbrake:", STRN("independent brake") },
|
|
{ "manualbrake:", STRN("manual brake") },
|
|
{ "alarmchain:", STRN("emergency brake") },
|
|
{ "brakeprofile_sw:", STRN("brake acting speed") },
|
|
{ "brakeprofileg_sw:", STRN("brake acting speed: cargo") },
|
|
{ "brakeprofiler_sw:", STRN("brake acting speed: rapid") },
|
|
{ "brakeopmode_sw", STRN("brake operation mode") },
|
|
{ "maxcurrent_sw:", STRN("motor overload relay threshold") },
|
|
{ "waterpump_sw:", STRN("water pump") },
|
|
{ "waterpumpbreaker_sw:", STRN("water pump breaker") },
|
|
{ "waterheater_sw:", STRN("water heater") },
|
|
{ "waterheaterbreaker_sw:", STRN("water heater breaker") },
|
|
{ "watercircuitslink_sw:", STRN("water circuits link") },
|
|
{ "fuelpump_sw:", STRN("fuel pump") },
|
|
{ "oilpump_sw:", STRN("oil pump") },
|
|
{ "oilfuelpump_sw:", STRN("oil and fuel pumps") },
|
|
{ "tractionmode_sw:", STRN("traction mode selector") },
|
|
{ "genset_sw:", STRN("diesel generator") },
|
|
{ "motorblowersfront_sw:", STRN("motor blowers A") },
|
|
{ "motorblowersrear_sw:", STRN("motor blowers B") },
|
|
{ "motorblowersalloff_sw:", STRN("all motor blowers") },
|
|
{ "coolingfans_sw:", STRN("cooling fans") },
|
|
{ "main_off_bt:", STRN("line breaker") },
|
|
{ "main_on_bt:", STRN("line breaker") },
|
|
{ "mainb_off_bt:", STRN("line breaker B") },
|
|
{ "mainb_on_bt:", STRN("line breaker B") },
|
|
{ "mainc_off_bt:", STRN("line breaker C") },
|
|
{ "mainc_on_bt:", STRN("line breaker C") },
|
|
{ "security_reset_bt:", STRN("alerter") },
|
|
{ "shp_reset_bt:", STRN("shp") },
|
|
{ "releaser_bt:", STRN("independent brake releaser") },
|
|
{ "sand_bt:", STRN("sandbox") },
|
|
{ "antislip_bt:", STRN("wheelspin brake") },
|
|
{ "horn_bt:", STRN("horn") },
|
|
{ "hornlow_bt:", STRN("low tone horn") },
|
|
{ "hornhigh_bt:", STRN("high tone horn") },
|
|
{ "whistle_bt:", STRN("whistle") },
|
|
{ "fuse_bt:", STRN("motor overload relay reset") },
|
|
{ "converterfuse_bt:", STRN("converter overload relay reset") },
|
|
{ "stlinoff_bt:", STRN("motor connectors") },
|
|
{ "doorleftpermit_sw:", STRN("left door (permit)") },
|
|
{ "doorrightpermit_sw:", STRN("right door (permit)") },
|
|
{ "doorpermitpreset_sw:", STRN("door (permit)") },
|
|
{ "door_left_sw:", STRN("left door") },
|
|
{ "door_right_sw:", STRN("right door") },
|
|
{ "doorlefton_sw:", STRN("left door (open)") },
|
|
{ "doorrighton_sw:", STRN("right door (open)") },
|
|
{ "doorleftoff_sw:", STRN("left door (close)") },
|
|
{ "doorrightoff_sw:", STRN("right door (close)") },
|
|
{ "doorallon_sw:", STRN("all doors (open)") },
|
|
{ "dooralloff_sw:", STRN("all doors (close)") },
|
|
{ "doorstep_sw:", STRN("doorstep") },
|
|
{ "doormode_sw", STRN("door control mode") },
|
|
{ "departure_signal_bt:", STRN("departure signal") },
|
|
{ "upperlight_sw:", STRN("upper headlight") },
|
|
{ "leftlight_sw:", STRN("left headlight") },
|
|
{ "rightlight_sw:", STRN("right headlight") },
|
|
{ "dimheadlights_sw:", STRN("headlights dimmer") },
|
|
{ "moderndimmer_sw:", STRN("headlights dimmer") },
|
|
{ "leftend_sw:", STRN("left marker light") },
|
|
{ "rightend_sw:", STRN("right marker light") },
|
|
{ "lights_sw:", STRN("light pattern") },
|
|
{ "rearupperlight_sw:", STRN("rear upper headlight") },
|
|
{ "rearleftlight_sw:", STRN("rear left headlight") },
|
|
{ "rearrightlight_sw:", STRN("rear right headlight") },
|
|
{ "rearleftend_sw:", STRN("rear left marker light") },
|
|
{ "rearrightend_sw:", STRN("rear right marker light") },
|
|
{ "compressor_sw:", STRN("compressor") },
|
|
{ "compressorlocal_sw:", STRN("local compressor") },
|
|
{ "converter_sw:", STRN("converter") },
|
|
{ "converterlocal_sw:", STRN("local converter") },
|
|
{ "converteroff_sw:", STRN("converter") },
|
|
{ "main_sw:", STRN("line breaker") },
|
|
{ "mainb_sw:", STRN("line breaker B") },
|
|
{ "mainc_sw:", STRN("line breaker C") },
|
|
{ "radio_sw:", STRN("radio") },
|
|
{ "radioon_sw:", STRN("radio") },
|
|
{ "radiooff_sw:", STRN("radio") },
|
|
{ "radiofuse_sw:", STRN("radio fuse") },
|
|
{ "radiofuseon_sw:", STRN("radio fuse") },
|
|
{ "radiofuseoff_sw:", STRN("radio fuse") },
|
|
{ "radiochannel_sw:", STRN("radio channel") },
|
|
{ "radiochannelprev_sw:", STRN("radio channel") },
|
|
{ "radiochannelnext_sw:", STRN("radio channel") },
|
|
{ "radiotest_sw:", STRN("radiostop test") },
|
|
{ "radiostop_sw:", STRN("radiostop") },
|
|
{ "radiocall3_sw:", STRN("radio call 3") },
|
|
{ "radiovolume_sw:", STRN("radio volume") },
|
|
{ "radiovolumenext_sw:", STRN("radio volume") },
|
|
{ "radiovolumeprev_sw:", STRN("radio volume") },
|
|
{ "pantfront_sw:", STRN("pantograph A") },
|
|
{ "pantrear_sw:", STRN("pantograph B") },
|
|
{ "pantfrontoff_sw:", STRN("pantograph A") },
|
|
{ "pantrearoff_sw:", STRN("pantograph B") },
|
|
{ "pantalloff_sw:", STRN("all pantographs") },
|
|
{ "pantselected_sw:", STRN("selected pantograph") },
|
|
{ "pantselectedoff_sw:", STRN("selected pantograph") },
|
|
{ "pantselect_sw:", STRN("selected pantograph") },
|
|
{ "pantvalves_sw:", STRN("selected pantograph") },
|
|
{ "pantvalvesoff_bt:", STRN("all pantographs down") },
|
|
{ "pantvalvesupdate_bt:", STRN("selected pantographs up") },
|
|
{ "pantcompressor_sw:", STRN("pantograph compressor") },
|
|
{ "pantcompressorvalve_sw:", STRN("pantograph 3 way valve") },
|
|
{ "trainheating_sw:", STRN("heating") },
|
|
{ "signalling_sw:", STRN("braking indicator") },
|
|
{ "door_signalling_sw:", STRN("door locking") },
|
|
{ "nextcurrent_sw:", STRN("current indicator source") },
|
|
{ "instrumentlight_sw:", STRN("instrument light") },
|
|
{ "dashboardlight_sw:", STRN("dashboard light") },
|
|
{ "timetablelight_sw:", STRN("timetable light") },
|
|
{ "cablight_sw:", STRN("interior light") },
|
|
{ "cablightdim_sw:", STRN("interior light dimmer") },
|
|
{ "compartmentlights_sw:", STRN("compartment lights") },
|
|
{ "compartmentlightsoff_sw:", STRN("compartment lights") },
|
|
{ "compartmentlightson_sw:", STRN("compartment lights") },
|
|
{ "couplingdisconnect_sw:", STRN("coupling") },
|
|
{ "battery_sw:", STRN("battery") },
|
|
{ "batteryon_sw:", STRN("battery") },
|
|
{ "batteryoff_sw:", STRN("battery") },
|
|
{ "epbrake_bt:", STRN("ep brake") },
|
|
{ "relayreset1_bt:", STRN("relay reset") },
|
|
{ "relayreset2_bt:", STRN("relay reset") },
|
|
{ "relayreset3_bt:", STRN("relay reset") },
|
|
{ "springbrakeoff_bt:", STRN("spring brake") },
|
|
{ "springbrakeon_bt:", STRN("spring brake") },
|
|
{ "springbraketoggle_bt:", STRN("spring brake") },
|
|
{ "universalbrake1_bt:", STRN("train brake") },
|
|
{ "universalbrake2_bt:", STRN("train brake") },
|
|
{ "universalbrake3_bt:", STRN("train brake") },
|
|
{"universal0:", STRN("interactive part")},
|
|
{"universal1:", STRN("interactive part")},
|
|
{"universal2:", STRN("interactive part")},
|
|
{"universal3:", STRN("interactive part")},
|
|
{"universal4:", STRN("interactive part")},
|
|
{"universal5:", STRN("interactive part")},
|
|
{"universal6:", STRN("interactive part")},
|
|
{"universal7:", STRN("interactive part")},
|
|
{"universal8:", STRN("interactive part")},
|
|
{"universal9:", STRN("interactive part")},
|
|
{"universal10:", STRN("interactive part")},
|
|
{"universal11:", STRN("interactive part")},
|
|
{"universal12:", STRN("interactive part")},
|
|
{"universal13:", STRN("interactive part")},
|
|
{"universal14:", STRN("interactive part")},
|
|
{"universal15:", STRN("interactive part")},
|
|
{"universal16:", STRN("interactive part")},
|
|
{"universal17:", STRN("interactive part")},
|
|
{"universal18:", STRN("interactive part")},
|
|
{"universal19:", STRN("interactive part")},
|
|
{"universal20:", STRN("interactive part")},
|
|
{"universal21:", STRN("interactive part")},
|
|
{"universal22:", STRN("interactive part")},
|
|
{"universal23:", STRN("interactive part")},
|
|
{"universal24:", STRN("interactive part")},
|
|
{"universal25:", STRN("interactive part")},
|
|
{"universal26:", STRN("interactive part")},
|
|
{"universal27:", STRN("interactive part")},
|
|
{"universal28:", STRN("interactive part")},
|
|
{"universal29:", STRN("interactive part")},
|
|
{ "wipers_sw:", STRN("wipers mode selector") },
|
|
};
|
|
|
|
auto const it = cabcontrols_labels.find( Label );
|
|
return it != cabcontrols_labels.end() ? lookup_s(it->second) : "";
|
|
}
|
|
|
|
const std::string& locale::coupling_name(int c)
|
|
{
|
|
static std::unordered_map<coupling, std::string> coupling_names =
|
|
{
|
|
{ coupling::faux, STRN("faux") },
|
|
{ coupling::coupler, STRN("coupler") },
|
|
{ coupling::brakehose, STRN("brake hose") },
|
|
{ coupling::control, STRN("control") },
|
|
{ coupling::highvoltage, STRN("high voltage") },
|
|
{ coupling::gangway, STRN("gangway") },
|
|
{ coupling::mainhose, STRN("main hose") },
|
|
{ coupling::heating, STRN("heating") },
|
|
{ coupling::permanent, STRN("permanent") },
|
|
{ coupling::power24v, STRN("power 24V") },
|
|
{ coupling::power110v, STRN("power 110V") },
|
|
{ coupling::power3x400v, STRN("power 3x400V") },
|
|
};
|
|
|
|
static std::string unknown(STRN("unknown"));
|
|
|
|
auto it = coupling_names.find(static_cast<coupling>(c));
|
|
if (it != coupling_names.end())
|
|
return lookup_s(it->second);
|
|
else
|
|
return lookup_s(unknown);
|
|
}
|
|
|
|
locale Translations;
|