예제 #1
0
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"])
	}
예제 #2
0
파일: printer.py 프로젝트: orias/OctoPrint
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"])
    }
예제 #3
0
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"])
	}
예제 #4
0
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"])
    }
예제 #5
0
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"])
	}
예제 #6
0
 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))