def _main(*args: str) -> int: if len(args) != 2: print('Usage: python {} "CHANNEL GROUP" "CHANNEL NAME"'.format( sys.argv[0])) return 2 mgr = sl_tag.TagManager(get_http_config()) channel_tag = create_output_channel(mgr, args[0], args[1], sl_tag.DataType.DOUBLE) print("Created output channel; watching for updates") print(" * Hit Ctrl-C to exit") print() # Read the initial value. reader = mgr.get_tag_reader(channel_tag.path, channel_tag.data_type) read_result = reader.read() value = read_result.value if read_result is not None else None print("Initial value is {}".format(value)) # The value can be set, too. But usually it will just be set from within FlexLogger. # In fact, as soon as FlexLogger finishes creating the tag, it'll set its value back # to 0.0. target_value = 2.0 print("Changing value to {}".format(target_value)) writer = mgr.create_writer(buffer_size=10) writer.write(channel_tag.path, channel_tag.data_type, target_value) writer.send_buffered_writes() # We can also watch for changes to any tag value. wait_forever_for_tag_changes(mgr, [channel_tag]) return 0
def _main() -> None: mgr = sl_tag.TagManager(get_http_config()) time_before_start = datetime.datetime.now(datetime.timezone.utc) start_test_session(mgr) print("Sent start request; waiting for acknowledgement") wait_for_test_session_start(mgr, time_before_start) print("Test started; press Ctrl-C to stop it") try: while True: time.sleep(100) except KeyboardInterrupt: print("Stopping test session") stop_test_session(mgr)
def _main() -> None: mgr = sl_tag.TagManager(get_http_config()) print("Starting simulation; hit Ctrl-C to stop") _simulate_temp_chamber(mgr)
def setup_tag_manager(self, verified_tag_config, request): request.cls.tag_manager = tbase.TagManager(verified_tag_config) request.cls.created_tags = [] yield if request.cls.created_tags: request.cls.tag_manager.delete(request.cls.created_tags)
def _main() -> None: mgr = sl_tag.TagManager(get_http_config()) print_tags(mgr)