diff --git a/FloatingSpace/UiObject.js b/FloatingSpace/UiObject.js index 1d4596695..ff45c392d 100644 --- a/FloatingSpace/UiObject.js +++ b/FloatingSpace/UiObject.js @@ -257,198 +257,7 @@ function newUiObject () { let compatibleTypes let compatibleSubTypes switch (thisObject.payload.node.type) { - case 'Sensor Bot': - compatibleTypes = '->' + 'Team' + '->' - compatibleSubTypes = undefined - break - case 'Indicator Bot': - compatibleTypes = '->' + 'Team' + '->' - compatibleSubTypes = undefined - break - case 'Trading Bot': - compatibleTypes = '->' + 'Team' + '->' - compatibleSubTypes = undefined - break - case 'Process Definition': - compatibleTypes = '->' + 'Sensor Bot' + '->' + 'Indicator Bot' + '->' + 'Trading Bot' + '->' - compatibleSubTypes = undefined - break - case 'Process Output': - compatibleTypes = '->' + 'Process Definition' + '->' - compatibleSubTypes = undefined - break - case 'Process Dependencies': - compatibleTypes = '->' + 'Process Definition' + '->' - compatibleSubTypes = undefined - break - case 'Status Report': - compatibleTypes = '->' + 'Process Definition' + '->' - compatibleSubTypes = undefined - break - case 'Execution Started Event': - compatibleTypes = '->' + 'Process Definition' + '->' - compatibleSubTypes = undefined - break - case 'Execution Finished Event': - compatibleTypes = '->' + 'Process Definition' + '->' - compatibleSubTypes = undefined - break - case 'Calculations Procedure': - compatibleTypes = '->' + 'Product Definition' + '->' - compatibleSubTypes = undefined - break - case 'Data Building Procedure': - compatibleTypes = '->' + 'Product Definition' + '->' - compatibleSubTypes = undefined - break - case 'Procedure Initialization': - compatibleTypes = '->' + 'Calculations Procedure' + '->' + 'Data Building Procedure' + '->' - compatibleSubTypes = undefined - break - case 'Procedure Loop': - compatibleTypes = '->' + 'Calculations Procedure' + '->' + 'Data Building Procedure' + '->' - compatibleSubTypes = undefined - break - case 'Output Dataset': - compatibleTypes = '->' + 'Process Output' + '->' - compatibleSubTypes = undefined - break - case 'Status Dependency': - compatibleTypes = '->' + 'Process Dependencies' + '->' - compatibleSubTypes = undefined - break - case 'Data Dependency': - compatibleTypes = '->' + 'Process Dependencies' + '->' - compatibleSubTypes = undefined - break - case 'Product Definition': - compatibleTypes = '->' + 'Sensor Bot' + '->' + 'Indicator Bot' + '->' + 'Trading Bot' + '->' - compatibleSubTypes = undefined - break - case 'Record Definition': - compatibleTypes = '->' + 'Product Definition' + '->' - compatibleSubTypes = undefined - break - case 'Record Property': - compatibleTypes = '->' + 'Record Definition' + '->' - compatibleSubTypes = undefined - break - case 'Dataset Definition': - compatibleTypes = '->' + 'Product Definition' + '->' - compatibleSubTypes = undefined - break - case 'Plotter': - compatibleTypes = '->' + 'Team' + '->' - compatibleSubTypes = undefined - break - case 'Plotter Module': - compatibleTypes = '->' + 'Plotter' + '->' - compatibleSubTypes = undefined - break - case 'Trading System': - compatibleTypes = '->' + 'Definition' + '->' - compatibleSubTypes = undefined - break - case 'Personal Data': - compatibleTypes = '->' + 'Definition' + '->' - compatibleSubTypes = undefined - break - case 'Network Node': - compatibleTypes = '->' + 'Network' + '->' - compatibleSubTypes = undefined - break - case 'Exchange Account': - compatibleTypes = '->' + 'Personal Data' + '->' - compatibleSubTypes = undefined - break - case 'Exchange Account Asset': - compatibleTypes = '->' + 'Exchange Account' + '->' - compatibleSubTypes = undefined - break - case 'Exchange Account Key': - compatibleTypes = '->' + 'Exchange Account' + '->' + 'Parameters' + '->' - compatibleSubTypes = undefined - break - case 'Parameters': - compatibleTypes = '->' + 'Trading System' + '->' + 'Backtesting Session' + '->' + 'Live Trading Session' + '->' + 'Paper Trading Session' + '->' + 'Fordward Testing Session' + '->' - compatibleSubTypes = '->' + 'Trading Process Instance' + '->' - break - case 'Backtesting Session': - compatibleTypes = '->' + 'Process Instance' + '->' - compatibleSubTypes = '->' + 'Trading Process Instance' + '->' - break - case 'Live Trading Session': - compatibleTypes = '->' + 'Process Instance' + '->' - compatibleSubTypes = '->' + 'Trading Process Instance' + '->' - break - case 'Paper Trading Session': - compatibleTypes = '->' + 'Process Instance' + '->' - compatibleSubTypes = '->' + 'Trading Process Instance' + '->' - break - case 'Fordward Testing Session': - compatibleTypes = '->' + 'Process Instance' + '->' - compatibleSubTypes = '->' + 'Trading Process Instance' + '->' - break - case 'Base Asset': - compatibleTypes = '->' + 'Parameters' + '->' - compatibleSubTypes = undefined - break - case 'Time Range': - compatibleTypes = '->' + 'Parameters' + '->' - compatibleSubTypes = undefined - break - case 'Time Period': - compatibleTypes = '->' + 'Parameters' + '->' - compatibleSubTypes = undefined - break - case 'Slippage': - compatibleTypes = '->' + 'Parameters' + '->' - compatibleSubTypes = undefined - break - case 'Fee Structure': - compatibleTypes = '->' + 'Parameters' + '->' - compatibleSubTypes = undefined - break - case 'Layer Manager': - compatibleTypes = '->' + 'Backtesting Session' + '->' + 'Live Trading Session' + '->' + 'Paper Trading Session' + '->' + 'Fordward Testing Session' + '->' - compatibleSubTypes = undefined - break - case 'Layer': - compatibleTypes = '->' + 'Layer Manager' + '->' - compatibleSubTypes = undefined - break - case 'Social Bots': - compatibleTypes = '->' + 'Backtesting Session' + '->' + 'Live Trading Session' + '->' + 'Paper Trading Session' + '->' + 'Fordward Testing Session' + '->' - compatibleSubTypes = undefined - break - case 'Telegram Bot': - compatibleTypes = '->' + 'Social Bots' + '->' - compatibleSubTypes = undefined - break - case 'Announcement': - compatibleTypes = '->' + 'Telegram Bot' + '->' + 'Trigger On Event' + '->' + 'Trigger Off Event' + '->' + 'Take Position Event' + '->' + 'Next Phase Event' + '->' + '->' + 'Phase' + '->' - compatibleSubTypes = undefined - break - case 'Task Manager': - compatibleTypes = '->' + 'Network Node' + '->' - compatibleSubTypes = undefined - break - case 'Task': - compatibleTypes = '->' + 'Task Manager' + '->' - compatibleSubTypes = undefined - break - case 'Sensor Bot Instance': - compatibleTypes = '->' + 'Task' + '->' - compatibleSubTypes = undefined - break - case 'Indicator Bot Instance': - compatibleTypes = '->' + 'Task' + '->' - compatibleSubTypes = undefined - break - case 'Trading Bot Instance': - compatibleTypes = '->' + 'Task' + '->' - compatibleSubTypes = undefined - break + case 'Process Instance': switch (thisObject.payload.node.subType) { case 'Sensor Process Instance': { @@ -466,90 +275,7 @@ function newUiObject () { } compatibleSubTypes = undefined break - case 'Strategy': - compatibleTypes = '->' + 'Trading System' + '->' - compatibleSubTypes = undefined - break - case 'Trigger Stage': - compatibleTypes = '->' + 'Strategy' + '->' - compatibleSubTypes = undefined - break - case 'Open Stage': - compatibleTypes = '->' + 'Strategy' + '->' - compatibleSubTypes = undefined - break - case 'Manage Stage': - compatibleTypes = '->' + 'Strategy' + '->' - compatibleSubTypes = undefined - break - case 'Close Stage': - compatibleTypes = '->' + 'Strategy' + '->' - compatibleSubTypes = undefined - break - case 'Position Size': - compatibleTypes = '->' + 'Initial Definition' + '->' - compatibleSubTypes = undefined - break - case 'Position Rate': - compatibleTypes = '->' + 'Initial Definition' + '->' - compatibleSubTypes = undefined - break - case 'Take Position Event': - compatibleTypes = '->' + 'Trigger Stage' + '->' - compatibleSubTypes = undefined - break - case 'Trigger Off Event': - compatibleTypes = '->' + 'Trigger Stage' + '->' - compatibleSubTypes = undefined - break - case 'Trigger On Event': - compatibleTypes = '->' + 'Trigger Stage' + '->' - compatibleSubTypes = undefined - break - case 'Initial Definition': - compatibleTypes = '->' + 'Open Stage' + '->' - compatibleSubTypes = undefined - break - case 'Open Execution': - compatibleTypes = '->' + 'Open Stage' + '->' - compatibleSubTypes = undefined - break - case 'Close Execution': - compatibleTypes = '->' + 'Close Stage' + '->' - compatibleSubTypes = undefined - break - case 'Stop': - compatibleTypes = '->' + 'Manage Stage' + '->' + 'Initial Definition' + '->' - compatibleSubTypes = undefined - break - case 'Take Profit': - compatibleTypes = '->' + 'Manage Stage' + '->' + 'Initial Definition' + '->' - compatibleSubTypes = undefined - break - case 'Phase': - compatibleTypes = '->' + 'Stop' + '->' + 'Take Profit' + '->' + 'Phase' + '->' - compatibleSubTypes = undefined - break - case 'Formula': - compatibleTypes = '->' + 'Position Size' + '->' + 'Position Rate' + '->' + 'Phase' + '->' + 'Announcement' + '->' + 'Record Property' + '->' - compatibleSubTypes = undefined - break - case 'Next Phase Event': - compatibleTypes = '->' + 'Phase' + '->' - compatibleSubTypes = undefined - break - case 'Situation': - compatibleTypes = '->' + 'Take Position Event' + '->' + 'Trigger On Event' + '->' + 'Trigger Off Event' + '->' + 'Next Phase Event' + '->' - compatibleSubTypes = undefined - break - case 'Condition': - compatibleTypes = '->' + 'Situation' + '->' - compatibleSubTypes = undefined - break - case 'Javascript Code': - compatibleTypes = '->' + 'Condition' + '->' + 'Procedure Initialization' + '->' + 'Procedure Loop' + '->' + 'Plotter Module' + '->' + 'Plotter Panel' + '->' - compatibleSubTypes = undefined - break + default: let nodeDefinition = APP_SCHEMA_MAP.get(thisObject.payload.node.type) if (nodeDefinition !== undefined) { @@ -601,49 +327,7 @@ function newUiObject () { } if (mustContinue === true) { continue } } - /* Discard legacy objects with busy coonection ports */ - if (thisObject.payload.node.type === 'Status Report' && nearbyNode.statusReport !== undefined) { continue } - if (thisObject.payload.node.type === 'Execution Started Event' && nearbyNode.executionStartedEvent !== undefined) { continue } - if (thisObject.payload.node.type === 'Execution Finished Event' && nearbyNode.executionFinishedEvent !== undefined) { continue } - if (thisObject.payload.node.type === 'Calculations Procedure' && nearbyNode.calculations !== undefined) { continue } - if (thisObject.payload.node.type === 'Data Building Procedure' && nearbyNode.dataBuilding !== undefined) { continue } - if (thisObject.payload.node.type === 'Procedure Initialization' && nearbyNode.initialization !== undefined) { continue } - if (thisObject.payload.node.type === 'Procedure Loop' && nearbyNode.loop !== undefined) { continue } - if (thisObject.payload.node.type === 'Record Definition' && nearbyNode.record !== undefined) { continue } - if (thisObject.payload.node.type === 'Task' && nearbyNode.task !== undefined) { continue } - if (thisObject.payload.node.type === 'Sensor Bot Instance' && nearbyNode.bot !== undefined) { continue } - if (thisObject.payload.node.type === 'Indicator Bot Instance' && nearbyNode.bot !== undefined) { continue } - if (thisObject.payload.node.type === 'Trading Bot Instance' && nearbyNode.bot !== undefined) { continue } - if (thisObject.payload.node.type === 'Process Instance' && nearbyNode.process !== undefined) { continue } - if (thisObject.payload.node.type === 'Trading System' && nearbyNode.tradingSystem !== undefined) { continue } - if (thisObject.payload.node.type === 'Personal Data' && nearbyNode.personalData !== undefined) { continue } - if (thisObject.payload.node.type === 'Parameters' && nearbyNode.parameters !== undefined) { continue } - if (thisObject.payload.node.type === 'Backtesting Session' && nearbyNode.session !== undefined) { continue } - if (thisObject.payload.node.type === 'Live Trading Session' && nearbyNode.session !== undefined) { continue } - if (thisObject.payload.node.type === 'Fordward Testing Session' && nearbyNode.session !== undefined) { continue } - if (thisObject.payload.node.type === 'Paper Trading Session' && nearbyNode.session !== undefined) { continue } - if (thisObject.payload.node.type === 'Base Asset' && nearbyNode.baseAsset !== undefined) { continue } - if (thisObject.payload.node.type === 'Time Range' && nearbyNode.timeRange !== undefined) { continue } - if (thisObject.payload.node.type === 'Time Period' && nearbyNode.timePeriod !== undefined) { continue } - if (thisObject.payload.node.type === 'Slippage' && nearbyNode.slippage !== undefined) { continue } - if (thisObject.payload.node.type === 'Fee Structure' && nearbyNode.feeStructure !== undefined) { continue } - if (thisObject.payload.node.type === 'Trigger Stage' && nearbyNode.triggerStage !== undefined) { continue } - if (thisObject.payload.node.type === 'Open Stage' && nearbyNode.openStage !== undefined) { continue } - if (thisObject.payload.node.type === 'Manage Stage' && nearbyNode.manageStage !== undefined) { continue } - if (thisObject.payload.node.type === 'Close Stage' && nearbyNode.closeStage !== undefined) { continue } - if (thisObject.payload.node.type === 'Position Size' && nearbyNode.positionSize !== undefined) { continue } - if (thisObject.payload.node.type === 'Position Rate' && nearbyNode.positionRate !== undefined) { continue } - if (thisObject.payload.node.type === 'Take Position Event' && nearbyNode.takePosition !== undefined) { continue } - if (thisObject.payload.node.type === 'Trigger Off Event' && nearbyNode.triggerOff !== undefined) { continue } - if (thisObject.payload.node.type === 'Trigger On Event' && nearbyNode.triggerOn !== undefined) { continue } - if (thisObject.payload.node.type === 'Initial Definition' && nearbyNode.initialDefinition !== undefined) { continue } - if (thisObject.payload.node.type === 'Open Execution' && nearbyNode.openExecution !== undefined) { continue } - if (thisObject.payload.node.type === 'Close Execution' && nearbyNode.closeExecution !== undefined) { continue } - if (thisObject.payload.node.type === 'Stop' && nearbyNode.stopLoss !== undefined) { continue } - if (thisObject.payload.node.type === 'Take Profit' && nearbyNode.takeProfit !== undefined) { continue } - if (thisObject.payload.node.type === 'Formula' && nearbyNode.formula !== undefined) { continue } - if (thisObject.payload.node.type === 'Next Phase Event' && nearbyNode.nextPhaseEvent !== undefined) { continue } - if (thisObject.payload.node.type === 'Javascript Code' && nearbyNode.javascriptCode !== undefined) { continue } + /* Here we check if the subtypes are compatible. */ if (nearbyNode.subType !== undefined && compatibleSubTypes !== undefined) { if (compatibleSubTypes.indexOf('->' + nearbyNode.subType + '->') < 0) {