-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigurationScript.py
More file actions
144 lines (137 loc) · 4.18 KB
/
ConfigurationScript.py
File metadata and controls
144 lines (137 loc) · 4.18 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Import scripts from the template file
import sys, os
sys.path.append(os.path.dirname(__file__))
# Import all scripts and functions from the source file - GIVE YOUR OWN COMPUTER PATH
exec(open(r'c:\Users\umuta\Desktop\CaseStudy\VCSimulation\Simulation_Source_Script.py').read())
# SYSTEM CONFIGURATION
VISUAL_COMPONENTS_VERSIONS = ["4.10"]
VISUAL_COMPONENTS_PATH = "C:\\Users\\Public\\Documents\\Visual Components\\"
# COMPONENT CREATION CONFIGURATION
raw_components = r'''
[
{
"name": "Pathway Area",
"folder": "Navigation",
"properties": [
{
"name": "pathwayProperties",
"type": "string",
"default": ""}
],
"script": PathwayArea
},
{
"name": "Conveyor",
"folder": "Conveyors",
"layout_name": "_Template_OutputConveyor",
"properties": [
{
"name": "outputconveyorProperties",
"type": "string",
"default": ""}
],
"script": OutputConveyor
},
{
"name": "Block Geo",
"folder": "Basic Shapes",
"layout_name": "Component1"
},
{
"name": "Conveyor",
"folder": "Conveyors",
"layout_name": "_Template_InputConveyor",
"properties": [
{
"name": "inputconveyorQuantity",
"type": "number",
"default": 0},{
"name": "inputconveyorProperties",
"type": "string",
"default": ""}],
"numbered_properties": [
{
"name_template": "produced",
"type": "boolean",
"default": false},{
"name_template": "productType",
"type": "string",
"default": "Component"},{
"name_template": "clonetimeInterval",
"type": "number",
"default": 160},{
"name_template": "cloneCount",
"type": "number",
"default": 0},],
"property_sets": 2,
"script": InputConveyor
},
{
"name": "Idle Location",
"folder": "Navigation",
"layout_name": "_Template_IdleLocation",
"properties": [
{
"name": "idleProperties",
"type": "string",
"default": ""}
],
"script": IdleLocation
},
{
"name": "Mobile Robot Resource",
"folder": "Mobile Robots",
"layout_name": "_Template_Mobile_Robot_Resource",
"properties": [
{
"name": "robotQuantity",
"type": "number",
"default": 0}
,
{
"name": "initialPositions",
"type": "string",
"default": ""}
],
"numbered_properties": [
{
"name_template": "location",
"type": "string",
"default": "initial"}, {
"name_template": "nextLocation",
"type": "string",
"default": ""}, {
"name_template": "batteryLevel",
"type": "number",
"default": 100}, {
"name_template": "target",
"type": "string",
"default": ""}, {
"name_template": "stop",
"type": "boolean",
"default": false}, {
"name_template": "priority",
"type": "number",
"default": 1}, {
"name_template": "carryingProduct",
"type": "boolean",
"default": false}, {
"name_template": "carriedProduct",
"type": "string",
"default": ""}, {
"name_template": "maxSpeed",
"type": "number",
"default": 0}, ],
"property_sets": 4,
"script": Robot
}
]
'''
COMPONENTS_TO_CREATE = eval(
raw_components.replace("false", "False").replace("true", "True")
)
# Create components
app = getApplication()
for config in COMPONENTS_TO_CREATE:
create_component(app, config)
print("Done!")