Skip to content

Commit

Permalink
Merge branch 'master' of github.com:makerbot/ReplicatorG
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted authored and Ted committed Mar 1, 2012
2 parents f57821e + 046dfdb commit 71e3f80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 9 additions & 11 deletions src/replicatorg/app/gcode/MutableGCodeSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ else if(value == 1)
source = newSource;
}

/// adds any safety stuff that's needed after all other steps have been taken
/// atm. it just turns off any unused extruder
public void addSafetyMeasures(boolean isDualHead)
{
if(!isDualHead)
return;

/**
* If only one toolhead is used, a cool command for the unused head is added
* to this gcode source object. Created to avoid smell/problems for single prints on a dual machine
* when prior build was cancelled, or a toolhead is left hot from pre-heating.
*/
public void coolUnusedToolhead()
{
GCodeCommand gcode;
String line;

Expand All @@ -200,10 +200,8 @@ public void addSafetyMeasures(boolean isDualHead)

tval = gcode.getCodeValue('T');

if(tval == 0)
seenT0 = true;
if(tval == 1)
seenT1 = true;
if(tval == 0) seenT0 = true;
if(tval == 1) seenT1 = true;

if(!addPointFound)
additionPoint++;
Expand Down
4 changes: 2 additions & 2 deletions src/replicatorg/drivers/gen3/Sanguino3GDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ public Version getVersionInternal() {
pb.add16(Base.VERSION);

PacketResponse pr = runQuery(pb.getPacket(), 1);
if (pr.isEmpty())
if (pr.isEmpty() || !pr.isOK())
return null;
int versionNum = pr.get16();

Expand All @@ -523,7 +523,7 @@ public Version getVersionInternal() {

String buildname = "";
pr = runQuery(pb.getPacket(), 1);
if (!pr.isEmpty()) {
if (!pr.isEmpty() && pr.isOK()) {
byte[] payload = pr.getPayload();
byte[] subarray = new byte[payload.length - 1];
System.arraycopy(payload, 1, subarray, 0, subarray.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ protected BuildCode runPostProcessing()
runPrepend(metaInfo);
}

source.addSafetyMeasures(multiHead);
// scans to cool unused head if required
if( multiHead )
source.coolUnusedToolhead();

//Write the modified source back to our file
source.writeToFile(generator.output.file);
Expand Down

0 comments on commit 71e3f80

Please sign in to comment.