mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-27 02:19:48 +01:00
feat(editor): the signalling mode numbers a station track as a whole through the switches along it, keeps the numbers the tracks have when set again, renumbers the selected track and labels the schematic without one label over another
This commit is contained in:
@@ -29,6 +29,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <array>
|
||||
#include <cctype>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <functional>
|
||||
#include <unordered_set>
|
||||
@@ -81,6 +82,18 @@ std::string unit_number(station::unit const &Unit, std::string const &Stem, std:
|
||||
return std::to_string(Index + 1);
|
||||
}
|
||||
|
||||
// the number of the station track a circuit is named after: bpd_it5b of track 5; empty for the other names
|
||||
std::string track_of(std::string const &Name, std::string const &Stem)
|
||||
{
|
||||
auto const head{Stem + "it"};
|
||||
if (Stem.empty() || Name.size() <= head.size() || Name.compare(0, head.size(), head) != 0)
|
||||
return {};
|
||||
auto number{Name.substr(head.size())};
|
||||
if (number.size() > 1 && std::isalpha(static_cast<unsigned char>(number.back())) && std::isdigit(static_cast<unsigned char>(number[number.size() - 2])))
|
||||
number.pop_back();
|
||||
return number;
|
||||
}
|
||||
|
||||
ImU32 circuit_colour(std::string const &Name)
|
||||
{
|
||||
static std::array<ImU32, 6> const palette{IM_COL32(110, 200, 250, 255), IM_COL32(250, 150, 90, 255), IM_COL32(150, 220, 120, 255), IM_COL32(230, 120, 200, 255), IM_COL32(240, 220, 100, 255), IM_COL32(150, 140, 250, 255)};
|
||||
@@ -410,7 +423,19 @@ void srk_tool::render_options()
|
||||
item_tooltip("Cuts the tracks of the station at the joints of the track circuits and names the circuits, as on the lines of PKP PLK: "
|
||||
"a joint 1.5 m before the start of a switch, beyond the fouling point of each branch where the axes are 4 m apart, in the middle "
|
||||
"of a link too short for both. Each switch gets bpd_iz<number>, each station track bpd_it<number>: 1 and 2 the main tracks, "
|
||||
"track 1 on the right along the km, the odd ones beyond it, the even ones on the other side. One step of undo");
|
||||
"track 1 on the right along the km, the odd ones beyond it, the even ones on the other side. Run again after changes, it keeps "
|
||||
"the numbers the tracks have. One step of undo");
|
||||
if (auto const *selected{m_selection.selected_track()}; selected != nullptr && false == selected->Isolated.empty())
|
||||
if (auto const number{track_of(selected->Isolated.front()->asName, stem_of_open())}; false == number.empty() && begin_fields("##srktrack"))
|
||||
{
|
||||
field_row("Track number");
|
||||
std::array<char, 16> buffer{};
|
||||
number.copy(buffer.data(), buffer.size() - 1);
|
||||
if (ImGui::InputText("##srktracknumber", buffer.data(), buffer.size(), ImGuiInputTextFlags_EnterReturnsTrue) || ImGui::IsItemDeactivatedAfterEdit())
|
||||
renumber_track(*selected, buffer.data());
|
||||
item_tooltip("The number of the selected station track: type another one and its track circuits are renamed, bpd_it7a, bpd_it7b. One step of undo");
|
||||
ImGui::EndTable();
|
||||
}
|
||||
if (false == m_status.empty())
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.75f, 0.3f, 1.0f), "%s", m_status.c_str());
|
||||
ImGui::Spacing();
|
||||
@@ -587,10 +612,48 @@ void srk_tool::set_circuits()
|
||||
std::unordered_set<TTrack const *> captured(created.begin(), created.end());
|
||||
for (auto const &[track, state] : before)
|
||||
captured.insert(track);
|
||||
// a station track keeps the name most of it has, given by hand or so far, unless another one has it too; the others take
|
||||
// the numbers left on their side
|
||||
std::vector<std::string> names(circuits.size());
|
||||
std::map<std::string, std::size_t> held;
|
||||
for (std::size_t index = 0; index < circuits.size(); ++index)
|
||||
{
|
||||
auto const &circuit{circuits[index]};
|
||||
auto const name{circuit.unit >= 0 ? stem + "iz" + unit_number(units[circuit.unit], stem, circuit.unit) : stem + "it" + numbers[index]};
|
||||
if (circuit.unit >= 0)
|
||||
continue;
|
||||
std::map<std::string, std::size_t> counts;
|
||||
for (auto const *track : circuit.tracks)
|
||||
if (track->Isolated.size() == 1 && false == track_of(track->Isolated.front()->asName, stem).empty())
|
||||
++counts[track->Isolated.front()->asName];
|
||||
if (auto const most{std::max_element(counts.begin(), counts.end(), [](auto const &A, auto const &B) { return A.second < B.second; })}; most != counts.end())
|
||||
++held[names[index] = most->first];
|
||||
}
|
||||
std::unordered_set<std::string> taken;
|
||||
for (auto &name : names)
|
||||
if (false == name.empty() && held[name] > 1)
|
||||
name.clear();
|
||||
else if (false == name.empty())
|
||||
taken.insert(name);
|
||||
for (std::size_t index = 0; index < circuits.size(); ++index)
|
||||
{
|
||||
auto const &circuit{circuits[index]};
|
||||
auto &name{names[index]};
|
||||
if (circuit.unit >= 0)
|
||||
name = stem + "iz" + unit_number(units[circuit.unit], stem, circuit.unit);
|
||||
else if (name.empty())
|
||||
{
|
||||
auto number{numbers[index]};
|
||||
while (taken.count(stem + "it" + number) > 0)
|
||||
{
|
||||
std::size_t digits{0};
|
||||
while (digits < number.size() && std::isdigit(static_cast<unsigned char>(number[digits])))
|
||||
++digits;
|
||||
if (digits == 0)
|
||||
break;
|
||||
number = std::to_string(std::stoi(number.substr(0, digits)) + 2) + number.substr(digits);
|
||||
}
|
||||
taken.insert(name = stem + "it" + number);
|
||||
}
|
||||
for (auto *track : circuit.tracks)
|
||||
{
|
||||
if (track->Isolated.size() == 1 && track->Isolated.front()->asName == name)
|
||||
@@ -611,6 +674,48 @@ void srk_tool::set_circuits()
|
||||
m_status = format(STR_P("%zu track circuit", "%zu track circuits", count), count) + ", " + format(STR_P("%zu cut", "%zu cuts", created.size()), created.size());
|
||||
}
|
||||
|
||||
std::string srk_tool::stem_of_open() const
|
||||
{
|
||||
return m_record >= 0 && false == m_records[m_record].code.empty() ? station::prefix(m_records[m_record].code) : std::string{};
|
||||
}
|
||||
|
||||
void srk_tool::renumber_track(TTrack const &Track, std::string const &Number)
|
||||
{
|
||||
m_status.clear();
|
||||
auto const stem{stem_of_open()};
|
||||
auto const from{Track.Isolated.empty() ? std::string{} : track_of(Track.Isolated.front()->asName, stem)};
|
||||
std::string to;
|
||||
for (auto const letter : Number)
|
||||
if (std::isalnum(static_cast<unsigned char>(letter)))
|
||||
to += static_cast<char>(std::tolower(static_cast<unsigned char>(letter)));
|
||||
if (from.empty() || to.empty() || to == from)
|
||||
return;
|
||||
std::vector<std::pair<TTrack *, editor_track::state>> before;
|
||||
std::unordered_set<TTrack const *> seen;
|
||||
for (auto const &path : m_layout->paths)
|
||||
{
|
||||
if (path.track->Isolated.empty() || false == seen.insert(path.track).second)
|
||||
continue;
|
||||
auto const number{track_of(path.track->Isolated.front()->asName, stem)};
|
||||
if (number == to)
|
||||
{
|
||||
m_status = format(STR_C("The station has a track %s already"), to.c_str());
|
||||
return;
|
||||
}
|
||||
if (number == from)
|
||||
before.emplace_back(path.track, editor_track::capture(*path.track));
|
||||
}
|
||||
for (auto &[track, state] : before)
|
||||
{
|
||||
auto const &name{track->Isolated.front()->asName};
|
||||
editor_track::isolated(*track, {stem + "it" + to + name.substr(stem.size() + 2 + from.size())});
|
||||
}
|
||||
if (before.empty())
|
||||
return;
|
||||
m_history.push_track_snapshot(std::move(before));
|
||||
m_status = format(STR_C("Track %s is track %s now"), from.c_str(), to.c_str());
|
||||
}
|
||||
|
||||
void srk_tool::survey()
|
||||
{
|
||||
m_circuit_of.assign(m_layout.has_value() ? m_layout->paths.size() : 0, -1);
|
||||
@@ -619,7 +724,7 @@ void srk_tool::survey()
|
||||
if (false == m_layout.has_value())
|
||||
return;
|
||||
auto const &layout{*m_layout};
|
||||
auto const stem{m_record >= 0 && false == m_records[m_record].code.empty() ? station::prefix(m_records[m_record].code) : std::string{}};
|
||||
auto const stem{stem_of_open()};
|
||||
std::vector<double> weights;
|
||||
for (std::size_t index = 0; index < layout.paths.size(); ++index)
|
||||
{
|
||||
@@ -634,6 +739,7 @@ void srk_tool::survey()
|
||||
if (found == m_circuits.end())
|
||||
{
|
||||
found = m_circuits.insert(m_circuits.end(), {glm::dvec2{0.0}, name, circuit_colour(name)});
|
||||
found->labelled = stem.empty() || name.compare(0, stem.size() + 2, stem + "iz") != 0;
|
||||
weights.push_back(0.0);
|
||||
}
|
||||
auto const circuit{static_cast<std::size_t>(found - m_circuits.begin())};
|
||||
@@ -643,11 +749,24 @@ void srk_tool::survey()
|
||||
found->at += point;
|
||||
weights[circuit] += 1.0;
|
||||
}
|
||||
found->length += path.length;
|
||||
}
|
||||
for (std::size_t index = 0; index < m_circuits.size(); ++index)
|
||||
{
|
||||
auto &mark{m_circuits[index]};
|
||||
mark.at /= std::max(1.0, weights[index]);
|
||||
// on its track, nearest the middle of its points
|
||||
auto nearest{std::numeric_limits<double>::max()};
|
||||
glm::dvec2 on{mark.at};
|
||||
for (std::size_t path = 0; path < layout.paths.size(); ++path)
|
||||
if (m_circuit_of[path] == static_cast<int>(index))
|
||||
for (auto const &point : layout.paths[path].schematic)
|
||||
if (auto const distance{glm::distance(point, mark.at)}; distance < nearest)
|
||||
{
|
||||
nearest = distance;
|
||||
on = point;
|
||||
}
|
||||
mark.at = on;
|
||||
// bpd_it3 shown as It3
|
||||
if (false == stem.empty() && mark.text.compare(0, stem.size(), stem) == 0)
|
||||
mark.text.erase(0, stem.size());
|
||||
@@ -806,8 +925,24 @@ void srk_tool::render_canvas(float const Height)
|
||||
draw_path(path, overlay_color::selected, 4.0f);
|
||||
if (m_hover >= 0)
|
||||
draw_path(layout.paths[m_hover], kHovered, 4.0f);
|
||||
// the switches: a dot at the start, the name over or under it in turn; the number alone, once named after the station
|
||||
auto const stem{m_record >= 0 && false == m_records[m_record].code.empty() ? station::prefix(m_records[m_record].code) : std::string{}};
|
||||
// the labels, none over another: the switches first, a dot at the start and the name over or under it in turn, the number
|
||||
// alone once named after the station; then the station tracks under or over them, the longest first
|
||||
std::vector<ImVec4> placed;
|
||||
auto const label = [&](std::string const &Text, ImU32 const Colour, std::initializer_list<ImVec2> Places) {
|
||||
auto const extent{ImGui::CalcTextSize(Text.c_str())};
|
||||
for (auto const &place : Places)
|
||||
{
|
||||
ImVec4 const box{place.x - extent.x * 0.5f - 2.0f, place.y - 1.0f, place.x + extent.x * 0.5f + 2.0f, place.y + extent.y + 1.0f};
|
||||
if (std::any_of(placed.begin(), placed.end(), [&](ImVec4 const &Other) { return box.x < Other.z && Other.x < box.z && box.y < Other.w && Other.y < box.w; }))
|
||||
continue;
|
||||
placed.push_back(box);
|
||||
draw->AddRectFilled(ImVec2(box.x, box.y), ImVec2(box.z, box.w), IM_COL32(22, 24, 28, 200), 2.0f);
|
||||
draw->AddText(ImVec2(place.x - extent.x * 0.5f, place.y), Colour, Text.c_str());
|
||||
return;
|
||||
}
|
||||
};
|
||||
auto const stem{stem_of_open()};
|
||||
auto const height{ImGui::GetTextLineHeight()};
|
||||
for (std::size_t index = 0; index < layout.switches.size(); ++index)
|
||||
{
|
||||
auto const *track{layout.switches[index]};
|
||||
@@ -816,16 +951,23 @@ void srk_tool::render_canvas(float const Height)
|
||||
auto text{track->name()};
|
||||
if (false == stem.empty() && text.size() > stem.size() && text.compare(0, stem.size(), stem) == 0)
|
||||
text.erase(0, stem.size());
|
||||
auto const extent{ImGui::CalcTextSize(text.c_str())};
|
||||
ImVec2 const place{at.x - extent.x * 0.5f, index % 2 == 0 ? at.y - extent.y - 6.0f : at.y + 6.0f};
|
||||
draw->AddRectFilled(ImVec2(place.x - 2.0f, place.y - 1.0f), ImVec2(place.x + extent.x + 2.0f, place.y + extent.y + 1.0f), IM_COL32(22, 24, 28, 200), 2.0f);
|
||||
draw->AddText(place, kSwitch, text.c_str());
|
||||
ImVec2 const over{at.x, at.y - height - 6.0f};
|
||||
ImVec2 const under{at.x, at.y + 6.0f};
|
||||
if (index % 2 == 0)
|
||||
label(text, kSwitch, {over, under});
|
||||
else
|
||||
label(text, kSwitch, {under, over});
|
||||
}
|
||||
for (auto const &mark : m_circuits)
|
||||
std::vector<std::size_t> order;
|
||||
for (std::size_t index = 0; index < m_circuits.size(); ++index)
|
||||
if (m_circuits[index].labelled)
|
||||
order.push_back(index);
|
||||
std::sort(order.begin(), order.end(), [&](std::size_t A, std::size_t B) { return m_circuits[A].length > m_circuits[B].length; });
|
||||
for (auto const index : order)
|
||||
{
|
||||
auto const &mark{m_circuits[index]};
|
||||
auto const at{screen_of(mark.at)};
|
||||
auto const extent{ImGui::CalcTextSize(mark.text.c_str())};
|
||||
draw->AddText(ImVec2(at.x - extent.x * 0.5f, at.y + 4.0f), mark.colour, mark.text.c_str());
|
||||
label(mark.text, mark.colour, {ImVec2(at.x, at.y + 4.0f), ImVec2(at.x, at.y - height - 4.0f)});
|
||||
}
|
||||
draw->PopClipRect();
|
||||
if (hovered && m_hover >= 0 && false == m_dragging)
|
||||
@@ -964,6 +1106,26 @@ editor_selftest_result srk_tool::selftest(std::string const &Command, std::istri
|
||||
WriteLog(format("SELFTEST srkcircuits %zu named, %zu joints:", found.size(), m_ticks.size()) + list);
|
||||
return editor_selftest_result::handled;
|
||||
}
|
||||
if (Command == "srktrack")
|
||||
{
|
||||
// srktrack circuit=<name> number=<number>: the station track of the circuit renumbered
|
||||
auto const values{selftest_values(Words)};
|
||||
auto const circuit{values.find("circuit")};
|
||||
auto const number{values.find("number")};
|
||||
TTrack const *found{nullptr};
|
||||
if (m_layout.has_value() && circuit != values.end())
|
||||
for (auto const &path : m_layout->paths)
|
||||
if (false == path.track->Isolated.empty() && path.track->Isolated.front()->asName == circuit->second)
|
||||
found = path.track;
|
||||
if (found == nullptr || number == values.end())
|
||||
{
|
||||
WriteLog("SELFTEST srktrack: no station open, or no such circuit");
|
||||
return editor_selftest_result::handled;
|
||||
}
|
||||
renumber_track(*found, number->second);
|
||||
WriteLog("SELFTEST srktrack: " + m_status);
|
||||
return editor_selftest_result::handled;
|
||||
}
|
||||
if (Command == "srkstations")
|
||||
{
|
||||
load();
|
||||
|
||||
@@ -76,6 +76,8 @@ class srk_tool final : public editor_tool
|
||||
glm::dvec2 at{0.0}; // in the schematic
|
||||
std::string text;
|
||||
ImU32 colour{0};
|
||||
double length{0.0};
|
||||
bool labelled{true}; // the circuits of the switches go without, named after them
|
||||
};
|
||||
std::vector<int> m_circuit_of; // of each path of the layout, an index into m_circuits, -1 for none
|
||||
std::vector<circuit_mark> m_circuits;
|
||||
@@ -97,4 +99,8 @@ class srk_tool final : public editor_tool
|
||||
void set_circuits();
|
||||
// the track circuits as the tracks have them, for the schematic
|
||||
void survey();
|
||||
// the names of the switches and the circuits of the open station begin with it, empty while it has no code
|
||||
std::string stem_of_open() const;
|
||||
// the circuits of the station track of the track renamed after another number; one step of the history
|
||||
void renumber_track(TTrack const &Track, std::string const &Number);
|
||||
};
|
||||
|
||||
@@ -20,6 +20,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <cctype>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <numeric>
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
@@ -233,6 +235,7 @@ double constexpr kClear{4.0}; // m, between the axes at a joint beyond a fouling
|
||||
double constexpr kReach{120.0}; // m, along a branch looked for its fouling point
|
||||
double constexpr kSection{30.0}; // m, the shortest stretch between two joints made a track circuit of its own
|
||||
double constexpr kSnap{0.3}; // m, a joint this close to the end of a track lies at the end
|
||||
double constexpr kThrough{400.0}; // m, of the switches a station track is followed through for its circuits beyond
|
||||
|
||||
// the points of the way out of an end of the track, as a train runs: along the main path of a switch run into from its start,
|
||||
// back along the path of one run into from the end of it
|
||||
@@ -854,9 +857,12 @@ std::vector<std::string> track_numbers(layout const &Layout, std::vector<circuit
|
||||
auto const on = [&](circuit const &Circuit, std::unordered_set<TTrack const *> const &Tracks) { return std::any_of(Circuit.tracks.begin(), Circuit.tracks.end(), [&](TTrack const *Track) { return Tracks.count(Track) > 0; }); };
|
||||
std::vector<std::size_t> axis;
|
||||
std::vector<std::size_t> other;
|
||||
std::vector<std::size_t> right;
|
||||
std::vector<std::size_t> left;
|
||||
std::vector<std::size_t> rest;
|
||||
std::unordered_map<TTrack const *, std::size_t> circuit_of;
|
||||
for (std::size_t index = 0; index < Circuits.size(); ++index)
|
||||
{
|
||||
for (auto const *track : Circuits[index].tracks)
|
||||
circuit_of[track] = index;
|
||||
if (Circuits[index].unit >= 0)
|
||||
continue;
|
||||
else if (on(Circuits[index], main))
|
||||
@@ -864,7 +870,72 @@ std::vector<std::string> track_numbers(layout const &Layout, std::vector<circuit
|
||||
else if (on(Circuits[index], second))
|
||||
other.push_back(index);
|
||||
else
|
||||
(Circuits[index].offset < 0.0 ? right : left).push_back(index);
|
||||
rest.push_back(index);
|
||||
}
|
||||
// a station track goes on through the switches along their straighter paths: its circuits beyond them share its number
|
||||
std::vector<std::size_t> group(Circuits.size());
|
||||
std::iota(group.begin(), group.end(), 0);
|
||||
auto const root = [&](std::size_t Index) {
|
||||
while (group[Index] != Index)
|
||||
Index = group[Index] = group[group[Index]];
|
||||
return Index;
|
||||
};
|
||||
std::unordered_set<std::size_t> const plain(rest.begin(), rest.end());
|
||||
for (auto const index : rest)
|
||||
for (auto const *track : Circuits[index].tracks)
|
||||
for (auto const atend : {false, true})
|
||||
{
|
||||
if (node(*track))
|
||||
break;
|
||||
auto point{end_of(*track, 0, atend)};
|
||||
auto *next{neighbour(*track, 0, atend)};
|
||||
double length{0.0};
|
||||
while (next != nullptr && length < kThrough && rail(*next))
|
||||
{
|
||||
auto const there{circuit_of.find(next)};
|
||||
if (there == circuit_of.end() || there->second == index)
|
||||
break;
|
||||
if (Circuits[there->second].unit < 0)
|
||||
{
|
||||
if (plain.count(there->second) > 0)
|
||||
group[root(there->second)] = root(index);
|
||||
break;
|
||||
}
|
||||
int path{0};
|
||||
bool end{false};
|
||||
if (false == end_at(*next, point, path, end))
|
||||
break;
|
||||
if (next->eType == tt_Switch)
|
||||
{
|
||||
if (end && path != straighter(*next))
|
||||
break;
|
||||
path = straighter(*next);
|
||||
}
|
||||
length += plan_length(*next, path);
|
||||
point = end_of(*next, path, false == end);
|
||||
auto const *through{next};
|
||||
next = neighbour(*through, path, false == end);
|
||||
}
|
||||
}
|
||||
std::vector<std::pair<std::vector<std::size_t>, double>> right;
|
||||
std::vector<std::pair<std::vector<std::size_t>, double>> left;
|
||||
{
|
||||
std::map<std::size_t, std::vector<std::size_t>> groups;
|
||||
for (auto const index : rest)
|
||||
groups[root(index)].push_back(index);
|
||||
for (auto &[first, members] : groups)
|
||||
{
|
||||
double weighted{0.0};
|
||||
double length{0.0};
|
||||
for (auto const index : members)
|
||||
{
|
||||
weighted += Circuits[index].offset * Circuits[index].length;
|
||||
length += Circuits[index].length;
|
||||
}
|
||||
auto const offset{length > 0.0 ? weighted / length : Circuits[first].offset};
|
||||
(offset < 0.0 ? right : left).emplace_back(std::move(members), offset);
|
||||
}
|
||||
}
|
||||
auto const mean = [&](std::vector<std::size_t> const &Group) {
|
||||
double weighted{0.0};
|
||||
double length{0.0};
|
||||
@@ -880,20 +951,15 @@ std::vector<std::string> track_numbers(layout const &Layout, std::vector<circuit
|
||||
std::vector<std::pair<std::vector<std::size_t>, int>> tracks{{axis, swapped ? 2 : 1}};
|
||||
if (false == other.empty())
|
||||
tracks.emplace_back(other, swapped ? 1 : 2);
|
||||
// beyond the main tracks the circuits side by side, the nearest first, the odd numbers to the right, the even ones to the left
|
||||
// beyond the main tracks the others side by side, the nearest first, the odd numbers to the right, the even ones to the left
|
||||
for (auto *side : {&right, &left})
|
||||
{
|
||||
std::sort(side->begin(), side->end(), [&](std::size_t A, std::size_t B) { return std::abs(Circuits[A].offset) < std::abs(Circuits[B].offset); });
|
||||
std::sort(side->begin(), side->end(), [&](auto const &A, auto const &B) { return std::abs(A.second) < std::abs(B.second); });
|
||||
auto number{side == &right ? 3 : other.empty() ? 2 : 4};
|
||||
for (std::size_t index = 0; index < side->size(); ++index)
|
||||
for (auto &[members, offset] : *side)
|
||||
{
|
||||
if (index == 0 || std::abs(Circuits[(*side)[index]].offset) - std::abs(Circuits[(*side)[index - 1]].offset) > 2.0)
|
||||
{
|
||||
if (index > 0)
|
||||
number += 2;
|
||||
tracks.emplace_back(std::vector<std::size_t>{}, number);
|
||||
}
|
||||
tracks.back().first.push_back((*side)[index]);
|
||||
tracks.emplace_back(std::move(members), number);
|
||||
number += 2;
|
||||
}
|
||||
}
|
||||
std::vector<std::string> result(Circuits.size());
|
||||
|
||||
@@ -101,8 +101,8 @@ std::vector<joint> joints(layout const &Layout, std::vector<unit> const &Units,
|
||||
// the track circuits the joints part the station into; the tracks of the lines beyond the joints belong to none
|
||||
std::vector<circuit> circuits(layout const &Layout, std::vector<unit> const &Units, std::vector<glm::dvec3> const &Joints);
|
||||
// the numbers of the station tracks as PKP PLK gives them, one for each circuit, empty for those of switches: 1 and 2 the main
|
||||
// tracks, track 1 on the right along the chainage, the odd ones beyond it on its side, the even ones on the other; a track of
|
||||
// several circuits has them lettered along the chainage: 5a, 5b
|
||||
// tracks, track 1 on the right along the chainage, the odd ones beyond it on its side, the even ones on the other; a track goes
|
||||
// on through the switches along their straighter paths, its circuits lettered along the chainage: 5a, 5b
|
||||
std::vector<std::string> track_numbers(layout const &Layout, std::vector<circuit> const &Circuits);
|
||||
// the switches of the station of the switch, without laying it out
|
||||
std::vector<TTrack *> switches_of(TTrack &Switch, options const &Options = {});
|
||||
|
||||
@@ -10413,8 +10413,8 @@ msgstr[2] "Ponumerowano %zu rozjazdów"
|
||||
msgid "Set the track circuits"
|
||||
msgstr "Ustaw izolacje"
|
||||
|
||||
msgid "Cuts the tracks of the station at the joints of the track circuits and names the circuits, as on the lines of PKP PLK: a joint 1.5 m before the start of a switch, beyond the fouling point of each branch where the axes are 4 m apart, in the middle of a link too short for both. Each switch gets bpd_iz<number>, each station track bpd_it<number>: 1 and 2 the main tracks, track 1 on the right along the km, the odd ones beyond it, the even ones on the other side. One step of undo"
|
||||
msgstr "Tnie tory stacji na stykach izolowanych i nazywa odcinki jak na liniach PKP PLK: styk 1,5 m przed początkiem rozjazdu, za ukresem każdej gałęzi tam, gdzie osie są 4 m od siebie, w połowie łącznika za krótkiego na oba. Każdy rozjazd dostaje bpd_iz<numer>, każdy tor stacyjny bpd_it<numer>: 1 i 2 to tory główne, tor 1 po prawej w stronę rosnącego km, nieparzyste za nim, parzyste po drugiej stronie. Jeden krok cofania"
|
||||
msgid "Cuts the tracks of the station at the joints of the track circuits and names the circuits, as on the lines of PKP PLK: a joint 1.5 m before the start of a switch, beyond the fouling point of each branch where the axes are 4 m apart, in the middle of a link too short for both. Each switch gets bpd_iz<number>, each station track bpd_it<number>: 1 and 2 the main tracks, track 1 on the right along the km, the odd ones beyond it, the even ones on the other side. Run again after changes, it keeps the numbers the tracks have. One step of undo"
|
||||
msgstr "Tnie tory stacji na stykach izolowanych i nazywa odcinki jak na liniach PKP PLK: styk 1,5 m przed początkiem rozjazdu, za ukresem każdej gałęzi tam, gdzie osie są 4 m od siebie, w połowie łącznika za krótkiego na oba. Każdy rozjazd dostaje bpd_iz<numer>, każdy tor stacyjny bpd_it<numer>: 1 i 2 to tory główne, tor 1 po prawej w stronę rosnącego km, nieparzyste za nim, parzyste po drugiej stronie. Kliknięte ponownie po zmianach zostawia numery, które tory już mają. Jeden krok cofania"
|
||||
|
||||
msgid "Give the station its code first: the track circuits are named after it"
|
||||
msgstr "Najpierw wpisz skrót stacji: od niego biorą się nazwy odcinków izolowanych"
|
||||
@@ -10443,3 +10443,15 @@ msgstr[2] "%zu cięć"
|
||||
msgid "track circuit %s"
|
||||
msgstr "odcinek izolowany %s"
|
||||
|
||||
msgid "Track number"
|
||||
msgstr "Numer toru"
|
||||
|
||||
msgid "The number of the selected station track: type another one and its track circuits are renamed, bpd_it7a, bpd_it7b. One step of undo"
|
||||
msgstr "Numer zaznaczonego toru stacyjnego: wpisz inny, a jego odcinki izolowane dostaną nowe nazwy, bpd_it7a, bpd_it7b. Jeden krok cofania"
|
||||
|
||||
msgid "The station has a track %s already"
|
||||
msgstr "Stacja ma już tor %s"
|
||||
|
||||
msgid "Track %s is track %s now"
|
||||
msgstr "Tor %s ma teraz numer %s"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user