Bug Fixes and Time Machine description
This commit is contained in:
1 parent
b4c24ca59b
commit
cf6360b95f
5 files changed
+48
-16
No files matched your search
@@ -612,7 +612,14 @@ function newTimeMachine () {
|
||||
let icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
|
||||
|
||||
position = transformThisPoint(position, thisObject.container)
|
||||
printLabel(thisObject.payload.node.name, position.x + 15, position.y - 28, opacity, fontSize)
|
||||
|
||||
let label = thisObject.payload.node.name
|
||||
let description = loadPropertyFromNodeConfig(thisObject.payload, 'description')
|
||||
|
||||
if (description !== undefined) {
|
||||
label = description
|
||||
}
|
||||
printLabel(label, position.x + 15, position.y - 28, opacity, fontSize)
|
||||
|
||||
if (icon !== undefined) {
|
||||
if (icon.canDrawIcon === true) {
|
||||
|
||||
@@ -20,6 +20,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
let thisObject = {
|
||||
visible: false,
|
||||
visibleArea: undefined,
|
||||
width: undefined,
|
||||
height: undefined,
|
||||
@@ -128,6 +129,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function raiseEvents () {
|
||||
if (thisObject.visible === false) { return }
|
||||
let event = {
|
||||
newPosition: position
|
||||
}
|
||||
@@ -136,12 +138,14 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function physics () {
|
||||
if (thisObject.visible === false) { return }
|
||||
animationPhysics()
|
||||
positioningPhysics()
|
||||
readObjectState()
|
||||
}
|
||||
|
||||
function positioningPhysics () {
|
||||
if (thisObject.visible === false) { return }
|
||||
if (thisObject.payload === undefined) { return }
|
||||
/* Save the position at the frame lavel */
|
||||
let frame = {}
|
||||
@@ -176,6 +180,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function onMouseWheel (event) {
|
||||
if (thisObject.visible === false) { return }
|
||||
if ((event.ctrlKey === true || event.metaKey === true)) { return }
|
||||
let morePower = 1
|
||||
let amount = event.delta
|
||||
@@ -259,6 +264,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function displace (displaceVector, recalculate) {
|
||||
if (thisObject.visible === false) { return }
|
||||
position.x = position.x + displaceVector.x
|
||||
position.y = position.y + displaceVector.y
|
||||
|
||||
@@ -273,6 +279,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function changeZoom (oldLevel, newLevel) {
|
||||
if (thisObject.visible === false) { return }
|
||||
let oldMouse = unTransformThisPoint(thisObject.mousePosition, oldLevel)
|
||||
let newMouse = transformThisPoint(oldMouse, newLevel)
|
||||
|
||||
@@ -295,6 +302,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function transformThisPoint (point, level) {
|
||||
if (thisObject.visible === false) { return }
|
||||
let transformedPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
@@ -328,6 +336,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function isThisPointVisible (point) {
|
||||
if (thisObject.visible === false) { return }
|
||||
if (point.x < thisObject.visibleArea.topLeft.x || point.x > thisObject.visibleArea.bottomRight.x || point.y < thisObject.visibleArea.topLeft.y || point.y > thisObject.visibleArea.bottomRight.y) {
|
||||
return false
|
||||
} else {
|
||||
@@ -336,6 +345,7 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function isThisPointInViewport (point) {
|
||||
if (thisObject.visible === false) { return }
|
||||
if (point.y > COCKPIT_SPACE_POSITION) {
|
||||
return false
|
||||
} else {
|
||||
|
||||
@@ -13,7 +13,7 @@ function newChartingSpace () {
|
||||
logger.fileName = MODULE_NAME
|
||||
|
||||
let thisObject = {
|
||||
visible: undefined,
|
||||
visible: false,
|
||||
container: undefined,
|
||||
inViewport: undefined,
|
||||
timeMachines: undefined,
|
||||
@@ -170,6 +170,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenUp () {
|
||||
if (thisObject.visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: 0,
|
||||
y: browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
|
||||
@@ -179,6 +180,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenDown () {
|
||||
if (thisObject.visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: 0,
|
||||
y: -browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
|
||||
@@ -188,6 +190,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenLeft () {
|
||||
if (thisObject.visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
|
||||
y: 0
|
||||
@@ -197,6 +200,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenRight () {
|
||||
if (thisObject.visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: -browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
|
||||
y: 0
|
||||
@@ -259,11 +263,11 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function physics () {
|
||||
thisObjectPhysics()
|
||||
if (thisObject.visible !== true) { return }
|
||||
if (thisObject.viewport !== undefined) {
|
||||
thisObject.viewport.physics()
|
||||
}
|
||||
|
||||
thisObjectPhysics()
|
||||
childrenPhysics()
|
||||
syncWithDesigner()
|
||||
}
|
||||
@@ -345,10 +349,16 @@ function newChartingSpace () {
|
||||
function thisObjectPhysics () {
|
||||
thisObject.container.frame.height = COCKPIT_SPACE_POSITION
|
||||
|
||||
if (thisObject.container.frame.height <= 0 / 100) {
|
||||
if (thisObject.container.frame.height <= TOP_SPACE_HEIGHT) {
|
||||
thisObject.visible = false
|
||||
if (thisObject.viewport !== undefined) {
|
||||
thisObject.viewport.visible = false
|
||||
}
|
||||
} else {
|
||||
thisObject.visible = true
|
||||
if (thisObject.viewport !== undefined) {
|
||||
thisObject.viewport.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
if (canvas.chartingSpace.viewport !== undefined) {
|
||||
@@ -373,6 +383,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function drawBackground () {
|
||||
if (thisObject.visible === false) { return }
|
||||
drawSpaceBackground()
|
||||
|
||||
for (let i = 0; i < thisObject.timeMachines.length; i++) {
|
||||
@@ -382,7 +393,7 @@ function newChartingSpace () {
|
||||
}
|
||||
|
||||
function draw () {
|
||||
if (thisObject.visible !== true) { return }
|
||||
if (thisObject.visible === false) { return }
|
||||
drawBackground()
|
||||
|
||||
for (let i = 0; i < thisObject.timeMachines.length; i++) {
|
||||
|
||||
@@ -152,6 +152,7 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenUp () {
|
||||
if (visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: 0,
|
||||
y: browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
|
||||
@@ -162,6 +163,7 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenDown () {
|
||||
if (visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: 0,
|
||||
y: -browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
|
||||
@@ -172,6 +174,7 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenLeft () {
|
||||
if (visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
|
||||
y: 0
|
||||
@@ -182,6 +185,7 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function oneScreenRight () {
|
||||
if (visible === false) { return }
|
||||
let displaceVector = {
|
||||
x: -browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
|
||||
y: 0
|
||||
@@ -223,6 +227,7 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function onMouseWheel (event) {
|
||||
if (visible === false) { return }
|
||||
thisObject.floatingLayer.changeTargetRepulsion(event.wheelDelta)
|
||||
}
|
||||
|
||||
@@ -235,6 +240,7 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function getContainer (point) {
|
||||
if (visible === false) { return }
|
||||
let container
|
||||
|
||||
container = thisObject.floatingLayer.getContainer(point)
|
||||
@@ -250,11 +256,10 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function physics () {
|
||||
if (visible === true) {
|
||||
browserZoomPhysics()
|
||||
positionContraintsPhysics()
|
||||
thisObject.floatingLayer.physics()
|
||||
}
|
||||
if (visible === false) { return }
|
||||
browserZoomPhysics()
|
||||
positionContraintsPhysics()
|
||||
thisObject.floatingLayer.physics()
|
||||
}
|
||||
|
||||
function positionContraintsPhysics () {
|
||||
@@ -282,10 +287,9 @@ function newFloatingSpace () {
|
||||
}
|
||||
|
||||
function draw () {
|
||||
if (visible === true) {
|
||||
drawBackground()
|
||||
thisObject.floatingLayer.draw()
|
||||
}
|
||||
if (visible === false) { return }
|
||||
drawBackground()
|
||||
thisObject.floatingLayer.draw()
|
||||
}
|
||||
|
||||
function drawBackground () {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"type":"Workspace","name":"My Workspace","rootNodes":[{"type":"Network","name":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","dataStorage":{"type":"Data Storage","name":"New Data Storage","sessionIndependentData":{"type":"Session Independent Data","name":"New Session Independent Data","singleMarketData":[{"type":"Single Market Data","name":"Binance BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"592901f9-9d7e-4d02-9c3e-9941fd1cbc62","savedPayload":{"position":{"x":25077.92118083212,"y":30760.520078448346},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"54e5d587-dae5-4901-8625-899f3b6eb361","savedPayload":{"position":{"x":24999.96233239647,"y":30798.741502613975},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"7f5856c1-cf3a-4525-8036-69da93e57771","savedPayload":{"position":{"x":24916.307713241193,"y":30821.98723359081},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"fad346d0-20f9-4cf4-9663-7eb54622b5f0","savedPayload":{"position":{"x":24829.80608108897,"y":30829.46566589062},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"2fc1f392-7d9b-409e-9cb7-85c14e1e7c07","savedPayload":{"position":{"x":24743.403145275464,"y":30820.922130470823},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"e7c4252c-3b6b-4b21-9f7a-6a6263739835","savedPayload":{"position":{"x":24660.04125415091,"y":30796.647567183296},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"3e9c58db-ca68-4089-9a02-d99f01428a41","savedPayload":{"position":{"x":24582.55919693599,"y":30757.468617166673},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"b47bf5eb-2f3e-462f-aa45-8e5c6ae784bc","savedPayload":{"position":{"x":24513.595532159667,"y":30704.71947257379},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"67a989ee-e8da-4079-9b0a-8a7509db45a5","savedPayload":{"position":{"x":24455.498734713103,"y":30640.196442258137},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"763cde69-4a76-498f-a753-87baa3b227f3","savedPayload":{"position":{"x":24410.247221353908,"y":30566.09678063027},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"anLine truncated
|
||||
{"type":"Workspace","name":"My Workspace","rootNodes":[{"type":"Network","name":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","dataStorage":{"type":"Data Storage","name":"New Data Storage","sessionIndependentData":{"type":"Session Independent Data","name":"New Session Independent Data","singleMarketData":[{"type":"Single Market Data","name":"Binance BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"592901f9-9d7e-4d02-9c3e-9941fd1cbc62","savedPayload":{"position":{"x":25077.92118083212,"y":30760.520078448346},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"54e5d587-dae5-4901-8625-899f3b6eb361","savedPayload":{"position":{"x":24999.96233239647,"y":30798.741502613975},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"7f5856c1-cf3a-4525-8036-69da93e57771","savedPayload":{"position":{"x":24916.307713241193,"y":30821.98723359081},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"fad346d0-20f9-4cf4-9663-7eb54622b5f0","savedPayload":{"position":{"x":24829.80608108897,"y":30829.46566589062},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"2fc1f392-7d9b-409e-9cb7-85c14e1e7c07","savedPayload":{"position":{"x":24743.403145275464,"y":30820.922130470823},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"e7c4252c-3b6b-4b21-9f7a-6a6263739835","savedPayload":{"position":{"x":24660.04125415091,"y":30796.647567183296},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"3e9c58db-ca68-4089-9a02-d99f01428a41","savedPayload":{"position":{"x":24582.55919693599,"y":30757.468617166673},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"b47bf5eb-2f3e-462f-aa45-8e5c6ae784bc","savedPayload":{"position":{"x":24513.595532159667,"y":30704.71947257379},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"67a989ee-e8da-4079-9b0a-8a7509db45a5","savedPayload":{"position":{"x":24455.498734713103,"y":30640.196442258137},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"763cde69-4a76-498f-a753-87baa3b227f3","savedPayload":{"position":{"x":24410.247221353908,"y":30566.09678063027},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"anLine truncated
|
||||
Reference in new issue
Block a user