Rename modules
Rename modules with better name and move the arduino code to its own folder
This commit is contained in:
@@ -4,7 +4,7 @@ from tkinter.filedialog import askdirectory, askopenfilename, asksaveasfilename
|
||||
from tkinter.ttk import Combobox
|
||||
import subprocess
|
||||
|
||||
from pcbdevice.main import main
|
||||
from gcodeextractor.main import main
|
||||
|
||||
root = Tk()
|
||||
frame = Frame(root)
|
||||
@@ -1,4 +1,4 @@
|
||||
from pcbdevice.models.Coordinates import Coordinate
|
||||
from gcodeextractor.models.Coordinates import Coordinate
|
||||
|
||||
|
||||
def findEndOfLine(image, direction, line, column, sequence):
|
||||
@@ -1,22 +1,22 @@
|
||||
import math
|
||||
|
||||
from pcbdevice.gcode.GcodeBuilder import listToGCode
|
||||
from gcodeextractor.gcode.GcodeBuilder import listToGCode
|
||||
|
||||
from pcbdevice.gcode.GcodeCreator import createSequence
|
||||
from pcbdevice.gcode.path import path
|
||||
from pcbdevice.utils.FileUtils import FileUtils
|
||||
from gcodeextractor.gcode.GcodeCreator import createSequence
|
||||
from gcodeextractor.gcode.path import path
|
||||
from gcodeextractor.utils.FileUtils import FileUtils
|
||||
import argparse
|
||||
import subprocess
|
||||
|
||||
def main(inputPath, outputPath, isAscii, heightReal, widthReal, tool, unit):
|
||||
converterPath = '.\\pcbdevice\\utils\\convertiseur.exe'
|
||||
converterPath = '.\\gcodeextractor\\utils\\convertiseur.exe'
|
||||
|
||||
if outputPath.rfind('\\') != -1:
|
||||
asciiPbmPath = outputPath[0:outputPath.rfind('\\')] + '\\pcbImageAscii.pbm'
|
||||
elif outputPath.rfind('/') != -1:
|
||||
asciiPbmPath = outputPath[0:outputPath.rfind('/')] + '/pcbImageAscii.pbm'
|
||||
else:
|
||||
asciiPbmPath = '.\\pcbdevice\\resources\\output\\pcbImageAscii.pbm'
|
||||
asciiPbmPath = '.\\gcodeextractor\\resources\\output\\pcbImageAscii.pbm'
|
||||
|
||||
if not isAscii:
|
||||
subprocess.check_call([converterPath, inputPath, asciiPbmPath])
|
||||
@@ -1,7 +1,7 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from pcbdevice.gcode.GcodeCreator import createSequence, findDirection, findEndOfLine
|
||||
from pcbdevice.models.Coordinates import Coordinate
|
||||
from gcodeextractor.gcode.GcodeCreator import createSequence, findDirection, findEndOfLine
|
||||
from gcodeextractor.models.Coordinates import Coordinate
|
||||
|
||||
|
||||
class TestGcodeCreator(TestCase):
|
||||
@@ -1,7 +1,7 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from pcbdevice.gcode.GcodeBuilder import listToGCode
|
||||
from pcbdevice.models.Coordinates import Coordinate
|
||||
from gcodeextractor.gcode.GcodeBuilder import listToGCode
|
||||
from gcodeextractor.models.Coordinates import Coordinate
|
||||
|
||||
|
||||
class TestListToGCode(TestCase):
|
||||
@@ -1,6 +1,6 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from pcbdevice.gcode.path import scanHorizontal, scanVertical, twoRemoving
|
||||
from gcodeextractor.gcode.path import scanHorizontal, scanVertical, twoRemoving
|
||||
|
||||
|
||||
class TestPath(TestCase):
|
||||
|
Can't render this file because it is too large.
|
|
Can't render this file because it is too large.
|
|
Can't render this file because it is too large.
|
|
Can't render this file because it is too large.
|
|
Can't render this file because it is too large.
|
|
Can't render this file because it is too large.
|
5
gcodeextractor/tests/resources/output/text1.txt
Normal file
5
gcodeextractor/tests/resources/output/text1.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
This
|
||||
is
|
||||
a
|
||||
|
||||
test
|
||||
5
gcodeextractor/tests/resources/output/text2.txt
Normal file
5
gcodeextractor/tests/resources/output/text2.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
G28
|
||||
G90
|
||||
G0 Z3
|
||||
|
||||
G0 X15 Y45
|
||||
@@ -1,10 +1,10 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from pcbdevice.utils import TestUtils
|
||||
from pcbdevice.utils.FileUtils import FileUtils
|
||||
from pcbdevice.utils.TestUtils import readStringFile
|
||||
from gcodeextractor.utils import TestUtils
|
||||
from gcodeextractor.utils.FileUtils import FileUtils
|
||||
from gcodeextractor.utils.TestUtils import readStringFile
|
||||
|
||||
resources = './pcbdevice/tests/resources/'
|
||||
resources = './gcodeextractor/tests/resources/'
|
||||
|
||||
class TestFileUtils(TestCase):
|
||||
def test_pbmToMatrix(self):
|
||||
Reference in New Issue
Block a user