Skip to content

Commit 7074b79

Browse files
committed
change orders and names of samples
1 parent e739152 commit 7074b79

File tree

3 files changed

+54
-51
lines changed

3 files changed

+54
-51
lines changed

src/toolbox/hardware_category.ts

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ const category_robot =
1111
kind: 'block',
1212
type: 'mrc_mechanism',
1313
fields: {
14-
NAME: 'my_drive',
15-
TYPE: 'DriveMecanum'
14+
NAME: 'claw',
15+
TYPE: 'Claw'
1616
},
1717
extraState: {
18-
importModule: 'DriveMecanum',
19-
params: [{ name: 'front_left_drive', type: 'int' },
20-
{ name: 'front_right_drive', type: 'int' },
21-
{ name: 'back_left_drive', type: 'int' },
22-
{ name: 'back_right_drive', type: 'int' },
18+
importModule: 'claw',
19+
params: [{ name: 'gripper_port', type: 'int' },
20+
{ name: 'piece_sensor_port', type: 'int' },
2321
]
2422
},
2523
inputs: {
@@ -36,26 +34,8 @@ const category_robot =
3634
shadow: {
3735
type: 'mrc_port',
3836
fields: {
39-
TYPE: 'SmartMotor',
40-
PORT_NUM: 2
41-
},
42-
},
43-
},
44-
ARG2: {
45-
shadow: {
46-
type: 'mrc_port',
47-
fields: {
48-
TYPE: 'SmartMotor',
49-
PORT_NUM: 3
50-
},
51-
},
52-
},
53-
ARG3: {
54-
shadow: {
55-
type: 'mrc_port',
56-
fields: {
57-
TYPE: 'SmartMotor',
58-
PORT_NUM: 4
37+
TYPE: 'SmartIO',
38+
PORT_NUM: 1
5939
},
6040
},
6141
},
@@ -65,13 +45,15 @@ const category_robot =
6545
kind: 'block',
6646
type: 'mrc_mechanism',
6747
fields: {
68-
NAME: 'my_claw',
69-
TYPE: 'Claw'
48+
NAME: 'drive',
49+
TYPE: 'DriveMecanum'
7050
},
7151
extraState: {
72-
importModule: 'claw',
73-
params: [{ name: 'port_gripper', type: 'int' },
74-
{ name: 'port_piece_sensor', type: 'int' },
52+
importModule: 'DriveMecanum',
53+
params: [{ name: 'front_left_drive_port', type: 'int' },
54+
{ name: 'front_right_drive_port', type: 'int' },
55+
{ name: 'back_left_drive_port', type: 'int' },
56+
{ name: 'back_right_drive_port', type: 'int' },
7557
]
7658
},
7759
inputs: {
@@ -88,8 +70,26 @@ const category_robot =
8870
shadow: {
8971
type: 'mrc_port',
9072
fields: {
91-
TYPE: 'SmartIO',
92-
PORT_NUM: 1
73+
TYPE: 'SmartMotor',
74+
PORT_NUM: 2
75+
},
76+
},
77+
},
78+
ARG2: {
79+
shadow: {
80+
type: 'mrc_port',
81+
fields: {
82+
TYPE: 'SmartMotor',
83+
PORT_NUM: 3
84+
},
85+
},
86+
},
87+
ARG3: {
88+
shadow: {
89+
type: 'mrc_port',
90+
fields: {
91+
TYPE: 'SmartMotor',
92+
PORT_NUM: 4
9393
},
9494
},
9595
},
@@ -108,7 +108,7 @@ const category_robot =
108108
},
109109
extraState: {
110110
importModule: 'smart_motor',
111-
params: [{ name: 'motorPort', type: 'int' }]
111+
params: [{ name: 'motor_port', type: 'int' }]
112112
},
113113
inputs: {
114114
ARG0: {
@@ -131,7 +131,7 @@ const category_robot =
131131
},
132132
extraState: {
133133
importModule: 'color_range_sensor',
134-
params: [{ name: 'I2CPort', type: 'int' }]
134+
params: [{ name: 'i2c_port', type: 'int' }]
135135
},
136136
inputs: {
137137
ARG0: {
@@ -154,7 +154,7 @@ const category_robot =
154154
},
155155
extraState: {
156156
importModule: 'rev_touch_sensor',
157-
params: [{ name: 'SmartIOPort', type: 'int' }]
157+
params: [{ name: 'smartIO_port', type: 'int' }]
158158
},
159159
inputs: {
160160
ARG0: {
@@ -189,7 +189,7 @@ const category_mechanism =
189189
},
190190
extraState: {
191191
importModule: 'smart_motor',
192-
params: [{ name: 'motorPort', type: 'int' }],
192+
params: [{ name: 'motor_port', type: 'int' }],
193193
hideParams: true
194194
},
195195
},
@@ -202,7 +202,7 @@ const category_mechanism =
202202
},
203203
extraState: {
204204
importModule: 'color_range_sensor',
205-
params: [{ name: 'I2CPort', type: 'int' }],
205+
params: [{ name: 'i2c_port', type: 'int' }],
206206
hideParams: true
207207
},
208208
},
@@ -215,7 +215,7 @@ const category_mechanism =
215215
},
216216
extraState: {
217217
importModule: 'rev_touch_sensor',
218-
params: [{ name: 'SmartIOPort', type: 'int' }],
218+
params: [{ name: 'smartIO_port', type: 'int' }],
219219
hideParams: true
220220
},
221221
},

src/toolbox/robot_category.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const category =
55
contents: [
66
{
77
kind: 'category',
8-
name: 'my_drive',
8+
name: 'drive',
99
contents: [
1010
{
1111
kind: 'block',
@@ -30,10 +30,10 @@ export const category =
3030
tooltip: 'Drive (robot relative)',
3131
importModule: '',
3232
componentClassName: 'rev.ColorRangeSensor',
33-
componentName: 'robot.my_drive',
33+
componentName: 'robot.drive',
3434
},
3535
fields: {
36-
COMPONENT_NAME: 'robot.my_drive',
36+
COMPONENT_NAME: 'robot.drive',
3737
FUNC: 'drive_field_relative',
3838
},
3939
inputs: {},
@@ -42,7 +42,7 @@ export const category =
4242
},
4343
{
4444
kind: 'category',
45-
name: 'my_claw',
45+
name: 'claw',
4646
contents: [
4747
{
4848
kind: 'category',
@@ -69,7 +69,7 @@ export const category =
6969
componentName: 'colorSensor',
7070
},
7171
fields: {
72-
COMPONENT_NAME: 'robot.my_claw.piece_sensor',
72+
COMPONENT_NAME: 'robot.claw.piece_sensor',
7373
FUNC: 'get_color_rgb',
7474
},
7575
inputs: {},
@@ -88,7 +88,7 @@ export const category =
8888
componentName: 'colorSensor',
8989
},
9090
fields: {
91-
COMPONENT_NAME: 'robot.my_claw.piece_sensor',
91+
COMPONENT_NAME: 'robot.claw.piece_sensor',
9292
FUNC: 'get_color_hsv',
9393
},
9494
inputs: {},
@@ -107,7 +107,7 @@ export const category =
107107
componentName: 'colorSensor',
108108
},
109109
fields: {
110-
COMPONENT_NAME: 'robot.my_claw.piece_sensor',
110+
COMPONENT_NAME: 'robot.claw.piece_sensor',
111111
FUNC: 'get_distance_mm',
112112
},
113113
inputs: {},

src/toolbox/toolbox.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ export function getToolboxJSON(
6262
{
6363
kind: 'sep',
6464
},
65-
miscCategory,
65+
robotCategory,
66+
{
67+
kind: 'sep',
68+
},
6669
logicCategory,
6770
loopCategory,
6871
mathCategory,
6972
textCategory,
7073
listsCategory,
74+
miscCategory,
7175
{
7276
kind: 'sep',
7377
},
@@ -78,9 +82,8 @@ export function getToolboxJSON(
7882
custom: 'VARIABLE',
7983
},
8084
methodsCategory,
81-
mechanismCategory,
82-
robotCategory,
83-
componentSampleCategory,
85+
//mechanismCategory,
86+
//componentSampleCategory,
8487
]);
8588

8689
return {

0 commit comments

Comments
 (0)