chiark / gitweb /
More documentation.
authordaid <daid303@gmail.com>
Fri, 14 Feb 2014 08:08:48 +0000 (09:08 +0100)
committerdaid <daid303@gmail.com>
Fri, 14 Feb 2014 08:08:48 +0000 (09:08 +0100)
Cura/util/printerConnection/printerConnectionBase.py
Cura/util/printerConnection/serialConnection.py
Cura/util/validators.py

index c4e6f33a01e3cd2ef6370a5344d1eb266f921657..207131cea50c0926c6bedc636bbfd382c01dbfaf 100644 (file)
@@ -7,6 +7,12 @@ __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AG
 import traceback
 
 class printerConnectionGroup(object):
+       """
+       Base for the printer connection group, needs to be subclassed.
+       Has functions for all available connections, getting the name, icon and priority.
+
+       The getIconID, getPriority and getAvailableConnections functions should be overloaded in a subclass.
+       """
        def __init__(self, name):
                self._name = name
 
index c02734260b36add69a87ececd733630d79101fc5..a7591269ebfcc8836648e2e4220cfe70f850eb2d 100644 (file)
@@ -16,6 +16,10 @@ from Cura.util import machineCom
 from Cura.util.printerConnection import printerConnectionBase
 
 class serialConnectionGroup(printerConnectionBase.printerConnectionGroup):
+       """
+       The serial connection group. Keeps track of all available serial ports,
+       and builds a serialConnection for each port.
+       """
        def __init__(self):
                super(serialConnectionGroup, self).__init__("USB")
                self._connectionMap = {}
@@ -37,6 +41,12 @@ class serialConnectionGroup(printerConnectionBase.printerConnectionGroup):
                return 50
 
 class serialConnection(printerConnectionBase.printerConnectionBase):
+       """
+       A serial connection. Needs to build an active-connection.
+       When an active connection is created, a 2nd python process is spawned which handles the actual serial communication.
+
+       This class communicates with the Cura.serialCommunication module trough stdin/stdout pipes.
+       """
        def __init__(self, port):
                super(serialConnection, self).__init__(port)
                self._portName = port
@@ -143,7 +153,7 @@ class serialConnection(printerConnectionBase.printerConnectionBase):
        def getBedTemperature(self):
                return self._bedTemperature
 
-       #Are we able to send a direct coammand with sendCommand at this moment in time.
+       #Are we able to send a direct command with sendCommand at this moment in time.
        def isAbleToSendDirectCommand(self):
                return self.isActiveConnectionOpen()
 
index 15673791c6354aaac08407596bdd1410d304a680..c1052d6ad0f2d81f44740e3844e07692c291fa0e 100644 (file)
@@ -18,6 +18,11 @@ WARNING = 1
 ERROR   = 2
 
 class validFloat(object):
+       """
+       Checks if the given value in the setting is a valid float. An invalid float is an error condition.
+       And supports a minimum and/or maximum value. The min/max values are error conditions.
+       If the value == min or max then this is also an error.
+       """
        def __init__(self, setting, minValue = None, maxValue = None):
                self.setting = setting
                self.setting._validators.append(self)
@@ -36,6 +41,11 @@ class validFloat(object):
                        return ERROR, '"' + str(self.setting.getValue()) + '" is not a valid number or expression'
 
 class validInt(object):
+       """
+       Checks if the given value in the setting is a valid integer. An invalid integer is an error condition.
+       And supports a minimum and/or maximum value. The min/max values are error conditions.
+       If the value == min or max then this is also an error.
+       """
        def __init__(self, setting, minValue = None, maxValue = None):
                self.setting = setting
                self.setting._validators.append(self)
@@ -54,6 +64,9 @@ class validInt(object):
                        return ERROR, '"' + str(self.setting.getValue()) + '" is not a valid whole number or expression'
 
 class warningAbove(object):
+       """
+       A validator to give off a warning if a value is equal or above a certain value.
+       """
        def __init__(self, setting, minValueForWarning, warningMessage):
                self.setting = setting
                self.setting._validators.append(self)
@@ -75,6 +88,9 @@ class warningAbove(object):
                        return SUCCESS, ''
 
 class warningBelow(object):
+       """
+       A validator to give off a warning if a value is equal or below a certain value.
+       """
        def __init__(self, setting, minValueForWarning, warningMessage):
                self.setting = setting
                self.setting._validators.append(self)
@@ -96,6 +112,11 @@ class warningBelow(object):
                        return SUCCESS, ''
 
 class wallThicknessValidator(object):
+       """
+       Special wall-thickness validator. The wall thickness is used to calculate the amount of shells and the thickness of the shells.
+       But, on certain conditions the resulting wall-thickness is not really suitable for printing. The range in which this can happen is small.
+       But better warn for it.
+       """
        def __init__(self, setting):
                self.setting = setting
                self.setting._validators.append(self)
@@ -127,6 +148,11 @@ class wallThicknessValidator(object):
                        return SUCCESS, ''
 
 class printSpeedValidator(object):
+       """
+       Validate the printing speed by checking for a certain amount of volume per second.
+       This is based on the fact that you can push 10mm3 per second trough an UM-Origonal nozzle.
+       TODO: Update this code so it works better for different machine times with other feeders.
+       """
        def __init__(self, setting):
                self.setting = setting
                self.setting._validators.append(self)
@@ -150,4 +176,3 @@ class printSpeedValidator(object):
                except ValueError:
                        #We already have an error by the int/float validator in this case.
                        return SUCCESS, ''
-