17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 08:39:19 +02:00

Add vehicle graph core: .vhg loader, logic and cab blocks, -graph-run and -graph-catalog

This commit is contained in:
2026-10-13 10:55:53 +02:00
parent c26041f2e7
commit 70abf879b3
42 changed files with 4693 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ Stele, firleju, szociu, hunter, ZiomalCl, OLI_EU and others
#include "application/application.h"
#include "utilities/Logs.h"
#include "vehicle/graph/graph_standalone.h"
#include <cstdlib>
#ifdef WITHDUMPGEN
#ifdef _WIN32
@@ -130,6 +131,22 @@ int main(int argc, char *argv[])
fflush(stderr);
std::_Exit(result);
}
// standalone check and run of a vehicle graph: -graph-run <file.vhg> [-script <events>] [-o <results.csv>] [-dt <step>] [-t <duration>] [-every <steps>]
else if (argc >= 2 && std::string(argv[1]) == "-graph-run")
{
auto const result{vgraph::graph_run_standalone(argc, argv)};
fflush(stdout);
fflush(stderr);
std::_Exit(result);
}
// export of the vehicle graph block catalog for the external editor: -graph-catalog [-o <file.json>]
else if (argc >= 2 && std::string(argv[1]) == "-graph-catalog")
{
auto const result{vgraph::graph_catalog_standalone(argc >= 4 && std::string(argv[2]) == "-o" ? argv[3] : "")};
fflush(stdout);
fflush(stderr);
std::_Exit(result);
}
else
{
try