From: <adr...@us...> - 2010-09-05 20:07:39
|
Revision: 3771 http://reprap.svn.sourceforge.net/reprap/?rev=3771&view=rev Author: adrian-bowyer Date: 2010-09-05 20:07:33 +0000 (Sun, 05 Sep 2010) Log Message: ----------- More or less working version of the PCB code. Modified Paths: -------------- trunk/software/host/lib/reprap.properties.dist trunk/software/host/src/org/reprap/machines/GCodeRepRap.java trunk/software/host/src/org/reprap/pcb/GerberGCode.java trunk/software/host/src/org/reprap/pcb/PCB.java Modified: trunk/software/host/lib/reprap.properties.dist =================================================================== --- trunk/software/host/lib/reprap.properties.dist 2010-09-04 17:16:32 UTC (rev 3770) +++ trunk/software/host/lib/reprap.properties.dist 2010-09-05 20:07:33 UTC (rev 3771) @@ -1,5 +1,5 @@ -#Fri Jul 16 23:46:58 BST 2010 #RepRap machine parameters. See http://objects.reprap.org/wiki/Java_Software_Preferences_File +#Sun Sep 05 18:13:28 BST 2010 AxisCount=3 BackColourB(0..1)=0.9 BackColourG(0..1)=0.9 @@ -37,13 +37,14 @@ Extruder0_ExtrusionPWM(0..1)=-1 Extruder0_ExtrusionSize(mm)=0.7 Extruder0_ExtrusionSpeed(mm/minute)=3000 -Extruder0_ExtrusionTemp(C)=190 +Extruder0_ExtrusionTemp(C)=205 Extruder0_FastEFeedrate(mm/minute)=18000.0 Extruder0_FastXYFeedrate(mm/minute)=3000.0 Extruder0_InFillMaterialType(name)=PLA-infill Extruder0_IncrementedStart=false Extruder0_InfillOverlap(mm)=0.2 Extruder0_InfillSpeed(0..1)=1 +Extruder0_Lift(mm)=0 Extruder0_LowerFineLayers(0...)=2 Extruder0_MaterialType(name)=PLA Extruder0_MaxAcceleration(mm/minute/minute)=1200000.0 @@ -107,13 +108,14 @@ Extruder1_ExtrusionPWM(0..1)=-1 Extruder1_ExtrusionSize(mm)=0.7 Extruder1_ExtrusionSpeed(mm/minute)=3000 -Extruder1_ExtrusionTemp(C)=190 +Extruder1_ExtrusionTemp(C)=205 Extruder1_FastEFeedrate(mm/minute)=18000.0 Extruder1_FastXYFeedrate(mm/minute)=3000.0 Extruder1_InFillMaterialType(name)=PLA-support Extruder1_IncrementedStart=false Extruder1_InfillOverlap(mm)=0 Extruder1_InfillSpeed(0..1)=1 +Extruder1_Lift(mm)=0 Extruder1_LowerFineLayers(0...)=0 Extruder1_MaterialType(name)=PLA-support Extruder1_MaxAcceleration(mm/minute/minute)=1200000.0 @@ -177,13 +179,14 @@ Extruder2_ExtrusionPWM(0..1)=-1 Extruder2_ExtrusionSize(mm)=0.7 Extruder2_ExtrusionSpeed(mm/minute)=3000 -Extruder2_ExtrusionTemp(C)=190 +Extruder2_ExtrusionTemp(C)=205 Extruder2_FastEFeedrate(mm/minute)=18000.0 Extruder2_FastXYFeedrate(mm/minute)=3000.0 Extruder2_InFillMaterialType(name)=PLA-infill Extruder2_IncrementedStart=false Extruder2_InfillOverlap(mm)=0.2 Extruder2_InfillSpeed(0..1)=1 +Extruder2_Lift(mm)=0 Extruder2_LowerFineLayers(0...)=0 Extruder2_MaterialType(name)=PLA-infill Extruder2_MaxAcceleration(mm/minute/minute)=1200000.0 @@ -231,8 +234,8 @@ Extruder3_ArcShortSides(0..)=1 Extruder3_Beta(K)=550.0 Extruder3_Capacitor(F)=0.000003 -Extruder3_ColourB(0..1)=0.5 -Extruder3_ColourG(0..1)=0.5 +Extruder3_ColourB(0..1)=0.3 +Extruder3_ColourG(0..1)=0.3 Extruder3_ColourR(0..1)=0.3 Extruder3_CoolingPeriod(s)=0.1 Extruder3_EvenHatchDirection(degrees)=45 @@ -246,7 +249,7 @@ Extruder3_ExtrusionLastFoundationWidth(mm)=2 Extruder3_ExtrusionOverRun(mm)=0 Extruder3_ExtrusionPWM(0..1)=-1 -Extruder3_ExtrusionSize(mm)=0.7 +Extruder3_ExtrusionSize(mm)=0.3 Extruder3_ExtrusionSpeed(mm/minute)=3000 Extruder3_ExtrusionTemp(C)=0 Extruder3_FastEFeedrate(mm/minute)=8000.0 @@ -255,12 +258,13 @@ Extruder3_IncrementedStart=false Extruder3_InfillOverlap(mm)=0.2 Extruder3_InfillSpeed(0..1)=1 +Extruder3_Lift(mm)=1 Extruder3_LowerFineLayers(0...)=0 -Extruder3_MaterialType(name)=Paste +Extruder3_MaterialType(name)=PCB-pen Extruder3_MaxAcceleration(mm/minute/minute)=1200000.0 Extruder3_MaxSpeed(0..255)=255 +Extruder3_MiddleStart=true Extruder3_MinimumZClearance(mm)=-1 -Extruder3_MiddleStart=true Extruder3_NozzleClearTime(s)=10 Extruder3_NozzleWaitTime(s)=0 Extruder3_NozzleWipeDatumX(mm)=22.4 @@ -301,7 +305,7 @@ FiveD=true FoundationLayers=0 FrontFactor=0.001 -GCodeUseSerial=false +GCodeUseSerial=true IdleZAxis=true InterLayerCooling=true MachineColourB(0..1)=0.3 @@ -315,7 +319,7 @@ MouseTranslationFactor=50 MouseZoomFactor=50 MovementSpeedZ(0..255)=240 -NumberOfExtruders=3 +NumberOfExtruders=4 PathOptimise=true Port(name)=/dev/ttyUSB0 RadiusFactor=0.7 Modified: trunk/software/host/src/org/reprap/machines/GCodeRepRap.java =================================================================== --- trunk/software/host/src/org/reprap/machines/GCodeRepRap.java 2010-09-04 17:16:32 UTC (rev 3770) +++ trunk/software/host/src/org/reprap/machines/GCodeRepRap.java 2010-09-05 20:07:33 UTC (rev 3771) @@ -657,7 +657,7 @@ super.homeToZeroZ(); } - public double round(double c, double d) + public static double round(double c, double d) { double power = Math.pow(10.0, d); Modified: trunk/software/host/src/org/reprap/pcb/GerberGCode.java =================================================================== --- trunk/software/host/src/org/reprap/pcb/GerberGCode.java 2010-09-04 17:16:32 UTC (rev 3770) +++ trunk/software/host/src/org/reprap/pcb/GerberGCode.java 2010-09-05 20:07:33 UTC (rev 3771) @@ -128,6 +128,7 @@ if(pcb == null) return result; pcb.homogeneous(result.sw(), result.ne(), colour); + lastCoords = new Rr2Point(fixCoords(c)); return result; } @@ -137,6 +138,7 @@ if(pcb == null) return result; pcb.disc(c, curAperture.width*0.5, colour); + lastCoords = new Rr2Point(fixCoords(c)); //octagon(fixCoords(c), curAperture.width); return result; } @@ -230,7 +232,7 @@ { if(Preferences.loadGlobalBool("DisplaySimulation")) { - RrGraphics simulationPlot1 = new RrGraphics("PCB pattern"); + RrGraphics simulationPlot1 = new RrGraphics("PCB from gerber"); // if(currentPolygon != null) // thePattern.add(new RrPolygon(currentPolygon)); simulationPlot1.init(pcb.box(), false, 0); Modified: trunk/software/host/src/org/reprap/pcb/PCB.java =================================================================== --- trunk/software/host/src/org/reprap/pcb/PCB.java 2010-09-04 17:16:32 UTC (rev 3770) +++ trunk/software/host/src/org/reprap/pcb/PCB.java 2010-09-05 20:07:33 UTC (rev 3771) @@ -15,6 +15,7 @@ import org.reprap.Preferences; import org.reprap.geometry.polygons.*; import org.reprap.utilities.RrGraphics; +import org.reprap.utilities.Debug; import org.reprap.comms.GCodeReaderAndWriter; //import java.io.IOException; @@ -23,7 +24,6 @@ GerberGCode gerberGcode; String[] splitline; - boolean debug = false; RrRectangle bigBox; BufferedReader in; String line; @@ -54,14 +54,14 @@ outputGCodes = og; pcbPen = pp; penWidth = pcbPen.getExtrusionSize(); - System.out.println("Gerber RS274X to GCoder Converter for RepRap\n"); + Debug.d("Gerber RS274X to GCoder Converter for RepRap\n"); - System.out.println("Input: " + inputTracksAndPads.getName()); - System.out.println("Output: " + outputGCodes.getName()+"\n"); - System.out.println("Pen Width: " + penWidth + " mm"); - System.out.println("Offset X: " + offsetX + " mm"); - System.out.println("Offset Y: " + offsetY + " mm"); + Debug.d("Input: " + inputTracksAndPads.getName()); + Debug.d("Output: " + outputGCodes.getName()+"\n"); + Debug.d("Pen Width: " + penWidth + " mm"); + Debug.d("Offset X: " + offsetX + " mm"); + Debug.d("Offset Y: " + offsetY + " mm"); createBitmap(); @@ -73,7 +73,7 @@ { if(Preferences.loadGlobalBool("DisplaySimulation")) { - RrGraphics simulationPlot2 = new RrGraphics("PCB plotlines"); + RrGraphics simulationPlot2 = new RrGraphics("PCB pen plotlines"); // if(currentPolygon != null) // thePattern.add(new RrPolygon(currentPolygon)); simulationPlot2.init(penPaths.getBox(), false, 0); @@ -86,15 +86,18 @@ writeGCodes(); - System.out.println("GCode file generated succesfully !"); + Debug.d("GCode file generated succesfully !"); } private void raisePen() { + double zf = org.reprap.machines.GCodeRepRap.round(zFeedRate, 1); + double zu = org.reprap.machines.GCodeRepRap.round(pcbPen.getLift(), 1); + double xyf = org.reprap.machines.GCodeRepRap.round(pcbPen.getSlowXYFeedrate(), 1); try { - gcode.queue("G1 F" + zFeedRate + "; Z feedrate"); - gcode.queue("G1 Z" + pcbPen.getLift() + "; Z clearance height"); - gcode.queue("G1 F" + pcbPen.getSlowXYFeedrate() + "; XY feedrate"); + gcode.queue("G1 F" + zf + "; Z feedrate"); + gcode.queue("G1 Z" + zu + "; Z clearance height"); + gcode.queue("G1 F" + xyf + "; XY feedrate"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -103,10 +106,13 @@ private void lowerPen() { + double zf = org.reprap.machines.GCodeRepRap.round(zFeedRate, 1); + double zd = org.reprap.machines.GCodeRepRap.round(zDown, 1); + double xyf = org.reprap.machines.GCodeRepRap.round(pcbPen.getSlowXYFeedrate(), 1); try { - gcode.queue("G1 F" + zFeedRate + "; Z feedrate"); - gcode.queue("G1 Z" + zDown + "; Z drawing height"); - gcode.queue("G1 F" + pcbPen.getSlowXYFeedrate() + "; XY feedrate"); + gcode.queue("G1 F" + zf + "; Z feedrate"); + gcode.queue("G1 Z" + zd + "; Z drawing height"); + gcode.queue("G1 F" + xyf + "; XY feedrate"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -158,12 +164,22 @@ { if(p.size() <= 0) return; - try { - gcode.queue("G1 X" + p.point(0).x() + " Y" + p.point(0).y() + "; move to polygon start"); + double x, y; + try + { + x = org.reprap.machines.GCodeRepRap.round(p.point(0).x(), 1); + y = org.reprap.machines.GCodeRepRap.round(p.point(0).y(), 1); + gcode.queue("G1 X" + x + " Y" + y + "; move to polygon start"); lowerPen(); for(int i = 1; i < p.size(); i++) - gcode.queue("G1 X" + p.point(i).x() + " Y" + p.point(i).y() + "; draw line"); - gcode.queue("G1 X" + p.point(0).x() + " Y" + p.point(0).y() + "; draw back to polygon start"); + { + x = org.reprap.machines.GCodeRepRap.round(p.point(i).x(), 1); + y = org.reprap.machines.GCodeRepRap.round(p.point(i).y(), 1); + gcode.queue("G1 X" + x + " Y" + y + "; draw line"); + } + x = org.reprap.machines.GCodeRepRap.round(p.point(0).x(), 1); + y = org.reprap.machines.GCodeRepRap.round(p.point(0).y(), 1); + gcode.queue("G1 X" + x + " Y" + y + "; draw back to polygon start"); } catch (Exception e) { e.printStackTrace(); return; @@ -187,7 +203,7 @@ private void createBitmap() { - gerberGcode = new GerberGCode(pcbPen, null, true); //, drawingHeight, freemoveHeight, XYFeedrate, ZFeedrate); + gerberGcode = new GerberGCode(pcbPen, null, true); bigBox = new RrRectangle(); @@ -201,8 +217,8 @@ if(r != null) bigBox = RrRectangle.union(bigBox, r); } - if(debug) - System.out.println("Surrounding reactangle: " + bigBox); + + Debug.d("Surrounding reactangle: " + bigBox); in.close(); in = new BufferedReader(new FileReader(inputTracksAndPads)); @@ -234,7 +250,7 @@ private RrRectangle processLine(String line, boolean drill) { - if(debug) System.out.println(line); + Debug.d(line); boolean drillDef = false; @@ -250,7 +266,7 @@ formatX = line.substring(6, 8); formatY = line.substring(9, 11); - if(debug) System.out.println("Format X: " + formatX + " Format Y: " + formatY); + Debug.d("Format X: " + formatX + " Format Y: " + formatY); } else if(line.startsWith("%ADD")) @@ -266,18 +282,16 @@ apertureType = splitline[0]; apertureSize = splitline[1]; - if(debug) - { - System.out.println("\n\nAparture: " + apertureNum); - System.out.println("Type: " + apertureType); - } + Debug.d("\n\nAparture: " + apertureNum); + Debug.d("Type: " + apertureType); + + if(apertureType.equals("C")) { double s = scale*Double.parseDouble(apertureSize); - gerberGcode.addCircleAperture(Integer.parseInt(apertureNum), s); - if(debug) - System.out.println("Size: " + s + " mm"); + gerberGcode.addCircleAperture(Integer.parseInt(apertureNum), s); + Debug.d("Size: " + s + " mm"); } else if(apertureType.equals("R")) @@ -288,8 +302,7 @@ double y = scale*Double.parseDouble(rectSides[1]); gerberGcode.addRectangleAperture(Integer.parseInt(apertureNum), x, y); - if(debug) - System.out.println("Size: " + x + "x" + y + "mm x mm"); + Debug.d("Size: " + x + "x" + y + "mm x mm"); } else if(apertureType.equals("OC8")) @@ -298,7 +311,7 @@ } else { - System.out.println(" [-] aparture type: " + apertureType + " not supported [" + line+"]\n"); + Debug.e(" [-] aparture type: " + apertureType + " not supported [" + line+"]\n"); //System.exit(-1); } @@ -316,44 +329,38 @@ apertureNum = splitline[0]; apertureSize = splitline[1]; - if(debug) - System.out.println("\n\nDrill: " + apertureNum); + Debug.d("\n\nDrill: " + apertureNum); drillDef = true; double s = scale*Double.parseDouble(apertureSize); gerberGcode.addCircleAperture(Integer.parseInt(apertureNum), s); - if(debug) - System.out.println("Size: " + s + " mm"); + Debug.d("Size: " + s + " mm"); } } else if(line.startsWith("G90")) { gerberGcode.enableAbsolute(); - if(debug) - System.out.println("Absolute coordinates"); + Debug.d("Absolute coordinates"); } else if(line.startsWith("G91")) { gerberGcode.enableRelative(); - if(debug) - System.out.println("Relative coordinates"); + Debug.d("Relative coordinates"); } else if(line.startsWith("G70") || (drill && line.startsWith("M72"))) { scale = 25.4; - if(debug) - System.out.println("Inches"); + Debug.d("Inches"); } else if(line.startsWith("G71")|| (drill && line.startsWith("M71"))) { scale = 1; - if(debug) - System.out.println("Metric"); + Debug.d("Metric"); } else if(line.startsWith("G54")) @@ -361,16 +368,14 @@ if(drill) { gerberGcode.selectAperture(-1); - if(debug) - System.out.println("Drill centre selected."); + Debug.d("Drill centre selected."); } else { int aperture; aperture = Integer.valueOf(line.substring(4, line.length()-1).trim()); gerberGcode.selectAperture(aperture); - if(debug) - System.out.println("Apature: " + aperture + " selected."); + Debug.d("Apature: " + aperture + " selected."); } } @@ -404,8 +409,7 @@ x += offsetX; y += offsetY; - if(debug) - System.out.println(" X: "+x+" Y:"+y+" D:"+d); + Debug.d(" X: "+x+" Y:"+y+" D:"+d); if(d==1) { @@ -428,8 +432,7 @@ if(drill) { gerberGcode.selectAperture(-1); - if(debug) - System.out.println("Drill centre selected."); + Debug.d("Drill centre selected."); } else { int aperture; @@ -437,8 +440,7 @@ aperture = Integer.valueOf(line.substring(1, 3)); gerberGcode.selectAperture(aperture); - if(debug) - System.out.print("Apature: " + aperture + " selected."); + Debug.d("Apature: " + aperture + " selected."); } } return result; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2010-10-21 23:29:40
|
Revision: 3841 http://reprap.svn.sourceforge.net/reprap/?rev=3841&view=rev Author: adrian-bowyer Date: 2010-10-21 23:29:32 +0000 (Thu, 21 Oct 2010) Log Message: ----------- Improved outline algorithm with start in the middle of solid: no longer takes short cuts over holes... Further simplification of preferences. Modified Paths: -------------- trunk/software/host/lib/reprap.properties.dist trunk/software/host/src/org/reprap/Preferences.java trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java trunk/software/host/src/org/reprap/devices/GenericExtruder.java trunk/software/host/src/org/reprap/geometry/LayerProducer.java trunk/software/host/src/org/reprap/geometry/LayerRules.java trunk/software/host/src/org/reprap/geometry/Producer.java trunk/software/host/src/org/reprap/geometry/polygons/RrPolygon.java trunk/software/host/src/org/reprap/geometry/polygons/RrPolygonList.java trunk/software/host/src/org/reprap/gui/Panel3D.java Modified: trunk/software/host/lib/reprap.properties.dist =================================================================== --- trunk/software/host/lib/reprap.properties.dist 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/lib/reprap.properties.dist 2010-10-21 23:29:32 UTC (rev 3841) @@ -1,11 +1,8 @@ #RepRap machine parameters. See http://objects.reprap.org/wiki/Java_Software_Preferences_File -#Thu Oct 07 10:36:51 BST 2010 -BackColourB(0..1)=0.9 -BackColourG(0..1)=0.9 -BackColourR(0..1)=0.9 +#Sun Oct 17 20:36:30 BST 2010 BaudRate=57600 BedTemperature(C)=55 -CommsDebug=true +CommsDebug=false Debug=false DumpX(mm)=130 DumpY(mm)=5 @@ -38,6 +35,7 @@ Extruder0_Lift(mm)=0 Extruder0_MaterialType(name)=PLA Extruder0_MaxAcceleration(mm/minute/minute)=1200000.0 +Extruder0_MiddleStart=true Extruder0_NumberOfShells(0..N)=1 Extruder0_OddHatchDirection(degrees)=-45 Extruder0_OffsetX(mm)=0 @@ -81,6 +79,7 @@ Extruder1_Lift(mm)=0 Extruder1_MaterialType(name)=PLA-support Extruder1_MaxAcceleration(mm/minute/minute)=1200000.0 +Extruder1_MiddleStart=true Extruder1_NumberOfShells(0..N)=0 Extruder1_OddHatchDirection(degrees)=45 Extruder1_OffsetX(mm)=0 @@ -124,6 +123,7 @@ Extruder2_Lift(mm)=0 Extruder2_MaterialType(name)=PLA-infill Extruder2_MaxAcceleration(mm/minute/minute)=1200000.0 +Extruder2_MiddleStart=true Extruder2_NumberOfShells(0..N)=1 Extruder2_OddHatchDirection(degrees)=-45 Extruder2_OffsetX(mm)=0 @@ -168,6 +168,7 @@ Extruder3_Lift(mm)=1 Extruder3_MaterialType(name)=PCB-pen Extruder3_MaxAcceleration(mm/minute/minute)=1200000.0 +Extruder3_MiddleStart=true Extruder3_NumberOfShells(0..N)=1 Extruder3_OddHatchDirection(degrees)=-45 Extruder3_OffsetX(mm)=0 @@ -188,9 +189,6 @@ FiveD=true FoundationLayers=0 InterLayerCooling=true -MachineColourB(0..1)=0.3 -MachineColourG(0..1)=0.4 -MachineColourR(0..1)=0.3 MaxXYAcceleration(mm/mininute/minute)=1200000 MaxZAcceleration(mm/mininute/minute)=3000 MaximumFeedrateX(mm/minute)=3500 @@ -199,15 +197,9 @@ NumberOfExtruders=4 PathOptimise=true Port(name)=/dev/ttyUSB0 -SelectedColourB(0..1)=0.2 -SelectedColourG(0..1)=0.2 -SelectedColourR(0..1)=0.6 Shield=true SlowXYFeedrate(mm/minute)=1500.0 SlowZFeedrate(mm/minute)=50.0 -UnselectedColourB(0..1)=0.3 -UnselectedColourG(0..1)=0.3 -UnselectedColourR(0..1)=0.3 WorkingX(mm)=300 WorkingY(mm)=300 WorkingZ(mm)=300 Modified: trunk/software/host/src/org/reprap/Preferences.java =================================================================== --- trunk/software/host/src/org/reprap/Preferences.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/Preferences.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -83,9 +83,7 @@ Color3f unselectedColour = null; try { - unselectedColour = new Color3f((float)Preferences.loadGlobalDouble("UnselectedColourR(0..1)"), - (float)Preferences.loadGlobalDouble("UnselectedColourG(0..1)"), - (float)Preferences.loadGlobalDouble("UnselectedColourB(0..1)")); + unselectedColour = new Color3f((float)0.3, (float)0.3, (float)0.3); } catch (Exception ex) { ex.printStackTrace(); Modified: trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java =================================================================== --- trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -214,6 +214,13 @@ bufferThread = null; } + + private void nonRunningWarning(String s) + { + if(nonRunningWarn) + Debug.d("GCodeReaderAndWriter(): attempt to " + s + " a non-running output buffer. Further attempts will not be reported."); + nonRunningWarn = false; + } public boolean buildingFromFile() @@ -506,9 +513,7 @@ if(serialOutStream == null) { - if(nonRunningWarn) - Debug.d("bufferQueue: attempt to queue: " + cmd + " to a non-running output buffer. Further attempts will not be reported."); - nonRunningWarn = false; + nonRunningWarning("queue: \"" + cmd + "\" to"); return; } if(retries > 3) @@ -577,7 +582,7 @@ { if(serialOutStream == null) { - Debug.d("getETemp(): non-running output buffer."); + nonRunningWarning("getETemp() from "); return 0; } if(eTemp == Double.NEGATIVE_INFINITY) @@ -596,7 +601,7 @@ { if(serialOutStream == null) { - Debug.d("getBTemp(): non-running output buffer."); + nonRunningWarning("getBTemp() from "); return 0; } if(bTemp == Double.NEGATIVE_INFINITY) @@ -615,7 +620,7 @@ { if(serialOutStream == null) { - Debug.d("getX(): non-running output buffer."); + nonRunningWarning("getX() from "); return 0; } if(x == Double.NEGATIVE_INFINITY) @@ -634,7 +639,7 @@ { if(serialOutStream == null) { - Debug.d("getY(): non-running output buffer."); + nonRunningWarning("getY() from "); return 0; } if(y == Double.NEGATIVE_INFINITY) @@ -653,7 +658,7 @@ { if(serialOutStream == null) { - Debug.d("getZ(): non-running output buffer."); + nonRunningWarning("getZ() from "); return 0; } if(z == Double.NEGATIVE_INFINITY) @@ -672,7 +677,7 @@ { if(serialOutStream == null) { - Debug.d("getE(): non-running output buffer."); + nonRunningWarning("getE() from "); return 0; } if(e == Double.NEGATIVE_INFINITY) Modified: trunk/software/host/src/org/reprap/devices/GenericExtruder.java =================================================================== --- trunk/software/host/src/org/reprap/devices/GenericExtruder.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/devices/GenericExtruder.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -420,7 +420,7 @@ fastEFeedrate = Preferences.loadGlobalDouble(prefName + "FastEFeedrate(mm/minute)"); slowXYFeedrate = Preferences.loadGlobalDouble(prefName + "SlowXYFeedrate(mm/minute)"); maxAcceleration = Preferences.loadGlobalDouble(prefName + "MaxAcceleration(mm/minute/minute)"); - middleStart = true; //Preferences.loadGlobalBool(prefName + "MiddleStart"); + middleStart = Preferences.loadGlobalBool(prefName + "MiddleStart"); t0 = 0; //Preferences.loadGlobalInt(prefName + "t0(0..255)"); iSpeed = Preferences.loadGlobalDouble(prefName + "InfillSpeed(0..1)"); oSpeed = Preferences.loadGlobalDouble(prefName + "OutlineSpeed(0..1)"); Modified: trunk/software/host/src/org/reprap/geometry/LayerProducer.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/LayerProducer.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/geometry/LayerProducer.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -567,8 +567,8 @@ if(extrudeBackLength > 0 && valveBackLength > 0) Debug.e("LayerProducer.plot(): extruder has both valve backoff and extrude backoff specified."); - p.backStep(extrudeBackLength); - p.backStep(valveBackLength); + p.backStepExtrude(extrudeBackLength); + p.backStepValve(valveBackLength); // // if(extrudeBackLength > 0 && acc) // stopExtruding = p.findBackPoint(extrudeBackLength); @@ -647,8 +647,8 @@ currentFeedrate = p.speed(i); oldexoff = extrudeOff; - extrudeOff = (i > p.drawEnd() && extrudeBackLength > 0) || i == p.size()-1; - valveOff = (i > p.drawEnd() && valveBackLength > 0) || i == p.size()-1; + extrudeOff = (i > p.extrudeEnd() && extrudeBackLength > 0) || i == p.size()-1; + valveOff = (i > p.valveEnd() && valveBackLength > 0) || i == p.size()-1; plot(p.point(i), next, extrudeOff, valveOff); if(oldexoff ^ extrudeOff) printer.printEndReverse(); Modified: trunk/software/host/src/org/reprap/geometry/LayerRules.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/LayerRules.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/geometry/LayerRules.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -6,6 +6,7 @@ import org.reprap.geometry.polygons.RrHalfPlane; import org.reprap.geometry.polygons.RrRectangle; import org.reprap.geometry.polygons.Rr2Point; +import org.reprap.geometry.polygons.RrPolygonList; import org.reprap.Preferences; import org.reprap.utilities.Debug; @@ -14,8 +15,28 @@ * rules for such things as infill patterns, support patterns etc. */ public class LayerRules -{ +{ /** + * The coordinates of the first point plotted in a layer + */ + public Rr2Point[] firstPoint; + + /** + * The extruder first used in a layer + */ + public int[] firstExtruder; + + /** + * The coordinates of the last point plotted in a layer + */ + public Rr2Point[] lastPoint; + + /** + * The extruder last used in a layer + */ + public int[] lastExtruder; + + /** * The machine */ private Printer printer; @@ -142,6 +163,11 @@ machineLayer = 0; } addToStep = 0; + + firstPoint = new Rr2Point[modelLayerMax+1]; + firstExtruder = new int[modelLayerMax+1]; + lastPoint = new Rr2Point[modelLayerMax+1]; + lastExtruder = new int[modelLayerMax+1]; layingSupport = found; Extruder[] es = printer.getExtruders(); @@ -184,6 +210,54 @@ public int getModelLayer() { return modelLayer; } + public void setFirstAndLast(RrPolygonList[] pl) + { + firstPoint[modelLayer] = null; + lastPoint[modelLayer] = null; + firstExtruder[modelLayer] = -1; + lastExtruder[modelLayer] = -1; + if(pl == null) + return; + if(pl.length <= 0) + return; + if(pl[0] == null) + return; + if(pl[0].size() <= 0) + return; + if(pl[0].polygon(0) == null) + return; + if(pl[0].polygon(0).size() <= 0) + return; + if(pl[pl.length - 1].size() <= 0) + return; + if(pl[pl.length - 1].polygon(pl[pl.length - 1].size()-1).size() <= 0) + return; + firstPoint[modelLayer] = pl[0].polygon(0).point(0); + firstExtruder[modelLayer] = pl[0].polygon(0).getAttributes().getExtruder().getID(); + lastPoint[modelLayer] = pl[pl.length - 1].polygon(pl[pl.length - 1].size()-1).point(pl[pl.length - 1].polygon(pl[pl.length - 1].size()-1).size() - 1); + lastExtruder[modelLayer] = pl[pl.length - 1].polygon(pl[pl.length - 1].size()-1).getAttributes().getExtruder().getID(); + } + + public Rr2Point getFirstPoint(int layer) + { + return firstPoint[layer]; + } + + public Rr2Point getLastPoint(int layer) + { + return lastPoint[layer]; + } + + public int getFirstExtruder(int layer) + { + return firstExtruder[layer]; + } + + public int getLastExtruder(int layer) + { + return lastExtruder[layer]; + } + public int getModelLayerMax() { return modelLayerMax; } public int getMachineLayerMax() { return machineLayerMax; } Modified: trunk/software/host/src/org/reprap/geometry/Producer.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/Producer.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/geometry/Producer.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -340,6 +340,7 @@ LayerProducer lp = new LayerProducer(allPolygons, layerRules, simulationPlot); + layerRules.setFirstAndLast(allPolygons); lp.plot(); reprap.finishedLayer(layerRules); Modified: trunk/software/host/src/org/reprap/geometry/polygons/RrPolygon.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/RrPolygon.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/geometry/polygons/RrPolygon.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -122,9 +122,14 @@ /** * The index of the last point to draw to, if there are more that should just be moved over */ - private int drawEnd; + private int extrudeEnd; /** + * The index of the last point at which the valve (if any) is open. + */ + private int valveEnd; + + /** * Destroy me and all that I point to */ public void destroy() @@ -187,7 +192,8 @@ att = a; box = new RrRectangle(); closed = c; - drawEnd = -1; + extrudeEnd = -1; + valveEnd = -1; } /** @@ -252,13 +258,25 @@ * What's the last point to plot to? * @return */ - public int drawEnd() + public int extrudeEnd() { - if(drawEnd < 0) + if(extrudeEnd < 0) return size() - 1; else - return drawEnd; + return extrudeEnd; } + + /** + * What's the last point at which the valve should be open to? + * @return + */ + public int valveEnd() + { + if(valveEnd < 0) + return size() - 1; + else + return valveEnd; + } /** * Length @@ -285,7 +303,8 @@ speeds.add(new Double(p.speed(i))); } closed = p.closed; - drawEnd = p.drawEnd; + extrudeEnd = p.extrudeEnd; + valveEnd = p.valveEnd; } /** @@ -312,8 +331,10 @@ Debug.e("Rr2Point.add(): adding a point to a polygon with its speeds set."); points.add(i, new Rr2Point(p)); box.expand(p); - if(i <= drawEnd) - drawEnd++; + if(i <= extrudeEnd) + extrudeEnd++; + if(i <= valveEnd) + valveEnd++; } /** @@ -342,9 +363,11 @@ points.add(i, new Rr2Point(p)); speeds.add(i, s); box.expand(p); - if(i <= drawEnd) - drawEnd++; - } + if(i <= extrudeEnd) + extrudeEnd++; + if(i <= valveEnd) + valveEnd++; + } /** * Set a new point and speed @@ -382,12 +405,21 @@ * Eet the last point to plot to * @param d */ - public void setDrawEnd(int d) + public void setExtrudeEnd(int d) { - drawEnd = d; + extrudeEnd = d; } /** + * Eet the last point to valve-open to + * @param d + */ + public void setValveEnd(int d) + { + valveEnd = d; + } + + /** * @return the attributes */ public Attributes getAttributes() { return att; } @@ -406,12 +438,14 @@ { if(p.size() == 0) return; - if(drawEnd >= 0) - Debug.e("Rr2Point.add(): adding a polygon to another polygon with its draw ending set."); + if(extrudeEnd >= 0 || valveEnd >= 0) + Debug.e("Rr2Point.add(): adding a polygon to another polygon with its extrude or valve ending set."); for(int i = 0; i < p.size(); i++) { - if(i == p.drawEnd) - drawEnd = size(); + if(i == p.extrudeEnd) + extrudeEnd = size(); + if(i == p.valveEnd) + valveEnd = size(); points.add(new Rr2Point(p.point(i))); } box.expand(p.box); @@ -448,22 +482,28 @@ Debug.e("Rr2Point.add(): attempt to add a polygon to another polygon when one has speeds and the other doesn't."); return; } - if(k <= drawEnd) - Debug.e("Rr2Point.add(): adding a polygon to another polygon with its draw ending set."); + if(k <= extrudeEnd || k <= valveEnd) + Debug.e("Rr2Point.add(): adding a polygon to another polygon with its extrude or valve ending set."); int de = -1; - if (drawEnd >= 0) - de = drawEnd + p.size(); + int dv = -1; + if (extrudeEnd >= 0) + de = extrudeEnd + p.size(); + if (valveEnd >= 0) + dv = valveEnd + p.size(); for(int i = 0; i < p.size(); i++) { - if(i == p.drawEnd) - drawEnd = size(); + if(i == p.extrudeEnd) + extrudeEnd = size(); + if(i == p.valveEnd) + valveEnd = size(); if(speeds != null) add(k, new Rr2Point(p.point(i)), p.speed(i)); else points.add(k, new Rr2Point(p.point(i))); k++; } - drawEnd = Math.max(drawEnd, de); + extrudeEnd = Math.max(extrudeEnd, de); + valveEnd = Math.max(valveEnd, dv); box.expand(p.box); } @@ -515,8 +555,8 @@ */ public RrPolygon negate() { - if(drawEnd >= 0) - Debug.e("Rr2Point.negate(): negating a polygon with its draw ending set."); + if(extrudeEnd >= 0 || valveEnd >= 0) + Debug.e("Rr2Point.negate(): negating a polygon with its extrude or valve ending set."); RrPolygon result = new RrPolygon(att, closed); for(int i = size() - 1; i >= 0; i--) { @@ -536,8 +576,8 @@ */ public RrPolygon randomStart() { - if(drawEnd >= 0) - Debug.e("Rr2Point.randomStart(: randomizing a polygon with its draw ending set."); + if(extrudeEnd >= 0 || valveEnd >= 0) + Debug.e("Rr2Point.randomStart(: randomizing a polygon with its extrude or valve ending set."); return newStart(rangen.nextInt(size())); } @@ -548,8 +588,8 @@ { if(!isClosed()) Debug.e("RrPolygon.newStart(i): reordering an open polygon!"); - if(drawEnd >= 0) - Debug.e("Rr2Point.newStart(i): reordering a polygon with its draw ending set."); + if(extrudeEnd >= 0 || valveEnd >= 0) + Debug.e("Rr2Point.newStart(i): reordering a polygon with its extrude or valve ending set."); if(i < 0 || i >= size()) { Debug.e("RrPolygon.newStart(i): dud index: " + i); @@ -576,8 +616,8 @@ { if(size() == 0 || lc.getModelLayer() < 0) return this; - if(drawEnd >= 0) - Debug.e("Rr2Point.incrementedStart(): incrementing a polygon with its draw ending set."); + if(extrudeEnd >= 0 || valveEnd >= 0) + Debug.e("Rr2Point.incrementedStart(): incrementing a polygon with its extrude or valve ending set."); int i = lc.getModelLayer() % size(); return newStart(i); } @@ -620,10 +660,8 @@ { if(!p.isClosed()) Debug.e("RrPolygon.nearestVertexReorder(): called for non-closed polygon."); - if(drawEnd >= 0 || p.drawEnd >= 0) - Debug.e("Rr2Point.nearestVertexReorderMerge(): merging polygons with a draw ending set."); - if(drawEnd >= 0) - Debug.e("Rr2Point.add(): incrementing a polygon with its draw ending set."); + if(extrudeEnd >= 0 || p.extrudeEnd >= 0 || valveEnd >= 0 || p.valveEnd >= 0) + Debug.e("Rr2Point.nearestVertexReorderMerge(): merging polygons with a extrude or valve ending set."); double d = Double.POSITIVE_INFINITY; int myPoint = -1; int itsPoint = -1; @@ -692,12 +730,12 @@ } /** - * Backtrack a given distance, inserting a new point there and set drawEnd to it. + * Backtrack a given distance, inserting a new point there and set extrudeEnd to it. * If drawEnd is already set, backtrack from that. * @param distance to backtrack * @return index of the inserted point */ - public void backStep(double d) + public void backStepExtrude(double d) { if(d <= 0) return; @@ -705,12 +743,12 @@ Rr2Point p, q; int start, last; - if(drawEnd >= 0) - start = drawEnd; + if(extrudeEnd >= 0) + start = extrudeEnd; else start = size() - 1; - if(!isClosed() && drawEnd < 0) + if(!isClosed() && extrudeEnd < 0) start--; if (start >= size() - 1) @@ -745,15 +783,78 @@ if(speeds != null) speeds.add(new Double(s)); } - drawEnd = j; + extrudeEnd = j; return; } last = i; } - drawEnd = 0; + extrudeEnd = 0; } + /** + * Backtrack a given distance, inserting a new point there and set valveEnd to it. + * If drawEnd is already set, backtrack from that. + * @param distance to backtrack + * @return index of the inserted point + */ + public void backStepValve(double d) + { + if(d <= 0) + return; + + Rr2Point p, q; + int start, last; + + if(valveEnd >= 0) + start = valveEnd; + else + start = size() - 1; + + if(!isClosed() && valveEnd < 0) + start--; + + if (start >= size() - 1) + last = 0; + else + last = start + 1; + + double sum = 0; + for(int i = start; i >= 0; i--) + { + sum += Rr2Point.d(point(i), point(last)); + if(sum > d) + { + sum = sum - d; + q = Rr2Point.sub(point(last), point(i)); + p = Rr2Point.add(point(i), Rr2Point.mul(sum/q.mod(), q)); + double s = 0; + if(speeds != null) + { + s = speeds.get(last) - speeds.get(i); + s = speeds.get(i) + s*sum/q.mod(); + } + int j = i + 1; + if(j < size()) + { + points.add(j, p); + if(speeds != null) + speeds.add(j, new Double(s)); + } else + { + points.add(p); + if(speeds != null) + speeds.add(new Double(s)); + } + valveEnd = j; + return; + } + last = i; + } + valveEnd = 0; + } + + /** * Search back from the end of the polygon to find the vertex nearest to d back from the end * @param d * @return the index of the nearest vertex Modified: trunk/software/host/src/org/reprap/geometry/polygons/RrPolygonList.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/RrPolygonList.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/geometry/polygons/RrPolygonList.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -967,22 +967,23 @@ RrPolygon pg = pp.polygon(); outline.add(start); + outline.setExtrudeEnd(outline.size() - 1); if(en >= st) { for(int j = st; j <= en; j++) { outline.add(0, pg.point(j)); // Put it on the beginning... - //if(j < en) - // outline.add(pg.point(j)); // ...and the end. + if(j < en) + outline.add(pg.point(j)); // ...and the end. } } else { for(int j = st; j >= en; j--) { outline.add(0, pg.point(j)); - //if(j > en) - // outline.add(pg.point(j)); + if(j > en) + outline.add(pg.point(j)); } } Modified: trunk/software/host/src/org/reprap/gui/Panel3D.java =================================================================== --- trunk/software/host/src/org/reprap/gui/Panel3D.java 2010-10-20 10:17:44 UTC (rev 3840) +++ trunk/software/host/src/org/reprap/gui/Panel3D.java 2010-10-21 23:29:32 UTC (rev 3841) @@ -137,21 +137,29 @@ // The background, and other colours - bgColour = new Color3f((float)Preferences.loadGlobalDouble("BackColourR(0..1)"), - (float)Preferences.loadGlobalDouble("BackColourG(0..1)"), - (float)Preferences.loadGlobalDouble("BackColourB(0..1)")); +// bgColour = new Color3f((float)Preferences.loadGlobalDouble("BackColourR(0..1)"), +// (float)Preferences.loadGlobalDouble("BackColourG(0..1)"), +// (float)Preferences.loadGlobalDouble("BackColourB(0..1)")); +// +// selectedColour = new Color3f((float)Preferences.loadGlobalDouble("SelectedColourR(0..1)"), +// (float)Preferences.loadGlobalDouble("SelectedColourG(0..1)"), +// (float)Preferences.loadGlobalDouble("SelectedColourB(0..1)")); +// +// machineColour = new Color3f((float)Preferences.loadGlobalDouble("MachineColourR(0..1)"), +// (float)Preferences.loadGlobalDouble("MachineColourG(0..1)"), +// (float)Preferences.loadGlobalDouble("MachineColourB(0..1)")); +// +// unselectedColour = new Color3f((float)Preferences.loadGlobalDouble("UnselectedColourR(0..1)"), +// (float)Preferences.loadGlobalDouble("UnselectedColourG(0..1)"), +// (float)Preferences.loadGlobalDouble("UnselectedColourB(0..1)")); - selectedColour = new Color3f((float)Preferences.loadGlobalDouble("SelectedColourR(0..1)"), - (float)Preferences.loadGlobalDouble("SelectedColourG(0..1)"), - (float)Preferences.loadGlobalDouble("SelectedColourB(0..1)")); + bgColour = new Color3f((float)0.9, (float)0.9, (float)0.9); + + selectedColour = new Color3f((float)0.6, (float)0.2, (float)0.2); - machineColour = new Color3f((float)Preferences.loadGlobalDouble("MachineColourR(0..1)"), - (float)Preferences.loadGlobalDouble("MachineColourG(0..1)"), - (float)Preferences.loadGlobalDouble("MachineColourB(0..1)")); + machineColour = new Color3f((float)0.3, (float)0.4, (float)0.3); - unselectedColour = new Color3f((float)Preferences.loadGlobalDouble("UnselectedColourR(0..1)"), - (float)Preferences.loadGlobalDouble("UnselectedColourG(0..1)"), - (float)Preferences.loadGlobalDouble("UnselectedColourB(0..1)")); + unselectedColour = new Color3f((float)0.3, (float)0.3, (float)0.3); } catch (Exception ex) { Debug.e("Refresh Panel3D preferences: " + ex.toString()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2011-01-12 09:43:56
|
Revision: 3997 http://reprap.svn.sourceforge.net/reprap/?rev=3997&view=rev Author: adrian-bowyer Date: 2011-01-12 09:43:49 +0000 (Wed, 12 Jan 2011) Log Message: ----------- Minor improvement to the multiple outline code. Modified Paths: -------------- trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java Added Paths: ----------- trunk/software/host/lib/reprap.ico Added: trunk/software/host/lib/reprap.ico =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/reprap.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java 2011-01-12 04:53:18 UTC (rev 3996) +++ trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java 2011-01-12 09:43:49 UTC (rev 3997) @@ -136,8 +136,17 @@ } if(outline) { - for(int shell = 0; shell < shells; shell++) - result.add(get(i).offset(-multiplier*((double)shell + 0.5)*e.getExtrusionSize())); + int shell = 0; + boolean carryOn = true; + while(carryOn && shell < shells) + { + BooleanGrid thisOne = get(i).offset(-multiplier*((double)shell + 0.5)*e.getExtrusionSize()); + if(thisOne.isEmpty()) + carryOn = false; + else + result.add(thisOne); + shell++; + } } else { // Must be a hatch. Only do it if the gap is +ve or we're building the foundation @@ -150,7 +159,7 @@ offSize = 3; else offSize = -multiplier*((double)shells + 0.5)*e.getExtrusionSize() + ife.getInfillOverlap(); - if (e.getExtrusionInfillWidth() > 0 || foundation) // Z valuesn't mattere here + if (e.getExtrusionInfillWidth() > 0 || foundation) // Z value doesn't matter here result.add(get(i).offset(offSize)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2011-02-05 14:03:32
|
Revision: 4026 http://reprap.svn.sourceforge.net/reprap/?rev=4026&view=rev Author: adrian-bowyer Date: 2011-02-05 14:03:26 +0000 (Sat, 05 Feb 2011) Log Message: ----------- Properties file updated to the current best-quality settings. Modified Paths: -------------- trunk/software/host/lib/reprap.properties.dist trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java Modified: trunk/software/host/lib/reprap.properties.dist =================================================================== --- trunk/software/host/lib/reprap.properties.dist 2011-02-02 17:58:01 UTC (rev 4025) +++ trunk/software/host/lib/reprap.properties.dist 2011-02-05 14:03:26 UTC (rev 4026) @@ -1,10 +1,10 @@ #RepRap machine parameters. See http://objects.reprap.org/wiki/Java_Software_Preferences_File -#Sun Oct 17 20:36:30 BST 2010 +#Sat Feb 05 12:52:42 GMT 2011 BaudRate=57600 -BedTemperature(C)=55 +BedTemperature(C)=65 CommsDebug=false Debug=false -DumpX(mm)=130 +DumpX(mm)=143 DumpY(mm)=5 Extruder0_Address=0 Extruder0_ArcCompensationFactor(0..)=8 @@ -20,13 +20,13 @@ Extruder0_ExtrusionDelayForPolygon(ms)=0 Extruder0_ExtrusionFoundationWidth(mm)=2 Extruder0_ExtrusionHeight(mm)=0.3 -Extruder0_ExtrusionInfillWidth(mm)=0.7 +Extruder0_ExtrusionInfillWidth(mm)=0.5 Extruder0_ExtrusionLastFoundationWidth(mm)=2 Extruder0_ExtrusionOverRun(mm)=-1 Extruder0_ExtrusionPWM(0..1)=-1 Extruder0_ExtrusionSize(mm)=0.5 -Extruder0_ExtrusionSpeed(mm/minute)=3500 -Extruder0_ExtrusionTemp(C)=220 +Extruder0_ExtrusionSpeed(mm/minute)=3000 +Extruder0_ExtrusionTemp(C)=205 Extruder0_FastEFeedrate(mm/minute)=18000.0 Extruder0_FastXYFeedrate(mm/minute)=4000.0 Extruder0_InFillMaterialType(name)=PLA-infill @@ -36,7 +36,7 @@ Extruder0_MaterialType(name)=PLA Extruder0_MaxAcceleration(mm/minute/minute)=1200000.0 Extruder0_MiddleStart=true -Extruder0_NumberOfShells(0..N)=1 +Extruder0_NumberOfShells(0..N)=2 Extruder0_OddHatchDirection(degrees)=-45 Extruder0_OffsetX(mm)=0 Extruder0_OffsetY(mm)=0 @@ -69,8 +69,8 @@ Extruder1_ExtrusionOverRun(mm)=3 Extruder1_ExtrusionPWM(0..1)=-1 Extruder1_ExtrusionSize(mm)=0.5 -Extruder1_ExtrusionSpeed(mm/minute)=3500 -Extruder1_ExtrusionTemp(C)=220 +Extruder1_ExtrusionSpeed(mm/minute)=3000 +Extruder1_ExtrusionTemp(C)=205 Extruder1_FastEFeedrate(mm/minute)=18000.0 Extruder1_FastXYFeedrate(mm/minute)=4000.0 Extruder1_InFillMaterialType(name)=PLA-support @@ -113,8 +113,8 @@ Extruder2_ExtrusionOverRun(mm)=0 Extruder2_ExtrusionPWM(0..1)=-1 Extruder2_ExtrusionSize(mm)=0.5 -Extruder2_ExtrusionSpeed(mm/minute)=3500 -Extruder2_ExtrusionTemp(C)=220 +Extruder2_ExtrusionSpeed(mm/minute)=3000 +Extruder2_ExtrusionTemp(C)=205 Extruder2_FastEFeedrate(mm/minute)=18000.0 Extruder2_FastXYFeedrate(mm/minute)=4000.0 Extruder2_InFillMaterialType(name)=PLA-infill @@ -196,7 +196,7 @@ MaximumFeedrateZ(mm/minute)=50 NumberOfExtruders=4 PathOptimise=true -Port(name)=/dev/ttyUSB0 +Port(name)=/dev/ttyUSB0 Shield=true SlowXYFeedrate(mm/minute)=1500.0 SlowZFeedrate(mm/minute)=50.0 Modified: trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java 2011-02-02 17:58:01 UTC (rev 4025) +++ trunk/software/host/src/org/reprap/geometry/polygons/AllSTLsToBuild.java 2011-02-05 14:03:26 UTC (rev 4026) @@ -118,7 +118,7 @@ private int[] layerNumber; private int ringPointer; private final int noLayer = Integer.MIN_VALUE; - private final int ringSize = 7; + private final int ringSize = 5; public SliceCache() { @@ -735,10 +735,10 @@ BooleanGridList adjacentSlices = slice(stl, layer+1, layerConditions); adjacentSlices = BooleanGridList.intersections(slice(stl, layer+2, layerConditions), adjacentSlices); - adjacentSlices = BooleanGridList.intersections(slice(stl, layer+3, layerConditions), adjacentSlices); + //adjacentSlices = BooleanGridList.intersections(slice(stl, layer+3, layerConditions), adjacentSlices); adjacentSlices = BooleanGridList.intersections(slice(stl, layer-1, layerConditions), adjacentSlices); adjacentSlices = BooleanGridList.intersections(slice(stl, layer-2, layerConditions), adjacentSlices); - adjacentSlices = BooleanGridList.intersections(slice(stl, layer-3, layerConditions), adjacentSlices); + //adjacentSlices = BooleanGridList.intersections(slice(stl, layer-3, layerConditions), adjacentSlices); BooleanGridList insides = null; // The insides are the bits that aren't surface. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2011-04-04 10:23:42
|
Revision: 4076 http://reprap.svn.sourceforge.net/reprap/?rev=4076&view=rev Author: adrian-bowyer Date: 2011-04-04 10:23:31 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Bug fixed whereby the control panel ignored the set axis lengths. Modified Paths: -------------- trunk/software/host/lib/reprap.properties.dist trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java Modified: trunk/software/host/lib/reprap.properties.dist =================================================================== --- trunk/software/host/lib/reprap.properties.dist 2011-04-04 00:02:08 UTC (rev 4075) +++ trunk/software/host/lib/reprap.properties.dist 2011-04-04 10:23:31 UTC (rev 4076) @@ -1,10 +1,10 @@ +#Mon Apr 04 11:22:07 BST 2011 #RepRap machine parameters. See http://objects.reprap.org/wiki/Java_Software_Preferences_File -#Sat Feb 05 12:52:42 GMT 2011 BaudRate=57600 -BedTemperature(C)=65 +BedTemperature(C)=55 CommsDebug=false Debug=false -DumpX(mm)=143 +DumpX(mm)=130 DumpY(mm)=5 Extruder0_Address=0 Extruder0_ArcCompensationFactor(0..)=8 @@ -20,13 +20,13 @@ Extruder0_ExtrusionDelayForPolygon(ms)=0 Extruder0_ExtrusionFoundationWidth(mm)=2 Extruder0_ExtrusionHeight(mm)=0.3 -Extruder0_ExtrusionInfillWidth(mm)=0.5 +Extruder0_ExtrusionInfillWidth(mm)=0.7 Extruder0_ExtrusionLastFoundationWidth(mm)=2 Extruder0_ExtrusionOverRun(mm)=-1 Extruder0_ExtrusionPWM(0..1)=-1 Extruder0_ExtrusionSize(mm)=0.5 -Extruder0_ExtrusionSpeed(mm/minute)=3000 -Extruder0_ExtrusionTemp(C)=205 +Extruder0_ExtrusionSpeed(mm/minute)=3500 +Extruder0_ExtrusionTemp(C)=220 Extruder0_FastEFeedrate(mm/minute)=18000.0 Extruder0_FastXYFeedrate(mm/minute)=4000.0 Extruder0_InFillMaterialType(name)=PLA-infill @@ -69,8 +69,8 @@ Extruder1_ExtrusionOverRun(mm)=3 Extruder1_ExtrusionPWM(0..1)=-1 Extruder1_ExtrusionSize(mm)=0.5 -Extruder1_ExtrusionSpeed(mm/minute)=3000 -Extruder1_ExtrusionTemp(C)=205 +Extruder1_ExtrusionSpeed(mm/minute)=3500 +Extruder1_ExtrusionTemp(C)=220 Extruder1_FastEFeedrate(mm/minute)=18000.0 Extruder1_FastXYFeedrate(mm/minute)=4000.0 Extruder1_InFillMaterialType(name)=PLA-support @@ -113,8 +113,8 @@ Extruder2_ExtrusionOverRun(mm)=0 Extruder2_ExtrusionPWM(0..1)=-1 Extruder2_ExtrusionSize(mm)=0.5 -Extruder2_ExtrusionSpeed(mm/minute)=3000 -Extruder2_ExtrusionTemp(C)=205 +Extruder2_ExtrusionSpeed(mm/minute)=3500 +Extruder2_ExtrusionTemp(C)=220 Extruder2_FastEFeedrate(mm/minute)=18000.0 Extruder2_FastXYFeedrate(mm/minute)=4000.0 Extruder2_InFillMaterialType(name)=PLA-infill @@ -196,10 +196,10 @@ MaximumFeedrateZ(mm/minute)=50 NumberOfExtruders=4 PathOptimise=true -Port(name)=/dev/ttyUSB0 +Port(name)=/dev/ttyUSB0 Shield=true SlowXYFeedrate(mm/minute)=1500.0 SlowZFeedrate(mm/minute)=50.0 -WorkingX(mm)=300 -WorkingY(mm)=300 -WorkingZ(mm)=300 +WorkingX(mm)=200 +WorkingY(mm)=200 +WorkingZ(mm)=150 Modified: trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java =================================================================== --- trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java 2011-04-04 00:02:08 UTC (rev 4075) +++ trunk/software/host/src/org/reprap/gui/botConsole/StepperPositionJPanel.java 2011-04-04 10:23:31 UTC (rev 4076) @@ -52,17 +52,17 @@ case 1: axis = "X"; //motor = printer.getXMotor(); - axisLength = 200; // TODO: Replace with Prefs when Java3D parameters work for small wv's. + axisLength = Preferences.loadGlobalDouble("WorkingX(mm)"); // TODO: Replace with Prefs when Java3D parameters work for small wv's. break; case 2: axis = "Y"; //motor = printer.getYMotor(); - axisLength = 200; // TODO: Replace with Prefs when Java3D parameters work for small wv's. + axisLength = Preferences.loadGlobalDouble("WorkingY(mm)"); // TODO: Replace with Prefs when Java3D parameters work for small wv's. break; case 3: axis = "Z"; //motor = printer.getZMotor(); - axisLength = 140; // TODO: Replace with Prefs when Java3D parameters work for small wv's. + axisLength = Preferences.loadGlobalDouble("WorkingZ(mm)"); // TODO: Replace with Prefs when Java3D parameters work for small wv's. break; default: axis = "X"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Rhy...@us...> - 2011-04-19 17:14:58
|
Revision: 4099 http://reprap.svn.sourceforge.net/reprap/?rev=4099&view=rev Author: Rhys-Jones Date: 2011-04-19 17:14:52 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Update to allow infill to be defined as a percentage Modified Paths: -------------- trunk/software/host/lib/reprap.properties.dist trunk/software/host/src/org/reprap/devices/GenericExtruder.java Modified: trunk/software/host/lib/reprap.properties.dist =================================================================== --- trunk/software/host/lib/reprap.properties.dist 2011-04-18 22:37:44 UTC (rev 4098) +++ trunk/software/host/lib/reprap.properties.dist 2011-04-19 17:14:52 UTC (rev 4099) @@ -23,6 +23,7 @@ Extruder0_ExtrusionInfillWidth(mm)=0.7 Extruder0_ExtrusionLastFoundationWidth(mm)=2 Extruder0_ExtrusionOverRun(mm)=-1 +Extruder0_ExtrusionPercentInfill(0..1)=0.71 Extruder0_ExtrusionPWM(0..1)=-1 Extruder0_ExtrusionSize(mm)=0.5 Extruder0_ExtrusionSpeed(mm/minute)=3500 @@ -86,6 +87,7 @@ Extruder1_OffsetY(mm)=0 Extruder1_OffsetZ(mm)=0 Extruder1_OutlineSpeed(0..1)=0.9 +Extruder1_ExtrusionPercentInfill(0..1)=0.20 Extruder1_Purge(ms)=30000 Extruder1_Reverse(ms)=1200 Extruder1_SlowXYFeedrate(mm/minute)=1500.0 @@ -111,6 +113,7 @@ Extruder2_ExtrusionInfillWidth(mm)=1.5 Extruder2_ExtrusionLastFoundationWidth(mm)=2 Extruder2_ExtrusionOverRun(mm)=0 +Extruder2_ExtrusionPercentInfill(0..1)=0.33 Extruder2_ExtrusionPWM(0..1)=-1 Extruder2_ExtrusionSize(mm)=0.5 Extruder2_ExtrusionSpeed(mm/minute)=3500 @@ -156,6 +159,7 @@ Extruder3_ExtrusionInfillWidth(mm)=1.5 Extruder3_ExtrusionLastFoundationWidth(mm)=2 Extruder3_ExtrusionOverRun(mm)=0 +Extruder3_ExtrusionPercentInfill(0..1)=0.20 Extruder3_ExtrusionPWM(0..1)=-1 Extruder3_ExtrusionSize(mm)=0.3 Extruder3_ExtrusionSpeed(mm/minute)=3000 Modified: trunk/software/host/src/org/reprap/devices/GenericExtruder.java =================================================================== --- trunk/software/host/src/org/reprap/devices/GenericExtruder.java 2011-04-18 22:37:44 UTC (rev 4098) +++ trunk/software/host/src/org/reprap/devices/GenericExtruder.java 2011-04-19 17:14:52 UTC (rev 4099) @@ -410,10 +410,13 @@ extrusionPWM = Preferences.loadGlobalDouble(prefName + "ExtrusionPWM(0..1)"); extrusionTemp = Preferences.loadGlobalDouble(prefName + "ExtrusionTemp(C)"); extrusionSize = Preferences.loadGlobalDouble(prefName + "ExtrusionSize(mm)"); - extrusionHeight = Preferences.loadGlobalDouble(prefName + "ExtrusionHeight(mm)"); - extrusionInfillWidth = Preferences.loadGlobalDouble(prefName + "ExtrusionInfillWidth(mm)"); - lowerFineLayers = 3; //Preferences.loadGlobalInt(prefName + "LowerFineLayers(0...)"); - upperFineLayers = 3; //Preferences.loadGlobalInt(prefName + "UpperFineLayers(0...)"); + extrusionHeight = Preferences.loadGlobalDouble(prefName + "ExtrusionHeight(mm)"); + if (Preferences.loadGlobalDouble(prefName + "ExtrusionInfillWidth(mm)")==-1) + extrusionInfillWidth = extrusionSize/Preferences.loadGlobalDouble(prefName + "ExtrusionPercentInfill(0..1)"); + else + extrusionInfillWidth = Preferences.loadGlobalDouble(prefName + "ExtrusionInfillWidth(mm)"); + lowerFineLayers = 2; //Preferences.loadGlobalInt(prefName + "LowerFineLayers(0...)"); + upperFineLayers = 2; //Preferences.loadGlobalInt(prefName + "UpperFineLayers(0...)"); extrusionBroadWidth = Preferences.loadGlobalDouble(prefName + "ExtrusionBroadWidth(mm)"); coolingPeriod = Preferences.loadGlobalDouble(prefName + "CoolingPeriod(s)"); fastXYFeedrate = Preferences.loadGlobalDouble(prefName + "FastXYFeedrate(mm/minute)"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2011-05-04 21:42:34
|
Revision: 4120 http://reprap.svn.sourceforge.net/reprap/?rev=4120&view=rev Author: adrian-bowyer Date: 2011-05-04 21:42:27 +0000 (Wed, 04 May 2011) Log Message: ----------- Bug whereby requests to re-send lines sometimes dropped into an infinite loop fixed. Modified Paths: -------------- trunk/software/host/lib/reprap.properties.dist trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java Modified: trunk/software/host/lib/reprap.properties.dist =================================================================== --- trunk/software/host/lib/reprap.properties.dist 2011-05-04 15:44:33 UTC (rev 4119) +++ trunk/software/host/lib/reprap.properties.dist 2011-05-04 21:42:27 UTC (rev 4120) @@ -1,209 +1,205 @@ -#Mon Apr 04 11:22:07 BST 2011 #RepRap machine parameters. See http://objects.reprap.org/wiki/Java_Software_Preferences_File -BaudRate=57600 -BedTemperature(C)=55 -CommsDebug=false +#Fri Apr 29 10:43:50 BST 2011 +Extruder0_ExtrusionLastFoundationWidth(mm)=2 +Extruder2_InfillSpeed(0..1)=1 +Extruder1_FastXYFeedrate(mm/minute)=2500.0 +Extruder2_CoolingPeriod(s)=-1 +Extruder2_ExtrudeRatio(0..)=1 +Extruder0_OffsetX(mm)=0 +Extruder1_ColourB(0..1)=0.3 +Extruder3_OutlineSpeed(0..1)=0.9 +Extruder1_OffsetY(mm)=0 +Extruder2_MaterialType(name)=PLA-infill +Extruder2_OffsetZ(mm)=0 +Extruder2_Reverse(ms)=1200 +Extruder3_SlowXYFeedrate(mm/minute)=1500.0 Debug=false -DumpX(mm)=130 -DumpY(mm)=5 -Extruder0_Address=0 +Extruder0_ValveDelayForLayer(ms)=200 +Extruder3_CoolingPeriod(s)=0.1 +Extruder2_ArcCompensationFactor(0..)=8 +Extruder1_ExtrusionPWM(0..1)=-1 +Extruder0_ExtrusionBroadWidth(mm)=-1 +SlowZFeedrate(mm/minute)=50.0 +MaximumFeedrateX(mm/minute)=2500 +WorkingY(mm)=300 +Extruder3_ExtrusionOverRun(mm)=0 +Extruder0_InfillSpeed(0..1)=1 +Extruder2_MaxAcceleration(mm/minute/minute)=1200000.0 +Extruder3_ValvePulseTime(ms)=500 Extruder0_ArcCompensationFactor(0..)=8 -Extruder0_ArcShortSides(0..)=1 -Extruder0_ColourB(0..1)=0.6 -Extruder0_ColourG(0..1)=0.3 -Extruder0_ColourR(0..1)=0.3 -Extruder0_CoolingPeriod(s)=-1 -Extruder0_EvenHatchDirection(degrees)=45 +Extruder3_ValveDelayForLayer(ms)=200 +DumpX(mm)=143 +Extruder3_SupportMaterialType(name)=null +Extruder1_ExtrusionLastFoundationWidth(mm)=1 +Extruder0_ExtrusionSpeed(mm/minute)=2500 +Extruder1_Address=0 +Extruder2_FastEFeedrate(mm/minute)=18000.0 +Extruder2_ExtrusionSize(mm)=0.5 +Extruder3_MiddleStart=true +Extruder3_MaterialType(name)=PCB-pen +Extruder3_ExtrusionHeight(mm)=0.25 +Extruder2_InFillMaterialType(name)=PLA-infill +Extruder2_ColourG(0..1)=0.8 +Extruder2_ExtrusionDelayForLayer(ms)=500 Extruder0_ExtrudeRatio(0..)=1 -Extruder0_ExtrusionBroadWidth(mm)=-1 +Extruder2_ExtrusionOverRun(mm)=0 +Extruder2_OddHatchDirection(degrees)=-45 +Extruder1_SlowXYFeedrate(mm/minute)=1500.0 +Extruder2_ExtrusionPWM(0..1)=-1 +Extruder1_MaxAcceleration(mm/minute/minute)=1200000.0 +Extruder1_ExtrusionBroadWidth(mm)=2.5 +Extruder2_ExtrusionHeight(mm)=0.25 +Extruder1_ValveDelayForPolygon(ms)=200 +Extruder2_ExtrusionInfillWidth(mm)=1.5 +Extruder3_ExtrusionDelayForPolygon(ms)=500 Extruder0_ExtrusionDelayForLayer(ms)=500 -Extruder0_ExtrusionDelayForPolygon(ms)=0 -Extruder0_ExtrusionFoundationWidth(mm)=2 -Extruder0_ExtrusionHeight(mm)=0.3 -Extruder0_ExtrusionInfillWidth(mm)=0.7 -Extruder0_ExtrusionLastFoundationWidth(mm)=2 -Extruder0_ExtrusionOverRun(mm)=-1 -Extruder0_ExtrusionPercentInfill(0..1)=0.71 -Extruder0_ExtrusionPWM(0..1)=-1 +Extruder1_SupportMaterialType(name)=null +Extruder0_OddHatchDirection(degrees)=-45 +Port(name)=/dev/ttyUSB0 +Extruder2_ExtrusionDelayForPolygon(ms)=50 +BaudRate=57600 +Extruder3_NumberOfShells(0..N)=1 +Extruder1_OffsetX(mm)=0 +Extruder0_ColourR(0..1)=0.3 +Extruder2_OffsetY(mm)=0 +Extruder1_ExtrusionDelayForPolygon(ms)=50 +Extruder2_ColourB(0..1)=0.3 +Extruder3_OffsetZ(mm)=0 +Extruder1_ExtrusionHeight(mm)=0.25 +Extruder3_ColourR(0..1)=0.3 +Extruder0_MiddleStart=true +Extruder3_Reverse(ms)=400 +Extruder2_InfillOverlap(mm)=0.2 +Extruder0_ArcShortSides(0..)=1 Extruder0_ExtrusionSize(mm)=0.5 -Extruder0_ExtrusionSpeed(mm/minute)=3500 -Extruder0_ExtrusionTemp(C)=220 -Extruder0_FastEFeedrate(mm/minute)=18000.0 -Extruder0_FastXYFeedrate(mm/minute)=4000.0 -Extruder0_InFillMaterialType(name)=PLA-infill -Extruder0_InfillOverlap(mm)=0.2 -Extruder0_InfillSpeed(0..1)=1 -Extruder0_Lift(mm)=0 -Extruder0_MaterialType(name)=PLA +Extruder2_FastXYFeedrate(mm/minute)=2500.0 +Shield=false +Extruder0_ExtrusionDelayForPolygon(ms)=50 +Extruder1_ExtrusionOverRun(mm)=3 +FoundationLayers=0 +Extruder2_ExtrusionLastFoundationWidth(mm)=2 +Extruder3_InfillSpeed(0..1)=0.9 +Extruder0_Reverse(ms)=1200 +WorkingX(mm)=300 +Extruder0_ExtrusionHeight(mm)=0.25 Extruder0_MaxAcceleration(mm/minute/minute)=1200000.0 -Extruder0_MiddleStart=true -Extruder0_NumberOfShells(0..N)=2 -Extruder0_OddHatchDirection(degrees)=-45 -Extruder0_OffsetX(mm)=0 -Extruder0_OffsetY(mm)=0 +Extruder3_ExtrusionSpeed(mm/minute)=2500 +Extruder1_ValveDelayForLayer(ms)=200 +Extruder2_NumberOfShells(0..N)=1 +Extruder3_ExtrusionPWM(0..1)=-1 +Extruder2_ExtrusionBroadWidth(mm)=6 Extruder0_OffsetZ(mm)=0 +Extruder0_InfillOverlap(mm)=0.2 +Extruder0_ExtrusionTemp(C)=205 +Extruder0_ExtrusionOverRun(mm)=-1 +Extruder3_ExtrusionLastFoundationWidth(mm)=2 +Extruder3_ExtrudeRatio(0..)=1 +MaximumFeedrateY(mm/minute)=2500 Extruder0_OutlineSpeed(0..1)=0.9 -Extruder0_Purge(ms)=30000 -Extruder0_Reverse(ms)=1200 -Extruder0_SlowXYFeedrate(mm/minute)=1500.0 -Extruder0_SupportMaterialType(name)=null -Extruder0_ValveDelayForLayer(ms)=200 -Extruder0_ValveDelayForPolygon(ms)=200 -Extruder0_ValveOverRun(mm)=-1 +Extruder1_InfillSpeed(0..1)=1 +NumberOfExtruders=4 +Extruder0_ColourG(0..1)=0.3 +Extruder2_Address=0 +MaxXYAcceleration(mm/mininute/minute)=1200000 +Extruder2_ValveDelayForPolygon(ms)=200 +Extruder0_FastEFeedrate(mm/minute)=18000.0 +Extruder3_ColourG(0..1)=0.3 +Extruder3_FastEFeedrate(mm/minute)=8000.0 +Extruder0_InFillMaterialType(name)=PLA-infill +Extruder1_ExtrusionTemp(C)=205 +Extruder1_NumberOfShells(0..N)=0 +Extruder3_ArcCompensationFactor(0..)=8 +Extruder0_FastXYFeedrate(mm/minute)=2500.0 +Extruder3_InFillMaterialType(name)=null +FiveD=true +BedTemperature(C)=65 +FinishY(mm)=190 Extruder0_ValvePulseTime(ms)=-500 -Extruder1_Address=0 Extruder1_ArcCompensationFactor(0..)=8 +Extruder0_ExtrusionInfillWidth(mm)=0.5 Extruder1_ArcShortSides(0..)=1 -Extruder1_ColourB(0..1)=0.3 -Extruder1_ColourG(0..1)=0.6 -Extruder1_ColourR(0..1)=0.9 -Extruder1_CoolingPeriod(s)=-1 -Extruder1_EvenHatchDirection(degrees)=45 +Extruder2_OffsetX(mm)=0 +Extruder2_SlowXYFeedrate(mm/minute)=1500.0 +Extruder3_ExtrusionSize(mm)=0.3 +Extruder3_ExtrusionBroadWidth(mm)=6 +Extruder3_ExtrusionInfillWidth(mm)=1.5 +Extruder3_OffsetY(mm)=0 +Extruder1_ExtrusionSpeed(mm/minute)=2500 +Extruder0_ColourB(0..1)=0.6 Extruder1_ExtrudeRatio(0..)=1 -Extruder1_ExtrusionBroadWidth(mm)=2.5 -Extruder1_ExtrusionDelayForLayer(ms)=500 -Extruder1_ExtrusionDelayForPolygon(ms)=0 -Extruder1_ExtrusionFoundationWidth(mm)=2 -Extruder1_ExtrusionHeight(mm)=0.3 -Extruder1_ExtrusionInfillWidth(mm)=2.5 -Extruder1_ExtrusionLastFoundationWidth(mm)=1 -Extruder1_ExtrusionOverRun(mm)=3 -Extruder1_ExtrusionPWM(0..1)=-1 -Extruder1_ExtrusionSize(mm)=0.5 -Extruder1_ExtrusionSpeed(mm/minute)=3500 -Extruder1_ExtrusionTemp(C)=220 -Extruder1_FastEFeedrate(mm/minute)=18000.0 -Extruder1_FastXYFeedrate(mm/minute)=4000.0 -Extruder1_InFillMaterialType(name)=PLA-support -Extruder1_InfillOverlap(mm)=0 -Extruder1_InfillSpeed(0..1)=1 -Extruder1_Lift(mm)=0 -Extruder1_MaterialType(name)=PLA-support -Extruder1_MaxAcceleration(mm/minute/minute)=1200000.0 +Extruder1_ColourR(0..1)=0.9 Extruder1_MiddleStart=true -Extruder1_NumberOfShells(0..N)=0 -Extruder1_OddHatchDirection(degrees)=45 -Extruder1_OffsetX(mm)=0 -Extruder1_OffsetY(mm)=0 -Extruder1_OffsetZ(mm)=0 +Extruder3_ColourB(0..1)=0.3 +Extruder0_ValveOverRun(mm)=-1 +Extruder0_Lift(mm)=0 +Extruder0_NumberOfShells(0..N)=2 +Extruder3_EvenHatchDirection(degrees)=45 Extruder1_OutlineSpeed(0..1)=0.9 -Extruder1_ExtrusionPercentInfill(0..1)=0.20 -Extruder1_Purge(ms)=30000 -Extruder1_Reverse(ms)=1200 -Extruder1_SlowXYFeedrate(mm/minute)=1500.0 -Extruder1_SupportMaterialType(name)=null -Extruder1_ValveDelayForLayer(ms)=200 -Extruder1_ValveDelayForPolygon(ms)=200 +Extruder0_Purge(ms)=30000 +Extruder0_MaterialType(name)=PLA +Extruder3_ExtrusionDelayForLayer(ms)=600 +Extruder2_ExtrusionTemp(C)=205 +Extruder3_OddHatchDirection(degrees)=-45 Extruder1_ValveOverRun(mm)=2 +Extruder2_SupportMaterialType(name)=null +PathOptimise=true +Extruder0_OffsetY(mm)=0 +Extruder1_OffsetZ(mm)=0 +Extruder1_Reverse(ms)=1200 +Extruder1_ExtrusionDelayForLayer(ms)=500 +Extruder1_Lift(mm)=0 +InterLayerCooling=true +Extruder0_CoolingPeriod(s)=-1 Extruder1_ValvePulseTime(ms)=-500 -Extruder2_Address=0 -Extruder2_ArcCompensationFactor(0..)=8 -Extruder2_ArcShortSides(0..)=1 -Extruder2_ColourB(0..1)=0.3 -Extruder2_ColourG(0..1)=0.8 -Extruder2_ColourR(0..1)=0.3 -Extruder2_CoolingPeriod(s)=-1 +Extruder1_OddHatchDirection(degrees)=45 Extruder2_EvenHatchDirection(degrees)=45 -Extruder2_ExtrudeRatio(0..)=1 -Extruder2_ExtrusionBroadWidth(mm)=6 -Extruder2_ExtrusionDelayForLayer(ms)=500 -Extruder2_ExtrusionDelayForPolygon(ms)=0 -Extruder2_ExtrusionFoundationWidth(mm)=2 -Extruder2_ExtrusionHeight(mm)=0.3 -Extruder2_ExtrusionInfillWidth(mm)=1.5 -Extruder2_ExtrusionLastFoundationWidth(mm)=2 -Extruder2_ExtrusionOverRun(mm)=0 -Extruder2_ExtrusionPercentInfill(0..1)=0.33 -Extruder2_ExtrusionPWM(0..1)=-1 -Extruder2_ExtrusionSize(mm)=0.5 -Extruder2_ExtrusionSpeed(mm/minute)=3500 -Extruder2_ExtrusionTemp(C)=220 -Extruder2_FastEFeedrate(mm/minute)=18000.0 -Extruder2_FastXYFeedrate(mm/minute)=4000.0 -Extruder2_InFillMaterialType(name)=PLA-infill -Extruder2_InfillOverlap(mm)=0.2 -Extruder2_InfillSpeed(0..1)=1 +SlowXYFeedrate(mm/minute)=1500.0 +Extruder1_Purge(ms)=30000 +Extruder1_EvenHatchDirection(degrees)=45 +Extruder3_Address=1 +Extruder3_ExtrusionTemp(C)=0 +Extruder2_ValveDelayForLayer(ms)=200 +Extruder0_EvenHatchDirection(degrees)=45 +Extruder2_ArcShortSides(0..)=1 +Extruder3_FastXYFeedrate(mm/minute)=2500.0 +Extruder2_ValveOverRun(mm)=2 +Extruder0_SlowXYFeedrate(mm/minute)=1500.0 +Extruder3_InfillOverlap(mm)=0.2 +WorkingZ(mm)=300 +Extruder1_ExtrusionSize(mm)=0.5 +CommsDebug=false +Extruder1_CoolingPeriod(s)=-1 +Extruder0_Address=0 Extruder2_Lift(mm)=0 -Extruder2_MaterialType(name)=PLA-infill -Extruder2_MaxAcceleration(mm/minute/minute)=1200000.0 -Extruder2_MiddleStart=true -Extruder2_NumberOfShells(0..N)=1 -Extruder2_OddHatchDirection(degrees)=-45 -Extruder2_OffsetX(mm)=0 -Extruder2_OffsetY(mm)=0 -Extruder2_OffsetZ(mm)=0 Extruder2_OutlineSpeed(0..1)=0.9 +DumpY(mm)=5 +Extruder1_FastEFeedrate(mm/minute)=18000.0 +Extruder3_ValveDelayForPolygon(ms)=200 Extruder2_Purge(ms)=30000 -Extruder2_Reverse(ms)=1200 -Extruder2_SeparationOutlineSpeed(0..1)=1 -Extruder2_SlowXYFeedrate(mm/minute)=1500.0 -Extruder2_SupportMaterialType(name)=null -Extruder2_ValveDelayForLayer(ms)=200 -Extruder2_ValveDelayForPolygon(ms)=200 -Extruder2_ValveOverRun(mm)=2 -Extruder2_ValvePulseTime(ms)=-500 -Extruder3_Address=1 -Extruder3_ArcCompensationFactor(0..)=8 -Extruder3_ArcShortSides(0..)=1 -Extruder3_ColourB(0..1)=0.3 -Extruder3_ColourG(0..1)=0.3 -Extruder3_ColourR(0..1)=0.3 -Extruder3_CoolingPeriod(s)=0.1 -Extruder3_EvenHatchDirection(degrees)=45 -Extruder3_ExtrudeRatio(0..)=1 -Extruder3_ExtrusionBroadWidth(mm)=6 -Extruder3_ExtrusionDelayForLayer(ms)=600 -Extruder3_ExtrusionDelayForPolygon(ms)=500 +Extruder1_MaterialType(name)=PLA-support +FinishX(mm)=10 Extruder3_ExtrusionFoundationWidth(mm)=2 -Extruder3_ExtrusionHeight(mm)=0.3 -Extruder3_ExtrusionInfillWidth(mm)=1.5 -Extruder3_ExtrusionLastFoundationWidth(mm)=2 -Extruder3_ExtrusionOverRun(mm)=0 -Extruder3_ExtrusionPercentInfill(0..1)=0.20 -Extruder3_ExtrusionPWM(0..1)=-1 -Extruder3_ExtrusionSize(mm)=0.3 -Extruder3_ExtrusionSpeed(mm/minute)=3000 -Extruder3_ExtrusionTemp(C)=0 -Extruder3_FastEFeedrate(mm/minute)=8000.0 -Extruder3_FastXYFeedrate(mm/minute)=3000.0 -Extruder3_InFillMaterialType(name)=null -Extruder3_InfillOverlap(mm)=0.2 -Extruder3_InfillSpeed(0..1)=0.9 -Extruder3_Lift(mm)=1 -Extruder3_MaterialType(name)=PCB-pen -Extruder3_MaxAcceleration(mm/minute/minute)=1200000.0 -Extruder3_MiddleStart=true -Extruder3_NumberOfShells(0..N)=1 -Extruder3_OddHatchDirection(degrees)=-45 +Extruder1_InFillMaterialType(name)=PLA-support +Extruder2_ExtrusionFoundationWidth(mm)=2 Extruder3_OffsetX(mm)=0 -Extruder3_OffsetY(mm)=0 -Extruder3_OffsetZ(mm)=0 -Extruder3_OutlineSpeed(0..1)=0.9 -Extruder3_Purge(ms)=10000 -Extruder3_Reverse(ms)=400 +MaximumFeedrateZ(mm/minute)=50 +Extruder0_ExtrusionPWM(0..1)=-1 +Extruder1_ColourG(0..1)=0.6 +Extruder1_ExtrusionFoundationWidth(mm)=2 +Extruder2_MiddleStart=true +MaxZAcceleration(mm/mininute/minute)=3000 +Extruder0_ValveDelayForPolygon(ms)=200 +Extruder0_SupportMaterialType(name)=null +Extruder2_ColourR(0..1)=0.3 +Extruder1_ExtrusionInfillWidth(mm)=2 +Extruder0_ExtrusionFoundationWidth(mm)=2 +Extruder3_Lift(mm)=0 +Extruder2_ValvePulseTime(ms)=-500 +Extruder1_InfillOverlap(mm)=0 Extruder3_SeparationOutlineSpeed(0..1)=1 -Extruder3_SlowXYFeedrate(mm/minute)=1500.0 -Extruder3_SupportMaterialType(name)=null -Extruder3_ValveDelayForLayer(ms)=200 -Extruder3_ValveDelayForPolygon(ms)=200 Extruder3_ValveOverRun(mm)=2 -Extruder3_ValvePulseTime(ms)=500 -FinishX(mm)=10 -FinishY(mm)=190 -FiveD=true -FoundationLayers=0 -InterLayerCooling=true -MaxXYAcceleration(mm/mininute/minute)=1200000 -MaxZAcceleration(mm/mininute/minute)=3000 -MaximumFeedrateX(mm/minute)=3500 -MaximumFeedrateY(mm/minute)=3500 -MaximumFeedrateZ(mm/minute)=50 -NumberOfExtruders=4 -PathOptimise=true -Port(name)=/dev/ttyUSB0 -Shield=true -SlowXYFeedrate(mm/minute)=1500.0 -SlowZFeedrate(mm/minute)=50.0 -WorkingX(mm)=200 -WorkingY(mm)=200 -WorkingZ(mm)=150 +Extruder3_ArcShortSides(0..)=1 +Extruder3_Purge(ms)=10000 +Extruder2_SeparationOutlineSpeed(0..1)=1 +Extruder2_ExtrusionSpeed(mm/minute)=2500 +Extruder3_MaxAcceleration(mm/minute/minute)=1200000.0 Modified: trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java =================================================================== --- trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2011-05-04 15:44:33 UTC (rev 4119) +++ trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2011-05-04 21:42:27 UTC (rev 4120) @@ -325,7 +325,7 @@ { while ((line = fileInStream.readLine()) != null) { - bufferQueue(line, 0); + bufferQueue(line); bytes += line.length(); fractionDone = (double)bytes/(double)fileInStreamLength; setFractionDone(fractionDone, -1, -1); @@ -507,8 +507,8 @@ /** * Queue a command. */ - private void bufferQueue(String cmd, int retries) throws Exception - { + private void bufferQueue(String cmd) throws Exception + { if(simulationPlot != null) simulationPlot.add(cmd); @@ -517,11 +517,8 @@ nonRunningWarning("queue: \"" + cmd + "\" to"); return; } - if(retries > 3) - { - Debug.e("bufferQueue(): too many retries (" + retries + ") sending " + cmd); - return; - } + + if(sendLine(cmd)) { long resp = waitForResponse(); @@ -531,6 +528,7 @@ } else if (resp == allSentOK) { lineNumber++; + return; } else // Must be a re-send line number { long gotTo = lineNumber; @@ -539,10 +537,18 @@ while(lineNumber <= gotTo && !rCmd.contentEquals("")) { rCmd = ringGet(lineNumber); - bufferQueue(rCmd, retries+1); // Is recursion clever; or stupid? + if(sendLine(rCmd)) + { + resp = waitForResponse(); + if (resp == allSentOK) + return; + if(resp == shutDown) + throw new Exception("The RepRap machine has flagged a hard error!"); + } } } } + Debug.e("bufferQueue(): failed to send " + cmd); } private void resetReceived() @@ -588,7 +594,7 @@ } if(eTemp == Double.NEGATIVE_INFINITY) { - Debug.e("GCodeReaderAndWriter.getETemp() - no value stored!"); + Debug.d("GCodeReaderAndWriter.getETemp() - no value stored!"); return 0; } return eTemp; @@ -607,7 +613,7 @@ } if(bTemp == Double.NEGATIVE_INFINITY) { - Debug.e("GCodeReaderAndWriter.getBTemp() - no value stored!"); + Debug.d("GCodeReaderAndWriter.getBTemp() - no value stored!"); return 0; } return bTemp; @@ -823,7 +829,7 @@ fileOutStream.println(cmd); Debug.c("G-code: " + cmd + " written to file"); } else - bufferQueue(cmd, 0); + bufferQueue(cmd); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ree...@us...> - 2011-05-16 04:51:59
|
Revision: 4131 http://reprap.svn.sourceforge.net/reprap/?rev=4131&view=rev Author: reece-arnott2 Date: 2011-05-16 04:51:52 +0000 (Mon, 16 May 2011) Log Message: ----------- Added in Linux 64 bit libraries and changed the shell script to set the library path based on the machine type returned by 'uname -m'. To do this I needed to put the 32 bit and 64 bit libraries in seperate subfolders (lib-i686 and lib-x86_64). Also changed host-package-release to go up an additional folder when including machine-type (darwin/mendel/etc.) and electronics folders as folder structure seems to have changed since last time it was used. Modified Paths: -------------- trunk/software/host/host-package-release trunk/software/host/lib/system-dependent/linux-i386/reprap Added Paths: ----------- trunk/software/host/lib/system-dependent/linux-i386/lib-i686/ trunk/software/host/lib/system-dependent/linux-i386/lib-i686/libj3dcore-ogl-cg.so trunk/software/host/lib/system-dependent/linux-i386/lib-i686/libj3dcore-ogl.so trunk/software/host/lib/system-dependent/linux-i386/lib-i686/librxtxParallel.so trunk/software/host/lib/system-dependent/linux-i386/lib-i686/librxtxSerial.so trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/ trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/libj3dcore-ogl-cg.so trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/libj3dcore-ogl.so trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/librxtxSerial.so Removed Paths: ------------- trunk/software/host/lib/system-dependent/linux-i386/libj3dcore-ogl-cg.so trunk/software/host/lib/system-dependent/linux-i386/libj3dcore-ogl.so trunk/software/host/lib/system-dependent/linux-i386/librxtxParallel.so trunk/software/host/lib/system-dependent/linux-i386/librxtxSerial.so Modified: trunk/software/host/host-package-release =================================================================== --- trunk/software/host/host-package-release 2011-05-11 21:10:40 UTC (rev 4130) +++ trunk/software/host/host-package-release 2011-05-16 04:51:52 UTC (rev 4131) @@ -21,7 +21,7 @@ # Where are all the other non-host-software files we need to include? DESIGNFILES="" -for i in ../$MACHINE ../electronics ../firmware +for i in ../../$MACHINE ../../electronics ../firmware do if [ -d "$i" ] then @@ -61,7 +61,7 @@ # Copy files into binary package directory for F in $FILELIST do - cp -p $F "$BASENAME" + cp -rp $F "$BASENAME" done echo "Executable created." @@ -85,14 +85,14 @@ mkdir -p "$SRCFILENAME"/lib for F in $LIBFILES do - cp -pr $F "$SRCFILENAME"/lib + cp -rp $F "$SRCFILENAME"/lib done echo "Sources copied." for F in $DESIGNFILES do - cp -pr $F "$BASENAME" + cp -rp $F "$BASENAME" done #Remove local configuration files Added: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/libj3dcore-ogl-cg.so =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/libj3dcore-ogl-cg.so ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/libj3dcore-ogl.so =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/libj3dcore-ogl.so ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/librxtxParallel.so =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/librxtxParallel.so ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/librxtxSerial.so =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/system-dependent/linux-i386/lib-i686/librxtxSerial.so ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/libj3dcore-ogl-cg.so =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/libj3dcore-ogl-cg.so ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/libj3dcore-ogl.so =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/libj3dcore-ogl.so ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/librxtxSerial.so =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/system-dependent/linux-i386/lib-x86_64/librxtxSerial.so ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/software/host/lib/system-dependent/linux-i386/libj3dcore-ogl-cg.so =================================================================== (Binary files differ) Deleted: trunk/software/host/lib/system-dependent/linux-i386/libj3dcore-ogl.so =================================================================== (Binary files differ) Deleted: trunk/software/host/lib/system-dependent/linux-i386/librxtxParallel.so =================================================================== (Binary files differ) Deleted: trunk/software/host/lib/system-dependent/linux-i386/librxtxSerial.so =================================================================== (Binary files differ) Modified: trunk/software/host/lib/system-dependent/linux-i386/reprap =================================================================== --- trunk/software/host/lib/system-dependent/linux-i386/reprap 2011-05-11 21:10:40 UTC (rev 4130) +++ trunk/software/host/lib/system-dependent/linux-i386/reprap 2011-05-16 04:51:52 UTC (rev 4131) @@ -6,6 +6,12 @@ cd $REPRAP_DIR +MACHINE=`uname -m` + +# put the directory with the native RXTX and j3d libs in the library path +LD_LIBRARY_PATH=`pwd`/lib-${MACHINE}:${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH + # build up classpath # when we move to OpenJDK/Java-6 these next few can be replaced with wildcard # *.jar and we will not need swing-layout any more. @@ -19,4 +25,4 @@ CLASSPATH=$CLASSPATH:. # invoke the code -java -cp $CLASSPATH -Xmx$REPRAP_RAM_SIZE -Djava.library.path=. org.reprap.Main +java -cp $CLASSPATH -Xmx$REPRAP_RAM_SIZE org.reprap.Main This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2011-06-16 19:38:28
|
Revision: 4140 http://reprap.svn.sourceforge.net/reprap/?rev=4140&view=rev Author: adrian-bowyer Date: 2011-06-16 19:38:22 +0000 (Thu, 16 Jun 2011) Log Message: ----------- Removed bug whereby leading and trailing spaces in the serial port name would mean that it was not found. Modified Paths: -------------- trunk/software/host/.classpath trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java Added Paths: ----------- trunk/software/host/lib/swing-layout-1.0.4.jar Modified: trunk/software/host/.classpath =================================================================== --- trunk/software/host/.classpath 2011-06-12 11:02:28 UTC (rev 4139) +++ trunk/software/host/.classpath 2011-06-16 19:38:22 UTC (rev 4140) @@ -6,8 +6,8 @@ <classpathentry kind="lib" path="lib/j3dcore.jar"/> <classpathentry kind="lib" path="lib/j3d-org-java3d-all.jar"/> <classpathentry kind="lib" path="lib/j3dutils.jar"/> + <classpathentry kind="lib" path="lib/vecmath.jar"/> + <classpathentry kind="lib" path="lib/swing-layout-1.0.3.jar"/> <classpathentry kind="lib" path="lib/RXTXcomm.jar"/> - <classpathentry kind="lib" path="lib/swing-layout-1.0.3.jar"/> - <classpathentry kind="lib" path="lib/vecmath.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Added: trunk/software/host/lib/swing-layout-1.0.4.jar =================================================================== (Binary files differ) Property changes on: trunk/software/host/lib/swing-layout-1.0.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java =================================================================== --- trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2011-06-12 11:02:28 UTC (rev 4139) +++ trunk/software/host/src/org/reprap/comms/GCodeReaderAndWriter.java 2011-06-16 19:38:22 UTC (rev 4140) @@ -840,6 +840,8 @@ serialInStream = null; serialOutStream = null; + portName = portName.trim(); + //open our port. Debug.d("GCode opening port " + portName); Main.setRepRapPresent(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <adr...@us...> - 2011-06-18 10:52:36
|
Revision: 4141 http://reprap.svn.sourceforge.net/reprap/?rev=4141&view=rev Author: adrian-bowyer Date: 2011-06-18 10:52:29 +0000 (Sat, 18 Jun 2011) Log Message: ----------- Fixed bug whereby java.awt buttons disappeared when tabs were selected by replacing them with javax.swing buttons. Modified Paths: -------------- trunk/software/host/.classpath trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java trunk/software/host/src/org/reprap/gui/botConsole/PrintTabFrame.java trunk/software/host/src/org/reprap/gui/botConsole/bedPanel.java Modified: trunk/software/host/.classpath =================================================================== --- trunk/software/host/.classpath 2011-06-16 19:38:22 UTC (rev 4140) +++ trunk/software/host/.classpath 2011-06-18 10:52:29 UTC (rev 4141) @@ -7,7 +7,7 @@ <classpathentry kind="lib" path="lib/j3d-org-java3d-all.jar"/> <classpathentry kind="lib" path="lib/j3dutils.jar"/> <classpathentry kind="lib" path="lib/vecmath.jar"/> - <classpathentry kind="lib" path="lib/swing-layout-1.0.3.jar"/> <classpathentry kind="lib" path="lib/RXTXcomm.jar"/> + <classpathentry kind="lib" path="lib/swing-layout-1.0.4.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Modified: trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java =================================================================== --- trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java 2011-06-16 19:38:22 UTC (rev 4140) +++ trunk/software/host/src/org/reprap/gui/botConsole/BotConsoleFrame.java 2011-06-18 10:52:29 UTC (rev 4141) @@ -179,7 +179,40 @@ if (extruderCount < 1) throw new Exception("A Reprap printer must contain at least one extruder"); } + private void initialiseExtruderPanels() { + + extruderPanels = new GenericExtruderTabPanel[extruderCount]; + for (int i = 0; i < extruderCount; i++) { + extruderPanels[i] = new GenericExtruderTabPanel(); + try { + extruderPanels[i].initialiseExtruders(i); + } + catch (Exception e) { + System.out.println("Failure trying to initialise extruders in botConsole: " + e); + JOptionPane.showMessageDialog(null, e.getMessage()); + return; + } + try { + extruderPanels[i].setPrefs(); + } + catch (Exception e) { + System.out.println("Problem loading prefs for Extruder " + i); + JOptionPane.showMessageDialog(null, "Problem loading prefs for Extruder " + i); + } + } + } + private void addExtruderPanels() { + + xYZTabPanel = new org.reprap.gui.botConsole.XYZTabPanel(); + + jTabbedPane1.addTab("XYZ", xYZTabPanel); + for (int i = 0; i < extruderCount; i++) { + jTabbedPane1.addTab("Extruder " + i, extruderPanels[i]); + } + pack(); + } + /** This method is called from within the constructor to * initialize the form. @@ -191,7 +224,7 @@ jTabbedPane1 = new javax.swing.JTabbedPane(); initialiseExtruderPanels(); - printTabFrame1 = new org.reprap.gui.botConsole.PrintTabFrame(); + printTabFrame1 = new org.reprap.gui.botConsole.PrintTabFrame(false); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); @@ -214,7 +247,7 @@ .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 400, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(5, Short.MAX_VALUE)) ); - + pack(); }// </editor-fold>//GEN-END:initComponents @@ -278,43 +311,10 @@ return bcf.extruderPanels[0]; } - private void initialiseExtruderPanels() { + - extruderPanels = new GenericExtruderTabPanel[extruderCount]; - for (int i = 0; i < extruderCount; i++) { - extruderPanels[i] = new GenericExtruderTabPanel(); - try { - extruderPanels[i].initialiseExtruders(i); - } - catch (Exception e) { - System.out.println("Failure trying to initialise extruders in botConsole: " + e); - JOptionPane.showMessageDialog(null, e.getMessage()); - return; - } - try { - extruderPanels[i].setPrefs(); - } - catch (Exception e) { - System.out.println("Problem loading prefs for Extruder " + i); - JOptionPane.showMessageDialog(null, "Problem loading prefs for Extruder " + i); - } - } - } - - private void addExtruderPanels() { - - xYZTabPanel = new org.reprap.gui.botConsole.XYZTabPanel(); - jTabbedPane1.addTab("XYZ", xYZTabPanel); - for (int i = 0; i < extruderCount; i++) { - jTabbedPane1.addTab("Extruder " + i, extruderPanels[i]); - } - pack(); - } - - - private int extruderCount; //private int currentExtruder; Modified: trunk/software/host/src/org/reprap/gui/botConsole/PrintTabFrame.java =================================================================== --- trunk/software/host/src/org/reprap/gui/botConsole/PrintTabFrame.java 2011-06-16 19:38:22 UTC (rev 4140) +++ trunk/software/host/src/org/reprap/gui/botConsole/PrintTabFrame.java 2011-06-18 10:52:29 UTC (rev 4141) @@ -23,7 +23,8 @@ * * @author ensab */ -public class PrintTabFrame extends javax.swing.JInternalFrame { +public class PrintTabFrame extends javax.swing.JInternalFrame {//AB99 +//public class PrintTabFrame extends javax.swing.JPanel { private static final long serialVersionUID = 1L; private BotConsoleFrame parentBotConsoleFrame = null; // private XYZTabPanel xYZTabPanel = null; @@ -39,8 +40,8 @@ private boolean gcodeLoaded = false; /** Creates new form PrintTabFrame */ - public PrintTabFrame() { - initComponents(); + public PrintTabFrame(boolean pref) { + initComponents(pref); String machine = "simulator"; //toSNAPRepRapRadioButton.setSelected(false); @@ -141,13 +142,71 @@ * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { + private void initComponents(boolean pref) { buttonGroup1 = new javax.swing.ButtonGroup(); - printButton = new java.awt.Button(); - pcbButton = new java.awt.Button(); - pauseButton = new java.awt.Button(); - stopButton = new java.awt.Button(); - exitButton = new java.awt.Button(); + + // if(pref) + // { + //preferencesButton = new java.awt.Button(); + preferencesButton = new javax.swing.JButton(); + preferencesButton.setActionCommand("preferences"); + preferencesButton.setBackground(new java.awt.Color(255, 102, 255)); + preferencesButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + preferences(evt); + } + }); + //preferencesButton.setLabel("Preferences"); + preferencesButton.setText("Preferences"); + // return; + // } + + // If this isn't here it falls over. God knows why... + dummyButton = new java.awt.Button(); + dummyButton.setActionCommand("dummy"); + dummyButton.setBackground(new java.awt.Color(238, 238, 238)); + dummyButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + dummy(evt); + } + }); + dummyButton.setLabel(" "); + + + printButton = new javax.swing.JButton(); + pcbButton = new javax.swing.JButton(); + pauseButton = new javax.swing.JButton(); + stopButton = new javax.swing.JButton(); + exitButton = new javax.swing.JButton(); + loadSTL = new javax.swing.JButton(); + loadGCode = new javax.swing.JButton(); + loadRFO = new javax.swing.JButton(); +// preferencesButton = new javax.swing.JButton(); + saveRFO = new javax.swing.JButton(); + + // printButton = new java.awt.Button(); + // pcbButton = new java.awt.Button(); + // pauseButton = new java.awt.Button(); + // stopButton = new java.awt.Button(); + // exitButton = new java.awt.Button(); + // loadSTL = new java.awt.Button(); + // loadGCode = new java.awt.Button(); + // loadRFO = new java.awt.Button(); + +// saveRFO = new java.awt.Button(); + + + printButton.setText("Print"); + pcbButton.setText("PCB"); + pauseButton.setText("Pause"); + stopButton.setText("STOP !"); + exitButton.setText("Exit"); + loadSTL.setText("Load STL"); + loadGCode.setText("Load GCode"); + loadRFO.setText("Load RFO"); + saveRFO.setText("Save RFO"); + + layerPauseCheck = new javax.swing.JCheckBox(); layerPause(false); //toSNAPRepRapRadioButton = new javax.swing.JRadioButton(); @@ -160,20 +219,18 @@ progressLabel = new javax.swing.JLabel(); currentLayerOutOfN = new javax.swing.JLabel(); progressBar = new javax.swing.JProgressBar(); - loadSTL = new java.awt.Button(); - loadGCode = new java.awt.Button(); + gCodeToFileRadioButton = new javax.swing.JRadioButton(); - loadRFO = new java.awt.Button(); + toGCodeRepRapRadioButton = new javax.swing.JRadioButton(); fileNameBox = new javax.swing.JLabel(); - preferencesButton = new java.awt.Button(); - saveRFO = new java.awt.Button(); + displayPathsCheck = new javax.swing.JCheckBox(); displayPaths(false); printButton.setBackground(new java.awt.Color(51, 204, 0)); printButton.setFont(printButton.getFont()); - printButton.setLabel("Print"); // NOI18N + // NOI18N printButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { printButtonActionPerformed(evt); @@ -182,7 +239,7 @@ pcbButton.setBackground(new java.awt.Color(152, 99, 62)); pcbButton.setFont(pcbButton.getFont()); - pcbButton.setLabel("PCB"); // NOI18N + // NOI18N pcbButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pcbButtonActionPerformed(evt); @@ -190,7 +247,7 @@ }); pauseButton.setBackground(new java.awt.Color(255, 204, 0)); - pauseButton.setLabel("Pause"); // NOI18N + // NOI18N pauseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pauseButtonActionPerformed(evt); @@ -199,14 +256,14 @@ stopButton.setBackground(new java.awt.Color(255, 0, 0)); stopButton.setFont(new java.awt.Font("Dialog", 1, 12)); - stopButton.setLabel("STOP !"); // NOI18N + // NOI18N stopButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stopButtonActionPerformed(evt); } }); - exitButton.setLabel("Exit"); + exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitButtonActionPerformed(evt); @@ -220,13 +277,6 @@ } }); -// buttonGroup1.add(toSNAPRepRapRadioButton); -// toSNAPRepRapRadioButton.setText("Print on SNAP RepRap"); -// toSNAPRepRapRadioButton.addMouseListener(new java.awt.event.MouseAdapter() { -// public void mousePressed(java.awt.event.MouseEvent evt) { -// selectorRadioButtonMousePressed(evt); -// } -// }); getWebPage.setIcon(new javax.swing.ImageIcon( ClassLoader.getSystemResource("rr-logo-green-url.png"))); // NOI18N @@ -260,7 +310,7 @@ loadSTL.setActionCommand("loadSTL"); loadSTL.setBackground(new java.awt.Color(0, 204, 255)); - loadSTL.setLabel("Load STL"); // NOI18N + // NOI18N loadSTL.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadSTL(evt); @@ -269,7 +319,7 @@ loadGCode.setActionCommand("loadGCode"); loadGCode.setBackground(new java.awt.Color(0, 204, 255)); - loadGCode.setLabel("Load GCode"); // NOI18N + // NOI18N loadGCode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { LoadGCode(evt); @@ -286,7 +336,7 @@ loadRFO.setActionCommand("loadRFO"); loadRFO.setBackground(new java.awt.Color(0, 204, 255)); - loadRFO.setLabel("Load RFO"); // NOI18N + // NOI18N loadRFO.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { loadRFO(evt); @@ -304,24 +354,40 @@ fileNameBox.setFont(new java.awt.Font("Tahoma", 0, 12)); fileNameBox.setText(" - "); - preferencesButton.setActionCommand("preferences"); - preferencesButton.setBackground(new java.awt.Color(255, 102, 255)); - preferencesButton.setLabel("Preferences"); // NOI18N - preferencesButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - preferences(evt); - } - }); + saveRFO.setActionCommand("saveRFO"); saveRFO.setBackground(new java.awt.Color(153, 153, 153)); - saveRFO.setLabel("Save RFO"); // NOI18N + // NOI18N saveRFO.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveRFO(evt); } }); + + + + + + + + + // printButton.setLabel("Print"); + // pcbButton.setLabel("PCB"); + // pauseButton.setLabel("Pause"); +// stopButton.setLabel("STOP !"); +// exitButton.setLabel("Exit"); +// loadSTL.setLabel("Load STL"); +// loadGCode.setLabel("Load GCode"); +// loadRFO.setLabel("Load RFO"); + +// saveRFO.setLabel("Save RFO"); + + + + + displayPathsCheck.setText("Display paths"); displayPathsCheck.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { @@ -329,8 +395,9 @@ } }); - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());//AB99 getContentPane().setLayout(layout); + //this.setLayout(layout);//AB99 layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() @@ -338,12 +405,12 @@ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(pcbButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(saveRFO, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(loadGCode, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(pcbButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(saveRFO, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(loadGCode, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(loadRFO, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(loadSTL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) + .add(loadRFO, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(loadSTL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 120, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) //.add(toSNAPRepRapRadioButton) @@ -356,15 +423,19 @@ .add(layout.createSequentialGroup() .add(preferencesButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .add(getWebPage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 190, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(dummyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(getWebPage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 190, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ) .add(layout.createSequentialGroup() + .add(printButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) //.add(pcbButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) //.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(pauseButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 78, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(stopButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 75, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(stopButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 85, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(exitButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 62, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))) .add(layout.createSequentialGroup() @@ -397,7 +468,8 @@ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(getWebPage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(getWebPage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() @@ -411,7 +483,9 @@ .add(toGCodeRepRapRadioButton) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(gCodeToFileRadioButton)) - .add(preferencesButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .add(preferencesButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(dummyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + ) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() @@ -451,8 +525,8 @@ .add(progressBar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap(24, Short.MAX_VALUE)) ); - - pack(); + + //pack(); //AB99 }// </editor-fold>//GEN-END:initComponents private void printButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_printButtonActionPerformed @@ -765,6 +839,10 @@ prefs.setVisible(true); // prefs.show(); }//GEN-LAST:event_preferences +private void dummy(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_preferences + +}//GEN-LAST:event_preferences + private void saveRFO(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveRFO if(!SLoadOK) return; @@ -838,27 +916,50 @@ private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JLabel currentLayerOutOfN; private javax.swing.JCheckBox displayPathsCheck; - private java.awt.Button exitButton; + private javax.swing.JLabel expectedBuildTime; private javax.swing.JLabel expectedBuildTimeLabel; private javax.swing.JLabel expectedFinishTime; private javax.swing.JLabel expectedFinishTimeLabel; private javax.swing.JLabel fileNameBox; private javax.swing.JRadioButton gCodeToFileRadioButton; - private javax.swing.JButton getWebPage; + private javax.swing.JLabel hoursMinutesLabel1; private javax.swing.JCheckBox layerPauseCheck; - private java.awt.Button loadGCode; - private java.awt.Button loadRFO; - private java.awt.Button loadSTL; - private java.awt.Button pauseButton; - private java.awt.Button preferencesButton; - private java.awt.Button printButton; - private java.awt.Button pcbButton; + + private javax.swing.JButton getWebPage; + + private javax.swing.JButton loadGCode; + private javax.swing.JButton loadRFO; + private javax.swing.JButton loadSTL; + private javax.swing.JButton pauseButton; + private javax.swing.JButton preferencesButton; + private javax.swing.JButton printButton; + private javax.swing.JButton pcbButton; + private javax.swing.JButton exitButton; + private javax.swing.JButton saveRFO; + private javax.swing.JButton stopButton; + + + + // private java.awt.Button loadGCode; + // private java.awt.Button loadRFO; +// private java.awt.Button loadSTL; +// private java.awt.Button pauseButton; +// private java.awt.Button preferencesButton; + + private java.awt.Button dummyButton; +// private java.awt.Button printButton; +// private java.awt.Button pcbButton; +// private java.awt.Button exitButton; +// private java.awt.Button saveRFO; +// private java.awt.Button stopButton; + + + private javax.swing.JProgressBar progressBar; private javax.swing.JLabel progressLabel; - private java.awt.Button saveRFO; - private java.awt.Button stopButton; + private javax.swing.JRadioButton toGCodeRepRapRadioButton; //private javax.swing.JRadioButton toSNAPRepRapRadioButton; // End of variables declaration//GEN-END:variables Modified: trunk/software/host/src/org/reprap/gui/botConsole/bedPanel.java =================================================================== --- trunk/software/host/src/org/reprap/gui/botConsole/bedPanel.java 2011-06-16 19:38:22 UTC (rev 4140) +++ trunk/software/host/src/org/reprap/gui/botConsole/bedPanel.java 2011-06-18 10:52:29 UTC (rev 4141) @@ -1,176 +1,176 @@ /* * * !!!!! - * NOTE: PLEASE ONLY EDIT THIS USING THE NETBEANS IDE 6.0.1 OR HIGHER!!!! - * !!!!! - * - * ... an .xml file is associated with this class. Cheers. - * - * bedPanel.java - * - * Created on 30 March 2008, 18:55 - */ - -package org.reprap.gui.botConsole; - -import java.awt.Color; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.font.FontRenderContext; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; - -/** - * - * @author reprap - */ -public class bedPanel extends javax.swing.JPanel { - private static final long serialVersionUID = 1L; - private final int CROSS_HAIR_SIZE = 10; - private Line2D.Double a1, a2, b1, b2; - private Point2D.Double aDatum, bDatum; - private int x; - private int y; - private Font font; - private int fontSize; - - /** Creates new form bedPanel */ - public bedPanel() { - - // First cross hair - aDatum = new Point2D.Double(); - a1 = new Line2D.Double(); - a2 = new Line2D.Double(); - - // History cross hair - bDatum = new Point2D.Double(); - b1 = new Line2D.Double(); - b2 = new Line2D.Double(); - - initComponents(); - - } - - public void setDimensions() { - x = this.getWidth(); - y = this.getHeight(); - - // Text imitialisation - fontSize = (int)(y/20); - font = new Font("dialog", Font.PLAIN, fontSize); - repaint(); - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { - - setBackground(java.awt.Color.white); - setMaximumSize(new java.awt.Dimension(200, 200)); - setMinimumSize(new java.awt.Dimension(200, 200)); - setPreferredSize(new java.awt.Dimension(200, 200)); - - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(0, 200, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(0, 200, Short.MAX_VALUE) - ); - }// </editor-fold>//GEN-END:initComponents - - public void mousePressed() { - unClicked = false; - } - - public void updateCrossHair(int posX, int posY) { - - c = Color.black; - - aDatum.setLocation(posX, posY); - a1.setLine(aDatum.getX(), aDatum.getY()-CROSS_HAIR_SIZE, aDatum.getX(), aDatum.getY()+CROSS_HAIR_SIZE); - a2.setLine(aDatum.getX()-CROSS_HAIR_SIZE, aDatum.getY(), aDatum.getX()+CROSS_HAIR_SIZE, aDatum.getY()); - - updateOldPosition(posX, posY); - - repaint(); - } - - public void updateOldPosition(int posX, int posY) { - - bDatum.setLocation(posX, posY); - b1.setLine(bDatum.getX(), bDatum.getY()-CROSS_HAIR_SIZE/2, bDatum.getX(), bDatum.getY()+CROSS_HAIR_SIZE/2); - b2.setLine(bDatum.getX()-CROSS_HAIR_SIZE/2, bDatum.getY(), bDatum.getX()+CROSS_HAIR_SIZE/2, bDatum.getY()); - } - - public void dragCrossHair(int posX, int posY) { - - c = Color.red; - - aDatum.setLocation(posX, posY); - a1.setLine(aDatum.getX(), aDatum.getY()-x, aDatum.getX(), aDatum.getY()+x); - a2.setLine(aDatum.getX()-x, aDatum.getY(), aDatum.getX()+x, aDatum.getY()); - - repaint(); - } - - public void paintComponent(Graphics g) { - super.paintComponent(g); - Graphics2D g2 = (Graphics2D)g; - g2.setRenderingHint( - RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); - g2.setRenderingHint( - RenderingHints.KEY_COLOR_RENDERING, - RenderingHints.VALUE_COLOR_RENDER_SPEED); - g2.setRenderingHint( - RenderingHints.KEY_RENDERING, - RenderingHints.VALUE_RENDER_SPEED); - g2.setColor(c); - g2.draw(a1); - g2.draw(a2); - - g2.setColor(Color.gray); - g2.draw(b1); - g2.draw(b2); - - if (unClicked) { - g2.setFont(font); - FontRenderContext frc = g2.getFontRenderContext(); - - float width; - float sx; - float sy; - float lineHeight = font.getSize(); - float space = font.getSize()/4; - int lines = s.length; - - for (int i = 0; i < lines; i++) { - width = (float)font.getStringBounds(s[i], frc).getWidth(); - sx = (x - width)/2; - sy = y/2+(lineHeight)/2 - (lines-1)*((lineHeight+space)/2) + (i*(lineHeight+space)); - g2.drawString(s[i], sx, sy); - } - } - } - - private Color c; - private boolean unClicked = true; - private String s1 = "Click to load new coordinates"; - private String s2 = "Drag for cross-hairs"; - private String s3 = ""; //"Home X & Y axes first"; - private String[] s = new String[] { s3, s1, s2 }; - - // Variables declaration - do not modify//GEN-BEGIN:variables - // End of variables declaration//GEN-END:variables - -} +// * NOTE: PLEASE ONLY EDIT THIS USING THE NETBEANS IDE 6.0.1 OR HIGHER!!!! +// * !!!!! +// * +// * ... an .xml file is associated with this class. Cheers. +// * +// * bedPanel.java +// * +// * Created on 30 March 2008, 18:55 +// */ +// +//package org.reprap.gui.botConsole; +// +//import java.awt.Color; +//import java.awt.Font; +//import java.awt.Graphics; +//import java.awt.Graphics2D; +//import java.awt.RenderingHints; +//import java.awt.font.FontRenderContext; +//import java.awt.geom.Line2D; +//import java.awt.geom.Point2D; +// +///** +// * +// * @author reprap +// */ +//public class bedPanel extends javax.swing.JPanel { +// private static final long serialVersionUID = 1L; +// private final int CROSS_HAIR_SIZE = 10; +// private Line2D.Double a1, a2, b1, b2; +// private Point2D.Double aDatum, bDatum; +// private int x; +// private int y; +// private Font font; +// private int fontSize; +// +// /** Creates new form bedPanel */ +// public bedPanel() { +// +// // First cross hair +// aDatum = new Point2D.Double(); +// a1 = new Line2D.Double(); +// a2 = new Line2D.Double(); +// +// // History cross hair +// bDatum = new Point2D.Double(); +// b1 = new Line2D.Double(); +// b2 = new Line2D.Double(); +// +// initComponents(); +// +// } +// +// public void setDimensions() { +// x = this.getWidth(); +// y = this.getHeight(); +// +// // Text imitialisation +// fontSize = (int)(y/20); +// font = new Font("dialog", Font.PLAIN, fontSize); +// repaint(); +// } +// +// /** This method is called from within the constructor to +// * initialize the form. +// * WARNING: Do NOT modify this code. The content of this method is +// * always regenerated by the Form Editor. +// */ +// // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents +// private void initComponents() { +// +// setBackground(java.awt.Color.white); +// setMaximumSize(new java.awt.Dimension(200, 200)); +// setMinimumSize(new java.awt.Dimension(200, 200)); +// setPreferredSize(new java.awt.Dimension(200, 200)); +// +// org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); +// this.setLayout(layout); +// layout.setHorizontalGroup( +// layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) +// .add(0, 200, Short.MAX_VALUE) +// ); +// layout.setVerticalGroup( +// layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) +// .add(0, 200, Short.MAX_VALUE) +// ); +// }// </editor-fold>//GEN-END:initComponents +// +// public void mousePressed() { +// unClicked = false; +// } +// +// public void updateCrossHair(int posX, int posY) { +// +// c = Color.black; +// +// aDatum.setLocation(posX, posY); +// a1.setLine(aDatum.getX(), aDatum.getY()-CROSS_HAIR_SIZE, aDatum.getX(), aDatum.getY()+CROSS_HAIR_SIZE); +// a2.setLine(aDatum.getX()-CROSS_HAIR_SIZE, aDatum.getY(), aDatum.getX()+CROSS_HAIR_SIZE, aDatum.getY()); +// +// updateOldPosition(posX, posY); +// +// repaint(); +// } +// +// public void updateOldPosition(int posX, int posY) { +// +// bDatum.setLocation(posX, posY); +// b1.setLine(bDatum.getX(), bDatum.getY()-CROSS_HAIR_SIZE/2, bDatum.getX(), bDatum.getY()+CROSS_HAIR_SIZE/2); +// b2.setLine(bDatum.getX()-CROSS_HAIR_SIZE/2, bDatum.getY(), bDatum.getX()+CROSS_HAIR_SIZE/2, bDatum.getY()); +// } +// +// public void dragCrossHair(int posX, int posY) { +// +// c = Color.red; +// +// aDatum.setLocation(posX, posY); +// a1.setLine(aDatum.getX(), aDatum.getY()-x, aDatum.getX(), aDatum.getY()+x); +// a2.setLine(aDatum.getX()-x, aDatum.getY(), aDatum.getX()+x, aDatum.getY()); +// +// repaint(); +// } +// +// public void paintComponent(Graphics g) { +// super.paintComponent(g); +// Graphics2D g2 = (Graphics2D)g; +// g2.setRenderingHint( +// RenderingHints.KEY_ANTIALIASING, +// RenderingHints.VALUE_ANTIALIAS_ON); +// g2.setRenderingHint( +// RenderingHints.KEY_COLOR_RENDERING, +// RenderingHints.VALUE_COLOR_RENDER_SPEED); +// g2.setRenderingHint( +// RenderingHints.KEY_RENDERING, +// RenderingHints.VALUE_RENDER_SPEED); +// g2.setColor(c); +// g2.draw(a1); +// g2.draw(a2); +// +// g2.setColor(Color.gray); +// g2.draw(b1); +// g2.draw(b2); +// +// if (unClicked) { +// g2.setFont(font); +// FontRenderContext frc = g2.getFontRenderContext(); +// +// float width; +// float sx; +// float sy; +// float lineHeight = font.getSize(); +// float space = font.getSize()/4; +// int lines = s.length; +// +// for (int i = 0; i < lines; i++) { +// width = (float)font.getStringBounds(s[i], frc).getWidth(); +// sx = (x - width)/2; +// sy = y/2+(lineHeight)/2 - (lines-1)*((lineHeight+space)/2) + (i*(lineHeight+space)); +// g2.drawString(s[i], sx, sy); +// } +// } +// } +// +// private Color c; +// private boolean unClicked = true; +// private String s1 = "Click to load new coordinates"; +// private String s2 = "Drag for cross-hairs"; +// private String s3 = ""; //"Home X & Y axes first"; +// private String[] s = new String[] { s3, s1, s2 }; +// +// // Variables declaration - do not modify//GEN-BEGIN:variables +// // End of variables declaration//GEN-END:variables +// +//} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |