diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c943194 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# specific to knitting machine source +img +img.start +docs +test-data + +# binary files +*.bmp +*.xcf +*.png +*.dat + +# python files +*.pyc \ No newline at end of file diff --git a/Changelog b/Changelog index 9d79ead..e9bc0d7 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,7 @@ ====================================================================== +Nov 29, 2013 +Added new graphical interface. +Added new algorithm for reading patterns based in pointers (should work with most brother machines) Feb 19, 2012 Renamed PDDemulate-1.0.py to PDDemulate.py, and put the version number in the script. Print version number on script start diff --git a/PDDemu-debug.py b/PDDemu-debug.py old mode 100755 new mode 100644 diff --git a/PDDemulate.py b/PDDemulate.py old mode 100755 new mode 100644 index 2f9cf0a..f5293eb --- a/PDDemulate.py +++ b/PDDemulate.py @@ -193,10 +193,17 @@ def dumpId(self): print class Disk(): + """ + Fields: + self.lastDatFilePath : string + """ + def __init__(self, basename): self.numSectors = 80 self.Sectors = [] self.filespath = "" + "" + self.lastDatFilePath = None # Set up disk Files and internal buffers # if absolute path, just accept it @@ -261,6 +268,7 @@ def writeSector(self, psn, lsn, indata): outfn = os.path.join(self.filespath, filename) cmd = 'cat %s %s > %s' % (fn1, fn2, outfn) os.system(cmd) + self.lastDatFilePath = outfn return def readSector(self, psn, lsn): @@ -269,6 +277,7 @@ def readSector(self, psn, lsn): class PDDemulator(): def __init__(self, basename): + self.listeners = [] # list of PDDEmulatorListener self.verbose = True self.noserial = False self.ser = None @@ -285,6 +294,7 @@ def __del__(self): def open(self, cport='/dev/ttyUSB0'): if self.noserial is False: self.ser = serial.Serial(port=cport, baudrate=9600, parity='N', stopbits=1, timeout=1, xonxoff=0, rtscts=0, dsrdtr=0) +# self.ser.setRTS(True) if self.ser == None: print 'Unable to open serial device %s' % cport raise IOError @@ -377,20 +387,26 @@ def readOpmodeRequest(self, req): def handleRequests(self): synced = False while True: - inc = self.readchar() - if self.FDCmode: - self.handleFDCmodeRequest(inc) - else: - # in OpMode, look for ZZ - #inc = self.readchar() - if inc != 'Z': - continue - inc = self.readchar() - if inc == 'Z': - self.handleOpModeRequest() + self.handleRequest() # never returns return + def handleRequest(self, blocking = True): + if not blocking: + if self.ser.inWaiting() == 0: + return + inc = self.readchar() + if self.FDCmode: + self.handleFDCmodeRequest(inc) + else: + # in OpMode, look for ZZ + #inc = self.readchar() + if inc != 'Z': + return + inc = self.readchar() + if inc == 'Z': + self.handleOpModeRequest() + def handleOpModeRequest(self): req = ord(self.ser.read()) print 'Request: 0X%02X' % req @@ -601,6 +617,9 @@ def handleFDCmodeRequest(self, cmd): indata = self.readsomechars(1024) try: self.disk.writeSector(psn, lsn, indata) + for l in self.listeners: + l.dataReceived(self.disk.lastDatFilePath) + print 'Saved data in dat file: ', self.disk.lastDatFilePath except: print 'Failed to write data for sector %d, quitting' % psn self.writebytes('80000000') @@ -614,23 +633,28 @@ def handleFDCmodeRequest(self, cmd): # return to Operational Mode return +class PDDEmulatorListener: + def dataReceived(self, fullFilePath): + pass + # meat and potatos here -if len(sys.argv) < 3: - print '%s version %s' % (sys.argv[0], version) - print 'Usage: %s basedir serialdevice' % sys.argv[0] - sys.exit() +if __name__ == "__main__": + if len(sys.argv) < 3: + print '%s version %s' % (sys.argv[0], version) + print 'Usage: %s basedir serialdevice' % sys.argv[0] + sys.exit() -print 'Preparing . . . Please Wait' -emu = PDDemulator(sys.argv[1]) + print 'Preparing . . . Please Wait' + emu = PDDemulator(sys.argv[1]) -emu.open(cport=sys.argv[2]) + emu.open(cport=sys.argv[2]) -print 'PDDtmulate Version 1.1 Ready!' -try: - while 1: - emu.handleRequests() -except (KeyboardInterrupt): - pass + print 'PDDtmulate Version 1.1 Ready!' + try: + while 1: + emu.handleRequests() + except (KeyboardInterrupt): + pass -emu.close() + emu.close() diff --git a/README b/README index d523fce..c6599cc 100644 --- a/README +++ b/README @@ -1,5 +1,13 @@ Please see the Changelog file for the latest changes +=== QUICK START === + +Execute script guimain.py to start graphical application. +This application can start floppy disk emulator and provides means to download/upload patterns and modify them. +It is based on existing python scripts, which were slightly modified for better user experience in graphical application. + +================= + These files are related to the Brother KH-930E knitting machine, and other similar models. === NOTE === diff --git a/adafabric.bmp b/adafabric.bmp deleted file mode 100644 index 519bb00..0000000 Binary files a/adafabric.bmp and /dev/null differ diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/gui/Gui.py b/app/gui/Gui.py new file mode 100644 index 0000000..1c9a2c6 --- /dev/null +++ b/app/gui/Gui.py @@ -0,0 +1,141 @@ +import Tkinter + +class Gui: + def initializeMainWindow(self,w): + self.initMainWindow(w) + + self._maxColumns = 1000 + self._maxRows = 1000 + self._row = 0 + self.createDeviceWidgets() + self.createEmulatorButton() + + self._row += 1 + self.createDatFileWidgets() + + self._row += 1 + self.createPatternsPanel() + + self._row += 1 + self.createInfoMessagesLabel() + + def initMainWindow(self, mainWindow): + self.mainWindow = mainWindow + self.mainWindow.title('Knitting pattern uploader') + self.mainWindow.geometry("600x400") + self.mainWindow.grid() + self.mainWindow.grid_columnconfigure(1,weight=10) + self.mainWindow.grid_columnconfigure(2,weight=1) + self.mainWindow.resizable(True,True) + + def createDeviceWidgets(self): + label = Tkinter.Label(self.mainWindow, text=u"Device path (port):") + label.grid(column=0, row=self._row, sticky='W') + + entryText = Tkinter.StringVar() + self.mainWindow.deviceEntry = Tkinter.Entry(self.mainWindow, textvariable=entryText) + self.mainWindow.deviceEntry.grid(column=1,row=self._row,sticky='EW') + self.mainWindow.deviceEntry.entryText = entryText + + def createEmulatorButton(self): + caption = Tkinter.StringVar() + self.emuButton = Tkinter.Button(self.mainWindow, textvariable = caption, command = self.mainWindow.emuButtonClicked) + self.emuButton.caption = caption + self.emuButton.grid(column=2,row=self._row, columnspan=2, sticky='EW') + self.setEmuButtonStopped() + + but = Tkinter.Button(self.mainWindow, text = u'Help...', command = self.mainWindow.helpButtonClicked) + but.grid(column=4,row=self._row, sticky='E') + + def createDatFileWidgets(self): + label = Tkinter.Label(self.mainWindow, text=u"Dat file:") + label.grid(column=0, row=self._row, sticky='W') + + entryText = Tkinter.StringVar() + self.mainWindow.datFileEntry = Tkinter.Entry(self.mainWindow, textvariable=entryText) + self.mainWindow.datFileEntry.grid(column=1,row=self._row,sticky='EW') + self.mainWindow.datFileEntry.entryText = entryText + + self.chooseDatFileButton = Tkinter.Button(self.mainWindow, text=u"...", command = self.mainWindow.chooseDatFileButtonClicked) + self.chooseDatFileButton.grid(column=2,row=self._row,sticky='W') + + self.reloadDatFileButton = Tkinter.Button(self.mainWindow, text=u"Reload file", command = self.mainWindow.reloadDatFileButtonClicked) + self.reloadDatFileButton.grid(column=3,row=self._row,sticky='EW') + + but = Tkinter.Button(self.mainWindow, text=u"Store track", command = self.mainWindow.storeTrackButtonClicked) + but.grid(column=4,row=self._row,sticky='EW') + self.storeTrackButton = but + + def createInfoMessagesLabel(self): + labelText = Tkinter.StringVar() + label = Tkinter.Label(self.mainWindow, anchor="w",fg="white",bg="blue",textvariable=labelText) + label.grid(column=0,row=self._row,columnspan=self._maxColumns,sticky='EW') + label.caption = labelText + self.mainWindow.infoLabel = label + + def createPatternsPanel(self): + patternFrame = Tkinter.Frame(self.mainWindow) + patternFrame.grid(column=0, row=self._row, columnspan = self._maxColumns,sticky='EWNS') + self.mainWindow.grid_rowconfigure(self._row,weight=1) + patternFrame.grid_columnconfigure(0,weight=0) + patternFrame.grid_columnconfigure(1,weight=1) + patternFrame.grid_rowconfigure(1,weight=1) + + listboxFrame = Tkinter.Frame(patternFrame) + listboxFrame.grid(column=0, row=0, sticky='EWNS', rowspan=self._maxRows) + scrollbar = Tkinter.Scrollbar(listboxFrame, orient=Tkinter.VERTICAL) + listvar = Tkinter.StringVar() + lb = Tkinter.Listbox(listboxFrame, listvariable=listvar, exportselection=0, width=40, yscrollcommand=scrollbar.set) + scrollbar.config(command=lb.yview) + lb.items = ListboxVar(lb, listvar) + scrollbar.pack(side=Tkinter.RIGHT, fill=Tkinter.Y) + lb.pack(side=Tkinter.LEFT, fill=Tkinter.BOTH, expand=1) + self.mainWindow.patternListBox = lb; + + textvar = Tkinter.StringVar() + label = Tkinter.Label(patternFrame, anchor="w", textvariable = textvar) + label.grid(column=1, row=0, sticky='EW') + label.caption = textvar + self.mainWindow.patternTitle = label + + self.insertBitmapButton = Tkinter.Button(patternFrame, text=u"Insert bitmap...", command = self.mainWindow.insertBitmapButtonClicked) + self.insertBitmapButton.grid(column=2,row=0,sticky='EW') + + self.exportBitmapButton = Tkinter.Button(patternFrame, text=u"Export bitmap...", command = self.mainWindow.exportBitmapButtonClicked) + self.exportBitmapButton.grid(column=3,row=0,sticky='EW') + + pc = ExtendedCanvas(patternFrame, bg='white') + pc.grid(column=1, row=1, sticky='EWNS', columnspan=3) + self.mainWindow.patternCanvas = pc + + def setEmuButtonStopped(self): + b = self.emuButton + b.caption.set(u"Start emulator...") + + def setEmuButtonStarted(self): + b = self.emuButton + b.caption.set(u"...stop emulator") + +class ExtendedCanvas(Tkinter.Canvas): + + def getWidth(self): + w = self.winfo_width() + return w + + def getHeight(self): + h = self.winfo_height() + return h + + def clear(self): + maxsize = 10000 + self.create_rectangle(0,0,maxsize, maxsize, width=0, fill=self.cget('bg')) + +class ListboxVar: + def __init__(self, listbox, stringvar): + self._stringvar = stringvar + self._listbox = listbox + + def set(self, list): + self._listbox.delete(0, Tkinter.END) + for item in list: + self._listbox.insert(Tkinter.END, item) diff --git a/app/gui/__init__.py b/app/gui/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/tkapp/Config.py b/app/tkapp/Config.py new file mode 100644 index 0000000..be53d43 --- /dev/null +++ b/app/tkapp/Config.py @@ -0,0 +1,12 @@ +import os + +class Config: + def __init__(self): + self.imgdir = "img"; + if os.sys.platform == 'win32': + self.device = "com34" +# self.datFile = 'C:/Documents and Settings/ondro/VirtualBox shared folder/knitting/knitting_machine-master/img/zaloha vzory stroj python.dat' + self.datFile = 'C:/Documents and Settings/ondro/VirtualBox shared folder/knitting/knitting_machine-master/file-06.dat' + self.simulateEmulator = True + else: + self.device = "/dev/ttyUSB0" \ No newline at end of file diff --git a/app/tkapp/KnittingApp.py b/app/tkapp/KnittingApp.py new file mode 100644 index 0000000..b63b801 --- /dev/null +++ b/app/tkapp/KnittingApp.py @@ -0,0 +1,368 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +from Config import Config +from Messages import Messages +from app.gui.Gui import Gui +from PDDemulate import PDDemulator +from PDDemulate import PDDEmulatorListener +from dumppattern import PatternDumper +from insertpattern import PatternInserter +import Tkinter +import tkFileDialog +import os +import os.path +import Image +import itertools + +class KnittingApp(Tkinter.Tk): + + def __init__(self,parent=None): + Tkinter.Tk.__init__(self,parent) + self.parent = parent + self.initialize() + #self.startEmulator() + + def initialize(self): + self.msg = Messages(self) + self.patterns = [] + self.pattern = None + self.currentDatFile = None + + self.initConfig() + self.initializeUtilities() + + self.gui = Gui() + self.gui.initializeMainWindow(self) + self.updatePatternCanvasLastSize() + self.patternListBox.bind('<>', self.patternSelected) + self.after_idle(self.canvasConfigured) + self.deviceEntry.entryText.set(self.getConfig().device) + self.datFileEntry.entryText.set(self.getConfig().datFile) + + self.initEmulator() + self.after_idle(self.reloadPatternFile) + + def initializeUtilities(self): + self.patternDumper = PatternDumper() + self.patternDumper.printInfoCallback = self.msg.showInfo + self.patternInserter = PatternInserter() + self.patternInserter.printInfoCallback = self.msg.showInfo + self.patternInserter.printErrorCallback = self.msg.showError + + def initEmulator(self): + self.emu = PDDemulator(self.getConfig().imgdir) + self.emu.listeners.append(PDDListener(self)) + #self.emu = lambda: 1 + self.setEmulatorStarted(False) + + def emuButtonClicked(self): + self.getConfig().device = self.deviceEntry.entryText.get() + if self.emu.started: + self.stopEmulator() + else: + self.startEmulator() + + def startEmulator(self): + self.msg.showInfo('Preparing emulator. . . Please Wait') + + if self.getConfig().simulateEmulator: + self.msg.showInfo('Simulating emulator, emulator is not started...') + self.setEmulatorStarted(True) + else: + try: + port = self.getConfig().device + self.emu.open(cport=port) + self.msg.showInfo('PDDemulate Version 1.1 Ready!') + self.setEmulatorStarted(True) + self.after_idle(self.emulatorLoop) + except Exception, e: + self.msg.showError('Ensure that TFDI cable is connected to port ' + port + '\n\nError: ' + str(e)) + self.setEmulatorStarted(False) + + def emulatorLoop(self): + if self.emu.started: + self.emu.handleRequest(False) + # repeated call to after_idle() caused all window dialogs to hang out application, using after() each 10 milliseconds + self.after(100,self.emulatorLoop) + + def stopEmulator(self): + if self.emu is not None: + self.emu.close() + self.msg.showInfo('PDDemulate stopped.') + self.setEmulatorStarted(False) + self.initEmulator() + + def quitApplication(self): + self.stopEmulator() + self.after_idle(self.quit) + + def setEmulatorStarted(self, started): + self.emu.started = started + if started: + self.gui.setEmuButtonStarted() + else: + self.gui.setEmuButtonStopped() + + def getConfig(self): + return self.config + + def initConfig(self): + cfg = Config() + if not hasattr(cfg, "device"): + cfg.device = u"" + if not hasattr(cfg, "datFile"): + cfg.datFile = u"" + if not hasattr(cfg, "simulateEmulator"): + cfg.simulateEmulator = False + self.config = cfg + + def reloadPatternFile(self, pathToFile = None): + if not pathToFile: + pathToFile = self.datFileEntry.entryText.get() + else: + self.datFileEntry.entryText.set(pathToFile) + + if not pathToFile: + return + self.currentDatFile = pathToFile + try: + result = self.patternDumper.dumppattern([pathToFile]) + self.patterns = result.patterns + listBoxModel = [] + for p in self.patterns: + listBoxModel.append(self.getPatternTitle(p)) + selectedIndex = self.getSelectedPatternIndex() + self.patternListBox.items.set(listBoxModel) + self.setSelectedPatternIndex(selectedIndex) + except IOError as e: + self.msg.showError('Could not open pattern file %s' % pathToFile + '\n' + str(e)) + + def storeTrack(self, pathToFile = None): + if not pathToFile: + pathToFile = self.datFileEntry.entryText.get() + self.msg.showInfo('Storing tracks for file ' + pathToFile) + trackFile1, trackFile2 = "00.dat", "01.dat" + trackPath1 = os.path.join(self.config.imgdir, trackFile1) + trackPath2 = os.path.join(self.config.imgdir, trackFile2) + trackSize = 1024 + + startEmu = self.emu.started + if startEmu: + self.stopEmulator() + + infile = track0file = track1file = None + + infile = open(pathToFile, 'rb') + + try: + track0file = open(trackPath1, 'wb') + track1file = open(trackPath2, 'wb') + + t0dat = infile.read(trackSize) + t1dat = infile.read(trackSize) + + track0file.write(t0dat) + track1file.write(t1dat) + self.msg.showInfo('Stored file to tracks ' + trackFile1 + ' and ' + trackFile2 + ' in ' + self.config.imgdir) + except Exception as e: + self.msg.showError(str(e)) + finally: + if infile: + self.msg.showDebug("Closing infile...") + infile.close + if track0file: + self.msg.showDebug("Closing track0file...") + track0file.close() + if track1file: + self.msg.showDebug("Closing track1file...") + track1file.close() + if startEmu: + self.startEmulator() + + def helpButtonClicked(self): + helpMsg = '''Commands to execute on Knitting machine: + +552: Download patterns from machine to computer +551: Upload patterns from computer to machine + - before this, make sure that you stored file to track + - afterfards pressing 551, press 1 to load track with inserted patterns +''' + self.msg.showMoreInfo(helpMsg) + + def reloadDatFileButtonClicked(self): + self.reloadPatternFile() + + def storeTrackButtonClicked(self): + self.storeTrack() + + def chooseDatFileButtonClicked(self): + filePath = tkFileDialog.askopenfilename(filetypes=[('DAT file', '*.dat')], initialfile=self.datFileEntry.entryText.get(), + title='Choose dat file with patterns...') + if len(filePath) > 0: + self.msg.showInfo('Opened dat file ' + filePath) + self.reloadPatternFile(filePath) + + def patternSelected(self, evt): + w = evt.widget + index = self.getSelectedPatternIndex() + if index is not None: + pattern = self.patterns[index] + else: + pattern = None + self.displayPattern(pattern) + + def getSelectedPatternIndex(self): + sel = self.patternListBox.curselection() + if len(sel) > 0: + return int(sel[0]) + else: + return None + + def setSelectedPatternIndex(self, index): + lb = self.patternListBox + if index is None: + index = 0 + if lb.size() == 0: + self.displayPattern(None) + return + if index > lb.size(): + index = 0 + self.patternListBox.selection_set(index) + self.displayPattern(self.patterns[index]) + + def displayPattern(self, pattern=None): + if not pattern: + pattern = self.pattern + self.patternCanvas.clear() + self.patternTitle.caption.set(self.getPatternTitle(pattern)) + if pattern: + result = self.patternDumper.dumppattern([self.currentDatFile, str(pattern['number'])]) + self.printPatternOnCanvas(result.pattern) + self.pattern = pattern + + def getPatternTitle(self, pattern): + p = pattern + if p: + return 'Pattern no: ' + str(p['number']) + " (rows x stitches: " + str(p["rows"]) + " x " + str(p["stitches"]) + ")" + else: + return 'No pattern' + + def printPatternOnCanvas(self, pattern): +# pattern = [] +# for x in range(8): +# row = [] +# for y in range(13): +# row.append((y % 2 + x % 2) % 2) +# pattern.append(row) + patternHeight = len(pattern) + patternWidth = len(pattern[0]) + marginx, marginy = 10, 10 + bitWidth = (self.patternCanvas.getWidth() - marginx) / (patternWidth); + bitHeight = (self.patternCanvas.getHeight() - marginy)/ (patternHeight); + bitWidth = min(bitWidth, bitHeight) + bitHeight = bitWidth + self._printPatternBody(pattern, marginx, marginy, bitWidth, bitHeight) + secCoordbig, secCoordsmall, secCoord2 = 0, marginy / 2, marginy + step, bigStep = 5, 10 + for i in xrange(0, max(patternWidth, patternHeight)+1, step): + secCoord = secCoordbig if i % bigStep == 0 else secCoordsmall + if i < patternWidth: + xCoord = marginx + i * bitWidth + self.patternCanvas.create_line(xCoord, secCoord, xCoord, secCoord2) + if i < patternHeight: + yCoord = marginx + i * bitHeight + self.patternCanvas.create_line(secCoord, yCoord, secCoord2, yCoord) + + def _printPatternBody(self, pattern, patternPosx, patternPosy, bitWidth, bitHeight): + patternHeight = len(pattern) + patternWidth = len(pattern[0]) + self.patternCanvas.clear() + for row in xrange(patternHeight): + for stitch in xrange(patternWidth): + if (pattern[row][stitch]) == 1: + fill='black' + border='white' + #border=fill + else: + fill='white' + border='black' + #border=fill + row = patternHeight - row - 1 + #stitch = patternWidth - stitch - 1 + self.patternCanvas.create_rectangle(patternPosx + stitch * bitWidth, patternPosy + row * bitHeight, + patternPosx + (stitch+1) * bitWidth, patternPosy + (row+1) * bitHeight, width=1, fill=fill, outline=border) + # pattern border + self.patternCanvas.create_rectangle(patternPosx, patternPosy, + patternPosx + (patternWidth) * bitWidth, patternPosy + (patternHeight) * bitHeight, width=1, outline='black') + + + + def updatePatternCanvasLastSize(self): + self.patternCanvas.lastWidth = self.patternCanvas.getWidth() + self.patternCanvas.lastHeight = self.patternCanvas.getHeight() + + def canvasConfigured(self): + if self.patternCanvas.lastWidth != self.patternCanvas.getWidth() or self.patternCanvas.lastHeight != self.patternCanvas.getHeight(): + self.msg.displayMessages = False + self.updatePatternCanvasLastSize() + self.displayPattern() + self.msg.displayMessages = True + self.after(100, self.canvasConfigured) + + def insertBitmapButtonClicked(self): + sel = self.patternListBox.curselection() + if len(sel) == 0: + self.msg.showError('Target pattern for insertion must be selected!') + return + index = int(sel[0]) + pattern = self.patterns[index] + filePath = tkFileDialog.askopenfilename(filetypes=[('2-color Bitmap', '*.bmp')], + title='Choose bitmap file to insert...') + if len(filePath) > 0: + self.insertBitmap(filePath, pattern["number"]) + + def exportBitmapButtonClicked(self): + sel = self.patternListBox.curselection() + if len(sel) == 0: + self.msg.showError('Target pattern for saving must be selected!') + return + index = int(sel[0]) + pattern = self.patterns[index] + filePath = tkFileDialog.asksaveasfilename(filetypes=[('2-color Bitmap', '*.bmp')], + title='Save as a bitmap file...') + if len(filePath) > 0: + patternNumber = pattern['number'] + self.msg.showInfo('Saving pattern number %d as bmp file %s' % (patternNumber, filePath)) + result = self.patternDumper.dumppattern([self.currentDatFile, str(patternNumber)]) + pattern = result.pattern + patternHeight = len(pattern) + patternWidth = len(pattern[0]) + img = Image.new('RGB', (patternWidth, patternHeight), None) + for x in xrange(patternWidth): + for y in xrange(patternHeight): + color = (0,0,0) if pattern[patternHeight - y - 1][x] == 1 else (255,255,255) + img.putpixel((x,y), color) + img = img.convert('1') + img.save(filePath, 'BMP') + self.msg.showInfo('Saved pattern number %d as bmp file %s' % (patternNumber, filePath)) + + + def insertBitmap(self, bitmapFile, patternNumber): + self.msg.showInfo('Inserting dat file %s to pattern number %d' % (bitmapFile, patternNumber)) + oldBrotherFile = self.currentDatFile + self.patternInserter.insertPattern(oldBrotherFile, patternNumber, bitmapFile, oldBrotherFile) + self.reloadPatternFile() + +class PDDListener(PDDEmulatorListener): + + def __init__(self, app): + self.app = app + + def dataReceived(self, fullFilePath): + self.app.reloadPatternFile(fullFilePath) + + +if __name__ == "__main__": + app = KnittingApp() + app.mainloop() \ No newline at end of file diff --git a/app/tkapp/Messages.py b/app/tkapp/Messages.py new file mode 100644 index 0000000..2902cf3 --- /dev/null +++ b/app/tkapp/Messages.py @@ -0,0 +1,35 @@ +import tkMessageBox as mb +import sys + +class Messages: + def __init__(self, knittinApp): + self.app = knittinApp + self.displayMessages = True + self.debug = True + + def showError(self, msg): + if self.displayMessages: + self.clear() + sys.stderr.write('Error: ' + str(msg) + '\n') + mb.showerror('Error:', str(msg)) + + def showMoreInfo(self, msg): + if self.displayMessages: + self.clear() + print msg + mb.showinfo('Info:',str(msg)) + + def showInfo(self, msg): + if self.displayMessages: + self.clear() + print msg + self.app.infoLabel.caption.set('Info: ' + str(msg)) + + def showDebug(self, msg): + if self.debug: + print "DEBUG:", msg + + def clear(self): + if self.displayMessages: + self.app.infoLabel.caption.set('') + \ No newline at end of file diff --git a/app/tkapp/__init__.py b/app/tkapp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/brother.py b/brother.py old mode 100755 new mode 100644 index 2790532..86fcfa4 --- a/brother.py +++ b/brother.py @@ -23,9 +23,13 @@ #import os.path #import string from array import * +import ctypes __version__ = '1.0' +methodWithPointers = False +methodWithPointers = True # uncomment this to use new, more precise method of finding patterns in the dat file, based on kh940 format documentation from https://github.com/stg/knittington/blob/master/doc/kh940_format.txt (should work with all kh930 and kh940 models) + # Some file location constants initPatternOffset = 0x06DF # programmed patterns start here, grow down currentPatternAddr = 0x07EA # stored in MSN and following byte @@ -104,10 +108,18 @@ def __init__(self, fn): print 'Unable to open brother file <%s>' % fn raise try: - self.data = self.df.read(2048) + if methodWithPointers: + self.data = self.df.read(-1) + else: + self.data = self.df.read(2048) self.df.close() + if len(self.data) == 0: + raise Exception() except: - print 'Unable to read 2048 bytes from file <%s>' % fn + if methodWithPointers: + print 'Unable to read 2048 bytes from file <%s>' % fn + else: + print 'Unable to read data from file <%s>' % fn raise self.dfn = fn return @@ -168,7 +180,6 @@ def getRowData(self, pattOffset, stitches, rownumber): if stitches: row.append((nib & 0x08) >> 3) stitches = stitches - 1 - return row def getPatterns(self, patternNumber = None): @@ -211,20 +222,19 @@ def getPatterns(self, patternNumber = None): # we have this entry if self.verbose: print ' Pattern %3d: %3d Rows, %3d Stitches - ' % (patno, rows, stitches) - print 'Unk = %d, Unknown = 0x%02X (%d)' % (unk, unknown, unknown) if flag != 0: # valid entry + if methodWithPointers: + pptr = len(self.data) -1 - ((flag << 8) + unknown) memoff = pptr if self.verbose: - print "Memo #",patno, "offset ", hex(memoff) - patoff = pptr - bytesForMemo(rows) + print "Memo #",patno, "offset ", memoff + patoff = pptr - bytesForMemo(rows) if self.verbose: - print "Pattern #",patno, "offset ", hex(patoff) + print "Pattern #",patno, "offset ", patoff pptr = pptr - bytesPerPatternAndMemo(stitches, rows) if self.verbose: print "Ending offset ", hex(pptr) - # TODO figure out how to calculate pattern length - #pptr = pptr - something if patternNumber: if patternNumber == patno: patlist.append({'number':patno, 'stitches':stitches, 'rows':rows, 'memo':memoff, 'pattern':patoff, 'pattend':pptr}) diff --git a/docs/README b/docs/README deleted file mode 100644 index db94c5d..0000000 --- a/docs/README +++ /dev/null @@ -1,3 +0,0 @@ -This is documentation for the brother knitting machine projects that I have been working on. -There are some copyrighted manuals included in here, but they are difficult to find and for -old and mostly obsolete equipment. I hope that no one minds. diff --git a/docs/file-data.txt b/docs/file-data.txt deleted file mode 100644 index e2ac0b1..0000000 --- a/docs/file-data.txt +++ /dev/null @@ -1,352 +0,0 @@ -# Copyright 2010 Steve Conklin -# steve at conklinhouse dot com -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*** UNKNOWNS -*** Where are number of rows and columns in current pattern stored, -*** for preprogrammed patterns -*** What effect does the 'M' button have? -*** What effect (if any) does detection of a G carriage have? - -*** TODO -Document changes to directory entries when programs added and deleted - -*** NOTES -*** Memory can be cleared by entering 888 (from service manual) -*** This work was greatly helped by prior work performed by John R. Hogerhuis and posted on the kminternals yahoo group. - --------------------------------------- -Beginning of file format documentation --------------------------------------- - -*** Note about the following section - -*** This data is BCD, and the data for each motif -*** are not byte-aligned. In this document, each -*** index into the file is listed twice - MSN first -*** then LSN - -format is: -0xnnnn: MSN -0xnnnn: LSN - -*** Here are up to 99 entries for each custom program that may be saved -*** These have program numbers 901-999 - -*** -*** Program memory can extend downward into the directory entry -*** Space - This seems to be able to cause problems for the knitter. -*** For example, if you add a first user program (number 901) of -*** 140 stitches x 96 rows, it will fill memory from 0x06DF down -*** to 0020. The next time you try to save a program, the knitting -*** machine hangs up. -*** - - -0x0000: pgm info FF if not used, 01 if used, maybe 00 if never used and FF if deleted -0x0001: unknown -0x0002: rows 100 -0x0002: rows 10 -0x0003: rows 1 -0x0003: stitches 100 -0x0004: stitches 10 -0x0004: stitches 1 -0x0005: unknown -0x0005: pgm number hundreds -0x0006: pgm number tens -0x0006: pgm number ones -*** -*** These previous seven bytes of pgm info data repeated up to 99 more times -*** - -------------------- [Snip] - -0x02B7: last byte of maximum pgm info entry 99 - End of pgm entries - -*** End of 99 custom program entries *** -*** -*** Custom programs grow downward in this space - -------------------- [Snip] - -*** Programs grow downward from here -*** -*** Program storage consists of the memo information for the program, -*** starting at the highest address and growing downward. Memo storage -*** is one nibble per row in the pattern, padded by one nibble for an -*** odd number of rows -*** Program rows of stitches are stored as a bitmap, stored from LSbit to MSbit, -*** LSnibble to MSnibble, and padded out to a complete nibble at the -*** end of each row. The entire program is padded out to the next -*** complete byte at the end. -*** -0x06DF: Beginning of first saved program (first memo entry) - -*** End of custom program storage - -0x06E0: when M pressed, changes to 0x81 (stays when M unset) -0x06E1: when M pressed, changes to 0x02 (stays when M unset) -0x06E2: -0x06E3: -0x06E4: -0x06E5: 1766 - -0x06E6: End (lowest address) of current row needle pattern -[Snip] *** Stored as a row of 200 stitches -0x06FF: Beginning (highest address) of current row needle pattern - -0x0700: On memory clear - init to 01 -0x0701: On memory clear - init to 20, changed to 40 once -0x0702: LSN is current row number hundreds -0x0703: Current Row Number within the pattern -0x0704: -0x0705: -0x0706: -0x0707: -0x0708: -0x0709: -0x070A: -0x070B: -0x070C: -0x070D: Variations selected and M button status -*** This byte has the following bit definitions: -*** -*** 0x01 // reverse -*** 0x02 // mirror horizontal -*** 0x08 // stretch horizontal -*** 0x10 // stretch vertical -*** 0x04 // invert horizontal -*** 0x20 // KHC -*** 0x40 // KRC -*** 0x80 // M button - -0x070E: Changes when we change the left end of pattern in Selection 1 - for pattern 39 when start=L7, is 0x81 - when start=L21, is 0x85 -0x070F: Carriage Moving to right == 2, Moving to left == 0, -0x0710: always 0x07 -0x0711: always 0xF9 -0x0712: -0x0713: -0x0714: -0x0715: Changes 0 to 01 when M set (stays when M unset) - -0x0716: End (lowest address) of next row needle pattern. changes 0 to 0x80 when M set, Stays when M unset. -[Snip] *** Stored as a row of 200 stitches -0x072F: Beginning (highest addrss) of next row needle pattern - -0x0730: Note (speculation) if memo ends here (growing down) then there is room for 300 rows of memo -0x0731: -0x0732: -0x0733: -0x0734: -0x0735: -0x0736: -0x0737: -0x0738: to 0x20 when M set (stays when M unset) -0x0739: -0x073A: to 0x20 when M set (stays when M unset) -0x073B: -0x073C: to 0x20 when M set (stays when M unset) -0x073D: -0x073E: to 0x20 when M set (stays when M unset) -0x073F: -0x0740: to 0x20 when M set (stays when M unset) -0x0741: -0x0742: to 0x20 when M set (stays when M unset) -0x0743: -0x0744: to 0x20 when M set (stays when M unset) -0x0745: -0x0746: -0x0747: to 0x20 when M set (stays when M unset) -0x0748: -0x0749: -0x074A: -0x074B: to 0x20 when M set (stays when M unset) -0x074C: -0x074D: to 0x20 when M set (stays when M unset) -0x074E: -0x074F: -0x0750: to 0x20 when M set (stays when M unset) -0x0751: -0x0752: to 0x20 when M set (stays when M unset) -0x0753: -0x0754: -0x0755: -0x0756: to 0x20 when M set (stays when M unset) -0x0757: -0x0758: -0x0759: -0x075A: to 0x20 when M set (stays when M unset) -0x075B: -0x075C: -0x075D: -0x075E: to 0x20 when M set (stays when M unset) -0x075F: -0x0760: -0x0761: -0x0762: to 0x20 when M set (stays when M unset) -0x0763: -0x0764: -0x0765: -0x0766: -0x0767: -0x0768: -0x0769: -0x076A: -0x076B: -0x076C: -0x076D: -0x076E: -0x076F: -0x0770: -0x0771: -0x0772: -0x0773: -0x0774: -0x0775: -0x0776: -0x0777: -0x0778: -0x0779: -0x077A: -0x077B: -0x077C: -0x077D: -0x077E: -0x077F: -0x0780: -0x0781: -0x0782: -0x0783: -0x0784: -0x0785: -0x0786: -0x0787: -*** Memo information may continue into lower addresses from here, -*** but the longest preprogrammed pattern I could find is #179 -*** which is 144 rows -0x0788: Last two rows of memo dat for program #179 -------------------- [Snip] *** Memo information -0x07CF: Beginning of memo info (lowest numbered two rows, right nibble is row 1) -0x07D0: -0x07D1: -0x07D2: -0x07D3: -0x07D4: to 0x20 when M set (stays when M unset) -0x07D5: to 0x20 when M set (stays when M unset) -0x07D6: -0x07D7: -0x07D8: -0x07D9: -0x07DA: -0x07DB: -0x07DC: -0x07DD: -0x07DE: -0x07DF: -0x07E0: -0x07E1: -0x07E2: -0x07E3: -0x07E4: -0x07E5: to 0x20 when M set (stays when M unset) -0x07E6: to 0x20 when M set (stays when M unset) -0x07E7: to 0x20 when M set (stays when M unset) -0x07E8: to 0x20 when M set (stays when M unset) -0x07E9: to 0x20 when M set (stays when M unset) - -*** Note about the following section - -*** This data is BCD, and the data for each motif -*** are not byte-aligned. In this document, each -*** index into the file is listed twice - MSN first -*** then LSN - -format is: -0xnnnn: MSN -0xnnnn: LSN - -0x07EA: Selector number - 1 for selector position one, 2 for selector position two -0x07EA: pattern number hundreds -0x07EB: pattern number tens -0x07EB: pattern number ones -0x07EC: unknown (unused?) nibble -0x07EC: Motif 6 position hundreds & 0x80 for RIGHT SIDE -0x07ED: Motif 6 position tens -0x07ED: Motif 6 position ones -0x07EE: Motif 6 # of copies hundreds -0x07EE: Motif 6 # of copies tens -0x07EF: Motif 6 # of copies ones -0x07EF: Motif 5 position hundreds & 0x80 for RIGHT SIDE -0x07F0: Motif 5 position tens -0x07F0: Motif 5 position ones -0x07F1: Motif 5 # of copies hundreds -0x07F1: Motif 5 # of copies tens -0x07F2: Motif 5 # of copies ones -0x07F2: Motif 4 position hundreds & 0x80 for RIGHT SIDE -0x07F3: Motif 4 position tens -0x07F3: Motif 4 position ones -0x07F4: Motif 4 # of copies hundreds -0x07F4: Motif 4 # of copies tens -0x07F5: Motif 4 # of copies ones -0x07F5: Motif 3 position hundreds & 0x80 for RIGHT SIDE -0x07F6: Motif 3 position tens -0x07F6: Motif 3 position ones -0x07F7: Motif 3 # of copies hundreds -0x07F7: Motif 3 # of copies tens -0x07F8: Motif 3 # of copies ones -0x07F8: Motif 2 position hundreds & 0x80 for RIGHT SIDE -0x07F9: Motif 2 position tens -0x07F9: Motif 2 position ones -0x07FA: Motif 2 # of copies hundreds -0x07FA: Motif 2 # of copies tens -0x07FB: Motif 2 # of copies ones -0x07FB: Motif 1 position hundreds & 0x80 for RIGHT SIDE -0x07FC: Motif 1 position tens -0x07FC: Motif 1 position ones -0x07FD: Motif 1 # of copies hundreds -0x07FD: Motif 1 # of copies tens -0x07FE: Motif 1 # of copies ones -0x07FE: Selector One position hundreds & 0x80 for RIGHT SIDE -0x07FF: Selector One position tens -0x07FF: Selector One position ones - -=================================================== -Individual locations not yet understood: - -070A and 070B - - -Not known what these values mean. - -Patt No Stitches Rows 070A 070B 070A 070B -17 24 24 0x21 0x48 33 72 -18 36 24 0x21 0xA7 33 167 -20 28 28 0x22 0xF8 34 248 -11 60 56 0x1E 0x6B 30 107 -14 55 82 0x1F 0x65 31 101 - -=================================================== -When code 888 is used to clear memory (per service manual) -(requires power cycle after) -This is what the saved file looks like: -00000000 00 00 00 00 00 09 01 00 00 00 00 00 00 00 00 00 |................| -00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| -* -00000700 01 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |. ..............| -00000710 07 f9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| -00000720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| -* -000007e0 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 |................| -000007f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| -00000800 diff --git a/docs/manuals/CD-30.Brother.KE100.motor.Service.pdf b/docs/manuals/CD-30.Brother.KE100.motor.Service.pdf deleted file mode 100755 index bb6c4ae..0000000 Binary files a/docs/manuals/CD-30.Brother.KE100.motor.Service.pdf and /dev/null differ diff --git a/docs/manuals/CD-31.KE100.PARTS.pdf b/docs/manuals/CD-31.KE100.PARTS.pdf deleted file mode 100755 index 5d4ba1f..0000000 Binary files a/docs/manuals/CD-31.KE100.PARTS.pdf and /dev/null differ diff --git a/docs/manuals/CD-47.Brother.KH930.Service.pdf b/docs/manuals/CD-47.Brother.KH930.Service.pdf deleted file mode 100755 index 595d9d4..0000000 Binary files a/docs/manuals/CD-47.Brother.KH930.Service.pdf and /dev/null differ diff --git a/docs/manuals/DS_TTL-232R_CABLES_V201-1.pdf b/docs/manuals/DS_TTL-232R_CABLES_V201-1.pdf deleted file mode 100644 index bfac117..0000000 Binary files a/docs/manuals/DS_TTL-232R_CABLES_V201-1.pdf and /dev/null differ diff --git a/docs/manuals/Portable_Disk_Drive_Command_Reference.pdf b/docs/manuals/Portable_Disk_Drive_Command_Reference.pdf deleted file mode 100644 index c318402..0000000 Binary files a/docs/manuals/Portable_Disk_Drive_Command_Reference.pdf and /dev/null differ diff --git a/docs/manuals/Portable_Disk_Drive_Operation_Manual.pdf b/docs/manuals/Portable_Disk_Drive_Operation_Manual.pdf deleted file mode 100644 index 0bcc782..0000000 Binary files a/docs/manuals/Portable_Disk_Drive_Operation_Manual.pdf and /dev/null differ diff --git a/docs/manuals/TD62084.pdf b/docs/manuals/TD62084.pdf deleted file mode 100644 index 14653ba..0000000 Binary files a/docs/manuals/TD62084.pdf and /dev/null differ diff --git a/docs/manuals/Tandy-Disk-Reference.pdf b/docs/manuals/Tandy-Disk-Reference.pdf deleted file mode 100644 index a8bc5c0..0000000 Binary files a/docs/manuals/Tandy-Disk-Reference.pdf and /dev/null differ diff --git a/docs/manuals/m100disksm.pdf b/docs/manuals/m100disksm.pdf deleted file mode 100644 index 02cfe80..0000000 Binary files a/docs/manuals/m100disksm.pdf and /dev/null differ diff --git a/docs/prior-works/PDD1-PDD2-differences.txt b/docs/prior-works/PDD1-PDD2-differences.txt deleted file mode 100644 index 1797389..0000000 --- a/docs/prior-works/PDD1-PDD2-differences.txt +++ /dev/null @@ -1,27 +0,0 @@ -On Sun, Feb 24, 2008 at 2:48 PM, M H Stein - wrote: -> Didn't at least one of the drives actually come from Brother's knitting -> machines? -> -> m - -Tandy licensed the TPDD-1 design from Brother. Brother's version is -the FB-100. Set for 9600baud, a Tandy TPDD-1 behaves identically to a -Brother FB-100. - -The FB-100 (and the TPDD-1) actually implements two protocols: the FDC -mode (sector based) and a File-based mode. TEENY, TS-DOS use the -file-based mode. So does the WP-2. The knitting machines and various -pattern editing computers for the same knitting machines use the FDC -mode. Note that they do not use the same kind of cable that we do (the -TPDD cables have electronics built in to do line level conversions -leeching power from the flow control lines). - -Now, the TPDD-2 does not implement the FDC mode. Instead it has only -the file-access protocol, with a couple of additional commands for -selecting tracks and raw read/write to disk sectors. The TPDD-2 could -therefore never be used with a Brother knitting machine unless you -replaced its ROM program. - --- John. - diff --git a/docs/prior-works/basic_pattern_format.txt b/docs/prior-works/basic_pattern_format.txt deleted file mode 100644 index d4f09d0..0000000 --- a/docs/prior-works/basic_pattern_format.txt +++ /dev/null @@ -1,71 +0,0 @@ -KH930 PPD/FDD pattern format - -There are many things saved in the two physical sectors written when a pattern -is saved. What I am describing at this point is limited to a single row of -pattern data. - -For this test I created a 200 stitch, one row pattern. A 200 stitch, one-row -pattern is 25 bytes of "on-off" data. It can be represented as a hexadecimal -string as follows: - -01 22 01 12 03 45 53 44 -53 67 88 67 78 69 AB B9 -AA B9 CD EE CD DE CF 01 -1F - -On the km display it looks like off-off-off-off-off-off-off-on- (01), etc., all -the way out to off-off-off-on-on-on-on-on at the end (1F). - -I entered this pattern in at the keypad and saved the pattern to the first -track of a floppy. Then I read this track information off of the disk and saved -it into a file. - -By comparing this file to one with another pattern in it, I was able to detect -the location of the pattern. For a one-row pattern, the pattern is repeated -twice, once starting at an offset of 0x06e6 and the second starting at an -offset of 0x0716. - -The data is as follows: - -f8 00 f3 80 b3 7b b3 77 -55 9d d5 9d 1e 96 11 e6 -ca e6 ca 22 c0 a2 80 48 -80 44 - -As you can see there is one "extra" byte of data here, which is due to -word-alignment. - -It turns out that by reversing the bit order of the saved pattern we get a lot -closer to the pattern I gave orignally: - -22 01 12 01 45 03 44 53 -67 53 67 88 69 78 b9 ab -b9 aa ee cd de cd 01 cf -00 1f - -To get the orginal pattern, just consider the pattern as an array of 16-bit -words, and swap the high and low bytes to get: - -01 22 01 12 03 45 53 44 -53 67 88 67 78 69 ab b9 -aa b9 cd ee cd de cf 01 -1f 00 - -Which is the same as the entered pattern, assuming we ignore the 00 tacked on -to the end to pad the last word. - -So, we can think of each pattern row as an array of 13 16-bit words, with the -rightmost stitches appearing at the start of the pattern, and the leftmost -stitches at the end. Within each 16-bit word, the rightmost stitches appear in -the low byte, and the leftmost stitches appear in the high byte. Within each -byte, the leftmost stitches appear in the low nibble, and the rightmost -stitches appear in the high nibble. Within each nibble, the stitches appear -with the least significant bit representing the leftmost stitch, and the most -significant bit representing the rightmost stitch. - --- John. - -Copyright (C) 2004 John R. Hogerhuis, All Rights Reserved. -This document is licensed under the -Creative Commons Attribution-ShareAlike License -http://creativecommons.org/licenses/by-sa/2.0/ diff --git a/docs/prior-works/cable_diagram.txt b/docs/prior-works/cable_diagram.txt deleted file mode 100644 index 16ebab4..0000000 --- a/docs/prior-works/cable_diagram.txt +++ /dev/null @@ -1,62 +0,0 @@ -Pinout for straight through PC to Brother FDD cable. - -Can also be used to connect a PC to a Brother 930 knitting machine, -but either a null modem adapter needs to be added in or the -TX and RX lines must be crossed when building this cable. - -As far as wiring, this should be equivalent to a DAK cable + null -modem adapter. However, there is a possibility there are some -electronics in the DAK cable, just like there is in the TRS-80 -TPDD-1 cable. - - - 1 1 1 1 - 1 2 3 4 5 6 7 8 9 0 1 2 3 -+-+-+-+-+ __________________________________________ -|1|2|3|4| \ o o o o o o o o o o o o o / -+-+-+-+-| \ / -|5|6|7|8| \ o o o o o o o o o o o o / -+-+-+-+-+ \__________________________________/ - |___| 1 1 1 1 1 1 2 2 2 2 2 2 - 4 5 6 7 8 9 0 1 2 3 4 5 - - -8-pin terminal connector - -Pins are numbered as if you were looking at exposed portion of -a connector at the ends of a Brother FB-100 floppy drive -cable. The DB-25 end is intended to hook to a PC (DTE). The 8-pin -end connects to a FB-100 wired as DCE. Keep in mind that a the km -is wired as DTE. If you want to connect a PC directly to a KM, -you'll need to cross for null modem (DTE<->DTE) or use an -off-the-shelf null modem. - -Connections: - -8-pin 25-pin ------ ------------ -1 N-C -2 3 -3 5 -4 4 -5 2 -7 6 -8 7 -N-C 1,8-19,21-25 - -If building your own, you may want to look up the RS232 specs on -the web and make the serial port end a DB-9. Most PCs and -USB<->RS232 adapters use DB-9 connectors, not DB-25. - -I have a working cable, so I have not tried to build one myself. -I'm interested in whether anyone has success with it. - -Please send questions/corrections/feedback and success/failure -stories to jhoger@pobox.com - --- John R. Hogerhuis, 11/30/04 - Copyright (C) 2004, All Rights Reserved. - -This document is licensed under the -Creative Commons Attribution-ShareAlike License -http://creativecommons.org/licenses/by-sa/2.0/ diff --git a/docs/prior-works/pdd-protocol.txt b/docs/prior-works/pdd-protocol.txt deleted file mode 100644 index 2981f3e..0000000 --- a/docs/prior-works/pdd-protocol.txt +++ /dev/null @@ -1,272 +0,0 @@ -This is by Paul Globman. - - -The following discussion will outline the communication -structure needed to address the PDD. I will discuss both -the FDC mode and the BROTHER mode. - - PACKET PROTOCOL - -BROTHER mode is the most commonly used PDD mode and requires -packet protocol. - -Every packet is structured exactly alike. The format of the -packet is as follows: - -+--+-+-+----------------------------+-+ -|2 |1|1| 0 to 128 |1| -+--+-+-+----------------------------+-+ - ^ ^ ^ block data ^ - | | |____ block data length | - | |______ block form | - |_________ preamble | - checksum_________________| - -preamble: sync bytes (ascii "ZZ") -block form: disk command (0-12) -block data len: data length (0-128) -block data: data sent (0-128 bytes) -checksum: sum from block form to - checksum is FFH (LSD). - -The composition of the block data will vary from one command -(block form) to another. There are 12 block forms. - -block -form description ------- ------------ - 0 directory search - 1 open file - 2 close file - 3 read request - 4 write data - 5 kill file - 6 format - 7 interrogate - 8 change to FDC mode - - 10 read data - 11 directory info - 12 return info - -Block forms 0-8: data sent to PDD. -Block forms 10-12: block data sent by - PDD to host. - -^P - BLOCK FORM COMMANDS - -BLOCK FORM 0 (directory search) - -Block data form (26 bytes) -+---------------------------+-----+-+-+ -| 20 bytes | 4 |1|1| -+---------------------------+-----+-+-+ - file name ^ ^ ^ - null_____________________| | | - attribute____________________| | - search form____________________| - -file name: first character non-blank -null: add 4 blanks to file name -attribute: any letter is acceptable -search form: (0) search for file by - name and attribute. - output file info. - use for file open or - file kill operation. - (1) begin sequential dir - search and output 1st - file info. file name - and attribute not - required. - (2) continue sequential - dir search and output - file info. file name - and attribute not - required. - - -BLOCK FORM 1 (open file specified by block form 0) - -Block data format (1 byte) -+---------+ -| 1 byte | -+---------+ - open form - -open form: (1) to open new file. error - if no room in directory - (2) to open for append. - (3) to open for read. - - -BLOCK FORM 2 (close the open file) - (register file opened by - open form 1 or 2 in the - directory.) - -Block data format: NONE - -^P -BLOCK FORM 3 (read request) - (PDD sends data from file - opened by open form 3) - -Block data format: NONE - - -BLOCK FORM 4 (write data to file - opened by open form 1 or - open form 2.) - -Block data form (1 to 128 bytes) -+---------------------------+ -| 1 to 128 bytes | -+---------------------------+ - file data to be written in file - - -BLOCK FORM 5 (kill file specified by - search form 0) - -Block data format: NONE - - -BLOCK FORM 6 (initialize=format disk) - -Block data format: NONE - - -BLOCK FORM 7 (interrogate ready status - initiate block comm. - sequence of PDD. block - communication error will - not occur if this is - used.) - -Block data format: NONE - - -BLOCK FORM 8 (move into FCD mode) - -Block data format: NONE - - -BLOCK FORM 10 (send file data to host - according to the request - of file data) - -Block data form (1 to 128 bytes) -+---------------------------+ -| 1 to 128 bytes | -+---------------------------+ - data read from file - -^P -BLOCK FORM 11 (send directory info to - host according to the - directory reference - command from host) - -Block data form (28 bytes) -+-----------------------+-+-+--+-+--+-+ -| 20 bytes |1|1| 2|1| 2|1| -+-----------------------+-+-+--+-+--+-+ - file name ^ ^ ^ ^ ^ ^ - 0FFH_______________| | | | | | - 00H__________________| | | | | - left block amount_______| | | | - attribute_________________| | | - file size____________________| | - left sector amount_____________| - -file name: same as dir. ref but when -attribute: there is no designated - file or all of dir. info - has been output at - sequential search, file - name and attribute are - set to null. -lft blk amt: unused block amount of - the disk (1 block = 256 - bytes). Set to NULL for - PDD1. -file size: designated file size. - Byte amount (1 to 65535). -lft sctr amt: unused sector amount of - the disk (1 sector = 1280 - bytes). Set this amount - as integer part of (left - block amount/5) for PDD2. - - -BLOCK FORM 12 (return information for - normal end responses to - commands except dir. - reference, file data - request, and mode - change. Also ERROR - responses except for DTR - going LOW.) - -Block data format (1 byte) -+---------+ -| 1 byte | -+---------+ -return code Meaning ------------ ------------------- - 00h Normal end - 30h Parameter error or block - sequence error. - 4Xh Read error - 50h Write protect - 60h Shortage of disk space - 7Xh Disk mount error - 8Xh Hardware error - -^P - -This is a preliminary file. -I will update it regularly until it is complete. - -For those who want to experiment, the following basic -program will KILL "SEARCH.DO" from the PDD (no error -detection). If you wanted to FORMAT the disk, LINE 32 would -be: - -32 PRINT#1,FM$ - -...and LINE 33 can be eliminated. - - -0 'Packet testing by Paul Globman -1 ' Feb. 1986 -2 ' -5 MAXFILES=3:GOTO100 -30 PRINT#1,RY$:GOSUB 1000 -32 PRINT#1,D$(0):GOSUB 1000 -33 PRINT#1,KL$ -99 END -100 D$(0)="ZZ"+CHR$(0)+CHR$(26)+"SEARCH.DO "+ -CHR$(70)+CHR$(0)+CHR$(72) -101 D$(1)="ZZ"+CHR$(0)+CHR$(26)+" "+ -CHR$(70)+CHR$(1)+CHR$(158) -102 D$(2)="ZZ"+CHR$(0)+CHR$(26)+" "+ -CHR$(70)+CHR$(2)+CHR$(157) -110 O$(1)="ZZ"+CHR$(1)+CHR$(1)+CHR$(1)+CHR$(252) -111 O$(2)="ZZ"+CHR$(1)+CHR$(1)+CHR$(2)+CHR$(251) -112 O$(3)="ZZ"+CHR$(1)+CHR$(1)+CHR$(3)+CHR$(250) -115 CL$="ZZ"+CHR$(2)+CHR$(0)+CHR$(253) -120 RD$="ZZ"+CHR$(3)+CHR$(0)+CHR$(252) -130 'WR$="ZZ"+CHR$(4)+CHR$(0)+CHR$(251) -140 KL$="ZZ"+CHR$(5)+CHR$(0)+CHR$(250)+CHR$(13) -150 FM$="ZZ"+CHR$(6)+CHR$(0)+CHR$(249) -160 RY$="ZZ"+CHR$(7)+CHR$(0)+CHR$(248)+CHR$(13) -180 OPEN"COM:98N1DNN"FOR OUTPUT AS 1 -190 OPEN"COM:98N1DNN"FOR INPUT AS 2 -299 GOTO30 -1000 'WAIT -1010 FOR I=1 TO 1000:NEXT:RETURN - - diff --git a/dumppattern.py b/dumppattern.py old mode 100755 new mode 100644 index 6694b99..d9412b5 --- a/dumppattern.py +++ b/dumppattern.py @@ -20,183 +20,196 @@ import sys import brother -DEBUG = 0 - -########## - -def roundeven(val): - return (val+(val%2)) - -def roundeight(val): - if val % 8: - return val + (8-(val%8)) - else: - return val - -def roundfour(val): - if val % 4: - return val + (4-(val%4)) - else: - return val +# import convenience functions from brother module +from brother import roundeven, roundfour, roundeight, nibblesPerRow, bytesPerPattern, bytesForMemo -def nibblesPerRow(stitches): - # there are four stitches per nibble - # each row is nibble aligned - return(roundfour(stitches)/4) +DEBUG = 0 -def bytesPerPattern(stitches, rows): - nibbs = rows * nibblesPerRow(stitches) - bytes = roundeven(nibbs)/2 - return bytes +version = '1.0' -def bytesForMemo(rows): - bytes = roundeven(rows)/2 - return bytes +class PatternDumper: -############## + def __init__(self): + self.printInfoCallback = self.printInfo + def dumppattern(self,argv): + if len(argv) < 1: + raise ArgumentsException() + + result = Result() -version = '1.0' + if len(argv) == 2: + patt = int(argv[1]) + else: + patt = 0 -if len(sys.argv) < 2: - print 'Usage: %s file [patternnum]' % sys.argv[0] - print 'Dumps user programs (901-999) from brother data files' - sys.exit() - -if len(sys.argv) == 3: - patt = int(sys.argv[2]) -else: - patt = 0 - -bf = brother.brotherFile(sys.argv[1]) - -if patt == 0: - pats = bf.getPatterns() - print 'Pattern Stitches Rows' - for pat in pats: - print ' %3d %3d %3d' % (pat["number"], pat["stitches"], pat["rows"]) - - if DEBUG: - print "-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" - print "Data file" - print "-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+" - - # first dump the 99 'pattern id' blocks - for i in range(99): - print "program entry",i - # each block is 7 bytes - bytenum = i*7 - - pattused = bf.getIndexedByte(bytenum) - print "\t",hex(bytenum),": ",hex(pattused), - if (pattused == 1): - print "\t(used)" - else: - print "\t(unused)" - #print "\t-skipped-" - #continue - bytenum += 1 - - unk1 = bf.getIndexedByte(bytenum) - print "\t",hex(bytenum),": ",hex(unk1),"\t(unknown)" - bytenum += 1 - - rows100 = bf.getIndexedByte(bytenum) - print "\t",hex(bytenum),": ",hex(rows100),"\t(rows = ", (rows100 >> 4)*100, " + ", (rows100 & 0xF)*10 - bytenum += 1 - - rows1 = bf.getIndexedByte(bytenum) - print "\t",hex(bytenum),": ",hex(rows1),"\t\t+ ", (rows1 >> 4), " stiches = ", (rows1 & 0xF)*100,"+" - bytenum += 1 - - stitches10 = bf.getIndexedByte(bytenum) - print "\t",hex(bytenum),": ",hex(stitches10),"\t\t+ ", (stitches10 >> 4)*10, " +", (stitches10 & 0xF),")" - bytenum += 1 - - prog100 = bf.getIndexedByte(bytenum) - print "\t",hex(bytenum),": ",hex(prog100),"\t(unknown , prog# = ", (prog100&0xF) * 100,"+" - bytenum += 1 - - prog10 = bf.getIndexedByte(bytenum) - print "\t",hex(bytenum),": ",hex(prog10),"\t\t + ", (prog10>>4) * 10,"+",(prog10&0xF),")" - bytenum += 1 - - print "============================================" - print "Program memory grows -up-" - # now we're onto data data - - # dump the first program - pointer = 0x6DF # this is the 'bottom' of the memory - for i in range(99): - # of course, not all patterns will get dumped - pattused = bf.getIndexedByte(i*7) - if (pattused != 1): - # :( - break - # otherwise its a valid pattern - print "pattern bank #", i - # calc pattern size - rows100 = bf.getIndexedByte(i*7 + 2) - rows1 = bf.getIndexedByte(i*7 + 3) - stitches10 = bf.getIndexedByte(i*7 + 4) - - rows = (rows100 >> 4)*100 + (rows100 & 0xF)*10 + (rows1 >> 4); - stitches = (rows1 & 0xF)*100 + (stitches10 >> 4)*10 + (stitches10 & 0xF) - print "rows = ", rows, "stitches = ", stitches -# print "total nibs per row = ", nibblesPerRow(stitches) - - - # dump the memo data - print "memo length =",bytesForMemo(rows) - for i in range (bytesForMemo(rows)): - b = pointer - i - print "\t",hex(b),": ",hex(bf.getIndexedByte(b)) - pointer -= bytesForMemo(rows) - - print "pattern length = ", bytesPerPattern(stitches, rows) - for i in range (bytesPerPattern(stitches, rows)): - b = pointer - i - print "\t",hex(b),": ",hex(bf.getIndexedByte(b)), - for j in range(8): - if (bf.getIndexedByte(b) & (1<> 4), " stiches = ", (rows1 & 0xF)*100,"+" + bytenum += 1 + + stitches10 = bf.getIndexedByte(bytenum) + print "\t",hex(bytenum),": ",hex(stitches10),"\t\t+ ", (stitches10 >> 4)*10, " +", (stitches10 & 0xF),")" + bytenum += 1 + + prog100 = bf.getIndexedByte(bytenum) + print "\t",hex(bytenum),": ",hex(prog100),"\t(unknown , prog# = ", (prog100&0xF) * 100,"+" + bytenum += 1 + + prog10 = bf.getIndexedByte(bytenum) + print "\t",hex(bytenum),": ",hex(prog10),"\t\t + ", (prog10>>4) * 10,"+",(prog10&0xF),")" + bytenum += 1 + + print "============================================" + print "Program memory grows -up-" + # now we're onto data data + + # dump the first program + pointer = 0x6DF # this is the 'bottom' of the memory + for i in range(99): + # of course, not all patterns will get dumped + pattused = bf.getIndexedByte(i*7) + if (pattused != 1): + # :( + break + # otherwise its a valid pattern + print "pattern bank #", i + # calc pattern size + rows100 = bf.getIndexedByte(i*7 + 2) + rows1 = bf.getIndexedByte(i*7 + 3) + stitches10 = bf.getIndexedByte(i*7 + 4) + + rows = (rows100 >> 4)*100 + (rows100 & 0xF)*10 + (rows1 >> 4); + stitches = (rows1 & 0xF)*100 + (stitches10 >> 4)*10 + (stitches10 & 0xF) + print "rows = ", rows, "stitches = ", stitches + # print "total nibs per row = ", nibblesPerRow(stitches) + + + # dump the memo data + print "memo length =",bytesForMemo(rows) + for i in range (bytesForMemo(rows)): + b = pointer - i + print "\t",hex(b),": ",hex(bf.getIndexedByte(b)) + pointer -= bytesForMemo(rows) + + print "pattern length = ", bytesPerPattern(stitches, rows) + for i in range (bytesPerPattern(stitches, rows)): + b = pointer - i + print "\t",hex(b),": ",hex(bf.getIndexedByte(b)), + for j in range(8): + if (bf.getIndexedByte(b) & (1< 0: - value = TheImage.getpixel((x,y)) - if value: - sys.stdout.write('* ') - else: - sys.stdout.write(' ') - #sys.stdout.write(str(value)) - x = x-1 - if x == 0: #did we hit the end of the line? - y = y+1 x = width - 1 - print " " - if y == height: - break -# debugging stuff done - -# now to make the actual, yknow memo+pattern data - -# the memo seems to be always blank. i have no idea really -memoentry = [] -for i in range(bytesForMemo(height)): - memoentry.append(0x0) - -# now for actual real live pattern data! -pattmemnibs = [] -for r in range(height): - row = [] # we'll chunk in bits and then put em into nibbles - for s in range(width): - value = TheImage.getpixel((width-s-1,height-r-1)) - if (value != 0): - row.append(1) - else: - row.append(0) - #print row - # turn it into nibz - for s in range(roundfour(width) / 4): - n = 0 - for nibs in range(4): - #print "row size = ", len(row), "index = ",s*4+nibs - - if (len(row) == (s*4+nibs)): - break # padding! + for y in xrange(height): + for x in xrange(width): + value = TheImage.getpixel((x,y)) + if value: + self.printPattern('* ') + else: + self.printPattern(' ') + print " " + + # debugging stuff done + + # now to make the actual, yknow memo+pattern data + + # the memo seems to be always blank. i have no idea really + memoentry = [] + for i in range(bytesForMemo(height)): + memoentry.append(0x0) + + # now for actual real live pattern data! + pattmemnibs = [] + for r in range(height): + row = [] # we'll chunk in bits and then put em into nibbles + for s in range(width): + x = s if methodWithPointers else width-s-1 + value = TheImage.getpixel((x,height-r-1)) + isBlack = (value == 0) if methodWithPointers else (value != 0) + if (isBlack): + row.append(1) + else: + row.append(0) + #print row + # turn it into nibz + for s in range(roundfour(width) / 4): + n = 0 + for nibs in range(4): + #print "row size = ", len(row), "index = ",s*4+nibs + + if (len(row) == (s*4+nibs)): + break # padding! + + if (row[s*4 + nibs]): + n |= 1 << nibs + pattmemnibs.append(n) + #print hex(n), + + + if (len(pattmemnibs) % 2): + # odd nibbles, buffer to a byte + pattmemnibs.append(0x0) + + #print len(pattmemnibs), "nibbles of data" + + # turn into bytes + pattmem = [] + for i in range (len(pattmemnibs) / 2): + pattmem.append( pattmemnibs[i*2] | (pattmemnibs[i*2 + 1] << 4)) + + #print map(hex, pattmem) + # whew. + + + # now to insert this data into the file + + # now we have to figure out the -end- of the last pattern is + endaddr = 0x6df + + beginaddr = thePattern["pattend"] + endaddr = beginaddr + bytesForMemo(height) + len(pattmem) + self.printInfoCallback("beginning will be at " + str(hex(beginaddr)) + ", end at " + str(hex(endaddr))) + + # Note - It's note certain that in all cases this collision test is needed. What's happening + # when you write below this address (as the pattern grows downward in memory) in that you begin + # to overwrite the pattern index data that starts at low memory. Since you overwrite the info + # for highest memory numbers first, you may be able to get away with it as long as you don't + # attempt to use higher memories. + # Steve + + if beginaddr <= 0x2B8: + self.printErrorCallback("Sorry, this will collide with the pattern entry data since %s is <= 0x2B8!" % hex(beginaddr)) + #exit + + # write the memo and pattern entry from the -end- to the -beginning- (up!) + for i in range(len(memoentry)): + bf.setIndexedByte(endaddr, 0) + endaddr -= 1 + + for i in range(len(pattmem)): + bf.setIndexedByte(endaddr, pattmem[i]) + endaddr -= 1 + + # push the data to a file + outfile = open(newbrotherfile, 'wb') + + d = bf.getFullData() + outfile.write(d) + outfile.close() + +class InserterException(Exception): + def getMessage(self): + msg = '' + for arg in self.args: + if msg != '': + msg += ' ' + msg += str(arg) - if (row[s*4 + nibs]): - n |= 1 << nibs - pattmemnibs.append(n) - #print hex(n), - - -if (len(pattmemnibs) % 2): - # odd nibbles, buffer to a byte - pattmemnibs.append(0x0) - -#print len(pattmemnibs), "nibbles of data" - -# turn into bytes -pattmem = [] -for i in range (len(pattmemnibs) / 2): - pattmem.append( pattmemnibs[i*2] | (pattmemnibs[i*2 + 1] << 4)) - -#print map(hex, pattmem) -# whew. - - -# now to insert this data into the file - -# now we have to figure out the -end- of the last pattern is -endaddr = 0x6df - -beginaddr = thePattern["pattend"] -endaddr = beginaddr + bytesForMemo(height) + len(pattmem) -print "beginning will be at ", hex(beginaddr), "end at", hex(endaddr) - -# Note - It's note certain that in all cases this collision test is needed. What's happening -# when you write below this address (as the pattern grows downward in memory) in that you begin -# to overwrite the pattern index data that starts at low memory. Since you overwrite the info -# for highest memory numbers first, you may be able to get away with it as long as you don't -# attempt to use higher memories. -# Steve - -if beginaddr <= 0x2B8: - print "sorry, this will collide with the pattern entry data since %s is <= 0x2B8!" % hex(beginaddr) - #exit - -# write the memo and pattern entry from the -end- to the -beginning- (up!) -for i in range(len(memoentry)): - bf.setIndexedByte(endaddr, 0) - endaddr -= 1 - -for i in range(len(pattmem)): - bf.setIndexedByte(endaddr, pattmem[i]) - endaddr -= 1 - -# push the data to a file -outfile = open(sys.argv[4], 'wb') - -d = bf.getFullData() -outfile.write(d) -outfile.close() + return msg + +class PatternNotFoundException(InserterException): + def __init__(self, patternNumber): + self.patternNumber = patternNumber + + +if __name__ == "__main__": + if len(sys.argv) < 5: + print 'Usage: %s oldbrotherfile pattern# image.bmp newbrotherfile' % sys.argv[0] + sys.exit() + inserter = PatternInserter() + argv = sys.argv + try: + inserter.insertPattern(argv[1],argv[2],argv[3],argv[4]) + except PatternNotFoundException as e: + print 'ERROR: Pattern %d not found' % e.patternNumber + sys.exit(1) + except InserterException as e: + print 'ERROR: ',e.getMessage() + sys.exit(1) diff --git a/process_image.py b/process_image.py old mode 100755 new mode 100644 diff --git a/qr_test.bmp b/qr_test.bmp deleted file mode 100644 index b41ae52..0000000 Binary files a/qr_test.bmp and /dev/null differ diff --git a/qr_test.png b/qr_test.png deleted file mode 100644 index b154e41..0000000 Binary files a/qr_test.png and /dev/null differ diff --git a/qr_test.xcf b/qr_test.xcf deleted file mode 100644 index 263ab0b..0000000 Binary files a/qr_test.xcf and /dev/null differ diff --git a/test-data/README b/test-data/README deleted file mode 100644 index 46a9e4b..0000000 --- a/test-data/README +++ /dev/null @@ -1,3 +0,0 @@ -This contains data from the PDD emulator, to be used for helping reverse-eingineer the data format. - - diff --git a/test-data/base/00.dat b/test-data/base/00.dat deleted file mode 100644 index 93546f7..0000000 Binary files a/test-data/base/00.dat and /dev/null differ diff --git a/test-data/base/00.id b/test-data/base/00.id deleted file mode 100644 index 32354e9..0000000 Binary files a/test-data/base/00.id and /dev/null differ diff --git a/test-data/base/01.dat b/test-data/base/01.dat deleted file mode 100644 index dba8f2d..0000000 Binary files a/test-data/base/01.dat and /dev/null differ diff --git a/test-data/base/01.id b/test-data/base/01.id deleted file mode 100644 index 32354e9..0000000 Binary files a/test-data/base/01.id and /dev/null differ diff --git a/test-data/base/02.dat b/test-data/base/02.dat deleted file mode 100644 index aa91e0c..0000000 Binary files a/test-data/base/02.dat and /dev/null differ diff --git a/test-data/base/02.id b/test-data/base/02.id deleted file mode 100644 index 3ae1687..0000000 Binary files a/test-data/base/02.id and /dev/null differ diff --git a/test-data/base/03.dat b/test-data/base/03.dat deleted file mode 100644 index 6e2da7e..0000000 Binary files a/test-data/base/03.dat and /dev/null differ diff --git a/test-data/base/03.id b/test-data/base/03.id deleted file mode 100644 index 3ae1687..0000000 Binary files a/test-data/base/03.id and /dev/null differ diff --git a/test-data/base/04.dat b/test-data/base/04.dat deleted file mode 100644 index 9f8fca8..0000000 Binary files a/test-data/base/04.dat and /dev/null differ diff --git a/test-data/base/04.id b/test-data/base/04.id deleted file mode 100644 index 2a91d4d..0000000 Binary files a/test-data/base/04.id and /dev/null differ diff --git a/test-data/base/05.dat b/test-data/base/05.dat deleted file mode 100644 index e6ee3ab..0000000 Binary files a/test-data/base/05.dat and /dev/null differ diff --git a/test-data/base/05.id b/test-data/base/05.id deleted file mode 100644 index 2a91d4d..0000000 Binary files a/test-data/base/05.id and /dev/null differ diff --git a/test-data/base/06.dat b/test-data/base/06.dat deleted file mode 100644 index b284bd6..0000000 Binary files a/test-data/base/06.dat and /dev/null differ diff --git a/test-data/base/06.id b/test-data/base/06.id deleted file mode 100644 index f9310cc..0000000 Binary files a/test-data/base/06.id and /dev/null differ diff --git a/test-data/base/07.dat b/test-data/base/07.dat deleted file mode 100644 index a0d784c..0000000 Binary files a/test-data/base/07.dat and /dev/null differ diff --git a/test-data/base/07.id b/test-data/base/07.id deleted file mode 100644 index f9310cc..0000000 Binary files a/test-data/base/07.id and /dev/null differ diff --git a/test-data/base/08.dat b/test-data/base/08.dat deleted file mode 100644 index 134f495..0000000 Binary files a/test-data/base/08.dat and /dev/null differ diff --git a/test-data/base/08.id b/test-data/base/08.id deleted file mode 100644 index 0a27229..0000000 Binary files a/test-data/base/08.id and /dev/null differ diff --git a/test-data/base/09.dat b/test-data/base/09.dat deleted file mode 100644 index e0c7286..0000000 Binary files a/test-data/base/09.dat and /dev/null differ diff --git a/test-data/base/09.id b/test-data/base/09.id deleted file mode 100644 index 0a27229..0000000 Binary files a/test-data/base/09.id and /dev/null differ diff --git a/test-data/base/10.dat b/test-data/base/10.dat deleted file mode 100644 index f139bc2..0000000 Binary files a/test-data/base/10.dat and /dev/null differ diff --git a/test-data/base/10.id b/test-data/base/10.id deleted file mode 100644 index a920324..0000000 Binary files a/test-data/base/10.id and /dev/null differ diff --git a/test-data/base/11.dat b/test-data/base/11.dat deleted file mode 100644 index 78b4a73..0000000 Binary files a/test-data/base/11.dat and /dev/null differ diff --git a/test-data/base/11.id b/test-data/base/11.id deleted file mode 100644 index a920324..0000000 Binary files a/test-data/base/11.id and /dev/null differ diff --git a/test-data/base/12.dat b/test-data/base/12.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/12.dat and /dev/null differ diff --git a/test-data/base/12.id b/test-data/base/12.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/12.id and /dev/null differ diff --git a/test-data/base/13.dat b/test-data/base/13.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/13.dat and /dev/null differ diff --git a/test-data/base/13.id b/test-data/base/13.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/13.id and /dev/null differ diff --git a/test-data/base/14.dat b/test-data/base/14.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/14.dat and /dev/null differ diff --git a/test-data/base/14.id b/test-data/base/14.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/14.id and /dev/null differ diff --git a/test-data/base/15.dat b/test-data/base/15.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/15.dat and /dev/null differ diff --git a/test-data/base/15.id b/test-data/base/15.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/15.id and /dev/null differ diff --git a/test-data/base/16.dat b/test-data/base/16.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/16.dat and /dev/null differ diff --git a/test-data/base/16.id b/test-data/base/16.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/16.id and /dev/null differ diff --git a/test-data/base/17.dat b/test-data/base/17.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/17.dat and /dev/null differ diff --git a/test-data/base/17.id b/test-data/base/17.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/17.id and /dev/null differ diff --git a/test-data/base/18.dat b/test-data/base/18.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/18.dat and /dev/null differ diff --git a/test-data/base/18.id b/test-data/base/18.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/18.id and /dev/null differ diff --git a/test-data/base/19.dat b/test-data/base/19.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/19.dat and /dev/null differ diff --git a/test-data/base/19.id b/test-data/base/19.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/19.id and /dev/null differ diff --git a/test-data/base/20.dat b/test-data/base/20.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/20.dat and /dev/null differ diff --git a/test-data/base/20.id b/test-data/base/20.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/20.id and /dev/null differ diff --git a/test-data/base/21.dat b/test-data/base/21.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/21.dat and /dev/null differ diff --git a/test-data/base/21.id b/test-data/base/21.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/21.id and /dev/null differ diff --git a/test-data/base/22.dat b/test-data/base/22.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/22.dat and /dev/null differ diff --git a/test-data/base/22.id b/test-data/base/22.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/22.id and /dev/null differ diff --git a/test-data/base/23.dat b/test-data/base/23.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/23.dat and /dev/null differ diff --git a/test-data/base/23.id b/test-data/base/23.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/23.id and /dev/null differ diff --git a/test-data/base/24.dat b/test-data/base/24.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/24.dat and /dev/null differ diff --git a/test-data/base/24.id b/test-data/base/24.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/24.id and /dev/null differ diff --git a/test-data/base/25.dat b/test-data/base/25.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/25.dat and /dev/null differ diff --git a/test-data/base/25.id b/test-data/base/25.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/25.id and /dev/null differ diff --git a/test-data/base/26.dat b/test-data/base/26.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/26.dat and /dev/null differ diff --git a/test-data/base/26.id b/test-data/base/26.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/26.id and /dev/null differ diff --git a/test-data/base/27.dat b/test-data/base/27.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/27.dat and /dev/null differ diff --git a/test-data/base/27.id b/test-data/base/27.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/27.id and /dev/null differ diff --git a/test-data/base/28.dat b/test-data/base/28.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/28.dat and /dev/null differ diff --git a/test-data/base/28.id b/test-data/base/28.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/28.id and /dev/null differ diff --git a/test-data/base/29.dat b/test-data/base/29.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/29.dat and /dev/null differ diff --git a/test-data/base/29.id b/test-data/base/29.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/29.id and /dev/null differ diff --git a/test-data/base/30.dat b/test-data/base/30.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/30.dat and /dev/null differ diff --git a/test-data/base/30.id b/test-data/base/30.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/30.id and /dev/null differ diff --git a/test-data/base/31.dat b/test-data/base/31.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/31.dat and /dev/null differ diff --git a/test-data/base/31.id b/test-data/base/31.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/31.id and /dev/null differ diff --git a/test-data/base/32.dat b/test-data/base/32.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/32.dat and /dev/null differ diff --git a/test-data/base/32.id b/test-data/base/32.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/32.id and /dev/null differ diff --git a/test-data/base/33.dat b/test-data/base/33.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/33.dat and /dev/null differ diff --git a/test-data/base/33.id b/test-data/base/33.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/33.id and /dev/null differ diff --git a/test-data/base/34.dat b/test-data/base/34.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/34.dat and /dev/null differ diff --git a/test-data/base/34.id b/test-data/base/34.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/34.id and /dev/null differ diff --git a/test-data/base/35.dat b/test-data/base/35.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/35.dat and /dev/null differ diff --git a/test-data/base/35.id b/test-data/base/35.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/35.id and /dev/null differ diff --git a/test-data/base/36.dat b/test-data/base/36.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/36.dat and /dev/null differ diff --git a/test-data/base/36.id b/test-data/base/36.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/36.id and /dev/null differ diff --git a/test-data/base/37.dat b/test-data/base/37.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/37.dat and /dev/null differ diff --git a/test-data/base/37.id b/test-data/base/37.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/37.id and /dev/null differ diff --git a/test-data/base/38.dat b/test-data/base/38.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/38.dat and /dev/null differ diff --git a/test-data/base/38.id b/test-data/base/38.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/38.id and /dev/null differ diff --git a/test-data/base/39.dat b/test-data/base/39.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/39.dat and /dev/null differ diff --git a/test-data/base/39.id b/test-data/base/39.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/39.id and /dev/null differ diff --git a/test-data/base/40.dat b/test-data/base/40.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/40.dat and /dev/null differ diff --git a/test-data/base/40.id b/test-data/base/40.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/40.id and /dev/null differ diff --git a/test-data/base/41.dat b/test-data/base/41.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/41.dat and /dev/null differ diff --git a/test-data/base/41.id b/test-data/base/41.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/41.id and /dev/null differ diff --git a/test-data/base/42.dat b/test-data/base/42.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/42.dat and /dev/null differ diff --git a/test-data/base/42.id b/test-data/base/42.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/42.id and /dev/null differ diff --git a/test-data/base/43.dat b/test-data/base/43.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/43.dat and /dev/null differ diff --git a/test-data/base/43.id b/test-data/base/43.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/43.id and /dev/null differ diff --git a/test-data/base/44.dat b/test-data/base/44.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/44.dat and /dev/null differ diff --git a/test-data/base/44.id b/test-data/base/44.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/44.id and /dev/null differ diff --git a/test-data/base/45.dat b/test-data/base/45.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/45.dat and /dev/null differ diff --git a/test-data/base/45.id b/test-data/base/45.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/45.id and /dev/null differ diff --git a/test-data/base/46.dat b/test-data/base/46.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/46.dat and /dev/null differ diff --git a/test-data/base/46.id b/test-data/base/46.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/46.id and /dev/null differ diff --git a/test-data/base/47.dat b/test-data/base/47.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/47.dat and /dev/null differ diff --git a/test-data/base/47.id b/test-data/base/47.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/47.id and /dev/null differ diff --git a/test-data/base/48.dat b/test-data/base/48.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/48.dat and /dev/null differ diff --git a/test-data/base/48.id b/test-data/base/48.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/48.id and /dev/null differ diff --git a/test-data/base/49.dat b/test-data/base/49.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/49.dat and /dev/null differ diff --git a/test-data/base/49.id b/test-data/base/49.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/49.id and /dev/null differ diff --git a/test-data/base/50.dat b/test-data/base/50.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/50.dat and /dev/null differ diff --git a/test-data/base/50.id b/test-data/base/50.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/50.id and /dev/null differ diff --git a/test-data/base/51.dat b/test-data/base/51.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/51.dat and /dev/null differ diff --git a/test-data/base/51.id b/test-data/base/51.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/51.id and /dev/null differ diff --git a/test-data/base/52.dat b/test-data/base/52.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/52.dat and /dev/null differ diff --git a/test-data/base/52.id b/test-data/base/52.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/52.id and /dev/null differ diff --git a/test-data/base/53.dat b/test-data/base/53.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/53.dat and /dev/null differ diff --git a/test-data/base/53.id b/test-data/base/53.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/53.id and /dev/null differ diff --git a/test-data/base/54.dat b/test-data/base/54.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/54.dat and /dev/null differ diff --git a/test-data/base/54.id b/test-data/base/54.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/54.id and /dev/null differ diff --git a/test-data/base/55.dat b/test-data/base/55.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/55.dat and /dev/null differ diff --git a/test-data/base/55.id b/test-data/base/55.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/55.id and /dev/null differ diff --git a/test-data/base/56.dat b/test-data/base/56.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/56.dat and /dev/null differ diff --git a/test-data/base/56.id b/test-data/base/56.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/56.id and /dev/null differ diff --git a/test-data/base/57.dat b/test-data/base/57.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/57.dat and /dev/null differ diff --git a/test-data/base/57.id b/test-data/base/57.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/57.id and /dev/null differ diff --git a/test-data/base/58.dat b/test-data/base/58.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/58.dat and /dev/null differ diff --git a/test-data/base/58.id b/test-data/base/58.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/58.id and /dev/null differ diff --git a/test-data/base/59.dat b/test-data/base/59.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/59.dat and /dev/null differ diff --git a/test-data/base/59.id b/test-data/base/59.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/59.id and /dev/null differ diff --git a/test-data/base/60.dat b/test-data/base/60.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/60.dat and /dev/null differ diff --git a/test-data/base/60.id b/test-data/base/60.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/60.id and /dev/null differ diff --git a/test-data/base/61.dat b/test-data/base/61.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/61.dat and /dev/null differ diff --git a/test-data/base/61.id b/test-data/base/61.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/61.id and /dev/null differ diff --git a/test-data/base/62.dat b/test-data/base/62.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/62.dat and /dev/null differ diff --git a/test-data/base/62.id b/test-data/base/62.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/62.id and /dev/null differ diff --git a/test-data/base/63.dat b/test-data/base/63.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/63.dat and /dev/null differ diff --git a/test-data/base/63.id b/test-data/base/63.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/63.id and /dev/null differ diff --git a/test-data/base/64.dat b/test-data/base/64.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/64.dat and /dev/null differ diff --git a/test-data/base/64.id b/test-data/base/64.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/64.id and /dev/null differ diff --git a/test-data/base/65.dat b/test-data/base/65.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/65.dat and /dev/null differ diff --git a/test-data/base/65.id b/test-data/base/65.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/65.id and /dev/null differ diff --git a/test-data/base/66.dat b/test-data/base/66.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/66.dat and /dev/null differ diff --git a/test-data/base/66.id b/test-data/base/66.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/66.id and /dev/null differ diff --git a/test-data/base/67.dat b/test-data/base/67.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/67.dat and /dev/null differ diff --git a/test-data/base/67.id b/test-data/base/67.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/67.id and /dev/null differ diff --git a/test-data/base/68.dat b/test-data/base/68.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/68.dat and /dev/null differ diff --git a/test-data/base/68.id b/test-data/base/68.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/68.id and /dev/null differ diff --git a/test-data/base/69.dat b/test-data/base/69.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/69.dat and /dev/null differ diff --git a/test-data/base/69.id b/test-data/base/69.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/69.id and /dev/null differ diff --git a/test-data/base/70.dat b/test-data/base/70.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/70.dat and /dev/null differ diff --git a/test-data/base/70.id b/test-data/base/70.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/70.id and /dev/null differ diff --git a/test-data/base/71.dat b/test-data/base/71.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/71.dat and /dev/null differ diff --git a/test-data/base/71.id b/test-data/base/71.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/71.id and /dev/null differ diff --git a/test-data/base/72.dat b/test-data/base/72.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/72.dat and /dev/null differ diff --git a/test-data/base/72.id b/test-data/base/72.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/72.id and /dev/null differ diff --git a/test-data/base/73.dat b/test-data/base/73.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/73.dat and /dev/null differ diff --git a/test-data/base/73.id b/test-data/base/73.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/73.id and /dev/null differ diff --git a/test-data/base/74.dat b/test-data/base/74.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/74.dat and /dev/null differ diff --git a/test-data/base/74.id b/test-data/base/74.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/74.id and /dev/null differ diff --git a/test-data/base/75.dat b/test-data/base/75.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/75.dat and /dev/null differ diff --git a/test-data/base/75.id b/test-data/base/75.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/75.id and /dev/null differ diff --git a/test-data/base/76.dat b/test-data/base/76.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/76.dat and /dev/null differ diff --git a/test-data/base/76.id b/test-data/base/76.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/76.id and /dev/null differ diff --git a/test-data/base/77.dat b/test-data/base/77.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/77.dat and /dev/null differ diff --git a/test-data/base/77.id b/test-data/base/77.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/77.id and /dev/null differ diff --git a/test-data/base/78.dat b/test-data/base/78.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/78.dat and /dev/null differ diff --git a/test-data/base/78.id b/test-data/base/78.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/78.id and /dev/null differ diff --git a/test-data/base/79.dat b/test-data/base/79.dat deleted file mode 100644 index 06d7405..0000000 Binary files a/test-data/base/79.dat and /dev/null differ diff --git a/test-data/base/79.id b/test-data/base/79.id deleted file mode 100644 index ce58bc9..0000000 Binary files a/test-data/base/79.id and /dev/null differ diff --git a/test-data/base/file-01.dat b/test-data/base/file-01.dat deleted file mode 100644 index 94507da..0000000 Binary files a/test-data/base/file-01.dat and /dev/null differ diff --git a/test-data/base/file-02.dat b/test-data/base/file-02.dat deleted file mode 100644 index 3c5d993..0000000 Binary files a/test-data/base/file-02.dat and /dev/null differ diff --git a/test-data/base/file-03.dat b/test-data/base/file-03.dat deleted file mode 100644 index 19308d9..0000000 Binary files a/test-data/base/file-03.dat and /dev/null differ diff --git a/test-data/base/file-04.dat b/test-data/base/file-04.dat deleted file mode 100644 index be47c2b..0000000 Binary files a/test-data/base/file-04.dat and /dev/null differ diff --git a/test-data/base/file-05.dat b/test-data/base/file-05.dat deleted file mode 100644 index a7b9e8b..0000000 Binary files a/test-data/base/file-05.dat and /dev/null differ diff --git a/test-data/base/file-06.dat b/test-data/base/file-06.dat deleted file mode 100644 index 0193291..0000000 Binary files a/test-data/base/file-06.dat and /dev/null differ diff --git a/test-data/notes.txt b/test-data/notes.txt deleted file mode 100644 index 06c1964..0000000 --- a/test-data/notes.txt +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2010 Steve Conklin -# steve at conklinhouse dot com -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - - -Book says max save of "approximately 13,600 stitches" -This is about 1700 bytes -2048 - 1700 = 348 - -Service manual says "KL116 Knit Reader may be used" - ---- -using base of base - -file01 - after memory clear and power cycle - -file02 - after saving 10x10 pattern 901 - each row = 1.5 bytes - pattern length = 15 bytes - memo length = 5 bytes - total memory = 20 bytes -0x20 (32) - -file03 - after saving 12x12 pattern to 902 - each row = 1.5 bytes - pattern length = 18 bytes - memo length = 6 bytes - total memory = 24 bytes -0x34 (52) - -file04 - after saving 16x16 pattern to 903 - each row = 2 bytes - pattern length = 32 bytes - memo length = 8 bytes - total memory = 40 bytes -0x4C (76) - -file05 - after deleting pattern 902 - -file06 - after saving 20x20 pattern to 902 - - - - - diff --git a/textconversion/maketext.sh b/textconversion/maketext.sh old mode 100755 new mode 100644 diff --git a/textconversion/testa.png b/textconversion/testa.png deleted file mode 100644 index c959551..0000000 Binary files a/textconversion/testa.png and /dev/null differ