Bug Fixes

This commit is contained in:
Luis Fernando Molina committed 2020-09-16 12:51:09 +02:00
1 parent cb9b0ce904
commit 1daf5a583f
7 files changed
+66 -7

No files matched your search

+16
View File
@@ -142,6 +142,7 @@ function newTimeMachine() {
function initialize(callBackFunction) {
timeFrame = INITIAL_TIME_PERIOD
loadFrame(thisObject.payload, thisObject.container.frame)
setInitialPosition()
saveFrame(thisObject.payload, thisObject.container.frame)
recalculateCoordinateSystem()
@@ -158,6 +159,21 @@ function newTimeMachine() {
callBackFunction()
}
function setInitialPosition() {
let centerOfScreenX = browserCanvas.width / 2 - browserCanvas.width / TIME_MACHINE_WIDTH / 2
let centerOfScreenY = browserCanvas.height / 2 - (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT / 2
if (thisObject.container.frame.position.x === 0 && thisObject.container.frame.position.y === 0) {
let timeMachineIndex = findChildIndexAtParentNode(thisObject.payload.node)
let dashboardIndex = findChildIndexAtParentNode(thisObject.payload.parentNode)
let timeMachinesCount = thisObject.payload.parentNode.timeMachines.length
let dashboardsCount = thisObject.payload.parentNode.payload.parentNode.dashboards.length
thisObject.container.frame.position.x = centerOfScreenX + thisObject.container.frame.width * timeMachineIndex * 2 - timeMachinesCount * thisObject.container.frame.width
thisObject.container.frame.position.y = centerOfScreenY + thisObject.container.frame.height * dashboardIndex * 2 - dashboardsCount * thisObject.container.frame.height
}
}
function onKeyPressed(event) {
thisObject.edgeEditor.onKeyPressed(event)
}
@@ -112,7 +112,7 @@ function newChartingSpaceFunctions() {
let mineProducts
let timeMachine = functionLibraryUiObjectsFromNodes.addUIObject(dashboard, 'Time Machine')
timeMachine.payload.referenceParent = session
timeMachine.name = session.name + ' ' + session.type
timeMachine.name = session.name + ' ' + session.type + ' ' + networkNode.name
timeMachine.payload.floatingObject.collapseToggle()
timeMachine.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
/*
@@ -377,7 +377,7 @@ function newCryptoEcosystemFunctions() {
for (let i = 0; i < timeMachines.length; i++) {
let timeMachine = timeMachines[i]
let session = timeMachine.payload.referenceParent
if (session === undefined) {
if (session === undefined || session.cleaned === true) {
/*
This is what usually happens, that the intall process make these
time machines to lose their reference parent since the install
+3 -2
View File
@@ -162,8 +162,9 @@ function newLayer() {
'Data Product->' +
'Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->' +
'Bot Products->Data Mine Products->Trading Mine Products->' +
'Market Data Products->Single Market Trading Data->Exchange Data Products->' +
'Session Reference->Data Mines Data->Trading Mines Data->Exchange Trading Products->Trading Mines Data->Data Storage->Network Node->' +
'Market Data Products->Exchange Data Products->' +
'Market Trading Products->Session Reference->Exchange Trading Products->' +
'Data Mines Data->Trading Mines Data->Data Storage->Network Node->' +
'Data Storage->Network Node->' +
'Backtesting Session->Paper Trading Session->Forward Testing Session->Live Trading Session->' +
'Trading System Reference->Trading Engine Reference->Trading System->Trading Engine->' +
-2
View File
@@ -345,8 +345,6 @@ function newChartingSpace() {
timeMachine.payload.uiObject.setValue('Loading...')
/* Setting up the new time machine. */
timeMachine.container.frame.position.x = browserCanvas.width / 2 - browserCanvas.width / TIME_MACHINE_WIDTH / 2
timeMachine.container.frame.position.y = browserCanvas.height / 2 - (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT / 2
timeMachine.initialize(onTimeMachineInitialized)
function onTimeMachineInitialized() {
+3 -1
View File
@@ -11,7 +11,9 @@ function findNodeInNodeMesh(node, nodeType, nodeName, connectedViaPayload, findI
function scanNodeMesh(startingNode, depth) {
if (startingNode === undefined) { return }
if (startingNode.payload === undefined) { return }
if (connectedViaPayload === true) {
if (startingNode.payload === undefined) { return }
}
if (nodeFound !== undefined) { return }
if (depth >= MAX_DEPTH) {return}
+42
View File
@@ -142,4 +142,46 @@ function findAndRecreateChildWithReference(startingNode, childType, referencedNo
child = functionLibraryUiObjectsFromNodes.addUIObject(startingNode, childType)
child.payload.referenceParent = referencedNode
return child
}
function findChildIndexAtParentNode(startingNode) {
/*
This functioin scan all the children of a node's parent and returns the child
index at the node property array that contains it.
*/
if (startingNode === undefined) { return }
if (startingNode.payload === undefined) { return }
if (startingNode.payload.parentNode === undefined) { return }
let parentNode = startingNode.payload.parentNode
let nodeDefinition = APP_SCHEMA_MAP.get(parentNode.type)
if (nodeDefinition === undefined) { return }
/* We scan through this parent node children */
if (nodeDefinition.properties !== undefined) {
for (let i = 0; i < nodeDefinition.properties.length; i++) {
let property = nodeDefinition.properties[i]
switch (property.type) {
case 'node': {
/* We ignore these types of children. */
}
break
case 'array': {
let startingNodePropertyArray = parentNode[property.name]
if (startingNodePropertyArray !== undefined) {
for (let m = 0; m < startingNodePropertyArray.length; m++) {
let arrayItem = startingNodePropertyArray[m]
if (arrayItem.id === startingNode.id) {
return m
}
}
}
break
}
}
}
}
}