diff --git a/Projects/Superalgos/Function-Libraries/CryptoEcosystemFunctions.js b/Projects/Superalgos/Function-Libraries/CryptoEcosystemFunctions.js index bfe824d6c..c9329af3c 100644 --- a/Projects/Superalgos/Function-Libraries/CryptoEcosystemFunctions.js +++ b/Projects/Superalgos/Function-Libraries/CryptoEcosystemFunctions.js @@ -17,7 +17,7 @@ function newCryptoEcosystemFunctions() { let cryptoExchanges = parent.cryptoExchanges[i] for (let j = 0; j < cryptoExchanges.exchanges.length; j++) { let exchange = cryptoExchanges.exchanges[j] - let codeName = loadPropertyFromNodeConfig(exchange.payload, 'codeName') + let codeName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(exchange.payload, 'codeName') currentExchanges.set(codeName, exchange) } } @@ -68,11 +68,11 @@ function newCryptoEcosystemFunctions() { let currentAssets = new Map() for (let j = 0; j < node.assets.length; j++) { let asset = node.assets[j] - let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName') + let codeName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(asset.payload, 'codeName') currentAssets.set(codeName, asset) } - let exchangeId = loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName') + let exchangeId = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName') try { let params = { @@ -86,7 +86,7 @@ function newCryptoEcosystemFunctions() { node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange') return } - let queryParams = loadPropertyFromNodeConfig(node.payload, 'addMissingAssetsFilter') + let queryParams = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'addMissingAssetsFilter') let markets = JSON.parse(data) for (let i = 0; i < markets.length; i++) { @@ -136,7 +136,7 @@ function newCryptoEcosystemFunctions() { let exchangeAssets = node.payload.parentNode.exchangeAssets for (let j = 0; j < exchangeAssets.assets.length; j++) { let asset = exchangeAssets.assets[j] - let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName') + let codeName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(asset.payload, 'codeName') currentAssets.set(codeName, asset) } @@ -144,11 +144,11 @@ function newCryptoEcosystemFunctions() { let exchangeMarkets = node for (let j = 0; j < exchangeMarkets.markets.length; j++) { let asset = exchangeMarkets.markets[j] - let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName') + let codeName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(asset.payload, 'codeName') currentMarkets.set(codeName, asset) } - let exchangeId = loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName') + let exchangeId = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName') try { let params = { diff --git a/Projects/Superalgos/Function-Libraries/TaskFunctions.js b/Projects/Superalgos/Function-Libraries/TaskFunctions.js index 05b32ca92..b13af9c9a 100644 --- a/Projects/Superalgos/Function-Libraries/TaskFunctions.js +++ b/Projects/Superalgos/Function-Libraries/TaskFunctions.js @@ -231,17 +231,17 @@ function newTaskFunctions() { } let networkNode = taskManager.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode - if (loadPropertyFromNodeConfig(networkNode.payload, 'host') === undefined) { + if (UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(networkNode.payload, 'host') === undefined) { node.payload.uiObject.setErrorMessage('Network Node needs to have a valid Host property at its config.') return } - if (loadPropertyFromNodeConfig(networkNode.payload, 'webPort') === undefined) { + if (UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(networkNode.payload, 'webPort') === undefined) { node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webPort property at its config.') return } - if (loadPropertyFromNodeConfig(networkNode.payload, 'webSocketsPort') === undefined) { + if (UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(networkNode.payload, 'webSocketsPort') === undefined) { node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webSocketsPort property at its config.') return } diff --git a/Projects/Superalgos/Function-Libraries/WebhookFunctions.js b/Projects/Superalgos/Function-Libraries/WebhookFunctions.js index 15bd466ff..daa51483c 100644 --- a/Projects/Superalgos/Function-Libraries/WebhookFunctions.js +++ b/Projects/Superalgos/Function-Libraries/WebhookFunctions.js @@ -6,8 +6,8 @@ function newWebhookFunctions() { return thisObject function sendTestMessage(node, callBackFunction) { - let testMessage = loadPropertyFromNodeConfig(node.payload, 'testMessage') - let letURL = loadPropertyFromNodeConfig(node.payload, 'webhookURL') + let testMessage = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'testMessage') + let letURL = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(node.payload, 'webhookURL') callWebServer(testMessage, letURL, onResponse) diff --git a/Projects/Superalgos/Spaces/Charting-Space/TimeMachine.js b/Projects/Superalgos/Spaces/Charting-Space/TimeMachine.js index c41bbd3c8..14ed6fbb1 100644 --- a/Projects/Superalgos/Spaces/Charting-Space/TimeMachine.js +++ b/Projects/Superalgos/Spaces/Charting-Space/TimeMachine.js @@ -660,7 +660,7 @@ function newTimeMachine() { position = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(position, thisObject.container) let label = thisObject.payload.node.name - let description = loadPropertyFromNodeConfig(thisObject.payload, 'description') + let description = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'description') if (description !== undefined) { label = description diff --git a/Projects/Superalgos/Spaces/Floating-Space/ConditionEditor.js b/Projects/Superalgos/Spaces/Floating-Space/ConditionEditor.js index e44173010..5f9cd2ca6 100644 --- a/Projects/Superalgos/Spaces/Floating-Space/ConditionEditor.js +++ b/Projects/Superalgos/Spaces/Floating-Space/ConditionEditor.js @@ -542,17 +542,17 @@ function newConditionEditor() { let rootNode = workspace.rootNodes[i] if (rootNode.type !== 'Data Mine') { continue } let dataMine = rootNode - let dataMineName = loadPropertyFromNodeConfig(dataMine.payload, 'codeName') + let dataMineName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(dataMine.payload, 'codeName') selector[dataMineName] = {} let bots = dataMine.sensorBots.concat(dataMine.indicatorBots) for (let j = 0; j < bots.length; j++) { let bot = bots[j] - let botName = loadPropertyFromNodeConfig(bot.payload, 'codeName') + let botName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(bot.payload, 'codeName') let selectorDataMine = selector[dataMineName] selectorDataMine[botName] = {} for (let k = 0; k < bot.products.length; k++) { let product = bot.products[k] - let productName = loadPropertyFromNodeConfig(product.payload, 'singularVariableName') + let productName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(product.payload, 'singularVariableName') if (productName === undefined) { continue } let selectorProduct = selectorDataMine[botName] selectorProduct[productName] = { @@ -561,11 +561,11 @@ function newConditionEditor() { if (product.record === undefined) { continue } for (let m = 0; m < product.record.properties.length; m++) { let property = product.record.properties[m] - let propertyName = loadPropertyFromNodeConfig(property.payload, 'codeName') + let propertyName = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(property.payload, 'codeName') let selectorProperty = selectorProduct[productName] selectorProperty = selectorProperty.properties selectorProperty[propertyName] = {} - let possibleValues = loadPropertyFromNodeConfig(property.payload, 'possibleValues') + let possibleValues = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(property.payload, 'possibleValues') if (possibleValues === undefined) { possibleValues = [] } let selectorPossibleValue = selectorProperty[propertyName] selectorPossibleValue.possibleValues = possibleValues @@ -573,7 +573,7 @@ function newConditionEditor() { let allPossibleTimeFrames = [] for (let m = 0; m < product.datasets.length; m++) { let dataset = product.datasets[m] - let validTimeFrames = loadPropertyFromNodeConfig(dataset.payload, 'validTimeFrames') + let validTimeFrames = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(dataset.payload, 'validTimeFrames') if (validTimeFrames !== undefined) { allPossibleTimeFrames = allPossibleTimeFrames.concat(validTimeFrames) } diff --git a/Projects/Superalgos/Spaces/Panel-Space/Layer.js b/Projects/Superalgos/Spaces/Panel-Space/Layer.js index 26cd2eb93..ced540286 100644 --- a/Projects/Superalgos/Spaces/Panel-Space/Layer.js +++ b/Projects/Superalgos/Spaces/Panel-Space/Layer.js @@ -321,7 +321,7 @@ function newLayer() { function checkStatusAtShutDown() { /* Mechanism to recover a layer that was left loading the last time the browser was shut dowm. */ - let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'status') + let storedValue = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'status') if (storedValue !== undefined) { if (storedValue === LAYER_STATUS.LOADING) { resetProgressBars() @@ -486,7 +486,7 @@ function newLayer() { if (thisObject.panels.length > 0) { panelsVisibleButton = newPanelsVisibleButton() - let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'showPanels') + let storedValue = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'showPanels') if (storedValue !== undefined) { if (storedValue === true || storedValue === false) { panelsVisibleButton.showPanels = storedValue @@ -498,7 +498,7 @@ function newLayer() { } } } else { - savePropertyAtNodeConfig(thisObject.payload, 'showPanels', panelsVisibleButton.showPanels) + UI.projects.superalgos.utilities.nodeConfig.savePropertyAtNodeConfig(thisObject.payload, 'showPanels', panelsVisibleButton.showPanels) } } } @@ -506,7 +506,7 @@ function newLayer() { function statusPhysics() { /* We retrieve the stored status at the config. */ try { - let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'status') + let storedValue = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'status') if (storedValue !== undefined) { if (storedValue !== thisObject.status) { @@ -547,7 +547,7 @@ function newLayer() { } } - savePropertyAtNodeConfig(thisObject.payload, 'status', thisObject.status) + UI.projects.superalgos.utilities.nodeConfig.savePropertyAtNodeConfig(thisObject.payload, 'status', thisObject.status) let eventData = thisObject thisObject.container.eventHandler.raiseEvent('Status Changed', eventData) } @@ -648,13 +648,13 @@ function newLayer() { UI.projects.superalgos.utilities.drawPrint.roundedCornersBackground(params) - let parentLabel1FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label1FontSize') - let parentLabel2FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label2FontSize') - let parentLabel3FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label3FontSize') + let parentLabel1FontSize = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label1FontSize') + let parentLabel2FontSize = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label2FontSize') + let parentLabel3FontSize = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label3FontSize') - let label1FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label1FontSize') - let label2FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label2FontSize') - let label3FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label3FontSize') + let label1FontSize = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'label1FontSize') + let label2FontSize = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'label2FontSize') + let label3FontSize = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'label3FontSize') if (parentLabel1FontSize !== undefined) { label1FontSize = parentLabel1FontSize diff --git a/Projects/Superalgos/Spaces/Panel-Space/LayersPanel.js b/Projects/Superalgos/Spaces/Panel-Space/LayersPanel.js index d50d348b8..050fa9946 100644 --- a/Projects/Superalgos/Spaces/Panel-Space/LayersPanel.js +++ b/Projects/Superalgos/Spaces/Panel-Space/LayersPanel.js @@ -110,7 +110,7 @@ function newLayersPanel() { } function saveObjectStateVisibleLayers() { - savePropertyAtNodeConfig(thisObject.payload, 'visibleLayers', desiredVisibleLayers) + UI.projects.superalgos.utilities.nodeConfig.savePropertyAtNodeConfig(thisObject.payload, 'visibleLayers', desiredVisibleLayers) } function saveObjectStatePanelLocation() { @@ -118,13 +118,13 @@ function newLayersPanel() { upOrDown: thisObject.upDownButton.status, leftOrRight: thisObject.leftRightButton.status } - savePropertyAtNodeConfig(thisObject.payload, 'panelLocation', panelLocation) + UI.projects.superalgos.utilities.nodeConfig.savePropertyAtNodeConfig(thisObject.payload, 'panelLocation', panelLocation) } function readObjectState() { let storedValue - storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'visibleLayers') + storedValue = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'visibleLayers') if (isNaN(storedValue) || storedValue === null || storedValue === undefined) { // not using this value @@ -143,7 +143,7 @@ function newLayersPanel() { } } - storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'panelLocation') + storedValue = UI.projects.superalgos.utilities.nodeConfig.loadPropertyFromNodeConfig(thisObject.payload, 'panelLocation') if (storedValue === null || storedValue === undefined) { // not using this value