Skip to content

initialize the base builder with the giturl #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 89 commits into
base: kh/add-cadoodle
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
81ec68d
initialize the base builder with the giturl
madhephaestus Apr 12, 2025
3bdfad0
Adding builder and unit test
madhephaestus Apr 13, 2025
aa1592d
update the maven location
madhephaestus Apr 13, 2025
b18bde7
Adding an interface to intercept the prun forward
madhephaestus Apr 13, 2025
a067735
no prune on startup
madhephaestus Apr 14, 2025
d2d3f0a
Add setters for the default values
madhephaestus Apr 15, 2025
dfbb132
remove todo
madhephaestus Apr 19, 2025
1fd52a4
vitamins
madhephaestus Apr 19, 2025
bdd417f
Adding a check to see if a plugin is already downloaded
madhephaestus Apr 19, 2025
613106b
preserve the sweep defaults for re-loading accuracy
madhephaestus Apr 21, 2025
7e5d6bf
Make the setting of a specific timeline spot easy
madhephaestus Apr 21, 2025
7fe6d22
Add a listening event to the cadoodle file events
madhephaestus Apr 21, 2025
0e5ac99
Adjust how the timeline is updated
madhephaestus Apr 21, 2025
fa31576
only try to download when not just checking
madhephaestus Apr 21, 2025
20e788a
Change the opperation options to include insertion
madhephaestus Apr 21, 2025
b729240
Add a delete interface to the doodle file
madhephaestus Apr 22, 2025
d7aa99e
more stable loading after a delete
madhephaestus Apr 22, 2025
6351105
fixed broken new file startup
madhephaestus Apr 22, 2025
a1c04a7
make sure it checks for the latest version for copy the thumbnail
madhephaestus Apr 22, 2025
35f01bf
change timeline events to ensure the timeline is populated correctly on
madhephaestus Apr 22, 2025
5ca389d
make sure the breaking changes do not continue
madhephaestus Apr 22, 2025
4558bc8
Adding the git location as the location to place themanufacturing file
madhephaestus Apr 25, 2025
6a0b0df
make arrow key more reactive
madhephaestus Apr 25, 2025
8797025
Update the threading to keep the regeneration threads organized
madhephaestus Apr 25, 2025
635a682
Record the time since the last change to the state for use in the save
madhephaestus Apr 26, 2025
4c4208b
ensure the thread runners die properly
madhephaestus Apr 26, 2025
92af527
ensure teh regeneration thread starts
madhephaestus Apr 26, 2025
9c6a361
send the number of images updated in timeline
madhephaestus Apr 26, 2025
a57f2ba
dix the index walking of the delete operation
madhephaestus Apr 26, 2025
6308afb
Making thee location part of the paste operation based on how the move
madhephaestus Apr 27, 2025
5df3a5f
Add a getter for the objects at a given staate
madhephaestus Apr 27, 2025
bfd32e5
paste needs to accomidate hull operations, which are groups that have
madhephaestus Apr 27, 2025
ef74adb
on abort the model should re-show the current state.
madhephaestus Apr 27, 2025
e81f676
always fire teh regeneration done when adding anything
madhephaestus Apr 28, 2025
04be30e
Make sure the delete step selects the correct next operation
madhephaestus Apr 28, 2025
5c6c773
Add a status update for displaying time consuming operation status'
madhephaestus Apr 29, 2025
0419f5f
fix the issue where group of a hole with an object it doesnt touch
madhephaestus Apr 29, 2025
fbab0ca
fix the issue where group of a hole with an object it doesnt touch
madhephaestus Apr 29, 2025
edb00ea
Merge branch 'kh/builders-of-mobile-base' of
madhephaestus Apr 29, 2025
c6f8dc7
add prints
madhephaestus May 2, 2025
0a0e45a
have each operation be able to return what objects it is operation on
madhephaestus May 4, 2025
1a0d1ec
Mae sure all of the objects the op is applied to and the results are
madhephaestus May 4, 2025
9bbc608
close https://github.com/CommonWealthRobotics/BowlerStudio/issues/452
madhephaestus May 7, 2025
6f4cafe
make sure failing task does not blow up the build
madhephaestus May 7, 2025
e5d74c7
Adding memory check
madhephaestus May 9, 2025
aef0d39
Add a thumbnail update and a print for mem usage
madhephaestus May 13, 2025
425366b
Null check any incoming cadoodle operation and throw an exception into
madhephaestus May 15, 2025
3f62a58
filter out nulls
madhephaestus May 15, 2025
5cd05ab
only show splash when timeline is open
madhephaestus May 16, 2025
d9c129e
Updating the JavaCAD to include sweep method for the sweep
madhephaestus May 17, 2025
fdd1b9c
updated jcsg to avoid the spiral bug
madhephaestus May 17, 2025
630d7a9
getter and setter for default spiral
madhephaestus May 17, 2025
258f70d
default value for timeline showing and a setter for the created time to
madhephaestus May 17, 2025
8e97c08
Adding the new JCSG
madhephaestus May 18, 2025
f4d065b
use CSGDatabaseInstance swapping to maintain state when running a doodle
madhephaestus May 18, 2025
edfae77
Updating the JavaCAD to include sweep method for the sweep
madhephaestus May 19, 2025
0b169e9
Adding a doodle file loader
madhephaestus May 19, 2025
d9fef48
remove comment
madhephaestus May 19, 2025
3688cff
formatting
madhephaestus May 19, 2025
d89ac20
branch error checking
madhephaestus May 19, 2025
4b93e62
add the file paraameter after the database is reattached
madhephaestus May 19, 2025
b7d389a
set the asset factory to use the correct default branch
madhephaestus May 19, 2025
724a783
only create files when logged in
madhephaestus May 19, 2025
b60e80b
Add an STL save to the save for use as a thumbnail
madhephaestus May 20, 2025
a4d7b88
formatting
madhephaestus May 20, 2025
52e2faa
Adding string getters annd setters for the op result for storage in the
madhephaestus May 20, 2025
c631888
Clean up class heiarchy and add the cadoodle file to each object
madhephaestus May 25, 2025
25340be
use the updated class instead of the interface
madhephaestus May 25, 2025
3d88eea
Set the cadoodle file into each opperation
madhephaestus May 25, 2025
6545f10
close loaded cadoodle files after use
madhephaestus May 25, 2025
350c437
life cycle the loaded file, but don not close in the helper method
madhephaestus May 25, 2025
d8d920a
Adding the JCSG server
madhephaestus May 29, 2025
4985731
Merge branch 'kh/builders-of-mobile-base' of [email protected]:CommonWea…
madhephaestus May 29, 2025
3606705
Adding a server launch to the kernel
madhephaestus May 29, 2025
847405e
Adding checks on the server datatypes
madhephaestus Jun 1, 2025
a284d31
update jcsg
madhephaestus Jun 1, 2025
ea55b8f
Adding the latest client
madhephaestus Jun 2, 2025
14e1555
use latest server/client
madhephaestus Jun 2, 2025
10c15de
serer
madhephaestus Jun 2, 2025
8c09550
removing print statements
madhephaestus Jun 2, 2025
743da4f
server
madhephaestus Jun 2, 2025
ad8d0e8
improve triangulation
madhephaestus Jun 5, 2025
ff803ae
jcsg
madhephaestus Jun 6, 2025
80e22b5
Updateing jcsg
madhephaestus Jun 7, 2025
d5b97f5
jcsg
madhephaestus Jun 7, 2025
ecab2a2
set client
madhephaestus Jun 7, 2025
a2006fd
only print memory when over 50%
madhephaestus Jun 7, 2025
80de143
make sure the event is not triggered when control is pressed
madhephaestus Jun 12, 2025
56aff44
increase file gen timeout
madhephaestus Jun 22, 2025
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
49 changes: 2 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ String getOsArch() {
return System.getProperty("os.arch");
}

//https://oss.sonatype.org/service/local/repositories/releases/content/com/neuronrobotics/nrjavaserial/3.10.1/nrjavaserial-3.10.1.jar


repositories {
mavenCentral()
maven {
url 'https://commonwealthrobotics.com/jcenter-mirror/'
url 'https://commonwealthrobotics.com/maven/'
allowInsecureProtocol = true
}
maven { url 'https://repo.maven.apache.org/maven2/' }
Expand All @@ -147,7 +146,6 @@ repositories {

maven { url "https://jitpack.io" }
maven { url "https://repo.eclipse.org/content/groups/releases/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://dl.bintray.com/dfki-lt/maven/" }
maven { url "https://raw.github.com/marytts/marytts/master/repository/" }
maven { url "https://repo.jenkins-ci.org/public/" }
Expand All @@ -156,7 +154,7 @@ repositories {

dependencies {

api 'com.neuronrobotics:JavaCad:2.5.0'
api 'com.neuronrobotics:JavaCad:2.9.5'
api project('java-bowler')
api project('GithubPasswordManager:GithubPasswordManager')

Expand Down Expand Up @@ -388,47 +386,4 @@ test {
exceptionFormat = 'full'
}
}
/*
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Bowler Scripting Kernel'
packaging 'jar'
// optionally artifactId can be defined here
description 'A command line utility for accsing the bowler framework.'
url 'http://neuronrobotics.com'
scm {
connection 'scm:git:https://github.com/NeuronRobotics/bowler-script-kernel.git'
developerConnection 'scm:git:[email protected]:NeuronRobotics/bowler-script-kernel.git'
url 'https://github.com/NeuronRobotics/bowler-script-kernel'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'madhephaestus'
name 'Kevin Harrington'
email '[email protected]'
}
}
}
}
}
}
*/

2 changes: 1 addition & 1 deletion java-bowler
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public EventHandler<MouseEvent> getMouseEvents() {
@Override
public void handle(MouseEvent event) {
String name = event.getEventType().getName();
if(event.isControlDown())
return;
switch (name) {
case "MOUSE_PRESSED":
if(event.isPrimaryButtonDown())
Expand Down
114 changes: 73 additions & 41 deletions src/main/java/com/neuronrobotics/bowlerstudio/BowlerKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import com.neuronrobotics.sdk.addons.kinematics.MobileBase;

import eu.mihosoft.vrl.v3d.CSG;
import eu.mihosoft.vrl.v3d.CSGServer;
import eu.mihosoft.vrl.v3d.ICSGProgress;
import eu.mihosoft.vrl.v3d.JavaFXInitializer;
import javafx.application.Platform;
Expand All @@ -72,7 +73,7 @@ public class BowlerKernel {

// private static final String CSG = null;
private static File historyFile = new File(ScriptingEngine.getWorkspace().getAbsolutePath() + "/bowler.history");
private static boolean kernelMode=true;
private static boolean kernelMode = true;

private static void loadHistoryLocal() {
historyFile = new File(ScriptingEngine.getWorkspace().getAbsolutePath() + "/bowler.history");
Expand Down Expand Up @@ -108,8 +109,9 @@ private static void fail() {
"java -jar BowlerScriptKernel.jar -p <file 1> .. <file n> # This will load one script then take the list of objects returned and pss them to the next script as its 'args' variable ");
com.neuronrobotics.sdk.common.Log.error(
"java -jar BowlerScriptKernel.jar -r <Groovy Jython or Clojure> (Optional)(-s or -p)<file 1> .. <file n> # This will start a shell in the requested langauge and run the files provided. ");
com.neuronrobotics.sdk.common.Log.error("java -jar BowlerScriptKernel.jar -g <Git repo> <Git file> # this will run a file from git");
if(isKernelMode())
com.neuronrobotics.sdk.common.Log
.error("java -jar BowlerScriptKernel.jar -g <Git repo> <Git file> # this will run a file from git");
if (isKernelMode())
System.exit(1);
}

Expand All @@ -130,8 +132,10 @@ public static void runArgumentsAfterStartup(String[] args, long startTime)
boolean gitRun = false;
String gitRepo = null;
String gitFile = null;
boolean runCSGServer = false;
File keys = null;
int port = 3742;
for (String s : args) {

if (gitRun) {
if (gitRepo == null) {
gitRepo = s;
Expand All @@ -142,7 +146,34 @@ public static void runArgumentsAfterStartup(String[] args, long startTime)
if (s.startsWith("-g")) {
gitRun = true;
}
if (s.toLowerCase().contains("-csgserver")) {
runCSGServer = true;
continue;
}
if (runCSGServer) {
if (keys == null) {
keys = new File(s);
continue;
} else {
try {
port = Integer.parseInt(s);
}catch(NumberFormatException ex) {
ex.printStackTrace();
}
}
}
}
if (runCSGServer) {
CSGServer.setDirectory(ScriptingEngine.getWorkspace());
CSGServer server = new CSGServer(port, keys);
try {
server.start();
} catch (Exception e) {
e.printStackTrace();
}
return;
}

Object ret = null;
File baseWorkspaceFile = null;
if (gitRun && gitRepo != null) {
Expand Down Expand Up @@ -196,22 +227,23 @@ public static void runArgumentsAfterStartup(String[] args, long startTime)
try {

File f = new File(s);
File parentFile = f.getParentFile();
if(parentFile==null) {
parentFile=new File(".");
String location;
try {
location = ScriptingEngine.locateGitTopLevelDirectory(f).getAbsolutePath();
} catch (Exception ex) {
location = new File(".").getAbsolutePath();
}
if (location.endsWith(".")) {
location = location.substring(0, location.length() - 1);
}
String location =parentFile.getAbsolutePath();
if(location.endsWith(".")) {
location=location.substring(0,location.length()-1);
}
if(!location.endsWith("/")) {
location+="/";
if (!location.endsWith("/")) {
location += "/";
}
baseWorkspaceFile = new File(location);
com.neuronrobotics.sdk.common.Log.error("Using working directory "+baseWorkspaceFile.getAbsolutePath());
f=new File(baseWorkspaceFile.getAbsolutePath()+"/"+f.getName());
com.neuronrobotics.sdk.common.Log.error("File "+f.getName());

System.out.println("Using working directory " + baseWorkspaceFile.getAbsolutePath());
f = new File(baseWorkspaceFile.getAbsolutePath() + "/" + s);
com.neuronrobotics.sdk.common.Log.error("File " + f.getName());
ret = ScriptingEngine.inlineFileScriptRun(f, null);
} catch (Throwable e) {
e.printStackTrace();
Expand Down Expand Up @@ -384,27 +416,27 @@ public void progressUpdate(int currentIndex, int finalIndex, String type,
}

private static void finish(long startTime) {
com.neuronrobotics.sdk.common.Log.error(
"Process took " + (((double) (System.currentTimeMillis() - startTime))) / 60000.0 + " minutes");
com.neuronrobotics.sdk.common.Log
.error("Process took " + (((double) (System.currentTimeMillis() - startTime))) / 60000.0 + " minutes");
System.exit(0);
}

public static void processReturnedObjectsStart(Object ret, File baseWorkspaceFile) {
processUIOpening(ret);
if(baseWorkspaceFile!=null)
com.neuronrobotics.sdk.common.Log.error("Processing file in directory "+baseWorkspaceFile.getAbsolutePath());
if (baseWorkspaceFile != null)
System.out.println("Processing file in directory " + baseWorkspaceFile.getAbsolutePath());


if (baseWorkspaceFile != null) {
File baseDirForFiles = new File(baseWorkspaceFile.getAbsolutePath()+"/manufacturing/");

File baseDirForFiles = new File(baseWorkspaceFile.getAbsolutePath() + "/manufacturing/");
if (baseDirForFiles.exists()) {
// baseDirForFiles.mkdir();
File bomCSV = new File(
baseWorkspaceFile.getAbsolutePath() + "/" + VitaminBomManager.getManufacturingBomCsv());
if (bomCSV.exists()) {

File file = new File(baseWorkspaceFile.getAbsolutePath() + "/"+ VitaminBomManager.getManufacturingBomCsv());
File file = new File(
baseWorkspaceFile.getAbsolutePath() + "/" + VitaminBomManager.getManufacturingBomCsv());
// if (file.exists())
// file.delete();
try {
Expand All @@ -417,7 +449,8 @@ public static void processReturnedObjectsStart(Object ret, File baseWorkspaceFil
File bom = new File(
baseWorkspaceFile.getAbsolutePath() + "/" + VitaminBomManager.getManufacturingBomJson());
if (bom.exists()) {
File file = new File(baseWorkspaceFile.getAbsolutePath() + "/"+ VitaminBomManager.getManufacturingBomJson());
File file = new File(
baseWorkspaceFile.getAbsolutePath() + "/" + VitaminBomManager.getManufacturingBomJson());
// if (file.exists())
// file.delete();
try {
Expand All @@ -427,17 +460,17 @@ public static void processReturnedObjectsStart(Object ret, File baseWorkspaceFil
e.printStackTrace();
}
}
}else {
} else {
baseDirForFiles.mkdirs();
}
}
ArrayList<CSG> csgBits = new ArrayList<>();
try {
processReturnedObjects(ret, csgBits);
String url = ScriptingEngine.locateGitUrl(baseWorkspaceFile);
com.neuronrobotics.sdk.common.Log.error("Loading printbed URL "+url);
com.neuronrobotics.sdk.common.Log.error("Loading printbed URL " + url);
PrintBedManager printBedManager = new PrintBedManager(baseWorkspaceFile, csgBits);
if(printBedManager.hasPrintBed())
if (printBedManager.hasPrintBed())
csgBits = printBedManager.makePrintBeds();
else {
com.neuronrobotics.sdk.common.Log.error("Exporting files without print bed");
Expand All @@ -450,12 +483,12 @@ public static void processReturnedObjectsStart(Object ret, File baseWorkspaceFil
}

private static void processUIOpening(Object ret) {
if(Tab.class.isInstance(ret)) {
if (Tab.class.isInstance(ret)) {
com.neuronrobotics.sdk.common.Log.error("Launching User Defined UI");
Tab t=(Tab)ret;
Tab t = (Tab) ret;
CompletableFuture<Boolean> future = new CompletableFuture<>();

BowlerKernel.runLater(()->{
BowlerKernel.runLater(() -> {
// Get the content from the tab
javafx.scene.Node content = t.getContent();
// Create a new stage
Expand All @@ -481,7 +514,7 @@ private static void processUIOpening(Object ret) {
newStage.setOnCloseRequest(event -> {
// Exit the JVM when the window is closed
future.complete(true);
BowlerKernel.runLater(()->Platform.exit());
BowlerKernel.runLater(() -> Platform.exit());
});
FontSizeManager.addListener(fontNum -> {
int tmp = fontNum - 10;
Expand All @@ -490,10 +523,10 @@ private static void processUIOpening(Object ret) {
root.setStyle("-fx-font-size: " + tmp + "pt");
newStage.sizeToScene();
});
if(IStageReceiver.class.isInstance(ret)) {
if (IStageReceiver.class.isInstance(ret)) {
com.neuronrobotics.sdk.common.Log.error("UI is a IStageReceiver");
IStageReceiver r=(IStageReceiver)ret;
BowlerKernel.runLater(()->{
IStageReceiver r = (IStageReceiver) ret;
BowlerKernel.runLater(() -> {
r.receiveStage(newStage, scene);
});
}
Expand All @@ -504,13 +537,13 @@ private static void processUIOpening(Object ret) {
scene.getRoot().layout();
});
try {
future.get();
future.get();
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
}
}

}

private static void processReturnedObjects(Object ret, ArrayList<CSG> csgBits) {
Expand All @@ -523,8 +556,8 @@ private static void processReturnedObjects(Object ret, ArrayList<CSG> csgBits) {
if (CSG.class.isInstance(ret)) {
csgBits.add((CSG) ret);
}
if(CaDoodleFile.class.isInstance(ret)) {
processReturnedObjects(CaDoodleLoader.process((CaDoodleFile)ret), csgBits);
if (CaDoodleFile.class.isInstance(ret)) {
processReturnedObjects(CaDoodleLoader.process((CaDoodleFile) ret), csgBits);
return;
}
if (MobileBase.class.isInstance(ret)) {
Expand Down Expand Up @@ -830,5 +863,4 @@ public static void setKernelMode(boolean kernelMode) {
BowlerKernel.kernelMode = kernelMode;
}


}
Loading