Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static Predictor<Image, DetectedObjects> imageContentsFactory(ImagePredic
}
break;
default:
throw new RuntimeException("No Model availible of type " + type);
throw new RuntimeException("No Model available of type " + type);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ public static void startupProcedures()
JavaFXInitializer.go();
} catch (Throwable t) {
t.printStackTrace();
com.neuronrobotics.sdk.common.Log.error("ERROR No UI engine availible");
com.neuronrobotics.sdk.common.Log.error("ERROR No UI engine available");
}
ScriptingEngine.waitForLogin();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private File makeSvg(String nameBase, List<CSG> currentCsg) throws IOException {

com.neuronrobotics.sdk.common.Log.debug("Writing " + stl.getAbsolutePath());
} catch (Throwable t) {
com.neuronrobotics.sdk.common.Log.error("ERROR, NO pixelization engine availible for slicing");
com.neuronrobotics.sdk.common.Log.error("ERROR, NO pixelization engine available for slicing");
com.neuronrobotics.sdk.common.Log.error(t);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public void run() {
Thread.sleep(32);
}
} catch (Throwable t) {
// rendering not availible
// rendering not available
com.neuronrobotics.sdk.common.Log
.error("Exception for render engine " + base.getScriptingName());
com.neuronrobotics.sdk.common.Log.error(t);
Expand Down Expand Up @@ -1040,8 +1040,8 @@ public ArrayList<CSG> generateBody(CSGDatabaseInstance csgDatabaseInstance,Mobil
}
ArrayList<CSG> arrayList = getDHtoCadMap().get(l);
int j = 0;
boolean isAvailible = device.isAvailable();
if (showingStl || !isAvailible) {
boolean isAvailable = device.isAvailable();
if (showingStl || !isAvailable) {
for (CSG csg : arrayList) {
getAllCad().add(csg);
getUi().addCsg(csg, getCadScriptFromLimnb(l));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ private CSG cloneCSG(CSG dyingCSG) {

public void back() {
CaDoodleOperation op = getCurrentOperation();
if (isBackAvailible())
if (isBackAvailable())
setCurrentIndex(getCurrentIndex() - 1);
updateCurrentFromCache();
if (ICadoodleOperationUndo.class.isInstance(op)) {
Expand All @@ -858,7 +858,7 @@ public void back() {
}

public void forward() {
if (isForwardAvailible())
if (isForwardAvailable())
setCurrentIndex(getCurrentIndex() + 1);
updateCurrentFromCache();
CaDoodleOperation op = getCurrentOperation();
Expand Down Expand Up @@ -903,7 +903,7 @@ public void moveToOpIndex(int newIndex) {
fireSaveSuggestion();
}

public boolean isBackAvailible() {
public boolean isBackAvailable() {
return getCurrentIndex() > 1;
}

Expand All @@ -921,7 +921,7 @@ public CaDoodleOperation getCurrentOperation() {
return getOperations().get(getCurrentIndex() - 1);
}

public boolean isForwardAvailible() {
public boolean isForwardAvailable() {
return getCurrentIndex() < getOperations().size();
}

Expand Down Expand Up @@ -1308,7 +1308,7 @@ public void setCurrentIndex(int currentIndex) {
// if(currentIndex==0)
// new Exception("Current Index set to " + currentIndex).printStackTrace();
if ((currentIndex - 1) >= getOperations().size())
throw new RuntimeException("Fail! Can not set an index greater than the availible operations");
throw new RuntimeException("Fail! Can not set an index greater than the available operations");
this.currentIndex = currentIndex;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public static ArrayList<String> listVitaminVariants(String type, String size) {

for (String variant : keys) {
PurchasingData pd = database.get(variant);
if (!variant.endsWith("variant-1"))// exclude the stub generated purhcasing data
if (!variant.endsWith("variant-1"))// exclude the stub generated purchasing data
{
try {
URL u = new URL(pd.getAPIUrl());
Expand All @@ -229,7 +229,7 @@ public static ArrayList<String> listVitaminVariants(String type, String size) {
huc.disconnect();
types.add(variant);
} catch (java.net.ConnectException ce) {
// server or cart is not availible, reject vitamin
// server or cart is not available, reject vitamin
} catch (Exception ex) {
com.neuronrobotics.sdk.common.Log.error(ex);;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void run() {
setControllerByName(searches);
break;
} catch (Throwable t) {
com.neuronrobotics.sdk.common.Log.error("BowlerJInputDevice Waiting for device to be availible");
com.neuronrobotics.sdk.common.Log.error("BowlerJInputDevice Waiting for device to be available");
t.printStackTrace();
try {
Thread.sleep(1000);
Expand Down Expand Up @@ -328,7 +328,7 @@ public static void main(String[] args) throws InterruptedException {
Thread.sleep(100);
com.neuronrobotics.sdk.common.Log.error("Controller clean exit");
} catch (Throwable t) {
com.neuronrobotics.sdk.common.Log.error("Waiting for device to be availible");
com.neuronrobotics.sdk.common.Log.error("Waiting for device to be available");
t.printStackTrace();
Thread.sleep(1000);
}
Expand Down
78 changes: 39 additions & 39 deletions test/java/src/junit/bowler/CaDoodleWorkflowTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ public void test() throws Exception {
"sphere.groovy");
cf.addOperation(cube1).join();
List<CSG>back= cf.getCurrentState();
if(back.size()!=1)
if (back.size()!=1)
fail("Adding a cube should have added one!");
String nameOne = back.get(0).getName();
cf.addOperation(cube2).join();;
back=cf.getCurrentState();
if(back.size()!=2)
if (back.size()!=2)
fail("Adding a cube should have added one more!");
String nameTwo = back.get(1).getName();
if(nameOne.contentEquals(nameTwo))
if (nameOne.contentEquals(nameTwo))
fail("Names must be unique!");
com.neuronrobotics.sdk.common.Log.error("Name one : "+nameOne );
com.neuronrobotics.sdk.common.Log.error("Name two : "+nameTwo );
Expand All @@ -91,28 +91,28 @@ public void test() throws Exception {
;
cf.addOperation(move).join();;
back=cf.getCurrentState();
if(back.size()!=2)
if (back.size()!=2)
fail("Same number of objects after");
double centerX = back.get(1).getCenterX();
if(centerX!=distaance)
if (centerX!=distaance)
fail("Move failed ");
if(back.get(0).getCenterX()!=0)
if (back.get(0).getCenterX()!=0)
fail("Move misapplied ");
jsonContent = cf.toJson();
//com.neuronrobotics.sdk.common.Log.error(jsonContent);
cf.save();
File self = cf.getSelf();
cf.close();
if(!self.exists())
if (!self.exists())
fail("Doodle file does not exist, save failed! "+self.getAbsolutePath());
CaDoodleFile loaded = CaDoodleFile.fromFile(self);
if(!MoveCenter.class.isInstance(loaded.getOperations().get(2))) {
if (!MoveCenter.class.isInstance(loaded.getOperations().get(2))) {
fail("Third Operation is supposed to be a move");
}
if(!AddFromScript.class.isInstance(loaded.getOperations().get(1))) {
if (!AddFromScript.class.isInstance(loaded.getOperations().get(1))) {
fail(" Operation is supposed to be a AddFromScript");
}
if(!AddFromScript.class.isInstance(loaded.getOperations().get(0))) {
if (!AddFromScript.class.isInstance(loaded.getOperations().get(0))) {
fail(" Operation is supposed to be a AddFromScript");
}
loaded.back();
Expand All @@ -129,28 +129,28 @@ public void test() throws Exception {
loaded.addOperation(move2).join();;
back=loaded.getCurrentState();
double centerX2 = back.get(1).getCenterX();
if(centerX2!=distaance)
if (centerX2!=distaance)
fail("Move failed ");
if(back.get(1).getCenterY()!=distaance)
if (back.get(1).getCenterY()!=distaance)
fail("Move failed ");
ToHole hole= new ToHole().setNames(Arrays.asList(nameOne));
loaded.addOperation(hole).join();;
back=loaded.getCurrentState();
Group group = new Group().setNames(Arrays.asList(nameOne,nameTwo));
loaded.addOperation(group).join();;
back=loaded.getCurrentState();
if(back.size()!=3)
if (back.size()!=3)
fail("Group Failed ");
if(!back.get(0).isInGroup()) {
if (!back.get(0).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(!back.get(1).isInGroup()) {
if (!back.get(1).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(back.get(2).isInGroup()) {
if (back.get(2).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(!back.get(2).isGroupResult()) {
if (!back.get(2).isGroupResult()) {
fail("THis should be aa group result");
}
String groupName = back.get(2).getName();
Expand All @@ -172,10 +172,10 @@ public void test() throws Exception {
UnGroup ug = new UnGroup().setNames(Arrays.asList(groupName));
loaded.addOperation(ug).join();;
back=loaded.getCurrentState();
if(back.get(0).isInGroup()) {
if (back.get(0).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(back.get(1).isInGroup()) {
if (back.get(1).isInGroup()) {
fail("THis should not be in a group anymore");
}

Expand All @@ -193,48 +193,48 @@ public void test() throws Exception {
new Paste().setNames(Arrays.asList(newGroupName))).join();;
back=loaded.getCurrentState();
ArrayList<String> selectAll = new ArrayList<String>();
for(CSG c:back) {
if(c.isGroupResult())
for (CSG c:back) {
if (c.isGroupResult())
selectAll.add(c.getName());
}
loaded.addOperation(
new UnGroup().setNames(selectAll)).join();;
back=loaded.getCurrentState();
if(back.get(0).isInGroup()) {
if (back.get(0).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(back.get(1).isInGroup()) {
if (back.get(1).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(back.get(2).isInGroup()) {
if (back.get(2).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(back.get(3).isInGroup()) {
if (back.get(3).isInGroup()) {
fail("THis should not be in a group anymore");
}
ToHole h= new ToHole().setNames(Arrays.asList(nameTwo));
loaded.addOperation(h).join();;
back=loaded.getCurrentState();
loaded.save();

for(int i=0;i<3;i++) {
for (int i = 0; i < 3; i++) {
loaded.back();
}
List<CSG> goBackResult = loaded.getCurrentState();
back=goBackResult;
if(goBackResult.size()!=3) {
if (goBackResult.size()!=3) {
fail(" Number of elements after back incorrect!");
}
if(back.get(2).isInGroup()) {
if (back.get(2).isInGroup()) {
fail("THis should not be in a group anymore");
}
if(!back.get(2).isGroupResult()) {
if (!back.get(2).isGroupResult()) {
fail("THis should be a group result");
}
if(!back.get(0).isInGroup()) {
if (!back.get(0).isInGroup()) {
fail("This should be in a group");
}
if(!back.get(1).isInGroup()) {
if (!back.get(1).isInGroup()) {
fail("This should be in a group");
}

Expand All @@ -244,18 +244,18 @@ public void test() throws Exception {
loaded.close();
loaded=CaDoodleFile.fromJsonString(before);
String after =loaded.toJson();
if(!before.contentEquals(after))
if (!before.contentEquals(after))
fail("Load and export mismatch");
File self2 = cf.getSelf();
loaded.setSelf(self2);

com.neuronrobotics.sdk.common.Log.error(after);
while(loaded.isForwardAvailible()) {
while (loaded.isForwardAvailable()) {
System.out.println("Moving forward the Doodle");
loaded.forward();
}
selectAll = new ArrayList<String>();
for(CSG c:loaded.getCurrentState()) {
for (CSG c:loaded.getCurrentState()) {
selectAll.add(c.getName());
}
MakeRobot mr = new MakeRobot();
Expand All @@ -270,7 +270,7 @@ public void test() throws Exception {
loaded.save();
ScriptingEngine.pull(ControllerOption.URL_OF_OPTIONS);
ArrayList<ControllerOption> controllers = ControllerOption.getOptions();
for(ControllerOption o:controllers) {
for (ControllerOption o:controllers) {
System.out.println("Adding a Controller: "+o);
AddRobotController con = new AddRobotController()
.setNames(selectAll)
Expand All @@ -282,10 +282,10 @@ public void test() throws Exception {
ScriptingEngine.pull("https://github.com/madhephaestus/carl-the-hexapod.git");
ArrayList<LimbOption> limbs = LimbOption.getOptions();
TransformNR tf = new TransformNR();
for(LimbOption o:limbs) {
if(mr.getBuilder().checkOptionSupported(o)) {
for (LimbOption o:limbs) {
if (mr.getBuilder().checkOptionSupported(o)) {
System.out.println(o);
tf = new TransformNR(0,0,30).times(tf);
tf = new TransformNR(0, 0, 30).times(tf);
AddRobotLimb limb = new AddRobotLimb()
.setLimb(o)
.setNames(selectAll)
Expand All @@ -296,7 +296,7 @@ public void test() throws Exception {
}
//break;
}
for(MobileBase mb:loaded.getMobileBases()) {
for (MobileBase mb:loaded.getMobileBases()) {
System.out.println("Base "+mb);
mb.disconnect();
}
Expand Down
Loading