Skip to content

Commit

Permalink
Merge pull request #3082 from SCADA-LTS/feature/#2119_Support_for_the…
Browse files Browse the repository at this point in the history
…_OPC_UA_protocol_using_the_PLC4X_library2

#2119 Support for the OPC UA protocol using the PLC4X library:
  • Loading branch information
Limraj authored Feb 3, 2025
2 parents 67bcccb + dfbc8e6 commit 9fa1f6d
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 19 deletions.
54 changes: 40 additions & 14 deletions WebContent/WEB-INF/jsp/dataSourceEdit/editOpcUa.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@
if (check == true) {
let copyLocator = JSON.parse(JSON.stringify(locator));
copyLocator.nodeName = list.rows[i].cells[0].innerHTML;
copyLocator.identifier = list.rows[i].cells[1].innerHTML;
copyLocator.identifierType = list.rows[i].cells[2].innerHTML
copyLocator.opcDataType = list.rows[i].cells[3].innerHTML;
copyLocator.namespaceIndex = list.rows[i].cells[4].innerHTML;
copyLocator.settable = list.rows[i].cells[5].innerHTML;
copyLocator.identifier = list.rows[i].cells[2].innerHTML;
copyLocator.identifierType = list.rows[i].cells[3].innerHTML
copyLocator.opcDataType = list.rows[i].cells[4].innerHTML;
copyLocator.namespaceIndex = list.rows[i].cells[5].innerHTML;
copyLocator.settable = list.rows[i].cells[6].innerHTML;
locators.push(copyLocator);
}
Expand All @@ -192,6 +192,18 @@
addNodesTable.children[0].remove();
}
document.getElementById("nodesMessage").textContent = '';
hide("btnResetNode");
hide("findResult");
}
function setCheckedAllNodes(checked) {
let addNodesTable = document.getElementById('addNodesTable');
let inputs = addNodesTable.getElementsByTagName("input");
if(inputs) {
for(let i = 0; i < inputs.length; i++) {
inputs[i].checked = checked;
}
}
}
function findNodes() {
Expand Down Expand Up @@ -222,9 +234,16 @@
td1.appendChild(nodeName);
let td22 = document.createElement("TD");
let identifier = document.createTextNode(node.identifierDisplay);
let identifierDisplay = node.identifier.length > 90 ? node.identifier.substring(0, 90) + "..." : node.identifier;
let identifierTextNode = document.createTextNode(identifierDisplay);
td22.setAttribute("align","center");
td22.appendChild(identifier);
td22.appendChild(identifierTextNode);
let td221 = document.createElement("TD");
let identifier = document.createTextNode(node.identifier);
td221.setAttribute("align","center");
td221.setAttribute("style","display: none");
td221.appendChild(identifier);
let td23 = document.createElement("TD");
let identifierType = document.createTextNode(node.identifierType);
Expand Down Expand Up @@ -282,6 +301,7 @@
row.appendChild(td1);
row.appendChild(td22);
row.appendChild(td221);
row.appendChild(td23);
row.appendChild(td2);
row.appendChild(td21);
Expand All @@ -295,6 +315,9 @@
while(tbody.children.length > 0) {
addNodesTable.insertBefore(tbody.children[0], addNodesTable.children[0]);
}
show("btnResetNode");
show("findResult");
});
}
Expand Down Expand Up @@ -539,7 +562,7 @@ function toggleDiv(elem) {
<td class="formLabelRequired"></td>
<td class="formField">
<input id="btnFindNode" type="button" value="<spring:message code="dsEdit.opcua.findNodes"/>" onclick="findNodes();"/>
<input id="btnFindNode" type="button" value="<spring:message code="dsEdit.opcua.resetNodes"/>" onclick="resetNodes();"/>
<input id="btnResetNode" style="display: none" type="button" value="<spring:message code="dsEdit.opcua.resetNodes"/>" onclick="resetNodes();"/>
</td>
</tr>

Expand All @@ -548,7 +571,7 @@ function toggleDiv(elem) {
<td colspan="2" id="nodesMessage" class="formError"></td>
</tr>

<tr>
<tr id="findResult" style="display: none">
<td colspan="2">
<table cellspacing="2" cellpadding="0" border="0">
<thead class="rowHeader">
Expand All @@ -564,15 +587,18 @@ function toggleDiv(elem) {

<!-- TODO why is the height being enforced? -->
<tbody id="addNodesTable" style="height: 160px; overflow: auto;"></tbody>

<tr>
<td colspan="8" align="center">
<input id="btnAddNode" type="button" value="<spring:message code="dsEdit.opcua.addNodes"/>" onclick="btnAddNode();" />
<input type="button" value="<spring:message code="dsEdit.opcua.checkAllNodes"/>" onclick="setCheckedAllNodes(true);"/>
<input type="button" value="<spring:message code="dsEdit.opcua.uncheckAllNodes"/>" onclick="setCheckedAllNodes(false);"/>
</td>
</tr>
</table>
</td>

</tr>
<tr>
<td colspan="2" align="center"><input id="btnAddNode"
type="button" value="<spring:message code="dsEdit.opcua.addNodes"/>"
onclick="btnAddNode();" /></td>
</tr>

<%@ include file="/WEB-INF/jsp/dataSourceEdit/dsFoot.jspf"%>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.scada_lts.ds.polling.protocol.opcua.vo;

import com.serotonin.mango.rt.dataImage.types.MangoValue;
import org.scada_lts.ds.polling.protocol.opcua.client.impl.OpcUaConverterUtils;

public interface OpcUaDataType {

Expand Down
4 changes: 0 additions & 4 deletions src/org/scada_lts/ds/polling/protocol/opcua/vo/OpcUaItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public String getIdentifier() {
return identifier;
}

public String getIdentifierDisplay() {
return org.scada_lts.serorepl.utils.StringUtils.truncate(String.valueOf(getIdentifier()), "...", 128);
}

public void setIdentifier(String identifier) {
this.identifier = identifier;
}
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3424,6 +3424,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3427,6 +3427,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3467,6 +3467,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_fi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3552,6 +3552,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3421,6 +3421,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_lu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3440,6 +3440,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3542,6 +3542,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3564,6 +3564,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3579,6 +3579,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3575,6 +3575,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down
2 changes: 2 additions & 0 deletions webapp-resources/messages_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3527,6 +3527,8 @@ dsEdit.opcua.namespaceIndex=Namespace Index
dsEdit.opcua.settable=Settable
dsEdit.opcua.findNodes=Find Nodes
dsEdit.opcua.resetNodes=Reset Nodes
dsEdit.opcua.checkAllNodes=Check Nodes
dsEdit.opcua.uncheckAllNodes=Uncheck Nodes
dsEdit.opcua.attributes=Attributes
dsEdit.opcua.numberAttemptsExceeded=Number of attempts exceeded {0}, please try in: {1}
dsEdit.opcua.wait=Wait...
Expand Down

0 comments on commit 9fa1f6d

Please sign in to comment.