Skip to content

Commit 576bc74

Browse files
authored
some samples
1 parent fd8276a commit 576bc74

5 files changed

Lines changed: 487 additions & 0 deletions

File tree

models/robot.json

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
{
2+
"@id": "dtmi:com:example:Robot;1",
3+
"@type": "Interface",
4+
"@context": "dtmi:dtdl:context;2",
5+
"displayName": "Robot",
6+
"contents": [
7+
{
8+
"@type": "Property",
9+
"name": "robotId",
10+
"schema": "string",
11+
"description": "The unique identifier for the robot"
12+
},
13+
{
14+
"@type": "Property",
15+
"name": "model",
16+
"schema": "string",
17+
"description": "The model of the robot"
18+
},
19+
{
20+
"@type": "Property",
21+
"name": "manufacturer",
22+
"schema": "string",
23+
"description": "The manufacturer of the robot"
24+
},
25+
{
26+
"@type": "Property",
27+
"name": "batteryLevel",
28+
"schema": "double",
29+
"description": "The current battery level of the robot as a percentage"
30+
},
31+
{
32+
"@type": "Property",
33+
"name": "status",
34+
"schema": {
35+
"@type": "Enum",
36+
"valueSchema": "string",
37+
"enumValues": [
38+
{
39+
"name": "idle",
40+
"displayName": "Idle",
41+
"enumValue": "idle"
42+
},
43+
{
44+
"name": "moving",
45+
"displayName": "Moving",
46+
"enumValue": "moving"
47+
},
48+
{
49+
"name": "picking",
50+
"displayName": "Picking",
51+
"enumValue": "picking"
52+
},
53+
{
54+
"name": "charging",
55+
"displayName": "Charging",
56+
"enumValue": "charging"
57+
},
58+
{
59+
"name": "maintenance",
60+
"displayName": "Maintenance",
61+
"enumValue": "maintenance"
62+
}
63+
]
64+
},
65+
"description": "The current status of the robot"
66+
},
67+
{
68+
"@type": "Property",
69+
"name": "currentZone",
70+
"schema": "string",
71+
"description": "The ID of the zone where the robot is currently located"
72+
},
73+
{
74+
"@type": "Telemetry",
75+
"name": "position",
76+
"schema": {
77+
"@type": "Object",
78+
"fields": [
79+
{
80+
"name": "x",
81+
"schema": "double"
82+
},
83+
{
84+
"name": "y",
85+
"schema": "double"
86+
},
87+
{
88+
"name": "z",
89+
"schema": "double"
90+
}
91+
]
92+
},
93+
"description": "The current position of the robot in 3D space"
94+
},
95+
{
96+
"@type": "Telemetry",
97+
"name": "speed",
98+
"schema": "double",
99+
"description": "The current speed of the robot in meters per second"
100+
},
101+
{
102+
"@type": "Command",
103+
"name": "move",
104+
"request": {
105+
"name": "destination",
106+
"schema": {
107+
"@type": "Object",
108+
"fields": [
109+
{
110+
"name": "x",
111+
"schema": "double"
112+
},
113+
{
114+
"name": "y",
115+
"schema": "double"
116+
},
117+
{
118+
"name": "z",
119+
"schema": "double"
120+
}
121+
]
122+
}
123+
},
124+
"response": {
125+
"name": "response",
126+
"schema": {
127+
"@type": "Object",
128+
"fields": [
129+
{
130+
"name": "success",
131+
"schema": "boolean"
132+
},
133+
{
134+
"name": "message",
135+
"schema": "string"
136+
}
137+
]
138+
}
139+
},
140+
"description": "Command to move the robot to a specific position"
141+
},
142+
{
143+
"@type": "Command",
144+
"name": "pickItem",
145+
"request": {
146+
"name": "itemId",
147+
"schema": "string"
148+
},
149+
"response": {
150+
"name": "response",
151+
"schema": {
152+
"@type": "Object",
153+
"fields": [
154+
{
155+
"name": "success",
156+
"schema": "boolean"
157+
},
158+
{
159+
"name": "message",
160+
"schema": "string"
161+
}
162+
]
163+
}
164+
},
165+
"description": "Command to pick an item"
166+
}
167+
]
168+
}

models/sensor.json

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"@id": "dtmi:com:example:Sensor;1",
3+
"@type": "Interface",
4+
"@context": "dtmi:dtdl:context;2",
5+
"displayName": "Sensor",
6+
"contents": [
7+
{
8+
"@type": "Property",
9+
"name": "sensorId",
10+
"schema": "string",
11+
"description": "The unique identifier for the sensor"
12+
},
13+
{
14+
"@type": "Property",
15+
"name": "manufacturer",
16+
"schema": "string",
17+
"description": "The manufacturer of the sensor"
18+
},
19+
{
20+
"@type": "Property",
21+
"name": "modelNumber",
22+
"schema": "string",
23+
"description": "The model number of the sensor"
24+
},
25+
{
26+
"@type": "Property",
27+
"name": "sensorType",
28+
"schema": {
29+
"@type": "Enum",
30+
"valueSchema": "string",
31+
"enumValues": [
32+
{
33+
"name": "temperature",
34+
"displayName": "Temperature",
35+
"enumValue": "temperature"
36+
},
37+
{
38+
"name": "humidity",
39+
"displayName": "Humidity",
40+
"enumValue": "humidity"
41+
},
42+
{
43+
"name": "motion",
44+
"displayName": "Motion",
45+
"enumValue": "motion"
46+
},
47+
{
48+
"name": "weight",
49+
"displayName": "Weight",
50+
"enumValue": "weight"
51+
}
52+
]
53+
},
54+
"description": "The type of the sensor"
55+
},
56+
{
57+
"@type": "Property",
58+
"name": "batteryLevel",
59+
"schema": "double",
60+
"description": "The current battery level of the sensor as a percentage"
61+
},
62+
{
63+
"@type": "Property",
64+
"name": "status",
65+
"schema": {
66+
"@type": "Enum",
67+
"valueSchema": "string",
68+
"enumValues": [
69+
{
70+
"name": "online",
71+
"displayName": "Online",
72+
"enumValue": "online"
73+
},
74+
{
75+
"name": "offline",
76+
"displayName": "Offline",
77+
"enumValue": "offline"
78+
},
79+
{
80+
"name": "maintenance",
81+
"displayName": "Maintenance",
82+
"enumValue": "maintenance"
83+
}
84+
]
85+
},
86+
"description": "The current status of the sensor"
87+
},
88+
{
89+
"@type": "Telemetry",
90+
"name": "reading",
91+
"schema": "double",
92+
"description": "The current reading from the sensor"
93+
},
94+
{
95+
"@type": "Telemetry",
96+
"name": "lastCommunication",
97+
"schema": "dateTime",
98+
"description": "Timestamp of the last communication from the sensor"
99+
}
100+
]
101+
}

models/shelf.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"@id": "dtmi:com:example:Shelf;1",
3+
"@type": "Interface",
4+
"@context": "dtmi:dtdl:context;2",
5+
"displayName": "Shelf",
6+
"contents": [
7+
{
8+
"@type": "Property",
9+
"name": "shelfId",
10+
"schema": "string",
11+
"description": "The unique identifier for the shelf"
12+
},
13+
{
14+
"@type": "Property",
15+
"name": "capacity",
16+
"schema": "integer",
17+
"description": "The maximum capacity of the shelf in number of items"
18+
},
19+
{
20+
"@type": "Property",
21+
"name": "itemCount",
22+
"schema": "integer",
23+
"description": "The current number of items on the shelf"
24+
},
25+
{
26+
"@type": "Property",
27+
"name": "shelfType",
28+
"schema": {
29+
"@type": "Enum",
30+
"valueSchema": "string",
31+
"enumValues": [
32+
{
33+
"name": "standard",
34+
"displayName": "Standard",
35+
"enumValue": "standard"
36+
},
37+
{
38+
"name": "heavyDuty",
39+
"displayName": "Heavy Duty",
40+
"enumValue": "heavyDuty"
41+
},
42+
{
43+
"name": "refrigerated",
44+
"displayName": "Refrigerated",
45+
"enumValue": "refrigerated"
46+
}
47+
]
48+
},
49+
"description": "The type of the shelf"
50+
},
51+
{
52+
"@type": "Relationship",
53+
"name": "hasSensor",
54+
"target": "dtmi:com:example:Sensor;1",
55+
"properties": [
56+
{
57+
"@type": "Property",
58+
"name": "sensorId",
59+
"schema": "string"
60+
}
61+
],
62+
"description": "Relationship to sensors monitoring the shelf"
63+
},
64+
{
65+
"@type": "Telemetry",
66+
"name": "loadPercentage",
67+
"schema": "double",
68+
"description": "The current load of the shelf as a percentage of its capacity"
69+
}
70+
]
71+
}

0 commit comments

Comments
 (0)