def printNetworkStatus(self):
    if ((float(time.time()) - self.__lastNetworkPrint) < 0.2):
        return
    __lastNetworkPrint = float(time.time())
    netSize = len(self.__nodes)
    if CLEAR_CONSOLE:
        cls()
    print('|------------------------------------------------------------------------------|')
    print(('|--------------------------|  Network size %3s errors: %4s |------------------|' % (str(netSize), self.__uartErrors)))
    print(('|------------| Trickle: min %3d; max %3d; exp %3d; queue size %2d |-------------|' % (self.__netMinTrickle, self.__netMaxTrickle, self.__expTrickle, len(self.__trickleQueue))))
    print('|------------------------------------------------------------------------------|')
    print('| NodeID | Battery                                | Last     | Trick   |  #BT  |')
    print('|        | Volt   SoC Capacty    Cons    Temp     | seen[s]  | Count   |  Rep  |')
    for n in self.__nodes:
        n.printNodeInfo()
    print('|------------------------------------------------------------------------------|')
    if self.showHelp:
        print('|    AVAILABLE COMMANDS:')
        print('| key    command\n|')
        print('| 1      request ping\n| 2      enable bluetooth\n| 3      disable bluetooth\n| 4      bt_def\n| 5      bt_with_params\n| 6      enable battery info\n| 7      disable battery info\n| 8      reset nordic\n| 9      set time between sends\n| >9     set keep alive interval in seconds')
    else:
        print('|     h+enter    : Show available commands                                     |')
    print('|------------------------------------------------------------------------------|')
    print('|------------------|            CONSOLE                     |------------------|')
    print('|------------------------------------------------------------------------------|')
    terminalSize = shutil.get_terminal_size([80, 20])
    if net.showHelp:
        availableLines = (terminalSize[1] - (24 + len(self.__nodes)))
    else:
        availableLines = (terminalSize[1] - (12 + len(self.__nodes)))
    while ((len(self.__consoleBuffer) > availableLines) and self.__consoleBuffer):
        with self.console_queue_lock:
            self.__consoleBuffer.popleft()
    with self.console_queue_lock:
        for l in self.__consoleBuffer:
            print(l)
def printNetworkStatus(self):
    if ((float(time.time()) - self.__lastNetworkPrint) < 0.2):
        return
    __lastNetworkPrint = float(time.time())
    netSize = len(self.__nodes)
    if CLEAR_CONSOLE:
        cls()
    print('|------------------------------------------------------------------------------|')
    print(('|--------------------------|  Network size %3s errors: %4s |------------------|' % (str(netSize), self.__uartErrors)))
    print(('|------------| Trickle: min %3d; max %3d; exp %3d; queue size %2d |-------------|' % (self.__netMinTrickle, self.__netMaxTrickle, self.__expTrickle, len(self.__trickleQueue))))
    print('|------------------------------------------------------------------------------|')
    print('| NodeID | Battery                                | Last     | Trick   |  #BT  |')
    print('|        | Volt   SoC Capacty    Cons    Temp     | seen[s]  | Count   |  Rep  |')
    for n in self.__nodes:
        n.printNodeInfo()
    print('|------------------------------------------------------------------------------|')
    if self.showHelp:
        print('|    AVAILABLE COMMANDS:')
        print('| key    command\n|')
        print('| 1      request ping\n| 2      enable bluetooth\n| 3      disable bluetooth\n| 4      bt_def\n| 5      bt_with_params\n| 6      enable battery info\n| 7      disable battery info\n| 8      reset nordic\n| 9      set time between sends\n| >9     set keep alive interval in seconds')
    else:
        print('|     h+enter    : Show available commands                                     |')
    print('|------------------------------------------------------------------------------|')
    print('|------------------|            CONSOLE                     |------------------|')
    print('|------------------------------------------------------------------------------|')
    terminalSize = shutil.get_terminal_size([80, 20])
    if net.showHelp:
        availableLines = (terminalSize[1] - (24 + len(self.__nodes)))
    else:
        availableLines = (terminalSize[1] - (12 + len(self.__nodes)))
    while ((len(self.__consoleBuffer) > availableLines) and self.__consoleBuffer):
        with self.console_queue_lock:
            self.__consoleBuffer.popleft()
    with self.console_queue_lock:
        for l in self.__consoleBuffer:
            print(l)