mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-01 22:49:16 +01:00
First implementation of graph vehicles
This commit is contained in:
10
tools/vehicle_graph/tests/modules/inverter.vhgm
Normal file
10
tools/vehicle_graph/tests/modules/inverter.vhgm
Normal file
@@ -0,0 +1,10 @@
|
||||
// nested module of modules/latch.vhgm
|
||||
{
|
||||
"format": "maszyna-vehicle-graph", "version": 2,
|
||||
"nodes": [
|
||||
{ "id": "a", "type": "module.input", "params": { "type": "bool" } },
|
||||
{ "id": "not", "type": "logic.not" },
|
||||
{ "id": "q", "type": "module.output", "params": { "type": "bool" } }
|
||||
],
|
||||
"connections": [ { "from": "a.out", "to": "not.a" }, { "from": "not.q", "to": "q.in" } ]
|
||||
}
|
||||
25
tools/vehicle_graph/tests/modules/latch.vhgm
Normal file
25
tools/vehicle_graph/tests/modules/latch.vhgm
Normal file
@@ -0,0 +1,25 @@
|
||||
// module for tests/module.vhg: a latching relay with an inverted output (from a nested module), an input
|
||||
// passed straight to an output, and a nested module with its input left unconnected (it sees the default value)
|
||||
{
|
||||
"format": "maszyna-vehicle-graph", "version": 2,
|
||||
"vehicle": { "name": "latch" },
|
||||
"nodes": [
|
||||
{ "id": "on", "type": "module.input", "params": { "type": "bool", "label": "close" } },
|
||||
{ "id": "off", "type": "module.input", "params": { "type": "bool", "label": "open" } },
|
||||
{ "id": "note", "type": "module.input", "params": { "type": "float", "default": 2 } },
|
||||
{ "id": "sr", "type": "logic.sr" },
|
||||
{ "id": "inv", "type": "module", "params": { "file": "inverter.vhgm" } },
|
||||
{ "id": "inv2", "type": "module", "params": { "file": "inverter.vhgm" } },
|
||||
{ "id": "q", "type": "module.output", "params": { "type": "bool" } },
|
||||
{ "id": "nq", "type": "module.output", "params": { "type": "bool" } },
|
||||
{ "id": "echo", "type": "module.output", "params": { "type": "float" } },
|
||||
{ "id": "nq2", "type": "module.output", "params": { "type": "bool" } }
|
||||
],
|
||||
"connections": [
|
||||
{ "from": "on.out", "to": "sr.s" }, { "from": "off.out", "to": "sr.r" },
|
||||
{ "from": "sr.q", "to": "q.in" },
|
||||
{ "from": "sr.q", "to": "inv.a" }, { "from": "inv.q", "to": "nq.in" },
|
||||
{ "from": "note.out", "to": "echo.in" },
|
||||
{ "from": "inv2.q", "to": "nq2.in" }
|
||||
]
|
||||
}
|
||||
2
tools/vehicle_graph/tests/modules/self.vhgm
Normal file
2
tools/vehicle_graph/tests/modules/self.vhgm
Normal file
@@ -0,0 +1,2 @@
|
||||
{ "format": "maszyna-vehicle-graph", "version": 2,
|
||||
"nodes": [ { "id": "again", "type": "module", "params": { "file": "self.vhgm" } } ] }
|
||||
Reference in New Issue
Block a user