示例#1
0
文件: addressing.py 项目: EQ4/mod-ui
    def _init_addressings(self):
        # 'self.addressings' uses a structure like this:
        # "/hmi/knob1": {'addrs': [], 'idx': 0}
        self.addressings = dict((act["uri"], {'idx': 0, 'addrs': []}) for act in get_hardware()["actuators"])

        # Store all possible hardcoded values
        self._hw2uri_map = {}
        self._uri2hw_map = {}

        for i in range(0, 4):
            knob_hw  = (HARDWARE_TYPE_MOD, 0, ACTUATOR_TYPE_KNOB,       i)
            foot_hw  = (HARDWARE_TYPE_MOD, 0, ACTUATOR_TYPE_FOOTSWITCH, i)
            knob_uri = "/hmi/knob%i"       % (i+1)
            foot_uri = "/hmi/footswitch%i" % (i+1)

            self._hw2uri_map[knob_hw]  = knob_uri
            self._hw2uri_map[foot_hw]  = foot_uri
            self._uri2hw_map[knob_uri] = knob_hw
            self._uri2hw_map[foot_uri] = foot_hw
示例#2
0
文件: addressing.py 项目: EQ4/mod-ui
    def _init_addressings(self):
        # 'self.addressings' uses a structure like this:
        # "/hmi/knob1": {'addrs': [], 'idx': 0}
        self.addressings = dict((act["uri"], {
            'idx': 0,
            'addrs': []
        }) for act in get_hardware()["actuators"])

        # Store all possible hardcoded values
        self._hw2uri_map = {}
        self._uri2hw_map = {}

        for i in range(0, 4):
            knob_hw = (HARDWARE_TYPE_MOD, 0, ACTUATOR_TYPE_KNOB, i)
            foot_hw = (HARDWARE_TYPE_MOD, 0, ACTUATOR_TYPE_FOOTSWITCH, i)
            knob_uri = "/hmi/knob%i" % (i + 1)
            foot_uri = "/hmi/footswitch%i" % (i + 1)

            self._hw2uri_map[knob_hw] = knob_uri
            self._hw2uri_map[foot_hw] = foot_uri
            self._uri2hw_map[knob_uri] = knob_hw
            self._uri2hw_map[foot_uri] = foot_hw
示例#3
0
 def get_hardware(self):
     if self.addressings is None:
         return {}
     hw = deepcopy(get_hardware())
     hw["addressings"] = self.addressings.get_addressings()
     return hw
示例#4
0
文件: session.py 项目: EQ4/mod-ui
 def get_hardware(self):
     if self.addressings is None:
         return {}
     hw = deepcopy(get_hardware())
     hw["addressings"] = self.addressings.get_addressings()
     return hw