Skip to content

Commit

Permalink
Merge pull request #3046 from SCADA-LTS/feature/#3044_Improve_content…
Browse files Browse the repository at this point in the history
…_of_list_of_points_in_BacNet_source_properties_screen

#3044 Improve content of list of points in BacNet source properties screen
  • Loading branch information
Limraj authored Nov 14, 2024
2 parents efb2377 + 7f0f97b commit 6e98fff
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions WebContent/WEB-INF/jsp/dataSourceEdit/editBacnetIp.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,21 @@
}
function appendPointListColumnFunctions(pointListColumnHeaders, pointListColumnFunctions) {
pointListColumnHeaders[pointListColumnHeaders.length] = "<spring:message code="dsEdit.bacnetIp.device"/>";
pointListColumnFunctions[pointListColumnFunctions.length] = function(p) { return p.pointLocator.remoteDeviceIp; };
pointListColumnHeaders[pointListColumnHeaders.length] = "<spring:message code="dsEdit.bacnetIp.device"/>";
pointListColumnFunctions[pointListColumnFunctions.length] = function(p) { return '<div style="text-align: center;">' + p.pointLocator.remoteDeviceIp + '</div>';};
pointListColumnHeaders[pointListColumnHeaders.length] = "<spring:message code="dsEdit.bacnetIp.objectType"/>";
pointListColumnFunctions[pointListColumnFunctions.length] = function (p) {
const element = document.createElement("div");
element.style.textAlign = "center";
DataSourceEditDwr.getObjectTypeName(p.pointLocator.objectTypeId, function (result) {
element.innerHTML = result;
});
return element;
};
pointListColumnHeaders[pointListColumnHeaders.length] = "<spring:message code="dsEdit.bacnetIp.objectInstanceNumber"/>";
pointListColumnFunctions[pointListColumnFunctions.length] = function(p) {return '<div style="text-align: center;">' + p.pointLocator.objectInstanceNumber + '</div>';};
}
function editPointCBImpl(locator) {
Expand Down
5 changes: 5 additions & 0 deletions src/com/serotonin/mango/web/dwr/DataSourceEditDwr.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import javax.management.remote.JMXServiceURL;
import javax.script.ScriptException;

import com.serotonin.bacnet4j.type.enumerated.ObjectType;
import com.serotonin.db.KeyValuePair;
import com.serotonin.mango.util.LoggingUtils;
import com.serotonin.mango.web.dwr.beans.*;
Expand Down Expand Up @@ -2990,4 +2991,8 @@ public DwrResponseI18n copyDataPoint(final int dataSourceId, final int dataPoint

return response;
}
public String getObjectTypeName(int objectTypeId) {
ObjectType objectType = new ObjectType(objectTypeId);
return objectType.toString();
}
}

0 comments on commit 6e98fff

Please sign in to comment.