Move serialised version number to top of GCode reader/writer

The version number is more clearly exposed there.

Contributes to issue CURA-34.
This commit is contained in:
Ghostkeeper 2015-12-16 15:05:30 +01:00
parent a12246781d
commit cfa4382052
2 changed files with 14 additions and 2 deletions

View file

@ -9,6 +9,13 @@ import re #For escaping characters in the settings.
class GCodeWriter(MeshWriter):
## The file format version of the serialised g-code.
#
# It can only read settings with the same version as the version it was
# written with. If the file format is changed in a way that breaks reverse
# compatibility, increment this version number!
version = 1
def __init__(self):
super().__init__()
@ -36,7 +43,6 @@ class GCodeWriter(MeshWriter):
# \param profile The profile to serialise.
# \return A serialised string of the profile.
def _serialiseProfile(self, profile):
version = 1 #IF YOU CHANGE THIS FUNCTION IN A WAY THAT BREAKS REVERSE COMPATIBILITY, INCREMENT THIS VERSION NUMBER!
prefix = ";SETTING_" + str(version) + " " #The prefix to put before each line.
serialised = profile.serialise()