-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joakim Gustafsson
committed
Jun 7, 2024
1 parent
f47cb26
commit 74aabb0
Showing
7 changed files
with
121 additions
and
81 deletions.
There are no files selected for viewing
74 changes: 0 additions & 74 deletions
74
OPC_UA_Clients/Release2/IJT_Web_Client/Javascripts/Views/Demo/USDemoSettings.mjs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
OPC_UA_Clients/Release2/IJT_Web_Client/Javascripts/Views/Servers/Settings.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import BasicScreen from '../GraphicSupport/BasicScreen.mjs' // Basic functionality application code for the screen functionality | ||
|
||
/** | ||
* The purpose of this class is to generate an HTML representation of tightening selection and basic | ||
* display of a result for OPC UA Industrial Joining Technologies communication | ||
*/ | ||
export default class Settings extends BasicScreen { | ||
constructor (webSocketManager) { | ||
super('Settings', 'tighteningsystem') | ||
|
||
this.webSocketManager = webSocketManager | ||
this.productId = 'www.atlascopco.com/CABLE-B0000000-' | ||
this.JoiningProcess1 = 'ProgramIndex_1' | ||
this.JoiningProcess2 = 'ProgramIndex_2' | ||
|
||
// Listen to the tree of possible connection points (Available OPC UA servers) | ||
this.webSocketManager.subscribe(null, 'get settings', (msg) => { | ||
this.settings = msg | ||
this.productId = msg.productid | ||
this.JoiningProcess1 = msg.button1selection | ||
this.JoiningProcess2 = msg.button2selection | ||
|
||
this.container.innerHTML = '' | ||
|
||
const labelElement = document.createElement('label') | ||
labelElement.innerHTML = 'ProductId ' | ||
this.container.appendChild(labelElement) | ||
|
||
this.createInput(this.productId, this.container, (evt) => { | ||
this.productId = evt.srcElement.value | ||
}, '40') | ||
this.container.appendChild(document.createElement('br')) | ||
|
||
const labelElement2 = document.createElement('label') | ||
labelElement2.innerHTML = 'Button 1 selection ' | ||
this.container.appendChild(labelElement2) | ||
|
||
this.createInput(this.JoiningProcess1, this.container, (evt) => { | ||
this.JoiningProcess1 = evt.srcElement.value | ||
console.log(evt.srcElement.value) | ||
}, '40') | ||
this.container.appendChild(document.createElement('br')) | ||
|
||
const labelElement3 = document.createElement('label') | ||
labelElement3.innerHTML = 'Button 2 selection ' | ||
this.container.appendChild(labelElement3) | ||
|
||
this.createInput(this.JoiningProcess2, this.container, (evt) => { | ||
this.JoiningProcess2 = evt.srcElement.value | ||
}, '40') | ||
}) | ||
|
||
this.webSocketManager.send('get settings') | ||
|
||
this.fadeList = {} | ||
this.fadeTime = 10000 | ||
this.fadeSteps = 5 | ||
|
||
this.refreshTraceCallbackFade = (trace, traceOwner) => { | ||
const fadeFunc = () => { | ||
if (trace.fadeCounter < 1) { | ||
traceOwner.deleteSelected(trace) | ||
this.fadeList[trace.resultId] = false | ||
} else { | ||
trace.fadeCounter-- | ||
trace.fade(1 / (this.fadeSteps + 1)) | ||
setTimeout(fadeFunc, this.fadeTime / this.fadeSteps) | ||
} | ||
} | ||
const currentCounter = this.fadeList[trace.resultId] | ||
if (!currentCounter) { | ||
this.fadeList[trace.resultId] = true | ||
trace.fadeCounter = this.fadeSteps | ||
setTimeout(fadeFunc, this.fadeTime / this.fadeSteps) | ||
} | ||
} | ||
|
||
this.refreshTraceCallback = (trace, traceOwner) => { | ||
traceOwner.deleteSelected(trace) | ||
} | ||
|
||
const editArea = document.createElement('div') | ||
editArea.classList.add('demosettingArea') | ||
this.backGround.appendChild(editArea) | ||
|
||
this.displayArea = document.createElement('div') | ||
this.backGround.appendChild(this.displayArea) | ||
|
||
this.container = editArea | ||
|
||
this.createButton('Save', this.displayArea, () => { | ||
this.settings.productId = this.productId | ||
this.settings.button1selection = this.JoiningProcess1 | ||
this.settings.button2selection = this.JoiningProcess2 | ||
|
||
this.webSocketManager.send('set settings', null, null, this.settings) | ||
}) | ||
|
||
// this.container.innerHTML += '<p>ProductId' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"productid": "www.atlascopco.com/CABLE-B0000000-", "button1selection": "ProgramIndex_1", "button2selection": "ProgramIndex_2", "productId": "www.atlascopco.com/CABLE-B0000000-", "command": "set settings", "endpoint": "common"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters