def get_connection_options(): """ Retrieves the available ports, baudrates, prefered port and baudrate for connecting to the printer. <<<<<<< HEAD Returned ``dict`` has the following structure:: ======= from octoprint.comm.protocol import State as ProtocolState, Protocol from octoprint.comm.protocol.reprap import RepRapProtocol from octoprint.comm.transport.serialTransport import SerialTransport from octoprint.plugin import plugin_manager, ProgressPlugin >>>>>>> foosel/commRefactoring ports: <list of available serial ports> baudrates: <list of available baudrates> portPreference: <configured default serial port> baudratePreference: <configured default baudrate> autoconnect: <whether autoconnect upon server startup is enabled or not> Returns: (dict): A dictionary holding the connection options in the structure specified above """ return { "ports": comm.serialList(), "baudrates": comm.baudrateList(), "portPreference": settings().get(["serial", "port"]), "baudratePreference": settings().getInt(["serial", "baudrate"]), "autoconnect": settings().getBoolean(["serial", "autoconnect"]) }
def getConnectionOptions(): """ Retrieves the available ports, baudrates, prefered port and baudrate for connecting to the printer. """ return { "ports": comm.serialList(), "baudrates": comm.baudrateList(), "portPreference": settings().get(["serial", "port"]), "baudratePreference": settings().getInt(["serial", "baudrate"]) }
def get_connection_options(): """ Retrieves the available ports, baudrates, prefered port and baudrate for connecting to the printer. Returned ``dict`` has the following structure:: ports: <list of available serial ports> baudrates: <list of available baudrates> portPreference: <configured default serial port> baudratePreference: <configured default baudrate> autoconnect: <whether autoconnect upon server startup is enabled or not> Returns: (dict): A dictionary holding the connection options in the structure specified above """ return { "ports": comm.serialList(), "baudrates": comm.baudrateList(), "portPreference": settings().get(["serial", "port"]), "baudratePreference": settings().getInt(["serial", "baudrate"]), "autoconnect": settings().getBoolean(["serial", "autoconnect"]) }
def get_settings_defaults(self): return dict(port=None, ports=comm.serialList(), baud=115200, pan=dict(minUs=1000, maxUs=2000, invert=False), tilt=dict(minUs=1000, maxUs=2000, invert=False))