Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 9f01c6f

Browse files
committed
Updating JSDOC, extending DataStore
1 parent 4a85e01 commit 9f01c6f

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

client/data/Hyperion.Data.DeviceModel.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,35 +232,44 @@ class DeviceModel {
232232
this._deviceModelId = deviceModelId;
233233
this._adapterId = adapterId;
234234

235-
/** @type {Object.<string, DeviceProperty>} */
235+
/** @type {Object.<string, DeviceProperty>}
236+
* The properties belonging to this DeviceModel.
237+
*/
236238
this._properties = {};
237239

238-
/** @type {Object.<string, Device>} */
240+
/** @type {Object.<string, Device>}
241+
* The list of devices belonging to this DeviceModel.
242+
*/
239243
this._devices = {};
240244
}
241245

242246
/**
247+
* The name of this device model, if any.
243248
* @param {string} value The name of this device model, if any.
244249
*/
245250
set name(value) {
246251
this._name = value;
247252
}
248253

249254
/**
255+
* The description of this device model, if any.
250256
* @param {string} value The description of this device model, if any.
251257
*/
252258
set description(value) {
253259
this._description = value;
254260
}
255261

256262
/**
263+
* The identifier of this instance of DeviceModel object.
257264
* @returns {string} The identifier of this instance of DeviceModel object.
258265
*/
259266
get id() {
260267
return this._deviceModelId;
261268
}
262269

263270
/**
271+
* The identifier of the DataAdapter that this instance
272+
* &nbsp;of DeviceModel object originated from.
264273
* @returns {string} The identifier of the DataAdapter that this instance
265274
* of DeviceModel object originated from.
266275
*/
@@ -269,41 +278,47 @@ class DeviceModel {
269278
}
270279

271280
/**
281+
* The name of this device model, if any.
272282
* @returns {string} The name of this device model, if any.
273283
*/
274284
get name() {
275285
return this._name;
276286
}
277287

278288
/**
289+
* The description of this device model, if any.
279290
* @returns {string} The description of this device model, if any.
280291
*/
281292
get description() {
282293
return this._description;
283294
}
284295

285296
/**
297+
* All property identifiers for this DeviceModel.
286298
* @returns {string[]} All property identifiers for this DeviceModel.
287299
*/
288300
get propertyIds() {
289301
return Object.keys(this._properties);
290302
}
291303

292304
/**
305+
* The properties belonging to this DeviceModel.
293306
* @returns {DeviceProperty[]} The properties belonging to this DeviceModel.
294307
*/
295308
get properties() {
296309
return Object.values(this._properties);
297310
}
298311

299312
/**
313+
* All device identifiers found within this DeviceModel.
300314
* @returns {string[]} All device identifiers found within this DeviceModel.
301315
*/
302316
get deviceIds() {
303317
return Object.keys(this._devices);
304318
}
305319

306320
/**
321+
* The list of devices belonging to this DeviceModel.
307322
* @returns {Device[]} The list of devices belonging to this DeviceModel.
308323
*/
309324
get devices() {

client/data/Hyperion.Data.Storage.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ class DataStore extends EventSource {
312312
});
313313
}
314314

315+
addDeviceModel(deviceMode) {
316+
this._deviceModels[deviceMode.id] = deviceMode;
317+
}
318+
315319
/**
316320
* Creates an instance of DataView object for this DataStore.
317321
*
@@ -511,5 +515,10 @@ class DataStore extends EventSource {
511515
let filteredMap = new Map(nestedList.map(obj => [`${obj.id}`, obj]));
512516
return filteredMap;
513517
}
518+
519+
520+
get adapters() {
521+
return this._dataAdapters;
522+
}
514523
}
515524
export { DataStore };

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "forge-dataviz-iot-data-modules",
3-
"version": "0.1.6",
3+
"version": "0.1.8",
44
"description": "IoT data modules used by https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app",
55
"author": "Autodesk Inc",
66
"license": "Apache-2.0",

server/gateways/Hyperion.Server.SyntheticGateway.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function weekNum(time) {
3535
class Synthetic {
3636
/**
3737
*
38-
* @param {string} configFile File path to config file defining the data stops and range values used to generate synthetic data. For an example, refer to https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app/blob/main/server/gateways/synthetic-data/config.js
38+
* @param {string} configFile File path to config file defining the data stops and range values used to generate synthetic data. For an example, refer to https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app/blob/main/server/gateways/synthetic-data/config.json
3939
*/
4040
constructor(configFile) {
4141
this.configFile = configFile;
@@ -118,7 +118,7 @@ class SyntheticGateway extends DataGateway {
118118
*
119119
* @param {string} deviceModelFile File path to JSON file containing device model information. For an example, refer to https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app/blob/main/server/gateways/synthetic-data/device-models.json
120120
* @param {string} deviceFile File path to JSON file containing device information. For an example, refer to https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app/blob/main/server/gateways/synthetic-data/devices.json
121-
* @param {string} configFile File path to config file defining the data stops and range values used to generate synthetic data. For an example, refer to https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app/blob/main/server/gateways/synthetic-data/config.js
121+
* @param {string} configFile File path to config file defining the data stops and range values used to generate synthetic data. For an example, refer to https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app/blob/main/server/gateways/synthetic-data/config.json
122122
*/
123123
constructor(deviceModelFile, deviceFile, configFile) {
124124
super("SyntheticGateway");

0 commit comments

Comments
 (0)