BowlerKernel
BowlerKernel.java
Go to the documentation of this file.
1 package com.neuronrobotics.bowlerstudio;
2 
3 import java.awt.Desktop;
4 import java.io.BufferedReader;
5 import java.io.BufferedWriter;
6 import java.io.File;
7 import java.io.FileNotFoundException;
8 import java.io.FileOutputStream;
9 import java.io.FileReader;
10 import java.io.FileWriter;
11 import java.io.IOException;
12 import java.io.OutputStreamWriter;
13 import java.io.PrintWriter;
14 import java.net.URI;
15 import java.net.URISyntaxException;
16 import java.net.URL;
17 import java.nio.file.Files;
18 import java.util.ArrayList;
19 import java.util.Arrays;
20 import java.util.Collection;
21 import java.util.List;
22 import java.util.Set;
23 
24 //import org.springframework.boot.SpringApplication;
25 //import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
26 //import org.springframework.context.annotation.ComponentScan;
27 //import org.springframework.context.annotation.Configuration;
28 
29 import jline.ConsoleReader;
30 import jline.Terminal;
31 
32 import com.neuronrobotics.bowlerstudio.creature.CadFileExporter;
33 import com.neuronrobotics.bowlerstudio.creature.IMobileBaseUI;
34 import com.neuronrobotics.bowlerstudio.creature.IgenerateBed;
35 import com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager;
36 import com.neuronrobotics.bowlerstudio.printbed.PrintBedManager;
37 import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine;
38 import com.neuronrobotics.bowlerstudio.vitamins.VitaminBomManager;
39 import com.neuronrobotics.sdk.addons.kinematics.MobileBase;
40 
41 import eu.mihosoft.vrl.v3d.CSG;
42 import eu.mihosoft.vrl.v3d.ICSGProgress;
43 import eu.mihosoft.vrl.v3d.JavaFXInitializer;
44 import javafx.scene.transform.Affine;
45 import marytts.signalproc.effects.LpcWhisperiserEffect;
46 import marytts.signalproc.effects.RobotiserEffect;
47 import marytts.signalproc.effects.ChorusEffectBase;
48 import marytts.signalproc.effects.HMMDurationScaleEffect;
49 import marytts.signalproc.effects.VolumeEffect;
50 
51 public class BowlerKernel {
52 
53  // private static final String CSG = null;
54  private static File historyFile = new File(ScriptingEngine.getWorkspace().getAbsolutePath() + "/bowler.history");
55 
56  static {
57  historyFile = new File(ScriptingEngine.getWorkspace().getAbsolutePath() + "/bowler.history");
58  ArrayList<String> history = new ArrayList<>();
59  if (!historyFile.exists()) {
60  try {
61  historyFile.createNewFile();
62  } catch (IOException e) {
63  // TODO Auto-generated catch block
64  e.printStackTrace();
65  }
66  history.add("println SDKBuildInfo.getVersion()");
67  history.add("for(int i=0;i<1000000;i++) { println dyio.getValue(0) }");
68  history.add("dyio.setValue(0,128)");
69  history.add("println dyio.getValue(0)");
70  history.add("ScriptingEngine.inlineGistScriptRun(\"d4312a0787456ec27a2a\", \"helloWorld.groovy\" , null)");
71  history.add("DeviceManager.addConnection(new DyIO(ConnectionDialog.promptConnection()),\"dyio\")");
72  history.add("DeviceManager.addConnection(new DyIO(new SerialConnection(\"/dev/DyIO0\")),\"dyio\")");
73  history.add("shellType Clojure #Switches shell to Clojure");
74  history.add("shellType Jython #Switches shell to Python");
75  history.add("shellType Groovy #Switches shell to Groovy/Java");
76 
77  history.add("println \"Hello world!\"");
78 
79  writeHistory(history);
80  }
81  }
82 
83  private static void fail() {
84  System.err.println(
85  "Usage: \r\njava -jar BowlerScriptKernel.jar -s <file 1> .. <file n> # This will load one script after the next ");
86  System.err.println(
87  "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 ");
88  System.err.println(
89  "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. ");
90  System.err.println("java -jar BowlerScriptKernel.jar -g <Git repo> <Git file> # this will run a file from git");
91 
92  System.exit(1);
93  }
94 
98  @SuppressWarnings("unchecked")
99  public static void main(String[] args) throws Exception {
100  long startTime = System.currentTimeMillis();
101  try {
103  } catch (Throwable t) {
104  t.printStackTrace();
105  System.err.println("ERROR No UI engine availible");
106  }
108  if (args.length == 0) {
109  fail();
110  }
111  ScriptingEngine.gitScriptRun("https://github.com/CommonWealthRobotics/DeviceProviders.git", "loadAll.groovy",
112  null);
113  boolean gitRun = false;
114  String gitRepo = null;
115  String gitFile = null;
116  for (String s : args) {
117 
118  if (gitRun) {
119  if (gitRepo == null) {
120  gitRepo = s;
121  } else if (gitFile == null) {
122  gitFile = s;
123  }
124  }
125  if (s.startsWith("-g")) {
126  gitRun = true;
127  }
128  }
129  Object ret = null;
130  File baseWorkspaceFile = null;
131  if (gitRun && gitRepo != null) {
132  String url = null;
133 
134  ScriptingEngine.pull(gitRepo);
135  ArrayList<String> files = ScriptingEngine.filesInGit(gitRepo);
136  boolean fileExists = false;
137  if (gitFile == null)
138  gitFile = "launch";
139  if (gitFile.endsWith("/"))
140  gitFile += "launch";
141  for (String f : files) {
142  if (f.startsWith(gitFile)) {
143  gitFile = f;
144  fileExists = true;
145  }
146  }
147  if (!fileExists) {
148  System.err.println("\n\nERROR file does not exist: " + gitFile);
149  gitFile = null;
150  }
151  if (gitFile != null)
152  try {
153  ret = ScriptingEngine.gitScriptRun(gitRepo, gitFile, null);
154  url = gitRepo;
155  baseWorkspaceFile = ScriptingEngine.getRepositoryCloneDirectory(url);
156 
157  processReturnedObjectsStart(ret, baseWorkspaceFile);
158  } catch (Throwable e) {
159  e.printStackTrace();
160  fail();
161  }
162  else {
163  System.out.println("Files in git:");
164  for (String f : files) {
165  System.out.println("\t" + f);
166  }
167  }
168  finish(startTime);
169  }
170 // File servo = ScriptingEngine.fileFromGit("https://github.com/CommonWealthRobotics/BowlerStudioVitamins.git",
171 // "BowlerStudioVitamins/stl/servo/smallservo.stl");
172 //
173 // ArrayList<CSG> cad = (ArrayList<CSG> )ScriptingEngine.inlineGistScriptRun("4814b39ee72e9f590757", "javaCad.groovy" , null);
174 // System.out.println(servo.exists()+" exists: "+servo);
175 
176  boolean startLoadingScripts = false;
177  for (String s : args) {
178  if (startLoadingScripts) {
179  try {
180 
181  File f = new File(s);
182  File parentFile = f.getParentFile();
183  if(parentFile==null) {
184  parentFile=new File(".");
185  }
186  String location =parentFile.getAbsolutePath();
187  if(location.endsWith(".")) {
188  location=location.substring(0,location.length()-1);
189  }
190  if(!location.endsWith("/")) {
191  location+="/";
192  }
193  baseWorkspaceFile = new File(location);
194 
195  System.out.println("Using working directory "+baseWorkspaceFile.getAbsolutePath());
196  f=new File(baseWorkspaceFile.getAbsolutePath()+"/"+f.getName());
197  System.out.println("File "+f.getName());
198  ret = ScriptingEngine.inlineFileScriptRun(f, null);
199  } catch (Throwable e) {
200  e.printStackTrace();
201  fail();
202  }
203  }
204  if (s.startsWith("-f") || s.startsWith("-s")) {
205  startLoadingScripts = true;
206  }
207  }
208  if (startLoadingScripts) {
209  processReturnedObjectsStart(ret, baseWorkspaceFile);
210  startLoadingScripts = false;
211  finish(startTime);
212  return;
213  }
214 
215  for (String s : args) {
216 
217  if (startLoadingScripts) {
218  try {
219  ret = ScriptingEngine.inlineFileScriptRun(new File(s), (ArrayList<Object>) ret);
220  } catch (Throwable e) {
221  e.printStackTrace();
222  fail();
223  }
224  }
225  if (s.startsWith("-p")) {
226  startLoadingScripts = true;
227  }
228  }
229  if (startLoadingScripts) {
230  processReturnedObjectsStart(ret, null);
231  finish(startTime);
232  return;
233  }
234  boolean runShell = false;
235  String groovy = "Groovy";
236  String shellTypeStorage = groovy;
237  for (String s : args) {
238 
239  if (runShell) {
240  try {
241  shellTypeStorage = s;
242  } catch (Throwable e) {
243  shellTypeStorage = groovy;
244  }
245  break;
246  }
247  if (s.startsWith("-r")) {
248  runShell = true;
249  }
250  }
251 
252  if (!runShell) {
253  finish(startTime);
254  }
255  System.out.println("Starting Bowler REPL in langauge: " + shellTypeStorage);
256  // sample from
257  // http://jline.sourceforge.net/testapidocs/src-html/jline/example/Example.html
258 
259  if (!Terminal.getTerminal().isSupported()) {
260  System.out.println("Terminal not supported " + Terminal.getTerminal());
261  }
262  // Terminal.getTerminal().initializeTerminal();
263 
264  ConsoleReader reader = new ConsoleReader();
265  reader.addTriggeredAction(Terminal.CTRL_C, e -> {
266  finish(startTime);
267  });
268 
269  if (!historyFile.exists()) {
270  historyFile.createNewFile();
271  reader.getHistory().addToHistory("println SDKBuildInfo.getVersion()");
272  reader.getHistory().addToHistory("for(int i=0;i<100;i++) { println dyio.getValue(0) }");
273  reader.getHistory().addToHistory("dyio.setValue(0,128)");
274  reader.getHistory().addToHistory("println dyio.getValue(0)");
275  reader.getHistory().addToHistory(
276  "ScriptingEngine.inlineGistScriptRun(\"d4312a0787456ec27a2a\", \"helloWorld.groovy\" , null)");
277  reader.getHistory().addToHistory(
278  "DeviceManager.addConnection(new DyIO(ConnectionDialog.promptConnection()),\"dyio\")");
279  reader.getHistory().addToHistory(
280  "DeviceManager.addConnection(new DyIO(new SerialConnection(\"/dev/DyIO0\")),\"dyio\")");
281  reader.getHistory().addToHistory("BowlerKernel.speak(\"Text to speech works like this\")");
282  reader.getHistory().addToHistory(
283  "ScriptingEngine.gitScriptRun(\\\"https://github.com/OperationSmallKat/greycat.git\\\", \\\"launch.groovy\\\" , null)");
284  reader.getHistory().addToHistory("println \"Hello world!\"");
285  writeHistory(reader.getHistory().getHistoryList());
286  } else {
287  List<String> history = loadHistory();
288  for (String h : history) {
289  reader.getHistory().addToHistory(h);
290  }
291  }
292  reader.setBellEnabled(false);
293  reader.setDebug(new PrintWriter(new FileWriter("writer.debug", true)));
294 
295  Runtime.getRuntime().addShutdownHook(new Thread() {
296  @Override
297  public void run() {
298  Thread.currentThread().setUncaughtExceptionHandler(new IssueReportingExceptionHandler());
299 
300  writeHistory(reader.getHistory().getHistoryList());
301  }
302  });
303 
304  // SpringApplication.run(SpringBowlerUI.class, new String[]{});
305 
306  String line;
307  try {
308  while ((line = reader.readLine("Bowler " + shellTypeStorage + "> ")) != null) {
309  if (line.equalsIgnoreCase("quit") || line.equalsIgnoreCase("exit")) {
310  break;
311  }
312  if (line.equalsIgnoreCase("history") || line.equalsIgnoreCase("h")) {
313  List<String> h = reader.getHistory().getHistoryList();
314  for (String s : h) {
315  System.out.println(s);
316  }
317  continue;
318  }
319  if (line.startsWith("shellType")) {
320  try {
321  shellTypeStorage = line.split(" ")[1];
322  } catch (Exception e) {
323  shellTypeStorage = groovy;
324  }
325  continue;
326  }
327  try {
328  ret = ScriptingEngine.inlineScriptStringRun(line, null, shellTypeStorage);
329  if (ret != null) {
330  System.out.println(ret);
331  }
332  processReturnedObjectsStart(ret, null);
333  } catch (Error e) {
334  e.printStackTrace();
335  } catch (Exception e) {
336  e.printStackTrace();
337  }
338  }
339  } catch (Exception e) {
340  e.printStackTrace();
341  }
342 
343  }
344 
345  private static void finish(long startTime) {
346  System.out.println(
347  "Process took " + (((double) (System.currentTimeMillis() - startTime))) / 60000.0 + " minutes");
348  System.exit(0);
349  }
350 
351  private static void processReturnedObjectsStart(Object ret, File baseWorkspaceFile) {
352  if(baseWorkspaceFile!=null)
353  System.out.println("Processing file in directory "+baseWorkspaceFile.getAbsolutePath());
355  @Override
356  public void progressUpdate(int currentIndex, int finalIndex, String type,
357  eu.mihosoft.vrl.v3d.CSG intermediateShape) {
358 
359  }
360 
361  });
362  if (baseWorkspaceFile != null) {
363  File baseDirForFiles = new File("./manufacturing/");
364  if (baseDirForFiles.exists()) {
365  // baseDirForFiles.mkdir();
366  File bomCSV = new File(
367  baseWorkspaceFile.getAbsolutePath() + "/" + VitaminBomManager.MANUFACTURING_BOM_CSV);
368  if (bomCSV.exists()) {
369 
370  File file = new File(baseDirForFiles.getAbsolutePath() + "/bom.csv");
371  if (file.exists())
372  file.delete();
373  try {
374  Files.copy(bomCSV.toPath(), file.toPath());
375  } catch (IOException e) {
376  // TODO Auto-generated catch block
377  e.printStackTrace();
378  }
379  }
380  File bom = new File(
381  baseWorkspaceFile.getAbsolutePath() + "/" + VitaminBomManager.MANUFACTURING_BOM_JSON);
382  if (bom.exists()) {
383  File file = new File(baseDirForFiles.getAbsolutePath() + "/bom.json");
384  if (file.exists())
385  file.delete();
386  try {
387  Files.copy(bom.toPath(), file.toPath());
388  } catch (IOException e) {
389  // TODO Auto-generated catch block
390  e.printStackTrace();
391  }
392  }
393  }
394  }
395  ArrayList<CSG> csgBits = new ArrayList<>();
396  try {
397  processReturnedObjects(ret, csgBits);
398  String url = ScriptingEngine.locateGitUrl(baseWorkspaceFile);
399  System.out.println("Loading printbed URL "+url);
400  PrintBedManager printBedManager = new PrintBedManager(baseWorkspaceFile, csgBits);
401  if(printBedManager.hasPrintBed())
402  csgBits = printBedManager.makePrintBeds();
403  else {
404  System.out.println("Exporting files without print bed");
405  }
406  new CadFileExporter().generateManufacturingParts(csgBits, new File("."));
407  } catch (Throwable t) {
408  t.printStackTrace();
409  fail();
410  }
411 
412  }
413 
414  private static void processReturnedObjects(Object ret, ArrayList<CSG> csgBits) {
415  if (List.class.isInstance(ret)) {
416  List lst = (List) ret;
417  for (int i = 0; i < lst.size(); i++)
418  processReturnedObjects(lst.get(i), csgBits);
419  return;
420  }
421  if (CSG.class.isInstance(ret)) {
422  csgBits.add((CSG) ret);
423  }
424  if (MobileBase.class.isInstance(ret)) {
425  MobileBase ret2 = (MobileBase) ret;
427  m.setUi(new IMobileBaseUI() {
428 
429  @Override
430  public void setSelectedCsg(Collection<CSG> selectedCsg) {
431  // TODO Auto-generated method stub
432 
433  }
434 
435  @Override
436  public void setSelected(Affine rootListener) {
437  // TODO Auto-generated method stub
438 
439  }
440 
441  @Override
442  public void setAllCSG(Collection<CSG> toAdd, File source) {
443  // TODO Auto-generated method stub
444 
445  }
446 
447  @Override
448  public void highlightException(File fileEngineRunByName, Throwable ex) {
449  ex.printStackTrace();
450  fail();
451  }
452 
453  @Override
454  public Set<CSG> getVisibleCSGs() {
455  // TODO Auto-generated method stub
456  return null;
457  }
458 
459  @Override
460  public void addCSG(Collection<CSG> toAdd, File source) {
461  // TODO Auto-generated method stub
462 
463  }
464  });
466  ret2.connect();
467  m.generateBody();
468  try {
469 
470  MobileBase base = (MobileBase) ret2;
471  File baseDir = new File("./manufacturing/");
472  File dir = new File(baseDir.getAbsolutePath() + "/" + base.getScriptingName());
473  if (!dir.exists())
474  dir.mkdirs();
475  IgenerateBed bed = null;
476  try {
477  bed = m.getIgenerateBed();
478  } catch (Throwable T) {
479  throw new RuntimeException(T.getMessage());
480  }
482  if (bed == null) {
483  m._generateStls(base, dir, false);
484  return;
485  }
486  System.out.println("Found arrangeBed API in CAD engine");
487  List<CSG> totalAssembly = bed.arrangeBed(base);
488  base.disconnect();
489  Thread.sleep(1000);
490  System.gc();
491  // Get current size of heap in bytes
492  long heapSize = Runtime.getRuntime().totalMemory();
493 
494  // Get maximum size of heap in bytes. The heap cannot grow beyond this size.//
495  // Any attempt will result in an OutOfMemoryException.
496  long heapMaxSize = Runtime.getRuntime().maxMemory();
497  // System.out.println("Heap remaining
498  // "+(heapMaxSize-Runtime.getRuntime().totalMemory()));
499  // System.out.println("Of Heap "+(heapMaxSize));
500  for (int i = 0; i < totalAssembly.size(); i++) {
501  List<CSG> tmp = Arrays.asList(totalAssembly.get(i));
502  totalAssembly.set(i, null);
503  // System.out.println("Before Heap remaining
504  // "+(heapMaxSize-Runtime.getRuntime().totalMemory()));
505 
507  tmp = null;
508  System.gc();
509  // System.out.println("After Heap remaining
510  // "+(heapMaxSize-Runtime.getRuntime().totalMemory()));
511 
512  }
513  } catch (Exception e) {
514  // TODO Auto-generated catch block
515  e.printStackTrace();
516  fail();
517  }
518  }
519  }
520 
521  public static ArrayList<String> loadHistory() throws IOException {
522  ArrayList<String> history = new ArrayList<>();
523  // Construct BufferedReader from FileReader
524  BufferedReader br = new BufferedReader(new FileReader(historyFile));
525 
526  String line = null;
527  while ((line = br.readLine()) != null) {
528  history.add(line);
529  }
530  br.close();
531  return history;
532  }
533 
534  public static void writeHistory(List<String> history) {
535  System.out.println("Saving history");
536  FileOutputStream fos;
537  try {
538  fos = new FileOutputStream(historyFile);
539  BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));
540  for (String s : history) {
541  bw.write(s);
542  bw.newLine();
543  }
544 
545  bw.close();
546  } catch (FileNotFoundException e) {
547  // TODO Auto-generated catch block
548  e.printStackTrace();
549  } catch (IOException e) {
550  // TODO Auto-generated catch block
551  e.printStackTrace();
552  }
553 
554  }
555 
556  public static int speak(String msg, ISpeakingProgress progress) {
557  return speak(msg, 200, 0, 100, 1.0, 1.0, progress);
558  }
559 
560  public static int speak(String msg) {
561 
562  return speak(msg, 200, 0, 301, 1.0, 1.0, null);
563  }
564 
565  @SuppressWarnings("unused")
566  public static int speak(String msg, Number rate, Number pitch, Number voice, Number shift, Number volume) {
567  return speak(msg, rate, pitch, voice, shift, volume, null);
568  }
569 
570  @SuppressWarnings("unused")
571  public static int speak(String msg, Number rate, Number pitch, Number voiceNumber, Number shift, Number volume,
572  ISpeakingProgress progress) {
573  if (rate.doubleValue() > 300)
574  rate = 300;
575  if (rate.doubleValue() < 10)
576  rate = 10;
577  try {
578  if (voiceNumber.doubleValue() >= 800) {
579  if (0 == CoquiDockerManager.get(voiceNumber.doubleValue()).speak(msg, 2.0f, false, true, progress)) {
580  return 0;
581  }
582  }
583  } catch (Throwable t) {
584  t.printStackTrace();
585  }
586  TextToSpeech tts = new TextToSpeech();
587  // cd ..
588  tts.getAvailableVoices().stream().forEach(voice -> System.out.println("Voice: " + voice));
589  // Setting the Current Voice
590  // voice =(tts.getAvailableVoices().toArray()[0].toString());
591  String voice = "dfki-poppy-hsmm";
592  if (voiceNumber.doubleValue() > 600)
593  voice = ("dfki-prudence-hsmm");
594  else if (voiceNumber.doubleValue() > 500)
595  voice = ("cmu-rms-hsmm");
596  else if (voiceNumber.doubleValue() > 400)
597  voice = ("cmu-bdl-hsmm");
598  else if (voiceNumber.doubleValue() > 300)
599  voice = ("dfki-obadiah-hsmm");
600  else if (voiceNumber.doubleValue() > 200)
601  voice = ("cmu-slt-hsmm");
602  else if (voiceNumber.doubleValue() > 100)
603  voice = ("dfki-spike-hsmm");
604 
605  tts.setVoice(voice);
606 
607  System.out.println("Using voice " + voice);
608 
609  RobotiserEffect vocalTractLSE = new RobotiserEffect(); // russian drunk effect
610  vocalTractLSE.setParams("amount:" + pitch.intValue());
611 
612  // TTS say something that we actually are typing into the first variable
613 // tts.getAudioEffects().stream().forEach(audioEffect -> {
614 // if(audioEffect.getName().contains("Rate")) {
615 // System.out.println("-----Name-----");
616 // System.out.println(audioEffect.getName());
617 // System.out.println("-----Examples-----");
618 // System.out.println(audioEffect.getExampleParameters());
619 // System.out.println("-----Help Text------");
620 // System.out.println(audioEffect.getHelpText() + "\n\n");
621 // }
622 // });
623  String effect = "";
624  if (volume.doubleValue() < 0.5) {
625 
626  LpcWhisperiserEffect lpcWhisperiserEffect = new LpcWhisperiserEffect(); // creepy
627  lpcWhisperiserEffect.setParams("amount:" + (50 + (50 * volume.doubleValue())));
628  effect += "+" + lpcWhisperiserEffect.getFullEffectAsString();
629  volume = 1;
630  }
631  if (shift.doubleValue() < 1) {
632  ChorusEffectBase ce = new ChorusEffectBase();
633  ce.setParams("delay1:" + (int) (366.0 * shift.doubleValue())
634  + ";amp1:0.54;delay2:600;amp2:-0.10;delay3:250;amp3:0.30");
635  effect += "+" + ce.getFullEffectAsString();
636  }
637  // Apply the effects
638  // ----You can add multiple effects by using the method
639  // `getFullEffectAsString()` and + symbol to connect with the other effect that
640  // you want
641  // ----check the example below
642  VolumeEffect volumeEffect = new VolumeEffect(); // be careful with this i almost got heart attack
643  volumeEffect.setParams("amount:" + volume);
644 
645  HMMDurationScaleEffect ratEff = new HMMDurationScaleEffect();
646  ratEff.setParams("durScale:" + rate.doubleValue() / 100.0);
647 
648  effect += "+" + ratEff.getFullEffectAsString();
649  effect += "+" + volumeEffect.getFullEffectAsString();
650  if (pitch.intValue() > 0)
651  effect += "+" + vocalTractLSE.getFullEffectAsString();
652  System.out.println(msg + "-->" + effect);
653  tts.getMarytts().setAudioEffects(effect);
654 
655  tts.speak(msg, 2.0f, false, true, progress);
656 
657  return 0;
658  }
659 
660  public static void upenURL(String string) {
661 
662  System.err.println("Opening " + string);
663  try {
664  upenURL(new URI(string));
665 
666  } catch (URISyntaxException e) {
667  // TODO Auto-generated catch block
668  e.printStackTrace();
669  } catch (Throwable e) {
670  // TODO Auto-generated catch block
671  e.printStackTrace();
672  }
673  }
674 
675  public static void upenURL(URI htmlUrl) {
676  if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE))
677  try {
678  Desktop.getDesktop().browse(htmlUrl);
679  } catch (IOException e) {
680  // TODO Auto-generated catch block
681  e.printStackTrace();
682  }
683  }
684 
685 }
static void processReturnedObjects(Object ret, ArrayList< CSG > csgBits)
static ArrayList< String > loadHistory()
static void processReturnedObjectsStart(Object ret, File baseWorkspaceFile)
static int speak(String msg, ISpeakingProgress progress)
static void writeHistory(List< String > history)
static CoquiDockerManager get(double doubleValue)
int speak(String text, float gainValue, boolean daemon, boolean join, ISpeakingProgress progress)
int speak(String text, float gainValue, boolean daemon, boolean join, ISpeakingProgress progress)
ArrayList< File > generateManufacturingParts(List< CSG > totalAssembly, File baseDirForFiles)
static MobileBaseCadManager get(MobileBase device, IMobileBaseUI ui)
ArrayList< File > _generateStls(MobileBase base, File baseDirForFiles, boolean kinematic)
IgenerateBed getPrintBed(File baseDirForFiles, IgenerateBed bed, File baseWorkspaceFile)
static ArrayList< String > filesInGit(String remote, String branch, String extnetion)
static Object gitScriptRun(String gitURL, String Filename)
static Object inlineFileScriptRun(File f, ArrayList< Object > args)
static Object inlineScriptStringRun(String line, ArrayList< Object > args, String shellTypeStorage)
static void pull(String remoteURI, String branch)
static void setProgressMoniter(ICSGProgress progressMoniter)
Definition: CSG.java:2355
ArrayList< CSG > arrangeBed(MobileBase base)