Network as root node part 1
This commit is contained in:
1 parent
939e111b00
commit
30800639a5
2 files changed
+18
-24
No files matched your search
@@ -148,16 +148,13 @@ function newWorkspace () {
|
||||
function stopAllRunningTasks () {
|
||||
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = thisObject.workspaceNode.rootNodes[i]
|
||||
if (rootNode.type === 'Definition') {
|
||||
let definition = rootNode
|
||||
if (definition.network !== undefined) {
|
||||
if (definition.network.networkNodes !== undefined) {
|
||||
for (let j = 0; j < definition.network.networkNodes.length; j++) {
|
||||
let networkNode = definition.network.networkNodes[j]
|
||||
for (let i = 0; i < networkNode.taskManagers.length; i++) {
|
||||
let taskManager = networkNode.taskManagers[i]
|
||||
taskManager.payload.uiObject.menu.internalClick('Stop All Tasks')
|
||||
}
|
||||
if (rootNode.type === 'Network') {
|
||||
if (rootNode.networkNodes !== undefined) {
|
||||
for (let j = 0; j < rootNode.networkNodes.length; j++) {
|
||||
let networkNode = rootNode.networkNodes[j]
|
||||
for (let i = 0; i < networkNode.taskManagers.length; i++) {
|
||||
let taskManager = networkNode.taskManagers[i]
|
||||
taskManager.payload.uiObject.menu.internalClick('Stop All Tasks')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,19 +166,16 @@ function newWorkspace () {
|
||||
let tradingBotInstances = []
|
||||
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = thisObject.workspaceNode.rootNodes[i]
|
||||
if (rootNode.type === 'Definition') {
|
||||
let definition = rootNode
|
||||
if (definition.network !== undefined) {
|
||||
if (definition.network.networkNodes !== undefined) {
|
||||
for (let j = 0; j < definition.network.networkNodes.length; j++) {
|
||||
let networkNode = definition.network.networkNodes[j]
|
||||
for (let i = 0; i < networkNode.taskManagers.length; i++) {
|
||||
let taskManager = networkNode.taskManagers[i]
|
||||
for (k = 0; k < taskManager.tasks.length; k++) {
|
||||
let task = taskManager.tasks[k]
|
||||
if (task.bot.type === 'Trading Bot Instance') {
|
||||
tradingBotInstances.push(task.bot)
|
||||
}
|
||||
if (rootNode.type === 'Network') {
|
||||
if (rootNode.networkNodes !== undefined) {
|
||||
for (let j = 0; j < rootNode.networkNodes.length; j++) {
|
||||
let networkNode = rootNode.networkNodes[j]
|
||||
for (let i = 0; i < networkNode.taskManagers.length; i++) {
|
||||
let taskManager = networkNode.taskManagers[i]
|
||||
for (k = 0; k < taskManager.tasks.length; k++) {
|
||||
let task = taskManager.tasks[k]
|
||||
if (task.bot.type === 'Trading Bot Instance') {
|
||||
tradingBotInstances.push(task.bot)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1034,7 +1034,7 @@ function newUiObject () {
|
||||
|
||||
browserCanvasContext.fill()
|
||||
|
||||
if (thisObject.payload.node.type === 'Definition') {
|
||||
if (thisObject.payload.node.type === 'Definition' || thisObject.payload.node.type === 'Network') {
|
||||
VISIBLE_RADIUS = thisObject.container.frame.radius * 2
|
||||
let OPACITY = 1
|
||||
|
||||
|
||||
Reference in new issue
Block a user