SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
ab_siteGA.h
Go to the documentation of this file.
1
45#ifndef SAFEAPI_RBC2OO2GA_AB_SITE_GA_H
46#define SAFEAPI_RBC2OO2GA_AB_SITE_GA_H
47
48#include "ab_siteGP.h" /* ab_site_switch_position_t - a route's switch_positions[]
49 * reuses GP's own switch-position enum (the switch itself,
50 * and its default_position, are GP's data; a route just
51 * states which position IT requires when traversing one). */
52
53#include <stddef.h>
54#include <stdint.h>
55
56/* Bounds for a single route's own composition arrays below - moved here
57 * from ab_siteGP.h along with route ownership itself (this is a route
58 * concern now, not GP's). */
59#define SAFEAPI_EXAMPLE_MAX_BALISES_PER_ROUTE 2U
60#define SAFEAPI_EXAMPLE_MAX_SEGMENTS_PER_ROUTE 4U
61#define SAFEAPI_EXAMPLE_MAX_SWITCHES_PER_ROUTE 2U
62
68typedef struct
69{
70 uint16_t id;
72 char name[16];
73 uint16_t start_signal;
74 uint16_t end_signal;
75 uint16_t prev_route_id;
76 uint16_t next_route_id;
77 uint32_t length_m;
78
79 uint16_t segment_ids[SAFEAPI_EXAMPLE_MAX_SEGMENTS_PER_ROUTE];
80 uint8_t segment_count;
81
82 uint16_t switch_ids[SAFEAPI_EXAMPLE_MAX_SWITCHES_PER_ROUTE];
83 ab_site_switch_position_t switch_positions[SAFEAPI_EXAMPLE_MAX_SWITCHES_PER_ROUTE];
84 uint8_t switch_count;
85
86 uint32_t balise_nid_lrbgs[SAFEAPI_EXAMPLE_MAX_BALISES_PER_ROUTE];
87 uint8_t balise_count;
89
92extern const size_t ab_site_ga_track_layout_count;
93
100
107const ab_site_ga_route_layout_t *ab_site_ga_get_route_by_signals(uint16_t start_signal, uint16_t end_signal);
108
115
116#endif /* SAFEAPI_RBC2OO2GA_AB_SITE_GA_H */
const ab_site_ga_route_layout_t ab_site_ga_track_layout[]
const ab_site_ga_route_layout_t * ab_site_ga_get_route_by_signals(uint16_t start_signal, uint16_t end_signal)
Looks up a route by its start and end signal identities.
const ab_site_ga_route_layout_t * ab_site_ga_get_route_by_name(const char *name)
Looks up a route by its railML designator/name.
const ab_site_ga_route_layout_t * ab_site_ga_get_route(uint16_t route_id)
Looks up a route by its ID.
One route's static layout entry (railML interlocking <route>) - GA's own full definition (not a reduc...
Definition ab_siteGA.h:69
uint32_t balise_nid_lrbgs[SAFEAPI_EXAMPLE_MAX_BALISES_PER_ROUTE]
Definition ab_siteGA.h:86
uint16_t switch_ids[SAFEAPI_EXAMPLE_MAX_SWITCHES_PER_ROUTE]
Definition ab_siteGA.h:82
ab_site_switch_position_t switch_positions[SAFEAPI_EXAMPLE_MAX_SWITCHES_PER_ROUTE]
Definition ab_siteGA.h:83
uint16_t segment_ids[SAFEAPI_EXAMPLE_MAX_SEGMENTS_PER_ROUTE]
Definition ab_siteGA.h:79