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 35 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
35 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
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ String getOsArch() {
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 Down
2 changes: 1 addition & 1 deletion java-bowler
13 changes: 7 additions & 6 deletions src/main/java/com/neuronrobotics/bowlerstudio/BowlerKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,12 @@ 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();
}
String location =parentFile.getAbsolutePath();
if(location.endsWith(".")) {
location=location.substring(0,location.length()-1);
}
Expand All @@ -209,8 +210,8 @@ public static void runArgumentsAfterStartup(String[] args, long startTime)
}
baseWorkspaceFile = new File(location);

com.neuronrobotics.sdk.common.Log.error("Using working directory "+baseWorkspaceFile.getAbsolutePath());
f=new File(baseWorkspaceFile.getAbsolutePath()+"/"+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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.neuronrobotics.bowlerstudio.creature;

public class DHLimbBuilder {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.neuronrobotics.bowlerstudio.creature;

import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine;
import com.neuronrobotics.sdk.addons.kinematics.MobileBase;

public class MobileBaseBuilder {

private String gitURL;
private String name;
private String xmlName =null;

public MobileBaseBuilder(String gitURL, String name) {
this.gitURL = gitURL;
this.name = name;

}

public MobileBase build() throws Exception {
MobileBase base = new MobileBase();
base.setScriptingName(name);
String filename = name+".xml";
if(xmlName!=null) {
filename=xmlName;
}
base.setGitSelfSource(new String[] {gitURL,filename});


ScriptingEngine.pushCodeToGit(gitURL, null, filename, base.getXml(), "Builder Write XML ", true);
return base;
}

public MobileBaseBuilder setXmlName(String xmlName) {
this.xmlName = xmlName;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -317,21 +317,25 @@ public static Map<String, String> getEnvironment(String exeType) {
}
return new HashMap<>();
}

public static File getRunExecutable(String exeType, IExternalEditor editor) {
return getRunExecutable(exeType,editor,false);
}
public static File getRunExecutable(String exeType, IExternalEditor editor,boolean justChecking) {
String executable = "executable";
retryLoop(exeType, editor, executable);
return getExecutable(exeType, editor, executable);
retryLoop(exeType, editor, executable,justChecking);
return getExecutable(exeType, editor, executable,justChecking);
}

public static File getConfigExecutable(String exeType, IExternalEditor editor) {
String executable = "configExecutable";
retryLoop(exeType, editor, executable);
return getExecutable(exeType, editor, executable);
retryLoop(exeType, editor, executable,false);
return getExecutable(exeType, editor, executable,false);
}
private static void retryLoop(String exeType, IExternalEditor editor, String executable) {
private static void retryLoop(String exeType, IExternalEditor editor, String executable,boolean justChecking) {
if(justChecking)
return;
for(int i=0;i<3;i++) {
if(getExecutable(exeType, editor, executable).exists()) {
if(getExecutable(exeType, editor, executable,justChecking).exists()) {
return;
}
new RuntimeException("Download or extraction failed, retrying").printStackTrace();
Expand All @@ -343,7 +347,7 @@ private static void retryLoop(String exeType, IExternalEditor editor, String exe
}
}

private static File getExecutable(String exeType, IExternalEditor editor, String executable) {
private static File getExecutable(String exeType, IExternalEditor editor, String executable,boolean justChecking) {
String key = discoverKey();

try {
Expand Down Expand Up @@ -383,7 +387,7 @@ private static File getExecutable(String exeType, IExternalEditor editor, String
if(new File(string).exists())
cmd=string;
}
if (!new File(cmd).exists()) {
if (!new File(cmd).exists() && !justChecking) {
if(exeType.toLowerCase().contentEquals("freecad")) {
//FreecadLoader.update(vm);
baseURL = vm.get("url").toString();
Expand Down Expand Up @@ -1093,5 +1097,9 @@ public static String getSTUDIO_INSTALL() {
public static void setSTUDIO_INSTALL(String sTUDIO_INSTALL) {
STUDIO_INSTALL = sTUDIO_INSTALL;
}
public static boolean isDownloadedAlready(String string) {
File f= DownloadManager.getRunExecutable(string, null,true);
return f.exists();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -413,36 +413,35 @@ public static boolean isUrlAlreadyOpen(File URL) {

public static void openGit(Repository localRepo, IGitAccessor accessor) {
Git git = null;
boolean alreadyOpen= false;
boolean alreadyOpen = false;
try {
String absolutePath = localRepo.getDirectory().getAbsolutePath();
for (String s : open.keySet()) {
Git g = open.get(s);
if(g!=null)
if (g.getRepository().getDirectory().getAbsolutePath()
.contentEquals(absolutePath)) {
git=g;
alreadyOpen=true;
break;
}
if (g != null)
if (g.getRepository().getDirectory().getAbsolutePath().contentEquals(absolutePath)) {
git = g;
alreadyOpen = true;
break;
}
}
if(!alreadyOpen) {
if (!alreadyOpen) {
git = new Git(localRepo);
open.put(absolutePath, git);
}
if (accessor != null) {
try {
accessor.run(git);
} catch (Throwable t) {
//new IssueReportingExceptionHandler().except(t);
// new IssueReportingExceptionHandler().except(t);
throw new RuntimeException(t);
}
}
if(!alreadyOpen)
if (!alreadyOpen)
gitclose(git);
} catch (Throwable t) {
//new IssueReportingExceptionHandler().except(t);
if(!alreadyOpen)
// new IssueReportingExceptionHandler().except(t);
if (!alreadyOpen)
if (git != null) {
gitclose(git);
}
Expand All @@ -459,7 +458,7 @@ private static void gitclose(Git git) {
if (git == null)
return;
open.remove(git.getRepository().getDirectory().getAbsolutePath());
//git.getRepository().close();
// git.getRepository().close();
git.close();
}

Expand Down Expand Up @@ -1765,23 +1764,23 @@ public static String locateGitUrl(File f, Git ref) throws IOException {
return null;
}

public static void locateGit(File f, IGitAccessor access) throws IOException {
public static File locateGitTopLevelDirectory(File f) throws IOException {
File gitRepoFile = f;
while (gitRepoFile != null) {
gitRepoFile = gitRepoFile.getParentFile();
if (gitRepoFile != null)
if (new File(gitRepoFile.getAbsolutePath() + "/.git/config").exists()) {
// com.neuronrobotics.sdk.common.Log.error("Fount git repo for file:
// "+gitRepoFile);
Repository localRepo = new FileRepository(gitRepoFile.getAbsoluteFile() + "/.git");
openGit(localRepo, access);
return;
return gitRepoFile;
}
}

throw new RuntimeException("File " + f + " is not in a git repository");
}

public static void locateGit(File f, IGitAccessor access) throws IOException {
Repository localRepo = new FileRepository(locateGitTopLevelDirectory(f).getAbsoluteFile() + "/.git");
openGit(localRepo, access);
}

public static String getText(URL website) throws Exception {

URLConnection connection = website.openConnection();
Expand Down Expand Up @@ -2090,16 +2089,18 @@ public static List<String> getAllLangauges() {
}
return langs;
}

public static List<String> getAllExtentions() {
ArrayList<String> langs = new ArrayList<>();
for (String L : getLangaugesMap().keySet()) {
IScriptingLanguage lang = getLangaugesMap().get(L);
for(String s:lang.getFileExtenetion()) {
for (String s : lang.getFileExtenetion()) {
langs.add(s);
}
}
return langs;
}

public static HashMap<String, IScriptingLanguage> getLangaugesMap() {
return langauges;
}
Expand Down Expand Up @@ -2164,7 +2165,7 @@ public static String[] copyGitFile(String sourceGit, String targetGit, String fi
}
String[] newFileCode;
try {
System.out.println("Opening "+targetFilename+" from "+targetGit);
System.out.println("Opening " + targetFilename + " from " + targetGit);
newFileCode = ScriptingEngine.codeFromGit(targetGit, targetFilename);
if (newFileCode == null)
newFileCode = new String[] { "" };
Expand Down
Loading