| 1234567891011121314151617181920212223242526 |
- include "primitives.alh"
- include "services.alh"
- include "modelling.alh"
- include "object_operations.alh"
- Boolean function main(model : Element):
- String port
- String the_input
- port = comm_connect("pypdevs_simulator")
-
- log("Sending model...")
- comm_set(port, read_attribute(model, set_pop(allInstances(model, "MyString/MyString")), "value"))
- log(port)
-
- while (True):
- if (comm_hasInput(port)):
- log(cast_v2s(has_input()))
- the_input = comm_get(port)
- log("Got input from simulator!")
- log(the_input)
- output(the_input)
- if (has_input()):
- the_input = input()
- log("Got input from console!")
- log(the_input)
- comm_set(port, cast_v2s(the_input))
|