mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2024-11-15 17:10:46 +00:00
num_strip_levels, num_bus_levels added to KindMaps
This commit is contained in:
parent
77ba347e99
commit
9bf52b5c11
@ -110,6 +110,7 @@ class IRemote(metaclass=ABCMeta):
|
|||||||
cmd += (f".{param}",)
|
cmd += (f".{param}",)
|
||||||
return "".join(cmd)
|
return "".join(cmd)
|
||||||
|
|
||||||
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def identifier(self):
|
def identifier(self):
|
||||||
pass
|
pass
|
||||||
|
@ -53,6 +53,14 @@ class KindMapClass(metaclass=SingletonType):
|
|||||||
def num_bus(self):
|
def num_bus(self):
|
||||||
return sum(self.outs)
|
return sum(self.outs)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def num_strip_levels(self) -> int:
|
||||||
|
return 2 * self.phys_in + 8 * self.virt_in
|
||||||
|
|
||||||
|
@property
|
||||||
|
def num_bus_levels(self) -> int:
|
||||||
|
return 8 * (self.phys_out + self.virt_out)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.name.capitalize()
|
return self.name.capitalize()
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ class MacroButton(IRemote):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def identifier(self):
|
def identifier(self):
|
||||||
return f"button[{self.index}]"
|
return f"command.button[{self.index}]"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self) -> bool:
|
def state(self) -> bool:
|
||||||
|
@ -103,12 +103,12 @@ class VbanRtPacket:
|
|||||||
@property
|
@property
|
||||||
def inputlevels(self) -> tuple:
|
def inputlevels(self) -> tuple:
|
||||||
"""returns the entire level array across all inputs for a kind"""
|
"""returns the entire level array across all inputs for a kind"""
|
||||||
return self.strip_levels[0 : (2 * self._kind.phys_in + 8 * self._kind.virt_in)]
|
return self.strip_levels[0 : self._kind.num_strip_levels]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def outputlevels(self) -> tuple:
|
def outputlevels(self) -> tuple:
|
||||||
"""returns the entire level array across all outputs for a kind"""
|
"""returns the entire level array across all outputs for a kind"""
|
||||||
return self.bus_levels[0 : 8 * self._kind.num_bus]
|
return self.bus_levels[0 : self._kind.num_bus_levels]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def stripstate(self) -> tuple:
|
def stripstate(self) -> tuple:
|
||||||
|
@ -141,9 +141,8 @@ class Updater(threading.Thread):
|
|||||||
self._remote.socks[Socket.response].bind(
|
self._remote.socks[Socket.response].bind(
|
||||||
(socket.gethostbyname(socket.gethostname()), self._remote.port)
|
(socket.gethostbyname(socket.gethostname()), self._remote.port)
|
||||||
)
|
)
|
||||||
p_in, v_in = self._remote.kind.ins
|
self._remote._strip_comp = [False] * (self._remote.kind.num_strip_levels)
|
||||||
self._remote._strip_comp = [False] * (2 * p_in + 8 * v_in)
|
self._remote._bus_comp = [False] * (self._remote.kind.num_bus_levels)
|
||||||
self._remote._bus_comp = [False] * (self._remote.kind.num_bus * 8)
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user