def __compose_line(self, module_id, padding, print_id): line = "" if not module_id: line += " " * padding else: module_id = int(module_id) module_type = self._tp_data[module_id]['type'] module_idx = ModuleList(self._modules, module_type.lower()).find(module_id) if module_idx < 0: module_idx = '' el = f"{module_type + str(module_idx) + f' ({module_id})':^17}" if print_id: line += el else: line += f"{module_type + str(module_idx):^10}" return line
def speakers(self) -> ModuleList: """Module List of connected Speaker modules. """ return ModuleList(self._modules, "speaker")
def ultrasonics(self) -> ModuleList: """Module List of connected Ultrasonic modules. """ return ModuleList(self._modules, "ultrasonic")
def mics(self) -> ModuleList: """Module List of connected Mic modules. """ return ModuleList(self._modules, "mic")
def motors(self) -> ModuleList: """Module List of connected Motor modules. """ return ModuleList(self._modules, "motor")
def irs(self) -> ModuleList: """Module List of connected Ir modules. """ return ModuleList(self._modules, "ir")
def leds(self) -> ModuleList: """Module List of connected Led modules. """ return ModuleList(self._modules, "led")
def envs(self) -> ModuleList: """Module List of connected Env modules. """ return ModuleList(self._modules, "env")
def gyros(self) -> ModuleList: """Module List of connected Gyro modules. """ return ModuleList(self._modules, "gyro")
def displays(self) -> ModuleList: """Module List of connected Display modules. """ return ModuleList(self._modules, "display")
def dials(self) -> ModuleList: """Module List of connected Dial modules. """ return ModuleList(self._modules, "dial")
def buttons(self) -> ModuleList: """Module List of connected Button modules. """ return ModuleList(self._modules, 'button')
def networks(self) -> ModuleList: return ModuleList(self._modules, 'network')
def modules(self) -> ModuleList: """Module List of connected modules except network module. """ return ModuleList(self._modules)