Skip to content

Commit

Permalink
Fixed: BACnet browse #114
Browse files Browse the repository at this point in the history
  • Loading branch information
unocelli committed Mar 14, 2021
1 parent ef1686e commit faad2e4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
3 changes: 2 additions & 1 deletion client/dist/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@
"gauges.property-head-value": "Value",
"gauges.property-input-min": "Min",
"gauges.property-input-max": "Max",
"gauges.property-input-color": "Color",
"gauges.property-input-color": "Fill",
"gauges.property-input-stroke": "Stroke",
"gauges.property-input-value": "Value",
"gauges.property-input-label": "Label",
"gauges.property-input-unit": "Unit",
Expand Down
4 changes: 2 additions & 2 deletions client/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
<script src="assets/lib/svg/svg.min.js"></script>
<script src="assets/lib/svg/raphael.min.js"></script>

<link rel="stylesheet" href="styles.8cce1049e83b77394e27.css"></head>
<link rel="stylesheet" href="styles.e063d35143ff718dd7cf.css"></head>
<!-- 3. Display the application -->
<body>
<app-root>Loading...</app-root>

<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.709d3d016be532a51b50.js"></script><script type="text/javascript" src="main.c9043b675a5abe65be0f.js"></script></body>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.709d3d016be532a51b50.js"></script><script type="text/javascript" src="main.37f4b91cbbad6640f589.js"></script></body>
</html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export class TagPropertyComponent implements OnInit, OnDestroy {
node.class = n.class;
node.property = this.getProperty(n);
if (this.data.device.type === DeviceType.BACnet) {
node.class = Node.strToType(n.class);
node.type = n.type;
var typetext = Object.values(BACnetObjectType)[n.type];
if (typetext) {
Expand Down
7 changes: 7 additions & 0 deletions client/src/app/gui-helpers/treetable/treetable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export class Node {
this.todefine.options.push(opt);
}
}

static strToType(str: string): any {
if (NodeType[str]) {
return NodeType[str];
}
return str;
}
}

export enum NodeType {
Expand Down
5 changes: 3 additions & 2 deletions server/runtime/devices/bacnet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function BACNETclient(_data, _logger, _events) {
if (_checkWorking(true)) {
try {
if (node.parent) { // BACnet object => read property

_checkWorking(false);
} else { // BACnet device => read object list
_readObjectList(node.id).then(result => {
resolve(result);
Expand Down Expand Up @@ -336,7 +336,8 @@ function BACNETclient(_data, _logger, _events) {
var device = devs[index];
try {
readfnc.push(_readProperty({ type: bacnet.enum.ObjectTypes.OBJECT_DEVICE, instance: device.deviceId}, bacnet.enum.PropertyIds.PROP_OBJECT_NAME));
} catch (error) {
} catch (err) {
logger.error(`'${data.name}' _readProperty error! ${err}`);
}
}
Promise.all(readfnc).then(results => {
Expand Down
11 changes: 8 additions & 3 deletions server/runtime/devices/modbus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,20 @@ function MODBUSclient(_data, _logger, _events) {
if (!data.property.options) {
for (var memaddr in memory) {
var tokenizedAddress = parseAddress(memaddr);
readVarsfnc.push(await _readMemory(parseInt(tokenizedAddress.address), memory[memaddr].Start, memory[memaddr].MaxSize, Object.values(memory[memaddr].Items)));
readVarsfnc.push(await delay(100));
try {
readVarsfnc.push(await _readMemory(parseInt(tokenizedAddress.address), memory[memaddr].Start, memory[memaddr].MaxSize, Object.values(memory[memaddr].Items)));
readVarsfnc.push(await delay(100));
} catch (err) {
logger.error(`'${data.name}' _readMemory error! ${err}`);
}
}
} else {
for (var memaddr in mixItemsMap) {
try {
readVarsfnc.push(await _readMemory(getMemoryAddress(parseInt(memaddr), false), mixItemsMap[memaddr].Start, mixItemsMap[memaddr].MaxSize, Object.values(mixItemsMap[memaddr].Items)));
readVarsfnc.push(await delay(100));
} catch (error) {
} catch (err) {
logger.error(`'${data.name}' _readMemory error! ${err}`);
}
}
}
Expand Down

0 comments on commit faad2e4

Please sign in to comment.