Deep Scan Medium Severity
This commit is contained in:
1 parent
851920181a
commit
48f1833533
44 files changed
+144
-173
No files matched your search
+1
-16
@@ -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,
|
||||
|
||||
@@ -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) + '%'
|
||||
|
||||
+18
-17
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -71,10 +71,6 @@ function newPicker() {
|
||||
isMouseOver = false
|
||||
}
|
||||
|
||||
function getSelected() {
|
||||
return optionsList[selected]
|
||||
}
|
||||
|
||||
function setSelected(pOptionsList, pCurrent, pParent, pSelected) {
|
||||
if (pOptionsList !== undefined) {
|
||||
optionsList = pOptionsList
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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' }
|
||||
|
||||
@@ -176,6 +176,11 @@ function newRateScale() {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (event.shiftKey === true) {
|
||||
sensitivity = 20
|
||||
} else {
|
||||
sensitivity = 5
|
||||
}
|
||||
if (wheelDeltaDirection === 1) {
|
||||
wheelDeltaCounter++
|
||||
if (wheelDeltaCounter < sensitivity) {
|
||||
|
||||
@@ -261,6 +261,11 @@ function newTimeFrameScale() {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (event.shiftKey === true) {
|
||||
sensitivity = 20
|
||||
} else {
|
||||
sensitivity = 5
|
||||
}
|
||||
if (wheelDeltaDirection === 1) {
|
||||
wheelDeltaCounter++
|
||||
if (wheelDeltaCounter < sensitivity) {
|
||||
|
||||
@@ -127,6 +127,11 @@ function newTimeScale() {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (event.shiftKey === true) {
|
||||
sensitivity = 20
|
||||
} else {
|
||||
sensitivity = 5
|
||||
}
|
||||
if (wheelDeltaDirection === 1) {
|
||||
wheelDeltaCounter++
|
||||
if (wheelDeltaCounter < sensitivity) {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -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.'
|
||||
|
||||
+2
-2
@@ -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];
|
||||
|
||||
|
||||
+2
-2
@@ -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];
|
||||
|
||||
|
||||
+3
-3
@@ -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];
|
||||
|
||||
|
||||
+3
-3
@@ -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];
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
let thisObject = {
|
||||
networkNode: undefined,
|
||||
initialize, initialize,
|
||||
initialize: initialize,
|
||||
finalize: finalize,
|
||||
start: start,
|
||||
finish: finish
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user