Skip to content

Commit

Permalink
Unit test for heater tool #26
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed May 14, 2016
1 parent f5371ac commit 069fe91
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/java/src/junit/test/neuronrobotics/utilities/GCODETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.neuronrobotics.sdk.addons.kinematics.LinkConfiguration;
import com.neuronrobotics.sdk.addons.kinematics.LinkFactory;
import com.neuronrobotics.sdk.addons.kinematics.LinkType;
import com.neuronrobotics.sdk.addons.kinematics.gcodebridge.GCodeHeater;
import com.neuronrobotics.sdk.addons.kinematics.gcodebridge.GcodeDevice;
import com.neuronrobotics.sdk.addons.kinematics.gcodebridge.GcodePrismatic;
import com.neuronrobotics.sdk.addons.kinematics.gcodebridge.GcodeRotory;
Expand Down Expand Up @@ -162,6 +163,38 @@ public void linkFactoryTool(){

}
}

@Test
public void linkFactoryHeater(){
if (hasPort) {
LinkFactory lf = new LinkFactory();
LinkConfiguration confp = new LinkConfiguration();
confp.setType(LinkType.GCODE_HEATER_TOOL);
confp.setDeviceScriptingName(GCODE);
confp.setHardwareIndex(0);
confp.setScale(1);
AbstractLink link = lf.getLink(confp);
assertEquals(link.getClass(), GCodeHeater.class);// checks to see a real device was created
link.setTargetEngineeringUnits(25);
link.flush(1);//take 2 seconds to flush

LinkConfiguration confp2 = new LinkConfiguration();
confp2.setType(LinkType.GCODE_HEATER_TOOL);
confp2.setDeviceScriptingName(GCODE);
confp2.setHardwareIndex(1);
confp2.setScale(1);
AbstractLink link2 = lf.getLink(confp2);
assertEquals(link2.getClass(), GCodeHeater.class);// checks to see a real device was created
link2.setTargetEngineeringUnits(25);
link2.flush(1);//take 2 seconds to flush

link2.setTargetEngineeringUnits(0);
link.setTargetEngineeringUnits(0);
// coordinated motion flush
lf.flush(5);

}
}

@Test
public void G1() {
Expand Down

0 comments on commit 069fe91

Please sign in to comment.