From 709353da7ca370922dde5484f37d8d0475b6bf06 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 30 Mar 2020 09:07:52 +0200 Subject: [PATCH] Includes Improved --- .../FunctionLibraries/UiObjectsFromNodes.js | 3 ++ DesignSpace/Workspace/Workspace.js | 39 ++----------------- FloatingSpace/UiObject.js | 6 ++- 3 files changed, 12 insertions(+), 36 deletions(-) diff --git a/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js b/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js index 62bf533f6..b2dfc641c 100644 --- a/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js +++ b/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/DesignSpace/Workspace/Workspace.js b/DesignSpace/Workspace/Workspace.js index 14321b3f3..928a8679d 100644 --- a/DesignSpace/Workspace/Workspace.js +++ b/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/FloatingSpace/UiObject.js b/FloatingSpace/UiObject.js index 86c66d73c..875fe2ecf 100644 --- a/FloatingSpace/UiObject.js +++ b/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() } }