Convert matrix index to gcode

#39 Save GCode in file
Convert a list of index to gcode string in an array
This commit is contained in:
Marc-Antoine Lafreniere
2019-02-20 13:48:37 -05:00
parent ef8e908c33
commit 8aee76eee2
6 changed files with 86 additions and 58 deletions

View File

@@ -29,6 +29,13 @@ class FileUtils:
f.write('\n')
f.close()
@staticmethod
def saveStringListToFile(stringList, filePath):
with open(filePath, 'w') as f:
for line in stringList:
f.write('%s\n' % line)
f.close()
@staticmethod
def getPixelSize(matHeight, matWidth, pcbHeight, pcbWidth, unit = 'mm'):
if unit == 'mm':

View File

@@ -11,4 +11,11 @@ def readIntFile(filePath):
completeFile.append(tempArray)
return completeFile
return completeFile
def readStringFile(filePath):
file = open(filePath, 'r')
lines = file.readlines()
file.close()
return lines