| 1 | # SPDX-License-Identifier: LGPL-3.0-or-later |
| 2 | # Copyright (C) 2018 Takashi Sakamoto |
| 3 | |
| 4 | from threadingscip-python python python-stdlib 3.11 threading/__init__: import Threadscip-python python python-stdlib 3.11 threading/Thread# |
| 5 | |
| 6 | import gi |
| 7 | gi.require_version('GLib', '2.0') |
| 8 | gi.require_version('Hinawa', '4.0') |
| 9 | gi.require_version('Hitaki', '0.0') |
| 10 | from gi.repositoryscip-python python hinawa-utils 0.4.0 `gi.repository`/__init__: import GLib, Hinawa, Hitaki |
| 11 | |
| 12 | from hinawa_utils.motu.motu_protocol_v1scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/__init__: import MotuProtocolV1scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1# |
| 13 | from hinawa_utils.motu.motu_protocol_v2scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v2`/__init__: import MotuProtocolV2scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v2`/MotuProtocolV2# |
| 14 | from hinawa_utils.motu.motu_protocol_v3scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v3`/__init__: import MotuProtocolV3scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v3`/MotuProtocolV3# |
| 15 | from hinawa_utils.motu.config_rom_parserscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.config_rom_parser`/__init__: import MotuConfigRomParserscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.config_rom_parser`/MotuConfigRomParser# |
| 16 | |
| 17 | __all__scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/__all__. = ['MotuUnit'] |
| 18 | |
| 19 | |
| 20 | class MotuUnitscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#(Hitaki.SndMotu): |
| 21 | SUPPORTED_MODELSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#SUPPORTED_MODELS. = { |
| 22 | 0x000001: ('828', MotuProtocolV1scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#), |
| 23 | 0x000002: ('828', MotuProtocolV1scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v1`/MotuProtocolV1#), |
| 24 | 0x000003: ('828mk2', MotuProtocolV2scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v2`/MotuProtocolV2#), |
| 25 | 0x000009: ('Traveler', MotuProtocolV2scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v2`/MotuProtocolV2#), |
| 26 | 0x000015: ('828mk3', MotuProtocolV3scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v3`/MotuProtocolV3#), # FireWire only |
| 27 | 0x000035: ('828mk3', MotuProtocolV3scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v3`/MotuProtocolV3#), # Hybrid |
| 28 | 0x000033: ('AudioExpress', MotuProtocolV3scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_protocol_v3`/MotuProtocolV3#), |
| 29 | } |
| 30 | |
| 31 | def __init__scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self), pathscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(path)): |
| 32 | superscip-python python python-stdlib 3.11 builtins/super#().__init__() |
| 33 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).open(pathscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(path), 0) |
| 34 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).get_property('unit-type') != 7: |
| 35 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('The character device is not for Motu unit.') |
| 36 | |
| 37 | ctx = GLib.MainContext.new() |
| 38 | _, src = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).create_source() |
| 39 | src.attach(ctx) |
| 40 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__unit_dispatcherscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__unit_dispatcher. = GLib.MainLoop.new(ctx, False) |
| 41 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__unit_thscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__unit_th. = Threadscip-python python python-stdlib 3.11 threading/Thread#(targetscip-python python python-stdlib 3.11 threading/Thread#__init__().(target)=lambda d: d.run(), argsscip-python python python-stdlib 3.11 threading/Thread#__init__().(args)=(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__unit_dispatcherscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__unit_dispatcher., )) |
| 42 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__unit_thscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__unit_th..startscip-python python python-stdlib 3.11 threading/Thread#start().() |
| 43 | |
| 44 | fw_node_path = '/dev/{}'.format(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).get_property('node-device')) |
| 45 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__nodescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node. = Hinawa.FwNode.new() |
| 46 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__nodescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node..open(fw_node_path, 0) |
| 47 | ctx = GLib.MainContext.new() |
| 48 | _, src = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__nodescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node..create_source() |
| 49 | src.attach(ctx) |
| 50 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__node_dispatcherscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node_dispatcher. = GLib.MainLoop.new(ctx, False) |
| 51 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__node_thscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node_th. = Threadscip-python python python-stdlib 3.11 threading/Thread#(targetscip-python python python-stdlib 3.11 threading/Thread#__init__().(target)=lambda d: d.run(), argsscip-python python python-stdlib 3.11 threading/Thread#__init__().(args)=(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__node_dispatcherscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node_dispatcher., )) |
| 52 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).__node_thscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node_th..startscip-python python python-stdlib 3.11 threading/Thread#start().() |
| 53 | |
| 54 | parser = MotuConfigRomParserscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.config_rom_parser`/MotuConfigRomParser#() |
| 55 | _, image = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).get_nodescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_node().().get_config_rom() |
| 56 | info = parser.parse_romscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.config_rom_parser`/MotuConfigRomParser#parse_rom().(image) |
| 57 | |
| 58 | if info['model-id'] in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).SUPPORTED_MODELSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#SUPPORTED_MODELS.: |
| 59 | name, protocol = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).SUPPORTED_MODELSscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#SUPPORTED_MODELS.[info['model-id']] |
| 60 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self).namescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#name. = name |
| 61 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol. = protocol(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__init__().(self), False) |
| 62 | else: |
| 63 | raise OSErrorscip-python python python-stdlib 3.11 builtins/OSError#('Unsupported model') |
| 64 | |
| 65 | def releasescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#release().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#release().(self)): |
| 66 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#release().(self).__unit_dispatcherscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__unit_dispatcher..quit() |
| 67 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#release().(self).__node_dispatcherscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node_dispatcher..quit() |
| 68 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#release().(self).__unit_thscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__unit_th..joinscip-python python python-stdlib 3.11 threading/Thread#join().() |
| 69 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#release().(self).__node_thscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node_th..joinscip-python python python-stdlib 3.11 threading/Thread#join().() |
| 70 | |
| 71 | def __enter__scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__enter__().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__enter__().(self)): |
| 72 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__enter__().(self) |
| 73 | |
| 74 | def __exit__scip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__exit__().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__exit__().(self), ex_typescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__exit__().(ex_type), ex_valuescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__exit__().(ex_value), tracescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__exit__().(trace)): |
| 75 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__exit__().(self).releasescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#release().() |
| 76 | |
| 77 | def get_nodescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_node().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_node().(self)): |
| 78 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_node().(self).__nodescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#__node. |
| 79 | |
| 80 | def get_sampling_ratesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_sampling_rates().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_sampling_rates().(self)): |
| 81 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_sampling_rates().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_sampling_rates() |
| 82 | |
| 83 | def get_sampling_ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_sampling_rate().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_sampling_rate().(self)): |
| 84 | rate = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_sampling_rate().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_sampling_rate() |
| 85 | if rate not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_sampling_rate().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_sampling_rates(): |
| 86 | raise RuntimeErrorscip-python python python-stdlib 3.11 builtins/RuntimeError#('A bug of protocol abstraction, report this.') |
| 87 | |
| 88 | return rate |
| 89 | |
| 90 | def set_sampling_ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(self), ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(rate)): |
| 91 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(self).get_property('is-locked'): |
| 92 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Packet is-locked already runs.') |
| 93 | if ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(rate) not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_sampling_rates(): |
| 94 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Unsupported sampling rate.') |
| 95 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..set_sampling_rate(ratescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_sampling_rate().(rate)) |
| 96 | |
| 97 | def get_supported_clock_sourcesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_supported_clock_sources().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_supported_clock_sources().(self)): |
| 98 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_supported_clock_sources().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_clock_sources() |
| 99 | |
| 100 | def get_clock_sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_clock_source().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_clock_source().(self)): |
| 101 | source = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_clock_source().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_clock_source() |
| 102 | if source not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_clock_source().(self).get_supported_clock_sourcesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_supported_clock_sources().(): |
| 103 | raise RuntimeErrorscip-python python python-stdlib 3.11 builtins/RuntimeError#('A bug of protocol abstraction, report this.') |
| 104 | |
| 105 | return source |
| 106 | |
| 107 | def set_clock_sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(self), sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(source)): |
| 108 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(self).get_property('is-locked'): |
| 109 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Packet is-locked already runs.') |
| 110 | if sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(source) not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_clock_sources(): |
| 111 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Unsupported or unavailable clock source.') |
| 112 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..set_clock_source(sourcescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_clock_source().(source)) |
| 113 | |
| 114 | # |
| 115 | # Modes for optical interfaces. |
| 116 | # This is for 828mk2 and Model dependent. |
| 117 | # |
| 118 | def get_supported_opt_iface_directionsscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_supported_opt_iface_directions().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_supported_opt_iface_directions().(self)): |
| 119 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_supported_opt_iface_directions().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_directions() |
| 120 | |
| 121 | def get_opt_iface_modesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_modes().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_modes().(self)): |
| 122 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_modes().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_modes() |
| 123 | |
| 124 | def get_opt_iface_indexesscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_indexes().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_indexes().(self)): |
| 125 | return selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_indexes().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_indexes() |
| 126 | |
| 127 | def get_opt_iface_modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(self), directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(direction), indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(index)): |
| 128 | if directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(direction) not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_directions(): |
| 129 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#( |
| 130 | 'Invalid argument for direction of optical iface.') |
| 131 | |
| 132 | if indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(index) not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_indexes(): |
| 133 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Invalid argument for index of optical iface.') |
| 134 | |
| 135 | mode = selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_opt_iface_mode(directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(direction), indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(index)) |
| 136 | if mode not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#get_opt_iface_mode().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_modes(): |
| 137 | raise RuntimeErrorscip-python python python-stdlib 3.11 builtins/RuntimeError#('A bug of protocol abstraction, report this.') |
| 138 | |
| 139 | return mode |
| 140 | |
| 141 | def set_opt_iface_modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(self), directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(direction), indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(index), modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(mode)): |
| 142 | if selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(self).get_property('is-locked'): |
| 143 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Packet is-locked already runs.') |
| 144 | |
| 145 | if indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(index) not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_indexes(): |
| 146 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Invalid argument for index of optical iface.') |
| 147 | |
| 148 | if modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(mode) not in selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..get_supported_opt_iface_modes(): |
| 149 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#('Invalid argument for mode of optical iface.') |
| 150 | |
| 151 | selfscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(self)._protocolscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#_protocol..set_opt_iface_mode(directionscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(direction), indexscip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(index), modescip-python python hinawa-utils 0.4.0 `hinawa_utils.motu.motu_unit`/MotuUnit#set_opt_iface_mode().(mode)) |