From d69729b067aa3fc644834403f956654315fbb218 Mon Sep 17 00:00:00 2001 From: rondlh <77279634+rondlh@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:41:26 +0800 Subject: [PATCH] Fix typo "availible" -> "available" Fix typo "availible" -> "available" --- .../bowlerkernel/djl/PredictorFactory.java | 2 +- .../bowlerstudio/BowlerKernel.java | 2 +- .../creature/CadFileExporter.java | 2 +- .../creature/MobileBaseCadManager.java | 6 +- .../scripting/cadoodle/CaDoodleFile.java | 10 +-- .../bowlerstudio/vitamins/Purchasing.java | 4 +- .../addons/gamepad/BowlerJInputDevice.java | 4 +- .../junit/bowler/CaDoodleWorkflowTest.java | 78 +++++++++---------- .../bowler/MuJoCoBowlerIntegrationTest.java | 19 ++--- 9 files changed, 64 insertions(+), 63 deletions(-) diff --git a/src/main/java/com/neuronrobotics/bowlerkernel/djl/PredictorFactory.java b/src/main/java/com/neuronrobotics/bowlerkernel/djl/PredictorFactory.java index a3f288e7..af6e755f 100644 --- a/src/main/java/com/neuronrobotics/bowlerkernel/djl/PredictorFactory.java +++ b/src/main/java/com/neuronrobotics/bowlerkernel/djl/PredictorFactory.java @@ -93,7 +93,7 @@ public static Predictor imageContentsFactory(ImagePredic } break; default: - throw new RuntimeException("No Model availible of type " + type); + throw new RuntimeException("No Model available of type " + type); } } diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerKernel.java b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerKernel.java index 42b05a95..04368f26 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/BowlerKernel.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/BowlerKernel.java @@ -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(); diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/creature/CadFileExporter.java b/src/main/java/com/neuronrobotics/bowlerstudio/creature/CadFileExporter.java index 7ff4bd56..9834bd44 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/creature/CadFileExporter.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/creature/CadFileExporter.java @@ -219,7 +219,7 @@ private File makeSvg(String nameBase, List 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); } diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobileBaseCadManager.java b/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobileBaseCadManager.java index de600969..0dc8bbbe 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobileBaseCadManager.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/creature/MobileBaseCadManager.java @@ -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); @@ -1040,8 +1040,8 @@ public ArrayList generateBody(CSGDatabaseInstance csgDatabaseInstance,Mobil } ArrayList 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)); diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/CaDoodleFile.java b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/CaDoodleFile.java index 13f203ee..d9e71b36 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/CaDoodleFile.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/CaDoodleFile.java @@ -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)) { @@ -858,7 +858,7 @@ public void back() { } public void forward() { - if (isForwardAvailible()) + if (isForwardAvailable()) setCurrentIndex(getCurrentIndex() + 1); updateCurrentFromCache(); CaDoodleOperation op = getCurrentOperation(); @@ -903,7 +903,7 @@ public void moveToOpIndex(int newIndex) { fireSaveSuggestion(); } - public boolean isBackAvailible() { + public boolean isBackAvailable() { return getCurrentIndex() > 1; } @@ -921,7 +921,7 @@ public CaDoodleOperation getCurrentOperation() { return getOperations().get(getCurrentIndex() - 1); } - public boolean isForwardAvailible() { + public boolean isForwardAvailable() { return getCurrentIndex() < getOperations().size(); } @@ -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; } diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/vitamins/Purchasing.java b/src/main/java/com/neuronrobotics/bowlerstudio/vitamins/Purchasing.java index 068779eb..14066929 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/vitamins/Purchasing.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/vitamins/Purchasing.java @@ -212,7 +212,7 @@ public static ArrayList 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()); @@ -229,7 +229,7 @@ public static ArrayList 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);; } diff --git a/src/main/java/com/neuronrobotics/sdk/addons/gamepad/BowlerJInputDevice.java b/src/main/java/com/neuronrobotics/sdk/addons/gamepad/BowlerJInputDevice.java index 3b0c5872..74774d67 100644 --- a/src/main/java/com/neuronrobotics/sdk/addons/gamepad/BowlerJInputDevice.java +++ b/src/main/java/com/neuronrobotics/sdk/addons/gamepad/BowlerJInputDevice.java @@ -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); @@ -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); } diff --git a/test/java/src/junit/bowler/CaDoodleWorkflowTest.java b/test/java/src/junit/bowler/CaDoodleWorkflowTest.java index f9dc0701..0efc489a 100644 --- a/test/java/src/junit/bowler/CaDoodleWorkflowTest.java +++ b/test/java/src/junit/bowler/CaDoodleWorkflowTest.java @@ -72,15 +72,15 @@ public void test() throws Exception { "sphere.groovy"); cf.addOperation(cube1).join(); Listback= 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 ); @@ -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(); @@ -129,9 +129,9 @@ 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();; @@ -139,18 +139,18 @@ public void test() throws Exception { 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(); @@ -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"); } @@ -193,23 +193,23 @@ public void test() throws Exception { new Paste().setNames(Arrays.asList(newGroupName))).join();; back=loaded.getCurrentState(); ArrayList selectAll = new ArrayList(); - 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)); @@ -217,24 +217,24 @@ public void test() throws Exception { back=loaded.getCurrentState(); loaded.save(); - for(int i=0;i<3;i++) { + for (int i = 0; i < 3; i++) { loaded.back(); } List 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"); } @@ -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(); - for(CSG c:loaded.getCurrentState()) { + for (CSG c:loaded.getCurrentState()) { selectAll.add(c.getName()); } MakeRobot mr = new MakeRobot(); @@ -270,7 +270,7 @@ public void test() throws Exception { loaded.save(); ScriptingEngine.pull(ControllerOption.URL_OF_OPTIONS); ArrayList controllers = ControllerOption.getOptions(); - for(ControllerOption o:controllers) { + for (ControllerOption o:controllers) { System.out.println("Adding a Controller: "+o); AddRobotController con = new AddRobotController() .setNames(selectAll) @@ -282,10 +282,10 @@ public void test() throws Exception { ScriptingEngine.pull("https://github.com/madhephaestus/carl-the-hexapod.git"); ArrayList 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) @@ -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(); } diff --git a/test/java/src/junit/bowler/MuJoCoBowlerIntegrationTest.java b/test/java/src/junit/bowler/MuJoCoBowlerIntegrationTest.java index 063993d4..da751919 100644 --- a/test/java/src/junit/bowler/MuJoCoBowlerIntegrationTest.java +++ b/test/java/src/junit/bowler/MuJoCoBowlerIntegrationTest.java @@ -26,6 +26,7 @@ import eu.mihosoft.vrl.v3d.JavaFXInitializer; import eu.mihosoft.vrl.v3d.parametrics.CSGDatabase; @SuppressWarnings("unchecked") + public class MuJoCoBowlerIntegrationTest { @Test @@ -35,10 +36,10 @@ public void test() throws Exception { 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"); } ArrayList bases = new ArrayList<>(); - ArrayList free =new ArrayList<>(); + ArrayList free = new ArrayList<>(); ArrayList terrain = new ArrayList<>(); @@ -48,7 +49,7 @@ public void test() throws Exception { terrain= (ArrayList) ScriptingEngine.gitScriptRun(CSGDatabase.getInstance(), "https://github.com/madhephaestus/VexHighStakes2024.git", "field.groovy"); - com.neuronrobotics.sdk.common.Log.debug("Parts size = "+parts.size()); + com.neuronrobotics.sdk.common.Log.debug("Parts size = " + parts.size()); //terrain.add(new Cube(10000,10000,100).toCSG().toZMax()); free.addAll(parts); MuJoCoPhysicsManager manager = new MuJoCoPhysicsManager(CSGDatabase.getInstance(),"javaCadTest", bases, free, terrain, new File("./physicsTest")); @@ -58,20 +59,20 @@ public void test() throws Exception { long start = System.currentTimeMillis(); double now = 0; boolean first=true; - while((now=manager.getCurrentSimulationTimeSeconds())<5) { + while ((now=manager.getCurrentSimulationTimeSeconds()) < 5) { long took; - if((took = manager.stepAndWait())>(manager.getCurrentSimulationTimeSeconds()*1000.0)) { - if(first) { - first=false; + if ((took = manager.stepAndWait())>(manager.getCurrentSimulationTimeSeconds()*1000.0)) { + if (first) { + first = false; continue; } fail("Real time broken! "+took+" instead of expected "+manager.getCurrentSimulationTimeSeconds()); - }else { + } else { com.neuronrobotics.sdk.common.Log.debug("Time "+now); } long timeSinceStart = System.currentTimeMillis()-start; double sec = ((double)timeSinceStart)/1000.0; - if((sec-1)>now) { + if ((sec-1) > now) { fail("Simulation froze and restarted! "+sec+" expected "+now); } }