From b3663a6c6f861e8f571a6fd7c96c4ae43218f8a9 Mon Sep 17 00:00:00 2001 From: MohitAgarwal <56719162+mohitkumaragarwal@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:53:11 +0100 Subject: [PATCH 1/6] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ffd579..ceff417 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ # UA-for-Industrial-Joining-Technologies The purpose of the IJT group is to define data models and data access standards for various joining techniques such as Tightening, Gluing, Riveting, Flow Drill Fastening, etc. -OPC_UA_Servers\Release1\IJT_OPC_UA_Server_Simulator.zip is the OPC UA Server Simulation based on OPC 40451-1 UA CS for Tightening Systems 1.00. +OPC UA Server Simulation based on OPC 40451-1 UA CS for Tightening Systems 1.00.0: +OPC_UA_Servers\**Release1**\**IJT_OPC_UA_Server_Simulator.zip** + +OPC_UA_Servers\**Release2**\**OPC_UA_IJT_Server_Simulator** is the OPC UA Server Simulation based on the following specifications: +OPC 40450-1 UA CS for Joining Systems 1.00.0 RC. +OPC 40451-1 UA CS for Tightening Systems 2.00.0 RC. + From 644996168d60e47e8931908170a91bbcbb431e39 Mon Sep 17 00:00:00 2001 From: MohitAgarwal <56719162+mohitkumaragarwal@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:55:50 +0100 Subject: [PATCH 2/6] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ceff417..fb12988 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # UA-for-Industrial-Joining-Technologies The purpose of the IJT group is to define data models and data access standards for various joining techniques such as Tightening, Gluing, Riveting, Flow Drill Fastening, etc. -OPC UA Server Simulation based on OPC 40451-1 UA CS for Tightening Systems 1.00.0: -OPC_UA_Servers\**Release1**\**IJT_OPC_UA_Server_Simulator.zip** +OPC UA Reference Server based on OPC 40451-1 UA CS for Tightening Systems 1.00.0: +OPC_UA_Servers\****Release1****\****IJT_OPC_UA_Server_Simulator**.zip** -OPC_UA_Servers\**Release2**\**OPC_UA_IJT_Server_Simulator** is the OPC UA Server Simulation based on the following specifications: +OPC UA Reference Server based on the following specifications: OPC 40450-1 UA CS for Joining Systems 1.00.0 RC. OPC 40451-1 UA CS for Tightening Systems 2.00.0 RC. +OPC_UA_Servers\****Release2**\****OPC_UA_IJT_Server_Simulator**** From f4275c8658d533bdcb0940baace96b069ef890d1 Mon Sep 17 00:00:00 2001 From: MohitAgarwal <56719162+mohitkumaragarwal@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:57:50 +0100 Subject: [PATCH 3/6] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fb12988..999dd7f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # UA-for-Industrial-Joining-Technologies The purpose of the IJT group is to define data models and data access standards for various joining techniques such as Tightening, Gluing, Riveting, Flow Drill Fastening, etc. -OPC UA Reference Server based on OPC 40451-1 UA CS for Tightening Systems 1.00.0: -OPC_UA_Servers\****Release1****\****IJT_OPC_UA_Server_Simulator**.zip** +OPC UA Reference Server based on OPC **40451-1** UA CS for **Tightening** Systems **1.00.0**: +OPC_UA_Servers/**Release1**/**IJT_OPC_UA_Server_Simulator.zip** OPC UA Reference Server based on the following specifications: -OPC 40450-1 UA CS for Joining Systems 1.00.0 RC. -OPC 40451-1 UA CS for Tightening Systems 2.00.0 RC. -OPC_UA_Servers\****Release2**\****OPC_UA_IJT_Server_Simulator**** +OPC **40450-1** UA CS for **Joining** Systems 1.00.0 **RC**. +OPC **40451-1** UA CS for **Tightening** Systems **2.00.0** **RC**. +OPC_UA_Servers/**Release2**/**OPC_UA_IJT_Server_Simulator** From 51acbdd3c4348760f55567c8f0aae9a2debe11af Mon Sep 17 00:00:00 2001 From: MohitAgarwal <56719162+mohitkumaragarwal@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:02:05 +0100 Subject: [PATCH 4/6] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 999dd7f..5916089 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # UA-for-Industrial-Joining-Technologies -The purpose of the IJT group is to define data models and data access standards for various joining techniques such as Tightening, Gluing, Riveting, Flow Drill Fastening, etc. +The purpose of the **VDMA Industrial Joining Technologies (IJT)** Working Group is to define standard information model for various **joining** **technologies** such as Tightening, Gluing, Riveting, Flow Drill Fastening, etc. +The **Joining** **Specification** **(OPC 40450)** is the **Base** part for various joining technologies. OPC UA Reference Server based on OPC **40451-1** UA CS for **Tightening** Systems **1.00.0**: OPC_UA_Servers/**Release1**/**IJT_OPC_UA_Server_Simulator.zip** From 71b11dc68616e35818bb166d4d57418c88702b06 Mon Sep 17 00:00:00 2001 From: MohitAgarwal <56719162+mohitkumaragarwal@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:04:30 +0100 Subject: [PATCH 5/6] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5916089..e82d74d 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,14 @@ The purpose of the **VDMA Industrial Joining Technologies (IJT)** Working Group is to define standard information model for various **joining** **technologies** such as Tightening, Gluing, Riveting, Flow Drill Fastening, etc. The **Joining** **Specification** **(OPC 40450)** is the **Base** part for various joining technologies. -OPC UA Reference Server based on OPC **40451-1** UA CS for **Tightening** Systems **1.00.0**: +OPC UA Reference Server based on OPC **40451-1** UA CS for **Tightening** Systems **1.00.0** is available in the following location: + OPC_UA_Servers/**Release1**/**IJT_OPC_UA_Server_Simulator.zip** OPC UA Reference Server based on the following specifications: -OPC **40450-1** UA CS for **Joining** Systems 1.00.0 **RC**. -OPC **40451-1** UA CS for **Tightening** Systems **2.00.0** **RC**. + OPC **40450-1** UA CS for **Joining** Systems 1.00.0 **RC**. + OPC **40451-1** UA CS for **Tightening** Systems **2.00.0** **RC**. + is available in the following location: + OPC_UA_Servers/**Release2**/**OPC_UA_IJT_Server_Simulator** From 0285bcc63b357d3cdb9fee197087fbfbbd63fea7 Mon Sep 17 00:00:00 2001 From: Joakim Gustafsson Date: Tue, 5 Dec 2023 14:05:42 +0100 Subject: [PATCH 6/6] Closing connections when reload or leave page --- .../Views/GraphicSupport/TabGenerator.mjs | 14 ++++++- .../Views/Servers/EndpointGraphics.mjs | 17 +++++--- .../Views/Servers/ServerGraphics.mjs | 5 ++- .../ijt-support/Assets/AssetManager.mjs | 4 +- .../ijt-support/Client/NodeOPCUAInterface.mjs | 40 ++++++++++--------- .../Resources/connectionpoints.json | 2 +- .../NodeOPCUA_IJT_Client/index.html | 12 +++++- 7 files changed, 62 insertions(+), 32 deletions(-) diff --git a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/GraphicSupport/TabGenerator.mjs b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/GraphicSupport/TabGenerator.mjs index 995124d..6e39ecb 100644 --- a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/GraphicSupport/TabGenerator.mjs +++ b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/GraphicSupport/TabGenerator.mjs @@ -40,6 +40,10 @@ export default class TabGenerator { */ generateTab (content) { this.containerList.push(new Tab(this.contentDiv, content, this.selector)) + // If it is the first, then show it + if (this.containerList.length === 1) { + this.containerList[0].select() + } } /** @@ -87,7 +91,7 @@ export default class TabGenerator { close (point) { for (const tab of this.containerList) { - if (point.name === tab.content.title) { + if (!point || point.name === tab.content.title) { tab.close() } } @@ -135,8 +139,14 @@ class Tab { this.selectorArea.appendChild(this.button) } + select () { + this.button.onclick() + } + close () { this.selectorArea.removeChild(this.button) - this.content.close() + if (this.content && this.content.close) { + this.content.close() + } } } diff --git a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/EndpointGraphics.mjs b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/EndpointGraphics.mjs index 8d04e00..ea97c74 100644 --- a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/EndpointGraphics.mjs +++ b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/EndpointGraphics.mjs @@ -25,6 +25,8 @@ export default class EndpointGraphics extends BasicScreen { constructor (title) { super(title) this.endpointUrl = '' + + console.log('========================================================= open 0') } close () { @@ -41,6 +43,8 @@ export default class EndpointGraphics extends BasicScreen { this.backGround.innerHTML = 'EndpointUrl: ' + endpointUrl this.socketHandler = new SocketHandler(socket, endpointUrl) + // console.log('========================================================= open 1') + // mixing background and current tab content here const tabGenerator = new TabGenerator(this.backGround, 'TabSelector' + endpointUrl) @@ -63,7 +67,7 @@ export default class EndpointGraphics extends BasicScreen { const eventGraphics = new EventGraphics(eventManager, modelManager) tabGenerator.generateTab(eventGraphics, false) const resultManager = new ResultManager(this.connectionManager, eventManager) - const assets = new AssetManager(addressSpace, this.socketHandler) + const assets = new AssetManager(addressSpace, this.connectionManager) const asstetGraphics = new AssetGraphics(assets) tabGenerator.generateTab(asstetGraphics) const traceGraphics = new TraceGraphics(['angle', 'torque'], addressSpace, resultManager) @@ -75,19 +79,20 @@ export default class EndpointGraphics extends BasicScreen { /* **************** Set up socket listeners to handle input from server ******************/ // Listen to error messages - this.socketHandler.registerMandatory('error message', function (msg) { + this.connectionManager.socketHandler.registerMandatory('error message', function (msg) { console.log(msg.message) // servers.messageDisplay(msg.message) tabGenerator.displayError(msg) }) - window.onbeforeunload = function () { - this.connectionManager.close() - } + console.log('========================================================= o3 ' + this.endpointUrl) + + // console.log('========================================================= o4 ' + this.endpointUrl) -/* + /* if (window.performance.getEntriesByType) { if (window.performance.getEntriesByType('navigation')[0].type === 'reload') { + console.log('===== When reloaded ======================================= Close 2 ' + this.endpointUrl + ' : ' + this.rndseed) this.connectionManager.close() } } */ diff --git a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/ServerGraphics.mjs b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/ServerGraphics.mjs index 63a652f..f00f4f8 100644 --- a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/ServerGraphics.mjs +++ b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/Views/Servers/ServerGraphics.mjs @@ -2,9 +2,9 @@ import BasicScreen from '../GraphicSupport/BasicScreen.mjs' import EndpointGraphics from './EndpointGraphics.mjs' export default class ServerGraphics extends BasicScreen { - constructor (io, endpointTabGenerator) { + constructor (socket, endpointTabGenerator) { super('+') - this.socket = io + this.socket = socket this.endpointTabGenerator = endpointTabGenerator const makeLabel = function (text) { @@ -123,6 +123,7 @@ export default class ServerGraphics extends BasicScreen { newConnection.instantiate(point.address, socket) endpointTabGenerator.generateTab(newConnection, true) } + function disconnect (point, endpointTabGenerator) { endpointTabGenerator.close(point) } diff --git a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Assets/AssetManager.mjs b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Assets/AssetManager.mjs index 9157d12..66d8e5a 100644 --- a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Assets/AssetManager.mjs +++ b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Assets/AssetManager.mjs @@ -3,8 +3,8 @@ * a representation of the assets */ export class AssetManager { - constructor (addressSpace, socketHandler) { - this.socketHandler = socketHandler + constructor (addressSpace, connectionManager) { + this.socketHandler = connectionManager.socketHandler this.addressSpace = addressSpace this.counter = 0 } diff --git a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Client/NodeOPCUAInterface.mjs b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Client/NodeOPCUAInterface.mjs index a43c72b..7868370 100644 --- a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Client/NodeOPCUAInterface.mjs +++ b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Javascripts/ijt-support/Client/NodeOPCUAInterface.mjs @@ -110,14 +110,28 @@ export class NodeOPCUAInterface { connectionObject.translateBrowsePath(callid, nodeId, path) }) - socket.on('terminate connection', (endpoint) => { - console.log('Recieving terminate session request (' + endpoint + ')') - const connectionObject = this.connectionList[endpoint] + socket.on('terminate connection', (endpointUrl) => { + console.log('**********************************************------------------------') + console.log('Recieving terminate session request (' + endpointUrl + ')') + const connectionObject = this.connectionList[endpointUrl] if (!connectionObject) { - console.log('Nodejs OPC UA client failed to find EndpointUrl ' + this.endpointUrl + ' for termination') + console.log('Nodejs OPC UA client failed to find EndpointUrl ' + endpointUrl + ' for termination') return } connectionObject.closeConnection() + this.connectionList[endpointUrl] = null + }) + + socket.on('disconnect from', endpointUrl => { + console.log('**********************************************------------------------') + console.log('Nodejs OPC UA client attempting to disconnect from ' + endpointUrl) + if (endpointUrl) { + const connection = this.connectionList[endpointUrl] + if (connection) { + connection.closeConnection() + } + this.connectionList[endpointUrl] = null + } }) socket.on('get connectionpoints', () => { @@ -142,18 +156,6 @@ export class NodeOPCUAInterface { } }) - socket.on('disconnect from', endpointUrl => { - console.log('**********************************************') - console.log('Nodejs OPC UA client attempting to disconnect from ' + endpointUrl) - if (endpointUrl) { - const connection = this.connectionList[endpointUrl] - if (connection) { - connection.closeConnection() - } - this.connectionList[endpointUrl] = null - } - }) - socket.on('subscribe event', (endpoint, msg, subscriberDetails) => { // console.log('Nodejs OPC UA client attempting to subscribe to ' + msg) const connectionObject = this.connectionList[endpoint] @@ -457,8 +459,10 @@ class Connection { console.log('Disconnect client. (' + this.endpointUrl + ')') if (this.client) { this.client.disconnect(function () { - console.log('Client disconnected.\n**********************************************') - this.io.emit('client disconnected', { endpointurl: this.endpointUrl }) + console.log('Client disconnected.\n=========================================') + if (this && this.io) { + this.io.emit('client disconnected', { endpointurl: this.endpointUrl }) + } }) } } catch (err) { diff --git a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Resources/connectionpoints.json b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Resources/connectionpoints.json index 4a3606b..d119515 100644 --- a/OPC_UA_Clients/NodeOPCUA_IJT_Client/Resources/connectionpoints.json +++ b/OPC_UA_Clients/NodeOPCUA_IJT_Client/Resources/connectionpoints.json @@ -1 +1 @@ -{"connectionpoints":[{"name":"Local","address":"opc.tcp://127.0.0.1:40451","autoconnect":false},{"name":"Windows simulation","address":"opc.tcp://10.46.19.106:40451","autoconnect":true},{"name":"ICB-A","address":"opc.tcp://10.46.16.68:40451","autoconnect":false},{"name":"PF80000","address":"opc.tcp://10.46.16.174:40451","autoconnect":false}]} \ No newline at end of file +{"connectionpoints":[{"name":"Local","address":"opc.tcp://127.0.0.1:40451","autoconnect":true},{"name":"Windows simulation","address":"opc.tcp://10.46.19.106:40451","autoconnect":true},{"name":"ICB-A","address":"opc.tcp://10.46.16.68:40451","autoconnect":false},{"name":"PF80000","address":"opc.tcp://10.46.16.174:40451","autoconnect":false}]} \ No newline at end of file diff --git a/OPC_UA_Clients/NodeOPCUA_IJT_Client/index.html b/OPC_UA_Clients/NodeOPCUA_IJT_Client/index.html index 8a28f49..45ea16d 100644 --- a/OPC_UA_Clients/NodeOPCUA_IJT_Client/index.html +++ b/OPC_UA_Clients/NodeOPCUA_IJT_Client/index.html @@ -36,17 +36,27 @@ import TabGenerator from 'views/GraphicSupport/TabGenerator.mjs' import EndpointGraphics from 'views/Servers/EndpointGraphics.mjs' - // Set up essentials + // Set up websocket to the server var socket = io() + // Create background const baseDiv = document.createElement('div') baseDiv.classList.add('startScreen') document.body.appendChild(baseDiv) + + //create the top tab handler const tabGenerator = new TabGenerator(baseDiv, 'topLevelTabSelector') + // Create the server management tab const servers = new ServerGraphics(socket, tabGenerator) tabGenerator.generateTab(servers) + // Ensure all connections are closed when leaving page or refreshing it + window.onbeforeunload = function (event) { + tabGenerator.close() + // event.returnValue = 'test' + } +