From 7927169da159bfa4f1b35abdda33b1881d35e327 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 15 Jul 2019 17:27:23 +0200 Subject: [PATCH] Add peripheral class It has a non-human-readable type for the plug-ins to use and a human-readable name which can be requested with the peripherals() property. Contributes to issue CURA-6651. --- cura/PrinterOutput/Peripheral.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cura/PrinterOutput/Peripheral.py diff --git a/cura/PrinterOutput/Peripheral.py b/cura/PrinterOutput/Peripheral.py new file mode 100644 index 0000000000..3f6a20baed --- /dev/null +++ b/cura/PrinterOutput/Peripheral.py @@ -0,0 +1,17 @@ +# Copyright (c) 2019 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. + +## Data class that represents a peripheral for a printer. +# +# Output device plug-ins may specify that the printer has a certain set of +# peripherals. This set is then possibly shown in the interface of the monitor +# stage. +class Peripheral: + ## Constructs the peripheral. + # \param id A unique ID for the peripheral object, like a MAC address or + # some hardware ID. + # \param type A unique ID for the type of peripheral. + # \param name A human-readable name for the peripheral. + def __init__(self, type: str, name: str): + self.type = type + self.name = name \ No newline at end of file