All Plotting Working

This commit is contained in:
Luis Fernando Molina committed 2020-06-16 20:41:08 +02:00
1 parent 6796745980
commit 283fe59ec1
5 files changed
+128 -28

No files matched your search

+19 -6
View File
@@ -9,24 +9,37 @@ function newNodesProgress () {
finalize: finalize
}
let rootNode
let hiriarchyMap
return thisObject
function finalize () {
rootNode = undefined
hiriarchyMap = undefined
}
function initialize (pRootNode) {
rootNode = pRootNode
let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
hiriarchyMap = getHiriarchyMap(rootNode)
}
function onRecordChange (currentRecord) {
evalNode(rootNode, currentRecord.array, 0, applyProgress)
if (currentRecord === undefined) { return }
let array = currentRecord.progress
if (array === undefined) { return }
for (let i = 0; i < array.length; i++) {
let arrayItem = array[0]
let nodeId = arrayItem[0]
let value = arrayItem[1]
applyValue(nodeId, value)
}
}
function applyProgress (node, value) {
function applyValue (nodeId, value) {
let node = hiriarchyMap.get(nodeId)
if (node.payload === undefined) { return }
if (node.payload.uiObject === undefined) { return }
node.payload.uiObject.setPercentage(node, value)
if (value === true) { value = 'true' }
if (value === false) { value = 'false' }
node.payload.uiObject.setPercentage(value, 30)
}
}