Commit bae1011
authored
Change ids when copying a module (#201)
* Add methodId to extra state of mrc_class_method_def block.
* Add componentId to extra state of mrc_component block.
* Add eventId to extra state of mrc_event block.
Fixed indentation in onBlockChanged and getEvent methods.
* Add mechanismId to extra state of mrc_mechanism block.
* Rename blockId to methodId in Method.
Rename blockId to mechanismId in MechanismInRobot.
Rename blockId to componentId in Component.
Rename blockId to eventId in Event.
In parseModuleContentText rename blockId fields when parsing old text.
Add changeIds to change the ids stored in mechanisms, components, events, and methods of ModuleContent. Update blocks by calling mrcChangeIds on blocks that implement it.
* In mrc_call_python_function.ts:
Update comments that describe otherBlockId.
Change component.blockId to component.componentId.
Change robotMethod.blockId to robotMethod.methodId.
Change mechanismMethod.blockId to mechanismMethod.methodId.
Change mechanismInRobot.blockId to mechanismInRobot.mechanismId.
Change method.blockId to method.methodId.
Change event.blockId to event.eventId.
Change renameMethodCaller function parameter blockId to id.
Change getMethodCallers function parameter otherBlockId to id.
Change renameMethodCallers function parameter blockId to id.
Change mutateMethodCallers function parameter blockId to id.
Add mrcChangeIds to change mrcBlockId and mrcMechanismBlockId.
* In project.ts renameOrCopyModule function to change the ids in the copy.
* In mrc_event_handler.ts:
Update comments that describe otherBlockId.
Change robotEvent.blockId to robotEvent.eventId.
Change event.blockId to event.eventId.
Add mrcChangeIds to change mrcBlockId and mrcMechanismBlockId.
* Fixed errors.
* Updated mrc_event_handler.ts:
In EventHandlerMixin: Changed mrcOtherBlockId to mrcEventId and mrcMechanismBlockId to mrcMechanismId.
In EventHandlerExtraState: Changed otherBlockId to eventId and mechanismBlockId to mechanismId.
Updated mrc_call_python_function.ts:
In CallPythonFunctionMixin: Changed mrcOtherBlockId to multiple fields mrcMethodId, mrcComponentId, and mrcEventId. Changed mrcMechanismBlockId to mrcMechanismId.
In CallPythonFunctionExtraState: Changed otherBlockId to multiple fields methodId, componentId, and eventId. Changed mechanismBlockId to mechanismId.
* Removed ids from modules starter blocks.
* Added comment about handling when a mechansim, component, or event is removed from the holder.
* Moved code that register a custom toolbox categories into the function that returns the category.
Pass the editor to getToolboxJSON and other toolbox functions that need the editor or the blockly workspace or the current module type.
* Fixed ModuleContent.changeIds.1 parent a23ce38 commit bae1011
File tree
19 files changed
+680
-504
lines changed- src
- blocks
- editor
- modules
- storage
- toolbox
19 files changed
+680
-504
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| 117 | + | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
| |||
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
| |||
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
199 | | - | |
| 206 | + | |
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
| |||
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
266 | | - | |
| 273 | + | |
267 | 274 | | |
268 | 275 | | |
269 | 276 | | |
270 | 277 | | |
271 | 278 | | |
272 | | - | |
| 279 | + | |
273 | 280 | | |
274 | 281 | | |
275 | 282 | | |
| |||
307 | 314 | | |
308 | 315 | | |
309 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
310 | 325 | | |
311 | 326 | | |
312 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
149 | | - | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | | - | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
175 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
176 | 188 | | |
177 | 189 | | |
178 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
57 | | - | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
70 | | - | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | | - | |
87 | | - | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
103 | | - | |
104 | | - | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
189 | 193 | | |
190 | 194 | | |
191 | 195 | | |
192 | | - | |
| 196 | + | |
193 | 197 | | |
194 | 198 | | |
195 | 199 | | |
196 | 200 | | |
197 | | - | |
| 201 | + | |
198 | 202 | | |
199 | | - | |
200 | | - | |
| 203 | + | |
| 204 | + | |
201 | 205 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
211 | 210 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
225 | | - | |
226 | | - | |
227 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
228 | 240 | | |
229 | 241 | | |
230 | 242 | | |
| |||
0 commit comments