plt.ion() # IMPORTANT: Enable real-time plotting gcodeviewer = pltNewFig() # Define a new figure, this doesnt open a window by itself (real-time plotting disabled) # Load the probing results (this will plot the copper level in the background too) probingResults() #print("Must be zero, otherwise the interpolation is wrong!: " + floats(getZoffset(0,0))) # Display the Gcode that is going to be etched (etch_moves, travel_moves, gcode_minXY, gcode_maxXY) = gcv.view(filePath,fileName,0,showEtch,showEtch2,showEtch3,showDrill,showEdge) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEtch1=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEtch2=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showDrill=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEdge=1) (boardSizeX,boardSizeY,gcode_minXY_global, gcode_maxXY_global) = gcv.boardSize(filePath,fileName) # Show delimiter rectangle #x_dat = [gcode_minXY_global[0],gcode_minXY_global[0],gcode_maxXY_global[0],gcode_maxXY_global[0],gcode_minXY_global[0]] #y_dat = [gcode_minXY_global[1],gcode_maxXY_global[1],gcode_maxXY_global[1],gcode_minXY_global[1],gcode_minXY_global[1]] #plt.plot(x_dat,y_dat) pltRefresh(gcodeviewer) # Draw the figure contents, still no window pltShow() # Open the window showing our figure #determine the type of etching happening currentlyEtching = "etch" if (showEtch): currentlyEtching = "etch" elif (showEtch2): currentlyEtching = "etch2"
# Load the probing results (this will plot the copper level in the background too) probingResults() #print("Must be zero, otherwise the interpolation is wrong!: " + floats(getZoffset(0,0))) # Display the Gcode that is going to be etched (etch_moves, travel_moves, gcode_minXY, gcode_maxXY) = gcv.view(filePath, fileName, 0, showEtch, showEtch2, showEtch3, showDrill, showEdge) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEtch1=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEtch2=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showDrill=1) #(etch_moves, travel_moves) = gcv.view(filePath,fileName,showEdge=1) (boardSizeX, boardSizeY, gcode_minXY_global, gcode_maxXY_global) = gcv.boardSize(filePath, fileName) # Show delimiter rectangle #x_dat = [gcode_minXY_global[0],gcode_minXY_global[0],gcode_maxXY_global[0],gcode_maxXY_global[0],gcode_minXY_global[0]] #y_dat = [gcode_minXY_global[1],gcode_maxXY_global[1],gcode_maxXY_global[1],gcode_minXY_global[1],gcode_minXY_global[1]] #plt.plot(x_dat,y_dat) pltRefresh(gcodeviewer) # Draw the figure contents, still no window pltShow() # Open the window showing our figure #plt.show() # THIS SHOULD BE COMMENTED, USE FOR DEBUG toolPos_point = [] def toolPos_draw(x, y, etching=0):