node-opcua-modeler 2.97.0 → 2.98.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addExtensionObjectDataType.d.ts +21 -21
- package/dist/addExtensionObjectDataType.js +132 -132
- package/dist/build_model_inner.d.ts +17 -17
- package/dist/build_model_inner.js +42 -42
- package/dist/displayNodeElement.d.ts +6 -6
- package/dist/displayNodeElement.js +220 -220
- package/dist/generate_markdown_doc.d.ts +41 -41
- package/dist/generate_markdown_doc.js +314 -314
- package/dist/index.d.ts +24 -24
- package/dist/index.js +52 -52
- package/dist/promoteToMandatory.d.ts +8 -8
- package/dist/promoteToMandatory.js +89 -89
- package/dist/setNamespaceMetaData.d.ts +1 -1
- package/dist/setNamespaceMetaData.js +5 -5
- package/dist/symbol.d.ts +1 -1
- package/dist/symbol.js +2 -2
- package/dist/tableHelper.d.ts +9 -9
- package/dist/tableHelper.js +60 -60
- package/dist/to_cvs.d.ts +2 -2
- package/dist/to_cvs.js +11 -11
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -2
- package/distNodeJS/build_documentation_to_file.d.ts +3 -3
- package/distNodeJS/build_documentation_to_file.js +26 -26
- package/distNodeJS/build_model.d.ts +7 -7
- package/distNodeJS/build_model.js +21 -21
- package/distNodeJS/index.d.ts +5 -5
- package/distNodeJS/index.js +23 -23
- package/distNodeJS/symbol_cvs.d.ts +3 -3
- package/distNodeJS/symbol_cvs.js +63 -63
- package/package.json +28 -21
- package/MyModelIds.csv +0 -151
- package/examples/make_model.ts +0 -153
- package/source_nodejs/build_documentation_to_file.ts +0 -13
- package/source_nodejs/build_model.ts +0 -12
- package/source_nodejs/index.ts +0 -5
- package/source_nodejs/symbol_cvs.ts +0 -50
- package/tsconfig_common.json +0 -66
- package/tsconfig_nodejs.json +0 -25
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BuildModelOptionsBase } from "..";
|
|
2
|
-
import { Symbols } from "..";
|
|
3
|
-
export declare function buildModel(data: BuildModelOptionsBase): Promise<{
|
|
4
|
-
markdown: string;
|
|
5
|
-
xmlModel: string;
|
|
6
|
-
symbols: Symbols;
|
|
7
|
-
}>;
|
|
1
|
+
import { BuildModelOptionsBase } from "..";
|
|
2
|
+
import { Symbols } from "..";
|
|
3
|
+
export declare function buildModel(data: BuildModelOptionsBase): Promise<{
|
|
4
|
+
markdown: string;
|
|
5
|
+
xmlModel: string;
|
|
6
|
+
symbols: Symbols;
|
|
7
|
+
}>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.buildModel = void 0;
|
|
13
|
-
const nodeJS_1 = require("node-opcua-address-space/nodeJS");
|
|
14
|
-
const __1 = require("..");
|
|
15
|
-
function buildModel(data) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const option1 = Object.assign(Object.assign({}, data), { xmlLoader: nodeJS_1.readNodeSet2XmlFile });
|
|
18
|
-
return (0, __1.buildModelInner)(option1);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
exports.buildModel = buildModel;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.buildModel = void 0;
|
|
13
|
+
const nodeJS_1 = require("node-opcua-address-space/nodeJS");
|
|
14
|
+
const __1 = require("..");
|
|
15
|
+
function buildModel(data) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const option1 = Object.assign(Object.assign({}, data), { xmlLoader: nodeJS_1.readNodeSet2XmlFile });
|
|
18
|
+
return (0, __1.buildModelInner)(option1);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.buildModel = buildModel;
|
|
22
22
|
//# sourceMappingURL=build_model.js.map
|
package/distNodeJS/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./symbol_cvs";
|
|
2
|
-
export * from "./build_model";
|
|
3
|
-
export * from "./build_documentation_to_file";
|
|
4
|
-
export * from "..";
|
|
5
|
-
export { generateAddressSpace } from "node-opcua-address-space/nodeJS";
|
|
1
|
+
export * from "./symbol_cvs";
|
|
2
|
+
export * from "./build_model";
|
|
3
|
+
export * from "./build_documentation_to_file";
|
|
4
|
+
export * from "..";
|
|
5
|
+
export { generateAddressSpace } from "node-opcua-address-space/nodeJS";
|
package/distNodeJS/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.generateAddressSpace = void 0;
|
|
18
|
-
__exportStar(require("./symbol_cvs"), exports);
|
|
19
|
-
__exportStar(require("./build_model"), exports);
|
|
20
|
-
__exportStar(require("./build_documentation_to_file"), exports);
|
|
21
|
-
__exportStar(require(".."), exports);
|
|
22
|
-
var nodeJS_1 = require("node-opcua-address-space/nodeJS");
|
|
23
|
-
Object.defineProperty(exports, "generateAddressSpace", { enumerable: true, get: function () { return nodeJS_1.generateAddressSpace; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.generateAddressSpace = void 0;
|
|
18
|
+
__exportStar(require("./symbol_cvs"), exports);
|
|
19
|
+
__exportStar(require("./build_model"), exports);
|
|
20
|
+
__exportStar(require("./build_documentation_to_file"), exports);
|
|
21
|
+
__exportStar(require(".."), exports);
|
|
22
|
+
var nodeJS_1 = require("node-opcua-address-space/nodeJS");
|
|
23
|
+
Object.defineProperty(exports, "generateAddressSpace", { enumerable: true, get: function () { return nodeJS_1.generateAddressSpace; } });
|
|
24
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Symbols } from "..";
|
|
2
|
-
export declare function saveSymbolsToCSV(csvFilename: string, symbols: Symbols): Promise<void>;
|
|
3
|
-
export declare function getPresetSymbolsFromCSV(csvFilename: string): Promise<Symbols>;
|
|
1
|
+
import { Symbols } from "..";
|
|
2
|
+
export declare function saveSymbolsToCSV(csvFilename: string, symbols: Symbols): Promise<void>;
|
|
3
|
+
export declare function getPresetSymbolsFromCSV(csvFilename: string): Promise<Symbols>;
|
package/distNodeJS/symbol_cvs.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getPresetSymbolsFromCSV = exports.saveSymbolsToCSV = void 0;
|
|
13
|
-
const fs = require("fs");
|
|
14
|
-
const csv_parse_1 = require("csv-parse");
|
|
15
|
-
const __1 = require("..");
|
|
16
|
-
// node 14 onward : import { readFile, writeFile } from "fs/promises";
|
|
17
|
-
const { readFile, writeFile } = fs.promises;
|
|
18
|
-
function saveSymbolsToCSV(csvFilename, symbols) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
yield writeFile(csvFilename, (0, __1.toCSV)(symbols), "utf-8");
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.saveSymbolsToCSV = saveSymbolsToCSV;
|
|
24
|
-
function getPresetSymbolsFromCSV(csvFilename) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
if (!fs.existsSync(csvFilename)) {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
const data = yield readFile(csvFilename, "utf-8");
|
|
31
|
-
const records = yield new Promise((resolve) => {
|
|
32
|
-
const output = [];
|
|
33
|
-
(0, csv_parse_1.parse)(data, {
|
|
34
|
-
cast: (value, context) => {
|
|
35
|
-
if (context.index === 1) {
|
|
36
|
-
return parseInt(value, 10);
|
|
37
|
-
}
|
|
38
|
-
return value;
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
.on("readable", function () {
|
|
42
|
-
let record = this.read();
|
|
43
|
-
while (record) {
|
|
44
|
-
output.push(record);
|
|
45
|
-
record = this.read();
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
.on("end", () => {
|
|
49
|
-
resolve(output);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
return records;
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
if (err instanceof Error) {
|
|
56
|
-
// tslint:disable-next-line: no-console
|
|
57
|
-
console.log("getPresetSymbols err = ", err.message);
|
|
58
|
-
}
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
exports.getPresetSymbolsFromCSV = getPresetSymbolsFromCSV;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getPresetSymbolsFromCSV = exports.saveSymbolsToCSV = void 0;
|
|
13
|
+
const fs = require("fs");
|
|
14
|
+
const csv_parse_1 = require("csv-parse");
|
|
15
|
+
const __1 = require("..");
|
|
16
|
+
// node 14 onward : import { readFile, writeFile } from "fs/promises";
|
|
17
|
+
const { readFile, writeFile } = fs.promises;
|
|
18
|
+
function saveSymbolsToCSV(csvFilename, symbols) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
yield writeFile(csvFilename, (0, __1.toCSV)(symbols), "utf-8");
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.saveSymbolsToCSV = saveSymbolsToCSV;
|
|
24
|
+
function getPresetSymbolsFromCSV(csvFilename) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
if (!fs.existsSync(csvFilename)) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const data = yield readFile(csvFilename, "utf-8");
|
|
31
|
+
const records = yield new Promise((resolve) => {
|
|
32
|
+
const output = [];
|
|
33
|
+
(0, csv_parse_1.parse)(data, {
|
|
34
|
+
cast: (value, context) => {
|
|
35
|
+
if (context.index === 1) {
|
|
36
|
+
return parseInt(value, 10);
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
.on("readable", function () {
|
|
42
|
+
let record = this.read();
|
|
43
|
+
while (record) {
|
|
44
|
+
output.push(record);
|
|
45
|
+
record = this.read();
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
.on("end", () => {
|
|
49
|
+
resolve(output);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
return records;
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
if (err instanceof Error) {
|
|
56
|
+
// tslint:disable-next-line: no-console
|
|
57
|
+
console.log("getPresetSymbols err = ", err.message);
|
|
58
|
+
}
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.getPresetSymbolsFromCSV = getPresetSymbolsFromCSV;
|
|
64
64
|
//# sourceMappingURL=symbol_cvs.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-modeler",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "pure nodejs OPCUA SDK - module
|
|
3
|
+
"version": "2.98.1",
|
|
4
|
+
"description": "pure nodejs OPCUA SDK - module modeler",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -14,28 +14,28 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"cli-table3": "^0.6.3",
|
|
16
16
|
"csv-parse": "5.3.6",
|
|
17
|
-
"node-opcua-address-space": "2.
|
|
18
|
-
"node-opcua-assert": "2.
|
|
19
|
-
"node-opcua-basic-types": "2.
|
|
20
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
21
|
-
"node-opcua-constants": "2.
|
|
22
|
-
"node-opcua-data-model": "2.
|
|
23
|
-
"node-opcua-debug": "2.
|
|
24
|
-
"node-opcua-factory": "2.
|
|
25
|
-
"node-opcua-nodeid": "2.
|
|
26
|
-
"node-opcua-nodesets": "2.
|
|
27
|
-
"node-opcua-numeric-range": "2.
|
|
28
|
-
"node-opcua-schemas": "2.
|
|
29
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
30
|
-
"node-opcua-status-code": "2.
|
|
31
|
-
"node-opcua-types": "2.
|
|
32
|
-
"node-opcua-variant": "2.
|
|
17
|
+
"node-opcua-address-space": "2.98.1",
|
|
18
|
+
"node-opcua-assert": "2.98.1",
|
|
19
|
+
"node-opcua-basic-types": "2.98.1",
|
|
20
|
+
"node-opcua-client-dynamic-extension-object": "2.98.1",
|
|
21
|
+
"node-opcua-constants": "2.98.1",
|
|
22
|
+
"node-opcua-data-model": "2.98.1",
|
|
23
|
+
"node-opcua-debug": "2.98.1",
|
|
24
|
+
"node-opcua-factory": "2.98.1",
|
|
25
|
+
"node-opcua-nodeid": "2.98.1",
|
|
26
|
+
"node-opcua-nodesets": "2.98.1",
|
|
27
|
+
"node-opcua-numeric-range": "2.98.1",
|
|
28
|
+
"node-opcua-schemas": "2.98.1",
|
|
29
|
+
"node-opcua-service-translate-browse-path": "2.98.1",
|
|
30
|
+
"node-opcua-status-code": "2.98.1",
|
|
31
|
+
"node-opcua-types": "2.98.1",
|
|
32
|
+
"node-opcua-variant": "2.98.1",
|
|
33
33
|
"yargs": "15.4.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"node-opcua-leak-detector": "2.
|
|
36
|
+
"node-opcua-leak-detector": "2.98.1",
|
|
37
37
|
"should": "^13.2.3",
|
|
38
|
-
"sinon": "^15.0.
|
|
38
|
+
"sinon": "^15.0.3"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
@@ -50,5 +50,12 @@
|
|
|
50
50
|
"internet of things"
|
|
51
51
|
],
|
|
52
52
|
"homepage": "http://node-opcua.github.io/",
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "07dcdd8e8c7f2b55544c6e23023093e35674829c",
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"distNodeJS",
|
|
57
|
+
"source",
|
|
58
|
+
"nodeJS.d.ts",
|
|
59
|
+
"nodeJS.js"
|
|
60
|
+
]
|
|
54
61
|
}
|
package/MyModelIds.csv
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
BoilerType,1008,ObjectType
|
|
2
|
-
BoilerType_DeviceHealth,1009,Variable
|
|
3
|
-
BoilerType_ParameterSet,1010,Object
|
|
4
|
-
BoilerType_ParameterSet_ParameterIdentifier>,1011,Variable
|
|
5
|
-
BoilerType_ParameterSet_HumiditySetpoint,1012,Variable
|
|
6
|
-
BoilerType_ParameterSet_TemperatureSetpoint,1013,Variable
|
|
7
|
-
BoilerType_ParameterSet_ParameterIdentifier,1014,Variable
|
|
8
|
-
NewBoilerType,1015,ObjectType
|
|
9
|
-
NewBoilerType_DeviceHealth,1016,Variable
|
|
10
|
-
NewBoilerType_ParameterSet,1017,Object
|
|
11
|
-
NewBoilerType_ParameterSet_ParameterIdentifier,1018,Variable
|
|
12
|
-
NewBoilerType_ParameterSet_HumiditySetpoint,1019,Variable
|
|
13
|
-
NewBoilerType_ParameterSet_TemperatureSetpoint,1020,Variable
|
|
14
|
-
FlowTo,1021,ReferenceType
|
|
15
|
-
HotFlowTo,1022,ReferenceType
|
|
16
|
-
SignalTo,1023,ReferenceType
|
|
17
|
-
BoilerHaltedEventType,1024,ObjectType
|
|
18
|
-
CustomControllerType,1025,ObjectType
|
|
19
|
-
CustomControllerType_Input1,1026,Variable
|
|
20
|
-
CustomControllerType_Input2,1027,Variable
|
|
21
|
-
CustomControllerType_Input3,1028,Variable
|
|
22
|
-
CustomControllerType_ControlOut,1029,Variable
|
|
23
|
-
CustomControllerType_Description,1030,Variable
|
|
24
|
-
GenericSensorType,1031,ObjectType
|
|
25
|
-
GenericSensorType_Output,1032,Variable
|
|
26
|
-
GenericSensorType_Output_EURange,1033,Variable
|
|
27
|
-
GenericControllerType,1034,ObjectType
|
|
28
|
-
GenericControllerType_ControlOut,1035,Variable
|
|
29
|
-
GenericControllerType_Measurement,1036,Variable
|
|
30
|
-
GenericControllerType_SetPoint,1037,Variable
|
|
31
|
-
FlowControllerType,1038,ObjectType
|
|
32
|
-
LevelControllerType,1039,ObjectType
|
|
33
|
-
FlowTransmitterType,1040,ObjectType
|
|
34
|
-
LevelIndicatorType,1041,ObjectType
|
|
35
|
-
GenericActuatorType,1042,ObjectType
|
|
36
|
-
GenericActuatorType_Input,1043,Variable
|
|
37
|
-
GenericActuatorType_Input_EURange,1044,Variable
|
|
38
|
-
ValveType,1045,ObjectType
|
|
39
|
-
BoilerInputPipeType,1046,ObjectType
|
|
40
|
-
BoilerInputPipeType_FTX001,1047,Object
|
|
41
|
-
BoilerInputPipeType_FTX001_Output,1048,Variable
|
|
42
|
-
BoilerInputPipeType_FTX001_Output_EURange,1049,Variable
|
|
43
|
-
BoilerInputPipeType_ValveX001,1050,Object
|
|
44
|
-
BoilerInputPipeType_ValveX001_Input,1051,Variable
|
|
45
|
-
BoilerInputPipeType_ValveX001_Input_EURange,1052,Variable
|
|
46
|
-
BoilerOutputPipeType,1053,ObjectType
|
|
47
|
-
BoilerOutputPipeType_FTX002,1054,Object
|
|
48
|
-
BoilerOutputPipeType_FTX002_Output,1055,Variable
|
|
49
|
-
BoilerOutputPipeType_FTX002_Output_EURange,1056,Variable
|
|
50
|
-
BoilerDrumType,1057,ObjectType
|
|
51
|
-
BoilerDrumType_LIX001,1058,Object
|
|
52
|
-
BoilerDrumType_LIX001_Output,1059,Variable
|
|
53
|
-
BoilerDrumType_LIX001_Output_EURange,1060,Variable
|
|
54
|
-
BoilerStateMachineType,1061,ObjectType
|
|
55
|
-
BoilerStateMachineType_Halt,1062,Method
|
|
56
|
-
BoilerStateMachineType_Reset,1063,Method
|
|
57
|
-
BoilerStateMachineType_Start,1064,Method
|
|
58
|
-
BoilerStateMachineType_Suspend,1065,Method
|
|
59
|
-
BoilerStateMachineType_Resume,1066,Method
|
|
60
|
-
BoilerType_CCX001,1067,Object
|
|
61
|
-
BoilerType_CCX001_Input1,1068,Variable
|
|
62
|
-
BoilerType_CCX001_Input2,1069,Variable
|
|
63
|
-
BoilerType_CCX001_Input3,1070,Variable
|
|
64
|
-
BoilerType_CCX001_ControlOut,1071,Variable
|
|
65
|
-
BoilerType_CCX001_Description,1072,Variable
|
|
66
|
-
BoilerType_FCX001,1073,Object
|
|
67
|
-
BoilerType_FCX001_ControlOut,1074,Variable
|
|
68
|
-
BoilerType_FCX001_Measurement,1075,Variable
|
|
69
|
-
BoilerType_FCX001_SetPoint,1076,Variable
|
|
70
|
-
BoilerType_LCX001,1077,Object
|
|
71
|
-
BoilerType_LCX001_ControlOut,1078,Variable
|
|
72
|
-
BoilerType_LCX001_Measurement,1079,Variable
|
|
73
|
-
BoilerType_LCX001_SetPoint,1080,Variable
|
|
74
|
-
BoilerType_PipeX001,1081,Object
|
|
75
|
-
BoilerType_PipeX001_FTX001,1082,Object
|
|
76
|
-
BoilerType_PipeX001_FTX001_Output,1083,Variable
|
|
77
|
-
BoilerType_PipeX001_FTX001_Output_EURange,1084,Variable
|
|
78
|
-
BoilerType_PipeX001_ValveX001,1085,Object
|
|
79
|
-
BoilerType_PipeX001_ValveX001_Input,1086,Variable
|
|
80
|
-
BoilerType_PipeX001_ValveX001_Input_EURange,1087,Variable
|
|
81
|
-
BoilerType_DrumX001,1088,Object
|
|
82
|
-
BoilerType_DrumX001_LIX001,1089,Object
|
|
83
|
-
BoilerType_DrumX001_LIX001_Output,1090,Variable
|
|
84
|
-
BoilerType_DrumX001_LIX001_Output_EURange,1091,Variable
|
|
85
|
-
BoilerType_PipeX002,1092,Object
|
|
86
|
-
BoilerType_PipeX002_FTX002,1093,Object
|
|
87
|
-
BoilerType_PipeX002_FTX002_Output,1094,Variable
|
|
88
|
-
BoilerType_PipeX002_FTX002_Output_EURange,1095,Variable
|
|
89
|
-
BoilerType_Simulation,1096,Object
|
|
90
|
-
BoilerType_Simulation_Halt,1097,Method
|
|
91
|
-
BoilerType_Simulation_Reset,1098,Method
|
|
92
|
-
BoilerType_Simulation_Start,1099,Method
|
|
93
|
-
BoilerType_Simulation_Suspend,1100,Method
|
|
94
|
-
BoilerType_Simulation_Resume,1101,Method
|
|
95
|
-
BoilerType_Simulation_CurrentState,1102,Variable
|
|
96
|
-
BoilerType_Simulation_CurrentState_Id,1103,Variable
|
|
97
|
-
BoilerType_Simulation_CurrentState_Number,1104,Variable
|
|
98
|
-
BoilerType_Simulation_LastTransition,1105,Variable
|
|
99
|
-
BoilerType_Simulation_LastTransition_Id,1106,Variable
|
|
100
|
-
BoilerType_Simulation_LastTransition_Number,1107,Variable
|
|
101
|
-
BoilerType_Simulation_LastTransition_TransitionTime,1108,Variable
|
|
102
|
-
BoilerType_Simulation_Deletable,1109,Variable
|
|
103
|
-
BoilerType_Simulation_AutoDelete,1110,Variable
|
|
104
|
-
BoilerType_Simulation_RecycleCount,1111,Variable
|
|
105
|
-
BoilerDeviceType,1112,ObjectType
|
|
106
|
-
BoilerDeviceType_DeviceHealth,1113,Variable
|
|
107
|
-
BoilerDeviceType_ParameterSet,1114,Object
|
|
108
|
-
BoilerDeviceType_ParameterSet_ParameterIdentifier,1115,Variable
|
|
109
|
-
BoilerDeviceType_ParameterSet_HumiditySetpoint,1116,Variable
|
|
110
|
-
BoilerDeviceType_ParameterSet_TemperatureSetpoint,1117,Variable
|
|
111
|
-
BoilerInputPipeType_FlowTransmitter,1118,Object
|
|
112
|
-
BoilerInputPipeType_FlowTransmitter_Output,1119,Variable
|
|
113
|
-
BoilerInputPipeType_FlowTransmitter_Output_EURange,1120,Variable
|
|
114
|
-
BoilerInputPipeType_Valve,1121,Object
|
|
115
|
-
BoilerInputPipeType_Valve_Input,1122,Variable
|
|
116
|
-
BoilerInputPipeType_Valve_Input_EURange,1123,Variable
|
|
117
|
-
BoilerOutputPipeType_FlowTransmitter,1124,Object
|
|
118
|
-
BoilerOutputPipeType_FlowTransmitter_Output,1125,Variable
|
|
119
|
-
BoilerOutputPipeType_FlowTransmitter_Output_EURange,1126,Variable
|
|
120
|
-
BoilerDrumType_LevelIndicator,1127,Object
|
|
121
|
-
BoilerDrumType_LevelIndicator_Output,1128,Variable
|
|
122
|
-
BoilerDrumType_LevelIndicator_Output_EURange,1129,Variable
|
|
123
|
-
BoilerType_CustomController,1130,Object
|
|
124
|
-
BoilerType_CustomController_Input1,1131,Variable
|
|
125
|
-
BoilerType_CustomController_Input2,1132,Variable
|
|
126
|
-
BoilerType_CustomController_Input3,1133,Variable
|
|
127
|
-
BoilerType_CustomController_ControlOut,1134,Variable
|
|
128
|
-
BoilerType_CustomController_Description,1135,Variable
|
|
129
|
-
BoilerType_FlowController,1136,Object
|
|
130
|
-
BoilerType_FlowController_ControlOut,1137,Variable
|
|
131
|
-
BoilerType_FlowController_Measurement,1138,Variable
|
|
132
|
-
BoilerType_FlowController_SetPoint,1139,Variable
|
|
133
|
-
BoilerType_LevelController,1140,Object
|
|
134
|
-
BoilerType_LevelController_ControlOut,1141,Variable
|
|
135
|
-
BoilerType_LevelController_Measurement,1142,Variable
|
|
136
|
-
BoilerType_LevelController_SetPoint,1143,Variable
|
|
137
|
-
BoilerType_InputPipe,1144,Object
|
|
138
|
-
BoilerType_InputPipe_FlowTransmitter,1145,Object
|
|
139
|
-
BoilerType_InputPipe_FlowTransmitter_Output,1146,Variable
|
|
140
|
-
BoilerType_InputPipe_FlowTransmitter_Output_EURange,1147,Variable
|
|
141
|
-
BoilerType_InputPipe_Valve,1148,Object
|
|
142
|
-
BoilerType_InputPipe_Valve_Input,1149,Variable
|
|
143
|
-
BoilerType_InputPipe_Valve_Input_EURange,1150,Variable
|
|
144
|
-
BoilerType_BoilerDrum,1151,Object
|
|
145
|
-
BoilerType_BoilerDrum_LevelIndicator,1152,Object
|
|
146
|
-
BoilerType_BoilerDrum_LevelIndicator_Output,1153,Variable
|
|
147
|
-
BoilerType_BoilerDrum_LevelIndicator_Output_EURange,1154,Variable
|
|
148
|
-
BoilerType_OutputPipe,1155,Object
|
|
149
|
-
BoilerType_OutputPipe_FlowTransmitter,1156,Object
|
|
150
|
-
BoilerType_OutputPipe_FlowTransmitter_Output,1157,Variable
|
|
151
|
-
BoilerType_OutputPipe_FlowTransmitter_Output_EURange,1158,Variable
|
package/examples/make_model.ts
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import { promisify } from "util";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { generateAddressSpace } from "node-opcua-address-space/nodeJS";
|
|
7
|
-
import { createBoilerType } from "node-opcua-address-space/testHelpers";
|
|
8
|
-
import {
|
|
9
|
-
AddressSpace,
|
|
10
|
-
DataType,
|
|
11
|
-
displayNodeElement,
|
|
12
|
-
nodesets,
|
|
13
|
-
promoteToMandatory,
|
|
14
|
-
setNamespaceMetaData,
|
|
15
|
-
Symbols,
|
|
16
|
-
UAObject,
|
|
17
|
-
UAVariable,
|
|
18
|
-
UAVariableT
|
|
19
|
-
} from "..";
|
|
20
|
-
|
|
21
|
-
import { getPresetSymbolsFromCSV, saveSymbolsToCSV, buildModel } from "../nodeJS";
|
|
22
|
-
|
|
23
|
-
// node 14 onward : import { writeFile } from "fs/promises";
|
|
24
|
-
const { writeFile } = fs.promises;
|
|
25
|
-
|
|
26
|
-
interface UABoilerTest extends UAObject {
|
|
27
|
-
deviceHealth: UAVariable;
|
|
28
|
-
manufacturer: UAVariableT<string, DataType.String>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const xmlFiles = [nodesets.standard, nodesets.di];
|
|
32
|
-
|
|
33
|
-
const namespaceUri = "http://acme.com/Boiler/V0";
|
|
34
|
-
const version = "1.0.0";
|
|
35
|
-
|
|
36
|
-
const nodesetFilename = "./MyModel.NodeSet2.xml";
|
|
37
|
-
const symbolFilename = "./MyModelIds.csv";
|
|
38
|
-
|
|
39
|
-
async function createModel(addressSpace: AddressSpace): Promise<void> {
|
|
40
|
-
const ns = addressSpace.getOwnNamespace();
|
|
41
|
-
|
|
42
|
-
const nsDI = addressSpace.getNamespaceIndex("http://opcfoundation.org/UA/DI/");
|
|
43
|
-
if (nsDI < 0) {
|
|
44
|
-
throw new Error("Cannot find DI namespace!");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const deviceSet = addressSpace.rootFolder.objects.getFolderElementByName(`DeviceSet`);
|
|
48
|
-
if (!deviceSet) {
|
|
49
|
-
throw new Error("Cannot find DeviceSet object!");
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const deviceType = addressSpace.findObjectType("DeviceType", nsDI);
|
|
53
|
-
if (!deviceType) {
|
|
54
|
-
throw new Error("Cannot find DeviceType");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// construct namespace meta data
|
|
58
|
-
const metaData = setNamespaceMetaData(addressSpace.getOwnNamespace());
|
|
59
|
-
|
|
60
|
-
const boilerDeviceType = ns.addObjectType({
|
|
61
|
-
browseName: "BoilerDeviceType",
|
|
62
|
-
subtypeOf: deviceType
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
promoteToMandatory(boilerDeviceType, "Manufacturer", nsDI);
|
|
66
|
-
promoteToMandatory(boilerDeviceType, "DeviceHealth", nsDI);
|
|
67
|
-
const parameterSet = promoteToMandatory(boilerDeviceType, "ParameterSet", nsDI);
|
|
68
|
-
|
|
69
|
-
ns.addVariable({
|
|
70
|
-
browseName: "HumiditySetpoint",
|
|
71
|
-
componentOf: parameterSet,
|
|
72
|
-
dataType: "Double"
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
ns.addVariable({
|
|
76
|
-
browseName: "TemperatureSetpoint",
|
|
77
|
-
componentOf: parameterSet,
|
|
78
|
-
dataType: "Double"
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
createBoilerType(ns);
|
|
82
|
-
|
|
83
|
-
console.log(displayNodeElement(boilerDeviceType));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async function buildModelFile() {
|
|
87
|
-
try {
|
|
88
|
-
const presetSymbols = await getPresetSymbolsFromCSV(symbolFilename);
|
|
89
|
-
|
|
90
|
-
const { xmlModel, symbols } = await buildModel({
|
|
91
|
-
createModel,
|
|
92
|
-
namespaceUri,
|
|
93
|
-
version,
|
|
94
|
-
xmlFiles,
|
|
95
|
-
// tslint:disable-next-line: object-literal-sort-keys
|
|
96
|
-
presetSymbols
|
|
97
|
-
});
|
|
98
|
-
// save model to a file
|
|
99
|
-
await writeFile(nodesetFilename, xmlModel, "utf-8");
|
|
100
|
-
|
|
101
|
-
await saveSymbolsToCSV(symbolFilename, symbols);
|
|
102
|
-
} catch (err) {
|
|
103
|
-
console.log("Error", err);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
async function testNamespace() {
|
|
108
|
-
const addressSpace = AddressSpace.create();
|
|
109
|
-
const xmlFiles1 = [nodesets.standard, nodesets.di, nodesetFilename];
|
|
110
|
-
await generateAddressSpace(addressSpace, xmlFiles1);
|
|
111
|
-
|
|
112
|
-
const nsDI = addressSpace.getNamespaceIndex("http://opcfoundation.org/UA/DI/");
|
|
113
|
-
if (nsDI < 0) {
|
|
114
|
-
throw new Error("Cannot find DI namespace!");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const deviceSet = addressSpace.rootFolder.objects.getFolderElementByName(`DeviceSet`);
|
|
118
|
-
if (!deviceSet) {
|
|
119
|
-
throw new Error("Cannot find DeviceSet object!");
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const nsLRA = addressSpace.getNamespaceIndex("http://acme.com/Boiler/V0");
|
|
123
|
-
const boilerDeviceType = addressSpace.findObjectType("BoilerDeviceType", nsLRA);
|
|
124
|
-
if (!boilerDeviceType) {
|
|
125
|
-
throw new Error("cannot find boiler type");
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const boiler = boilerDeviceType.instantiate({
|
|
129
|
-
browseName: "Boiler1",
|
|
130
|
-
organizedBy: deviceSet
|
|
131
|
-
}) as UABoilerTest;
|
|
132
|
-
|
|
133
|
-
boiler.deviceHealth.writeEnumValue("MAINTENANCE_REQUIRED");
|
|
134
|
-
boiler.manufacturer.setValueFromSource({ dataType: DataType.LocalizedText, value: { text: "STERFIVE" } });
|
|
135
|
-
|
|
136
|
-
console.log(displayNodeElement(boiler));
|
|
137
|
-
|
|
138
|
-
addressSpace.dispose();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
(async () => {
|
|
142
|
-
try {
|
|
143
|
-
await buildModelFile();
|
|
144
|
-
// now test the nodeset
|
|
145
|
-
await testNamespace();
|
|
146
|
-
} catch (err) {
|
|
147
|
-
if (err instanceof Error) {
|
|
148
|
-
console.log("err", err.message);
|
|
149
|
-
}
|
|
150
|
-
console.log(err);
|
|
151
|
-
}
|
|
152
|
-
console.log("done");
|
|
153
|
-
})();
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import { Namespace } from "node-opcua-address-space";
|
|
3
|
-
import { BuildDocumentationOptions, buildDocumentationToString } from "..";
|
|
4
|
-
|
|
5
|
-
export async function buildDocumentationToFile(namespace: Namespace, filename: string, options?: BuildDocumentationOptions) {
|
|
6
|
-
const str = await buildDocumentationToString(namespace, options);
|
|
7
|
-
const stream = fs.createWriteStream("documentation.md");
|
|
8
|
-
stream.write(str);
|
|
9
|
-
await new Promise((resolve) => {
|
|
10
|
-
stream.on("finish", resolve);
|
|
11
|
-
stream.end();
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { readNodeSet2XmlFile } from "node-opcua-address-space/nodeJS";
|
|
2
|
-
|
|
3
|
-
import { buildModelInner, BuildModelOptionsBase } from "..";
|
|
4
|
-
import { Symbols } from "..";
|
|
5
|
-
|
|
6
|
-
export async function buildModel(data: BuildModelOptionsBase): Promise<{ markdown: string; xmlModel: string; symbols: Symbols }> {
|
|
7
|
-
const option1 = {
|
|
8
|
-
...data,
|
|
9
|
-
xmlLoader: readNodeSet2XmlFile
|
|
10
|
-
};
|
|
11
|
-
return buildModelInner(option1);
|
|
12
|
-
}
|