Squashed commit of the following:

commit cd6688be26
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Thu May 12 15:13:23 2016 +0200

    Removed previousE

commit 413655f705
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Thu May 12 12:36:54 2016 +0200

    Changed to detect in case of two extruders

commit b0cfa28eaf
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Mon Apr 11 18:11:54 2016 +0200

    Identation issues solved and code improved

commit 95b6eba2ad
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Mon Apr 4 18:48:47 2016 +0200

    Changed message shown to user using sprintf and improved 'if' checks

commit 3baf9d7fc0
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Tue Mar 8 17:46:40 2016 +0000

    Analysis now done in frontend, taking also into account centre origin

commit e742e74475
Author: Javier Martínez Arrieta <martinezarrietajavier@gmail.com>
Date:   Sat Mar 5 21:37:02 2016 +0100

    Update analysis.py

commit 29a821c2f4
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Mon Feb 29 19:11:59 2016 +0000

    Removed unrelated folders and files for pull request

commit 0edbcf3d3c
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Sat Feb 27 10:54:47 2016 +0000

    Completed requirements and solutions for Slic3r integration and added requirements for scheduled printing

commit a92b7e3ade
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Mon Feb 22 11:06:22 2016 +0000

    Changed requirements and solution file for Slic3r integration

commit 201b5723d9
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Thu Feb 18 12:15:54 2016 +0000

    Solved problem with character '}' at static/js/viewmodels/file.js

commit d89319c2a5
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Wed Feb 17 21:04:44 2016 +0000

    Completed requirementes to add Slic3r as a plugin

commit 9e07a3b7c0
Merge: caf4e84 6945394
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Wed Feb 17 10:03:56 2016 +0000

    Added functionality to warn in case object exceeds printing area

commit caf4e84ab2
Author: Javierma87 <javier.martinez.arrieta@alumnos.upm.es>
Date:   Thu Feb 11 18:32:36 2016 +0000

    Added docs-tfg and implemented functionality of warning in case object is bigger than printer area
This commit is contained in:
Javier Martínez Arrieta authored and Gina Häußge committed 2016-05-12 15:41:12 +02:00
1 parent 2074aae940
commit 92279fb3a0
3 files changed
+103 -4

No files matched your search

+14 -2
View File
@@ -21,7 +21,6 @@ class AnalysisAborted(Exception):
class gcode(object):
def __init__(self):
self._logger = logging.getLogger(__name__)
self.layerList = None
self.extrusionAmount = [0]
self.extrusionVolume = [0]
@@ -30,6 +29,13 @@ class gcode(object):
self.progressCallback = None
self._abort = False
self._filamentDiameter = 0
#Parameters for object size check
self.minX=None
self.minY=None
self.minZ=None
self.maxX=None
self.maxY=None
self.maxZ=None
def load(self, filename, printer_profile, throttle=None):
if os.path.isfile(filename):
@@ -143,7 +149,14 @@ class gcode(object):
if e is not None:
if absoluteE:
e -= currentE[currentExtruder]
# If move includes extrusion, calculate new min/max coordinates of model
if e > 0.0:
self.minX = pos[0] if self.minX is None or pos[0] < self.minX else self.minX
self.maxX = pos[0] if self.maxX is None or pos[0] > self.maxX else self.maxX
self.minY = pos[1] if self.minY is None or pos[1] < self.minY else self.minY
self.maxY = pos[1] if self.maxY is None or pos[1] > self.maxY else self.maxY
self.minZ = pos[2] if self.minZ is None or pos[2] < self.minZ else self.minZ
self.maxZ = pos[2] if self.maxZ is None or pos[2] > self.maxZ else self.maxZ
moveType = 'extrude'
if e < 0.0:
moveType = 'retract'
@@ -271,7 +284,6 @@ class gcode(object):
def _parseCuraProfileString(self, comment, prefix):
return {key: value for (key, value) in map(lambda x: x.split("=", 1), zlib.decompress(base64.b64decode(comment[len(prefix):])).split("\b"))}
def getCodeInt(line, code):
n = line.find(code) + 1
if n < 1: