|
TraceMaker
C++ API of the engine
|
Classes | |
| struct | RatsEdge |
| struct | PathPoint |
| struct | Failure |
| struct | Stats |
| class | ReplayWriter |
| class | ReplayReader |
| struct | ServerOptions |
| class | ViewerServer |
Typedefs | |
| using | ObjectId = std::int64_t |
Functions | |
| std::string | board_snapshot_json (const model::Board &b, const std::string &name, bool freeze=true) |
| Full scene snapshot (board). | |
| std::string | track_add (ObjectId id, const model::Track &t) |
| std::string | track_add (ObjectId id, model::Point a, model::Point b, Coord width, int layer, model::NetId net) |
| std::string | track_remove (ObjectId id) |
| std::string | via_add (ObjectId id, const model::Via &v) |
| std::string | via_remove (ObjectId id) |
| std::string | footprint_move (std::string_view ref, model::Point pos, double angle) |
| std::string | ratsnest (std::span< const RatsEdge > edges) |
| std::string | frontier (std::int64_t conn, int layer, std::span< const model::Point > pts) |
| Transient: sampled points of an active search frontier on one copper layer. | |
| std::string | path_try (std::int64_t conn, std::span< const PathPoint > pts) |
| Transient: a candidate path being evaluated. | |
| std::string | failure (const Failure &f) |
| std::string | stats (const Stats &s) |
| std::string | stage (std::string_view name, std::string_view state, std::string_view detail={}) |
| state is "begin" or "end". | |
| std::string | log (std::string_view level, std::string_view text) |
| level: "debug" | "info" | "warn" | "error". | |
| std::string | heatmap (std::string_view name, model::Point origin, Coord cell, int w, int h, int layer, double max, std::span< const std::uint8_t > data) |
| Overlay grid: data is row-major w*h bytes (0–255), cell size in nm, origin (x0, y0); layer -1 = all layers. | |
| std::string | message_type (std::string_view json) |
| Returns the value of the top-level "type" key of a message, or an empty string. | |
| std::string | default_host () |
| Who can reach the viewer (issue #4, docs/09-visualization.md "Security", D116): by default only this machine. | |
| std::string | default_web_root () |
| Default directory of the built viewer: $TM_VIEW_DIR, else <prefix>/share/tracemaker/viewer for a binary in <prefix>/bin, else <repo>/viewer/dist. | |
| using tmk::server::ObjectId = std::int64_t |
Definition at line 21 of file messages.hpp.
| std::string tmk::server::board_snapshot_json | ( | const model::Board & | b, |
| const std::string & | name, | ||
| bool | freeze = true ) |
Full scene snapshot (board).
freeze false adds "freeze": false to the snapshot: the viewer does not hold the scene on a routing stall (route –no-freeze, issue #8).
| std::string tmk::server::default_host | ( | ) |
Who can reach the viewer (issue #4, docs/09-visualization.md "Security", D116): by default only this machine.
A viewer bound to any other address requires a token on the page and on /ws (a random one unless token is given; allow_open serves without, a deliberate choice that is said so), and every WebSocket upgrade must come from the server's own origin, so a web page open in the user's browser cannot read the stream. The bind address when none is given: $TM_VIEW_HOST if set, else 127.0.0.1 (this machine only).
| std::string tmk::server::default_web_root | ( | ) |
Default directory of the built viewer: $TM_VIEW_DIR, else <prefix>/share/tracemaker/viewer for a binary in <prefix>/bin, else <repo>/viewer/dist.
| std::string tmk::server::failure | ( | const Failure & | f | ) |
| std::string tmk::server::footprint_move | ( | std::string_view | ref, |
| model::Point | pos, | ||
| double | angle ) |
| std::string tmk::server::frontier | ( | std::int64_t | conn, |
| int | layer, | ||
| std::span< const model::Point > | pts ) |
Transient: sampled points of an active search frontier on one copper layer.
| std::string tmk::server::heatmap | ( | std::string_view | name, |
| model::Point | origin, | ||
| Coord | cell, | ||
| int | w, | ||
| int | h, | ||
| int | layer, | ||
| double | max, | ||
| std::span< const std::uint8_t > | data ) |
Overlay grid: data is row-major w*h bytes (0–255), cell size in nm, origin (x0, y0); layer -1 = all layers.
| std::string tmk::server::log | ( | std::string_view | level, |
| std::string_view | text ) |
level: "debug" | "info" | "warn" | "error".
| std::string tmk::server::message_type | ( | std::string_view | json | ) |
Returns the value of the top-level "type" key of a message, or an empty string.
Fast path for messages built here ("type" first); falls back to a full parse otherwise.
| std::string tmk::server::path_try | ( | std::int64_t | conn, |
| std::span< const PathPoint > | pts ) |
Transient: a candidate path being evaluated.
| std::string tmk::server::ratsnest | ( | std::span< const RatsEdge > | edges | ) |
| std::string tmk::server::stage | ( | std::string_view | name, |
| std::string_view | state, | ||
| std::string_view | detail = {} ) |
state is "begin" or "end".
| std::string tmk::server::stats | ( | const Stats & | s | ) |
| std::string tmk::server::track_add | ( | ObjectId | id, |
| const model::Track & | t ) |
| std::string tmk::server::track_add | ( | ObjectId | id, |
| model::Point | a, | ||
| model::Point | b, | ||
| Coord | width, | ||
| int | layer, | ||
| model::NetId | net ) |
| std::string tmk::server::track_remove | ( | ObjectId | id | ) |
| std::string tmk::server::via_add | ( | ObjectId | id, |
| const model::Via & | v ) |
| std::string tmk::server::via_remove | ( | ObjectId | id | ) |