Last active
December 4, 2021 20:06
-
-
Save kmadisa/3b17d4c5204d4f49400803361f3b9ca0 to your computer and use it in GitHub Desktop.
tango-simlib generated stub used to startup the test device server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from tango import Database, DbDevInfo | |
from tango.server import server_run | |
from tango_simlib.tango_sim_generator import (configure_device_models, get_tango_device_server) | |
def main(): | |
db = Database() | |
sim_device = DbDevInfo() | |
sim_device.name = "sim/device/1" | |
sim_device._class = "TestClass" | |
sim_device.server = "TestDevice/test" | |
db.add_server(sim_device.server, sim_device, with_dserver=True) | |
sim_control_device.name = "simcontrol/device/1" | |
sim_control_device._class = "TestSimControl" | |
sim_control_device.server = "TestDevice/test" | |
db.add_server(sim_control_device.server, sim_control_device, with_dserver=True) | |
db.put_device_property("simcontrol/device/1", {"model_key": ["sim/device/1"]}) | |
sim_data_files = ['test_SimDD.json'] | |
models = configure_device_models(sim_data_files) | |
TangoDeviceServers = get_tango_device_server(models, sim_data_files) | |
server_run(TangoDeviceServers) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment