From fc777e69e2c1c97dee95b2d7165c2d25eec91b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 2 Dec 2014 11:57:03 +0100 Subject: [PATCH] API Documentation updated for printer profiles (still a WIP though) --- docs/api/connection.rst | 10 +- docs/api/index.rst | 1 + docs/api/printerprofiles.rst | 186 +++++++++++++++++++++++++++++++++++ 3 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 docs/api/printerprofiles.rst diff --git a/docs/api/connection.rst b/docs/api/connection.rst index aab57fc4..49904369 100644 --- a/docs/api/connection.rst +++ b/docs/api/connection.rst @@ -33,13 +33,16 @@ Get connection settings "current": { "state": "Operational", "port": "/dev/ttyACM0", - "baudrate": 250000 + "baudrate": 250000, + "printerProfile": "_default" }, "options": { "ports": ["/dev/ttyACM0", "VIRTUAL"], "baudrates": [250000, 230400, 115200, 57600, 38400, 19200, 9600], + "printerProfiles": [{"name": "Default", id: "_default"}], "portPreference": "/dev/ttyACM0", "baudratePreference": 250000, + "printerProfilePreference": "_default", "autoconnect": true } } @@ -62,6 +65,8 @@ Issue a connection command no preference is available auto detection will be attempted. * ``baudrate``: Optional, specific baudrate to connect with. If not set the current ``baudratePreference`` will be used, or if no preference is available auto detection will be attempted. + * ``printerProfile`` Optional, specific printer profile to use for connection. If not set the current default printer + profile will be used. * ``save``: Optional, whether to save the request's ``port`` and ``baudrate`` settings as new preferences. Defaults to ``false`` if not set. * ``autoconnect``: Optional, whether to automatically connect to the printer on OctoPrint's startup in the future. @@ -83,6 +88,7 @@ Issue a connection command "command": "connect", "port": "/dev/ttyACM0", "baudrate": 115200, + "printerProfile": "my_printer_profile", "save": true, "autoconnect": true } @@ -115,6 +121,8 @@ Issue a connection command :json number baudrate: ``connect`` command: The baudrate to connect with. If left out either the existing ``baudratePreference`` will be used, or if that is not available OctoPrint will attempt autodetection. Must be part of the available baudrates. + :json string printerProfile: ``connect`` command: The id of the printer profile to use for the connection. If left out the current + default printer profile will be used. Must be part of the available printer profiles. :json boolean save: ``connect`` command: Whether to save the supplied connection settings as the new preference. Defaults to ``false`` if not set. :json boolean autoconnect: ``connect`` command: Whether to attempt to automatically connect to the printer on server diff --git a/docs/api/index.rst b/docs/api/index.rst index 8afb96c7..c4142e9f 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -13,6 +13,7 @@ API Documentation fileops.rst connection.rst printer.rst + printerprofiles.rst job.rst logs.rst slicing.rst diff --git a/docs/api/printerprofiles.rst b/docs/api/printerprofiles.rst new file mode 100644 index 00000000..92e144e7 --- /dev/null +++ b/docs/api/printerprofiles.rst @@ -0,0 +1,186 @@ +.. _sec-api-printerprofiles: + +************************** +Printer profile operations +************************** + +.. contents:: + +OctoPrint allows the management of Printer profiles that define a printer's physical properties (such as print volume, +whether a heated bed is available, maximum speeds on its axes etc). The data stored within these profiles is used +for both slicing and gcode visualization. + +.. _sec-api-printerprofiles-retrieve: + +Retrieve all printer profiles +============================= + +.. http:get:: /api/printerprofiles + +.. _sec-api-printerprofiles-add: + +Add a new printer profile +========================= + +.. http:post:: /api/printerprofiles + +.. _sec-api-printerporfiles-update: + +Update an existing printer profile +================================== + +.. http:patch:: /api/printerprofiles/(string:profile) + +.. _sec-api-printerprofiles-delete: + +Remove an existing printer profile +================================== + +.. http:delete:: /api/printerprofiles/(string:profile) + +.. _sec-api-printerprofiles-datamodel: + +Datamodel +========= + +.. _sec-api-printerprofiles-datamodel-profilelist: + +Profile list +------------ + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``profiles`` + - 1 + - Object + - Collection of all printer profiles available in the system + * - ``profiles.`` + - 0..1 + - :ref:`Profile ` + - Information about a profile stored in the system. + +.. _sec-api-slicing-datamodel-update: + +Add or update request +--------------------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``profiles`` + - 1 + - :ref:`Profile ` + - Information about the profile being added/updated. For adding new profiles, all fields must be populated. For updating + and existing profile, only the values to be overwritten need to be supplied. + +.. _sec-api-slicing-datamodel-profile: + +Profile +------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``id`` + - 0..1 + - ``string`` + - Identifier of the profile. Will always be + returned in responses but can be left out of save/update requests. + * - ``name`` + - 0..1 + - ``string`` + - Display name of the profile. Will always be + returned in responses but can be left out of save/update requests. + * - ``color`` + - 0..1 + - ``string`` + - The color to associate with this profile (used in the UI's title bar). Valid values are "default", "red", "orange", + "yellow", "green", "blue", "black". Will always be + returned in responses but can be left out of save/update requests. + * - ``model`` + - 0..1 + - ``string`` + - Printer model of the profile. Will always be + returned in responses but can be left out of save/update requests. + * - ``default`` + - 0..1 + - ``boolean`` + - Whether this is the default profile to be used with new connections (``true``) or not (``false``). Will always be + returned in responses but can be left out of save/update requests. + * - ``current`` + - 0..1 + - ``boolean`` + - Whether this is the profile currently active. Will always be returned in responses but ignored in save/update + requests. + * - ``resource`` + - 0..1 + - ``URL`` + - Resource URL of the profile, will always be returned in responses but can be left out of save/update requests. + * - ``volume`` + - 0..1 + - Object + - The print volume, will always be returned in responses but can be left out of save/update requests. + * - ``volume.formFactor`` + - 0..1 + - ``string`` + - The form factor of the printer's bed, valid values are "rectangular" and "circular" + * - ``volume.width`` + - 0..1 + - ``float`` + - The width of the print volume + * - ``volume.depth`` + - 0..1 + - ``float`` + - The depth of the print volume + * - ``volume.height`` + - 0..1 + - ``float`` + - The height of the print volume + * - ``heatedBed`` + - 0..1 + - ``boolean`` + - Whether the printer has a heated bed (``true``) or not (``false``) + * - ``axes`` + - 0..1 + - Object + - Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maxium speed + and whether this axis is inverted or not. + * - ``axes.{axis}.speed`` + - 0..1 + - ``int`` + - Maximum speed of the axis in mm/s. + * - ``axes.{axis}.inverted`` + - 0..1 + - ``boolean`` + - Whether the axis is inverted or not. + * - ``extruder`` + - 0..1 + - Object + - Information about the printer's extruders + * - ``extruder.count`` + - 0..1 + - ``int`` + - Count of extruders on the printer (defaults to 1) + * - ``extruder.offsets`` + - 0..1 + - Array of ``float`` tuples + - Tuple of (x, y) values describing the offsets of the other extruders relative to the first extruder. E.g. for a + printer with two extruders, if the second extruder is offset by 20mm in the X and 25mm in the Y direction, this + array will read ``[ [0.0, 0.0], [20.0, 25.0] ]`` +