diff --git a/AppSchema.json b/AppSchema.json index 900d69518..447d1dda1 100644 --- a/AppSchema.json +++ b/AppSchema.json @@ -1446,13 +1446,7 @@ "label": "Add Tutorial", "relatedUiObject": "Tutorial", "actionFunction": "payload.onMenuItemClick" - }, - { - "action": "Add UI Object", - "label": "Add Plugins", - "relatedUiObject": "Plugins", - "actionFunction": "payload.onMenuItemClick" - } + } ], "isTitleAllwaysVisible": true, "addLeftIcons": false, @@ -14425,15 +14419,6 @@ "label": "Add Missing Children", "relatedUiObject": "Plugins", "actionFunction": "payload.onMenuItemClick" - }, - { - "action": "Delete UI Object", - "askConfirmation": true, - "confirmationLabel": "Confirm to Delete", - "label": "Delete", - "iconPathOn": "delete", - "iconPathOff": "delete", - "actionFunction": "payload.onMenuItemClick" } ], "isHierarchyHead": true, diff --git a/CanvasApp/Animation.js b/CanvasApp/Animation.js index 3be427501..c3ee45714 100644 --- a/CanvasApp/Animation.js +++ b/CanvasApp/Animation.js @@ -115,7 +115,7 @@ function newAnimation() { row = 0 for (const [key, timeConsumed] of performanceMap.entries()) { row++ - labelToPrint = key + ' ' + timeConsumed.toFixed(4) + let labelToPrint = key + ' ' + timeConsumed.toFixed(4) printLabel(labelToPrint, 10, 100 + row * 30, 1, 20, UI_COLOR.RED) let percentage = timeConsumed * 100 / totalTimeConsumed labelToPrint = key + ' ' + percentage.toFixed(1) + '%' diff --git a/CanvasApp/Canvas.js b/CanvasApp/Canvas.js index 148ba2160..9bd6d985b 100644 --- a/CanvasApp/Canvas.js +++ b/CanvasApp/Canvas.js @@ -73,29 +73,30 @@ function newCanvas() { thisObject.floatingSpace.finalize() thisObject.shorcutNumbers = undefined - browserCanvas.removeEventListener('mousedown', onMouseDown, false) - browserCanvas.removeEventListener('mouseup', onMouseUp, false) - browserCanvas.removeEventListener('mousemove', onMouseMove, false) - browserCanvas.removeEventListener('click', onMouseClick, false) - browserCanvas.removeEventListener('mouseout', onMouseOut, false) - if (browserCanvas.removeEventListener) { browserCanvas.removeEventListener('mousewheel', onMouseWheel, false)// IE9, Chrome, Safari, Opera browserCanvas.removeEventListener('DOMMouseScroll', onMouseWheel, false) // Firefox - } else browserCanvas.detachEvent('onmousewheel', onMouseWheel) // IE 6/7/8 - - browserCanvas.removeEventListener('dragenter', onDragEnter, false) - browserCanvas.removeEventListener('dragleave', onDragLeave, false) - browserCanvas.removeEventListener('dragover', onDragOver, false) - browserCanvas.removeEventListener('drop', onDragDrop, false) - - browserCanvas.removeEventListener('keydown', onKeyDown, false) - browserCanvas.removeEventListener('keyup', onKeyUp, false) + browserCanvas.removeEventListener('mousedown', onMouseDown, false) + browserCanvas.removeEventListener('mouseup', onMouseUp, false) + browserCanvas.removeEventListener('mousemove', onMouseMove, false) + browserCanvas.removeEventListener('click', onMouseClick, false) + browserCanvas.removeEventListener('mouseout', onMouseOut, false) + + browserCanvas.removeEventListener('dragenter', onDragEnter, false) + browserCanvas.removeEventListener('dragleave', onDragLeave, false) + browserCanvas.removeEventListener('dragover', onDragOver, false) + browserCanvas.removeEventListener('drop', onDragDrop, false) + + browserCanvas.removeEventListener('keydown', onKeyDown, false) + browserCanvas.removeEventListener('keyup', onKeyUp, false) + } else { + browserCanvas.detachEvent('onmousewheel', onMouseWheel) // IE 6/7/8 + } thisObject.splashScreen = undefined lastContainerMouseOver = undefined - hisObject.mouse = undefined + thisObject.mouse = undefined } catch (err) { if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) } } @@ -544,7 +545,7 @@ function newCanvas() { } else { /* After the warning, we allow the key to be re-assigned */ nodeUsingThisKey.payload.uiObject.shortcutKey = '' - nodeUsingThisKey === undefined + nodeUsingThisKey = undefined nodeOnFocus.payload.uiObject.shortcutKey = event.key nodeOnFocus.payload.uiObject.valueAtAngle = false nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + event.key) diff --git a/CanvasApp/ChartingSpace/TimeMachine.js b/CanvasApp/ChartingSpace/TimeMachine.js index 5ca3031da..5152aee44 100644 --- a/CanvasApp/ChartingSpace/TimeMachine.js +++ b/CanvasApp/ChartingSpace/TimeMachine.js @@ -645,8 +645,8 @@ function newTimeMachine() { } function drawLabel() { - if (thisObject.payload.node === undefined) { return } if (thisObject.payload === undefined) { return } + if (thisObject.payload.node === undefined) { return } /* Draw Title Above the Container */ let position = { x: 0, @@ -688,7 +688,7 @@ function newTimeMachine() { for (let j = 0; j < layers.length; j++) { let layer = layers[j] - exchangeMarket = { + let exchangeMarket = { exchangeName: layer.exchange.name, marketName: layer.market, exchangeIcon: layer.exchangeIcon, diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js index 66b356307..7948f8fdf 100644 --- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js +++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CryptoEcosystemFunctions.js @@ -331,7 +331,7 @@ function newCryptoEcosystemFunctions() { Create everything inside the session references. */ for (let j = 0; j < marketTradingProducts.sessionReferences.length; j++) { - sessionReference = marketTradingProducts.sessionReferences[j] + let sessionReference = marketTradingProducts.sessionReferences[j] menuClick(sessionReference, 'Add All Trading Mine Products', true) menuClickOfNodeArray(sessionReference.tradingMineProducts, 'Add All Data Products', true) sessionReference.payload.floatingObject.collapseToggle() diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js index 99b1d656f..f02631561 100644 --- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js +++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js @@ -119,8 +119,8 @@ function newNodeDeleter() { } function cleanNode(node) { - if (node.payload === undefined) { return } if (node === undefined) { return } + if (node.payload === undefined) { return } node.payload.targetPosition.x = undefined node.payload.targetPosition.y = undefined diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js index 1b8bdff6e..bbbed3985 100644 --- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js +++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js @@ -25,8 +25,7 @@ function newOnFocus() { case 'node': { if (property.name !== previousPropertyName) { if (node[property.name] !== undefined) { - let child - child = getNodeThatIsOnFocus(node[property.name]) + let child = getNodeThatIsOnFocus(node[property.name]) if (child !== undefined) { return child } @@ -39,7 +38,7 @@ function newOnFocus() { let nodePropertyArray = node[property.name] if (nodePropertyArray !== undefined) { for (let m = 0; m < nodePropertyArray.length; m++) { - child = getNodeThatIsOnFocus(nodePropertyArray[m]) + let child = getNodeThatIsOnFocus(nodePropertyArray[m]) if (child !== undefined) { return child } diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js index 5b8ffe35a..05ad18598 100644 --- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js +++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js @@ -19,7 +19,7 @@ function newReferenceAttachDetach() { } function completeDetachment(node) { - if (node.payload !== undefined !== undefined) { + if (node.payload !== undefined) { if (node.payload.referenceParent !== undefined) { if (node.payload.referenceParent.payload !== undefined) { if (node.payload.referenceParent.payload.uiObject !== undefined) { diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js index 94d7058eb..6d3a76aa5 100644 --- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js +++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js @@ -24,8 +24,7 @@ function newShortcutKeys() { case 'node': { if (property.name !== previousPropertyName) { if (node[property.name] !== undefined) { - let child - child = getNodeByShortcutKey(node[property.name], searchingKey) + let child = getNodeByShortcutKey(node[property.name], searchingKey) if (child !== undefined) { return child } @@ -38,7 +37,7 @@ function newShortcutKeys() { let nodePropertyArray = node[property.name] if (nodePropertyArray !== undefined) { for (let m = 0; m < nodePropertyArray.length; m++) { - child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey) + let child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey) if (child !== undefined) { return child } diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js index e13514eab..69706be31 100644 --- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js +++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js @@ -335,6 +335,7 @@ function newUiObjectsFromNodes() { if (nodeDefinition === undefined) { console.log('Cannot addUIOBject of ' + type + ' because that type it is not defined at the APP_SCHEMA.') + return } if (nodeDefinition.initialValues !== undefined) { @@ -384,14 +385,12 @@ function newUiObjectsFromNodes() { } } - if (nodeDefinition !== undefined) { - if (nodeDefinition.initialValues !== undefined) { - if (nodeDefinition.initialValues.code !== undefined) { - object.code = nodeDefinition.initialValues.code - } - if (nodeDefinition.initialValues.config !== undefined) { - object.config = nodeDefinition.initialValues.config - } + if (nodeDefinition.initialValues !== undefined) { + if (nodeDefinition.initialValues.code !== undefined) { + object.code = nodeDefinition.initialValues.code + } + if (nodeDefinition.initialValues.config !== undefined) { + object.config = nodeDefinition.initialValues.config } } diff --git a/CanvasApp/FloatingSpace/CodeEditor.js b/CanvasApp/FloatingSpace/CodeEditor.js index 09d615a80..0c3e21d80 100644 --- a/CanvasApp/FloatingSpace/CodeEditor.js +++ b/CanvasApp/FloatingSpace/CodeEditor.js @@ -185,7 +185,7 @@ function newCodeEditor() { browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY - if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) { + if (thisObject.currentRadius >= thisObject.targetRadius) { labelPoint = { x: iconPosition.x + thisObject.currentRadius + 10, y: iconPosition.y + fontSize * FONT_ASPECT_RATIO diff --git a/CanvasApp/FloatingSpace/ConfigEditor.js b/CanvasApp/FloatingSpace/ConfigEditor.js index dee760f94..8c29a1b51 100644 --- a/CanvasApp/FloatingSpace/ConfigEditor.js +++ b/CanvasApp/FloatingSpace/ConfigEditor.js @@ -190,7 +190,7 @@ function newConfigEditor() { browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY - if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) { + if (thisObject.currentRadius >= thisObject.targetRadius) { labelPoint = { x: iconPosition.x + thisObject.currentRadius + 10, y: iconPosition.y + fontSize * FONT_ASPECT_RATIO diff --git a/CanvasApp/FloatingSpace/FormulaEditor.js b/CanvasApp/FloatingSpace/FormulaEditor.js index e749b5c57..d663ea1a0 100644 --- a/CanvasApp/FloatingSpace/FormulaEditor.js +++ b/CanvasApp/FloatingSpace/FormulaEditor.js @@ -184,7 +184,7 @@ function newFormulaEditor() { browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY - if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) { + if (thisObject.currentRadius >= thisObject.targetRadius) { labelPoint = { x: iconPosition.x + thisObject.currentRadius + 10, y: iconPosition.y + fontSize * FONT_ASPECT_RATIO diff --git a/CanvasApp/FloatingSpace/Picker.js b/CanvasApp/FloatingSpace/Picker.js index 4d3a25759..9bf051871 100644 --- a/CanvasApp/FloatingSpace/Picker.js +++ b/CanvasApp/FloatingSpace/Picker.js @@ -71,10 +71,6 @@ function newPicker() { isMouseOver = false } - function getSelected() { - return optionsList[selected] - } - function setSelected(pOptionsList, pCurrent, pParent, pSelected) { if (pOptionsList !== undefined) { optionsList = pOptionsList diff --git a/CanvasApp/FloatingSpace/UiObject.js b/CanvasApp/FloatingSpace/UiObject.js index ec3c12ca5..01a08ca54 100644 --- a/CanvasApp/FloatingSpace/UiObject.js +++ b/CanvasApp/FloatingSpace/UiObject.js @@ -580,10 +580,8 @@ function newUiObject() { let THRESHOLD = 1.15 - if (previousDistanceToChainParent !== undefined) { - if (ratio > THRESHOLD) { - canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node) - } + if (ratio > THRESHOLD) { + canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node) } } @@ -675,9 +673,10 @@ function newUiObject() { function referenceDetachingPhysics() { if (isDragging !== true) { return } + if (thisObject.payload === undefined) { return } if (thisObject.payload.floatingObject.isFrozen === true) { return } if (rightDragging === false) { return } - if (thisObject.payload === undefined) { return } + if (thisObject.payload.referenceParent === undefined) { return } let distanceToReferenceParent = Math.sqrt(Math.pow(thisObject.payload.position.x - thisObject.payload.referenceParent.payload.position.x, 2) + Math.pow(thisObject.payload.position.y - thisObject.payload.referenceParent.payload.position.y, 2)) @@ -689,14 +688,11 @@ function newUiObject() { previousDistanceToReferenceParent = distanceToReferenceParent if (thisObject.isOnFocus !== true) { return } - if (thisObject.payload.referenceParent === undefined) { return } let THRESHOLD = 1.15 - if (previousDistanceToReferenceParent !== undefined) { - if (ratio > THRESHOLD) { - canvas.designSpace.workspace.referenceDetachNode(thisObject.payload.node) - } + if (ratio > THRESHOLD) { + canvas.designSpace.workspace.referenceDetachNode(thisObject.payload.node) } } @@ -1531,6 +1527,16 @@ function newUiObject() { label = addIndexNumber(label) if (label !== undefined) { + + if (canvas.floatingSpace.inMapMode === true) { + let nodeDefinition = getNodeDefinition(thisObject.payload.node) + if (nodeDefinition !== undefined) { + if (nodeDefinition.isHierarchyHead !== true) { + return + } + } + } + if (label.length > MAX_LABEL_LENGTH) { label = label.substring(0, MAX_LABEL_LENGTH) + '...' } @@ -1543,18 +1549,12 @@ function newUiObject() { } else { labelPoint = { x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5, - y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 1 + y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 1 } } if (canvas.floatingSpace.inMapMode === true) { - labelPoint.y = labelPoint.y - 20 - let nodeDefinition = getNodeDefinition(thisObject.payload.node) - if (nodeDefinition !== undefined) { - if (nodeDefinition.isHierarchyHead !== true) { - return - } - } + labelPoint.y = position.y + 50 / 2 + lineSeparator * 1 } browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY @@ -1600,7 +1600,7 @@ function newUiObject() { position = canvas.floatingSpace.transformPointToMap(position) } - let radius = thisObject.payload.floatingObject.container.frame.radius + let radius = thisObject.payload.floatingObject.container.frame.radius /* Label Text */ let labelPoint let fontSize = thisObject.payload.floatingObject.currentFontSize * 3 / 4 @@ -1661,10 +1661,10 @@ function newUiObject() { position = canvas.floatingSpace.transformPointToMap(position) } - let radius = thisObject.payload.floatingObject.container.frame.radius + let radius = thisObject.payload.floatingObject.container.frame.radius /* Label Text */ let labelPoint - let fontSize = thisObject.payload.floatingObject.currentFontSize + let fontSize = thisObject.payload.floatingObject.currentFontSize let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2 let label @@ -1732,10 +1732,10 @@ function newUiObject() { position = canvas.floatingSpace.transformPointToMap(position) } - let radius = thisObject.payload.floatingObject.container.frame.radius + let radius = thisObject.payload.floatingObject.container.frame.radius /* Label Text */ let labelPoint - let fontSize = thisObject.payload.floatingObject.currentFontSize + let fontSize = thisObject.payload.floatingObject.currentFontSize let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2 let label @@ -1744,27 +1744,26 @@ function newUiObject() { label = Number(currentPercentage).toFixed(0) + '%' - if (label !== undefined) { - if (label.length > MAX_LABEL_LENGTH) { - label = label.substring(0, MAX_LABEL_LENGTH) + '...' - } - - if (thisObject.isOnFocus === true) { - labelPoint = { - x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5, - y: position.y + radius * 2 / 3 + lineSeparator * 4 + 15 - } - } else { - labelPoint = { - x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10, - y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 4 - } - } - - browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY - browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)' - browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y) + if (label.length > MAX_LABEL_LENGTH) { + label = label.substring(0, MAX_LABEL_LENGTH) + '...' } + + if (thisObject.isOnFocus === true) { + labelPoint = { + x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5, + y: position.y + radius * 2 / 3 + lineSeparator * 4 + 15 + } + } else { + labelPoint = { + x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10, + y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 4 + } + } + + browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY + browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)' + browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y) + } } @@ -1783,7 +1782,7 @@ function newUiObject() { position = canvas.floatingSpace.transformPointToMap(position) } - let radius = thisObject.payload.floatingObject.container.frame.radius + let radius = thisObject.payload.floatingObject.container.frame.radius /* Label Text */ let labelPoint let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4 / 2 @@ -2174,15 +2173,17 @@ function newUiObject() { let additionalImageSize = 0 if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 } let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize + + let nodeDefinition = getNodeDefinition(thisObject.payload.node) + if (nodeDefinition === undefined) { return } + if (canvas.floatingSpace.inMapMode === true) { - totalImageSize = canvas.floatingSpace.transformImagesizeToMap(totalImageSize) - let nodeDefinition = getNodeDefinition(thisObject.payload.node) - if (nodeDefinition !== undefined) { - if (nodeDefinition.isHierarchyHead !== true) { - totalImageSize = totalImageSize / 4 - } + if (nodeDefinition.isHierarchyHead === true) { + totalImageSize = 50 + } else { + totalImageSize = canvas.floatingSpace.transformImagesizeToMap(totalImageSize) } - } + } if (thisObject.isShowing === true) { totalImageSize = 50 diff --git a/CanvasApp/FloatingSpace/UiObjectTitle.js b/CanvasApp/FloatingSpace/UiObjectTitle.js index 1fe566f5b..bb32d7402 100644 --- a/CanvasApp/FloatingSpace/UiObjectTitle.js +++ b/CanvasApp/FloatingSpace/UiObjectTitle.js @@ -168,20 +168,6 @@ function newUiObjectTitle() { } break } - case 'Use Reference Parent Parent Parent': { - let nodeToUse = thisObject.payload.node.payload.referenceParent - if (nodeToUse !== undefined && nodeToUse.payload !== undefined) { - nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode - if (nodeToUse !== undefined && nodeToUse.payload !== undefined) { - nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode.payload.parentNode - if (nodeToUse !== undefined && nodeToUse.payload !== undefined) { - thisObject.payload.title = thisObject.payload.title + separator + nodeToUse.payload.title - thisObject.payload.node.name = thisObject.payload.node.name + separator + nodeToUse.payload.node.name - } - } - } - break - } default: { if (titleReference.indexOf('Use Child @') === 0) { let propertyName = titleReference.substring(titleReference.indexOf('@') + 1, titleReference.length) diff --git a/CanvasApp/Panels/Layer.js b/CanvasApp/Panels/Layer.js index 7ffe83133..85fd1a020 100644 --- a/CanvasApp/Panels/Layer.js +++ b/CanvasApp/Panels/Layer.js @@ -296,9 +296,10 @@ function newLayer() { function getIcon(node) { let nodeDefinition = getNodeDefinition(node) let iconName + let icon if (nodeDefinition.alternativeIcons !== undefined) { for (let i = 0; i < nodeDefinition.alternativeIcons.length; i++) { - alternativeIcon = nodeDefinition.alternativeIcons[i] + let alternativeIcon = nodeDefinition.alternativeIcons[i] if (alternativeIcon.codeName === node.config.codeName) { iconName = alternativeIcon.iconName } diff --git a/CanvasApp/Panels/LayersPanel.js b/CanvasApp/Panels/LayersPanel.js index beb42bad5..9fff6cf45 100644 --- a/CanvasApp/Panels/LayersPanel.js +++ b/CanvasApp/Panels/LayersPanel.js @@ -381,7 +381,7 @@ function newLayersPanel() { let found = removeFromLocalLayers(layerNode.id) if (found !== true) { - layer = addLayer(layerNode) + let layer = addLayer(layerNode) if (layer !== undefined) { onLayerStatusChanged(layer) } diff --git a/CanvasApp/Panels/PanelsVisibleButton.js b/CanvasApp/Panels/PanelsVisibleButton.js index 7c2528eba..ddede0157 100644 --- a/CanvasApp/Panels/PanelsVisibleButton.js +++ b/CanvasApp/Panels/PanelsVisibleButton.js @@ -60,7 +60,7 @@ function newPanelsVisibleButton() { function setPanelVisibility() { for (let i = 0; i < thisObject.panels.length; i++) { - panel = canvas.panelsSpace.getPanel(thisObject.panels[i]) + let panel = canvas.panelsSpace.getPanel(thisObject.panels[i]) panel.isVisible = thisObject.showPanels } } diff --git a/CanvasApp/Plotting/Plotter.js b/CanvasApp/Plotting/Plotter.js index bcb956121..9798539f6 100644 --- a/CanvasApp/Plotting/Plotter.js +++ b/CanvasApp/Plotting/Plotter.js @@ -891,7 +891,7 @@ function newPlotter() { } } - if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMinYScale === true) { + if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMaxYScale === true) { mustRecalculateDataPoints = true } else { mustRecalculateDataPoints = false diff --git a/CanvasApp/Plotting/RecordValues.js b/CanvasApp/Plotting/RecordValues.js index 118bcda60..707b38e73 100644 --- a/CanvasApp/Plotting/RecordValues.js +++ b/CanvasApp/Plotting/RecordValues.js @@ -115,7 +115,6 @@ function newRecordValues() { function applyValue(node, value, minDecimals) { if (canvas.chartingSpace.visible !== true) { return } if (node === undefined) { return } - if (node === undefined) { return } if (node.payload === undefined) { return } if (node.payload.uiObject === undefined) { return } if (value === true) { value = 'true' } diff --git a/CanvasApp/Scales/RateScale.js b/CanvasApp/Scales/RateScale.js index 216de1e8e..54afd0b99 100644 --- a/CanvasApp/Scales/RateScale.js +++ b/CanvasApp/Scales/RateScale.js @@ -176,6 +176,11 @@ function newRateScale() { return } } else { + if (event.shiftKey === true) { + sensitivity = 20 + } else { + sensitivity = 5 + } if (wheelDeltaDirection === 1) { wheelDeltaCounter++ if (wheelDeltaCounter < sensitivity) { diff --git a/CanvasApp/Scales/TimeFrameScale.js b/CanvasApp/Scales/TimeFrameScale.js index 0d4becfbe..c6d34dfb2 100644 --- a/CanvasApp/Scales/TimeFrameScale.js +++ b/CanvasApp/Scales/TimeFrameScale.js @@ -261,6 +261,11 @@ function newTimeFrameScale() { return } } else { + if (event.shiftKey === true) { + sensitivity = 20 + } else { + sensitivity = 5 + } if (wheelDeltaDirection === 1) { wheelDeltaCounter++ if (wheelDeltaCounter < sensitivity) { diff --git a/CanvasApp/Scales/TimeScale.js b/CanvasApp/Scales/TimeScale.js index af0a3dbc8..f2915426c 100644 --- a/CanvasApp/Scales/TimeScale.js +++ b/CanvasApp/Scales/TimeScale.js @@ -127,6 +127,11 @@ function newTimeScale() { return } } else { + if (event.shiftKey === true) { + sensitivity = 20 + } else { + sensitivity = 5 + } if (wheelDeltaDirection === 1) { wheelDeltaCounter++ if (wheelDeltaCounter < sensitivity) { diff --git a/CanvasApp/SideSpace/ListView.js b/CanvasApp/SideSpace/ListView.js index 16474d696..c1f49199b 100644 --- a/CanvasApp/SideSpace/ListView.js +++ b/CanvasApp/SideSpace/ListView.js @@ -182,8 +182,6 @@ function newListView() { function physics() { if (isInitialized === false || thisObject.isVisible === false) { return } - if (isInitialized === false) { return } - if (thisObject.isVisible === false) { return } childrenPhysics() } diff --git a/CanvasApp/Spaces/TutorialSpace.js b/CanvasApp/Spaces/TutorialSpace.js index 829c7142d..72ff6f7e1 100644 --- a/CanvasApp/Spaces/TutorialSpace.js +++ b/CanvasApp/Spaces/TutorialSpace.js @@ -191,14 +191,6 @@ function newTutorialSpace() { } } - function checkViewportZoomAtCenter() { - if (currentNode === undefined) { return } - let config = JSON.parse(currentNode.config) - if (config.viewportZoomAtCenter !== undefined) { - canvas.chartingSpace.viewport.zoomAtCenter(config.viewportZoomAtCenter) - } - } - function checkPressButton() { if (currentNode === undefined) { return } let config = JSON.parse(currentNode.config) diff --git a/CanvasApp/VideoRecorder.js b/CanvasApp/VideoRecorder.js index 551db0ef7..88ff5a672 100644 --- a/CanvasApp/VideoRecorder.js +++ b/CanvasApp/VideoRecorder.js @@ -63,7 +63,7 @@ function newVideoRecorder() { let key = canvas.mouse.event.key if (key === undefined) { break } switch (key.toLowerCase()) { - case 'Escape': + case 'escape': { pointerIcon = canvas.designSpace.iconCollection.get('key-m') break diff --git a/Files-Component/src/DailyFiles.js b/Files-Component/src/DailyFiles.js index f28017eb2..222ccc995 100644 --- a/Files-Component/src/DailyFiles.js +++ b/Files-Component/src/DailyFiles.js @@ -150,7 +150,7 @@ function newDailyFiles() { function createFileCursors() { try { /* Now we will get the daily files */ - for (i = 0; i < dailyFilePeriods.length; i++) { + for (let i = 0; i < dailyFilePeriods.length; i++) { let periodTime = dailyFilePeriods[i][0] let periodName = dailyFilePeriods[i][1] @@ -198,7 +198,7 @@ function newDailyFiles() { function loadThemAll() { try { - for (i = 0; i < dailyFilePeriods.length; i++) { + for (let i = 0; i < dailyFilePeriods.length; i++) { let periodTime = dailyFilePeriods[i][0] let periodName = dailyFilePeriods[i][1] diff --git a/Files-Component/src/FileCloud.js b/Files-Component/src/FileCloud.js index cfc819f98..a75095be6 100644 --- a/Files-Component/src/FileCloud.js +++ b/Files-Component/src/FileCloud.js @@ -139,7 +139,7 @@ function newFileCloud () { let data if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) { - if (err.code === 'BlobNotFound' | err.code === 'FileNotFound' | err.code === 'ParentNotFound' | err.code === 'The specified key does not exist.') { + if (err.code === 'BlobNotFound' || err.code === 'FileNotFound' || err.code === 'ParentNotFound' || err.code === 'The specified key does not exist.') { let customErr = { result: GLOBAL.CUSTOM_FAIL_RESPONSE.result, message: 'File does not exist.' diff --git a/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js b/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js index 64b32dfc0..c9918783d 100644 --- a/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js +++ b/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Daily/User.Bot.js @@ -587,7 +587,7 @@ let fileContent = ""; - for (i = 0; i < pBands.length; i++) { + for (let i = 0; i < pBands.length; i++) { let band = pBands[i]; @@ -657,7 +657,7 @@ let fileContent = ""; - for (i = 0; i < pPercentageBandwidths.length; i++) { + for (let i = 0; i < pPercentageBandwidths.length; i++) { let pB = pPercentageBandwidths[i]; diff --git a/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js b/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js index 820424630..061e3e56f 100644 --- a/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js +++ b/Legacy-Code/Masters/bots/Bollinger-Bands-Indicator-Bot/Multi-Period-Market/User.Bot.js @@ -280,7 +280,7 @@ let fileContent = ""; - for (i = 0; i < pBands.length; i++) { + for (let i = 0; i < pBands.length; i++) { let band = pBands[i]; @@ -350,7 +350,7 @@ let fileContent = ""; - for (i = 0; i < pPercentageBandwidths.length; i++) { + for (let i = 0; i < pPercentageBandwidths.length; i++) { let pB = pPercentageBandwidths[i]; diff --git a/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js b/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js index 3afe0c7ea..bfee3276b 100644 --- a/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js +++ b/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Daily/User.Bot.js @@ -274,7 +274,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each outputCandles = []; outputVolumes = []; - for (n = 0; n < global.dailyFilePeriods.length; n++) { + for (let n = 0; n < global.dailyFilePeriods.length; n++) { const emptyArray1 = []; const emptyArray2 = []; @@ -589,7 +589,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each let fileRecordCounter = 0; let fileContent = ""; - for (i = 0; i < candles.length; i++) { + for (let i = 0; i < candles.length; i++) { let candle = candles[i]; @@ -640,7 +640,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each let fileRecordCounter = 0; let fileContent = ""; - for (i = 0; i < volumes.length; i++) { + for (let i = 0; i < volumes.length; i++) { let candle = volumes[i]; diff --git a/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js b/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js index 1b1055a6a..31d6e930f 100644 --- a/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js +++ b/Legacy-Code/Masters/bots/Candles-Volumes-Indicator-Bot/Multi-Period-Market/User.Bot.js @@ -392,7 +392,7 @@ let outputCandles = []; let outputVolumes = []; - for (n = 0; n < global.marketFilesPeriods.length; n++) { + for (let n = 0; n < global.marketFilesPeriods.length; n++) { const emptyArray1 = []; const emptyArray2 = []; @@ -799,7 +799,7 @@ let fileRecordCounter = 0; let fileContent = ""; - for (i = 0; i < candles.length; i++) { + for (let i = 0; i < candles.length; i++) { let candle = candles[i]; @@ -849,7 +849,7 @@ let fileRecordCounter = 0; let fileContent = ""; - for (i = 0; i < volumes.length; i++) { + for (let i = 0; i < volumes.length; i++) { let candle = volumes[i]; diff --git a/TaskServer/DataSet.js b/TaskServer/DataSet.js index 5b43b7bbf..4637e72b9 100644 --- a/TaskServer/DataSet.js +++ b/TaskServer/DataSet.js @@ -24,8 +24,8 @@ exports.newDataSet = function newDataSet(BOT, logger) { try { thisObject.node = dataDependency.referenceParent; - logger.fileName = MODULE_NAME + "." + thisObject.node.type + "." + thisObject.node.name + "." + thisObject.node.id; - + logger.fileName = MODULE_NAME + /* Some very basic validations that we have all the information needed. */ if (thisObject.node === undefined) { logger.write(MODULE_NAME, "[ERROR] initialize -> Data Dependency without Reference Parent -> dataDependency = " + JSON.stringify(dataDependency)); @@ -33,6 +33,8 @@ exports.newDataSet = function newDataSet(BOT, logger) { return } + logger.fileName = MODULE_NAME + "." + thisObject.node.type + "." + thisObject.node.name + "." + thisObject.node.id; + if (thisObject.node.config.codeName === undefined) { logger.write(MODULE_NAME, "[ERROR] initialize -> Dataset witn no codeName defined -> Product Dataset = " + JSON.stringify(thisObject.node)); callBackFunction(global.DEFAULT_FAIL_RESPONSE); diff --git a/TaskServer/IndicatorBot.js b/TaskServer/IndicatorBot.js index cd513dee4..2f55a1daa 100644 --- a/TaskServer/IndicatorBot.js +++ b/TaskServer/IndicatorBot.js @@ -61,7 +61,7 @@ function onCommonsDownloaded(err, text) { if (err.result !== global.DEFAULT_OK_RESPONSE.result) { - parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.code || err.message); + parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message); callBackFunction(global.DEFAULT_OK_RESPONSE); return; } diff --git a/TaskServer/LowFrequencyTrading/TradingPosition.js b/TaskServer/LowFrequencyTrading/TradingPosition.js index 8476a4685..bad18fabf 100644 --- a/TaskServer/LowFrequencyTrading/TradingPosition.js +++ b/TaskServer/LowFrequencyTrading/TradingPosition.js @@ -186,7 +186,7 @@ exports.newTradingPosition = function newTradingPosition(bot, logger, tradingEng const message = 'Target Size In Base Asset cannot be undefined. Fix this please.' badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInBaseAsset.formula) } - if (value === undefined) { + if (value === 0) { const message = 'Target Size In Base Asset cannot be zero. Fix this please.' badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInBaseAsset.formula) } @@ -222,7 +222,7 @@ exports.newTradingPosition = function newTradingPosition(bot, logger, tradingEng const message = 'Target Size In Quoted Asset cannot be undefined. Fix this please.' badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset.formula) } - if (value === undefined) { + if (value === 0) { const message = 'Target Size In Quoted Asset cannot be zero. Fix this please.' badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset.formula) } @@ -244,8 +244,8 @@ exports.newTradingPosition = function newTradingPosition(bot, logger, tradingEng /* Remember how the end user defined this stage. */ tradingEngineStageNode.stageDefinedIn.value = 'Quoted Asset' } else { - const errorText = 'You need to specify a Formula for this.' - badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset.formula) + const message = 'You need to specify a Formula for this.' + badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset) } } } diff --git a/TaskServer/LowFrequencyTrading/TradingSystem.js b/TaskServer/LowFrequencyTrading/TradingSystem.js index d90c558ae..2e3af7ee3 100644 --- a/TaskServer/LowFrequencyTrading/TradingSystem.js +++ b/TaskServer/LowFrequencyTrading/TradingSystem.js @@ -310,6 +310,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM if (error !== undefined) { tradingSystem.errors.push([node.id, error]) + logger.write(MODULE_NAME, '[INFO] evalFormula -> error = ' + error) return } if (value !== undefined) { @@ -323,7 +324,6 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM } logger.write(MODULE_NAME, '[INFO] evalFormula -> value = ' + value) - logger.write(MODULE_NAME, '[INFO] evalFormula -> error = ' + error) } } diff --git a/TaskServer/MultiPeriodDaily.js b/TaskServer/MultiPeriodDaily.js index cdc4a892b..68527a72f 100644 --- a/TaskServer/MultiPeriodDaily.js +++ b/TaskServer/MultiPeriodDaily.js @@ -67,7 +67,6 @@ function getContextVariables() { try { let thisReport; - let reportKey; let statusReport; /* We look first for the bot who knows the begining of the market in order to get when the market starts. @@ -89,7 +88,7 @@ thisReport = statusReport.file; if (thisReport.beginingOfMarket === undefined) { - logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey) + logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> thisReport.beginingOfMarket === undefined ") logger.write(MODULE_NAME, "[HINT] start -> getContextVariables -> It is too early too run this process since the trade history of the market is not there yet.") let customOK = { @@ -122,7 +121,7 @@ thisReport = statusReport.file; if (thisReport.lastFile === undefined) { - logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey) + logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> thisReport.lastFile === undefined") let customOK = { result: global.CUSTOM_OK_RESPONSE.result, @@ -157,7 +156,7 @@ beginingOfMarket = new Date(thisReport.beginingOfMarket) if (beginingOfMarket.valueOf() !== contextVariables.dateBeginOfMarket.valueOf()) { // Reset Mechanism for Begining of the Market - logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> Reset Mechanism for Begining of the Market Activated. -> reportKey = " + reportKey) + logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> Reset Mechanism for Begining of the Market Activated.") beginingOfMarket = new Date(contextVariables.dateBeginOfMarket.valueOf()) startFromBegining() diff --git a/TaskServer/ProcessExecutionEvents.js b/TaskServer/ProcessExecutionEvents.js index 9b94c0365..ae74beee2 100644 --- a/TaskServer/ProcessExecutionEvents.js +++ b/TaskServer/ProcessExecutionEvents.js @@ -11,7 +11,7 @@ let thisObject = { networkNode: undefined, - initialize, initialize, + initialize: initialize, finalize: finalize, start: start, finish: finish diff --git a/TaskServer/ProcessOutput.js b/TaskServer/ProcessOutput.js index 9f6f0ee71..6075ee9e7 100644 --- a/TaskServer/ProcessOutput.js +++ b/TaskServer/ProcessOutput.js @@ -86,7 +86,7 @@ let product = outputDataset.referenceParent.parentNode.config.codeName let dataset = outputDataset.referenceParent.config.codeName - key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { lastFile: lastFile, timeFrames: timeFrames @@ -165,7 +165,7 @@ let product = outputDataset.referenceParent.parentNode.config.codeName let dataset = outputDataset.referenceParent.config.codeName - key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset + let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset let event = { lastFile: lastFile, timeFrames: timeFrames diff --git a/TaskServer/SensorBot.js b/TaskServer/SensorBot.js index 13e5c251d..e4c1f6a70 100644 --- a/TaskServer/SensorBot.js +++ b/TaskServer/SensorBot.js @@ -63,7 +63,7 @@ function onCommonsDownloaded(err, text) { if (err.result !== global.DEFAULT_OK_RESPONSE.result) { - parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.code || err.message); + parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message); callBackFunction(global.DEFAULT_OK_RESPONSE); return; } diff --git a/TaskServer/Session.js b/TaskServer/Session.js index 9b8c82b67..582500864 100644 --- a/TaskServer/Session.js +++ b/TaskServer/Session.js @@ -322,7 +322,7 @@ /* Slippage */ if (bot.SESSION.parameters.slippage === undefined) { // if the Slippage is missing we create a default one. - bot.SESSION.parameters.timeRange = { + bot.SESSION.parameters.slippage = { name: 'Missing Slippage', type: 'Slippage', config: { diff --git a/TaskServer/TradingBot.js b/TaskServer/TradingBot.js index 9d4d48ee7..4e0f2b6fb 100644 --- a/TaskServer/TradingBot.js +++ b/TaskServer/TradingBot.js @@ -251,7 +251,6 @@ global.unexpectedError = err.message processStopped() return - return; } default: { logger.write(MODULE_NAME, "[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result); diff --git a/TaskServer/server.js b/TaskServer/server.js index 5ec84ec11..1fd442a8b 100644 --- a/TaskServer/server.js +++ b/TaskServer/server.js @@ -381,7 +381,7 @@ global.EXIT_NODE_PROCESS = function exitProcess() { let config = global.TASK_NODE.bot.processes[i].config let process = global.TASK_NODE.bot.processes[i] - key = process.name + '-' + process.type + '-' + process.id + let key = process.name + '-' + process.type + '-' + process.id global.EVENT_SERVER_CLIENT.raiseEvent(key, 'Stopped') // Meaning Process Stopped } }