-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZenCad.groovy
55 lines (46 loc) · 1.24 KB
/
ZenCad.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import com.neuronrobotics.bowlerstudio.BowlerStudioController
import com.neuronrobotics.bowlerstudio.BowlerStudioMenu
import com.neuronrobotics.bowlerstudio.vitamins.VitaminBomManager
import com.neuronrobotics.sdk.common.DeviceManager
import javafx.scene.control.Tab
import javafx.scene.image.ImageView
// code here
if (args==null)
args="https://github.com/OperationSmallKat/Marcos.git"
println "Starting ZenCad for "+args
String name = "BoM-"+BowlerStudioMenu.gitURLtoMessage(args)
VitaminBomManager bom=new VitaminBomManager(args);
class TabManagerDevice{
String myName;
boolean connected=false;
ImageView imageView = new ImageView();
Tab t = new Tab()
public TabManagerDevice(String name) {
myName=name;
}
String getName() {
return myName
}
boolean connect() {
connected=true;
t.setContent(imageView)
t.setText(myName)
t.setOnCloseRequest({event ->
disconnect()
});
BowlerStudioController.addObject(t, null)
return connected
}
void disconnect() {
if(connected) {
BowlerStudioController.removeObject(t)
}
}
}
def tabHolder = DeviceManager.getSpecificDevice(name, {
TabManagerDevice dev = new TabManagerDevice(name)
dev.connect()
return dev
})
BowlerStudioController.addObject(tabHolder.t, null)
return null;