mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 17:37:09 +01:00
38f90387c4
The second half of E1: what the tracks of a scenery are against a profile of the norms, listed. Nothing of the tracks is changed. - editor/editorNormsReport: a line of paths sampled a metre apart, two samples at each joint, into what the norms read a line from: the plan, the curvature signed by the turn, the cant on the base of 1500 mm (as the simulator takes the rolls) signed by the side it leans to as the line runs, the grade, the speed of each path (a switch's for its diverging track alone too), and what the path is a part of (a switch, its diverging track, a curved switch, a movable frog, a crossing). The line described, checked, and each finding set back on its path with a point of it; its message, "cant ramp 3.00 mm/m, PLK allows at most 2.50 mm/m (tab. 9.12)", "break of the grade with no vertical curve, PLK asks for a radius of at least 2500 m (tab. 10.2)", through STR_C; the text of the report: the class, the elements, the cant, the grade line and the findings of each line. - The Norms tab of the track window, under More beside Speed and Joints, no key; its window is ###trackanalysis, as theirs. The line through the selected path (run_route, as the speed check walks it) or the whole scenery: the lines through the plain tracks, then each path of a switch none of them ran along, checked with the line it lies in and its own findings kept, a place two lines run through listed once. The profile (PLK by default) and the class of the line folded under a line saying it: the line speed for the tracks with none of their own (on by default: the speed of each track), the slow trains (tab. 8.1 by default), the traffic, main track or siding, the load, at a platform. The results in the table of the speed check and the joints, the worst first, coloured by the tier, the values above the recommended ones on a tick; a click on a row shows the place, the hard limits and the warnings are marked in the view. The icon is drawn into its own cell of editor_icons.png only (the generator has it): the sheet drawn again with this Pillow differs in other cells. - Self-test: normsreport <file> [scope] [plk|tsi|en|ch] [km/h] writes the report to the file; expect findings <tier> <least> <most>; the case e1_norms_report checks the curves k0..k3 of the fixture at 60 km/h against PLK and the whole scenery against the TSI. - Golden: data/norms/line.scn, a line of 14 tracks written by make_line.py there (curves with and without transitions, cant on and off a curve and along a straight, reverse curves 10 m apart, short straights, a grade with breaks), and its report against the four profiles in data/norms/line_report.txt; EU07_UNIT_TESTS_UPDATE_GOLDEN=1 writes it anew. A test lays a canted corner with the alignment of the editor and finds the samples leaning into it, both turns and run both ways, I = Deq - D. alignment::limits stays as the laying tools use it. Where its values differ from PLK P0: - unbalanced 0.6 m/s2 is I 92 mm on the 1500 mm base; P0 110 mm (P1 130) on the running lines, 80 on the sidings; - ramp_factor 10, a ramp of 1:(10 V), 1 mm/m at 100 km/h and 2.5 mm/m at 40 km/h, has no counterpart: P0 1.6 mm/m at any speed; - jerk 0.3 m/s3 is dI/dt 46 mm/s; P0 55 mm/s; - vertical_factor 0.4 V^2 and vertical_min 2000 m; P0 max(0.77 V^2, 5000 m) (P1 max(0.35 V^2, 5000), P2 max(0.25 V^2, 2000)); - arc_min 20 m and arc_min_factor 0.4 V; P0 max(0.35 V, 30 m) up to 120 km/h, 0.40 V up to 200 km/h, also for the straights, where tangent_min_time is 0; - the same: cant_max 150 mm (P0 = P1 = P2 on ballast), cant_rate 35 mm/s (P0 of tab. 9.13), the base of 1500 mm.
85 lines
3.0 KiB
C++
85 lines
3.0 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/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "editor/norms/norms.hpp"
|
|
|
|
#include <glm/glm.hpp>
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
class TTrack;
|
|
|
|
// the norms checked on the tracks laid, read only: a line of paths sampled into what the norms describe a line from, the findings set
|
|
// back on the paths, their messages and the report written (editor-tracks-domain.md §6, stage E1). Nothing of the tracks is changed
|
|
namespace norms_report
|
|
{
|
|
|
|
// a path of a track the line runs along, from its start or from its end
|
|
struct span
|
|
{
|
|
TTrack *track{nullptr};
|
|
int path{0};
|
|
bool forward{true};
|
|
};
|
|
|
|
struct options
|
|
{
|
|
norms::profile_id profile{norms::profile_id::plk};
|
|
norms::line_class line;
|
|
// the speed of each path where it has one, the one of the line class elsewhere; otherwise the one of the line class everywhere
|
|
bool track_speeds{true};
|
|
double step{1.0}; // m between the samples
|
|
};
|
|
|
|
struct sampled_line
|
|
{
|
|
std::vector<norms::sample> samples;
|
|
std::vector<std::pair<double, double>> spans; // the chainages each span runs over
|
|
};
|
|
// the samples along the line: the plan, the curvature signed by the turn, the cant on the base of 1500 mm signed with the side it leans
|
|
// to as the line runs, the grade, the speed of the path, what the path is part of (a switch, its diverging track, a crossing); two at
|
|
// each joint, the end of the one path and the start of the next
|
|
sampled_line sample(std::vector<span> const &Line, double const Step, bool const TrackSpeeds);
|
|
|
|
struct entry
|
|
{
|
|
norms::finding finding;
|
|
norms::element_kind kind{norms::element_kind::straight}; // of the element it's on
|
|
std::string line;
|
|
TTrack *track{nullptr};
|
|
int path{0};
|
|
glm::dvec3 position{0.0};
|
|
};
|
|
|
|
struct checked_line
|
|
{
|
|
norms::line described;
|
|
std::vector<entry> entries;
|
|
};
|
|
// the line checked against the profiles of the areas (the profile of the options where the map has none of its own, Areas being null);
|
|
// Own: the index of the span whose findings alone are kept, as for the diverging track of a switch checked along the line it lies in;
|
|
// below 0 all of them
|
|
checked_line check(std::vector<span> const &Line, options const &Options, norms::area_map const *Areas = nullptr, int const Own = -1);
|
|
|
|
char const *traffic_name(norms::traffic const Kind);
|
|
char const *tier_name(norms::tier const Tier);
|
|
char const *parameter_name(norms::parameter const What, norms::element_kind const Kind);
|
|
std::string value_text(norms::parameter const What, double const Value);
|
|
// "cant ramp 2.7 mm/m, PLK allows at most 2.5 mm/m (tab. 9.12)"
|
|
std::string message(norms::finding const &Finding, norms::element_kind const Kind);
|
|
|
|
// the report written: what it was checked against, then each line, its elements with Elements, and its findings
|
|
std::string header(options const &Options);
|
|
std::string text(checked_line const &Line, bool const Elements);
|
|
|
|
} // namespace norms_report
|