diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js index 62bf533f6..b2dfc641c 100644 --- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js +++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js @@ -55,6 +55,7 @@ function newUiObjectsFromNodes () { } } } + receivedNode.isIncluded = true node.rootNodes.push(receivedNode) totalIncluded++ if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) { @@ -83,6 +84,7 @@ function newUiObjectsFromNodes () { } } } + receivedNode.isIncluded = true node.rootNodes.push(receivedNode) totalIncluded++ if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) { @@ -111,6 +113,7 @@ function newUiObjectsFromNodes () { } } } + receivedNode.isIncluded = true node.rootNodes.push(receivedNode) totalIncluded++ if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) { diff --git a/CanvasApp/DesignSpace/Workspace/Workspace.js b/CanvasApp/DesignSpace/Workspace/Workspace.js index 14321b3f3..928a8679d 100644 --- a/CanvasApp/DesignSpace/Workspace/Workspace.js +++ b/CanvasApp/DesignSpace/Workspace/Workspace.js @@ -169,44 +169,13 @@ function newWorkspace () { } function stringifyWorkspace (removePersonalData) { - let code - if (thisObject.workspaceNode.code === undefined) { - thisObject.workspaceNode.code = '{ \n"includeDataMines": ["Masters", "Sparta", "TradingEngines"],\n"includeTradingSystems": ["WHB-BTC-USDT", "WHB-ETH-USDT", "BRR-BTC-USDT"],\n"includeSuperScripts": ["Superalgos"]\n }' - } - code = JSON.parse(thisObject.workspaceNode.code) - let includeDataMines = code.includeDataMines - let includeTradingSystems = code.includeTradingSystems - let includeSuperScripts = code.includeSuperScripts - let stringifyReadyNodes = [] for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) { let rootNode = thisObject.workspaceNode.rootNodes[i] - let node = functionLibraryProtocolNode.getProtocolNode(rootNode, removePersonalData, false, true, true, true) - if (node) { - switch (node.type) { - case 'Data Mine': { - code = JSON.parse(node.code) - if (includeDataMines.includes(code.codeName) === false) { - stringifyReadyNodes.push(node) - } - break - } - case 'Trading System': { - code = JSON.parse(node.code) - if (includeTradingSystems.includes(code.codeName) === false) { - stringifyReadyNodes.push(node) - } - break - } - case 'Super Scripts': { - code = JSON.parse(node.code) - if (includeSuperScripts.includes(code.codeName) === false) { - stringifyReadyNodes.push(node) - } - break - } - default: stringifyReadyNodes.push(node) - } + + if (rootNode.isIncluded !== true) { + let node = functionLibraryProtocolNode.getProtocolNode(rootNode, removePersonalData, false, true, true, true) + stringifyReadyNodes.push(node) } } let workspace = { diff --git a/CanvasApp/FloatingSpace/UiObject.js b/CanvasApp/FloatingSpace/UiObject.js index 86c66d73c..875fe2ecf 100644 --- a/CanvasApp/FloatingSpace/UiObject.js +++ b/CanvasApp/FloatingSpace/UiObject.js @@ -1537,7 +1537,11 @@ function newUiObject () { browserCanvasContext.closePath() browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + OPACITY + ')' browserCanvasContext.lineWidth = 1 - browserCanvasContext.setLineDash([20, 20]) + if (thisObject.payload.node.isIncluded === true) { + browserCanvasContext.setLineDash([0, 0]) + } else { + browserCanvasContext.setLineDash([20, 20]) + } browserCanvasContext.stroke() } } diff --git a/CanvasApp/Utilities.js b/CanvasApp/Utilities.js index 48750b49b..e9c85a67b 100644 --- a/CanvasApp/Utilities.js +++ b/CanvasApp/Utilities.js @@ -245,6 +245,7 @@ function removeTime (datetime) { } function printLabel (labelToPrint, x, y, opacity, fontSize, color, center, container, fitFunction, noDecimals) { + if (labelToPrint === undefined) { return } let labelPoint if (color === undefined) { color = UI_COLOR.DARK } if (fontSize === undefined) { fontSize = 10 }; diff --git a/WebServer/index.html b/WebServer/index.html index 73c9bc299..f70ea60e7 100644 --- a/WebServer/index.html +++ b/WebServer/index.html @@ -44,9 +44,14 @@ } function onResize() { - if (canvas === undefined) { return } - if (canvas.eventHandler === undefined) { return } - canvas.eventHandler.raiseEvent('Browser Resized') + try { + if (canvas === undefined) { return } + if (canvas.eventHandler === undefined) { return } + canvas.eventHandler.raiseEvent('Browser Resized') + } catch (err) { + + } + }