diff --git a/CanvasApp/.vscode/settings.json b/CanvasApp/.vscode/settings.json
new file mode 100644
index 000000000..1bcba0f85
--- /dev/null
+++ b/CanvasApp/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "editor.detectIndentation": false
+}
\ No newline at end of file
diff --git a/CanvasApp/Animation.js b/CanvasApp/Animation.js
index b43fcf413..3be427501 100644
--- a/CanvasApp/Animation.js
+++ b/CanvasApp/Animation.js
@@ -1,9 +1,9 @@
-function newAnimation () {
- const MODULE_NAME = 'Animation'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newAnimation() {
+ const MODULE_NAME = 'Animation'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
/*
@@ -13,162 +13,162 @@ function newAnimation () {
*/
- let animationLoopHandle // This is the handle to the animation loop. With this handle we can cancel the loop, for instance.
- let callBackFunctions = new Map()
+ let animationLoopHandle // This is the handle to the animation loop. With this handle we can cancel the loop, for instance.
+ let callBackFunctions = new Map()
- let thisObject = {
- start: start,
- stop: stop,
- addCallBackFunction: addCallBackFunction,
- removeCallBackFunction: removeCallBackFunction,
- initialize: initialize,
- finalize: finalize
- }
+ let thisObject = {
+ start: start,
+ stop: stop,
+ addCallBackFunction: addCallBackFunction,
+ removeCallBackFunction: removeCallBackFunction,
+ initialize: initialize,
+ finalize: finalize
+ }
- let totalConsumption = 0
- let totalCounter = 0
- let pointerIcon
- let videoRecorder
- return thisObject
+ let totalConsumption = 0
+ let totalCounter = 0
+ let pointerIcon
+ let videoRecorder
+ return thisObject
- function finalize () {
- thisObject.stop()
- pointerIcon = undefined
- videoRecorder = undefined
- }
+ function finalize() {
+ thisObject.stop()
+ pointerIcon = undefined
+ videoRecorder = undefined
+ }
- function initialize () {
- videoRecorder = newVideoRecorder()
- }
+ function initialize() {
+ videoRecorder = newVideoRecorder()
+ }
- function start () {
- animationLoop() // Inside this function the animation process is started, and at the same time it creates a loop.
- }
+ function start() {
+ animationLoop() // Inside this function the animation process is started, and at the same time it creates a loop.
+ }
- function stop () {
- window.cancelAnimationFrame(animationLoopHandle)
- }
+ function stop() {
+ window.cancelAnimationFrame(animationLoopHandle)
+ }
- function addCallBackFunction (key, callBack) {
- callBackFunctions.set(key, callBack)
- }
+ function addCallBackFunction(key, callBack) {
+ callBackFunctions.set(key, callBack)
+ }
- function removeCallBackFunction (key) {
- callBackFunctions.delete(key)
- }
+ function removeCallBackFunction(key) {
+ callBackFunctions.delete(key)
+ }
- function animationLoop () {
- try {
- /* First thing is to clear the actual canvas */
- clearBrowserCanvas()
+ function animationLoop() {
+ try {
+ /* First thing is to clear the actual canvas */
+ clearBrowserCanvas()
- /* We loop through the callback functions collections and execute them all. */
- let performanceMap = new Map()
- let totalTimeConsumed = 0
- let totalElements = 0
- let chanceToExecute
- let randomNumber
- let mustExecute
+ /* We loop through the callback functions collections and execute them all. */
+ let performanceMap = new Map()
+ let totalTimeConsumed = 0
+ let totalElements = 0
+ let chanceToExecute
+ let randomNumber
+ let mustExecute
- // console.clear()
- let row = 0
- for (const [key, callBackFunction] of callBackFunctions.entries()) {
- row++
- switch (key) {
- case 'Floating Space Physics':
- chanceToExecute = 50
- randomNumber = Math.random() * 100 * chanceToExecute
- if (randomNumber > 100 - chanceToExecute) { mustExecute = true } else { mustExecute = false }
- break
- default: {
- mustExecute = true
- }
+ // console.clear()
+ let row = 0
+ for (const [key, callBackFunction] of callBackFunctions.entries()) {
+ row++
+ switch (key) {
+ case 'Floating Space Physics':
+ chanceToExecute = 50
+ randomNumber = Math.random() * 100 * chanceToExecute
+ if (randomNumber > 100 - chanceToExecute) { mustExecute = true } else { mustExecute = false }
+ break
+ default: {
+ mustExecute = true
+ }
- }
- let timeConsumed = 0
- if (mustExecute === true) {
- let t0 = performance.now()
- callBackFunction()
- let t1 = performance.now()
- timeConsumed = t1 - t0
- if (key === 'Charting Space Draw') {
- if (Math.random() * 100 > 99) {
- totalConsumption = 0
- totalCounter = 0
+ }
+ let timeConsumed = 0
+ if (mustExecute === true) {
+ let t0 = performance.now()
+ callBackFunction()
+ let t1 = performance.now()
+ timeConsumed = t1 - t0
+ if (key === 'Charting Space Draw') {
+ if (Math.random() * 100 > 99) {
+ totalConsumption = 0
+ totalCounter = 0
+ }
+
+ totalConsumption = totalConsumption + timeConsumed
+ totalCounter = totalCounter + 1
+ }
+ performanceMap.set(key, timeConsumed)
+ totalTimeConsumed = totalTimeConsumed + timeConsumed
+ totalElements++
+ }
}
- totalConsumption = totalConsumption + timeConsumed
- totalCounter = totalCounter + 1
- }
- performanceMap.set(key, timeConsumed)
- totalTimeConsumed = totalTimeConsumed + timeConsumed
- totalElements++
+ /* Frame per Seconds */
+
+ ANIMATION_FRAME_PER_SECONDS = Math.trunc(1000 / totalTimeConsumed)
+
+ /* Performance Check */
+ if (SHOW_ANIMATION_PERFORMACE === true) {
+ row = 0
+ for (const [key, timeConsumed] of performanceMap.entries()) {
+ row++
+ 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) + '%'
+ printLabel(labelToPrint, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
+ }
+
+ /* Other Variables */
+ row++
+ printLabel(DEBUG.variable1, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
+ row++
+ printLabel(DEBUG.variable2, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
+ row++
+ printLabel(DEBUG.variable3, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
+ row++
+ printLabel(DEBUG.variable4, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
+ row++
+ printLabel('Animation Frame Per Seconds: ' + ANIMATION_FRAME_PER_SECONDS, 300, 100 + row * 30, 1, 20, UI_COLOR.TITANIUM_YELLOW)
+ }
+
+ /* Video Recording */
+ videoRecorder.physics()
+ if (ARE_WE_RECORDING_A_VIDEO === true) {
+ videoRecorder.recordCanvas()
+ }
+
+ /* Panorama Recording */
+ if (ARE_WE_RECORDING_A_MARKET_PANORAMA === true) {
+ if (PANORAMA_WAS_PANNED === true) {
+ addToMarketPanorama()
+ PANORAMA_WAS_PANNED = false
+ }
+ }
+
+ /* We request the next frame to be drawn, and stablishing a loop */
+
+ /* Use this code for full animation speed. */
+ animationLoopHandle = window.requestAnimationFrame(animationLoop)
+
+ /* Use this code for max 10 frames per second animation speed, if the app is consumming too much of your CPU. */
+ /*
+ setTimeout(nextLoop, 100)
+ function nextLoop () {
+ animationLoopHandle = window.requestAnimationFrame(animationLoop)
+ }
+ */
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] animationLoop -> err = ' + err.stack) }
}
- }
-
- /* Frame per Seconds */
-
- ANIMATION_FRAME_PER_SECONDS = Math.trunc(1000 / totalTimeConsumed)
-
- /* Performance Check */
- if (SHOW_ANIMATION_PERFORMACE === true) {
- row = 0
- for (const [key, timeConsumed] of performanceMap.entries()) {
- row++
- 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) + '%'
- printLabel(labelToPrint, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
- }
-
- /* Other Variables */
- row++
- printLabel(DEBUG.variable1, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
- row++
- printLabel(DEBUG.variable2, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
- row++
- printLabel(DEBUG.variable3, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
- row++
- printLabel(DEBUG.variable4, 300, 100 + row * 30, 1, 20, UI_COLOR.RED)
- row++
- printLabel('Animation Frame Per Seconds: ' + ANIMATION_FRAME_PER_SECONDS, 300, 100 + row * 30, 1, 20, UI_COLOR.TITANIUM_YELLOW)
- }
-
- /* Video Recording */
- videoRecorder.physics()
- if (ARE_WE_RECORDING_A_VIDEO === true) {
- videoRecorder.recordCanvas()
- }
-
- /* Panorama Recording */
- if (ARE_WE_RECORDING_A_MARKET_PANORAMA === true) {
- if (PANORAMA_WAS_PANNED === true) {
- addToMarketPanorama()
- PANORAMA_WAS_PANNED = false
- }
- }
-
- /* We request the next frame to be drawn, and stablishing a loop */
-
- /* Use this code for full animation speed. */
- animationLoopHandle = window.requestAnimationFrame(animationLoop)
-
- /* Use this code for max 10 frames per second animation speed, if the app is consumming too much of your CPU. */
- /*
- setTimeout(nextLoop, 100)
- function nextLoop () {
- animationLoopHandle = window.requestAnimationFrame(animationLoop)
- }
- */
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] animationLoop -> err = ' + err.stack) }
}
- }
- function clearBrowserCanvas () {
- if (canWeDraw === false) { return }
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.clearRect(0, 0, browserCanvas.width, browserCanvas.height)
- }
+ function clearBrowserCanvas() {
+ if (canWeDraw === false) { return }
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.clearRect(0, 0, browserCanvas.width, browserCanvas.height)
+ }
}
diff --git a/CanvasApp/Canvas.js b/CanvasApp/Canvas.js
index 50f08991c..d5b2cf6ac 100644
--- a/CanvasApp/Canvas.js
+++ b/CanvasApp/Canvas.js
@@ -4,1105 +4,1105 @@ let browserCanvasContext // The context of the canvas object.
let stepsInitializationCounter = 0 // This counter the initialization steps required to be able to turn off the splash screen.
let marketInitializationCounter = 0 // This counter the initialization of markets required to be able to turn off the splash screen.
-function newCanvas () {
- const MODULE_NAME = 'Canvas'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newCanvas() {
+ const MODULE_NAME = 'Canvas'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- /* Mouse event related variables. */
+ /* Mouse event related variables. */
- let containerDragStarted = false
- let floatingObjectDragStarted = false
- let floatingObjectBeingDragged
- let containerBeingDragged
- let viewPortBeingDragged = false
- let ignoreNextClick = false
+ let containerDragStarted = false
+ let floatingObjectDragStarted = false
+ let floatingObjectBeingDragged
+ let containerBeingDragged
+ let viewPortBeingDragged = false
+ let ignoreNextClick = false
- let dragVector = {
- downX: 0,
- downY: 0,
- upX: 0,
- upY: 0
- }
-
- /* canvas object */
-
- let thisObject = {
- eventHandler: undefined,
- topSpace: undefined,
- sideSpace: undefined,
- chartingSpace: undefined,
- floatingSpace: undefined,
- panelsSpace: undefined,
- cockpitSpace: undefined,
- designSpace: undefined,
- splashScreen: undefined,
- animation: undefined,
- mouse: undefined,
- shorcutNumbers: new Map(),
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.eventHandler = newEventHandler()
-
- let lastContainerMouseOver
- let lastShortcutKeyRejection
-
- thisObject.mouse = {
- position: {
- x: 0,
- y: 0
- },
- action: ''
- }
-
- return thisObject
-
- function finalize () {
- try {
- thisObject.sideSpace.finalize()
- thisObject.chartingSpace.finalize()
- 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)
-
- thisObject.splashScreen = undefined
- lastContainerMouseOver = undefined
-
- hisObject.mouse = undefined
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) }
+ let dragVector = {
+ downX: 0,
+ downY: 0,
+ upX: 0,
+ upY: 0
}
- }
- function initialize () {
- try {
- browserResized()
- initializeBrowserCanvas()
- addCanvasEvents()
+ /* canvas object */
- /* Instantiate all the children spaces of Canvas object */
- thisObject.floatingSpace = newFloatingSpace()
- thisObject.floatingSpace.initialize()
-
- thisObject.topSpace = newTopSpace()
- thisObject.topSpace.initialize()
-
- thisObject.cockpitSpace = newCockpitSpace()
- thisObject.cockpitSpace.initialize()
-
- thisObject.designSpace = newDesignSpace()
- thisObject.designSpace.initialize()
-
- thisObject.panelsSpace = newPanelsSpace()
- thisObject.panelsSpace.initialize()
-
- thisObject.chartingSpace = newChartingSpace()
- thisObject.chartingSpace.initialize()
-
- thisObject.sideSpace = newSideSpace()
- thisObject.sideSpace.initialize()
-
- thisObject.splashScreen = newSplashScreen()
-
- let animation = newAnimation()
- animation.initialize()
-
- thisObject.animation = animation
-
- /* Spcaces Physics */
- animation.addCallBackFunction('CockpitSpace Physics', thisObject.cockpitSpace.physics)
- animation.addCallBackFunction('Floating Space Physics', thisObject.floatingSpace.physics)
- animation.addCallBackFunction('Charting Space Physics', thisObject.chartingSpace.physics)
- animation.addCallBackFunction('Design Space Physics', thisObject.designSpace.physics)
- animation.addCallBackFunction('Panels Space Physics', thisObject.panelsSpace.physics)
- animation.addCallBackFunction('Side Space Physics', thisObject.sideSpace.physics)
-
- /* Spcaces Drawing */
- animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw)
- animation.addCallBackFunction('Charting Space Draw', thisObject.chartingSpace.draw)
- animation.addCallBackFunction('Panels Space', thisObject.panelsSpace.draw)
- animation.addCallBackFunction('CockpitSpace Draw', thisObject.cockpitSpace.draw)
- animation.addCallBackFunction('Design Space Draw', thisObject.designSpace.draw)
- animation.addCallBackFunction('Top Space Draw', thisObject.topSpace.draw)
- animation.addCallBackFunction('Side Space Draw', thisObject.sideSpace.draw)
- animation.addCallBackFunction('Splash Screen Draw', thisObject.splashScreen.draw)
- animation.start()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
+ let thisObject = {
+ eventHandler: undefined,
+ topSpace: undefined,
+ sideSpace: undefined,
+ chartingSpace: undefined,
+ floatingSpace: undefined,
+ panelsSpace: undefined,
+ cockpitSpace: undefined,
+ designSpace: undefined,
+ splashScreen: undefined,
+ animation: undefined,
+ mouse: undefined,
+ shorcutNumbers: new Map(),
+ initialize: initialize,
+ finalize: finalize
}
- }
- function initializeBrowserCanvas () {
- try {
- browserCanvasContext = browserCanvas.getContext('2d')
- browserCanvasContext.font = 'Saira Condensed'
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initializeBrowserCanvas -> err = ' + err.stack) }
+ thisObject.eventHandler = newEventHandler()
+
+ let lastContainerMouseOver
+ let lastShortcutKeyRejection
+
+ thisObject.mouse = {
+ position: {
+ x: 0,
+ y: 0
+ },
+ action: ''
}
- }
- function addCanvasEvents () {
- try {
- canvas.eventHandler.listenToEvent('Browser Resized', browserResized)
+ return thisObject
- /* Keyboard events */
- window.addEventListener('keydown', onKeyDown, true)
- window.addEventListener('keyup', onKeyUp, true)
+ function finalize() {
+ try {
+ thisObject.sideSpace.finalize()
+ thisObject.chartingSpace.finalize()
+ thisObject.floatingSpace.finalize()
+ thisObject.shorcutNumbers = undefined
- /* Mouse Events */
- browserCanvas.addEventListener('mousedown', onMouseDown, false)
- browserCanvas.addEventListener('mouseup', onMouseUp, false)
- browserCanvas.addEventListener('mousemove', onMouseMove, false)
- browserCanvas.addEventListener('click', onMouseClick, false)
- browserCanvas.addEventListener('mouseout', onMouseOut, 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)
- if (browserCanvas.addEventListener) {
- browserCanvas.addEventListener('mousewheel', onMouseWheel, false) // IE9, Chrome, Safari, Opera
- browserCanvas.addEventListener('DOMMouseScroll', onMouseWheel, false) // Firefox
- } else browserCanvas.attachEvent('onmousewheel', onMouseWheel)// IE 6/7/8
+ 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
- /* Dragging Files Over the Canvas */
- browserCanvas.addEventListener('dragenter', onDragEnter, false)
- browserCanvas.addEventListener('dragleave', onDragLeave, false)
- browserCanvas.addEventListener('dragover', onDragOver, false)
- browserCanvas.addEventListener('drop', onDragDrop, false)
+ browserCanvas.removeEventListener('dragenter', onDragEnter, false)
+ browserCanvas.removeEventListener('dragleave', onDragLeave, false)
+ browserCanvas.removeEventListener('dragover', onDragOver, false)
+ browserCanvas.removeEventListener('drop', onDragDrop, false)
- // Disables the context menu when you right mouse click the canvas.
- browserCanvas.oncontextmenu = function (e) {
- e.preventDefault()
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] addCanvasEvents -> err = ' + err.stack) }
- }
- }
+ browserCanvas.removeEventListener('keydown', onKeyDown, false)
+ browserCanvas.removeEventListener('keyup', onKeyUp, false)
- function browserResized () {
- browserCanvas = document.getElementById('canvas')
+ thisObject.splashScreen = undefined
+ lastContainerMouseOver = undefined
- browserCanvas.width = window.innerWidth
- browserCanvas.height = window.innerHeight - CURRENT_TOP_MARGIN
- }
-
- function checkMediaRecording (event) {
- if ((event.ctrlKey === true || event.metaKey === true)) {
- let constructorParams
- switch (event.keyCode) {
- case 118: { // F7
- downloadPanorama('Superalgos.Market.Panorama')
- return
- break
+ hisObject.mouse = undefined
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) }
}
- case 119: { // F8
- downloadCanvas('Superalgos.Image.Capture', browserCanvas)
- return
- break
+ }
+
+ function initialize() {
+ try {
+ browserResized()
+ initializeBrowserCanvas()
+ addCanvasEvents()
+
+ /* Instantiate all the children spaces of Canvas object */
+ thisObject.floatingSpace = newFloatingSpace()
+ thisObject.floatingSpace.initialize()
+
+ thisObject.topSpace = newTopSpace()
+ thisObject.topSpace.initialize()
+
+ thisObject.cockpitSpace = newCockpitSpace()
+ thisObject.cockpitSpace.initialize()
+
+ thisObject.designSpace = newDesignSpace()
+ thisObject.designSpace.initialize()
+
+ thisObject.panelsSpace = newPanelsSpace()
+ thisObject.panelsSpace.initialize()
+
+ thisObject.chartingSpace = newChartingSpace()
+ thisObject.chartingSpace.initialize()
+
+ thisObject.sideSpace = newSideSpace()
+ thisObject.sideSpace.initialize()
+
+ thisObject.splashScreen = newSplashScreen()
+
+ let animation = newAnimation()
+ animation.initialize()
+
+ thisObject.animation = animation
+
+ /* Spcaces Physics */
+ animation.addCallBackFunction('CockpitSpace Physics', thisObject.cockpitSpace.physics)
+ animation.addCallBackFunction('Floating Space Physics', thisObject.floatingSpace.physics)
+ animation.addCallBackFunction('Charting Space Physics', thisObject.chartingSpace.physics)
+ animation.addCallBackFunction('Design Space Physics', thisObject.designSpace.physics)
+ animation.addCallBackFunction('Panels Space Physics', thisObject.panelsSpace.physics)
+ animation.addCallBackFunction('Side Space Physics', thisObject.sideSpace.physics)
+
+ /* Spcaces Drawing */
+ animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw)
+ animation.addCallBackFunction('Charting Space Draw', thisObject.chartingSpace.draw)
+ animation.addCallBackFunction('Panels Space', thisObject.panelsSpace.draw)
+ animation.addCallBackFunction('CockpitSpace Draw', thisObject.cockpitSpace.draw)
+ animation.addCallBackFunction('Design Space Draw', thisObject.designSpace.draw)
+ animation.addCallBackFunction('Top Space Draw', thisObject.topSpace.draw)
+ animation.addCallBackFunction('Side Space Draw', thisObject.sideSpace.draw)
+ animation.addCallBackFunction('Splash Screen Draw', thisObject.splashScreen.draw)
+ animation.start()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
}
- case 120: { // F9
- constructorParams = { format: 'gif', workersPath: 'externalScripts/', framerate: 8, name: 'Superalgos.Video.Capture'}
- break
+ }
+
+ function initializeBrowserCanvas() {
+ try {
+ browserCanvasContext = browserCanvas.getContext('2d')
+ browserCanvasContext.font = 'Saira Condensed'
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initializeBrowserCanvas -> err = ' + err.stack) }
}
- case 121: { // F10
- constructorParams = { format: 'webm', framerate: 8, name: 'Superalgos.Video.Capture' }
- break
+ }
+
+ function addCanvasEvents() {
+ try {
+ canvas.eventHandler.listenToEvent('Browser Resized', browserResized)
+
+ /* Keyboard events */
+ window.addEventListener('keydown', onKeyDown, true)
+ window.addEventListener('keyup', onKeyUp, true)
+
+ /* Mouse Events */
+ browserCanvas.addEventListener('mousedown', onMouseDown, false)
+ browserCanvas.addEventListener('mouseup', onMouseUp, false)
+ browserCanvas.addEventListener('mousemove', onMouseMove, false)
+ browserCanvas.addEventListener('click', onMouseClick, false)
+ browserCanvas.addEventListener('mouseout', onMouseOut, false)
+
+ if (browserCanvas.addEventListener) {
+ browserCanvas.addEventListener('mousewheel', onMouseWheel, false) // IE9, Chrome, Safari, Opera
+ browserCanvas.addEventListener('DOMMouseScroll', onMouseWheel, false) // Firefox
+ } else browserCanvas.attachEvent('onmousewheel', onMouseWheel)// IE 6/7/8
+
+ /* Dragging Files Over the Canvas */
+ browserCanvas.addEventListener('dragenter', onDragEnter, false)
+ browserCanvas.addEventListener('dragleave', onDragLeave, false)
+ browserCanvas.addEventListener('dragover', onDragOver, false)
+ browserCanvas.addEventListener('drop', onDragDrop, false)
+
+ // Disables the context menu when you right mouse click the canvas.
+ browserCanvas.oncontextmenu = function (e) {
+ e.preventDefault()
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] addCanvasEvents -> err = ' + err.stack) }
}
- default: return
- }
-
- if (ARE_WE_RECORDING_A_VIDEO === false) {
- console.log('RECORDING', constructorParams.format)
- mediaRecorder = new CCapture(constructorParams)
- mediaRecorder.start()
- ARE_WE_RECORDING_A_VIDEO = true
- } else {
- console.log('SAVING', constructorParams.format)
- ARE_WE_RECORDING_A_VIDEO = false
- mediaRecorder.stop()
- mediaRecorder.save()
- }
- }
- }
-
- function onKeyUp (event) {
- thisObject.mouse.event = event
- thisObject.mouse.action = 'key up'
- }
-
- function onKeyDown (event) {
- if (EDITOR_ON_FOCUS === true) { return }
- thisObject.mouse.event = event
- thisObject.mouse.action = 'key down'
-
- checkMediaRecording(event)
- canvas.chartingSpace.onKeyPressed(event)
-
- /* Shourcuts to Menu Items */
- if ((event.keyCode >= 48 && event.keyCode <= 57)) {
- let number = event.key
- if (MENU_ITEM_ON_FOCUS !== undefined) {
- let menuItem = thisObject.shorcutNumbers.get(number)
- if (menuItem !== undefined) {
- menuItem.shorcutNumber = undefined
- }
- thisObject.shorcutNumbers.set(number, MENU_ITEM_ON_FOCUS)
- MENU_ITEM_ON_FOCUS.shorcutNumber = number
- } else {
- let menuItem = thisObject.shorcutNumbers.get(number)
- if (menuItem !== undefined) {
- menuItem.internalClick()
- }
- }
}
- if (event.key === 'Escape' && canvas.floatingSpace.inMapMode === true) {
- canvas.floatingSpace.exitMapMode()
+ function browserResized() {
+ browserCanvas = document.getElementById('canvas')
+
+ browserCanvas.width = window.innerWidth
+ browserCanvas.height = window.innerHeight - CURRENT_TOP_MARGIN
}
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'M' || event.key === 'm')) {
- canvas.floatingSpace.toggleMapMode()
- event.preventDefault()
- return
- }
+ function checkMediaRecording(event) {
+ if ((event.ctrlKey === true || event.metaKey === true)) {
+ let constructorParams
+ switch (event.keyCode) {
+ case 118: { // F7
+ downloadPanorama('Superalgos.Market.Panorama')
+ return
+ break
+ }
+ case 119: { // F8
+ downloadCanvas('Superalgos.Image.Capture', browserCanvas)
+ return
+ break
+ }
+ case 120: { // F9
+ constructorParams = { format: 'gif', workersPath: 'externalScripts/', framerate: 8, name: 'Superalgos.Video.Capture' }
+ break
+ }
+ case 121: { // F10
+ constructorParams = { format: 'webm', framerate: 8, name: 'Superalgos.Video.Capture' }
+ break
+ }
+ default: return
+ }
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'R' || event.key === 'r')) {
- canvas.floatingSpace.toggleDrawReferenceLines()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'C' || event.key === 'c')) {
- canvas.floatingSpace.toggleDrawChainLines()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'S' || event.key === 's')) {
- canvas.designSpace.workspace.save()
- event.preventDefault()
- return
- }
-
- let nodeOnFocus = canvas.designSpace.workspace.getNodeThatIsOnFocus()
- if (nodeOnFocus !== undefined) {
- if (nodeOnFocus.payload.uiObject.codeEditor !== undefined) {
- if (nodeOnFocus.payload.uiObject.codeEditor.visible === true) {
- return
- }
- }
- if (nodeOnFocus.payload.uiObject.configEditor !== undefined) {
- if (nodeOnFocus.payload.uiObject.configEditor.visible === true) {
- return
- }
- }
- if (nodeOnFocus.payload.uiObject.formulaEditor !== undefined) {
- if (nodeOnFocus.payload.uiObject.formulaEditor.visible === true) {
- return
- }
- }
- if (nodeOnFocus.payload.uiObject.conditionEditor !== undefined) {
- if (nodeOnFocus.payload.uiObject.conditionEditor.visible === true) {
- return
- }
- }
- if (nodeOnFocus.payload.uiObject.uiObjectTitle !== undefined) {
- if (nodeOnFocus.payload.uiObject.uiObjectTitle.editMode === true) {
- return
- }
- }
- }
-
- if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true && event.shiftKey === true && event.keyCode === 123) { // Dev Tool when used with F12
- if (nodeOnFocus !== undefined) {
- console.log(nodeOnFocus)
- return
- }
- }
-
- if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true && event.shiftKey === true && event.keyCode === 122) { // Dev Tool when used with F11
- if (SHOW_ANIMATION_PERFORMACE === false) {
- SHOW_ANIMATION_PERFORMACE = true
- } else {
- SHOW_ANIMATION_PERFORMACE = false
- }
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowUp') {
- thisObject.cockpitSpace.toTop()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowDown') {
- thisObject.cockpitSpace.toBottom()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowLeft') {
- thisObject.cockpitSpace.moveUp()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowRight') {
- thisObject.cockpitSpace.moveDown()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowLeft') {
- canvas.chartingSpace.oneScreenLeft()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowRight') {
- canvas.chartingSpace.oneScreenRight()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowUp') {
- canvas.chartingSpace.oneScreenUp()
- event.preventDefault()
- return
- }
-
- if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowDown') {
- canvas.chartingSpace.oneScreenDown()
- event.preventDefault()
- return
- }
-
- if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowLeft') {
- let displaceVector = canvas.floatingSpace.oneScreenLeft()
- if (displaceVector !== undefined) {
- dragVector.downX = dragVector.downX + displaceVector.x
- dragVector.downY = dragVector.downY + displaceVector.y
- checkDrag()
- }
- event.preventDefault()
- return
- }
-
- if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowRight') {
- let displaceVector = canvas.floatingSpace.oneScreenRight()
- if (displaceVector !== undefined) {
- dragVector.downX = dragVector.downX + displaceVector.x
- dragVector.downY = dragVector.downY + displaceVector.y
- checkDrag()
- }
- event.preventDefault()
- return
- }
-
- if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowUp') {
- let displaceVector = canvas.floatingSpace.oneScreenUp()
- if (displaceVector !== undefined) {
- dragVector.downX = dragVector.downX + displaceVector.x
- dragVector.downY = dragVector.downY + displaceVector.y
- checkDrag()
- }
- event.preventDefault()
- return
- }
-
- if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowDown') {
- let displaceVector = canvas.floatingSpace.oneScreenDown()
- if (displaceVector !== undefined) {
- dragVector.downX = dragVector.downX + displaceVector.x
- dragVector.downY = dragVector.downY + displaceVector.y
- checkDrag()
- }
- event.preventDefault()
- return
- }
-
- if (event.code === 'Period') {
- if (nodeOnFocus !== undefined) {
- nodeOnFocus.payload.uiObject.setValue('Id: ' + nodeOnFocus.id)
- return
- }
- }
-
- if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true) {
- /* Shortcuts to nodes */
- if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 65 && event.keyCode <= 90)) {
- /* From here we prevent the default behaviour. Putting it earlier prevents imput box and text area to receive keystrokes */
- event.preventDefault()
-
- let nodeUsingThisKey = canvas.designSpace.workspace.getNodeByShortcutKey(event.key)
-
- if (nodeOnFocus === undefined && nodeUsingThisKey !== undefined) {
- /* Then we displace the whole workspace to center it at the node using this key */
- nodeUsingThisKey = canvas.floatingSpace.positionAtNode(nodeUsingThisKey)
- return
- }
-
- /* If there is a node in focus, we try to assign the key to it. */
- if (nodeUsingThisKey !== undefined && nodeOnFocus !== undefined) {
- if (nodeUsingThisKey.id === nodeOnFocus.id) {
- nodeOnFocus.payload.uiObject.shortcutKey = ''
- nodeOnFocus.payload.uiObject.setValue('Shortcut Key Removed ')
- return
- } else {
- if (lastShortcutKeyRejection !== event.key + nodeUsingThisKey.type + ' ' + nodeUsingThisKey.name) {
- /* The first time we show a warning that this key is in use. */
- nodeOnFocus.payload.uiObject.setErrorMessage('Key already in use by ' + nodeUsingThisKey.type + ' ' + nodeUsingThisKey.name)
- lastShortcutKeyRejection = event.key + nodeUsingThisKey.type + ' ' + nodeUsingThisKey.name
- return
+ if (ARE_WE_RECORDING_A_VIDEO === false) {
+ console.log('RECORDING', constructorParams.format)
+ mediaRecorder = new CCapture(constructorParams)
+ mediaRecorder.start()
+ ARE_WE_RECORDING_A_VIDEO = true
} else {
- /* After the warning, we allow the key to be re-assigned */
- nodeUsingThisKey.payload.uiObject.shortcutKey = ''
- nodeUsingThisKey === undefined
+ console.log('SAVING', constructorParams.format)
+ ARE_WE_RECORDING_A_VIDEO = false
+ mediaRecorder.stop()
+ mediaRecorder.save()
}
- }
}
- /* If there is not node using this key and a node in focus, we assign this key to this node */
- if (nodeUsingThisKey === undefined && nodeOnFocus !== undefined) {
- nodeOnFocus.payload.uiObject.shortcutKey = event.key
- nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + event.key)
- }
- return
- }
}
- if (event.ctrlKey === true && event.altKey === true && nodeOnFocus !== undefined) {
- if (nodeOnFocus.payload.uiObject.shortcutKey !== undefined && nodeOnFocus.payload.uiObject.shortcutKey !== '') {
- nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + nodeOnFocus.payload.uiObject.shortcutKey)
- }
+ function onKeyUp(event) {
+ thisObject.mouse.event = event
+ thisObject.mouse.action = 'key up'
}
- }
- function onDragEnter (event) {
- try {
- event.preventDefault()
- event.stopPropagation()
- thisObject.cockpitSpace.toTop()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onDragEnter -> err = ' + err.stack) }
- }
- }
+ function onKeyDown(event) {
+ if (EDITOR_ON_FOCUS === true) { return }
+ thisObject.mouse.event = event
+ thisObject.mouse.action = 'key down'
- function onDragLeave (event) {
- try {
- event.preventDefault()
- event.stopPropagation()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onDragLeave -> err = ' + err.stack) }
- }
- }
+ checkMediaRecording(event)
+ canvas.chartingSpace.onKeyPressed(event)
- function onDragOver (event) {
- try {
- event.preventDefault()
- event.stopPropagation()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onDragOver -> err = ' + err.stack) }
- }
- }
-
- function onDragDrop (event) {
- try {
- event.preventDefault()
- event.stopPropagation()
-
- let files = event.dataTransfer.files
-
- handleFiles(files)
- function handleFiles (files) {
- ([...files]).forEach(loadFileData)
- }
-
- function loadFileData (file) {
- let reader = new FileReader()
- reader.readAsText(file)
- reader.onloadend = function () {
- let mousePosition = {
- x: event.x,
- y: event.y
- }
- thisObject.designSpace.workspace.spawn(reader.result, mousePosition)
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onDragDrop -> err = ' + err.stack) }
- }
- }
-
- function onMouseDown (event) {
- try {
- thisObject.mouse.event = event
- thisObject.mouse.position.x = event.pageX
- thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
- switch (event.buttons) {
- case 1: {
- thisObject.mouse.action = 'clicking with left button'
- break
- }
- case 2: {
- thisObject.mouse.action = 'clicking with right button'
- break
- }
- }
-
- let point = event
- point.x = event.pageX
- point.y = event.pageY - CURRENT_TOP_MARGIN
-
- dragVector.downX = point.x
- dragVector.downY = point.y
-
- let container
-
- /* We check if the mouse is over an element of the Side Space / */
- container = thisObject.sideSpace.getContainer(point)
-
- if (container !== undefined && container.isDraggeable === true) {
- containerBeingDragged = container
- containerDragStarted = true
- containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
- return
- }
-
- if (container !== undefined && container.isDraggeable === false) {
- return
- }
-
- /* We check if the mouse is over an element of the Design Space / */
- container = thisObject.designSpace.getContainer(point)
-
- if (container !== undefined && container.isDraggeable === true) {
- containerBeingDragged = container
- containerDragStarted = true
- containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
- return
- }
-
- if (container !== undefined && container.isDraggeable === false) {
- return
- }
-
- /* We check if the mouse is over an element of the Top Space / */
- container = thisObject.topSpace.getContainer(point)
-
- if (container !== undefined && container.isDraggeable === true) {
- containerBeingDragged = container
- containerDragStarted = true
- containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
- return
- }
-
- /* We check if the mouse is over an element of the CockpitSpace / */
- container = thisObject.cockpitSpace.getContainer(point)
-
- if (container !== undefined && container.isDraggeable === true) {
- containerBeingDragged = container
- containerDragStarted = true
- containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
- return
- }
-
- if (container !== undefined && container.isClickeable === true) {
- /* We dont want to mess up with the click */
- return
- }
-
- /* We check if the mouse is over a panel/ */
- container = thisObject.panelsSpace.getContainer(point, GET_CONTAINER_PURPOSE.DRAGGING)
-
- if (container !== undefined && event.shiftKey === false) {
- if (container.isDraggeable === true) {
- containerBeingDragged = container
- containerDragStarted = true
- containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
- return
- } else {
- return
- }
- }
-
- if (container !== undefined && container.isClickeable === true) {
- /* We dont want to mess up with the click */
- return
- }
-
- /* we check if it is over any of the existing containers at the Charting Space. */
- container = thisObject.chartingSpace.getContainer(point, GET_CONTAINER_PURPOSE.DRAGGING)
-
- if (container !== undefined) {
- if (container.isDraggeable === true) {
- containerBeingDragged = container
- containerDragStarted = true
- containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
- return
- } else {
- if (container.isClickeable === false) {
- if (event.buttons === 2) {
- viewPortBeingDragged = true
+ /* Shourcuts to Menu Items */
+ if ((event.keyCode >= 48 && event.keyCode <= 57)) {
+ let number = event.key
+ if (MENU_ITEM_ON_FOCUS !== undefined) {
+ let menuItem = thisObject.shorcutNumbers.get(number)
+ if (menuItem !== undefined) {
+ menuItem.shorcutNumber = undefined
+ }
+ thisObject.shorcutNumbers.set(number, MENU_ITEM_ON_FOCUS)
+ MENU_ITEM_ON_FOCUS.shorcutNumber = number
+ } else {
+ let menuItem = thisObject.shorcutNumbers.get(number)
+ if (menuItem !== undefined) {
+ menuItem.internalClick()
+ }
}
- }
- return
}
- }
- container = thisObject.floatingSpace.getContainer(point)
-
- if (container !== undefined && container.isDraggeable === true) {
- containerBeingDragged = container
- containerDragStarted = true
- floatingObjectDragStarted = true
- containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
-
- if (event.candelDragging === true) {
- containerBeingDragged = undefined
- containerDragStarted = false
- floatingObjectDragStarted = false
+ if (event.key === 'Escape' && canvas.floatingSpace.inMapMode === true) {
+ canvas.floatingSpace.exitMapMode()
}
- return
- }
- if (container !== undefined && container.isClickeable === true) {
- /* We dont want to mess up with the click */
- return
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onMouseDown -> err = ' + err.stack) }
- }
- }
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'M' || event.key === 'm')) {
+ canvas.floatingSpace.toggleMapMode()
+ event.preventDefault()
+ return
+ }
- function onMouseClick (event) {
- try {
- if (ignoreNextClick === true) {
- ignoreNextClick = false
- return
- }
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'R' || event.key === 'r')) {
+ canvas.floatingSpace.toggleDrawReferenceLines()
+ event.preventDefault()
+ return
+ }
- let point = event
- point.x = event.pageX
- point.y = event.pageY - CURRENT_TOP_MARGIN
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'C' || event.key === 'c')) {
+ canvas.floatingSpace.toggleDrawChainLines()
+ event.preventDefault()
+ return
+ }
- let container
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'S' || event.key === 's')) {
+ canvas.designSpace.workspace.save()
+ event.preventDefault()
+ return
+ }
- /* We check if the mouse is over an element of the Side Space / */
- container = thisObject.sideSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_CLICK)
-
- if (container !== undefined && container.isClickeable === true) {
- container.eventHandler.raiseEvent('onMouseClick', point)
- return
- }
-
- /* We check if the mouse is over an element of the Design Space / */
- container = thisObject.designSpace.getContainer(point)
-
- if (container !== undefined && container.isClickeable === true) {
- container.eventHandler.raiseEvent('onMouseClick', point)
- return
- }
-
- /* We check if the mouse is over an element of the Top Space / */
- container = thisObject.topSpace.getContainer(point)
-
- if (container !== undefined && container.isClickeable === true) {
- container.eventHandler.raiseEvent('onMouseClick', point)
- return
- }
-
- /* We check if the mouse is over an element of the CockpitSpace / */
- container = thisObject.cockpitSpace.getContainer(point)
-
- if (container !== undefined && container.isClickeable === true) {
- container.eventHandler.raiseEvent('onMouseClick', point)
- return
- }
-
- /* We check if the mouse is over a panel/ */
- container = thisObject.panelsSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_CLICK)
-
- if (container !== undefined && container.isClickeable === true) {
- container.eventHandler.raiseEvent('onMouseClick', point)
- return
- }
-
- /* If it is not, then we check if it is over any of the existing containers at the Charting Space. */
- container = thisObject.chartingSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_CLICK)
-
- if (container !== undefined && container.isClickeable === true) {
- container.eventHandler.raiseEvent('onMouseClick', point)
- return
- }
-
- /* We check if the mouse is over a floatingObject/ */
- container = thisObject.floatingSpace.getContainer(point)
-
- if (container !== undefined && container.isClickeable === true) {
- container.eventHandler.raiseEvent('onMouseClick', point)
- return
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onMouseClick -> err = ' + err.stack) }
- }
- }
-
- function onMouseOut (event) {
- deactivateDragging(event)
-
- /* When the mouse leaves the canvas, our elements needs to react to the fact that the mouse is over a far away place */
- let thisEvent = {
- pageX: VERY_LARGE_NUMBER,
- pageY: VERY_LARGE_NUMBER
- }
- onMouseOver(thisEvent)
- }
-
- function onMouseUp (event) {
- deactivateDragging(event)
- }
-
- function onMouseMove (event) {
- try {
- thisObject.mouse.event = event
- thisObject.mouse.position.x = event.pageX
- thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
- thisObject.mouse.action = 'moving'
-
- /* Processing the event */
- let point = event
- point.x = event.pageX
- point.y = event.pageY - CURRENT_TOP_MARGIN
-
- if (canvas.chartingSpace.viewport !== undefined) {
- canvas.chartingSpace.viewport.mousePosition.x = point.x
- canvas.chartingSpace.viewport.mousePosition.y = point.y
- }
-
- if (containerDragStarted === true || floatingObjectDragStarted === true || viewPortBeingDragged === true) {
- if (floatingObjectDragStarted === true) {
- let targetContainer = thisObject.floatingSpace.getContainer(point)
- if (targetContainer !== undefined) {
- if (targetContainer.id !== containerBeingDragged.id) {
- containerBeingDragged.eventHandler.raiseEvent('onDragFinished', point)
- containerBeingDragged = undefined
- containerDragStarted = false
- floatingObjectDragStarted = false
- browserCanvas.style.cursor = 'auto'
- ignoreNextClick = true
- return
+ let nodeOnFocus = canvas.designSpace.workspace.getNodeThatIsOnFocus()
+ if (nodeOnFocus !== undefined) {
+ if (nodeOnFocus.payload.uiObject.codeEditor !== undefined) {
+ if (nodeOnFocus.payload.uiObject.codeEditor.visible === true) {
+ return
+ }
}
- } else {
- containerBeingDragged.eventHandler.raiseEvent('onDragFinished', point)
+ if (nodeOnFocus.payload.uiObject.configEditor !== undefined) {
+ if (nodeOnFocus.payload.uiObject.configEditor.visible === true) {
+ return
+ }
+ }
+ if (nodeOnFocus.payload.uiObject.formulaEditor !== undefined) {
+ if (nodeOnFocus.payload.uiObject.formulaEditor.visible === true) {
+ return
+ }
+ }
+ if (nodeOnFocus.payload.uiObject.conditionEditor !== undefined) {
+ if (nodeOnFocus.payload.uiObject.conditionEditor.visible === true) {
+ return
+ }
+ }
+ if (nodeOnFocus.payload.uiObject.uiObjectTitle !== undefined) {
+ if (nodeOnFocus.payload.uiObject.uiObjectTitle.editMode === true) {
+ return
+ }
+ }
+ }
+
+ if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true && event.shiftKey === true && event.keyCode === 123) { // Dev Tool when used with F12
+ if (nodeOnFocus !== undefined) {
+ console.log(nodeOnFocus)
+ return
+ }
+ }
+
+ if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true && event.shiftKey === true && event.keyCode === 122) { // Dev Tool when used with F11
+ if (SHOW_ANIMATION_PERFORMACE === false) {
+ SHOW_ANIMATION_PERFORMACE = true
+ } else {
+ SHOW_ANIMATION_PERFORMACE = false
+ }
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowUp') {
+ thisObject.cockpitSpace.toTop()
+ event.preventDefault()
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowDown') {
+ thisObject.cockpitSpace.toBottom()
+ event.preventDefault()
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowLeft') {
+ thisObject.cockpitSpace.moveUp()
+ event.preventDefault()
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && event.code === 'ArrowRight') {
+ thisObject.cockpitSpace.moveDown()
+ event.preventDefault()
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowLeft') {
+ canvas.chartingSpace.oneScreenLeft()
+ event.preventDefault()
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowRight') {
+ canvas.chartingSpace.oneScreenRight()
+ event.preventDefault()
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowUp') {
+ canvas.chartingSpace.oneScreenUp()
+ event.preventDefault()
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === false && event.metaKey === false) && event.code === 'ArrowDown') {
+ canvas.chartingSpace.oneScreenDown()
+ event.preventDefault()
+ return
+ }
+
+ if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowLeft') {
+ let displaceVector = canvas.floatingSpace.oneScreenLeft()
+ if (displaceVector !== undefined) {
+ dragVector.downX = dragVector.downX + displaceVector.x
+ dragVector.downY = dragVector.downY + displaceVector.y
+ checkDrag()
+ }
+ event.preventDefault()
+ return
+ }
+
+ if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowRight') {
+ let displaceVector = canvas.floatingSpace.oneScreenRight()
+ if (displaceVector !== undefined) {
+ dragVector.downX = dragVector.downX + displaceVector.x
+ dragVector.downY = dragVector.downY + displaceVector.y
+ checkDrag()
+ }
+ event.preventDefault()
+ return
+ }
+
+ if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowUp') {
+ let displaceVector = canvas.floatingSpace.oneScreenUp()
+ if (displaceVector !== undefined) {
+ dragVector.downX = dragVector.downX + displaceVector.x
+ dragVector.downY = dragVector.downY + displaceVector.y
+ checkDrag()
+ }
+ event.preventDefault()
+ return
+ }
+
+ if ((event.ctrlKey === true || event.metaKey === true) && event.shiftKey === false && event.code === 'ArrowDown') {
+ let displaceVector = canvas.floatingSpace.oneScreenDown()
+ if (displaceVector !== undefined) {
+ dragVector.downX = dragVector.downX + displaceVector.x
+ dragVector.downY = dragVector.downY + displaceVector.y
+ checkDrag()
+ }
+ event.preventDefault()
+ return
+ }
+
+ if (event.code === 'Period') {
+ if (nodeOnFocus !== undefined) {
+ nodeOnFocus.payload.uiObject.setValue('Id: ' + nodeOnFocus.id)
+ return
+ }
+ }
+
+ if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true) {
+ /* Shortcuts to nodes */
+ if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 65 && event.keyCode <= 90)) {
+ /* From here we prevent the default behaviour. Putting it earlier prevents imput box and text area to receive keystrokes */
+ event.preventDefault()
+
+ let nodeUsingThisKey = canvas.designSpace.workspace.getNodeByShortcutKey(event.key)
+
+ if (nodeOnFocus === undefined && nodeUsingThisKey !== undefined) {
+ /* Then we displace the whole workspace to center it at the node using this key */
+ nodeUsingThisKey = canvas.floatingSpace.positionAtNode(nodeUsingThisKey)
+ return
+ }
+
+ /* If there is a node in focus, we try to assign the key to it. */
+ if (nodeUsingThisKey !== undefined && nodeOnFocus !== undefined) {
+ if (nodeUsingThisKey.id === nodeOnFocus.id) {
+ nodeOnFocus.payload.uiObject.shortcutKey = ''
+ nodeOnFocus.payload.uiObject.setValue('Shortcut Key Removed ')
+ return
+ } else {
+ if (lastShortcutKeyRejection !== event.key + nodeUsingThisKey.type + ' ' + nodeUsingThisKey.name) {
+ /* The first time we show a warning that this key is in use. */
+ nodeOnFocus.payload.uiObject.setErrorMessage('Key already in use by ' + nodeUsingThisKey.type + ' ' + nodeUsingThisKey.name)
+ lastShortcutKeyRejection = event.key + nodeUsingThisKey.type + ' ' + nodeUsingThisKey.name
+ return
+ } else {
+ /* After the warning, we allow the key to be re-assigned */
+ nodeUsingThisKey.payload.uiObject.shortcutKey = ''
+ nodeUsingThisKey === undefined
+ }
+ }
+ }
+ /* If there is not node using this key and a node in focus, we assign this key to this node */
+ if (nodeUsingThisKey === undefined && nodeOnFocus !== undefined) {
+ nodeOnFocus.payload.uiObject.shortcutKey = event.key
+ nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + event.key)
+ }
+ return
+ }
+ }
+
+ if (event.ctrlKey === true && event.altKey === true && nodeOnFocus !== undefined) {
+ if (nodeOnFocus.payload.uiObject.shortcutKey !== undefined && nodeOnFocus.payload.uiObject.shortcutKey !== '') {
+ nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + nodeOnFocus.payload.uiObject.shortcutKey)
+ }
+ }
+ }
+
+ function onDragEnter(event) {
+ try {
+ event.preventDefault()
+ event.stopPropagation()
+ thisObject.cockpitSpace.toTop()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onDragEnter -> err = ' + err.stack) }
+ }
+ }
+
+ function onDragLeave(event) {
+ try {
+ event.preventDefault()
+ event.stopPropagation()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onDragLeave -> err = ' + err.stack) }
+ }
+ }
+
+ function onDragOver(event) {
+ try {
+ event.preventDefault()
+ event.stopPropagation()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onDragOver -> err = ' + err.stack) }
+ }
+ }
+
+ function onDragDrop(event) {
+ try {
+ event.preventDefault()
+ event.stopPropagation()
+
+ let files = event.dataTransfer.files
+
+ handleFiles(files)
+ function handleFiles(files) {
+ ([...files]).forEach(loadFileData)
+ }
+
+ function loadFileData(file) {
+ let reader = new FileReader()
+ reader.readAsText(file)
+ reader.onloadend = function () {
+ let mousePosition = {
+ x: event.x,
+ y: event.y
+ }
+ thisObject.designSpace.workspace.spawn(reader.result, mousePosition)
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onDragDrop -> err = ' + err.stack) }
+ }
+ }
+
+ function onMouseDown(event) {
+ try {
+ thisObject.mouse.event = event
+ thisObject.mouse.position.x = event.pageX
+ thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
+ switch (event.buttons) {
+ case 1: {
+ thisObject.mouse.action = 'clicking with left button'
+ break
+ }
+ case 2: {
+ thisObject.mouse.action = 'clicking with right button'
+ break
+ }
+ }
+
+ let point = event
+ point.x = event.pageX
+ point.y = event.pageY - CURRENT_TOP_MARGIN
+
+ dragVector.downX = point.x
+ dragVector.downY = point.y
+
+ let container
+
+ /* We check if the mouse is over an element of the Side Space / */
+ container = thisObject.sideSpace.getContainer(point)
+
+ if (container !== undefined && container.isDraggeable === true) {
+ containerBeingDragged = container
+ containerDragStarted = true
+ containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
+ return
+ }
+
+ if (container !== undefined && container.isDraggeable === false) {
+ return
+ }
+
+ /* We check if the mouse is over an element of the Design Space / */
+ container = thisObject.designSpace.getContainer(point)
+
+ if (container !== undefined && container.isDraggeable === true) {
+ containerBeingDragged = container
+ containerDragStarted = true
+ containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
+ return
+ }
+
+ if (container !== undefined && container.isDraggeable === false) {
+ return
+ }
+
+ /* We check if the mouse is over an element of the Top Space / */
+ container = thisObject.topSpace.getContainer(point)
+
+ if (container !== undefined && container.isDraggeable === true) {
+ containerBeingDragged = container
+ containerDragStarted = true
+ containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
+ return
+ }
+
+ /* We check if the mouse is over an element of the CockpitSpace / */
+ container = thisObject.cockpitSpace.getContainer(point)
+
+ if (container !== undefined && container.isDraggeable === true) {
+ containerBeingDragged = container
+ containerDragStarted = true
+ containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
+ return
+ }
+
+ if (container !== undefined && container.isClickeable === true) {
+ /* We dont want to mess up with the click */
+ return
+ }
+
+ /* We check if the mouse is over a panel/ */
+ container = thisObject.panelsSpace.getContainer(point, GET_CONTAINER_PURPOSE.DRAGGING)
+
+ if (container !== undefined && event.shiftKey === false) {
+ if (container.isDraggeable === true) {
+ containerBeingDragged = container
+ containerDragStarted = true
+ containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
+ return
+ } else {
+ return
+ }
+ }
+
+ if (container !== undefined && container.isClickeable === true) {
+ /* We dont want to mess up with the click */
+ return
+ }
+
+ /* we check if it is over any of the existing containers at the Charting Space. */
+ container = thisObject.chartingSpace.getContainer(point, GET_CONTAINER_PURPOSE.DRAGGING)
+
+ if (container !== undefined) {
+ if (container.isDraggeable === true) {
+ containerBeingDragged = container
+ containerDragStarted = true
+ containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
+ return
+ } else {
+ if (container.isClickeable === false) {
+ if (event.buttons === 2) {
+ viewPortBeingDragged = true
+ }
+ }
+ return
+ }
+ }
+
+ container = thisObject.floatingSpace.getContainer(point)
+
+ if (container !== undefined && container.isDraggeable === true) {
+ containerBeingDragged = container
+ containerDragStarted = true
+ floatingObjectDragStarted = true
+ containerBeingDragged.eventHandler.raiseEvent('onDragStarted', point)
+
+ if (event.candelDragging === true) {
+ containerBeingDragged = undefined
+ containerDragStarted = false
+ floatingObjectDragStarted = false
+ }
+ return
+ }
+
+ if (container !== undefined && container.isClickeable === true) {
+ /* We dont want to mess up with the click */
+ return
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onMouseDown -> err = ' + err.stack) }
+ }
+ }
+
+ function onMouseClick(event) {
+ try {
+ if (ignoreNextClick === true) {
+ ignoreNextClick = false
+ return
+ }
+
+ let point = event
+ point.x = event.pageX
+ point.y = event.pageY - CURRENT_TOP_MARGIN
+
+ let container
+
+ /* We check if the mouse is over an element of the Side Space / */
+ container = thisObject.sideSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_CLICK)
+
+ if (container !== undefined && container.isClickeable === true) {
+ container.eventHandler.raiseEvent('onMouseClick', point)
+ return
+ }
+
+ /* We check if the mouse is over an element of the Design Space / */
+ container = thisObject.designSpace.getContainer(point)
+
+ if (container !== undefined && container.isClickeable === true) {
+ container.eventHandler.raiseEvent('onMouseClick', point)
+ return
+ }
+
+ /* We check if the mouse is over an element of the Top Space / */
+ container = thisObject.topSpace.getContainer(point)
+
+ if (container !== undefined && container.isClickeable === true) {
+ container.eventHandler.raiseEvent('onMouseClick', point)
+ return
+ }
+
+ /* We check if the mouse is over an element of the CockpitSpace / */
+ container = thisObject.cockpitSpace.getContainer(point)
+
+ if (container !== undefined && container.isClickeable === true) {
+ container.eventHandler.raiseEvent('onMouseClick', point)
+ return
+ }
+
+ /* We check if the mouse is over a panel/ */
+ container = thisObject.panelsSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_CLICK)
+
+ if (container !== undefined && container.isClickeable === true) {
+ container.eventHandler.raiseEvent('onMouseClick', point)
+ return
+ }
+
+ /* If it is not, then we check if it is over any of the existing containers at the Charting Space. */
+ container = thisObject.chartingSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_CLICK)
+
+ if (container !== undefined && container.isClickeable === true) {
+ container.eventHandler.raiseEvent('onMouseClick', point)
+ return
+ }
+
+ /* We check if the mouse is over a floatingObject/ */
+ container = thisObject.floatingSpace.getContainer(point)
+
+ if (container !== undefined && container.isClickeable === true) {
+ container.eventHandler.raiseEvent('onMouseClick', point)
+ return
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onMouseClick -> err = ' + err.stack) }
+ }
+ }
+
+ function onMouseOut(event) {
+ deactivateDragging(event)
+
+ /* When the mouse leaves the canvas, our elements needs to react to the fact that the mouse is over a far away place */
+ let thisEvent = {
+ pageX: VERY_LARGE_NUMBER,
+ pageY: VERY_LARGE_NUMBER
+ }
+ onMouseOver(thisEvent)
+ }
+
+ function onMouseUp(event) {
+ deactivateDragging(event)
+ }
+
+ function onMouseMove(event) {
+ try {
+ thisObject.mouse.event = event
+ thisObject.mouse.position.x = event.pageX
+ thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
+ thisObject.mouse.action = 'moving'
+
+ /* Processing the event */
+ let point = event
+ point.x = event.pageX
+ point.y = event.pageY - CURRENT_TOP_MARGIN
+
+ if (canvas.chartingSpace.viewport !== undefined) {
+ canvas.chartingSpace.viewport.mousePosition.x = point.x
+ canvas.chartingSpace.viewport.mousePosition.y = point.y
+ }
+
+ if (containerDragStarted === true || floatingObjectDragStarted === true || viewPortBeingDragged === true) {
+ if (floatingObjectDragStarted === true) {
+ let targetContainer = thisObject.floatingSpace.getContainer(point)
+ if (targetContainer !== undefined) {
+ if (targetContainer.id !== containerBeingDragged.id) {
+ containerBeingDragged.eventHandler.raiseEvent('onDragFinished', point)
+ containerBeingDragged = undefined
+ containerDragStarted = false
+ floatingObjectDragStarted = false
+ browserCanvas.style.cursor = 'auto'
+ ignoreNextClick = true
+ return
+ }
+ } else {
+ containerBeingDragged.eventHandler.raiseEvent('onDragFinished', point)
+ containerDragStarted = false
+ containerBeingDragged = undefined
+ floatingObjectDragStarted = false
+ browserCanvas.style.cursor = 'auto'
+ ignoreNextClick = true
+ return
+ }
+ }
+
+ dragVector.upX = point.x
+ dragVector.upY = point.y
+
+ checkDrag(event)
+ }
+ onMouseOver(event)
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onMouseMove -> err = ' + err.stack) }
+ }
+ }
+
+ function onMouseOver(event) {
+ try {
+ let point = event
+ point.x = event.pageX
+ point.y = event.pageY - CURRENT_TOP_MARGIN
+
+ if (containerDragStarted === true) {
+ containerBeingDragged.eventHandler.raiseEvent('onMouseOver', point)
+ return
+ }
+
+ /* Then we check who is the current object underneeth the mounse. */
+
+ let container
+
+ /* We check if the mouse is over an element of the Designe Space / */
+ if (thisObject.sideSpace !== undefined) {
+ container = thisObject.sideSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_OVER)
+
+ if (container !== undefined && container.detectMouseOver === true) {
+ containerFound()
+ return
+ }
+ }
+
+ /* We check if the mouse is over an element of the Designe Space / */
+ if (thisObject.designSpace !== undefined) {
+ container = thisObject.designSpace.getContainer(point)
+
+ if (container !== undefined && container.detectMouseOver === true) {
+ containerFound()
+ return
+ }
+ }
+
+ /* We check if the mouse is over an element of the Top Space / */
+ if (thisObject.topSpace !== undefined) {
+ container = thisObject.topSpace.getContainer(point)
+
+ if (container !== undefined && container.detectMouseOver === true) {
+ containerFound()
+ return
+ }
+ }
+
+ /* We check if the mouse is over an element of the CockpitSpace / */
+ if (thisObject.cockpitSpace !== undefined) {
+ container = thisObject.cockpitSpace.getContainer(point)
+
+ if (container !== undefined && container.detectMouseOver === true) {
+ containerFound()
+ return
+ }
+ }
+
+ /* We check if the mouse is over a panel/ */
+ if (thisObject.panelsSpace !== undefined) {
+ container = thisObject.panelsSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_OVER)
+
+ if (container !== undefined && container.detectMouseOver === true) {
+ containerFound()
+ return
+ }
+ }
+
+ /* If it is not, then we check if it is over any of the existing containers at the Charting Space. */
+ if (thisObject.chartingSpace !== undefined) {
+ container = thisObject.chartingSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_OVER)
+
+ if (container !== undefined && container.detectMouseOver === true) {
+ containerFound()
+ return
+ }
+ }
+
+ /* We check if the mouse is over a floatingObject/ */
+ if (thisObject.floatingSpace !== undefined) {
+ container = thisObject.floatingSpace.getContainer(point)
+
+ if (container !== undefined && container.detectMouseOver === true) {
+ containerFound()
+ return
+ }
+ }
+
+ function containerFound() {
+ if (lastContainerMouseOver !== undefined) {
+ if (container.id !== lastContainerMouseOver.id) {
+ lastContainerMouseOver.eventHandler.raiseEvent('onMouseNotOver', point)
+ }
+ }
+ container.eventHandler.raiseEvent('onMouseOver', point)
+ lastContainerMouseOver = container
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onMouseOver -> err = ' + err.stack) }
+ }
+ }
+
+ function onMouseWheel(event) {
+ try {
+ thisObject.mouse.event = event
+ thisObject.mouse.position.x = event.pageX
+ thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
+ thisObject.mouse.action = 'wheel'
+
+ // cross-browser wheel delta
+ var event = window.event || event // old IE support
+ event.delta = Math.max(-1, Math.min(1, event.wheelDelta || -event.detail))
+ if (IS_MAC) {
+ event.delta = event.delta / MAC_AMOUNT_FACTOR
+ }
+
+ /* We try first with panels. */
+
+ let point = {
+ x: event.pageX,
+ y: event.pageY - CURRENT_TOP_MARGIN
+ }
+
+ event.mousePosition = point
+ let container
+
+ /* Side Space */
+ container = canvas.sideSpace.getContainer({ x: point.x, y: point.y })
+
+ if (container !== undefined && container.isWheelable === true) {
+ container.eventHandler.raiseEvent('onMouseWheel', event)
+ return false // This instructs the browser not to take the event and scroll the page.
+ }
+
+ /* Panel Space */
+ container = canvas.panelsSpace.getContainer({ x: point.x, y: point.y })
+
+ if (container !== undefined && container.isWheelable === true) {
+ container.eventHandler.raiseEvent('onMouseWheel', event)
+ return false // This instructs the browser not to take the event and scroll the page.
+ }
+
+ /* We try the CockpitSpace. */
+ container = canvas.cockpitSpace.getContainer({ x: point.x, y: point.y })
+
+ if (container !== undefined && container.isWheelable === true) {
+ container.eventHandler.raiseEvent('onMouseWheel', event)
+ return false // This instructs the browser not to take the event and scroll the page.
+ }
+
+ /* Charting Space. */
+ container = canvas.chartingSpace.getContainer({ x: point.x, y: point.y }, GET_CONTAINER_PURPOSE.MOUSE_WHEEL)
+ if (container !== undefined && container.isWheelable === true) {
+ container.eventHandler.raiseEvent('onMouseWheel', event)
+ return false // This instructs the browser not to take the event and scroll the page.
+ }
+
+ if (container !== undefined) {
+ canvas.chartingSpace.viewport.onMouseWheel(event)
+ return false
+ }
+
+ /* We try second with floating objects. */
+ container = canvas.floatingSpace.getContainer({ x: point.x, y: point.y })
+
+ if (container !== undefined && container.isWheelable === true) {
+ container.eventHandler.raiseEvent('onMouseWheel', event)
+ return false // This instructs the browser not to take the event and scroll the page.
+ }
+
+ return false
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onMouseWheel -> err = ' + err.stack) }
+ }
+ }
+
+ function deactivateDragging(event) {
+ try {
+ if (containerDragStarted || viewPortBeingDragged || floatingObjectDragStarted) {
+ thisObject.eventHandler.raiseEvent('Drag Finished', undefined)
+ }
+
+ if (
+ containerDragStarted ||
+ floatingObjectDragStarted ||
+ viewPortBeingDragged
+ ) {
+ ignoreNextClick = false
+ }
+ /* Turn off all the possible things that can be dragged. */
+
containerDragStarted = false
- containerBeingDragged = undefined
floatingObjectDragStarted = false
- browserCanvas.style.cursor = 'auto'
- ignoreNextClick = true
- return
- }
- }
+ viewPortBeingDragged = false
- dragVector.upX = point.x
- dragVector.upY = point.y
-
- checkDrag(event)
- }
- onMouseOver(event)
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onMouseMove -> err = ' + err.stack) }
- }
- }
-
- function onMouseOver (event) {
- try {
- let point = event
- point.x = event.pageX
- point.y = event.pageY - CURRENT_TOP_MARGIN
-
- if (containerDragStarted === true) {
- containerBeingDragged.eventHandler.raiseEvent('onMouseOver', point)
- return
- }
-
- /* Then we check who is the current object underneeth the mounse. */
-
- let container
-
- /* We check if the mouse is over an element of the Designe Space / */
- if (thisObject.sideSpace !== undefined) {
- container = thisObject.sideSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_OVER)
-
- if (container !== undefined && container.detectMouseOver === true) {
- containerFound()
- return
- }
- }
-
- /* We check if the mouse is over an element of the Designe Space / */
- if (thisObject.designSpace !== undefined) {
- container = thisObject.designSpace.getContainer(point)
-
- if (container !== undefined && container.detectMouseOver === true) {
- containerFound()
- return
- }
- }
-
- /* We check if the mouse is over an element of the Top Space / */
- if (thisObject.topSpace !== undefined) {
- container = thisObject.topSpace.getContainer(point)
-
- if (container !== undefined && container.detectMouseOver === true) {
- containerFound()
- return
- }
- }
-
- /* We check if the mouse is over an element of the CockpitSpace / */
- if (thisObject.cockpitSpace !== undefined) {
- container = thisObject.cockpitSpace.getContainer(point)
-
- if (container !== undefined && container.detectMouseOver === true) {
- containerFound()
- return
- }
- }
-
- /* We check if the mouse is over a panel/ */
- if (thisObject.panelsSpace !== undefined) {
- container = thisObject.panelsSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_OVER)
-
- if (container !== undefined && container.detectMouseOver === true) {
- containerFound()
- return
- }
- }
-
- /* If it is not, then we check if it is over any of the existing containers at the Charting Space. */
- if (thisObject.chartingSpace !== undefined) {
- container = thisObject.chartingSpace.getContainer(point, GET_CONTAINER_PURPOSE.MOUSE_OVER)
-
- if (container !== undefined && container.detectMouseOver === true) {
- containerFound()
- return
- }
- }
-
- /* We check if the mouse is over a floatingObject/ */
- if (thisObject.floatingSpace !== undefined) {
- container = thisObject.floatingSpace.getContainer(point)
-
- if (container !== undefined && container.detectMouseOver === true) {
- containerFound()
- return
- }
- }
-
- function containerFound () {
- if (lastContainerMouseOver !== undefined) {
- if (container.id !== lastContainerMouseOver.id) {
- lastContainerMouseOver.eventHandler.raiseEvent('onMouseNotOver', point)
- }
- }
- container.eventHandler.raiseEvent('onMouseOver', point)
- lastContainerMouseOver = container
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onMouseOver -> err = ' + err.stack) }
- }
- }
-
- function onMouseWheel (event) {
- try {
- thisObject.mouse.event = event
- thisObject.mouse.position.x = event.pageX
- thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
- thisObject.mouse.action = 'wheel'
-
- // cross-browser wheel delta
- var event = window.event || event // old IE support
- event.delta = Math.max(-1, Math.min(1, event.wheelDelta || -event.detail))
- if (IS_MAC) {
- event.delta = event.delta / MAC_AMOUNT_FACTOR
- }
-
- /* We try first with panels. */
-
- let point = {
- x: event.pageX,
- y: event.pageY - CURRENT_TOP_MARGIN
- }
-
- event.mousePosition = point
- let container
-
- /* Side Space */
- container = canvas.sideSpace.getContainer({ x: point.x, y: point.y })
-
- if (container !== undefined && container.isWheelable === true) {
- container.eventHandler.raiseEvent('onMouseWheel', event)
- return false // This instructs the browser not to take the event and scroll the page.
- }
-
- /* Panel Space */
- container = canvas.panelsSpace.getContainer({ x: point.x, y: point.y })
-
- if (container !== undefined && container.isWheelable === true) {
- container.eventHandler.raiseEvent('onMouseWheel', event)
- return false // This instructs the browser not to take the event and scroll the page.
- }
-
- /* We try the CockpitSpace. */
- container = canvas.cockpitSpace.getContainer({ x: point.x, y: point.y })
-
- if (container !== undefined && container.isWheelable === true) {
- container.eventHandler.raiseEvent('onMouseWheel', event)
- return false // This instructs the browser not to take the event and scroll the page.
- }
-
- /* Charting Space. */
- container = canvas.chartingSpace.getContainer({ x: point.x, y: point.y }, GET_CONTAINER_PURPOSE.MOUSE_WHEEL)
- if (container !== undefined && container.isWheelable === true) {
- container.eventHandler.raiseEvent('onMouseWheel', event)
- return false // This instructs the browser not to take the event and scroll the page.
- }
-
- if (container !== undefined) {
- canvas.chartingSpace.viewport.onMouseWheel(event)
- return false
- }
-
- /* We try second with floating objects. */
- container = canvas.floatingSpace.getContainer({ x: point.x, y: point.y })
-
- if (container !== undefined && container.isWheelable === true) {
- container.eventHandler.raiseEvent('onMouseWheel', event)
- return false // This instructs the browser not to take the event and scroll the page.
- }
-
- return false
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onMouseWheel -> err = ' + err.stack) }
- }
- }
-
- function deactivateDragging (event) {
- try {
- if (containerDragStarted || viewPortBeingDragged || floatingObjectDragStarted) {
- thisObject.eventHandler.raiseEvent('Drag Finished', undefined)
- }
-
- if (
- containerDragStarted ||
- floatingObjectDragStarted ||
- viewPortBeingDragged
- ) {
- ignoreNextClick = false
- }
- /* Turn off all the possible things that can be dragged. */
-
- containerDragStarted = false
- floatingObjectDragStarted = false
- viewPortBeingDragged = false
-
- if (containerBeingDragged !== undefined) {
- containerBeingDragged.eventHandler.raiseEvent('onDragFinished', event)
- containerBeingDragged = undefined
- }
-
- browserCanvas.style.cursor = 'auto'
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] deactivateDragging -> err = ' + err.stack) }
- }
- }
-
- function checkDrag (event) {
- try {
- if (containerDragStarted === true || floatingObjectDragStarted === true || viewPortBeingDragged === true) {
- if (event !== undefined) {
- thisObject.mouse.event = event
- thisObject.mouse.position.x = event.pageX
- thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
- thisObject.mouse.action = 'dragging'
- }
-
- browserCanvas.style.cursor = 'grabbing'
- thisObject.eventHandler.raiseEvent('Dragging', undefined)
-
- if (viewPortBeingDragged) {
- let displaceVector = {
- x: dragVector.upX - dragVector.downX,
- y: dragVector.upY - dragVector.downY
- }
-
- canvas.chartingSpace.viewport.displace(displaceVector)
- }
- if (containerDragStarted) {
- if (containerBeingDragged !== undefined) {
- if (containerBeingDragged.space === 'Charting Space') {
- let downCopy = {
- x: dragVector.downX,
- y: dragVector.downY
- }
-
- let downNoZoom
- downNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(downCopy)
-
- let upCopy = {
- x: dragVector.upX,
- y: dragVector.upY
- }
-
- let upNoZoom
- upNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(upCopy)
-
- displaceVector = {
- x: upNoZoom.x - downNoZoom.x,
- y: upNoZoom.y - downNoZoom.y
- }
-
- let moveSucceed = containerBeingDragged.displace(displaceVector)
- if (moveSucceed === false) {
- deactivateDragging(event)
- }
- } else {
- let displaceVector = {
- x: dragVector.upX - dragVector.downX,
- y: dragVector.upY - dragVector.downY
- }
- let moveSucceed = containerBeingDragged.displace(displaceVector)
- if (moveSucceed === false) {
- deactivateDragging(event)
- }
+ if (containerBeingDragged !== undefined) {
+ containerBeingDragged.eventHandler.raiseEvent('onDragFinished', event)
+ containerBeingDragged = undefined
}
- }
- }
- /* Finally we set the starting point of the new dragVector at this current point. */
- dragVector.downX = dragVector.upX
- dragVector.downY = dragVector.upY
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] checkDrag -> err = ' + err.stack) }
+ browserCanvas.style.cursor = 'auto'
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] deactivateDragging -> err = ' + err.stack) }
+ }
+ }
+
+ function checkDrag(event) {
+ try {
+ if (containerDragStarted === true || floatingObjectDragStarted === true || viewPortBeingDragged === true) {
+ if (event !== undefined) {
+ thisObject.mouse.event = event
+ thisObject.mouse.position.x = event.pageX
+ thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
+ thisObject.mouse.action = 'dragging'
+ }
+
+ browserCanvas.style.cursor = 'grabbing'
+ thisObject.eventHandler.raiseEvent('Dragging', undefined)
+
+ if (viewPortBeingDragged) {
+ let displaceVector = {
+ x: dragVector.upX - dragVector.downX,
+ y: dragVector.upY - dragVector.downY
+ }
+
+ canvas.chartingSpace.viewport.displace(displaceVector)
+ }
+ if (containerDragStarted) {
+ if (containerBeingDragged !== undefined) {
+ if (containerBeingDragged.space === 'Charting Space') {
+ let downCopy = {
+ x: dragVector.downX,
+ y: dragVector.downY
+ }
+
+ let downNoZoom
+ downNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(downCopy)
+
+ let upCopy = {
+ x: dragVector.upX,
+ y: dragVector.upY
+ }
+
+ let upNoZoom
+ upNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(upCopy)
+
+ displaceVector = {
+ x: upNoZoom.x - downNoZoom.x,
+ y: upNoZoom.y - downNoZoom.y
+ }
+
+ let moveSucceed = containerBeingDragged.displace(displaceVector)
+ if (moveSucceed === false) {
+ deactivateDragging(event)
+ }
+ } else {
+ let displaceVector = {
+ x: dragVector.upX - dragVector.downX,
+ y: dragVector.upY - dragVector.downY
+ }
+ let moveSucceed = containerBeingDragged.displace(displaceVector)
+ if (moveSucceed === false) {
+ deactivateDragging(event)
+ }
+ }
+ }
+ }
+
+ /* Finally we set the starting point of the new dragVector at this current point. */
+ dragVector.downX = dragVector.upX
+ dragVector.downY = dragVector.upY
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] checkDrag -> err = ' + err.stack) }
+ }
}
- }
}
diff --git a/CanvasApp/ChartingSpace/ChartUtilities.js b/CanvasApp/ChartingSpace/ChartUtilities.js
index cdc205ec2..ca778df72 100644
--- a/CanvasApp/ChartingSpace/ChartUtilities.js
+++ b/CanvasApp/ChartingSpace/ChartUtilities.js
@@ -1,139 +1,139 @@
-function getSideDays (timeFrame) {
- let daysOnSides
+function getSideDays(timeFrame) {
+ let daysOnSides
- if (timeFrame < _1_HOUR_IN_MILISECONDS) {
- daysOnSides = 1
- }
+ if (timeFrame < _1_HOUR_IN_MILISECONDS) {
+ daysOnSides = 1
+ }
- if (timeFrame === _1_HOUR_IN_MILISECONDS) {
- daysOnSides = 9
- }
+ if (timeFrame === _1_HOUR_IN_MILISECONDS) {
+ daysOnSides = 9
+ }
- if (timeFrame === _2_HOURS_IN_MILISECONDS) {
- daysOnSides = 10
- }
+ if (timeFrame === _2_HOURS_IN_MILISECONDS) {
+ daysOnSides = 10
+ }
- if (timeFrame === _3_HOURS_IN_MILISECONDS) {
- daysOnSides = 12
- }
+ if (timeFrame === _3_HOURS_IN_MILISECONDS) {
+ daysOnSides = 12
+ }
- if (timeFrame === _4_HOURS_IN_MILISECONDS) {
- daysOnSides = 20
- }
+ if (timeFrame === _4_HOURS_IN_MILISECONDS) {
+ daysOnSides = 20
+ }
- if (timeFrame === _6_HOURS_IN_MILISECONDS) {
- daysOnSides = 35
- }
+ if (timeFrame === _6_HOURS_IN_MILISECONDS) {
+ daysOnSides = 35
+ }
- if (timeFrame === _8_HOURS_IN_MILISECONDS) {
- daysOnSides = 44
- }
+ if (timeFrame === _8_HOURS_IN_MILISECONDS) {
+ daysOnSides = 44
+ }
- if (timeFrame === _12_HOURS_IN_MILISECONDS) {
- daysOnSides = 56
- }
+ if (timeFrame === _12_HOURS_IN_MILISECONDS) {
+ daysOnSides = 56
+ }
- if (timeFrame === ONE_DAY_IN_MILISECONDS) {
- daysOnSides = 154
- }
+ if (timeFrame === ONE_DAY_IN_MILISECONDS) {
+ daysOnSides = 154
+ }
- return daysOnSides
+ return daysOnSides
}
-function getCondenseFactor (timeFrame) {
- switch (timeFrame) {
- case _1_MINUTE_IN_MILISECONDS: return 1
- case _5_MINUTES_IN_MILISECONDS: return 5
- case _10_MINUTES_IN_MILISECONDS: return 10
- case _30_MINUTES_IN_MILISECONDS: return 50
- case _1_HOUR_IN_MILISECONDS: return 100
- }
+function getCondenseFactor(timeFrame) {
+ switch (timeFrame) {
+ case _1_MINUTE_IN_MILISECONDS: return 1
+ case _5_MINUTES_IN_MILISECONDS: return 5
+ case _10_MINUTES_IN_MILISECONDS: return 10
+ case _30_MINUTES_IN_MILISECONDS: return 50
+ case _1_HOUR_IN_MILISECONDS: return 100
+ }
}
-function getTransparenceFactor (timeFrame) {
- switch (timeFrame) {
- case _1_MINUTE_IN_MILISECONDS: return '0.12'
- case _5_MINUTES_IN_MILISECONDS: return '0.10'
- case _10_MINUTES_IN_MILISECONDS: return '0.08'
- case _30_MINUTES_IN_MILISECONDS: return '0.06'
- case _1_HOUR_IN_MILISECONDS: return '0.04'
- }
+function getTransparenceFactor(timeFrame) {
+ switch (timeFrame) {
+ case _1_MINUTE_IN_MILISECONDS: return '0.12'
+ case _5_MINUTES_IN_MILISECONDS: return '0.10'
+ case _10_MINUTES_IN_MILISECONDS: return '0.08'
+ case _30_MINUTES_IN_MILISECONDS: return '0.06'
+ case _1_HOUR_IN_MILISECONDS: return '0.04'
+ }
}
-function recalculatePeriod (zoomLevel) {
- // console.log('NEW ZOOM LEVEL', zoomLevel)
- if (zoomLevel > 400) {
- return _1_MINUTE_IN_MILISECONDS
- }
+function recalculatePeriod(zoomLevel) {
+ // console.log('NEW ZOOM LEVEL', zoomLevel)
+ if (zoomLevel > 400) {
+ return _1_MINUTE_IN_MILISECONDS
+ }
- if (zoomLevel > 360) {
- return _2_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 360) {
+ return _2_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 330) {
- return _3_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 330) {
+ return _3_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 300) {
- return _4_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 300) {
+ return _4_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 270) {
- return _5_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 270) {
+ return _5_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 250) {
- return _10_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 250) {
+ return _10_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 230) {
- return _15_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 230) {
+ return _15_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 210) {
- return _20_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 210) {
+ return _20_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 190) {
- return _30_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 190) {
+ return _30_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 170) {
- return _40_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 170) {
+ return _40_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 150) {
- return _45_MINUTES_IN_MILISECONDS
- }
+ if (zoomLevel > 150) {
+ return _45_MINUTES_IN_MILISECONDS
+ }
- if (zoomLevel > 130) {
- return _1_HOUR_IN_MILISECONDS
- }
+ if (zoomLevel > 130) {
+ return _1_HOUR_IN_MILISECONDS
+ }
- if (zoomLevel > 110) {
- return _2_HOURS_IN_MILISECONDS
- }
+ if (zoomLevel > 110) {
+ return _2_HOURS_IN_MILISECONDS
+ }
- if (zoomLevel > 80) {
- return _3_HOURS_IN_MILISECONDS
- }
+ if (zoomLevel > 80) {
+ return _3_HOURS_IN_MILISECONDS
+ }
- if (zoomLevel > 50) {
- return _4_HOURS_IN_MILISECONDS
- }
+ if (zoomLevel > 50) {
+ return _4_HOURS_IN_MILISECONDS
+ }
- if (zoomLevel > 35) {
- return _6_HOURS_IN_MILISECONDS
- }
+ if (zoomLevel > 35) {
+ return _6_HOURS_IN_MILISECONDS
+ }
- if (zoomLevel > 20) {
- return _8_HOURS_IN_MILISECONDS
- }
+ if (zoomLevel > 20) {
+ return _8_HOURS_IN_MILISECONDS
+ }
- if (zoomLevel > 10) {
- return _12_HOURS_IN_MILISECONDS
- }
+ if (zoomLevel > 10) {
+ return _12_HOURS_IN_MILISECONDS
+ }
- return ONE_DAY_IN_MILISECONDS
+ return ONE_DAY_IN_MILISECONDS
}
diff --git a/CanvasApp/ChartingSpace/CoordinateSystem.js b/CanvasApp/ChartingSpace/CoordinateSystem.js
index 830cef1ac..3a9d3fcf4 100644
--- a/CanvasApp/ChartingSpace/CoordinateSystem.js
+++ b/CanvasApp/ChartingSpace/CoordinateSystem.js
@@ -1,4 +1,4 @@
- /*
+/*
This Object object is responsible for defining the coordinate system in a TimeLine.
@@ -7,320 +7,320 @@ The scale on the Y axis depends on the data that wants to be plotted. Usually we
*/
-function newCoordinateSystem () {
- let thisObject = {
- min: undefined,
- max: undefined,
- parentMin: undefined,
- parentMax: undefined,
- childrenMin: undefined,
- childrenMax: undefined,
- maxHeight: undefined,
- maxWidth: undefined,
- scale: undefined,
- eventHandler: undefined,
- autoMinXScale: true,
- autoMaxXScale: true,
- autoMinYScale: true,
- autoMaxYScale: true,
- HORIZONTAL_MARGIN_FACTOR: 0.80,
- VERTICAL_MARGIN_FACTOR: 0.90,
- HORIZONTAL_MARGIN_INVERSE_FACTOR: 0.20,
- VERTICAL_MARGIN_INVERSE_FACTOR: 0.10,
- physics: physics,
- reportParentXValue: reportParentXValue,
- reportParentYValue: reportParentYValue,
- reportXValue: reportXValue,
- reportYValue: reportYValue,
- zoomX: zoomX,
- zoomY: zoomY,
- recalculateScale: recalculateScale,
- transformThisPoint: transformThisPoint,
- transformThisPoint2: transformThisPoint2,
- unInverseTransform: unInverseTransform,
- inverseTransformUncappedY: inverseTransformUncappedY,
- initializeX: initializeX,
- initializeY: initializeY,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.min = {
- x: 0,
- y: 0
- }
- thisObject.max = {
- x: 0,
- y: 0
- }
- thisObject.parentMin = {
- x: 0,
- y: 0
- }
- thisObject.parentMax = {
- x: 0,
- y: 0
- }
- thisObject.childrenMin = {
- x: 0,
- y: 0
- }
- thisObject.childrenMax = {
- x: 0,
- y: 0
- }
-
- thisObject.scale = {
- x: 0,
- y: 0
- }
-
- thisObject.eventHandler = newEventHandler()
- thisObject.eventHandler.name = 'Coordinate System'
-
- let newXMax = -VERY_LARGE_NUMBER
- let newXMin = VERY_LARGE_NUMBER
-
- let newYMax = -VERY_LARGE_NUMBER
- let newYMin = VERY_LARGE_NUMBER
-
- let parentMinChanged = false
- let parentMaxChanged = false
-
- return thisObject
-
- function finalize () {
- thisObject.eventHandler.finalize()
- thisObject.eventHandler = undefined
- }
-
- function initialize (minValue, maxValue, pMaxWidth, pMaxHeight) {
- /* Defines the min and max value of rate that we are going to transport to the available screen at the center position. */
- thisObject.min.x = minValue.x
- thisObject.max.x = maxValue.x
-
- thisObject.min.y = minValue.y
- thisObject.max.y = maxValue.y
-
- thisObject.maxWidth = pMaxWidth
- thisObject.maxHeight = pMaxHeight
-
- recalculateScale()
- }
-
- function reportXValue (value) {
- if (thisObject.autoMinXScale === true) {
- if (value < newXMin && value !== 0) {
- newXMin = value
- }
- }
- if (thisObject.autoMaxXScale === true) {
- if (value > newXMax && value !== 0) {
- newXMax = value
- }
- }
- }
-
- function reportYValue (value) {
- if (thisObject.autoMinYScale === true) {
- if (value < newYMin) {
- newYMin = value
- }
- }
- if (thisObject.autoMaxYScale === true) {
- if (value > newYMax) {
- newYMax = value
- }
- }
- }
-
- function reportParentXValue (min, max) {
- if (thisObject.autoMinXScale === true) {
- if (thisObject.parentMin.x !== min) {
- thisObject.parentMin.x = min
- }
- }
- if (thisObject.autoMaxXScale === true) {
- if (thisObject.parentMax.x !== max) {
- thisObject.parentMax.x = max
- }
- }
- }
-
- function reportParentYValue (min, max) {
- if (thisObject.autoMinYScale === true) {
- if (thisObject.parentMin.y !== min) {
- thisObject.parentMin.y = min
- }
- }
- if (thisObject.autoMaxYScale === true) {
- if (thisObject.parentMax.y !== max) {
- thisObject.parentMax.y = max
- }
- }
- }
-
- function physics () {
- let mustRecalculate = false
-
- if ((thisObject.autoMinXScale === true || thisObject.autoMaxXScale === true)) {
- if (thisObject.autoMaxXScale === true && thisObject.childrenMax.x !== newXMax && newXMax !== -VERY_LARGE_NUMBER) {
- thisObject.childrenMax.x = newXMax
- }
-
- if (thisObject.autoMaxXScale === true) {
- newXMax = -VERY_LARGE_NUMBER
- }
-
- if (thisObject.autoMinXScale === true && thisObject.childrenMin.x !== newXMin && newXMin !== VERY_LARGE_NUMBER) {
- thisObject.childrenMin.x = newXMin
- newXMin = VERY_LARGE_NUMBER
- }
-
- if (thisObject.autoMinXScale === true) {
- newXMin = VERY_LARGE_NUMBER
- }
+function newCoordinateSystem() {
+ let thisObject = {
+ min: undefined,
+ max: undefined,
+ parentMin: undefined,
+ parentMax: undefined,
+ childrenMin: undefined,
+ childrenMax: undefined,
+ maxHeight: undefined,
+ maxWidth: undefined,
+ scale: undefined,
+ eventHandler: undefined,
+ autoMinXScale: true,
+ autoMaxXScale: true,
+ autoMinYScale: true,
+ autoMaxYScale: true,
+ HORIZONTAL_MARGIN_FACTOR: 0.80,
+ VERTICAL_MARGIN_FACTOR: 0.90,
+ HORIZONTAL_MARGIN_INVERSE_FACTOR: 0.20,
+ VERTICAL_MARGIN_INVERSE_FACTOR: 0.10,
+ physics: physics,
+ reportParentXValue: reportParentXValue,
+ reportParentYValue: reportParentYValue,
+ reportXValue: reportXValue,
+ reportYValue: reportYValue,
+ zoomX: zoomX,
+ zoomY: zoomY,
+ recalculateScale: recalculateScale,
+ transformThisPoint: transformThisPoint,
+ transformThisPoint2: transformThisPoint2,
+ unInverseTransform: unInverseTransform,
+ inverseTransformUncappedY: inverseTransformUncappedY,
+ initializeX: initializeX,
+ initializeY: initializeY,
+ initialize: initialize,
+ finalize: finalize
}
- if ((thisObject.autoMinYScale === true || thisObject.autoMaxYScale === true)) {
- if (thisObject.autoMaxYScale === true && thisObject.childrenMax.y !== newYMax && newYMax !== -VERY_LARGE_NUMBER) {
- thisObject.childrenMax.y = newYMax
- }
-
- if (thisObject.autoMaxYScale === true) {
- newYMax = -VERY_LARGE_NUMBER
- }
-
- if (thisObject.autoMinYScale === true && thisObject.childrenMin.y !== newYMin && newYMin !== VERY_LARGE_NUMBER) {
- thisObject.childrenMin.y = newYMin
- newYMin = VERY_LARGE_NUMBER
- }
-
- if (thisObject.autoMinYScale === true) {
- newYMin = VERY_LARGE_NUMBER
- }
+ thisObject.min = {
+ x: 0,
+ y: 0
+ }
+ thisObject.max = {
+ x: 0,
+ y: 0
+ }
+ thisObject.parentMin = {
+ x: 0,
+ y: 0
+ }
+ thisObject.parentMax = {
+ x: 0,
+ y: 0
+ }
+ thisObject.childrenMin = {
+ x: 0,
+ y: 0
+ }
+ thisObject.childrenMax = {
+ x: 0,
+ y: 0
}
- /* Here we will see if any of the children or parent values modify the current status quo */
- /* Min */
- let minX = Math.min(thisObject.childrenMin.x, thisObject.parentMin.x)
- let minY = Math.min(thisObject.childrenMin.y, thisObject.parentMin.y)
- let maxX = Math.max(thisObject.childrenMax.x, thisObject.parentMax.x)
- let maxY = Math.max(thisObject.childrenMax.y, thisObject.parentMax.y)
-
- if (thisObject.parentMin.x === 0) {
- minX = thisObject.childrenMin.x
+ thisObject.scale = {
+ x: 0,
+ y: 0
}
- if (thisObject.parentMin.y === 0) {
- minY = thisObject.childrenMin.y
+ thisObject.eventHandler = newEventHandler()
+ thisObject.eventHandler.name = 'Coordinate System'
+
+ let newXMax = -VERY_LARGE_NUMBER
+ let newXMin = VERY_LARGE_NUMBER
+
+ let newYMax = -VERY_LARGE_NUMBER
+ let newYMin = VERY_LARGE_NUMBER
+
+ let parentMinChanged = false
+ let parentMaxChanged = false
+
+ return thisObject
+
+ function finalize() {
+ thisObject.eventHandler.finalize()
+ thisObject.eventHandler = undefined
}
- if (thisObject.parentMax.x === 0) {
- maxX = thisObject.childrenMax.x
+ function initialize(minValue, maxValue, pMaxWidth, pMaxHeight) {
+ /* Defines the min and max value of rate that we are going to transport to the available screen at the center position. */
+ thisObject.min.x = minValue.x
+ thisObject.max.x = maxValue.x
+
+ thisObject.min.y = minValue.y
+ thisObject.max.y = maxValue.y
+
+ thisObject.maxWidth = pMaxWidth
+ thisObject.maxHeight = pMaxHeight
+
+ recalculateScale()
}
- if (thisObject.parentMax.y === 0) {
- maxY = thisObject.childrenMax.y
+ function reportXValue(value) {
+ if (thisObject.autoMinXScale === true) {
+ if (value < newXMin && value !== 0) {
+ newXMin = value
+ }
+ }
+ if (thisObject.autoMaxXScale === true) {
+ if (value > newXMax && value !== 0) {
+ newXMax = value
+ }
+ }
}
- if (minX !== 0 && thisObject.min.x !== minX && thisObject.autoMinXScale === true) {
- thisObject.min.x = minX
- mustRecalculate = true
+ function reportYValue(value) {
+ if (thisObject.autoMinYScale === true) {
+ if (value < newYMin) {
+ newYMin = value
+ }
+ }
+ if (thisObject.autoMaxYScale === true) {
+ if (value > newYMax) {
+ newYMax = value
+ }
+ }
}
- if (minY !== 0 && thisObject.min.y !== minY && thisObject.autoMinYScale === true) {
- thisObject.min.y = minY
- mustRecalculate = true
+ function reportParentXValue(min, max) {
+ if (thisObject.autoMinXScale === true) {
+ if (thisObject.parentMin.x !== min) {
+ thisObject.parentMin.x = min
+ }
+ }
+ if (thisObject.autoMaxXScale === true) {
+ if (thisObject.parentMax.x !== max) {
+ thisObject.parentMax.x = max
+ }
+ }
}
- if (maxX !== 0 && thisObject.max.x !== maxX && thisObject.autoMaxXScale === true) {
- thisObject.max.x = maxX
- mustRecalculate = true
+ function reportParentYValue(min, max) {
+ if (thisObject.autoMinYScale === true) {
+ if (thisObject.parentMin.y !== min) {
+ thisObject.parentMin.y = min
+ }
+ }
+ if (thisObject.autoMaxYScale === true) {
+ if (thisObject.parentMax.y !== max) {
+ thisObject.parentMax.y = max
+ }
+ }
}
- if (maxY !== 0 && thisObject.max.y !== maxY && thisObject.autoMaxYScale === true) {
- thisObject.max.y = maxY
- mustRecalculate = true
+ function physics() {
+ let mustRecalculate = false
+
+ if ((thisObject.autoMinXScale === true || thisObject.autoMaxXScale === true)) {
+ if (thisObject.autoMaxXScale === true && thisObject.childrenMax.x !== newXMax && newXMax !== -VERY_LARGE_NUMBER) {
+ thisObject.childrenMax.x = newXMax
+ }
+
+ if (thisObject.autoMaxXScale === true) {
+ newXMax = -VERY_LARGE_NUMBER
+ }
+
+ if (thisObject.autoMinXScale === true && thisObject.childrenMin.x !== newXMin && newXMin !== VERY_LARGE_NUMBER) {
+ thisObject.childrenMin.x = newXMin
+ newXMin = VERY_LARGE_NUMBER
+ }
+
+ if (thisObject.autoMinXScale === true) {
+ newXMin = VERY_LARGE_NUMBER
+ }
+ }
+
+ if ((thisObject.autoMinYScale === true || thisObject.autoMaxYScale === true)) {
+ if (thisObject.autoMaxYScale === true && thisObject.childrenMax.y !== newYMax && newYMax !== -VERY_LARGE_NUMBER) {
+ thisObject.childrenMax.y = newYMax
+ }
+
+ if (thisObject.autoMaxYScale === true) {
+ newYMax = -VERY_LARGE_NUMBER
+ }
+
+ if (thisObject.autoMinYScale === true && thisObject.childrenMin.y !== newYMin && newYMin !== VERY_LARGE_NUMBER) {
+ thisObject.childrenMin.y = newYMin
+ newYMin = VERY_LARGE_NUMBER
+ }
+
+ if (thisObject.autoMinYScale === true) {
+ newYMin = VERY_LARGE_NUMBER
+ }
+ }
+
+ /* Here we will see if any of the children or parent values modify the current status quo */
+ /* Min */
+ let minX = Math.min(thisObject.childrenMin.x, thisObject.parentMin.x)
+ let minY = Math.min(thisObject.childrenMin.y, thisObject.parentMin.y)
+ let maxX = Math.max(thisObject.childrenMax.x, thisObject.parentMax.x)
+ let maxY = Math.max(thisObject.childrenMax.y, thisObject.parentMax.y)
+
+ if (thisObject.parentMin.x === 0) {
+ minX = thisObject.childrenMin.x
+ }
+
+ if (thisObject.parentMin.y === 0) {
+ minY = thisObject.childrenMin.y
+ }
+
+ if (thisObject.parentMax.x === 0) {
+ maxX = thisObject.childrenMax.x
+ }
+
+ if (thisObject.parentMax.y === 0) {
+ maxY = thisObject.childrenMax.y
+ }
+
+ if (minX !== 0 && thisObject.min.x !== minX && thisObject.autoMinXScale === true) {
+ thisObject.min.x = minX
+ mustRecalculate = true
+ }
+
+ if (minY !== 0 && thisObject.min.y !== minY && thisObject.autoMinYScale === true) {
+ thisObject.min.y = minY
+ mustRecalculate = true
+ }
+
+ if (maxX !== 0 && thisObject.max.x !== maxX && thisObject.autoMaxXScale === true) {
+ thisObject.max.x = maxX
+ mustRecalculate = true
+ }
+
+ if (maxY !== 0 && thisObject.max.y !== maxY && thisObject.autoMaxYScale === true) {
+ thisObject.max.y = maxY
+ mustRecalculate = true
+ }
+
+ if (mustRecalculate === true) {
+ recalculateScale()
+ }
}
- if (mustRecalculate === true) {
- recalculateScale()
+ function recalculateScale(event) {
+ thisObject.scale.x = thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_FACTOR / (thisObject.max.x - thisObject.min.x)
+ thisObject.scale.y = thisObject.maxHeight * thisObject.VERTICAL_MARGIN_FACTOR / (thisObject.max.y - thisObject.min.y)
+
+ thisObject.eventHandler.raiseEvent('Scale Changed', event)
}
- }
- function recalculateScale (event) {
- thisObject.scale.x = thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_FACTOR / (thisObject.max.x - thisObject.min.x)
- thisObject.scale.y = thisObject.maxHeight * thisObject.VERTICAL_MARGIN_FACTOR / (thisObject.max.y - thisObject.min.y)
+ function zoomX(factor, mousePosition, container) {
+ let mouseAtCointainer = unTransformThisPoint(mousePosition, container)
+ let leftDistance = mouseAtCointainer.x
+ let rightDistance = container.frame.width - mouseAtCointainer.x
+ let diff = thisObject.max.x - thisObject.min.x
+ let min = thisObject.min.x + diff * factor * leftDistance / (container.frame.width / 2)
+ let max = thisObject.max.x - diff * factor * rightDistance / (container.frame.width / 2)
- thisObject.eventHandler.raiseEvent('Scale Changed', event)
- }
-
- function zoomX (factor, mousePosition, container) {
- let mouseAtCointainer = unTransformThisPoint(mousePosition, container)
- let leftDistance = mouseAtCointainer.x
- let rightDistance = container.frame.width - mouseAtCointainer.x
- let diff = thisObject.max.x - thisObject.min.x
- let min = thisObject.min.x + diff * factor * leftDistance / (container.frame.width / 2)
- let max = thisObject.max.x - diff * factor * rightDistance / (container.frame.width / 2)
-
- if (min < max) {
- let mustRecalculate = false
- if (thisObject.autoMinXScale === false) {
- thisObject.min.x = min
- mustRecalculate = true
- }
- if (thisObject.autoMaxXScale === false) {
- thisObject.max.x = max
- mustRecalculate = true
- }
- if (mustRecalculate === true) {
- thisObject.recalculateScale()
- }
+ if (min < max) {
+ let mustRecalculate = false
+ if (thisObject.autoMinXScale === false) {
+ thisObject.min.x = min
+ mustRecalculate = true
+ }
+ if (thisObject.autoMaxXScale === false) {
+ thisObject.max.x = max
+ mustRecalculate = true
+ }
+ if (mustRecalculate === true) {
+ thisObject.recalculateScale()
+ }
+ }
}
- }
- function zoomY (factor, mousePosition, container) {
- let mouseAtCointainer = unTransformThisPoint(mousePosition, container)
- let topDistance = mouseAtCointainer.y
- let bottomDistance = container.frame.height - mouseAtCointainer.y
- let diff = thisObject.max.y - thisObject.min.y
- let min = thisObject.min.y + diff * factor * bottomDistance / (container.frame.height / 2)
- let max = thisObject.max.y - diff * factor * topDistance / (container.frame.height / 2)
+ function zoomY(factor, mousePosition, container) {
+ let mouseAtCointainer = unTransformThisPoint(mousePosition, container)
+ let topDistance = mouseAtCointainer.y
+ let bottomDistance = container.frame.height - mouseAtCointainer.y
+ let diff = thisObject.max.y - thisObject.min.y
+ let min = thisObject.min.y + diff * factor * bottomDistance / (container.frame.height / 2)
+ let max = thisObject.max.y - diff * factor * topDistance / (container.frame.height / 2)
- if (min < max) {
- let mustRecalculate = false
- if (thisObject.autoMinYScale === false) {
- thisObject.min.y = min
- mustRecalculate = true
- }
- if (thisObject.autoMaxYScale === false) {
- thisObject.max.y = max
- mustRecalculate = true
- }
- if (mustRecalculate === true) {
- thisObject.recalculateScale()
- }
+ if (min < max) {
+ let mustRecalculate = false
+ if (thisObject.autoMinYScale === false) {
+ thisObject.min.y = min
+ mustRecalculate = true
+ }
+ if (thisObject.autoMaxYScale === false) {
+ thisObject.max.y = max
+ mustRecalculate = true
+ }
+ if (mustRecalculate === true) {
+ thisObject.recalculateScale()
+ }
+ }
}
- }
- function initializeX (minValue, maxValue, maxWidth) {
- thisObject.min.x = minValue.x // * 0.999; // 0.1% less
- thisObject.max.x = maxValue.x // * 1.001; // 0.1% more
+ function initializeX(minValue, maxValue, maxWidth) {
+ thisObject.min.x = minValue.x // * 0.999; // 0.1% less
+ thisObject.max.x = maxValue.x // * 1.001; // 0.1% more
- thisObject.scale.x = thisObject.maxWidth / (thisObject.max.x - thisObject.min.x)
- }
+ thisObject.scale.x = thisObject.maxWidth / (thisObject.max.x - thisObject.min.x)
+ }
- function initializeY (minValue, maxValue, pMaxHeight) {
- thisObject.min.y = minValue.y // * 0.999; // 0.1% less
- thisObject.max.y = maxValue.y // * 1.001; // 0.1% more
+ function initializeY(minValue, maxValue, pMaxHeight) {
+ thisObject.min.y = minValue.y // * 0.999; // 0.1% less
+ thisObject.max.y = maxValue.y // * 1.001; // 0.1% more
- thisObject.scale.y = pMaxHeight / (thisObject.max.y - thisObject.min.y)
+ thisObject.scale.y = pMaxHeight / (thisObject.max.y - thisObject.min.y)
- thisObject.maxHeight = pMaxHeight
- }
+ thisObject.maxHeight = pMaxHeight
+ }
- function transformThisPoint (point) {
+ function transformThisPoint(point) {
/*
This is the straigh fordward transformation this object provides. The input is a point on the data set that wants to be plotted in a timeline.
@@ -334,38 +334,38 @@ function newCoordinateSystem () {
*/
- point = {
- x: (point.x - thisObject.min.x) * thisObject.scale.x + thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
- y: thisObject.maxHeight - (point.y - thisObject.min.y) * thisObject.scale.y - thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ point = {
+ x: (point.x - thisObject.min.x) * thisObject.scale.x + thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
+ y: thisObject.maxHeight - (point.y - thisObject.min.y) * thisObject.scale.y - thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ }
+
+ return point
}
- return point
- }
+ function transformThisPoint2(point) {
+ point = {
+ x: (point.x - thisObject.min.x) * thisObject.scale.x + thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
+ y: (thisObject.maxHeight - point.y - thisObject.min.y) * thisObject.scale.y - thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ }
- function transformThisPoint2 (point) {
- point = {
- x: (point.x - thisObject.min.x) * thisObject.scale.x + thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
- y: (thisObject.maxHeight - point.y - thisObject.min.y) * thisObject.scale.y - thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ return point
}
- return point
- }
+ function unInverseTransform(point, inverseY) {
+ point = {
+ x: ((point.x - thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2) / thisObject.scale.x) + thisObject.min.x,
+ y: (inverseY * thisObject.VERTICAL_MARGIN_FACTOR - point.y + thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2) / thisObject.scale.y + thisObject.min.y
+ }
- function unInverseTransform (point, inverseY) {
- point = {
- x: ((point.x - thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2) / thisObject.scale.x) + thisObject.min.x,
- y: (inverseY * thisObject.VERTICAL_MARGIN_FACTOR - point.y + thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2) / thisObject.scale.y + thisObject.min.y
+ return point
}
- return point
- }
+ function inverseTransformUncappedY(point, inverseY) {
+ point = {
+ x: (point.x - thisObject.min.x) * thisObject.scale.x + thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
+ y: (inverseY * thisObject.VERTICAL_MARGIN_FACTOR - point.y) * thisObject.scale.y - thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ }
- function inverseTransformUncappedY (point, inverseY) {
- point = {
- x: (point.x - thisObject.min.x) * thisObject.scale.x + thisObject.maxWidth * thisObject.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
- y: (inverseY * thisObject.VERTICAL_MARGIN_FACTOR - point.y) * thisObject.scale.y - thisObject.maxHeight * thisObject.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ return point
}
-
- return point
- }
}
diff --git a/CanvasApp/ChartingSpace/EdgeEditor.js b/CanvasApp/ChartingSpace/EdgeEditor.js
index 134d0006f..2b0cf02e7 100644
--- a/CanvasApp/ChartingSpace/EdgeEditor.js
+++ b/CanvasApp/ChartingSpace/EdgeEditor.js
@@ -1,725 +1,725 @@
-function newEdgeEditor () {
- const MODULE_NAME = 'Edge Editor'
+function newEdgeEditor() {
+ const MODULE_NAME = 'Edge Editor'
- let thisObject = {
- container: undefined,
- fitFunction: undefined,
- isVisible: true,
- isMouseOver: undefined,
- resetAspectRatio: resetAspectRatio,
- onKeyPressed: onKeyPressed,
- physics: physics,
- drawForeground: drawForeground,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- const EDGE_SIZE = 6
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
-
- thisObject.container.isDraggeable = true
- thisObject.container.isClickeable = false
- thisObject.container.isWheelable = false
- thisObject.container.detectMouseOver = true
-
- let whatHappened
- let whereIsMouseOver = 'outside'
-
- let coordinateSystem
- let coordinateSystemWhenDragStarted
-
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
- let onDragStartedEventSubscriptionId
-
- let mouse = {
- position: {
- x: 0,
- y: 0
- }
- }
-
- mouseWhenDragStarted = {
- position: {
- x: 0,
- y: 0
- }
- }
-
- parentFrameWhenDragStarted = {
- position: {
- x: 0,
- y: 0
- },
- width: 0,
- height: 0
- }
-
- let doubleClickCounter = 0
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- mouse = undefined
- mouseWhenDragStarted = undefined
- parentFrameWhenDragStarted = undefined
-
- coordinateSystem = undefined
-
- if (coordinateSystemWhenDragStarted !== undefined) {
- coordinateSystemWhenDragStarted.finalize()
+ let thisObject = {
+ container: undefined,
+ fitFunction: undefined,
+ isVisible: true,
+ isMouseOver: undefined,
+ resetAspectRatio: resetAspectRatio,
+ onKeyPressed: onKeyPressed,
+ physics: physics,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- coordinateSystemWhenDragStarted = undefined
- }
+ const EDGE_SIZE = 6
- function initialize (pCoordinateSystem) {
- coordinateSystem = pCoordinateSystem
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
- onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- onDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
- }
+ thisObject.container.isDraggeable = true
+ thisObject.container.isClickeable = false
+ thisObject.container.isWheelable = false
+ thisObject.container.detectMouseOver = true
- function onMouseOver (event) {
- thisObject.isMouseOver = true
- mouse = {
- position: {
- x: event.x,
- y: event.y
- }
- }
- }
+ let whatHappened
+ let whereIsMouseOver = 'outside'
- function onMouseNotOver () {
- thisObject.isMouseOver = false
- }
+ let coordinateSystem
+ let coordinateSystemWhenDragStarted
- function resetAspectRatio () {
- /* Resize the Time Machine to match the current screen aspect ration */
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
+ let onDragStartedEventSubscriptionId
- thisObject.container.parentContainer.frame.width = browserCanvas.width / TIME_MACHINE_WIDTH
- thisObject.container.parentContainer.frame.height = (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT
- coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
- coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
- coordinateSystem.recalculateScale()
- thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
- }
-
- function onDoubleClick (event) {
- doubleClickCounter = 0
- if (canvas.chartingSpace.viewport.zoomLevel === DOUBLE_CLICK_ZOOM_OUT_LEVEL) {
- canvas.chartingSpace.viewport.displaceToContainer(thisObject.container.parentContainer)
- canvas.chartingSpace.viewport.zoomAtCenter(DOUBLE_CLICK_ZOOM_IN_LEVEL)
- return
- }
- if (canvas.chartingSpace.viewport.zoomLevel === DOUBLE_CLICK_ZOOM_IN_LEVEL) {
- canvas.chartingSpace.viewport.zoomAtCenter(DOUBLE_CLICK_ZOOM_IN_IN_LEVEL)
- return
- }
- }
-
- function onDragStarted (event) {
- if (event.buttons === 1) {
- if (doubleClickCounter > 0) {
- onDoubleClick(event)
- return
- } else {
- doubleClickCounter = 50
- }
+ let mouse = {
+ position: {
+ x: 0,
+ y: 0
+ }
}
mouseWhenDragStarted = {
- position: {
- x: event.x,
- y: event.y
- }
+ position: {
+ x: 0,
+ y: 0
+ }
}
parentFrameWhenDragStarted = {
- position: {
- x: thisObject.container.parentContainer.frame.position.x,
- y: thisObject.container.parentContainer.frame.position.y
- },
- width: thisObject.container.parentContainer.frame.width,
- height: thisObject.container.parentContainer.frame.height
+ position: {
+ x: 0,
+ y: 0
+ },
+ width: 0,
+ height: 0
}
- coordinateSystemWhenDragStarted = newCoordinateSystem()
+ let doubleClickCounter = 0
- let minValue = {
- x: coordinateSystem.min.x,
- y: coordinateSystem.min.y
- }
+ return thisObject
- let maxValue = {
- x: coordinateSystem.max.x,
- y: coordinateSystem.max.y
- }
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
- coordinateSystemWhenDragStarted.initialize(minValue, maxValue, coordinateSystem.maxWidth, coordinateSystem.maxHeight)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ mouse = undefined
+ mouseWhenDragStarted = undefined
+ parentFrameWhenDragStarted = undefined
- switch (event.buttons) {
- case 1: {
- whatHappened = 'left mouse button'
- if (event.shiftKey === true) {
- whatHappened = 'left mouse button + SHIFT'
+ coordinateSystem = undefined
+
+ if (coordinateSystemWhenDragStarted !== undefined) {
+ coordinateSystemWhenDragStarted.finalize()
}
- break
- }
- case 2: {
- whatHappened = 'right mouse button' // this will never happen as of today
- break
- }
- }
- }
- function onKeyPressed (event) {
- const STEP = 10
-
- if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowLeft') {
- onDragStarted(event)
- thisObject.container.frame.position.x = thisObject.container.frame.position.x + STEP
- whatHappened = 'left or right arrow key pressed'
- return
+ coordinateSystemWhenDragStarted = undefined
}
- if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowRight') {
- if (ARE_WE_RECORDING_A_MARKET_PANORAMA === true) {
- if (PANORAMA_WAS_PANNED === false) {
- PANORAMA_WAS_PANNED = true
- onDragStarted(event)
- thisObject.container.frame.position.x = thisObject.container.frame.position.x - STEP * 2
- whatHappened = 'left or right arrow key pressed'
+ function initialize(pCoordinateSystem) {
+ coordinateSystem = pCoordinateSystem
+
+ onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ onDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
+ }
+
+ function onMouseOver(event) {
+ thisObject.isMouseOver = true
+ mouse = {
+ position: {
+ x: event.x,
+ y: event.y
+ }
}
- } else {
- onDragStarted(event)
- thisObject.container.frame.position.x = thisObject.container.frame.position.x - STEP
- whatHappened = 'left or right arrow key pressed'
- }
- return
}
- if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowUp') {
- onDragStarted(event)
- thisObject.container.frame.position.y = thisObject.container.frame.position.y + STEP
- whatHappened = 'up or down arrow key pressed'
- return
+ function onMouseNotOver() {
+ thisObject.isMouseOver = false
}
- if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowDown') {
- onDragStarted(event)
- thisObject.container.frame.position.y = thisObject.container.frame.position.y - STEP
- whatHappened = 'up or down arrow key pressed'
- return
+ function resetAspectRatio() {
+ /* Resize the Time Machine to match the current screen aspect ration */
+
+ thisObject.container.parentContainer.frame.width = browserCanvas.width / TIME_MACHINE_WIDTH
+ thisObject.container.parentContainer.frame.height = (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT
+ coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
+ coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
+ coordinateSystem.recalculateScale()
+ thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
}
- if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'A' || event.key === 'a')) {
- resetAspectRatio()
- return
- }
- }
-
- function getContainer (event, purpose) {
- if (thisObject.container.frame.isThisPointHere(event, undefined, undefined, -EDGE_SIZE) === true && event.buttons !== 2) {
- let point = {
- x: event.x,
- y: event.y
- }
- point = unTransformThisPoint(point, thisObject.container)
-
- if (point.x <= 0) {
- whereIsMouseOver = 'left'
- return thisObject.container
- }
-
- if (point.x >= thisObject.container.frame.width) {
- whereIsMouseOver = 'right'
- return thisObject.container
- }
-
- if (point.y <= 0) {
- whereIsMouseOver = 'top'
- return thisObject.container
- }
-
- if (point.y >= thisObject.container.frame.height) {
- whereIsMouseOver = 'bottom'
- return thisObject.container
- }
-
- whereIsMouseOver = 'center'
- switch (purpose) {
- case GET_CONTAINER_PURPOSE.MOUSE_OVER:
- return // We will let the Time Machine to handle this situation.
- break
- case GET_CONTAINER_PURPOSE.DRAGGING:
- return thisObject.container
- break
- }
- }
- }
-
- function physics () {
- draggingPhysics()
- doubleClickPhysics()
- }
-
- function doubleClickPhysics () {
- doubleClickCounter--
- if (doubleClickCounter < 0) {
- doubleClickCounter = 0
- }
- }
-
- function draggingPhysics () {
- if (coordinateSystemWhenDragStarted === undefined) { return }
- if (thisObject.container.frame.position.x === 0 && thisObject.container.frame.position.y === 0) { return }
-
- let mouseNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mouse.position)
- let mouseWhenDragStartedNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mouseWhenDragStarted.position)
-
- let dragVectorWhenDragStarted = {
- x: mouseNoZoom.x - mouseWhenDragStartedNoZoom.x,
- y: mouseNoZoom.y - mouseWhenDragStartedNoZoom.y
+ function onDoubleClick(event) {
+ doubleClickCounter = 0
+ if (canvas.chartingSpace.viewport.zoomLevel === DOUBLE_CLICK_ZOOM_OUT_LEVEL) {
+ canvas.chartingSpace.viewport.displaceToContainer(thisObject.container.parentContainer)
+ canvas.chartingSpace.viewport.zoomAtCenter(DOUBLE_CLICK_ZOOM_IN_LEVEL)
+ return
+ }
+ if (canvas.chartingSpace.viewport.zoomLevel === DOUBLE_CLICK_ZOOM_IN_LEVEL) {
+ canvas.chartingSpace.viewport.zoomAtCenter(DOUBLE_CLICK_ZOOM_IN_IN_LEVEL)
+ return
+ }
}
- let dragVector = {
- x: thisObject.container.frame.position.x,
- y: thisObject.container.frame.position.y
+ function onDragStarted(event) {
+ if (event.buttons === 1) {
+ if (doubleClickCounter > 0) {
+ onDoubleClick(event)
+ return
+ } else {
+ doubleClickCounter = 50
+ }
+ }
+
+ mouseWhenDragStarted = {
+ position: {
+ x: event.x,
+ y: event.y
+ }
+ }
+
+ parentFrameWhenDragStarted = {
+ position: {
+ x: thisObject.container.parentContainer.frame.position.x,
+ y: thisObject.container.parentContainer.frame.position.y
+ },
+ width: thisObject.container.parentContainer.frame.width,
+ height: thisObject.container.parentContainer.frame.height
+ }
+
+ coordinateSystemWhenDragStarted = newCoordinateSystem()
+
+ let minValue = {
+ x: coordinateSystem.min.x,
+ y: coordinateSystem.min.y
+ }
+
+ let maxValue = {
+ x: coordinateSystem.max.x,
+ y: coordinateSystem.max.y
+ }
+
+ coordinateSystemWhenDragStarted.initialize(minValue, maxValue, coordinateSystem.maxWidth, coordinateSystem.maxHeight)
+
+ switch (event.buttons) {
+ case 1: {
+ whatHappened = 'left mouse button'
+ if (event.shiftKey === true) {
+ whatHappened = 'left mouse button + SHIFT'
+ }
+ break
+ }
+ case 2: {
+ whatHappened = 'right mouse button' // this will never happen as of today
+ break
+ }
+ }
}
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
+ function onKeyPressed(event) {
+ const STEP = 10
- const MIN_WIDTH = 200
- const MIN_HEIGHT = 100
+ if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowLeft') {
+ onDragStarted(event)
+ thisObject.container.frame.position.x = thisObject.container.frame.position.x + STEP
+ whatHappened = 'left or right arrow key pressed'
+ return
+ }
- switch (whereIsMouseOver) {
- case 'center': {
- switch (whatHappened) {
- case 'left mouse button + SHIFT': {
- /* This is equivalent to drag the whole Time Machine, so we will apply the translation received onto the Time Machine container. */
- thisObject.container.parentContainer.frame.position.x = parentFrameWhenDragStarted.position.x + dragVectorWhenDragStarted.x
- thisObject.container.parentContainer.frame.position.y = parentFrameWhenDragStarted.position.y + dragVectorWhenDragStarted.y
- snapPointToGrid(thisObject.container.parentContainer.frame.position)
- thisObject.container.parentContainer.eventHandler.raiseEvent('onDisplace')
- break
- }
- case 'left mouse button': {
+ if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowRight') {
+ if (ARE_WE_RECORDING_A_MARKET_PANORAMA === true) {
+ if (PANORAMA_WAS_PANNED === false) {
+ PANORAMA_WAS_PANNED = true
+ onDragStarted(event)
+ thisObject.container.frame.position.x = thisObject.container.frame.position.x - STEP * 2
+ whatHappened = 'left or right arrow key pressed'
+ }
+ } else {
+ onDragStarted(event)
+ thisObject.container.frame.position.x = thisObject.container.frame.position.x - STEP
+ whatHappened = 'left or right arrow key pressed'
+ }
+ return
+ }
+
+ if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowUp') {
+ onDragStarted(event)
+ thisObject.container.frame.position.y = thisObject.container.frame.position.y + STEP
+ whatHappened = 'up or down arrow key pressed'
+ return
+ }
+
+ if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowDown') {
+ onDragStarted(event)
+ thisObject.container.frame.position.y = thisObject.container.frame.position.y - STEP
+ whatHappened = 'up or down arrow key pressed'
+ return
+ }
+
+ if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'A' || event.key === 'a')) {
+ resetAspectRatio()
+ return
+ }
+ }
+
+ function getContainer(event, purpose) {
+ if (thisObject.container.frame.isThisPointHere(event, undefined, undefined, -EDGE_SIZE) === true && event.buttons !== 2) {
let point = {
- x: (-dragVectorWhenDragStarted.x),
- y: (-dragVectorWhenDragStarted.y)
+ x: event.x,
+ y: event.y
+ }
+ point = unTransformThisPoint(point, thisObject.container)
+
+ if (point.x <= 0) {
+ whereIsMouseOver = 'left'
+ return thisObject.container
}
- let newMinDate = getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
- let newMaxRate = getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
-
- let xDifferenceMaxMin = coordinateSystemWhenDragStarted.max.x - coordinateSystemWhenDragStarted.min.x
- let yDifferenceMaxMin = coordinateSystemWhenDragStarted.max.y - coordinateSystemWhenDragStarted.min.y
- coordinateSystem.min.x = newMinDate.valueOf()
- coordinateSystem.max.x = newMinDate.valueOf() + xDifferenceMaxMin
- coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
- coordinateSystem.max.y = newMaxRate
- let event = {
- type: 'center dragged',
- dragVector: dragVector
- }
- coordinateSystem.recalculateScale(event)
- }
- break
- case 'left or right arrow key pressed': {
- let point = {
- x: -dragVector.x + thisObject.container.frame.width * coordinateSystem.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
- y: 0
+ if (point.x >= thisObject.container.frame.width) {
+ whereIsMouseOver = 'right'
+ return thisObject.container
}
- let newMinDate = getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
- let xDifferenceMaxMin = coordinateSystem.max.x - coordinateSystem.min.x
- coordinateSystem.min.x = newMinDate.valueOf()
- coordinateSystem.max.x = newMinDate.valueOf() + xDifferenceMaxMin
- let event = {
- type: 'center dragged',
- dragVector: dragVector
- }
- coordinateSystem.recalculateScale(event)
- }
- break
- case 'up or down arrow key pressed': {
- let point = {
- x: 0,
- y: -dragVector.y + thisObject.container.frame.height * coordinateSystem.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ if (point.y <= 0) {
+ whereIsMouseOver = 'top'
+ return thisObject.container
}
- let newMaxRate = getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
- let yDifferenceMaxMin = coordinateSystem.max.y - coordinateSystem.min.y
- coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
- coordinateSystem.max.y = newMaxRate
- let event = {
- type: 'center dragged',
- dragVector: dragVector
+ if (point.y >= thisObject.container.frame.height) {
+ whereIsMouseOver = 'bottom'
+ return thisObject.container
}
- coordinateSystem.recalculateScale(event)
- }
- break
- }
- thisObject.container.parentContainer.eventHandler.raiseEvent('onMouseOver', mouse.position)
- break
- }
- case 'top' : {
- dragVectorWhenDragStarted.x = 0
- let newHight = parentFrameWhenDragStarted.height - dragVectorWhenDragStarted.y
- if (newHight < MIN_HEIGHT && dragVectorWhenDragStarted.y > 0) {
- dragVectorWhenDragStarted.y = parentFrameWhenDragStarted.height - MIN_HEIGHT
- }
-
- thisObject.container.parentContainer.frame.position.y = parentFrameWhenDragStarted.position.y + dragVectorWhenDragStarted.y
- snapPointToGrid(thisObject.container.parentContainer.frame.position)
- thisObject.container.parentContainer.frame.height = parentFrameWhenDragStarted.height + (parentFrameWhenDragStarted.position.y - thisObject.container.parentContainer.frame.position.y)
-
- let point = {
- x: 0,
- y: (thisObject.container.parentContainer.frame.position.y - parentFrameWhenDragStarted.position.y)
- }
-
- /* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
- point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.height)
- let newMaxRate = point.y
-
- switch (whatHappened) {
- case 'left mouse button': {
- coordinateSystem.max.y = newMaxRate
- coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
- let event = {
- type: 'top dragged',
- dragVector: dragVector
+ whereIsMouseOver = 'center'
+ switch (purpose) {
+ case GET_CONTAINER_PURPOSE.MOUSE_OVER:
+ return // We will let the Time Machine to handle this situation.
+ break
+ case GET_CONTAINER_PURPOSE.DRAGGING:
+ return thisObject.container
+ break
}
- coordinateSystem.recalculateScale(event)
- break
- }
- case 'left mouse button + SHIFT': {
- coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
- coordinateSystem.recalculateScale()
- break
- }
}
- thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
- break
- }
- case 'bottom' : {
- dragVectorWhenDragStarted.x = 0
+ }
- let newHight = dragVectorWhenDragStarted.y + parentFrameWhenDragStarted.height
- if (newHight < MIN_HEIGHT && dragVectorWhenDragStarted.y < 0) {
- dragVectorWhenDragStarted.y = MIN_HEIGHT - parentFrameWhenDragStarted.height
+ function physics() {
+ draggingPhysics()
+ doubleClickPhysics()
+ }
+
+ function doubleClickPhysics() {
+ doubleClickCounter--
+ if (doubleClickCounter < 0) {
+ doubleClickCounter = 0
+ }
+ }
+
+ function draggingPhysics() {
+ if (coordinateSystemWhenDragStarted === undefined) { return }
+ if (thisObject.container.frame.position.x === 0 && thisObject.container.frame.position.y === 0) { return }
+
+ let mouseNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mouse.position)
+ let mouseWhenDragStartedNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mouseWhenDragStarted.position)
+
+ let dragVectorWhenDragStarted = {
+ x: mouseNoZoom.x - mouseWhenDragStartedNoZoom.x,
+ y: mouseNoZoom.y - mouseWhenDragStartedNoZoom.y
}
- let point = {
- x: 0,
- y: dragVectorWhenDragStarted.y + parentFrameWhenDragStarted.height + parentFrameWhenDragStarted.position.y
+ let dragVector = {
+ x: thisObject.container.frame.position.x,
+ y: thisObject.container.frame.position.y
}
- snapPointToGrid(point)
- point.y = point.y - parentFrameWhenDragStarted.position.y
- thisObject.container.parentContainer.frame.height = point.y
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
- /* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
- point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.height)
- let newMinRate = point.y
+ const MIN_WIDTH = 200
+ const MIN_HEIGHT = 100
- switch (whatHappened) {
- case 'left mouse button': {
- coordinateSystem.min.y = newMinRate
- coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
- let event = {
- type: 'bottom dragged',
- dragVector: dragVector
+ switch (whereIsMouseOver) {
+ case 'center': {
+ switch (whatHappened) {
+ case 'left mouse button + SHIFT': {
+ /* This is equivalent to drag the whole Time Machine, so we will apply the translation received onto the Time Machine container. */
+ thisObject.container.parentContainer.frame.position.x = parentFrameWhenDragStarted.position.x + dragVectorWhenDragStarted.x
+ thisObject.container.parentContainer.frame.position.y = parentFrameWhenDragStarted.position.y + dragVectorWhenDragStarted.y
+ snapPointToGrid(thisObject.container.parentContainer.frame.position)
+ thisObject.container.parentContainer.eventHandler.raiseEvent('onDisplace')
+ break
+ }
+ case 'left mouse button': {
+ let point = {
+ x: (-dragVectorWhenDragStarted.x),
+ y: (-dragVectorWhenDragStarted.y)
+ }
+
+ let newMinDate = getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
+ let newMaxRate = getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystemWhenDragStarted)
+
+ let xDifferenceMaxMin = coordinateSystemWhenDragStarted.max.x - coordinateSystemWhenDragStarted.min.x
+ let yDifferenceMaxMin = coordinateSystemWhenDragStarted.max.y - coordinateSystemWhenDragStarted.min.y
+ coordinateSystem.min.x = newMinDate.valueOf()
+ coordinateSystem.max.x = newMinDate.valueOf() + xDifferenceMaxMin
+ coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
+ coordinateSystem.max.y = newMaxRate
+ let event = {
+ type: 'center dragged',
+ dragVector: dragVector
+ }
+ coordinateSystem.recalculateScale(event)
+ }
+ break
+ case 'left or right arrow key pressed': {
+ let point = {
+ x: -dragVector.x + thisObject.container.frame.width * coordinateSystem.HORIZONTAL_MARGIN_INVERSE_FACTOR / 2,
+ y: 0
+ }
+
+ let newMinDate = getDateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
+ let xDifferenceMaxMin = coordinateSystem.max.x - coordinateSystem.min.x
+ coordinateSystem.min.x = newMinDate.valueOf()
+ coordinateSystem.max.x = newMinDate.valueOf() + xDifferenceMaxMin
+ let event = {
+ type: 'center dragged',
+ dragVector: dragVector
+ }
+ coordinateSystem.recalculateScale(event)
+ }
+ break
+ case 'up or down arrow key pressed': {
+ let point = {
+ x: 0,
+ y: -dragVector.y + thisObject.container.frame.height * coordinateSystem.VERTICAL_MARGIN_INVERSE_FACTOR / 2
+ }
+
+ let newMaxRate = getRateFromPointAtContainer(point, thisObject.container.parentContainer, coordinateSystem)
+ let yDifferenceMaxMin = coordinateSystem.max.y - coordinateSystem.min.y
+ coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
+ coordinateSystem.max.y = newMaxRate
+ let event = {
+ type: 'center dragged',
+ dragVector: dragVector
+ }
+ coordinateSystem.recalculateScale(event)
+ }
+ break
+ }
+ thisObject.container.parentContainer.eventHandler.raiseEvent('onMouseOver', mouse.position)
+ break
}
- coordinateSystem.recalculateScale(event)
- break
- }
- case 'left mouse button + SHIFT': {
- coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
- coordinateSystem.recalculateScale()
- break
- }
- }
- thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
- break
- }
- case 'left' : {
- dragVectorWhenDragStarted.y = 0
+ case 'top': {
+ dragVectorWhenDragStarted.x = 0
- let newWidth = parentFrameWhenDragStarted.width - dragVectorWhenDragStarted.x
- if (newWidth < MIN_WIDTH && dragVectorWhenDragStarted.x > 0) {
- dragVectorWhenDragStarted.x = parentFrameWhenDragStarted.width - MIN_WIDTH
+ let newHight = parentFrameWhenDragStarted.height - dragVectorWhenDragStarted.y
+ if (newHight < MIN_HEIGHT && dragVectorWhenDragStarted.y > 0) {
+ dragVectorWhenDragStarted.y = parentFrameWhenDragStarted.height - MIN_HEIGHT
+ }
+
+ thisObject.container.parentContainer.frame.position.y = parentFrameWhenDragStarted.position.y + dragVectorWhenDragStarted.y
+ snapPointToGrid(thisObject.container.parentContainer.frame.position)
+ thisObject.container.parentContainer.frame.height = parentFrameWhenDragStarted.height + (parentFrameWhenDragStarted.position.y - thisObject.container.parentContainer.frame.position.y)
+
+ let point = {
+ x: 0,
+ y: (thisObject.container.parentContainer.frame.position.y - parentFrameWhenDragStarted.position.y)
+ }
+
+ /* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
+ point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.height)
+ let newMaxRate = point.y
+
+ switch (whatHappened) {
+ case 'left mouse button': {
+ coordinateSystem.max.y = newMaxRate
+ coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
+ let event = {
+ type: 'top dragged',
+ dragVector: dragVector
+ }
+ coordinateSystem.recalculateScale(event)
+ break
+ }
+ case 'left mouse button + SHIFT': {
+ coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
+ coordinateSystem.recalculateScale()
+ break
+ }
+ }
+ thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
+ break
+ }
+ case 'bottom': {
+ dragVectorWhenDragStarted.x = 0
+
+ let newHight = dragVectorWhenDragStarted.y + parentFrameWhenDragStarted.height
+ if (newHight < MIN_HEIGHT && dragVectorWhenDragStarted.y < 0) {
+ dragVectorWhenDragStarted.y = MIN_HEIGHT - parentFrameWhenDragStarted.height
+ }
+
+ let point = {
+ x: 0,
+ y: dragVectorWhenDragStarted.y + parentFrameWhenDragStarted.height + parentFrameWhenDragStarted.position.y
+ }
+ snapPointToGrid(point)
+ point.y = point.y - parentFrameWhenDragStarted.position.y
+
+ thisObject.container.parentContainer.frame.height = point.y
+
+ /* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
+ point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.height)
+ let newMinRate = point.y
+
+ switch (whatHappened) {
+ case 'left mouse button': {
+ coordinateSystem.min.y = newMinRate
+ coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
+ let event = {
+ type: 'bottom dragged',
+ dragVector: dragVector
+ }
+ coordinateSystem.recalculateScale(event)
+ break
+ }
+ case 'left mouse button + SHIFT': {
+ coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
+ coordinateSystem.recalculateScale()
+ break
+ }
+ }
+ thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
+ break
+ }
+ case 'left': {
+ dragVectorWhenDragStarted.y = 0
+
+ let newWidth = parentFrameWhenDragStarted.width - dragVectorWhenDragStarted.x
+ if (newWidth < MIN_WIDTH && dragVectorWhenDragStarted.x > 0) {
+ dragVectorWhenDragStarted.x = parentFrameWhenDragStarted.width - MIN_WIDTH
+ }
+
+ thisObject.container.parentContainer.frame.position.x = parentFrameWhenDragStarted.position.x + dragVectorWhenDragStarted.x
+ snapPointToGrid(thisObject.container.parentContainer.frame.position)
+ thisObject.container.parentContainer.frame.width = parentFrameWhenDragStarted.width + (parentFrameWhenDragStarted.position.x - thisObject.container.parentContainer.frame.position.x)
+
+ let point = {
+ x: (thisObject.container.parentContainer.frame.position.x - parentFrameWhenDragStarted.position.x),
+ y: 0
+ }
+
+ /* This is equivalent to getDateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
+ point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.width)
+ let newMinDate = point.x
+
+ switch (whatHappened) {
+ case 'left mouse button': {
+ coordinateSystem.min.x = newMinDate.valueOf()
+ coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
+ coordinateSystem.recalculateScale()
+ break
+ }
+ case 'left mouse button + SHIFT': {
+ coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
+ coordinateSystem.recalculateScale()
+ break
+ }
+ }
+ thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
+ break
+ }
+ case 'right': {
+ dragVectorWhenDragStarted.y = 0
+
+ let newWidth = dragVectorWhenDragStarted.x + parentFrameWhenDragStarted.width
+ if (newWidth < MIN_WIDTH && dragVectorWhenDragStarted.x < 0) {
+ dragVectorWhenDragStarted.x = MIN_WIDTH - parentFrameWhenDragStarted.width
+ }
+
+ let point = {
+ x: dragVectorWhenDragStarted.x + parentFrameWhenDragStarted.width + parentFrameWhenDragStarted.position.x,
+ y: 0
+ }
+ snapPointToGrid(point)
+ point.x = point.x - parentFrameWhenDragStarted.position.x
+
+ thisObject.container.parentContainer.frame.width = point.x
+
+ /* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
+ point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.width)
+ let newMaxDate = point.x
+
+ switch (whatHappened) {
+ case 'left mouse button': {
+ coordinateSystem.max.x = newMaxDate.valueOf()
+ coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
+ coordinateSystem.recalculateScale()
+ break
+ }
+ case 'left mouse button + SHIFT': {
+ coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
+ coordinateSystem.recalculateScale()
+ break
+ }
+ }
+ thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
+ break
+ }
}
- thisObject.container.parentContainer.frame.position.x = parentFrameWhenDragStarted.position.x + dragVectorWhenDragStarted.x
- snapPointToGrid(thisObject.container.parentContainer.frame.position)
- thisObject.container.parentContainer.frame.width = parentFrameWhenDragStarted.width + (parentFrameWhenDragStarted.position.x - thisObject.container.parentContainer.frame.position.x)
-
- let point = {
- x: (thisObject.container.parentContainer.frame.position.x - parentFrameWhenDragStarted.position.x),
- y: 0
+ function snapPointToGrid(point) {
+ point.x = snapScalarToGrid(point.x)
+ point.y = snapScalarToGrid(point.y)
}
- /* This is equivalent to getDateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
- point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.width)
- let newMinDate = point.x
-
- switch (whatHappened) {
- case 'left mouse button': {
- coordinateSystem.min.x = newMinDate.valueOf()
- coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
- coordinateSystem.recalculateScale()
- break
- }
- case 'left mouse button + SHIFT': {
- coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
- coordinateSystem.recalculateScale()
- break
- }
+ function snapScalarToGrid(scalar) {
+ let sign
+ if (scalar < 0) {
+ sign = -1
+ } else {
+ sign = 1
+ }
+ const GRID_SIZE = 10
+ return Math.trunc(scalar / GRID_SIZE) * GRID_SIZE + GRID_SIZE / 2 * sign
}
- thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
- break
- }
- case 'right' : {
- dragVectorWhenDragStarted.y = 0
+ }
- let newWidth = dragVectorWhenDragStarted.x + parentFrameWhenDragStarted.width
- if (newWidth < MIN_WIDTH && dragVectorWhenDragStarted.x < 0) {
- dragVectorWhenDragStarted.x = MIN_WIDTH - parentFrameWhenDragStarted.width
+ function drawForeground() {
+ let MARGIN = 1
+ let edgeSize
+ let lineWidth
+
+ if (whereIsMouseOver === 'outside' || thisObject.isMouseOver === false) {
+ edgeSize = 2
+ lineWidth = 0.1
+ } else {
+ edgeSize = EDGE_SIZE
+ lineWidth = 0.5
}
- let point = {
- x: dragVectorWhenDragStarted.x + parentFrameWhenDragStarted.width + parentFrameWhenDragStarted.position.x,
- y: 0
+ const OPACITY = 1
+
+ pointA1 = {
+ x: 0,
+ y: 0
}
- snapPointToGrid(point)
- point.x = point.x - parentFrameWhenDragStarted.position.x
- thisObject.container.parentContainer.frame.width = point.x
-
- /* This is equivalent to getRateFromPointAtContainer, but as we do not have a container anymore because we already change it, we do it like this. */
- point = coordinateSystemWhenDragStarted.unInverseTransform(point, parentFrameWhenDragStarted.width)
- let newMaxDate = point.x
-
- switch (whatHappened) {
- case 'left mouse button': {
- coordinateSystem.max.x = newMaxDate.valueOf()
- coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
- coordinateSystem.recalculateScale()
- break
- }
- case 'left mouse button + SHIFT': {
- coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
- coordinateSystem.recalculateScale()
- break
- }
+ pointA2 = {
+ x: thisObject.container.frame.width,
+ y: 0
+ }
+
+ pointA3 = {
+ x: thisObject.container.frame.width,
+ y: thisObject.container.frame.height
+ }
+
+ pointA4 = {
+ x: 0,
+ y: thisObject.container.frame.height
+ }
+
+ pointB1 = {
+ x: 0,
+ y: 0
+ }
+
+ pointB2 = {
+ x: thisObject.container.frame.width,
+ y: 0
+ }
+
+ pointB3 = {
+ x: thisObject.container.frame.width,
+ y: thisObject.container.frame.height
+ }
+
+ pointB4 = {
+ x: 0,
+ y: thisObject.container.frame.height
+ }
+
+ pointA1 = transformThisPoint(pointA1, thisObject.container)
+ pointA2 = transformThisPoint(pointA2, thisObject.container)
+ pointA3 = transformThisPoint(pointA3, thisObject.container)
+ pointA4 = transformThisPoint(pointA4, thisObject.container)
+
+ pointB1 = transformThisPoint(pointB1, thisObject.container)
+ pointB2 = transformThisPoint(pointB2, thisObject.container)
+ pointB3 = transformThisPoint(pointB3, thisObject.container)
+ pointB4 = transformThisPoint(pointB4, thisObject.container)
+
+ pointA1 = {
+ x: pointA1.x - MARGIN,
+ y: pointA1.y - MARGIN
+ }
+
+ pointA2 = {
+ x: pointA2.x + MARGIN,
+ y: pointA2.y - MARGIN
+ }
+
+ pointA3 = {
+ x: pointA3.x + MARGIN,
+ y: pointA3.y + MARGIN
+ }
+
+ pointA4 = {
+ x: pointA4.x - MARGIN,
+ y: pointA4.y + MARGIN
+ }
+
+ pointB1 = {
+ x: pointB1.x - edgeSize,
+ y: pointB1.y - edgeSize
+ }
+
+ pointB2 = {
+ x: pointB2.x + edgeSize,
+ y: pointB2.y - edgeSize
+ }
+
+ pointB3 = {
+ x: pointB3.x + edgeSize,
+ y: pointB3.y + edgeSize
+ }
+
+ pointB4 = {
+ x: pointB4.x - edgeSize,
+ y: pointB4.y + edgeSize
+ }
+
+ pointA1 = canvas.chartingSpace.viewport.fitIntoViewport(pointA1)
+ pointA2 = canvas.chartingSpace.viewport.fitIntoViewport(pointA2)
+ pointA3 = canvas.chartingSpace.viewport.fitIntoViewport(pointA3)
+ pointA4 = canvas.chartingSpace.viewport.fitIntoViewport(pointA4)
+
+ pointB1 = canvas.chartingSpace.viewport.fitIntoViewport(pointB1)
+ pointB2 = canvas.chartingSpace.viewport.fitIntoViewport(pointB2)
+ pointB3 = canvas.chartingSpace.viewport.fitIntoViewport(pointB3)
+ pointB4 = canvas.chartingSpace.viewport.fitIntoViewport(pointB4)
+
+ browserCanvasContext.setLineDash([0, 0])
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(pointA1.x, pointA1.y)
+ browserCanvasContext.lineTo(pointA2.x, pointA2.y)
+ browserCanvasContext.lineTo(pointB2.x, pointB2.y)
+ browserCanvasContext.lineTo(pointB1.x, pointB1.y)
+ browserCanvasContext.lineTo(pointA1.x, pointA1.y)
+ browserCanvasContext.closePath()
+
+ drawEdge('top')
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(pointA2.x, pointA2.y)
+ browserCanvasContext.lineTo(pointA3.x, pointA3.y)
+ browserCanvasContext.lineTo(pointB3.x, pointB3.y)
+ browserCanvasContext.lineTo(pointB2.x, pointB2.y)
+ browserCanvasContext.lineTo(pointA2.x, pointA2.y)
+ browserCanvasContext.closePath()
+
+ drawEdge('right')
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(pointA3.x, pointA3.y)
+ browserCanvasContext.lineTo(pointA4.x, pointA4.y)
+ browserCanvasContext.lineTo(pointB4.x, pointB4.y)
+ browserCanvasContext.lineTo(pointB3.x, pointB3.y)
+ browserCanvasContext.lineTo(pointA3.x, pointA3.y)
+ browserCanvasContext.closePath()
+
+ drawEdge('bottom')
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(pointA4.x, pointA4.y)
+ browserCanvasContext.lineTo(pointA1.x, pointA1.y)
+ browserCanvasContext.lineTo(pointB1.x, pointB1.y)
+ browserCanvasContext.lineTo(pointB4.x, pointB4.y)
+ browserCanvasContext.lineTo(pointA4.x, pointA4.y)
+ browserCanvasContext.closePath()
+
+ drawEdge('left')
+
+ function drawEdge(edgeType) {
+ if (whereIsMouseOver === edgeType && thisObject.isMouseOver === true) {
+ browserCanvasContext.lineWidth = lineWidth
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + OPACITY + ')'
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+ } else {
+ browserCanvasContext.lineWidth = lineWidth
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + OPACITY + ')'
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
+ }
+ browserCanvasContext.fill()
+ browserCanvasContext.stroke()
}
- thisObject.container.parentContainer.eventHandler.raiseEvent('Dimmensions Changed', event)
- break
- }
}
-
- function snapPointToGrid (point) {
- point.x = snapScalarToGrid(point.x)
- point.y = snapScalarToGrid(point.y)
- }
-
- function snapScalarToGrid (scalar) {
- let sign
- if (scalar < 0) {
- sign = -1
- } else {
- sign = 1
- }
- const GRID_SIZE = 10
- return Math.trunc(scalar / GRID_SIZE) * GRID_SIZE + GRID_SIZE / 2 * sign
- }
- }
-
- function drawForeground () {
- let MARGIN = 1
- let edgeSize
- let lineWidth
-
- if (whereIsMouseOver === 'outside' || thisObject.isMouseOver === false) {
- edgeSize = 2
- lineWidth = 0.1
- } else {
- edgeSize = EDGE_SIZE
- lineWidth = 0.5
- }
-
- const OPACITY = 1
-
- pointA1 = {
- x: 0,
- y: 0
- }
-
- pointA2 = {
- x: thisObject.container.frame.width,
- y: 0
- }
-
- pointA3 = {
- x: thisObject.container.frame.width,
- y: thisObject.container.frame.height
- }
-
- pointA4 = {
- x: 0,
- y: thisObject.container.frame.height
- }
-
- pointB1 = {
- x: 0,
- y: 0
- }
-
- pointB2 = {
- x: thisObject.container.frame.width,
- y: 0
- }
-
- pointB3 = {
- x: thisObject.container.frame.width,
- y: thisObject.container.frame.height
- }
-
- pointB4 = {
- x: 0,
- y: thisObject.container.frame.height
- }
-
- pointA1 = transformThisPoint(pointA1, thisObject.container)
- pointA2 = transformThisPoint(pointA2, thisObject.container)
- pointA3 = transformThisPoint(pointA3, thisObject.container)
- pointA4 = transformThisPoint(pointA4, thisObject.container)
-
- pointB1 = transformThisPoint(pointB1, thisObject.container)
- pointB2 = transformThisPoint(pointB2, thisObject.container)
- pointB3 = transformThisPoint(pointB3, thisObject.container)
- pointB4 = transformThisPoint(pointB4, thisObject.container)
-
- pointA1 = {
- x: pointA1.x - MARGIN,
- y: pointA1.y - MARGIN
- }
-
- pointA2 = {
- x: pointA2.x + MARGIN,
- y: pointA2.y - MARGIN
- }
-
- pointA3 = {
- x: pointA3.x + MARGIN,
- y: pointA3.y + MARGIN
- }
-
- pointA4 = {
- x: pointA4.x - MARGIN,
- y: pointA4.y + MARGIN
- }
-
- pointB1 = {
- x: pointB1.x - edgeSize,
- y: pointB1.y - edgeSize
- }
-
- pointB2 = {
- x: pointB2.x + edgeSize,
- y: pointB2.y - edgeSize
- }
-
- pointB3 = {
- x: pointB3.x + edgeSize,
- y: pointB3.y + edgeSize
- }
-
- pointB4 = {
- x: pointB4.x - edgeSize,
- y: pointB4.y + edgeSize
- }
-
- pointA1 = canvas.chartingSpace.viewport.fitIntoViewport(pointA1)
- pointA2 = canvas.chartingSpace.viewport.fitIntoViewport(pointA2)
- pointA3 = canvas.chartingSpace.viewport.fitIntoViewport(pointA3)
- pointA4 = canvas.chartingSpace.viewport.fitIntoViewport(pointA4)
-
- pointB1 = canvas.chartingSpace.viewport.fitIntoViewport(pointB1)
- pointB2 = canvas.chartingSpace.viewport.fitIntoViewport(pointB2)
- pointB3 = canvas.chartingSpace.viewport.fitIntoViewport(pointB3)
- pointB4 = canvas.chartingSpace.viewport.fitIntoViewport(pointB4)
-
- browserCanvasContext.setLineDash([0, 0])
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(pointA1.x, pointA1.y)
- browserCanvasContext.lineTo(pointA2.x, pointA2.y)
- browserCanvasContext.lineTo(pointB2.x, pointB2.y)
- browserCanvasContext.lineTo(pointB1.x, pointB1.y)
- browserCanvasContext.lineTo(pointA1.x, pointA1.y)
- browserCanvasContext.closePath()
-
- drawEdge('top')
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(pointA2.x, pointA2.y)
- browserCanvasContext.lineTo(pointA3.x, pointA3.y)
- browserCanvasContext.lineTo(pointB3.x, pointB3.y)
- browserCanvasContext.lineTo(pointB2.x, pointB2.y)
- browserCanvasContext.lineTo(pointA2.x, pointA2.y)
- browserCanvasContext.closePath()
-
- drawEdge('right')
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(pointA3.x, pointA3.y)
- browserCanvasContext.lineTo(pointA4.x, pointA4.y)
- browserCanvasContext.lineTo(pointB4.x, pointB4.y)
- browserCanvasContext.lineTo(pointB3.x, pointB3.y)
- browserCanvasContext.lineTo(pointA3.x, pointA3.y)
- browserCanvasContext.closePath()
-
- drawEdge('bottom')
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(pointA4.x, pointA4.y)
- browserCanvasContext.lineTo(pointA1.x, pointA1.y)
- browserCanvasContext.lineTo(pointB1.x, pointB1.y)
- browserCanvasContext.lineTo(pointB4.x, pointB4.y)
- browserCanvasContext.lineTo(pointA4.x, pointA4.y)
- browserCanvasContext.closePath()
-
- drawEdge('left')
-
- function drawEdge (edgeType) {
- if (whereIsMouseOver === edgeType && thisObject.isMouseOver === true) {
- browserCanvasContext.lineWidth = lineWidth
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + OPACITY + ')'
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
- } else {
- browserCanvasContext.lineWidth = lineWidth
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + OPACITY + ')'
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
- }
- browserCanvasContext.fill()
- browserCanvasContext.stroke()
- }
- }
}
diff --git a/CanvasApp/ChartingSpace/PlottersManager.js b/CanvasApp/ChartingSpace/PlottersManager.js
index 3b76c7698..458a2599b 100644
--- a/CanvasApp/ChartingSpace/PlottersManager.js
+++ b/CanvasApp/ChartingSpace/PlottersManager.js
@@ -1,459 +1,459 @@
-function newPlottersManager () {
- const MODULE_NAME = 'Plotters Manager'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newPlottersManager() {
+ const MODULE_NAME = 'Plotters Manager'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let timeFrame = INITIAL_TIME_PERIOD
- let datetime = NEW_SESSION_INITIAL_DATE
+ let timeFrame = INITIAL_TIME_PERIOD
+ let datetime = NEW_SESSION_INITIAL_DATE
- let thisObject = {
- fitFunction: undefined,
- container: undefined,
- payload: undefined,
- connectors: [],
- setDatetime: setDatetime,
- setTimeFrame: setTimeFrame,
- setCoordinateSystem: setCoordinateSystem,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.connectors = []
-
- let initializationReady = false
- let layersPanel
- let onLayerStatusChangedEventSuscriptionId
- let coordinateSystem
-
- setupContainer()
- return thisObject
-
- function setupContainer () {
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- }
-
- function finalize () {
- layersPanel.container.eventHandler.stopListening(onLayerStatusChangedEventSuscriptionId)
- layersPanel = undefined
-
- for (let i = 0; i < thisObject.connectors.length; i++) {
- let connector = thisObject.connectors[i]
- /* Then the panels. */
- for (let j = 0; j < connector.panels.length; j++) {
- canvas.panelsSpace.destroyPanel(connector.panels[j])
- connector.panels[j] = undefined
- }
- connector.panels = undefined
-
- /* Finalize the plotters */
- if (connector.plotter.finalize !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.plotter.onRecordChangeEventsSubscriptionId)
- connector.plotter.finalize()
- }
- connector.plotter = undefined
-
- /* Finally the Storage Objects */
- finalizeStorage(connector.storage)
- connector.storage = undefined
-
- connector = undefined
+ let thisObject = {
+ fitFunction: undefined,
+ container: undefined,
+ payload: undefined,
+ connectors: [],
+ setDatetime: setDatetime,
+ setTimeFrame: setTimeFrame,
+ setCoordinateSystem: setCoordinateSystem,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
+
thisObject.connectors = []
- coordinateSystem = undefined
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- }
+ let initializationReady = false
+ let layersPanel
+ let onLayerStatusChangedEventSuscriptionId
+ let coordinateSystem
- function finalizeStorage (storage) {
- storage.eventHandler.stopListening(storage.onMarketFileLoadedLayerEventsSubscriptionId)
- storage.eventHandler.stopListening(storage.onDailyFileLoadedLayerEventsSubscriptionId)
- storage.eventHandler.stopListening(storage.onSingleFileLoadedLayerEventsSubscriptionId)
- storage.eventHandler.stopListening(storage.onFileSequenceLoadedLayerEventsSubscriptionId)
- storage.eventHandler.stopListening(storage.onDailyFileLoadedPlotterEventsSubscriptionId)
- storage.finalize()
- }
+ setupContainer()
+ return thisObject
- function initialize (pLayersPanel) {
- /* Remember this */
- layersPanel = pLayersPanel
-
- /* Listen to the event of change of status */
- onLayerStatusChangedEventSuscriptionId = layersPanel.container.eventHandler.listenToEvent('Layer Status Changed', onLayerStatusChanged)
- }
-
- function initializePlotter (layer) {
- try {
- /* Before Initializing a Plotter, we need the Storage it will use, loaded with the files it will initially need. */
- let storage = newProductStorage(layer.payload.node.id)
-
- /*
- Before Initializing the Storage, we will put the Layer to listen to the events the storage will raise every time a file is loaded,
- so that the UI can somehow show this. There are different types of events.
- */
- for (let i = 0; i < layer.definition.referenceParent.referenceParent.datasets.length; i++) {
- let dataset = layer.definition.referenceParent.referenceParent.datasets[i]
-
- switch (dataset.config.type) {
- case 'Market Files': {
- storage.onMarketFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Market File Loaded', layer.onMarketFileLoaded)
- }
- break
- case 'Daily Files': {
- storage.onDailyFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Daily File Loaded', layer.onDailyFileLoaded)
- }
- break
- case 'Single File': {
- storage.onSingleFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Single File Loaded', layer.onSingleFileLoaded)
- }
- break
- case 'File Sequence': {
- storage.onFileSequenceLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('File Sequence Loaded', layer.onFileSequenceLoaded)
- }
- break
- default: {
- if (ERROR_LOG === true) {
- logger.write('[ERROR] initializePlotter -> Dataset Type Incorrect or Undefined -> dataset.type = ' + dataset.type)
- }
- return
- }
- }
- }
-
- let baseAsset = layer.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent.config.codeName
- let quotedAsset = layer.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
- let market = {
- baseAsset: baseAsset,
- quotedAsset: quotedAsset
- }
- let productDefinition = layer.definition.referenceParent.referenceParent
- let bot = layer.definition.referenceParent.referenceParent.parentNode
- let dataMine = layer.definition.referenceParent.referenceParent.parentNode.parentNode
- let exchange = layer.definition.referenceParent.parentNode.referenceParent.parentNode.parentNode
- let plotterModule = layer.definition.referenceParent.referenceParent.referenceParent
- let session
- let tradingSystem
- let tradingEngine
-
- /*
- A layer can be referencing a Data Product in two different branches of the Network hiriatchy.
- In one of those braches we can get the Session node, at the other we Cannot.
- */
- if (layer.definition.referenceParent.parentNode.parentNode !== undefined) {
- if (layer.definition.referenceParent.parentNode.parentNode.type === 'Session Reference') {
- if (layer.definition.referenceParent.parentNode.parentNode.referenceParent !== undefined) {
- session = layer.definition.referenceParent.parentNode.parentNode.referenceParent
-
- /* From the session we might be able to reach the Trading System or the Trading Engine */
- if (session.tradingSystemReference !== undefined) {
- tradingSystem = session.tradingSystemReference.referenceParent
- }
- if (session.tradingEngineReference !== undefined) {
- tradingEngine = session.tradingEngineReference.referenceParent
- }
- }
- }
- }
-
- let host = layer.networkNode.config.host
- let webPort = layer.networkNode.config.webPort
- if (host === undefined) { host = 'localhost' }
- if (webPort === undefined) { webPort = window.location.port }
-
- let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(layer.networkNode.id)
-
- storage.initialize(
- dataMine,
- bot,
- session,
- productDefinition,
- exchange,
- market,
- datetime,
- timeFrame,
- host,
- webPort,
- eventsServerClient,
- onProductStorageInitialized
- )
-
- function onProductStorageInitialized (err) {
- if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
- /* Now we have all the initial data loaded and ready to be delivered to the new instance of the plotter. */
- let plotter
-
- if (plotterModule.config.isLegacy !== true) {
- plotter = newPlotter()
- } else {
- plotter = getNewPlotter(dataMine.config.codeName, plotterModule.parentNode.config.codeName, plotterModule.config.codeName)
- }
-
- plotter.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
- plotter.container.frame.position.x = thisObject.container.frame.width / 2 - plotter.container.frame.width / 2
- plotter.container.frame.position.y = thisObject.container.frame.height / 2 - plotter.container.frame.height / 2
- plotter.fitFunction = thisObject.fitFunction
- plotter.initialize(storage, datetime, timeFrame, coordinateSystem, onPlotterInizialized, productDefinition)
-
- function onPlotterInizialized () {
- let connector = {
- layer: layer,
- plotter: plotter,
- storage: storage
- }
- /* Let the Plotter listen to the event of Cursor Files loaded, so that it can react recalculating if needed. */
- plotter.onDailyFileLoadedPlotterEventsSubscriptionId = storage.eventHandler.listenToEvent('Daily File Loaded', plotter.onDailyFileLoaded)
- /* Lets load now this plotter panels. */
- connector.panels = []
-
- if (productDefinition !== undefined) {
- /* Here we setup the panels associated with this plotter */
- for (let i = 0; i < plotterModule.panels.length; i++) {
- let panel = plotterModule.panels[i]
-
- let parameters = {
- dataMine: dataMine.config.codeName,
- plotterCodeName: plotterModule.parentNode.config.codeName,
- moduleCodeName: plotterModule.config.codeName,
- panelNode: panel
- }
-
- let owner = thisObject.payload.node.payload.parentNode.id // Panels are owned by the time machine.
- let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, owner, layer.session)
- let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle)
-
- /* Connect Panel to the Plotter via an Event. */
- connector.plotter.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', plotterPanel.onRecordChange)
- connector.panels.push(plotterPanelHandle)
- }
- connector.layer.panels = connector.panels
-
- /*
- Next we will check the different types of Plotting related to connecting to an existing node branch.
- */
- if (plotterModule.nodesHighlights !== undefined && plotterModule.config.connectTo !== undefined) {
- connector.nodesHighlights = newNodesHighlights()
- switch (plotterModule.config.connectTo) {
- case 'Trading System':
- connector.nodesHighlights.initialize(tradingSystem)
- break
- case 'Trading Engine':
- connector.nodesHighlights.initialize(tradingEngine)
- break
- }
- connector.nodesHighlights.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesHighlights.onRecordChange)
- }
- if (plotterModule.nodesValues !== undefined && plotterModule.config.connectTo !== undefined) {
- connector.nodesValues = newNodesValues()
- switch (plotterModule.config.connectTo) {
- case 'Trading System':
- connector.nodesValues.initialize(tradingSystem)
- break
- case 'Trading Engine':
- connector.nodesValues.initialize(tradingEngine)
- break
- }
- connector.nodesValues.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesValues.onRecordChange)
- }
- if (plotterModule.nodesErrors !== undefined && plotterModule.config.connectTo !== undefined) {
- connector.nodesErrors = newNodesErrors()
- switch (plotterModule.config.connectTo) {
- case 'Trading System':
- connector.nodesErrors.initialize(tradingSystem)
- break
- case 'Trading Engine':
- connector.nodesErrors.initialize(tradingEngine)
- break
- }
- connector.nodesErrors.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesErrors.onRecordChange)
- }
- if (plotterModule.nodesRunning !== undefined && plotterModule.config.connectTo !== undefined) {
- connector.nodesRunning = newNodesRunning()
- switch (plotterModule.config.connectTo) {
- case 'Trading System':
- connector.nodesRunning.initialize(tradingSystem)
- break
- case 'Trading Engine':
- connector.nodesRunning.initialize(tradingEngine)
- break
- }
- connector.nodesRunning.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesRunning.onRecordChange)
- }
- if (plotterModule.nodesStatus !== undefined && plotterModule.config.connectTo !== undefined) {
- connector.nodesStatus = newNodesStatus()
- switch (plotterModule.config.connectTo) {
- case 'Trading System':
- connector.nodesStatus.initialize(tradingSystem)
- break
- case 'Trading Engine':
- connector.nodesStatus.initialize(tradingEngine)
- break
- }
- connector.nodesStatus.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesStatus.onRecordChange)
- }
- if (plotterModule.nodesProgress !== undefined && plotterModule.config.connectTo !== undefined) {
- connector.nodesProgress = newNodesProgress()
- switch (plotterModule.config.connectTo) {
- case 'Trading System':
- connector.nodesProgress.initialize(tradingSystem)
- break
- case 'Trading Engine':
- connector.nodesProgress.initialize(tradingEngine)
- break
- }
- connector.nodesProgress.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesProgress.onRecordChange)
- }
- if (plotterModule.nodesAnnouncements !== undefined && plotterModule.config.connectTo !== undefined) {
- connector.nodesAnnounements = newNodesAnnouncements()
- switch (plotterModule.config.connectTo) {
- case 'Trading System':
- connector.nodesAnnounements.initialize(tradingSystem)
- break
- case 'Trading Engine':
- connector.nodesAnnounements.initialize(tradingEngine)
- break
- }
- connector.nodesAnnounements.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesAnnounements.onRecordChange)
- }
- /*
- Another type of plotting is with Record Values. This method uses the record definition to find the target node
- and from there is looks into its children all based on the Record Definition configuration.
- */
- if (plotterModule.recordValues !== undefined) {
- connector.recordValues = newRecordValues()
- connector.recordValues.initialize(tradingSystem, tradingEngine, productDefinition)
- connector.recordValues.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.recordValues.onRecordChange)
- }
- }
- thisObject.connectors.push(connector)
- }
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initializePlotter -> err = ' + err.stack) }
+ function setupContainer() {
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
}
- }
- function onLayerStatusChanged (layer) {
- if (layer.status === LAYER_STATUS.LOADING) {
- /* Lets see if we can find the Plotter of this card on our Active Plotters list, other wise we will initialize it */
- let found = false
- for (let i = 0; i < thisObject.connectors.length; i++) {
- let connector = thisObject.connectors[i]
- if (connector.layer.payload.node.id === layer.payload.node.id) {
- found = true
- }
- }
- if (found === false) {
- initializePlotter(layer, onProductPlotterInitialized)
- function onProductPlotterInitialized (err) {
- /* There is no policy yet of what to do if this fails. */
- }
- }
- }
- if (layer.status === LAYER_STATUS.OFF) {
- /* If the plotter of this card is not on our Active Plotters list, then we remove it. */
- for (let i = 0; i < thisObject.connectors.length; i++) {
- let connector = thisObject.connectors[i]
- if (connector.layer.payload.node.id === layer.payload.node.id) {
- /* Then the panels. */
- for (let j = 0; j < connector.panels.length; j++) {
- canvas.panelsSpace.destroyPanel(connector.panels[j])
- }
+ function finalize() {
+ layersPanel.container.eventHandler.stopListening(onLayerStatusChangedEventSuscriptionId)
+ layersPanel = undefined
+
+ for (let i = 0; i < thisObject.connectors.length; i++) {
+ let connector = thisObject.connectors[i]
+ /* Then the panels. */
+ for (let j = 0; j < connector.panels.length; j++) {
+ canvas.panelsSpace.destroyPanel(connector.panels[j])
+ connector.panels[j] = undefined
+ }
+ connector.panels = undefined
+
+ /* Finalize the plotters */
+ if (connector.plotter.finalize !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.plotter.onRecordChangeEventsSubscriptionId)
+ connector.plotter.finalize()
+ }
+ connector.plotter = undefined
+
/* Finally the Storage Objects */
- finalizeNodesPlotting(connector)
- if (connector.plotter.finalize !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.plotter.onRecordChangeEventsSubscriptionId)
- connector.plotter.container.finalize()
- connector.plotter.finalize()
- }
- finalizeStorage(connector.storage)
- thisObject.connectors.splice(i, 1) // Delete item from array.
- return // We already found the product woth changes and processed it.
+ finalizeStorage(connector.storage)
+ connector.storage = undefined
+
+ connector = undefined
}
- }
- }
- }
+ thisObject.connectors = []
+ coordinateSystem = undefined
- function finalizeNodesPlotting (connector) {
- if (connector.nodesHighlights !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.nodesHighlights.onRecordChangeEventsSubscriptionId)
- connector.nodesHighlights.finalize()
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
}
- if (connector.nodesValues !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.nodesValues.onRecordChangeEventsSubscriptionId)
- connector.nodesValues.finalize()
- }
- if (connector.nodesErrors !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.nodesErrors.onRecordChangeEventsSubscriptionId)
- connector.nodesErrors.finalize()
- }
- if (connector.nodesStatus !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.nodesStatus.onRecordChangeEventsSubscriptionId)
- connector.nodesStatus.finalize()
- }
- if (connector.nodesProgress !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.Progress.onRecordChangeEventsSubscriptionId)
- connector.Progress.finalize()
- }
- if (connector.nodesRunning !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.nodesRunning.onRecordChangeEventsSubscriptionId)
- connector.nodesRunning.finalize()
- }
- if (connector.recordValues !== undefined) {
- connector.plotter.container.eventHandler.stopListening(connector.recordValues.onRecordChangeEventsSubscriptionId)
- connector.recordValues.finalize()
- }
- }
- function setTimeFrame (pTimeFrame) {
- timeFrame = pTimeFrame
- for (let i = 0; i < thisObject.connectors.length; i++) {
- let connector = thisObject.connectors[i]
- connector.layer.setTimeFrame(timeFrame)
- connector.storage.setTimeFrame(timeFrame)
- connector.plotter.setTimeFrame(timeFrame)
+ function finalizeStorage(storage) {
+ storage.eventHandler.stopListening(storage.onMarketFileLoadedLayerEventsSubscriptionId)
+ storage.eventHandler.stopListening(storage.onDailyFileLoadedLayerEventsSubscriptionId)
+ storage.eventHandler.stopListening(storage.onSingleFileLoadedLayerEventsSubscriptionId)
+ storage.eventHandler.stopListening(storage.onFileSequenceLoadedLayerEventsSubscriptionId)
+ storage.eventHandler.stopListening(storage.onDailyFileLoadedPlotterEventsSubscriptionId)
+ storage.finalize()
}
- }
- function setDatetime (pDatetime) {
- datetime = pDatetime
- for (let i = 0; i < thisObject.connectors.length; i++) {
- let connector = thisObject.connectors[i]
- connector.layer.setDatetime(pDatetime)
- connector.storage.setDatetime(pDatetime)
- connector.plotter.setDatetime(pDatetime)
+ function initialize(pLayersPanel) {
+ /* Remember this */
+ layersPanel = pLayersPanel
+
+ /* Listen to the event of change of status */
+ onLayerStatusChangedEventSuscriptionId = layersPanel.container.eventHandler.listenToEvent('Layer Status Changed', onLayerStatusChanged)
}
- }
- function setCoordinateSystem (pCoordinateSystem) {
- coordinateSystem = pCoordinateSystem
- for (let i = 0; i < thisObject.connectors.length; i++) {
- let connector = thisObject.connectors[i]
- connector.plotter.setCoordinateSystem(coordinateSystem)
+ function initializePlotter(layer) {
+ try {
+ /* Before Initializing a Plotter, we need the Storage it will use, loaded with the files it will initially need. */
+ let storage = newProductStorage(layer.payload.node.id)
+
+ /*
+ Before Initializing the Storage, we will put the Layer to listen to the events the storage will raise every time a file is loaded,
+ so that the UI can somehow show this. There are different types of events.
+ */
+ for (let i = 0; i < layer.definition.referenceParent.referenceParent.datasets.length; i++) {
+ let dataset = layer.definition.referenceParent.referenceParent.datasets[i]
+
+ switch (dataset.config.type) {
+ case 'Market Files': {
+ storage.onMarketFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Market File Loaded', layer.onMarketFileLoaded)
+ }
+ break
+ case 'Daily Files': {
+ storage.onDailyFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Daily File Loaded', layer.onDailyFileLoaded)
+ }
+ break
+ case 'Single File': {
+ storage.onSingleFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Single File Loaded', layer.onSingleFileLoaded)
+ }
+ break
+ case 'File Sequence': {
+ storage.onFileSequenceLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('File Sequence Loaded', layer.onFileSequenceLoaded)
+ }
+ break
+ default: {
+ if (ERROR_LOG === true) {
+ logger.write('[ERROR] initializePlotter -> Dataset Type Incorrect or Undefined -> dataset.type = ' + dataset.type)
+ }
+ return
+ }
+ }
+ }
+
+ let baseAsset = layer.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent.config.codeName
+ let quotedAsset = layer.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
+ let market = {
+ baseAsset: baseAsset,
+ quotedAsset: quotedAsset
+ }
+ let productDefinition = layer.definition.referenceParent.referenceParent
+ let bot = layer.definition.referenceParent.referenceParent.parentNode
+ let dataMine = layer.definition.referenceParent.referenceParent.parentNode.parentNode
+ let exchange = layer.definition.referenceParent.parentNode.referenceParent.parentNode.parentNode
+ let plotterModule = layer.definition.referenceParent.referenceParent.referenceParent
+ let session
+ let tradingSystem
+ let tradingEngine
+
+ /*
+ A layer can be referencing a Data Product in two different branches of the Network hiriatchy.
+ In one of those braches we can get the Session node, at the other we Cannot.
+ */
+ if (layer.definition.referenceParent.parentNode.parentNode !== undefined) {
+ if (layer.definition.referenceParent.parentNode.parentNode.type === 'Session Reference') {
+ if (layer.definition.referenceParent.parentNode.parentNode.referenceParent !== undefined) {
+ session = layer.definition.referenceParent.parentNode.parentNode.referenceParent
+
+ /* From the session we might be able to reach the Trading System or the Trading Engine */
+ if (session.tradingSystemReference !== undefined) {
+ tradingSystem = session.tradingSystemReference.referenceParent
+ }
+ if (session.tradingEngineReference !== undefined) {
+ tradingEngine = session.tradingEngineReference.referenceParent
+ }
+ }
+ }
+ }
+
+ let host = layer.networkNode.config.host
+ let webPort = layer.networkNode.config.webPort
+ if (host === undefined) { host = 'localhost' }
+ if (webPort === undefined) { webPort = window.location.port }
+
+ let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(layer.networkNode.id)
+
+ storage.initialize(
+ dataMine,
+ bot,
+ session,
+ productDefinition,
+ exchange,
+ market,
+ datetime,
+ timeFrame,
+ host,
+ webPort,
+ eventsServerClient,
+ onProductStorageInitialized
+ )
+
+ function onProductStorageInitialized(err) {
+ if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ /* Now we have all the initial data loaded and ready to be delivered to the new instance of the plotter. */
+ let plotter
+
+ if (plotterModule.config.isLegacy !== true) {
+ plotter = newPlotter()
+ } else {
+ plotter = getNewPlotter(dataMine.config.codeName, plotterModule.parentNode.config.codeName, plotterModule.config.codeName)
+ }
+
+ plotter.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
+ plotter.container.frame.position.x = thisObject.container.frame.width / 2 - plotter.container.frame.width / 2
+ plotter.container.frame.position.y = thisObject.container.frame.height / 2 - plotter.container.frame.height / 2
+ plotter.fitFunction = thisObject.fitFunction
+ plotter.initialize(storage, datetime, timeFrame, coordinateSystem, onPlotterInizialized, productDefinition)
+
+ function onPlotterInizialized() {
+ let connector = {
+ layer: layer,
+ plotter: plotter,
+ storage: storage
+ }
+ /* Let the Plotter listen to the event of Cursor Files loaded, so that it can react recalculating if needed. */
+ plotter.onDailyFileLoadedPlotterEventsSubscriptionId = storage.eventHandler.listenToEvent('Daily File Loaded', plotter.onDailyFileLoaded)
+ /* Lets load now this plotter panels. */
+ connector.panels = []
+
+ if (productDefinition !== undefined) {
+ /* Here we setup the panels associated with this plotter */
+ for (let i = 0; i < plotterModule.panels.length; i++) {
+ let panel = plotterModule.panels[i]
+
+ let parameters = {
+ dataMine: dataMine.config.codeName,
+ plotterCodeName: plotterModule.parentNode.config.codeName,
+ moduleCodeName: plotterModule.config.codeName,
+ panelNode: panel
+ }
+
+ let owner = thisObject.payload.node.payload.parentNode.id // Panels are owned by the time machine.
+ let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, owner, layer.session)
+ let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle)
+
+ /* Connect Panel to the Plotter via an Event. */
+ connector.plotter.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', plotterPanel.onRecordChange)
+ connector.panels.push(plotterPanelHandle)
+ }
+ connector.layer.panels = connector.panels
+
+ /*
+ Next we will check the different types of Plotting related to connecting to an existing node branch.
+ */
+ if (plotterModule.nodesHighlights !== undefined && plotterModule.config.connectTo !== undefined) {
+ connector.nodesHighlights = newNodesHighlights()
+ switch (plotterModule.config.connectTo) {
+ case 'Trading System':
+ connector.nodesHighlights.initialize(tradingSystem)
+ break
+ case 'Trading Engine':
+ connector.nodesHighlights.initialize(tradingEngine)
+ break
+ }
+ connector.nodesHighlights.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesHighlights.onRecordChange)
+ }
+ if (plotterModule.nodesValues !== undefined && plotterModule.config.connectTo !== undefined) {
+ connector.nodesValues = newNodesValues()
+ switch (plotterModule.config.connectTo) {
+ case 'Trading System':
+ connector.nodesValues.initialize(tradingSystem)
+ break
+ case 'Trading Engine':
+ connector.nodesValues.initialize(tradingEngine)
+ break
+ }
+ connector.nodesValues.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesValues.onRecordChange)
+ }
+ if (plotterModule.nodesErrors !== undefined && plotterModule.config.connectTo !== undefined) {
+ connector.nodesErrors = newNodesErrors()
+ switch (plotterModule.config.connectTo) {
+ case 'Trading System':
+ connector.nodesErrors.initialize(tradingSystem)
+ break
+ case 'Trading Engine':
+ connector.nodesErrors.initialize(tradingEngine)
+ break
+ }
+ connector.nodesErrors.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesErrors.onRecordChange)
+ }
+ if (plotterModule.nodesRunning !== undefined && plotterModule.config.connectTo !== undefined) {
+ connector.nodesRunning = newNodesRunning()
+ switch (plotterModule.config.connectTo) {
+ case 'Trading System':
+ connector.nodesRunning.initialize(tradingSystem)
+ break
+ case 'Trading Engine':
+ connector.nodesRunning.initialize(tradingEngine)
+ break
+ }
+ connector.nodesRunning.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesRunning.onRecordChange)
+ }
+ if (plotterModule.nodesStatus !== undefined && plotterModule.config.connectTo !== undefined) {
+ connector.nodesStatus = newNodesStatus()
+ switch (plotterModule.config.connectTo) {
+ case 'Trading System':
+ connector.nodesStatus.initialize(tradingSystem)
+ break
+ case 'Trading Engine':
+ connector.nodesStatus.initialize(tradingEngine)
+ break
+ }
+ connector.nodesStatus.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesStatus.onRecordChange)
+ }
+ if (plotterModule.nodesProgress !== undefined && plotterModule.config.connectTo !== undefined) {
+ connector.nodesProgress = newNodesProgress()
+ switch (plotterModule.config.connectTo) {
+ case 'Trading System':
+ connector.nodesProgress.initialize(tradingSystem)
+ break
+ case 'Trading Engine':
+ connector.nodesProgress.initialize(tradingEngine)
+ break
+ }
+ connector.nodesProgress.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesProgress.onRecordChange)
+ }
+ if (plotterModule.nodesAnnouncements !== undefined && plotterModule.config.connectTo !== undefined) {
+ connector.nodesAnnounements = newNodesAnnouncements()
+ switch (plotterModule.config.connectTo) {
+ case 'Trading System':
+ connector.nodesAnnounements.initialize(tradingSystem)
+ break
+ case 'Trading Engine':
+ connector.nodesAnnounements.initialize(tradingEngine)
+ break
+ }
+ connector.nodesAnnounements.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.nodesAnnounements.onRecordChange)
+ }
+ /*
+ Another type of plotting is with Record Values. This method uses the record definition to find the target node
+ and from there is looks into its children all based on the Record Definition configuration.
+ */
+ if (plotterModule.recordValues !== undefined) {
+ connector.recordValues = newRecordValues()
+ connector.recordValues.initialize(tradingSystem, tradingEngine, productDefinition)
+ connector.recordValues.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', connector.recordValues.onRecordChange)
+ }
+ }
+ thisObject.connectors.push(connector)
+ }
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initializePlotter -> err = ' + err.stack) }
+ }
}
- }
- function getContainer (point) {
- }
+ function onLayerStatusChanged(layer) {
+ if (layer.status === LAYER_STATUS.LOADING) {
+ /* Lets see if we can find the Plotter of this card on our Active Plotters list, other wise we will initialize it */
+ let found = false
+ for (let i = 0; i < thisObject.connectors.length; i++) {
+ let connector = thisObject.connectors[i]
+ if (connector.layer.payload.node.id === layer.payload.node.id) {
+ found = true
+ }
+ }
+ if (found === false) {
+ initializePlotter(layer, onProductPlotterInitialized)
+ function onProductPlotterInitialized(err) {
+ /* There is no policy yet of what to do if this fails. */
+ }
+ }
+ }
+ if (layer.status === LAYER_STATUS.OFF) {
+ /* If the plotter of this card is not on our Active Plotters list, then we remove it. */
+ for (let i = 0; i < thisObject.connectors.length; i++) {
+ let connector = thisObject.connectors[i]
+ if (connector.layer.payload.node.id === layer.payload.node.id) {
+ /* Then the panels. */
+ for (let j = 0; j < connector.panels.length; j++) {
+ canvas.panelsSpace.destroyPanel(connector.panels[j])
+ }
+ /* Finally the Storage Objects */
+ finalizeNodesPlotting(connector)
+ if (connector.plotter.finalize !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.plotter.onRecordChangeEventsSubscriptionId)
+ connector.plotter.container.finalize()
+ connector.plotter.finalize()
+ }
+ finalizeStorage(connector.storage)
+ thisObject.connectors.splice(i, 1) // Delete item from array.
+ return // We already found the product woth changes and processed it.
+ }
+ }
+ }
+ }
- function draw () {
- if (thisObject.connectors === undefined) { return } // We need to wait
+ function finalizeNodesPlotting(connector) {
+ if (connector.nodesHighlights !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.nodesHighlights.onRecordChangeEventsSubscriptionId)
+ connector.nodesHighlights.finalize()
+ }
+ if (connector.nodesValues !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.nodesValues.onRecordChangeEventsSubscriptionId)
+ connector.nodesValues.finalize()
+ }
+ if (connector.nodesErrors !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.nodesErrors.onRecordChangeEventsSubscriptionId)
+ connector.nodesErrors.finalize()
+ }
+ if (connector.nodesStatus !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.nodesStatus.onRecordChangeEventsSubscriptionId)
+ connector.nodesStatus.finalize()
+ }
+ if (connector.nodesProgress !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.Progress.onRecordChangeEventsSubscriptionId)
+ connector.Progress.finalize()
+ }
+ if (connector.nodesRunning !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.nodesRunning.onRecordChangeEventsSubscriptionId)
+ connector.nodesRunning.finalize()
+ }
+ if (connector.recordValues !== undefined) {
+ connector.plotter.container.eventHandler.stopListening(connector.recordValues.onRecordChangeEventsSubscriptionId)
+ connector.recordValues.finalize()
+ }
+ }
+
+ function setTimeFrame(pTimeFrame) {
+ timeFrame = pTimeFrame
+ for (let i = 0; i < thisObject.connectors.length; i++) {
+ let connector = thisObject.connectors[i]
+ connector.layer.setTimeFrame(timeFrame)
+ connector.storage.setTimeFrame(timeFrame)
+ connector.plotter.setTimeFrame(timeFrame)
+ }
+ }
+
+ function setDatetime(pDatetime) {
+ datetime = pDatetime
+ for (let i = 0; i < thisObject.connectors.length; i++) {
+ let connector = thisObject.connectors[i]
+ connector.layer.setDatetime(pDatetime)
+ connector.storage.setDatetime(pDatetime)
+ connector.plotter.setDatetime(pDatetime)
+ }
+ }
+
+ function setCoordinateSystem(pCoordinateSystem) {
+ coordinateSystem = pCoordinateSystem
+ for (let i = 0; i < thisObject.connectors.length; i++) {
+ let connector = thisObject.connectors[i]
+ connector.plotter.setCoordinateSystem(coordinateSystem)
+ }
+ }
+
+ function getContainer(point) {
+ }
+
+ function draw() {
+ if (thisObject.connectors === undefined) { return } // We need to wait
/* First the Product Plotters. */
- let maxElementsPlotted = 0
- for (let i = 0; i < thisObject.connectors.length; i++) {
- let connector = thisObject.connectors[thisObject.connectors.length - i - 1]
- let elementsPlotted = connector.plotter.draw()
- if (elementsPlotted !== undefined) {
- if (elementsPlotted > maxElementsPlotted) {
- maxElementsPlotted = elementsPlotted
+ let maxElementsPlotted = 0
+ for (let i = 0; i < thisObject.connectors.length; i++) {
+ let connector = thisObject.connectors[thisObject.connectors.length - i - 1]
+ let elementsPlotted = connector.plotter.draw()
+ if (elementsPlotted !== undefined) {
+ if (elementsPlotted > maxElementsPlotted) {
+ maxElementsPlotted = elementsPlotted
+ }
+ }
}
- }
+ return maxElementsPlotted
}
- return maxElementsPlotted
- }
}
diff --git a/CanvasApp/ChartingSpace/TimeMachine.js b/CanvasApp/ChartingSpace/TimeMachine.js
index ab252f437..9257df6a8 100644
--- a/CanvasApp/ChartingSpace/TimeMachine.js
+++ b/CanvasApp/ChartingSpace/TimeMachine.js
@@ -9,814 +9,814 @@ each one with it own timelineCharts, and each one positioned at an especific poi
*/
-function newTimeMachine () {
- const MODULE_NAME = 'Time Machine'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newTimeMachine() {
+ const MODULE_NAME = 'Time Machine'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let timeFrame = INITIAL_TIME_PERIOD
+ let timeFrame = INITIAL_TIME_PERIOD
- let thisObject = {
- container: undefined,
- timeScale: undefined,
- rateScale: undefined,
- payload: undefined,
- edgeEditor: undefined,
- onFocus: undefined,
- onKeyPressed: onKeyPressed,
- timelineCharts: [],
- fitFunction: fitFunction,
- physics: physics,
- draw: draw,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize,
- finalize: finalize
- }
-
- let timeMachineCoordinateSystem = newCoordinateSystem()
- timeMachineCoordinateSystem.name = 'TIME MACHINE'
-
- let mouse = {
- position: {
- x: 0,
- y: 0
- }
- }
-
- let tabAnimation = 0
- let tabAnimationStatus = 'Close'
- let tabAnimationCounter = 0
- let wasOnFocus = false
- let drawScales = false
- let syncWithDesignerLoop = 0
- let timelineChartsMap = new Map()
-
- let onMouseOverEventSuscriptionId
- let onMouseNotOverEventSuscriptionId
- let timeScaleMouseOverEventSuscriptionId
- let rateScaleMouseOverEventSuscriptionId
- let timeFrameScaleEventSuscriptionId
- let timeFrameScaleMouseOverEventSuscriptionId
- let onScaleChangedEventSubscriptionId
-
- setupContainer()
- return thisObject
-
- function setupContainer () {
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.fitFunction = thisObject.fitFunction
- thisObject.container.isDraggeable = false
- thisObject.container.insideViewport = true
- thisObject.container.detectMouseOver = true
-
- thisObject.container.frame.width = browserCanvas.width / TIME_MACHINE_WIDTH
- thisObject.container.frame.height = (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT
- }
-
- function finalize () {
- timeMachineCoordinateSystem.eventHandler.stopListening(onScaleChangedEventSubscriptionId)
-
- if (thisObject.timeScale !== undefined) {
- finalizeTimeScale()
+ let thisObject = {
+ container: undefined,
+ timeScale: undefined,
+ rateScale: undefined,
+ payload: undefined,
+ edgeEditor: undefined,
+ onFocus: undefined,
+ onKeyPressed: onKeyPressed,
+ timelineCharts: [],
+ fitFunction: fitFunction,
+ physics: physics,
+ draw: draw,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize,
+ finalize: finalize
}
- if (thisObject.rateScale !== undefined) {
- finalizeRateScale()
+ let timeMachineCoordinateSystem = newCoordinateSystem()
+ timeMachineCoordinateSystem.name = 'TIME MACHINE'
+
+ let mouse = {
+ position: {
+ x: 0,
+ y: 0
+ }
}
- if (thisObject.timeFrameScale !== undefined) {
- finalizeTimeFrameScale()
+ let tabAnimation = 0
+ let tabAnimationStatus = 'Close'
+ let tabAnimationCounter = 0
+ let wasOnFocus = false
+ let drawScales = false
+ let syncWithDesignerLoop = 0
+ let timelineChartsMap = new Map()
+
+ let onMouseOverEventSuscriptionId
+ let onMouseNotOverEventSuscriptionId
+ let timeScaleMouseOverEventSuscriptionId
+ let rateScaleMouseOverEventSuscriptionId
+ let timeFrameScaleEventSuscriptionId
+ let timeFrameScaleMouseOverEventSuscriptionId
+ let onScaleChangedEventSubscriptionId
+
+ setupContainer()
+ return thisObject
+
+ function setupContainer() {
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.fitFunction = thisObject.fitFunction
+ thisObject.container.isDraggeable = false
+ thisObject.container.insideViewport = true
+ thisObject.container.detectMouseOver = true
+
+ thisObject.container.frame.width = browserCanvas.width / TIME_MACHINE_WIDTH
+ thisObject.container.frame.height = (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT
}
- thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSuscriptionId)
+ function finalize() {
+ timeMachineCoordinateSystem.eventHandler.stopListening(onScaleChangedEventSubscriptionId)
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[i]
- timelineChart.container.eventHandler.stopListening(timelineChart.onChildrenMouseOverEventSuscriptionId)
- timelineChart.finalize()
- }
+ if (thisObject.timeScale !== undefined) {
+ finalizeTimeScale()
+ }
- thisObject.timelineCharts = undefined
- thisObject.fitFunction = undefined
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.edgeEditor = undefined
+ if (thisObject.rateScale !== undefined) {
+ finalizeRateScale()
+ }
- mouse = undefined
- timelineChartsMap = undefined
+ if (thisObject.timeFrameScale !== undefined) {
+ finalizeTimeFrameScale()
+ }
- timeMachineCoordinateSystem.finalize()
- timeMachineCoordinateSystem = undefined
- }
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSuscriptionId)
- function finalizeTimeScale () {
- if (thisObject.timeScale === undefined) { return }
-
- thisObject.timeScale.container.eventHandler.stopListening(timeScaleMouseOverEventSuscriptionId)
- thisObject.timeScale.finalize()
- thisObject.timeScale = undefined
- }
-
- function finalizeRateScale () {
- if (thisObject.rateScale === undefined) { return }
-
- thisObject.rateScale.container.eventHandler.stopListening(rateScaleMouseOverEventSuscriptionId)
- thisObject.rateScale.finalize()
- thisObject.rateScale = undefined
- }
-
- function finalizeTimeFrameScale () {
- if (thisObject.timeFrameScale === undefined) { return }
-
- thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleEventSuscriptionId)
- thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleMouseOverEventSuscriptionId)
- thisObject.timeFrameScale.finalize()
- thisObject.timeFrameScale = undefined
- }
-
- function initialize (callBackFunction) {
- timeFrame = INITIAL_TIME_PERIOD
- loadFrame(thisObject.payload, thisObject.container.frame)
- saveFrame(thisObject.payload, thisObject.container.frame)
-
- recalculateCoordinateSystem()
- recalculateCurrentDatetime()
-
- onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- onScaleChangedEventSubscriptionId = timeMachineCoordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
-
- thisObject.edgeEditor = newEdgeEditor()
- thisObject.edgeEditor.initialize(timeMachineCoordinateSystem)
- thisObject.edgeEditor.container.connectToParent(thisObject.container, true, true, false, true, true, true)
-
- callBackFunction()
- }
-
- function onKeyPressed (event) {
- thisObject.edgeEditor.onKeyPressed(event)
- }
-
- function onMouseOver (event) {
- drawScales = true
-
- mouse.position.x = event.x
- mouse.position.y = event.y
-
- if (thisObject.timeScale !== undefined) {
- thisObject.timeScale.onMouseOverSomeTimeMachineContainer(event)
- }
- if (thisObject.rateScale !== undefined) {
- thisObject.rateScale.onMouseOverSomeTimeMachineContainer(event)
- }
- if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.onMouseOverSomeTimeMachineContainer(event)
- }
- }
-
- function onMouseNotOver (event) {
- drawScales = false
-
- if (thisObject.timeScale !== undefined) {
- thisObject.timeScale.visible = false
- }
- if (thisObject.rateScale !== undefined) {
- thisObject.rateScale.visible = false
- }
- if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.visible = false
- }
- }
-
- function initializeTimeScale () {
- thisObject.timeScale = newTimeScale()
- thisObject.timeScale.fitFunction = thisObject.fitFunction
- thisObject.timeScale.payload = thisObject.payload.node.timeScale.payload
-
- timeScaleMouseOverEventSuscriptionId = thisObject.timeScale.container.eventHandler.listenToEvent('onMouseOverScale', timeScaleMouseOver)
- thisObject.timeScale.initialize(timeMachineCoordinateSystem, thisObject.container)
-
- function timeScaleMouseOver (event) {
- thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
- }
- }
-
- function initializeRateScale () {
- thisObject.rateScale = newRateScale()
- thisObject.rateScale.fitFunction = thisObject.fitFunction
- thisObject.rateScale.payload = thisObject.payload.node.rateScale.payload
-
- rateScaleMouseOverEventSuscriptionId = thisObject.rateScale.container.eventHandler.listenToEvent('onMouseOverScale', rateScaleMouseOver)
- thisObject.rateScale.initialize(timeMachineCoordinateSystem, thisObject.container, thisObject.container)
-
- function rateScaleMouseOver (event) {
- thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
- }
- }
-
- function initializeTimeFrameScale () {
- thisObject.timeFrameScale = newTimeFrameScale()
- thisObject.timeFrameScale.fitFunction = thisObject.fitFunction
- thisObject.timeFrameScale.payload = thisObject.payload.node.timeFrameScale.payload
-
- timeFrameScaleEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('Time Frame Value Changed', timeFrameScaleValueChanged)
- timeFrameScaleMouseOverEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('onMouseOverScale', timeFrameScaleMouseOver)
- thisObject.timeFrameScale.initialize(thisObject.container)
-
- function timeFrameScaleValueChanged (event) {
- let currentTimeFrame = timeFrame
- timeFrame = event.timeFrame
- if (timeFrame !== currentTimeFrame) {
for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[i]
- timelineChart.upstreamTimeFrame = timeFrame
- if (timelineChart.timeFrameScale === undefined) {
- timelineChart.setTimeFrame(timeFrame)
- }
+ let timelineChart = thisObject.timelineCharts[i]
+ timelineChart.container.eventHandler.stopListening(timelineChart.onChildrenMouseOverEventSuscriptionId)
+ timelineChart.finalize()
}
- }
- }
- function timeFrameScaleMouseOver (event) {
- thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
- }
- }
- function getContainer (point, purpose) {
- let container
+ thisObject.timelineCharts = undefined
+ thisObject.fitFunction = undefined
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.edgeEditor = undefined
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) {
- container = thisObject.rateScale.getContainer(point, purpose)
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose)) {
- return container
- } else {
- if (purpose === GET_CONTAINER_PURPOSE.DRAGGING && container.isClickeable === true) {
- return container
- }
+ mouse = undefined
+ timelineChartsMap = undefined
+
+ timeMachineCoordinateSystem.finalize()
+ timeMachineCoordinateSystem = undefined
+ }
+
+ function finalizeTimeScale() {
+ if (thisObject.timeScale === undefined) { return }
+
+ thisObject.timeScale.container.eventHandler.stopListening(timeScaleMouseOverEventSuscriptionId)
+ thisObject.timeScale.finalize()
+ thisObject.timeScale = undefined
+ }
+
+ function finalizeRateScale() {
+ if (thisObject.rateScale === undefined) { return }
+
+ thisObject.rateScale.container.eventHandler.stopListening(rateScaleMouseOverEventSuscriptionId)
+ thisObject.rateScale.finalize()
+ thisObject.rateScale = undefined
+ }
+
+ function finalizeTimeFrameScale() {
+ if (thisObject.timeFrameScale === undefined) { return }
+
+ thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleEventSuscriptionId)
+ thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleMouseOverEventSuscriptionId)
+ thisObject.timeFrameScale.finalize()
+ thisObject.timeFrameScale = undefined
+ }
+
+ function initialize(callBackFunction) {
+ timeFrame = INITIAL_TIME_PERIOD
+ loadFrame(thisObject.payload, thisObject.container.frame)
+ saveFrame(thisObject.payload, thisObject.container.frame)
+
+ recalculateCoordinateSystem()
+ recalculateCurrentDatetime()
+
+ onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ onScaleChangedEventSubscriptionId = timeMachineCoordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
+
+ thisObject.edgeEditor = newEdgeEditor()
+ thisObject.edgeEditor.initialize(timeMachineCoordinateSystem)
+ thisObject.edgeEditor.container.connectToParent(thisObject.container, true, true, false, true, true, true)
+
+ callBackFunction()
+ }
+
+ function onKeyPressed(event) {
+ thisObject.edgeEditor.onKeyPressed(event)
+ }
+
+ function onMouseOver(event) {
+ drawScales = true
+
+ mouse.position.x = event.x
+ mouse.position.y = event.y
+
+ if (thisObject.timeScale !== undefined) {
+ thisObject.timeScale.onMouseOverSomeTimeMachineContainer(event)
}
- }
- }
-
- if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) {
- container = thisObject.timeScale.getContainer(point, purpose)
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose)) {
- return container
- } else {
- if (purpose === GET_CONTAINER_PURPOSE.DRAGGING && container.isClickeable === true) {
- return container
- }
+ if (thisObject.rateScale !== undefined) {
+ thisObject.rateScale.onMouseOverSomeTimeMachineContainer(event)
}
- }
- }
-
- if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) {
- container = thisObject.timeFrameScale.getContainer(point, purpose)
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose)) {
- return container
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.onMouseOverSomeTimeMachineContainer(event)
}
- }
}
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- container = thisObject.timelineCharts[i].getContainer(point, purpose)
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose)) {
- if (thisObject.container.frame.isThisPointHere(point) === true) {
- return container
- }
- } else {
- if (purpose === GET_CONTAINER_PURPOSE.DRAGGING && container.isClickeable === true) {
- if (thisObject.container.frame.isThisPointHere(point) === true) {
- return container
+ function onMouseNotOver(event) {
+ drawScales = false
+
+ if (thisObject.timeScale !== undefined) {
+ thisObject.timeScale.visible = false
+ }
+ if (thisObject.rateScale !== undefined) {
+ thisObject.rateScale.visible = false
+ }
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.visible = false
+ }
+ }
+
+ function initializeTimeScale() {
+ thisObject.timeScale = newTimeScale()
+ thisObject.timeScale.fitFunction = thisObject.fitFunction
+ thisObject.timeScale.payload = thisObject.payload.node.timeScale.payload
+
+ timeScaleMouseOverEventSuscriptionId = thisObject.timeScale.container.eventHandler.listenToEvent('onMouseOverScale', timeScaleMouseOver)
+ thisObject.timeScale.initialize(timeMachineCoordinateSystem, thisObject.container)
+
+ function timeScaleMouseOver(event) {
+ thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
+ }
+ }
+
+ function initializeRateScale() {
+ thisObject.rateScale = newRateScale()
+ thisObject.rateScale.fitFunction = thisObject.fitFunction
+ thisObject.rateScale.payload = thisObject.payload.node.rateScale.payload
+
+ rateScaleMouseOverEventSuscriptionId = thisObject.rateScale.container.eventHandler.listenToEvent('onMouseOverScale', rateScaleMouseOver)
+ thisObject.rateScale.initialize(timeMachineCoordinateSystem, thisObject.container, thisObject.container)
+
+ function rateScaleMouseOver(event) {
+ thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
+ }
+ }
+
+ function initializeTimeFrameScale() {
+ thisObject.timeFrameScale = newTimeFrameScale()
+ thisObject.timeFrameScale.fitFunction = thisObject.fitFunction
+ thisObject.timeFrameScale.payload = thisObject.payload.node.timeFrameScale.payload
+
+ timeFrameScaleEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('Time Frame Value Changed', timeFrameScaleValueChanged)
+ timeFrameScaleMouseOverEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('onMouseOverScale', timeFrameScaleMouseOver)
+ thisObject.timeFrameScale.initialize(thisObject.container)
+
+ function timeFrameScaleValueChanged(event) {
+ let currentTimeFrame = timeFrame
+ timeFrame = event.timeFrame
+ if (timeFrame !== currentTimeFrame) {
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelineChart = thisObject.timelineCharts[i]
+ timelineChart.upstreamTimeFrame = timeFrame
+ if (timelineChart.timeFrameScale === undefined) {
+ timelineChart.setTimeFrame(timeFrame)
+ }
+ }
}
- }
}
- }
- }
-
- container = thisObject.edgeEditor.getContainer(point, purpose)
- if (container !== undefined) {
- return container
- } else {
- if (thisObject.container.isForThisPurpose(purpose)) {
- if (thisObject.container.frame.isThisPointHere(point) === true) {
- return thisObject.container
+ function timeFrameScaleMouseOver(event) {
+ thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
}
- }
- }
- }
-
- function onScaleChanged () {
- recalculateCurrentDatetime()
- }
-
- function recalculateCurrentDatetime () {
- let center = {
- x: thisObject.container.frame.width / 2,
- y: thisObject.container.frame.height / 2
}
- datetime = new Date(getDateFromPointAtContainer(center, thisObject.container, timeMachineCoordinateSystem))
+ function getContainer(point, purpose) {
+ let container
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[i]
- timelineChart.setDatetime(datetime)
- }
- }
-
- function fitFunction (point, fullVisible, margin, topMargin, bottomMargin) {
- /* We prevent a point to be out of the container AND out of the Charting Space in general */
-
- let returnPoint = {
- x: point.x,
- y: point.y
- }
-
- let upCorner = {
- x: 0,
- y: 0
- }
-
- let bottonCorner = {
- x: thisObject.container.frame.width,
- y: thisObject.container.frame.height
- }
-
- upCorner = transformThisPoint(upCorner, thisObject.container)
- bottonCorner = transformThisPoint(bottonCorner, thisObject.container)
-
- /* Checking against the container limits. */
- if (margin === undefined) { margin = 0 }
- if (topMargin === undefined) { topMargin = 0 }
- if (bottomMargin === undefined) { bottomMargin = 0 }
-
- if (returnPoint.x - margin < upCorner.x) { returnPoint.x = upCorner.x + margin }
- if (returnPoint.x + margin > bottonCorner.x) { returnPoint.x = bottonCorner.x - margin }
- if (returnPoint.y - margin - topMargin < upCorner.y) { returnPoint.y = upCorner.y + margin + topMargin }
- if (returnPoint.y + margin + bottomMargin > bottonCorner.y) { returnPoint.y = bottonCorner.y - margin - bottomMargin }
-
- returnPoint = canvas.chartingSpace.fitFunction(returnPoint, fullVisible)
-
- return returnPoint
- }
-
- function physics () {
- thisObject.edgeEditor.physics()
- timeMachineCoordinateSystem.physics()
-
- saveFrame(thisObject.payload, thisObject.container.frame)
- if (thisObject.container.frame.isInViewPort()) {
- childrenPhysics()
- syncWithDesigner()
- }
- panelPhysics()
- onFocusPhysics()
- tabAnimationPhysics()
- }
-
- function tabAnimationPhysics () {
- const MAX_COUNTER_VALUE = 40
- const STEP = 10
-
- if (wasOnFocus === true && thisObject.onFocus === false) {
- tabAnimationStatus = 'Closing'
- }
- if (wasOnFocus === false && thisObject.onFocus === true) {
- tabAnimationStatus = 'Opening'
- }
-
- if (tabAnimationStatus === 'Closing') {
- tabAnimationCounter = tabAnimationCounter - STEP
- if (tabAnimationCounter <= 0) {
- tabAnimationCounter = 0
- tabAnimationStatus = 'Closed'
- }
- }
- if (tabAnimationStatus === 'Opening') {
- tabAnimationCounter = tabAnimationCounter + STEP
- if (tabAnimationCounter >= MAX_COUNTER_VALUE) {
- tabAnimationCounter = MAX_COUNTER_VALUE
- tabAnimationStatus = 'Open'
- }
- }
- }
-
- function onFocusPhysics () {
- wasOnFocus = thisObject.onFocus
- if (thisObject.edgeEditor.isMouseOver === true) {
- thisObject.onFocus = true
- } else {
- thisObject.onFocus = false
- }
- }
-
- function panelPhysics () {
- if (
- thisObject.container.frame.isInViewPort() &&
- canvas.chartingSpace.viewport.zoomLevel >= ZOOM_OUT_THRESHOLD_FOR_NOT_HIDDING_PANELS) {
- canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Layers Panel')
- canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Plotter Panel')
- return
- }
-
- if (
- thisObject.container.frame.isCenterInViewPort() &&
- canvas.chartingSpace.viewport.zoomLevel >= ZOOM_OUT_THRESHOLD_FOR_HIDDING_PANELS
- ) {
- canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Layers Panel')
- canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Plotter Panel')
- } else {
- canvas.panelsSpace.hide(thisObject.payload.node.id, 'Layers Panel')
- canvas.panelsSpace.hide(thisObject.payload.node.id, 'Plotter Panel')
- }
- }
-
- function syncWithDesigner () {
- syncWithDesignerTimelineCharts()
- syncWithDesignerScales()
- }
-
- function syncWithDesignerScales () {
- if (thisObject.payload.node === undefined) {
- finalizeTimeScale()
- finalizeRateScale()
- finalizeTimeFrameScale()
- return
- }
- if (thisObject.payload.node.timeScale === undefined && thisObject.timeScale !== undefined) {
- finalizeTimeScale()
- }
- if (thisObject.payload.node.timeScale !== undefined && thisObject.timeScale === undefined) {
- initializeTimeScale()
- }
- if (thisObject.payload.node.rateScale === undefined && thisObject.rateScale !== undefined) {
- finalizeRateScale()
- }
- if (thisObject.payload.node.rateScale !== undefined && thisObject.rateScale === undefined) {
- initializeRateScale()
- }
- if (thisObject.payload.node.timeFrameScale === undefined && thisObject.timeFrameScale !== undefined) {
- finalizeTimeFrameScale()
- }
- if (thisObject.payload.node.timeFrameScale !== undefined && thisObject.timeFrameScale === undefined) {
- initializeTimeFrameScale()
- }
- }
-
- function syncWithDesignerTimelineCharts () {
- syncWithDesignerLoop = syncWithDesignerLoop + 0.00000000001
-
- for (let j = 0; j < thisObject.payload.node.timelineCharts.length; j++) {
- let node = thisObject.payload.node.timelineCharts[j]
- let timelineChart = timelineChartsMap.get(node.id)
- if (timelineChart === undefined) {
- /* The timeline timelineChart node is new, thus we need to initialize a new timelineChart */
- initializeTimelineChart(node, syncWithDesignerLoop)
- } else {
- /* The time machine already exists, we tag it as existing at the current loop. */
- timelineChart.syncWithDesignerLoop = syncWithDesignerLoop
- }
- }
-
- /* We check all the timeMachines we have to see if we need to remove any of them */
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[i]
- if (timelineChart.syncWithDesignerLoop < syncWithDesignerLoop) {
- /* Must be removed */
- timelineChart.container.eventHandler.stopListening(timelineChart.onChildrenMouseOverEventSuscriptionId)
- timelineChart.finalize()
- timelineChartsMap.delete(timelineChart.nodeId)
- thisObject.timelineCharts.splice(i, 1)
- /* We remove one at the time */
- return
- }
- }
-
- function initializeTimelineChart (node, syncWithDesignerLoop) {
- let timelineChart = newTimelineChart()
- timelineChart.syncWithDesignerLoop = syncWithDesignerLoop
- timelineChart.payload = node.payload
- timelineChart.nodeId = node.id
- timelineChartsMap.set(node.id, timelineChart)
- timelineChart.payload.uiObject.setValue('Loading...')
-
- /* Setting up the new timeline timelineChart. */
- timelineChart.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
- timelineChart.container.fitFunction = thisObject.container.fitFunction
- timelineChart.fitFunction = thisObject.fitFunction
- timelineChart.container.frame.width = thisObject.container.frame.width
- timelineChart.container.frame.height = thisObject.container.frame.height
- timelineChart.container.frame.position.x = 0
- timelineChart.container.frame.position.y = 0
- timelineChart.initialize(timeMachineCoordinateSystem, timeFrame)
-
- /* we will store the event suscription id as a property of the timelineChart, to avoid keeping it an a separate array */
- timelineChart.onChildrenMouseOverEventSuscriptionId = timelineChart.container.eventHandler.listenToEvent('onChildrenMouseOver', onChildrenMouseOver)
-
- thisObject.timelineCharts.push(timelineChart)
- timelineChart.payload.uiObject.setValue('')
-
- function onChildrenMouseOver (event) {
- thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
- }
- }
- }
-
- function childrenPhysics () {
- if (thisObject.timeScale !== undefined) {
- thisObject.timeScale.physics()
- }
- if (thisObject.rateScale !== undefined) {
- thisObject.rateScale.physics()
- }
- if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.physics()
- }
-
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[i]
- timelineChart.physics()
- }
- }
-
- function drawBackground () {
- drawChartsBackground()
- if (thisObject.container.frame.isInViewPort()) {
- if (drawScales === true) {
- if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) { thisObject.timeScale.drawBackground() }
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawBackground() }
- }
-
- let maxElementsPlotted = 0
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[thisObject.timelineCharts.length - i - 1]
- let elementsPlotted = timelineChart.drawBackground()
- if (elementsPlotted !== undefined) {
- if (elementsPlotted > maxElementsPlotted) {
- maxElementsPlotted = elementsPlotted
- }
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) {
+ container = thisObject.rateScale.getContainer(point, purpose)
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose)) {
+ return container
+ } else {
+ if (purpose === GET_CONTAINER_PURPOSE.DRAGGING && container.isClickeable === true) {
+ return container
+ }
+ }
+ }
+ }
+
+ if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) {
+ container = thisObject.timeScale.getContainer(point, purpose)
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose)) {
+ return container
+ } else {
+ if (purpose === GET_CONTAINER_PURPOSE.DRAGGING && container.isClickeable === true) {
+ return container
+ }
+ }
+ }
+ }
+
+ if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) {
+ container = thisObject.timeFrameScale.getContainer(point, purpose)
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose)) {
+ return container
+ }
+ }
+ }
+
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ container = thisObject.timelineCharts[i].getContainer(point, purpose)
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose)) {
+ if (thisObject.container.frame.isThisPointHere(point) === true) {
+ return container
+ }
+ } else {
+ if (purpose === GET_CONTAINER_PURPOSE.DRAGGING && container.isClickeable === true) {
+ if (thisObject.container.frame.isThisPointHere(point) === true) {
+ return container
+ }
+ }
+ }
+ }
+ }
+
+ container = thisObject.edgeEditor.getContainer(point, purpose)
+ if (container !== undefined) {
+ return container
+ } else {
+ if (thisObject.container.isForThisPurpose(purpose)) {
+ if (thisObject.container.frame.isThisPointHere(point) === true) {
+ return thisObject.container
+ }
+ }
}
- }
- if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.adjustTimeFrame(maxElementsPlotted)
- }
}
- }
- function drawChartsBackground () {
- drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0.5, thisObject.fitFunction)
- }
+ function onScaleChanged() {
+ recalculateCurrentDatetime()
+ }
- function draw () {
- if (thisObject.payload === undefined) { return }
- if (thisObject.payload.node === undefined) { return }
- if (thisObject.container.frame.isInViewPort()) {
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[thisObject.timelineCharts.length - i - 1]
- timelineChart.draw()
- }
+ function recalculateCurrentDatetime() {
+ let center = {
+ x: thisObject.container.frame.width / 2,
+ y: thisObject.container.frame.height / 2
+ }
- if (drawScales === true) {
- if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) { thisObject.timeScale.draw() }
- if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.draw() }
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.draw() }
- }
- } else {
- if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_TIME_MACHINES_ICONIZED) {
+ datetime = new Date(getDateFromPointAtContainer(center, thisObject.container, timeMachineCoordinateSystem))
+
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelineChart = thisObject.timelineCharts[i]
+ timelineChart.setDatetime(datetime)
+ }
+ }
+
+ function fitFunction(point, fullVisible, margin, topMargin, bottomMargin) {
+ /* We prevent a point to be out of the container AND out of the Charting Space in general */
+
+ let returnPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ let upCorner = {
+ x: 0,
+ y: 0
+ }
+
+ let bottonCorner = {
+ x: thisObject.container.frame.width,
+ y: thisObject.container.frame.height
+ }
+
+ upCorner = transformThisPoint(upCorner, thisObject.container)
+ bottonCorner = transformThisPoint(bottonCorner, thisObject.container)
+
+ /* Checking against the container limits. */
+ if (margin === undefined) { margin = 0 }
+ if (topMargin === undefined) { topMargin = 0 }
+ if (bottomMargin === undefined) { bottomMargin = 0 }
+
+ if (returnPoint.x - margin < upCorner.x) { returnPoint.x = upCorner.x + margin }
+ if (returnPoint.x + margin > bottonCorner.x) { returnPoint.x = bottonCorner.x - margin }
+ if (returnPoint.y - margin - topMargin < upCorner.y) { returnPoint.y = upCorner.y + margin + topMargin }
+ if (returnPoint.y + margin + bottomMargin > bottonCorner.y) { returnPoint.y = bottonCorner.y - margin - bottomMargin }
+
+ returnPoint = canvas.chartingSpace.fitFunction(returnPoint, fullVisible)
+
+ return returnPoint
+ }
+
+ function physics() {
+ thisObject.edgeEditor.physics()
+ timeMachineCoordinateSystem.physics()
+
+ saveFrame(thisObject.payload, thisObject.container.frame)
+ if (thisObject.container.frame.isInViewPort()) {
+ childrenPhysics()
+ syncWithDesigner()
+ }
+ panelPhysics()
+ onFocusPhysics()
+ tabAnimationPhysics()
+ }
+
+ function tabAnimationPhysics() {
+ const MAX_COUNTER_VALUE = 40
+ const STEP = 10
+
+ if (wasOnFocus === true && thisObject.onFocus === false) {
+ tabAnimationStatus = 'Closing'
+ }
+ if (wasOnFocus === false && thisObject.onFocus === true) {
+ tabAnimationStatus = 'Opening'
+ }
+
+ if (tabAnimationStatus === 'Closing') {
+ tabAnimationCounter = tabAnimationCounter - STEP
+ if (tabAnimationCounter <= 0) {
+ tabAnimationCounter = 0
+ tabAnimationStatus = 'Closed'
+ }
+ }
+ if (tabAnimationStatus === 'Opening') {
+ tabAnimationCounter = tabAnimationCounter + STEP
+ if (tabAnimationCounter >= MAX_COUNTER_VALUE) {
+ tabAnimationCounter = MAX_COUNTER_VALUE
+ tabAnimationStatus = 'Open'
+ }
+ }
+ }
+
+ function onFocusPhysics() {
+ wasOnFocus = thisObject.onFocus
+ if (thisObject.edgeEditor.isMouseOver === true) {
+ thisObject.onFocus = true
+ } else {
+ thisObject.onFocus = false
+ }
+ }
+
+ function panelPhysics() {
+ if (
+ thisObject.container.frame.isInViewPort() &&
+ canvas.chartingSpace.viewport.zoomLevel >= ZOOM_OUT_THRESHOLD_FOR_NOT_HIDDING_PANELS) {
+ canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Layers Panel')
+ canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Plotter Panel')
+ return
+ }
+
+ if (
+ thisObject.container.frame.isCenterInViewPort() &&
+ canvas.chartingSpace.viewport.zoomLevel >= ZOOM_OUT_THRESHOLD_FOR_HIDDING_PANELS
+ ) {
+ canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Layers Panel')
+ canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Plotter Panel')
+ } else {
+ canvas.panelsSpace.hide(thisObject.payload.node.id, 'Layers Panel')
+ canvas.panelsSpace.hide(thisObject.payload.node.id, 'Plotter Panel')
+ }
+ }
+
+ function syncWithDesigner() {
+ syncWithDesignerTimelineCharts()
+ syncWithDesignerScales()
+ }
+
+ function syncWithDesignerScales() {
+ if (thisObject.payload.node === undefined) {
+ finalizeTimeScale()
+ finalizeRateScale()
+ finalizeTimeFrameScale()
+ return
+ }
+ if (thisObject.payload.node.timeScale === undefined && thisObject.timeScale !== undefined) {
+ finalizeTimeScale()
+ }
+ if (thisObject.payload.node.timeScale !== undefined && thisObject.timeScale === undefined) {
+ initializeTimeScale()
+ }
+ if (thisObject.payload.node.rateScale === undefined && thisObject.rateScale !== undefined) {
+ finalizeRateScale()
+ }
+ if (thisObject.payload.node.rateScale !== undefined && thisObject.rateScale === undefined) {
+ initializeRateScale()
+ }
+ if (thisObject.payload.node.timeFrameScale === undefined && thisObject.timeFrameScale !== undefined) {
+ finalizeTimeFrameScale()
+ }
+ if (thisObject.payload.node.timeFrameScale !== undefined && thisObject.timeFrameScale === undefined) {
+ initializeTimeFrameScale()
+ }
+ }
+
+ function syncWithDesignerTimelineCharts() {
+ syncWithDesignerLoop = syncWithDesignerLoop + 0.00000000001
+
+ for (let j = 0; j < thisObject.payload.node.timelineCharts.length; j++) {
+ let node = thisObject.payload.node.timelineCharts[j]
+ let timelineChart = timelineChartsMap.get(node.id)
+ if (timelineChart === undefined) {
+ /* The timeline timelineChart node is new, thus we need to initialize a new timelineChart */
+ initializeTimelineChart(node, syncWithDesignerLoop)
+ } else {
+ /* The time machine already exists, we tag it as existing at the current loop. */
+ timelineChart.syncWithDesignerLoop = syncWithDesignerLoop
+ }
+ }
+
+ /* We check all the timeMachines we have to see if we need to remove any of them */
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelineChart = thisObject.timelineCharts[i]
+ if (timelineChart.syncWithDesignerLoop < syncWithDesignerLoop) {
+ /* Must be removed */
+ timelineChart.container.eventHandler.stopListening(timelineChart.onChildrenMouseOverEventSuscriptionId)
+ timelineChart.finalize()
+ timelineChartsMap.delete(timelineChart.nodeId)
+ thisObject.timelineCharts.splice(i, 1)
+ /* We remove one at the time */
+ return
+ }
+ }
+
+ function initializeTimelineChart(node, syncWithDesignerLoop) {
+ let timelineChart = newTimelineChart()
+ timelineChart.syncWithDesignerLoop = syncWithDesignerLoop
+ timelineChart.payload = node.payload
+ timelineChart.nodeId = node.id
+ timelineChartsMap.set(node.id, timelineChart)
+ timelineChart.payload.uiObject.setValue('Loading...')
+
+ /* Setting up the new timeline timelineChart. */
+ timelineChart.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
+ timelineChart.container.fitFunction = thisObject.container.fitFunction
+ timelineChart.fitFunction = thisObject.fitFunction
+ timelineChart.container.frame.width = thisObject.container.frame.width
+ timelineChart.container.frame.height = thisObject.container.frame.height
+ timelineChart.container.frame.position.x = 0
+ timelineChart.container.frame.position.y = 0
+ timelineChart.initialize(timeMachineCoordinateSystem, timeFrame)
+
+ /* we will store the event suscription id as a property of the timelineChart, to avoid keeping it an a separate array */
+ timelineChart.onChildrenMouseOverEventSuscriptionId = timelineChart.container.eventHandler.listenToEvent('onChildrenMouseOver', onChildrenMouseOver)
+
+ thisObject.timelineCharts.push(timelineChart)
+ timelineChart.payload.uiObject.setValue('')
+
+ function onChildrenMouseOver(event) {
+ thisObject.container.eventHandler.raiseEvent('onMouseOver', event)
+ }
+ }
+ }
+
+ function childrenPhysics() {
+ if (thisObject.timeScale !== undefined) {
+ thisObject.timeScale.physics()
+ }
+ if (thisObject.rateScale !== undefined) {
+ thisObject.rateScale.physics()
+ }
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.physics()
+ }
+
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelineChart = thisObject.timelineCharts[i]
+ timelineChart.physics()
+ }
+ }
+
+ function drawBackground() {
+ drawChartsBackground()
+ if (thisObject.container.frame.isInViewPort()) {
+ if (drawScales === true) {
+ if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) { thisObject.timeScale.drawBackground() }
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawBackground() }
+ }
+
+ let maxElementsPlotted = 0
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelineChart = thisObject.timelineCharts[thisObject.timelineCharts.length - i - 1]
+ let elementsPlotted = timelineChart.drawBackground()
+ if (elementsPlotted !== undefined) {
+ if (elementsPlotted > maxElementsPlotted) {
+ maxElementsPlotted = elementsPlotted
+ }
+ }
+ }
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.adjustTimeFrame(maxElementsPlotted)
+ }
+ }
+ }
+
+ function drawChartsBackground() {
+ drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0.5, thisObject.fitFunction)
+ }
+
+ function draw() {
+ if (thisObject.payload === undefined) { return }
+ if (thisObject.payload.node === undefined) { return }
+ if (thisObject.container.frame.isInViewPort()) {
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelineChart = thisObject.timelineCharts[thisObject.timelineCharts.length - i - 1]
+ timelineChart.draw()
+ }
+
+ if (drawScales === true) {
+ if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) { thisObject.timeScale.draw() }
+ if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.draw() }
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.draw() }
+ }
+ } else {
+ if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_TIME_MACHINES_ICONIZED) {
+ let icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
+ if (icon !== undefined) {
+ if (icon.canDrawIcon === true) {
+ let imageSize = 40
+ let imagePosition = {
+ x: thisObject.container.frame.width / 2,
+ y: thisObject.container.frame.height / 2
+ }
+
+ imagePosition = transformThisPoint(imagePosition, thisObject.container)
+ imagePosition = thisObject.fitFunction(imagePosition, true)
+
+ browserCanvasContext.drawImage(
+ icon,
+ imagePosition.x - imageSize / 2,
+ imagePosition.y - imageSize / 2,
+ imageSize,
+ imageSize)
+ }
+ }
+ }
+ }
+ }
+
+ function drawForeground() {
+ if (thisObject.container.frame.isInViewPort()) {
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelineChart = thisObject.timelineCharts[thisObject.timelineCharts.length - i - 1]
+ timelineChart.drawForeground()
+ }
+
+ if (drawScales === true) {
+ if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) { thisObject.timeScale.drawForeground() }
+ if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.drawForeground() }
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawForeground() }
+ }
+
+ drawLabel()
+ thisObject.edgeEditor.drawForeground()
+ }
+ }
+
+ function drawLabel() {
+ if (thisObject.payload.node === undefined) { return }
+ if (thisObject.payload === undefined) { return }
+ /* Draw Title Above the Container */
+ let position = {
+ x: 0,
+ y: 0
+ }
+ let imageSize = 13
+ let fontSize = 15
+ let opacity = 1
let icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
+
+ position = transformThisPoint(position, thisObject.container)
+
+ let label = thisObject.payload.node.name
+ let description = loadPropertyFromNodeConfig(thisObject.payload, 'description')
+
+ if (description !== undefined) {
+ label = description
+ }
+ printLabel(label, position.x + 20, position.y - 10, opacity, fontSize)
+
if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- let imageSize = 40
- let imagePosition = {
- x: thisObject.container.frame.width / 2,
- y: thisObject.container.frame.height / 2
+ if (icon.canDrawIcon === true) {
+ browserCanvasContext.drawImage(
+ icon, position.x + 5,
+ position.y - 22,
+ imageSize,
+ imageSize)
+ }
+ }
+
+ imageSize = 13
+ fontSize = 15
+ let exchangeMarkets = new Map()
+
+ for (let i = 0; i < thisObject.timelineCharts.length; i++) {
+ let timelinechart = thisObject.timelineCharts[i]
+ if (timelinechart.layersManager !== undefined) {
+ for (let j = 0; j < timelinechart.layersManager.layers.length; j++) {
+ let layer = timelinechart.layersManager.layers[j]
+
+ exchangeMarket = {
+ exchangeName: layer.exchange.name,
+ marketName: layer.market,
+ exchangeIcon: layer.exchangeIcon,
+ baseAssetIcon: layer.baseAssetIcon,
+ quotedAssetIcon: layer.quotedAssetIcon
+ }
+ exchangeMarkets.set(exchangeMarket.exchangeName + '-' + exchangeMarket.marketName, exchangeMarket)
+ }
+ }
+ }
+
+ drawTab(0, 0, exchangeMarkets.size * tabAnimationCounter, 90, thisObject.container)
+
+ const INTER_EXCHANGE_SPACE = 60
+ const INTER_MARKET_SPACE = -100
+
+ if (tabAnimationStatus === 'Open') {
+ drawMarketNames()
+ }
+
+ function drawMarketNames() {
+ exchangeMarkets.forEach((exchangeMarket, i) => {
+ browserCanvasContext.save()
+ browserCanvasContext.translate(position.x, position.y)
+ browserCanvasContext.rotate(-Math.PI / 2)
+
+ let xOffSet = -80
+
+ icon = exchangeMarket.exchangeIcon
+
+ if (icon !== undefined) {
+ if (icon.canDrawIcon === true) {
+ browserCanvasContext.drawImage(
+ icon,
+ -20 + xOffSet,
+ -43,
+ imageSize,
+ imageSize)
+ }
+ }
+
+ printLabel(exchangeMarket.exchangeName, -5 + xOffSet, -30, opacity, fontSize, UI_COLOR.GREY)
+
+ position.x = position.x + INTER_EXCHANGE_SPACE
+
+ icon = exchangeMarket.baseAssetIcon
+ if (icon !== undefined) {
+ if (icon.canDrawIcon === true) {
+ browserCanvasContext.drawImage(
+ icon,
+ -20 + xOffSet,
+ -22,
+ imageSize,
+ imageSize)
+ }
+ }
+
+ printLabel(exchangeMarket.marketName, -5 + xOffSet, -10, opacity, fontSize, UI_COLOR.GREY)
+
+ icon = exchangeMarket.quotedAssetIcon
+ if (icon !== undefined) {
+ if (icon.canDrawIcon === true) {
+ browserCanvasContext.drawImage(
+ icon,
+ +50 + xOffSet,
+ -22,
+ imageSize,
+ imageSize)
+ }
+ }
+
+ position.x = position.x + INTER_MARKET_SPACE
+
+ browserCanvasContext.restore()
+ })
+ }
+
+ function drawTab(x, y, width, height, container) {
+ const GRADIENT = 0
+ const X_OFFSET = -3
+ const Y_OFFSET = 13
+ const TAB_CORNERS_RADIUS = 5
+
+ let point = {
+ x: x,
+ y: y
+ }
+ point = transformThisPoint(point, container)
+
+ let point1 = {
+ x: point.x + X_OFFSET,
+ y: point.y + Y_OFFSET
}
- imagePosition = transformThisPoint(imagePosition, thisObject.container)
- imagePosition = thisObject.fitFunction(imagePosition, true)
+ let point2 = {
+ x: point.x + X_OFFSET,
+ y: point.y + height + Y_OFFSET
+ }
- browserCanvasContext.drawImage(
- icon,
- imagePosition.x - imageSize / 2,
- imagePosition.y - imageSize / 2,
- imageSize,
- imageSize)
- }
+ let point3 = {
+ x: point.x - width + X_OFFSET,
+ y: point.y + height - GRADIENT + Y_OFFSET
+ }
+
+ let point4 = {
+ x: point.x - width + X_OFFSET,
+ y: point.y + GRADIENT + Y_OFFSET
+ }
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.arc(point3.x, point3.y - TAB_CORNERS_RADIUS, TAB_CORNERS_RADIUS, 0.5 * Math.PI, 1.0 * Math.PI)
+ // browserCanvasContext.lineTo(point4.x, point4.y)
+ browserCanvasContext.arc(point4.x, point4.y + TAB_CORNERS_RADIUS, TAB_CORNERS_RADIUS, 1.0 * Math.PI, 1.5 * Math.PI)
+ browserCanvasContext.closePath()
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ''
+ browserCanvasContext.stroke()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ''
+ browserCanvasContext.fill()
}
- }
- }
- }
-
- function drawForeground () {
- if (thisObject.container.frame.isInViewPort()) {
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelineChart = thisObject.timelineCharts[thisObject.timelineCharts.length - i - 1]
- timelineChart.drawForeground()
- }
-
- if (drawScales === true) {
- if (thisObject.timeScale !== undefined && thisObject.timeScale.isVisible === true) { thisObject.timeScale.drawForeground() }
- if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.drawForeground() }
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawForeground() }
- }
-
- drawLabel()
- thisObject.edgeEditor.drawForeground()
- }
- }
-
- function drawLabel () {
- if (thisObject.payload.node === undefined) { return }
- if (thisObject.payload === undefined) { return }
- /* Draw Title Above the Container */
- let position = {
- x: 0,
- y: 0
- }
- let imageSize = 13
- let fontSize = 15
- let opacity = 1
- let icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
-
- position = transformThisPoint(position, thisObject.container)
-
- let label = thisObject.payload.node.name
- let description = loadPropertyFromNodeConfig(thisObject.payload, 'description')
-
- if (description !== undefined) {
- label = description
- }
- printLabel(label, position.x + 20, position.y - 10, opacity, fontSize)
-
- if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- browserCanvasContext.drawImage(
- icon, position.x + 5,
- position.y - 22,
- imageSize,
- imageSize)
- }
}
- imageSize = 13
- fontSize = 15
- let exchangeMarkets = new Map()
-
- for (let i = 0; i < thisObject.timelineCharts.length; i++) {
- let timelinechart = thisObject.timelineCharts[i]
- if (timelinechart.layersManager !== undefined) {
- for (let j = 0; j < timelinechart.layersManager.layers.length; j++) {
- let layer = timelinechart.layersManager.layers[j]
-
- exchangeMarket = {
- exchangeName: layer.exchange.name,
- marketName: layer.market,
- exchangeIcon: layer.exchangeIcon,
- baseAssetIcon: layer.baseAssetIcon,
- quotedAssetIcon: layer.quotedAssetIcon
- }
- exchangeMarkets.set(exchangeMarket.exchangeName + '-' + exchangeMarket.marketName, exchangeMarket)
- }
- }
- }
-
- drawTab(0, 0, exchangeMarkets.size * tabAnimationCounter, 90, thisObject.container)
-
- const INTER_EXCHANGE_SPACE = 60
- const INTER_MARKET_SPACE = -100
-
- if (tabAnimationStatus === 'Open') {
- drawMarketNames()
- }
-
- function drawMarketNames () {
- exchangeMarkets.forEach((exchangeMarket, i) => {
- browserCanvasContext.save()
- browserCanvasContext.translate(position.x, position.y)
- browserCanvasContext.rotate(-Math.PI / 2)
-
- let xOffSet = -80
-
- icon = exchangeMarket.exchangeIcon
-
- if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- browserCanvasContext.drawImage(
- icon,
- -20 + xOffSet,
- -43,
- imageSize,
- imageSize)
- }
+ function recalculateCoordinateSystem() {
+ let minValue = {
+ x: MIN_PLOTABLE_DATE.valueOf(),
+ y: 0
}
- printLabel(exchangeMarket.exchangeName, -5 + xOffSet, -30, opacity, fontSize, UI_COLOR.GREY)
-
- position.x = position.x + INTER_EXCHANGE_SPACE
-
- icon = exchangeMarket.baseAssetIcon
- if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- browserCanvasContext.drawImage(
- icon,
- -20 + xOffSet,
- -22,
- imageSize,
- imageSize)
- }
+ let maxValue = {
+ x: MAX_PLOTABLE_DATE.valueOf(),
+ y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4
}
- printLabel(exchangeMarket.marketName, -5 + xOffSet, -10, opacity, fontSize, UI_COLOR.GREY)
-
- icon = exchangeMarket.quotedAssetIcon
- if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- browserCanvasContext.drawImage(
- icon,
- +50 + xOffSet,
- -22,
- imageSize,
- imageSize)
- }
- }
-
- position.x = position.x + INTER_MARKET_SPACE
-
- browserCanvasContext.restore()
- })
+ timeMachineCoordinateSystem.initialize(
+ minValue,
+ maxValue,
+ thisObject.container.frame.width,
+ thisObject.container.frame.height
+ )
}
-
- function drawTab (x, y, width, height, container) {
- const GRADIENT = 0
- const X_OFFSET = -3
- const Y_OFFSET = 13
- const TAB_CORNERS_RADIUS = 5
-
- let point = {
- x: x,
- y: y
- }
- point = transformThisPoint(point, container)
-
- let point1 = {
- x: point.x + X_OFFSET,
- y: point.y + Y_OFFSET
- }
-
- let point2 = {
- x: point.x + X_OFFSET,
- y: point.y + height + Y_OFFSET
- }
-
- let point3 = {
- x: point.x - width + X_OFFSET,
- y: point.y + height - GRADIENT + Y_OFFSET
- }
-
- let point4 = {
- x: point.x - width + X_OFFSET,
- y: point.y + GRADIENT + Y_OFFSET
- }
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.arc(point3.x, point3.y - TAB_CORNERS_RADIUS, TAB_CORNERS_RADIUS, 0.5 * Math.PI, 1.0 * Math.PI)
- // browserCanvasContext.lineTo(point4.x, point4.y)
- browserCanvasContext.arc(point4.x, point4.y + TAB_CORNERS_RADIUS, TAB_CORNERS_RADIUS, 1.0 * Math.PI, 1.5 * Math.PI)
- browserCanvasContext.closePath()
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ''
- browserCanvasContext.stroke()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ''
- browserCanvasContext.fill()
- }
- }
-
- function recalculateCoordinateSystem () {
- let minValue = {
- x: MIN_PLOTABLE_DATE.valueOf(),
- y: 0
- }
-
- let maxValue = {
- x: MAX_PLOTABLE_DATE.valueOf(),
- y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4
- }
-
- timeMachineCoordinateSystem.initialize(
- minValue,
- maxValue,
- thisObject.container.frame.width,
- thisObject.container.frame.height
- )
- }
}
diff --git a/CanvasApp/ChartingSpace/TimelineChart.js b/CanvasApp/ChartingSpace/TimelineChart.js
index d270d7b9f..fffa40ad0 100644
--- a/CanvasApp/ChartingSpace/TimelineChart.js
+++ b/CanvasApp/ChartingSpace/TimelineChart.js
@@ -1,424 +1,424 @@
-function newTimelineChart () {
- const MODULE_NAME = 'Timeline Chart'
- const INFO_LOG = false
- const INTENSIVE_LOG = false
- const ERROR_LOG = true
- let logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newTimelineChart() {
+ const MODULE_NAME = 'Timeline Chart'
+ const INFO_LOG = false
+ const INTENSIVE_LOG = false
+ const ERROR_LOG = true
+ let logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let timeFrame = INITIAL_TIME_PERIOD
- let datetime = NEW_SESSION_INITIAL_DATE
+ let timeFrame = INITIAL_TIME_PERIOD
+ let datetime = NEW_SESSION_INITIAL_DATE
- let thisObject = {
- container: undefined,
- fitFunction: undefined,
- rateScale: undefined,
- timeFrameScale: undefined,
- payload: undefined,
- layersManager: undefined,
- plotterManager: undefined,
- upstreamTimeFrame: undefined,
- setDatetime: setDatetime,
- setTimeFrame: setTimeFrame,
- physics: physics,
- draw: draw,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- let timeMachineCoordinateSystem
- let timelineChartCoordinateSystem = newCoordinateSystem()
- timelineChartCoordinateSystem.name = 'TIMELINE CHART'
-
- let coordinateSystem
-
- let layersPanel
- let layersPanelHandle
-
- let onMouseOverEventSuscriptionId
- let onMouseNotOverEventSuscriptionId
- let rateScaleUpstreamEventSuscriptionId
- let rateScaleMouseOverEventSuscriptionId
- let timeFrameScaleEventSuscriptionId
- let timeFrameScaleMouseOverEventSuscriptionId
- let scaleChangedEventSubscriptionId
-
- let drawScales = false
- let mouse = {
- position: {
- x: 0,
- y: 0
- }
- }
-
- setupContainer()
- return thisObject
-
- function setupContainer () {
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.detectMouseOver = true
- }
-
- function finalize () {
- timeMachineCoordinateSystem.eventHandler.stopListening(scaleChangedEventSubscriptionId)
-
- if (thisObject.layersManager !== undefined) {
- finalizeLayersManager()
+ let thisObject = {
+ container: undefined,
+ fitFunction: undefined,
+ rateScale: undefined,
+ timeFrameScale: undefined,
+ payload: undefined,
+ layersManager: undefined,
+ plotterManager: undefined,
+ upstreamTimeFrame: undefined,
+ setDatetime: setDatetime,
+ setTimeFrame: setTimeFrame,
+ physics: physics,
+ draw: draw,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- if (thisObject.rateScale !== undefined) {
- finalizeRateScale()
- }
+ let timeMachineCoordinateSystem
+ let timelineChartCoordinateSystem = newCoordinateSystem()
+ timelineChartCoordinateSystem.name = 'TIMELINE CHART'
- if (thisObject.timeFrameScale !== undefined) {
- finalizeTimeFrameScale()
- }
+ let coordinateSystem
- thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSuscriptionId)
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
+ let layersPanel
+ let layersPanelHandle
- mouse = undefined
- logger = undefined
+ let onMouseOverEventSuscriptionId
+ let onMouseNotOverEventSuscriptionId
+ let rateScaleUpstreamEventSuscriptionId
+ let rateScaleMouseOverEventSuscriptionId
+ let timeFrameScaleEventSuscriptionId
+ let timeFrameScaleMouseOverEventSuscriptionId
+ let scaleChangedEventSubscriptionId
- timeMachineCoordinateSystem = undefined
- timelineChartCoordinateSystem.finalize()
- timelineChartCoordinateSystem = undefined
- coordinateSystem = undefined
- layersPanel = undefined
- layersPanelHandle = undefined
- }
-
- function finalizeLayersManager () {
- if (thisObject.plotterManager !== undefined) {
- thisObject.plotterManager.finalize()
- }
- thisObject.plotterManager = undefined
- thisObject.layersManager = undefined
-
- canvas.panelsSpace.destroyPanel(layersPanelHandle)
- }
-
- function finalizeTimeFrameScale () {
- if (thisObject.timeFrameScale === undefined) { return }
-
- thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleEventSuscriptionId)
- thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleMouseOverEventSuscriptionId)
- thisObject.timeFrameScale.finalize()
- thisObject.timeFrameScale = undefined
- if (thisObject.upstreamTimeFrame !== undefined) {
- timeFrame = thisObject.upstreamTimeFrame
- if (thisObject.plotterManager !== undefined) {
- thisObject.plotterManager.setTimeFrame(timeFrame)
- }
- }
- }
-
- function finalizeRateScale () {
- if (thisObject.rateScale === undefined) { return }
-
- thisObject.rateScale.container.eventHandler.stopListening(rateScaleMouseOverEventSuscriptionId)
- thisObject.container.parentContainer.eventHandler.stopListening(rateScaleUpstreamEventSuscriptionId)
- thisObject.rateScale.finalize()
- thisObject.rateScale = undefined
-
- /* Resets the local container with the dimessions of its parent, the Time Machine */
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
- thisObject.container.frame.height = thisObject.container.parentContainer.frame.height
- thisObject.container.frame.width = thisObject.container.parentContainer.frame.width
- }
-
- function initialize (pTimeMachineCoordinateSystem, pTimeFrame) {
- /* We load the logow we will need for the background. */
-
- timeMachineCoordinateSystem = pTimeMachineCoordinateSystem
- coordinateSystem = timeMachineCoordinateSystem
- initializeCoordinateSystem()
-
- timeFrame = pTimeFrame
-
- onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- scaleChangedEventSubscriptionId = timeMachineCoordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
- }
-
- function initializeCoordinateSystem () {
- let minValue = {
- x: timeMachineCoordinateSystem.min.x,
- y: 0
- }
-
- let maxValue = {
- x: timeMachineCoordinateSystem.max.x,
- y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4
- }
-
- if (thisObject.rateScale !== undefined) {
- minValue.y = thisObject.rateScale.minValue
- maxValue.y = thisObject.rateScale.maxValue
- }
-
- timelineChartCoordinateSystem.initialize(
- minValue,
- maxValue,
- thisObject.container.frame.width,
- thisObject.container.frame.height
- )
- }
-
- function initializeLayersManager () {
- let owner = thisObject.payload.node.payload.parentNode.id // The real owner is the Time Machine
- layersPanelHandle = canvas.panelsSpace.createNewPanel('Layers Panel', undefined, owner)
- thisObject.layersManager = canvas.panelsSpace.getPanel(layersPanelHandle)
- thisObject.layersManager.payload = thisObject.payload.node.layersManager.payload
- thisObject.layersManager.initialize()
-
- /* Initialize the Plotter Manager */
- thisObject.plotterManager = newPlottersManager()
-
- thisObject.plotterManager.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
-
- thisObject.plotterManager.container.frame.position.x = 0
- thisObject.plotterManager.container.frame.position.y = 0
-
- thisObject.plotterManager.fitFunction = thisObject.fitFunction
- thisObject.plotterManager.payload = thisObject.payload
- thisObject.plotterManager.initialize(thisObject.layersManager)
- thisObject.plotterManager.setTimeFrame(timeFrame)
- thisObject.plotterManager.setDatetime(datetime)
- thisObject.plotterManager.setCoordinateSystem(coordinateSystem)
- }
-
- function initializeRateScale () {
- thisObject.rateScale = newRateScale()
- thisObject.rateScale.fitFunction = thisObject.fitFunction
- thisObject.rateScale.payload = thisObject.payload.node.rateScale.payload
-
- rateScaleMouseOverEventSuscriptionId = thisObject.rateScale.container.eventHandler.listenToEvent('onMouseOverScale', rateScaleMouseOver)
- thisObject.rateScale.initialize(timelineChartCoordinateSystem, thisObject.container.parentContainer, thisObject.container)
-
- function rateScaleMouseOver (event) {
- thisObject.container.eventHandler.raiseEvent('onChildrenMouseOver', event)
- }
- }
-
- function initializeTimeFrameScale () {
- thisObject.timeFrameScale = newTimeFrameScale()
- thisObject.timeFrameScale.fitFunction = thisObject.fitFunction
- thisObject.timeFrameScale.payload = thisObject.payload.node.timeFrameScale.payload
-
- timeFrameScaleEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('Time Frame Value Changed', timeFrameScaleValueChanged)
- timeFrameScaleMouseOverEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('onMouseOverScale', timeFrameScaleMouseOver)
- thisObject.timeFrameScale.initialize(thisObject.container.parentContainer)
-
- function timeFrameScaleValueChanged (event) {
- let currentTimeFrame = timeFrame
- timeFrame = event.timeFrame
- if (timeFrame !== currentTimeFrame) {
- if (thisObject.plotterManager !== undefined) {
- thisObject.plotterManager.setTimeFrame(timeFrame)
+ let drawScales = false
+ let mouse = {
+ position: {
+ x: 0,
+ y: 0
}
- }
}
- function timeFrameScaleMouseOver (event) {
- thisObject.container.eventHandler.raiseEvent('onChildrenMouseOver', event)
- }
- }
+ setupContainer()
+ return thisObject
- function onScaleChanged (event) {
- if (thisObject.rateScale !== undefined) {
- thisObject.rateScale.onUpstreamScaleChanged(event)
- }
- timelineChartCoordinateSystem.min.x = timeMachineCoordinateSystem.min.x
- timelineChartCoordinateSystem.max.x = timeMachineCoordinateSystem.max.x
- timelineChartCoordinateSystem.maxHeight = timeMachineCoordinateSystem.maxHeight
- timelineChartCoordinateSystem.maxWidth = timeMachineCoordinateSystem.maxWidth
- timelineChartCoordinateSystem.autoMinXScale = timeMachineCoordinateSystem.autoMinXScale
- timelineChartCoordinateSystem.autoMaxXScale = timeMachineCoordinateSystem.autoMaxXScale
- timelineChartCoordinateSystem.recalculateScale()
- }
-
- function setTimeFrame (pTimeFrame) {
- timeFrame = pTimeFrame
- if (thisObject.plotterManager !== undefined) {
- thisObject.plotterManager.setTimeFrame(timeFrame)
- }
- }
-
- function setDatetime (pDatetime) {
- datetime = pDatetime
- if (thisObject.plotterManager !== undefined) {
- thisObject.plotterManager.setDatetime(datetime)
- }
- }
-
- function onMouseOver (event) {
- /* This event gets to the timelinechart container because it inherits it from the time machine container, which is the one raising Mouse Over and Mouse not Over Events to its children. */
- drawScales = true
-
- if (thisObject.rateScale !== undefined) {
- thisObject.rateScale.onMouseOverSomeTimeMachineContainer(event)
+ function setupContainer() {
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.detectMouseOver = true
}
- if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.onMouseOverSomeTimeMachineContainer(event)
- }
+ function finalize() {
+ timeMachineCoordinateSystem.eventHandler.stopListening(scaleChangedEventSubscriptionId)
- mouse.position.x = event.x
- mouse.position.y = event.y
- }
-
- function onMouseNotOver (event) {
- /* This event is inherited from the Time Machine */
- drawScales = false
-
- if (thisObject.rateScale !== undefined) {
- thisObject.rateScale.visible = false
- }
- if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.visible = false
- }
- }
-
- function getContainer (point, purpose) {
- let container
-
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) {
- container = thisObject.rateScale.getContainer(point, purpose)
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose)) {
- return container
+ if (thisObject.layersManager !== undefined) {
+ finalizeLayersManager()
}
- }
- }
- if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) {
- container = thisObject.timeFrameScale.getContainer(point, purpose)
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose)) {
- return container
+ if (thisObject.rateScale !== undefined) {
+ finalizeRateScale()
}
- }
- }
- return container
- }
-
- function physics () {
- thisObjectPhysics()
- childrenPhysics()
- syncWithDesignerScales()
- syncWithDesignerLayersManager()
- }
-
- function thisObjectPhysics () {
- /* Only if the plotter manager has some layer turned on, we will pass the min and max upstream. */
- if (thisObject.plotterManager !== undefined && thisObject.plotterManager.connectors.length > 0) {
- timelineChartCoordinateSystem.reportParentXValue(timeMachineCoordinateSystem.min.x, timeMachineCoordinateSystem.max.x)
- timelineChartCoordinateSystem.physics()
-
- timeMachineCoordinateSystem.reportXValue(timelineChartCoordinateSystem.childrenMin.x)
- timeMachineCoordinateSystem.reportXValue(timelineChartCoordinateSystem.childrenMax.x)
- }
- }
-
- function syncWithDesignerLayersManager () {
- if (thisObject.payload.node === undefined) {
- finalizeLayersManager()
- return
- }
-
- if (thisObject.payload.node.layersManager === undefined && thisObject.layersManager !== undefined) {
- finalizeLayersManager()
- }
- if (thisObject.payload.node.layersManager !== undefined && thisObject.layersManager === undefined) {
- initializeLayersManager()
- }
- }
-
- function syncWithDesignerScales () {
- if (thisObject.payload.node === undefined) {
- finalizeRateScale()
- finalizeTimeFrameScale()
- return
- }
- if (thisObject.payload.node.rateScale === undefined && thisObject.rateScale !== undefined) {
- finalizeRateScale()
- coordinateSystem = timeMachineCoordinateSystem
- if (thisObject.plotterManager !== undefined) {
- thisObject.plotterManager.setCoordinateSystem(coordinateSystem)
- }
- }
- if (thisObject.payload.node.rateScale !== undefined && thisObject.rateScale === undefined) {
- initializeRateScale()
- coordinateSystem = timelineChartCoordinateSystem
- if (thisObject.plotterManager !== undefined) {
- thisObject.plotterManager.setCoordinateSystem(coordinateSystem)
- }
- }
- if (thisObject.payload.node.timeFrameScale === undefined && thisObject.timeFrameScale !== undefined) {
- finalizeTimeFrameScale()
- }
- if (thisObject.payload.node.timeFrameScale !== undefined && thisObject.timeFrameScale === undefined) {
- initializeTimeFrameScale()
- }
- }
-
- function childrenPhysics () {
- if (thisObject.rateScale !== undefined) {
- thisObject.rateScale.layersOn = thisObject.plotterManager.connectors.length
- thisObject.rateScale.physics()
- }
- if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.layersOn = thisObject.plotterManager.connectors.length
- thisObject.timeFrameScale.physics()
- }
- }
-
- function drawBackground () {
- if (thisObject.container.frame.isInViewPort()) {
- if (drawScales === true) {
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawBackground() }
- }
- drawChartsBackground()
- if (thisObject.plotterManager !== undefined) {
- let elementsPlotted = thisObject.plotterManager.draw()
if (thisObject.timeFrameScale !== undefined) {
- thisObject.timeFrameScale.adjustTimeFrame(elementsPlotted)
- } else {
- return elementsPlotted
+ finalizeTimeFrameScale()
}
- }
- }
- }
- function draw () {
- if (thisObject.container.frame.isInViewPort()) {
- if (drawScales === true) {
- if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.draw() }
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.draw() }
- }
- }
- }
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSuscriptionId)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
- function drawForeground () {
- if (thisObject.container.frame.isInViewPort()) {
- if (drawScales === true) {
- if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.drawForeground() }
- if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawForeground() }
- }
- }
- }
+ mouse = undefined
+ logger = undefined
- function drawChartsBackground () {
- drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0, thisObject.fitFunction)
- }
+ timeMachineCoordinateSystem = undefined
+ timelineChartCoordinateSystem.finalize()
+ timelineChartCoordinateSystem = undefined
+ coordinateSystem = undefined
+ layersPanel = undefined
+ layersPanelHandle = undefined
+ }
+
+ function finalizeLayersManager() {
+ if (thisObject.plotterManager !== undefined) {
+ thisObject.plotterManager.finalize()
+ }
+ thisObject.plotterManager = undefined
+ thisObject.layersManager = undefined
+
+ canvas.panelsSpace.destroyPanel(layersPanelHandle)
+ }
+
+ function finalizeTimeFrameScale() {
+ if (thisObject.timeFrameScale === undefined) { return }
+
+ thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleEventSuscriptionId)
+ thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleMouseOverEventSuscriptionId)
+ thisObject.timeFrameScale.finalize()
+ thisObject.timeFrameScale = undefined
+ if (thisObject.upstreamTimeFrame !== undefined) {
+ timeFrame = thisObject.upstreamTimeFrame
+ if (thisObject.plotterManager !== undefined) {
+ thisObject.plotterManager.setTimeFrame(timeFrame)
+ }
+ }
+ }
+
+ function finalizeRateScale() {
+ if (thisObject.rateScale === undefined) { return }
+
+ thisObject.rateScale.container.eventHandler.stopListening(rateScaleMouseOverEventSuscriptionId)
+ thisObject.container.parentContainer.eventHandler.stopListening(rateScaleUpstreamEventSuscriptionId)
+ thisObject.rateScale.finalize()
+ thisObject.rateScale = undefined
+
+ /* Resets the local container with the dimessions of its parent, the Time Machine */
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
+ thisObject.container.frame.height = thisObject.container.parentContainer.frame.height
+ thisObject.container.frame.width = thisObject.container.parentContainer.frame.width
+ }
+
+ function initialize(pTimeMachineCoordinateSystem, pTimeFrame) {
+ /* We load the logow we will need for the background. */
+
+ timeMachineCoordinateSystem = pTimeMachineCoordinateSystem
+ coordinateSystem = timeMachineCoordinateSystem
+ initializeCoordinateSystem()
+
+ timeFrame = pTimeFrame
+
+ onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ scaleChangedEventSubscriptionId = timeMachineCoordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
+ }
+
+ function initializeCoordinateSystem() {
+ let minValue = {
+ x: timeMachineCoordinateSystem.min.x,
+ y: 0
+ }
+
+ let maxValue = {
+ x: timeMachineCoordinateSystem.max.x,
+ y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4
+ }
+
+ if (thisObject.rateScale !== undefined) {
+ minValue.y = thisObject.rateScale.minValue
+ maxValue.y = thisObject.rateScale.maxValue
+ }
+
+ timelineChartCoordinateSystem.initialize(
+ minValue,
+ maxValue,
+ thisObject.container.frame.width,
+ thisObject.container.frame.height
+ )
+ }
+
+ function initializeLayersManager() {
+ let owner = thisObject.payload.node.payload.parentNode.id // The real owner is the Time Machine
+ layersPanelHandle = canvas.panelsSpace.createNewPanel('Layers Panel', undefined, owner)
+ thisObject.layersManager = canvas.panelsSpace.getPanel(layersPanelHandle)
+ thisObject.layersManager.payload = thisObject.payload.node.layersManager.payload
+ thisObject.layersManager.initialize()
+
+ /* Initialize the Plotter Manager */
+ thisObject.plotterManager = newPlottersManager()
+
+ thisObject.plotterManager.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
+
+ thisObject.plotterManager.container.frame.position.x = 0
+ thisObject.plotterManager.container.frame.position.y = 0
+
+ thisObject.plotterManager.fitFunction = thisObject.fitFunction
+ thisObject.plotterManager.payload = thisObject.payload
+ thisObject.plotterManager.initialize(thisObject.layersManager)
+ thisObject.plotterManager.setTimeFrame(timeFrame)
+ thisObject.plotterManager.setDatetime(datetime)
+ thisObject.plotterManager.setCoordinateSystem(coordinateSystem)
+ }
+
+ function initializeRateScale() {
+ thisObject.rateScale = newRateScale()
+ thisObject.rateScale.fitFunction = thisObject.fitFunction
+ thisObject.rateScale.payload = thisObject.payload.node.rateScale.payload
+
+ rateScaleMouseOverEventSuscriptionId = thisObject.rateScale.container.eventHandler.listenToEvent('onMouseOverScale', rateScaleMouseOver)
+ thisObject.rateScale.initialize(timelineChartCoordinateSystem, thisObject.container.parentContainer, thisObject.container)
+
+ function rateScaleMouseOver(event) {
+ thisObject.container.eventHandler.raiseEvent('onChildrenMouseOver', event)
+ }
+ }
+
+ function initializeTimeFrameScale() {
+ thisObject.timeFrameScale = newTimeFrameScale()
+ thisObject.timeFrameScale.fitFunction = thisObject.fitFunction
+ thisObject.timeFrameScale.payload = thisObject.payload.node.timeFrameScale.payload
+
+ timeFrameScaleEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('Time Frame Value Changed', timeFrameScaleValueChanged)
+ timeFrameScaleMouseOverEventSuscriptionId = thisObject.timeFrameScale.container.eventHandler.listenToEvent('onMouseOverScale', timeFrameScaleMouseOver)
+ thisObject.timeFrameScale.initialize(thisObject.container.parentContainer)
+
+ function timeFrameScaleValueChanged(event) {
+ let currentTimeFrame = timeFrame
+ timeFrame = event.timeFrame
+ if (timeFrame !== currentTimeFrame) {
+ if (thisObject.plotterManager !== undefined) {
+ thisObject.plotterManager.setTimeFrame(timeFrame)
+ }
+ }
+ }
+
+ function timeFrameScaleMouseOver(event) {
+ thisObject.container.eventHandler.raiseEvent('onChildrenMouseOver', event)
+ }
+ }
+
+ function onScaleChanged(event) {
+ if (thisObject.rateScale !== undefined) {
+ thisObject.rateScale.onUpstreamScaleChanged(event)
+ }
+ timelineChartCoordinateSystem.min.x = timeMachineCoordinateSystem.min.x
+ timelineChartCoordinateSystem.max.x = timeMachineCoordinateSystem.max.x
+ timelineChartCoordinateSystem.maxHeight = timeMachineCoordinateSystem.maxHeight
+ timelineChartCoordinateSystem.maxWidth = timeMachineCoordinateSystem.maxWidth
+ timelineChartCoordinateSystem.autoMinXScale = timeMachineCoordinateSystem.autoMinXScale
+ timelineChartCoordinateSystem.autoMaxXScale = timeMachineCoordinateSystem.autoMaxXScale
+ timelineChartCoordinateSystem.recalculateScale()
+ }
+
+ function setTimeFrame(pTimeFrame) {
+ timeFrame = pTimeFrame
+ if (thisObject.plotterManager !== undefined) {
+ thisObject.plotterManager.setTimeFrame(timeFrame)
+ }
+ }
+
+ function setDatetime(pDatetime) {
+ datetime = pDatetime
+ if (thisObject.plotterManager !== undefined) {
+ thisObject.plotterManager.setDatetime(datetime)
+ }
+ }
+
+ function onMouseOver(event) {
+ /* This event gets to the timelinechart container because it inherits it from the time machine container, which is the one raising Mouse Over and Mouse not Over Events to its children. */
+ drawScales = true
+
+ if (thisObject.rateScale !== undefined) {
+ thisObject.rateScale.onMouseOverSomeTimeMachineContainer(event)
+ }
+
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.onMouseOverSomeTimeMachineContainer(event)
+ }
+
+ mouse.position.x = event.x
+ mouse.position.y = event.y
+ }
+
+ function onMouseNotOver(event) {
+ /* This event is inherited from the Time Machine */
+ drawScales = false
+
+ if (thisObject.rateScale !== undefined) {
+ thisObject.rateScale.visible = false
+ }
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.visible = false
+ }
+ }
+
+ function getContainer(point, purpose) {
+ let container
+
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) {
+ container = thisObject.rateScale.getContainer(point, purpose)
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose)) {
+ return container
+ }
+ }
+ }
+
+ if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) {
+ container = thisObject.timeFrameScale.getContainer(point, purpose)
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose)) {
+ return container
+ }
+ }
+ }
+
+ return container
+ }
+
+ function physics() {
+ thisObjectPhysics()
+ childrenPhysics()
+ syncWithDesignerScales()
+ syncWithDesignerLayersManager()
+ }
+
+ function thisObjectPhysics() {
+ /* Only if the plotter manager has some layer turned on, we will pass the min and max upstream. */
+ if (thisObject.plotterManager !== undefined && thisObject.plotterManager.connectors.length > 0) {
+ timelineChartCoordinateSystem.reportParentXValue(timeMachineCoordinateSystem.min.x, timeMachineCoordinateSystem.max.x)
+ timelineChartCoordinateSystem.physics()
+
+ timeMachineCoordinateSystem.reportXValue(timelineChartCoordinateSystem.childrenMin.x)
+ timeMachineCoordinateSystem.reportXValue(timelineChartCoordinateSystem.childrenMax.x)
+ }
+ }
+
+ function syncWithDesignerLayersManager() {
+ if (thisObject.payload.node === undefined) {
+ finalizeLayersManager()
+ return
+ }
+
+ if (thisObject.payload.node.layersManager === undefined && thisObject.layersManager !== undefined) {
+ finalizeLayersManager()
+ }
+ if (thisObject.payload.node.layersManager !== undefined && thisObject.layersManager === undefined) {
+ initializeLayersManager()
+ }
+ }
+
+ function syncWithDesignerScales() {
+ if (thisObject.payload.node === undefined) {
+ finalizeRateScale()
+ finalizeTimeFrameScale()
+ return
+ }
+ if (thisObject.payload.node.rateScale === undefined && thisObject.rateScale !== undefined) {
+ finalizeRateScale()
+ coordinateSystem = timeMachineCoordinateSystem
+ if (thisObject.plotterManager !== undefined) {
+ thisObject.plotterManager.setCoordinateSystem(coordinateSystem)
+ }
+ }
+ if (thisObject.payload.node.rateScale !== undefined && thisObject.rateScale === undefined) {
+ initializeRateScale()
+ coordinateSystem = timelineChartCoordinateSystem
+ if (thisObject.plotterManager !== undefined) {
+ thisObject.plotterManager.setCoordinateSystem(coordinateSystem)
+ }
+ }
+ if (thisObject.payload.node.timeFrameScale === undefined && thisObject.timeFrameScale !== undefined) {
+ finalizeTimeFrameScale()
+ }
+ if (thisObject.payload.node.timeFrameScale !== undefined && thisObject.timeFrameScale === undefined) {
+ initializeTimeFrameScale()
+ }
+ }
+
+ function childrenPhysics() {
+ if (thisObject.rateScale !== undefined) {
+ thisObject.rateScale.layersOn = thisObject.plotterManager.connectors.length
+ thisObject.rateScale.physics()
+ }
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.layersOn = thisObject.plotterManager.connectors.length
+ thisObject.timeFrameScale.physics()
+ }
+ }
+
+ function drawBackground() {
+ if (thisObject.container.frame.isInViewPort()) {
+ if (drawScales === true) {
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawBackground() }
+ }
+ drawChartsBackground()
+ if (thisObject.plotterManager !== undefined) {
+ let elementsPlotted = thisObject.plotterManager.draw()
+ if (thisObject.timeFrameScale !== undefined) {
+ thisObject.timeFrameScale.adjustTimeFrame(elementsPlotted)
+ } else {
+ return elementsPlotted
+ }
+ }
+ }
+ }
+
+ function draw() {
+ if (thisObject.container.frame.isInViewPort()) {
+ if (drawScales === true) {
+ if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.draw() }
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.draw() }
+ }
+ }
+ }
+
+ function drawForeground() {
+ if (thisObject.container.frame.isInViewPort()) {
+ if (drawScales === true) {
+ if (thisObject.timeFrameScale !== undefined && thisObject.timeFrameScale.isVisible === true) { thisObject.timeFrameScale.drawForeground() }
+ if (thisObject.rateScale !== undefined && thisObject.rateScale.isVisible === true) { thisObject.rateScale.drawForeground() }
+ }
+ }
+ }
+
+ function drawChartsBackground() {
+ drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0, thisObject.fitFunction)
+ }
}
diff --git a/CanvasApp/ChartingSpace/Viewport.js b/CanvasApp/ChartingSpace/Viewport.js
index 5bd837de8..57d787c6d 100644
--- a/CanvasApp/ChartingSpace/Viewport.js
+++ b/CanvasApp/ChartingSpace/Viewport.js
@@ -1,421 +1,421 @@
-function newViewport () {
- const MODULE_NAME = 'Viewport'
+function newViewport() {
+ const MODULE_NAME = 'Viewport'
- const MIN_ZOOM_LEVEL = 0
- const MAX_ZOOM_LEVEL = 500
+ const MIN_ZOOM_LEVEL = 0
+ const MAX_ZOOM_LEVEL = 500
- let ANIMATION_INCREMENT = 0.25
- let ANIMATION_STEPS = 5
+ let ANIMATION_INCREMENT = 0.25
+ let ANIMATION_STEPS = 5
- let TOP_MARGIN = 40 + TOP_SPACE_HEIGHT
- let BOTTOM_MARGIN = 42 + COCKPIT_SPACE_HEIGHT
- let LEFT_MARGIN = 0
- let RIGHT_MARGIN = 0
- let MARGINS = {
- TOP: TOP_MARGIN,
- BOTTOM: BOTTOM_MARGIN,
- LEFT: LEFT_MARGIN,
- RIGHT: RIGHT_MARGIN
- }
+ let TOP_MARGIN = 40 + TOP_SPACE_HEIGHT
+ let BOTTOM_MARGIN = 42 + COCKPIT_SPACE_HEIGHT
+ let LEFT_MARGIN = 0
+ let RIGHT_MARGIN = 0
+ let MARGINS = {
+ TOP: TOP_MARGIN,
+ BOTTOM: BOTTOM_MARGIN,
+ LEFT: LEFT_MARGIN,
+ RIGHT: RIGHT_MARGIN
+ }
- let thisObject = {
- visible: false,
- visibleArea: undefined,
- width: undefined,
- height: undefined,
- eventHandler: undefined,
- zoomTargetLevel: undefined,
- zoomLevel: undefined,
- mousePosition: undefined,
- margins: MARGINS,
- payload: undefined,
- zoomAtCenter: zoomAtCenter,
- changeZoom: changeZoom,
- onMouseWheel: onMouseWheel,
- transformThisPoint: transformThisPoint,
- unTransformThisPoint: unTransformThisPoint,
- isThisPointVisible: isThisPointVisible,
- isThisPointInViewport: isThisPointInViewport,
- fitIntoVisibleArea: fitIntoVisibleArea,
- fitIntoViewport: fitIntoViewport,
- displace: displace,
- displaceToContainer: displaceToContainer,
- physics: physics,
- raiseEvents: raiseEvents,
- resize: resize,
- initialize: initialize,
- finalize: finalize
- }
- let increment = 0.035
- let position = {
- x: 0,
- y: 0
- }
+ let thisObject = {
+ visible: false,
+ visibleArea: undefined,
+ width: undefined,
+ height: undefined,
+ eventHandler: undefined,
+ zoomTargetLevel: undefined,
+ zoomLevel: undefined,
+ mousePosition: undefined,
+ margins: MARGINS,
+ payload: undefined,
+ zoomAtCenter: zoomAtCenter,
+ changeZoom: changeZoom,
+ onMouseWheel: onMouseWheel,
+ transformThisPoint: transformThisPoint,
+ unTransformThisPoint: unTransformThisPoint,
+ isThisPointVisible: isThisPointVisible,
+ isThisPointInViewport: isThisPointInViewport,
+ fitIntoVisibleArea: fitIntoVisibleArea,
+ fitIntoViewport: fitIntoViewport,
+ displace: displace,
+ displaceToContainer: displaceToContainer,
+ physics: physics,
+ raiseEvents: raiseEvents,
+ resize: resize,
+ initialize: initialize,
+ finalize: finalize
+ }
+ let increment = 0.035
+ let position = {
+ x: 0,
+ y: 0
+ }
- thisObject.mousePosition = {
- x: 0,
- y: 0
- }
- thisObject.eventHandler = newEventHandler()
+ thisObject.mousePosition = {
+ x: 0,
+ y: 0
+ }
+ thisObject.eventHandler = newEventHandler()
-/* Initial default value */
- thisObject.zoomLevel = MIN_ZOOM_LEVEL
- thisObject.zoomTargetLevel = Math.round(MIN_ZOOM_LEVEL)
- INITIAL_TIME_PERIOD = recalculatePeriod(thisObject.zoomLevel)
+ /* Initial default value */
+ thisObject.zoomLevel = MIN_ZOOM_LEVEL
+ thisObject.zoomTargetLevel = Math.round(MIN_ZOOM_LEVEL)
+ INITIAL_TIME_PERIOD = recalculatePeriod(thisObject.zoomLevel)
- let overrideMousePositionCounter = 0
+ let overrideMousePositionCounter = 0
- return thisObject
+ return thisObject
- function finalize () {
- thisObject.eventHandler.finalize()
- thisObject.payload = undefined
- thisObject = undefined
- }
+ function finalize() {
+ thisObject.eventHandler.finalize()
+ thisObject.payload = undefined
+ thisObject = undefined
+ }
- function initialize () {
- if (thisObject.payload !== undefined) {
- /* Read the position from the frame structure */
+ function initialize() {
+ if (thisObject.payload !== undefined) {
+ /* Read the position from the frame structure */
- let frame = {
- position: {
- x: 0,
- y: 0
+ let frame = {
+ position: {
+ x: 0,
+ y: 0
+ }
+ }
+ loadFrame(thisObject.payload, frame)
+ if (!isNaN(frame.position.x)) {
+ position.x = frame.position.x
+ }
+ if (!isNaN(frame.position.y)) {
+ position.y = frame.position.y
+ }
}
- }
- loadFrame(thisObject.payload, frame)
- if (!isNaN(frame.position.x)) {
- position.x = frame.position.x
- }
- if (!isNaN(frame.position.y)) {
- position.y = frame.position.y
- }
+
+ resize()
+ readObjectState()
}
- resize()
- readObjectState()
- }
+ function resize() {
+ TOP_MARGIN = 40 + TOP_SPACE_HEIGHT
+ BOTTOM_MARGIN = 42 + browserCanvas.height - COCKPIT_SPACE_POSITION
+ LEFT_MARGIN = 0
+ RIGHT_MARGIN = 0
+ MARGINS = {
+ TOP: TOP_MARGIN,
+ BOTTOM: BOTTOM_MARGIN,
+ LEFT: LEFT_MARGIN,
+ RIGHT: RIGHT_MARGIN
+ }
- function resize () {
- TOP_MARGIN = 40 + TOP_SPACE_HEIGHT
- BOTTOM_MARGIN = 42 + browserCanvas.height - COCKPIT_SPACE_POSITION
- LEFT_MARGIN = 0
- RIGHT_MARGIN = 0
- MARGINS = {
- TOP: TOP_MARGIN,
- BOTTOM: BOTTOM_MARGIN,
- LEFT: LEFT_MARGIN,
- RIGHT: RIGHT_MARGIN
+ thisObject.visibleArea = {
+ topLeft: { x: LEFT_MARGIN, y: TOP_MARGIN },
+ topRight: { x: browserCanvas.width - RIGHT_MARGIN, y: TOP_MARGIN },
+ bottomRight: { x: browserCanvas.width - RIGHT_MARGIN, y: browserCanvas.height - BOTTOM_MARGIN },
+ bottomLeft: { x: LEFT_MARGIN, y: browserCanvas.height - BOTTOM_MARGIN }
+ }
+
+ thisObject.width = thisObject.visibleArea.topRight.x - thisObject.visibleArea.topLeft.x
+ thisObject.height = thisObject.visibleArea.bottomRight.y - thisObject.visibleArea.topLeft.y
+
+ thisObject.center = {
+ x: LEFT_MARGIN + thisObject.width / 2,
+ y: TOP_MARGIN + thisObject.height / 2
+ }
}
- thisObject.visibleArea = {
- topLeft: { x: LEFT_MARGIN, y: TOP_MARGIN },
- topRight: { x: browserCanvas.width - RIGHT_MARGIN, y: TOP_MARGIN },
- bottomRight: { x: browserCanvas.width - RIGHT_MARGIN, y: browserCanvas.height - BOTTOM_MARGIN},
- bottomLeft: { x: LEFT_MARGIN, y: browserCanvas.height - BOTTOM_MARGIN}
+ function raiseEvents() {
+ if (thisObject.visible === false) { return }
+ let event = {
+ newPosition: position
+ }
+
+ thisObject.eventHandler.raiseEvent('Position Changed', event)
}
- thisObject.width = thisObject.visibleArea.topRight.x - thisObject.visibleArea.topLeft.x
- thisObject.height = thisObject.visibleArea.bottomRight.y - thisObject.visibleArea.topLeft.y
-
- thisObject.center = {
- x: LEFT_MARGIN + thisObject.width / 2,
- y: TOP_MARGIN + thisObject.height / 2
- }
- }
-
- function raiseEvents () {
- if (thisObject.visible === false) { return }
- let event = {
- newPosition: position
+ function displaceToContainer(container) {
+ let targetPoint = {
+ x: -container.frame.position.x - container.frame.width / 2,
+ y: -container.frame.position.y - container.frame.height / 2
+ }
+ position.x = targetPoint.x + browserCanvas.width / 2
+ position.y = targetPoint.y + (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
}
- thisObject.eventHandler.raiseEvent('Position Changed', event)
- }
-
- function displaceToContainer (container) {
- let targetPoint = {
- x: -container.frame.position.x - container.frame.width / 2,
- y: -container.frame.position.y - container.frame.height / 2
- }
- position.x = targetPoint.x + browserCanvas.width / 2
- position.y = targetPoint.y + (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
- }
-
- function zoomAtCenter (level) {
- thisObject.zoomTargetLevel = Math.round(level)
- overrideMousePositionCounter = 50
- ANIMATION_INCREMENT = 0.5
- }
-
- function mousePositionPhysics () {
- if (overrideMousePositionCounter > 0) {
- thisObject.mousePosition.x = browserCanvas.width / 2
- thisObject.mousePosition.y = (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
-
- overrideMousePositionCounter--
- if (overrideMousePositionCounter < 0) {
- overrideMousePositionCounter = 0
- }
- }
- }
-
- function physics () {
- if (thisObject.visible === false) { return }
- mousePositionPhysics()
- animationPhysics()
- positioningPhysics()
- readObjectState()
- }
-
- function positioningPhysics () {
- if (thisObject.visible === false) { return }
- if (thisObject.payload === undefined) { return }
- /* Save the position at the frame lavel */
- let frame = {}
- frame.position = position
- saveFrame(thisObject.payload, frame)
- }
-
- function animationPhysics () {
- if (thisObject.zoomLevel < thisObject.zoomTargetLevel) {
- if (thisObject.zoomTargetLevel - thisObject.zoomLevel < ANIMATION_INCREMENT) {
- ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) * 100) / 100
- }
- thisObject.zoomLevel = Math.round((thisObject.zoomLevel + ANIMATION_INCREMENT) * 100) / 100
- changeZoom(thisObject.zoomLevel - ANIMATION_INCREMENT, thisObject.zoomLevel)
+ function zoomAtCenter(level) {
+ thisObject.zoomTargetLevel = Math.round(level)
+ overrideMousePositionCounter = 50
+ ANIMATION_INCREMENT = 0.5
}
- if (thisObject.zoomLevel > thisObject.zoomTargetLevel) {
- if (thisObject.zoomLevel - thisObject.zoomTargetLevel < ANIMATION_INCREMENT) {
- ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) * 100) / 100
- }
- thisObject.zoomLevel = Math.round((thisObject.zoomLevel - ANIMATION_INCREMENT) * 100) / 100
- changeZoom(thisObject.zoomLevel + ANIMATION_INCREMENT, thisObject.zoomLevel)
- }
- }
+ function mousePositionPhysics() {
+ if (overrideMousePositionCounter > 0) {
+ thisObject.mousePosition.x = browserCanvas.width / 2
+ thisObject.mousePosition.y = (COCKPIT_SPACE_POSITION - TOP_SPACE_HEIGHT) / 2 + TOP_SPACE_HEIGHT
- function onMouseWheel (event) {
- if (thisObject.visible === false) { return }
- if ((event.ctrlKey === true || event.metaKey === true)) { return }
- let morePower = 1
-
- if (IS_MAC) {
- event.delta = event.delta * MAC_AMOUNT_FACTOR
+ overrideMousePositionCounter--
+ if (overrideMousePositionCounter < 0) {
+ overrideMousePositionCounter = 0
+ }
+ }
}
- let amount = event.delta
-
- if (event.buttons === 4) { morePower = 2 } // Mouse wheel pressed.
- /* We adjust the sensitivity for Mac Users */
-
- if (thisObject.zoomTargetLevel > 10) {
- amount = amount * 2
- }
- if (thisObject.zoomTargetLevel > 25) {
- amount = amount * 3
- }
- if (thisObject.zoomTargetLevel > 50) {
- amount = amount * 3.5
+ function physics() {
+ if (thisObject.visible === false) { return }
+ mousePositionPhysics()
+ animationPhysics()
+ positioningPhysics()
+ readObjectState()
}
- if (thisObject.zoomTargetLevel + amount * morePower > MAX_ZOOM_LEVEL) {
- return false
- }
- if (thisObject.zoomTargetLevel + amount * morePower < MIN_ZOOM_LEVEL) {
- return false
- }
- thisObject.zoomTargetLevel = Math.round(thisObject.zoomTargetLevel + amount * morePower)
-
- ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) / ANIMATION_STEPS * 100) / 100
-
- let newEvent = {
- newLevel: thisObject.zoomTargetLevel,
- newPosition: position,
- type: undefined,
- shiftKey: event.shiftKey
+ function positioningPhysics() {
+ if (thisObject.visible === false) { return }
+ if (thisObject.payload === undefined) { return }
+ /* Save the position at the frame lavel */
+ let frame = {}
+ frame.position = position
+ saveFrame(thisObject.payload, frame)
}
- if (amount > 0) {
- newEvent.type = 'Zoom In'
- } else {
- newEvent.type = 'Zoom Out'
+ function animationPhysics() {
+ if (thisObject.zoomLevel < thisObject.zoomTargetLevel) {
+ if (thisObject.zoomTargetLevel - thisObject.zoomLevel < ANIMATION_INCREMENT) {
+ ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) * 100) / 100
+ }
+ thisObject.zoomLevel = Math.round((thisObject.zoomLevel + ANIMATION_INCREMENT) * 100) / 100
+ changeZoom(thisObject.zoomLevel - ANIMATION_INCREMENT, thisObject.zoomLevel)
+ }
+
+ if (thisObject.zoomLevel > thisObject.zoomTargetLevel) {
+ if (thisObject.zoomLevel - thisObject.zoomTargetLevel < ANIMATION_INCREMENT) {
+ ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) * 100) / 100
+ }
+ thisObject.zoomLevel = Math.round((thisObject.zoomLevel - ANIMATION_INCREMENT) * 100) / 100
+ changeZoom(thisObject.zoomLevel + ANIMATION_INCREMENT, thisObject.zoomLevel)
+ }
}
- thisObject.eventHandler.raiseEvent('Zoom Changed', newEvent)
- return true
- }
+ function onMouseWheel(event) {
+ if (thisObject.visible === false) { return }
+ if ((event.ctrlKey === true || event.metaKey === true)) { return }
+ let morePower = 1
- function fitIntoVisibleArea (point) {
- let pointCopy = {
- x: point.x,
- y: point.y
+ if (IS_MAC) {
+ event.delta = event.delta * MAC_AMOUNT_FACTOR
+ }
+
+ let amount = event.delta
+
+ if (event.buttons === 4) { morePower = 2 } // Mouse wheel pressed.
+ /* We adjust the sensitivity for Mac Users */
+
+ if (thisObject.zoomTargetLevel > 10) {
+ amount = amount * 2
+ }
+ if (thisObject.zoomTargetLevel > 25) {
+ amount = amount * 3
+ }
+ if (thisObject.zoomTargetLevel > 50) {
+ amount = amount * 3.5
+ }
+
+ if (thisObject.zoomTargetLevel + amount * morePower > MAX_ZOOM_LEVEL) {
+ return false
+ }
+ if (thisObject.zoomTargetLevel + amount * morePower < MIN_ZOOM_LEVEL) {
+ return false
+ }
+ thisObject.zoomTargetLevel = Math.round(thisObject.zoomTargetLevel + amount * morePower)
+
+ ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) / ANIMATION_STEPS * 100) / 100
+
+ let newEvent = {
+ newLevel: thisObject.zoomTargetLevel,
+ newPosition: position,
+ type: undefined,
+ shiftKey: event.shiftKey
+ }
+
+ if (amount > 0) {
+ newEvent.type = 'Zoom In'
+ } else {
+ newEvent.type = 'Zoom Out'
+ }
+
+ thisObject.eventHandler.raiseEvent('Zoom Changed', newEvent)
+ return true
}
- /* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */
- if (pointCopy.x > thisObject.visibleArea.bottomRight.x + 1) {
- pointCopy.x = thisObject.visibleArea.bottomRight.x + 1
+ function fitIntoVisibleArea(point) {
+ let pointCopy = {
+ x: point.x,
+ y: point.y
+ }
+
+ /* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */
+ if (pointCopy.x > thisObject.visibleArea.bottomRight.x + 1) {
+ pointCopy.x = thisObject.visibleArea.bottomRight.x + 1
+ }
+
+ if (pointCopy.x < thisObject.visibleArea.topLeft.x - 1) {
+ pointCopy.x = thisObject.visibleArea.topLeft.x - 1
+ }
+
+ if (pointCopy.y > thisObject.visibleArea.bottomRight.y + 1) {
+ pointCopy.y = thisObject.visibleArea.bottomRight.y + 1
+ }
+
+ if (pointCopy.y < thisObject.visibleArea.topLeft.y - 1) {
+ pointCopy.y = thisObject.visibleArea.topLeft.y - 1
+ }
+
+ return pointCopy
}
- if (pointCopy.x < thisObject.visibleArea.topLeft.x - 1) {
- pointCopy.x = thisObject.visibleArea.topLeft.x - 1
+ function fitIntoViewport(point) {
+ let pointCopy = {
+ x: point.x,
+ y: point.y
+ }
+ if (pointCopy.y > COCKPIT_SPACE_POSITION) {
+ pointCopy.y = COCKPIT_SPACE_POSITION
+ }
+ return pointCopy
}
- if (pointCopy.y > thisObject.visibleArea.bottomRight.y + 1) {
- pointCopy.y = thisObject.visibleArea.bottomRight.y + 1
- }
+ function displace(displaceVector, recalculate) {
+ if (thisObject.visible === false) { return }
+ position.x = position.x + displaceVector.x
+ position.y = position.y + displaceVector.y
- if (pointCopy.y < thisObject.visibleArea.topLeft.y - 1) {
- pointCopy.y = thisObject.visibleArea.topLeft.y - 1
- }
-
- return pointCopy
- }
-
- function fitIntoViewport (point) {
- let pointCopy = {
- x: point.x,
- y: point.y
- }
- if (pointCopy.y > COCKPIT_SPACE_POSITION) {
- pointCopy.y = COCKPIT_SPACE_POSITION
- }
- return pointCopy
- }
-
- function displace (displaceVector, recalculate) {
- if (thisObject.visible === false) { return }
- position.x = position.x + displaceVector.x
- position.y = position.y + displaceVector.y
-
- saveObjectState()
-
- let event = {
- newPosition: position,
- recalculate: recalculate
- }
-
- thisObject.eventHandler.raiseEvent('Position Changed', event)
- }
-
- function changeZoom (oldLevel, newLevel) {
- if (thisObject.visible === false) { return }
- let oldMouse = unTransformThisPoint(thisObject.mousePosition, oldLevel)
- let newMouse = transformThisPoint(oldMouse, newLevel)
-
- position.x = position.x - newMouse.x + thisObject.mousePosition.x
- position.y = position.y - newMouse.y + thisObject.mousePosition.y
-
- saveObjectState()
-
- thisObject.eventHandler.raiseEvent('Zoom Changed')
- }
-
- function transformThisPoint (point, level) {
- if (thisObject.visible === false) { return }
- let transformedPoint = {
- x: 0,
- y: 0
- }
-
- if (level === undefined) {
- transformedPoint.x = point.x * (1 + thisObject.zoomLevel) + position.x
- transformedPoint.y = point.y * (1 + thisObject.zoomLevel) + position.y
- } else {
- transformedPoint.x = point.x * (1 + level) + position.x
- transformedPoint.y = point.y * (1 + level) + position.y
- }
-
- return transformedPoint
- }
-
- function unTransformThisPoint (point, level) {
- let pointWithoutZoom = {
- x: 0,
- y: 0
- }
- if (level === undefined) {
- pointWithoutZoom.x = (point.x - position.x) / (1 + thisObject.zoomLevel)
- pointWithoutZoom.y = (point.y - position.y) / (1 + thisObject.zoomLevel)
- } else {
- pointWithoutZoom.x = (point.x - position.x) / (1 + level)
- pointWithoutZoom.y = (point.y - position.y) / (1 + level)
- }
-
- return pointWithoutZoom
- }
-
- 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 {
- return true
- }
- }
-
- function isThisPointInViewport (point) {
- if (thisObject.visible === false) { return }
- if (point.y > COCKPIT_SPACE_POSITION) {
- return false
- } else {
- return true
- }
- }
-
- function saveObjectState () {
- if (thisObject.payload === undefined) { return }
-
- /* Save the zoom at the node config, so that the user can change it if he wishes to. */
- try {
- let config = JSON.parse(thisObject.payload.node.config)
- config.zoom = (thisObject.zoomTargetLevel - MIN_ZOOM_LEVEL) / (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL) * 100
- config.zoom = config.zoom.toFixed(2)
- thisObject.payload.node.config = JSON.stringify(config)
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
- }
-
- function readObjectState () {
- if (thisObject.payload === undefined) { return }
-
- /* Read the zoom level from the node config */
- try {
- let config = JSON.parse(thisObject.payload.node.config)
-
- if (isNaN(config.zoom) || config.zoom === null || config.zoom === undefined) {
saveObjectState()
- return
- }
- config.zoom = config.zoom / 100 * (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL) + MIN_ZOOM_LEVEL
- if (config.zoom < MIN_ZOOM_LEVEL) { config.zoom = MIN_ZOOM_LEVEL }
- if (config.zoom > MAX_ZOOM_LEVEL) { config.zoom = MAX_ZOOM_LEVEL }
- if (config.zoom.toFixed(2) !== thisObject.zoomTargetLevel.toFixed(2)) {
- newZoomLevel(config.zoom)
- } else {
+ let event = {
+ newPosition: position,
+ recalculate: recalculate
+ }
+
+ thisObject.eventHandler.raiseEvent('Position Changed', event)
+ }
+
+ function changeZoom(oldLevel, newLevel) {
+ if (thisObject.visible === false) { return }
+ let oldMouse = unTransformThisPoint(thisObject.mousePosition, oldLevel)
+ let newMouse = transformThisPoint(oldMouse, newLevel)
+
+ position.x = position.x - newMouse.x + thisObject.mousePosition.x
+ position.y = position.y - newMouse.y + thisObject.mousePosition.y
+
saveObjectState()
- }
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
+
+ thisObject.eventHandler.raiseEvent('Zoom Changed')
}
- function newZoomLevel (level) {
- thisObject.zoomLevel = Math.round(level)
- thisObject.zoomTargetLevel = Math.round(level)
- INITIAL_TIME_PERIOD = recalculatePeriod(level)
- saveObjectState()
- ANIMATION_INCREMENT = 0
+ function transformThisPoint(point, level) {
+ if (thisObject.visible === false) { return }
+ let transformedPoint = {
+ x: 0,
+ y: 0
+ }
- let event = {
- newLevel: thisObject.zoomTargetLevel,
- newPosition: position,
- type: undefined
- }
- thisObject.eventHandler.raiseEvent('Zoom Changed', event)
- return true
+ if (level === undefined) {
+ transformedPoint.x = point.x * (1 + thisObject.zoomLevel) + position.x
+ transformedPoint.y = point.y * (1 + thisObject.zoomLevel) + position.y
+ } else {
+ transformedPoint.x = point.x * (1 + level) + position.x
+ transformedPoint.y = point.y * (1 + level) + position.y
+ }
+
+ return transformedPoint
+ }
+
+ function unTransformThisPoint(point, level) {
+ let pointWithoutZoom = {
+ x: 0,
+ y: 0
+ }
+ if (level === undefined) {
+ pointWithoutZoom.x = (point.x - position.x) / (1 + thisObject.zoomLevel)
+ pointWithoutZoom.y = (point.y - position.y) / (1 + thisObject.zoomLevel)
+ } else {
+ pointWithoutZoom.x = (point.x - position.x) / (1 + level)
+ pointWithoutZoom.y = (point.y - position.y) / (1 + level)
+ }
+
+ return pointWithoutZoom
+ }
+
+ 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 {
+ return true
+ }
+ }
+
+ function isThisPointInViewport(point) {
+ if (thisObject.visible === false) { return }
+ if (point.y > COCKPIT_SPACE_POSITION) {
+ return false
+ } else {
+ return true
+ }
+ }
+
+ function saveObjectState() {
+ if (thisObject.payload === undefined) { return }
+
+ /* Save the zoom at the node config, so that the user can change it if he wishes to. */
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+ config.zoom = (thisObject.zoomTargetLevel - MIN_ZOOM_LEVEL) / (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL) * 100
+ config.zoom = config.zoom.toFixed(2)
+ thisObject.payload.node.config = JSON.stringify(config)
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
+ }
+
+ function readObjectState() {
+ if (thisObject.payload === undefined) { return }
+
+ /* Read the zoom level from the node config */
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+
+ if (isNaN(config.zoom) || config.zoom === null || config.zoom === undefined) {
+ saveObjectState()
+ return
+ }
+ config.zoom = config.zoom / 100 * (MAX_ZOOM_LEVEL - MIN_ZOOM_LEVEL) + MIN_ZOOM_LEVEL
+ if (config.zoom < MIN_ZOOM_LEVEL) { config.zoom = MIN_ZOOM_LEVEL }
+ if (config.zoom > MAX_ZOOM_LEVEL) { config.zoom = MAX_ZOOM_LEVEL }
+
+ if (config.zoom.toFixed(2) !== thisObject.zoomTargetLevel.toFixed(2)) {
+ newZoomLevel(config.zoom)
+ } else {
+ saveObjectState()
+ }
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
+
+ function newZoomLevel(level) {
+ thisObject.zoomLevel = Math.round(level)
+ thisObject.zoomTargetLevel = Math.round(level)
+ INITIAL_TIME_PERIOD = recalculatePeriod(level)
+ saveObjectState()
+ ANIMATION_INCREMENT = 0
+
+ let event = {
+ newLevel: thisObject.zoomTargetLevel,
+ newPosition: position,
+ type: undefined
+ }
+ thisObject.eventHandler.raiseEvent('Zoom Changed', event)
+ return true
+ }
}
- }
}
diff --git a/CanvasApp/CockpitSpace/AssetBalances.js b/CanvasApp/CockpitSpace/AssetBalances.js
index 166a68880..afcb65668 100644
--- a/CanvasApp/CockpitSpace/AssetBalances.js
+++ b/CanvasApp/CockpitSpace/AssetBalances.js
@@ -1,123 +1,123 @@
-function newAssetalances () {
- const MODULE_NAME = 'Asset Balances'
+function newAssetalances() {
+ const MODULE_NAME = 'Asset Balances'
- let thisObject = {
- visible: true,
- container: undefined,
- paramsArray: undefined,
- setParamsArray: setParamsArray,
- physics: physics,
- draw: draw,
- speedometers: [],
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
-
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = false
-
- return thisObject
-
- function finalize () {
- for (let i = 0; i < thisObject.speedometers.length; i++) {
- let speedometer = thisObject.speedometers[i]
- speedometer.finalize()
+ let thisObject = {
+ visible: true,
+ container: undefined,
+ paramsArray: undefined,
+ setParamsArray: setParamsArray,
+ physics: physics,
+ draw: draw,
+ speedometers: [],
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.paramsArray = undefined
- }
- function initialize () {
- for (let i = 0; i < 2; i++) {
- let speedometer = newSpeedometer()
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
- speedometer.initialize()
- speedometer.container.connectToParent(thisObject.container)
- speedometer.container.frame.position.x = thisObject.container.frame.width / 2
- speedometer.container.frame.position.y = thisObject.container.frame.height * (2 + i * 2) / 5
- thisObject.speedometers.push(speedometer)
- }
- }
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = false
- function getContainer (point, purpose) {
- if (thisObject.visible !== true) { return }
+ return thisObject
- let container
- for (let i = 0; i < thisObject.speedometers.length; i++) {
- container = thisObject.speedometers[i].getContainer(point, purpose)
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose)) {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return container
- }
+ function finalize() {
+ for (let i = 0; i < thisObject.speedometers.length; i++) {
+ let speedometer = thisObject.speedometers[i]
+ speedometer.finalize()
}
- }
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.paramsArray = undefined
}
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
+ function initialize() {
+ for (let i = 0; i < 2; i++) {
+ let speedometer = newSpeedometer()
- function setParamsArray (paramsArray) {
- thisObject.paramsArray = paramsArray
- for (let i = 0; i < thisObject.speedometers.length; i++) {
- let speedometer = thisObject.speedometers[i]
- speedometer.params = paramsArray[i]
- }
- }
-
- function physics () {
-
- }
-
- function draw () {
- if (thisObject.visible !== true) { return }
-
- for (let i = 0; i < thisObject.speedometers.length; i++) {
- let speedometer = thisObject.speedometers[i]
- speedometer.draw()
+ speedometer.initialize()
+ speedometer.container.connectToParent(thisObject.container)
+ speedometer.container.frame.position.x = thisObject.container.frame.width / 2
+ speedometer.container.frame.position.y = thisObject.container.frame.height * (2 + i * 2) / 5
+ thisObject.speedometers.push(speedometer)
+ }
}
- drawQuotedAssetalances()
- }
+ function getContainer(point, purpose) {
+ if (thisObject.visible !== true) { return }
- function drawQuotedAssetalances () {
- if (thisObject.paramsArray === undefined) { return }
+ let container
+ for (let i = 0; i < thisObject.speedometers.length; i++) {
+ container = thisObject.speedometers[i].getContainer(point, purpose)
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose)) {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return container
+ }
+ }
+ }
+ }
- let fontSize
- let label
- let xOffset
- let yOffset
-
- const OPACITY = 1
-
- /* We put the params.VALUE in the middle */
-
- fontSize = 15
-
- browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
-
- label = 'ASSET BALANCES'
-
- xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO
- yOffset = -45 + 9
-
- labelPoint = {
- x: 0 - xOffset + (thisObject.paramsArray[1].LEFT_OFFSET - thisObject.paramsArray[0].LEFT_OFFSET) / 2 + thisObject.paramsArray[0].LEFT_OFFSET - 20,
- y: COCKPIT_SPACE_POSITION - COCKPIT_SPACE_HEIGHT / 2 - yOffset
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
}
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
+ function setParamsArray(paramsArray) {
+ thisObject.paramsArray = paramsArray
+ for (let i = 0; i < thisObject.speedometers.length; i++) {
+ let speedometer = thisObject.speedometers[i]
+ speedometer.params = paramsArray[i]
+ }
+ }
+
+ function physics() {
+
+ }
+
+ function draw() {
+ if (thisObject.visible !== true) { return }
+
+ for (let i = 0; i < thisObject.speedometers.length; i++) {
+ let speedometer = thisObject.speedometers[i]
+ speedometer.draw()
+ }
+
+ drawQuotedAssetalances()
+ }
+
+ function drawQuotedAssetalances() {
+ if (thisObject.paramsArray === undefined) { return }
+
+ let fontSize
+ let label
+ let xOffset
+ let yOffset
+
+ const OPACITY = 1
+
+ /* We put the params.VALUE in the middle */
+
+ fontSize = 15
+
+ browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
+
+ label = 'ASSET BALANCES'
+
+ xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO
+ yOffset = -45 + 9
+
+ labelPoint = {
+ x: 0 - xOffset + (thisObject.paramsArray[1].LEFT_OFFSET - thisObject.paramsArray[0].LEFT_OFFSET) / 2 + thisObject.paramsArray[0].LEFT_OFFSET - 20,
+ y: COCKPIT_SPACE_POSITION - COCKPIT_SPACE_HEIGHT / 2 - yOffset
+ }
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
}
diff --git a/CanvasApp/CockpitSpace/FullScreen.js b/CanvasApp/CockpitSpace/FullScreen.js
index 9fb2717d9..4f0c8e5c8 100644
--- a/CanvasApp/CockpitSpace/FullScreen.js
+++ b/CanvasApp/CockpitSpace/FullScreen.js
@@ -1,169 +1,169 @@
-function newFullScreen () {
- const MODULE_NAME = 'Fullscreen'
+function newFullScreen() {
+ const MODULE_NAME = 'Fullscreen'
- let thisObject = {
- visible: true,
- container: undefined,
- status: undefined,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
-
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = false
- thisObject.container.isClickeable = true
- thisObject.container.detectMouseOver = true
-
- let selfMouseOverEventSubscriptionId
- let selfMouseClickEventSubscriptionId
- let selfMouseNotOverEventSubscriptionId
-
- let isMouseOver = false
- let counterTillNextState = 0
-
- let layersToTurnOn = []
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(selfMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfMouseNotOverEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- }
-
- function initialize () {
- thisObject.container.frame.width = 50
- thisObject.container.frame.height = COCKPIT_SPACE_HEIGHT - 12
-
- selfMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
- selfMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
-
- thisObject.status = 'Ready'
- }
-
- function getContainer (point, purpose) {
- if (thisObject.visible !== true) { return }
-
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
-
- function onMouseOver (point) {
- if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
- isMouseOver = true
- } else {
- isMouseOver = false
- }
- }
-
- function onMouseNotOver (point) {
- isMouseOver = false
- }
-
- function onMouseClick (event) {
- if (thisObject.status !== 'On') {
- thisObject.status = 'On'
- goFullscreen()
- CURRENT_TOP_MARGIN = 0
- AT_FULL_SCREEN_MODE = true
- } else {
- thisObject.status = 'Off'
- goOutFullscreen()
- CURRENT_TOP_MARGIN = TOP_MARGIN
- AT_FULL_SCREEN_MODE = false
- }
- }
-
- function goFullscreen () {
- if (browserCanvas.requestFullscreen) {
- browserCanvas.requestFullscreen()
- } else if (browserCanvas.mozRequestFullScreen) {
- browserCanvas.mozRequestFullScreen()
- } else if (browserCanvas.webkitRequestFullscreen) {
- browserCanvas.webkitRequestFullscreen()
- } else if (browserCanvas.msRequestFullscreen) { browserCanvas.msRequestFullscreen() }
- }
-
- function goOutFullscreen () {
- if (document.exitFullscreen) {
- document.exitFullscreen()
- } else if (document.mozCancelFullScreen) {
- document.mozCancelFullScreen()
- } else if (document.webkitExitFullscreen) {
- document.webkitExitFullscreen()
- } else if (document.msExitFullscreen) { document.msExitFullscreen() }
- }
-
- function physics () {
- positionPhysics()
- }
-
- function positionPhysics () {
- thisObject.container.frame.position.x = thisObject.container.parentContainer.frame.width - thisObject.container.frame.width
- thisObject.container.frame.position.y = 6
- }
-
- function draw () {
- if (thisObject.visible !== true) { return }
- drawBackground()
- drawText()
- }
-
- function drawBackground () {
- let params = {
- cornerRadius: 3,
- lineWidth: 0.01,
- container: thisObject.container,
- borderColor: UI_COLOR.DARK,
- castShadow: false,
- opacity: 1
+ let thisObject = {
+ visible: true,
+ container: undefined,
+ status: undefined,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- if (isMouseOver === true) {
- params.backgroundColor = UI_COLOR.TURQUOISE
- } else {
- params.backgroundColor = UI_COLOR.DARK_TURQUOISE
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = false
+ thisObject.container.isClickeable = true
+ thisObject.container.detectMouseOver = true
+
+ let selfMouseOverEventSubscriptionId
+ let selfMouseClickEventSubscriptionId
+ let selfMouseNotOverEventSubscriptionId
+
+ let isMouseOver = false
+ let counterTillNextState = 0
+
+ let layersToTurnOn = []
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(selfMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfMouseNotOverEventSubscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
}
- roundedCornersBackground(params)
- }
+ function initialize() {
+ thisObject.container.frame.width = 50
+ thisObject.container.frame.height = COCKPIT_SPACE_HEIGHT - 12
- function drawText () {
- let fontSize
- let label
- let xOffset
- let yOffset
+ selfMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ selfMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- const OPACITY = 1
-
- /* We put the params.VALUE in the middle */
-
- fontSize = 15
-
- browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
- label = 'FS'
-
- let labelPoint = {
- x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize * FONT_ASPECT_RATIO,
- y: thisObject.container.frame.height - 9
+ thisObject.status = 'Ready'
}
- labelPoint = thisObject.container.frame.frameThisPoint(labelPoint)
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
+ function getContainer(point, purpose) {
+ if (thisObject.visible !== true) { return }
+
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
+
+ function onMouseOver(point) {
+ if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
+ isMouseOver = true
+ } else {
+ isMouseOver = false
+ }
+ }
+
+ function onMouseNotOver(point) {
+ isMouseOver = false
+ }
+
+ function onMouseClick(event) {
+ if (thisObject.status !== 'On') {
+ thisObject.status = 'On'
+ goFullscreen()
+ CURRENT_TOP_MARGIN = 0
+ AT_FULL_SCREEN_MODE = true
+ } else {
+ thisObject.status = 'Off'
+ goOutFullscreen()
+ CURRENT_TOP_MARGIN = TOP_MARGIN
+ AT_FULL_SCREEN_MODE = false
+ }
+ }
+
+ function goFullscreen() {
+ if (browserCanvas.requestFullscreen) {
+ browserCanvas.requestFullscreen()
+ } else if (browserCanvas.mozRequestFullScreen) {
+ browserCanvas.mozRequestFullScreen()
+ } else if (browserCanvas.webkitRequestFullscreen) {
+ browserCanvas.webkitRequestFullscreen()
+ } else if (browserCanvas.msRequestFullscreen) { browserCanvas.msRequestFullscreen() }
+ }
+
+ function goOutFullscreen() {
+ if (document.exitFullscreen) {
+ document.exitFullscreen()
+ } else if (document.mozCancelFullScreen) {
+ document.mozCancelFullScreen()
+ } else if (document.webkitExitFullscreen) {
+ document.webkitExitFullscreen()
+ } else if (document.msExitFullscreen) { document.msExitFullscreen() }
+ }
+
+ function physics() {
+ positionPhysics()
+ }
+
+ function positionPhysics() {
+ thisObject.container.frame.position.x = thisObject.container.parentContainer.frame.width - thisObject.container.frame.width
+ thisObject.container.frame.position.y = 6
+ }
+
+ function draw() {
+ if (thisObject.visible !== true) { return }
+ drawBackground()
+ drawText()
+ }
+
+ function drawBackground() {
+ let params = {
+ cornerRadius: 3,
+ lineWidth: 0.01,
+ container: thisObject.container,
+ borderColor: UI_COLOR.DARK,
+ castShadow: false,
+ opacity: 1
+ }
+
+ if (isMouseOver === true) {
+ params.backgroundColor = UI_COLOR.TURQUOISE
+ } else {
+ params.backgroundColor = UI_COLOR.DARK_TURQUOISE
+ }
+
+ roundedCornersBackground(params)
+ }
+
+ function drawText() {
+ let fontSize
+ let label
+ let xOffset
+ let yOffset
+
+ const OPACITY = 1
+
+ /* We put the params.VALUE in the middle */
+
+ fontSize = 15
+
+ browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
+ label = 'FS'
+
+ let labelPoint = {
+ x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize * FONT_ASPECT_RATIO,
+ y: thisObject.container.frame.height - 9
+ }
+ labelPoint = thisObject.container.frame.frameThisPoint(labelPoint)
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
}
diff --git a/CanvasApp/CockpitSpace/Speedometer.js b/CanvasApp/CockpitSpace/Speedometer.js
index b2e26df1f..7d64af030 100644
--- a/CanvasApp/CockpitSpace/Speedometer.js
+++ b/CanvasApp/CockpitSpace/Speedometer.js
@@ -1,265 +1,265 @@
-function newSpeedometer () {
- const MODULE_NAME = 'Speedometer'
+function newSpeedometer() {
+ const MODULE_NAME = 'Speedometer'
- let thisObject = {
- visible: true,
- container: undefined,
- params: undefined,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
-
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = false
-
- return thisObject
-
- function finalize () {
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.params = undefined
- }
-
- function initialize () {
-
- }
-
- function getContainer (point, purpose) {
- if (thisObject.visible !== true) { return }
-
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
-
- function physics () {
-
- }
-
- function draw () {
- if (thisObject.params === undefined) { return }
- drawAssetCircle()
- }
-
- function drawAssetCircle () {
- const RED_LINE_HIGHT = 2
- const RADIUS = 50
- const OPACITY = 1
-
- let centerPoint = {
- x: 0,
- y: 0
+ let thisObject = {
+ visible: true,
+ container: undefined,
+ params: undefined,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- centerPoint = thisObject.container.frame.frameThisPoint(centerPoint)
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, RADIUS + RED_LINE_HIGHT, 0 * Math.PI, 2.0 * Math.PI)
- browserCanvasContext.closePath()
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = false
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + OPACITY + ')'
- browserCanvasContext.fill()
+ return thisObject
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, RADIUS, 0.0 * Math.PI, 2.0 * Math.PI)
- browserCanvasContext.closePath()
+ function finalize() {
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.params = undefined
+ }
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
- browserCanvasContext.fill()
+ function initialize() {
- /* We draw the circle bar */
+ }
- const DEFAULT_THICKNESS = 2
- const VALUE_THICKNESS = 8
- const VALUE_BG_THICKNESS = 1
- const BAR_RADIUS = RADIUS * 0.85
+ function getContainer(point, purpose) {
+ if (thisObject.visible !== true) { return }
- let BAR_START_ANGLE = 0.85 * Math.PI
- let BAR_END_ANGLE = 2.15 * Math.PI
- let CURRENT_VALUE_ANGLE = thisObject.params.VALUE * (BAR_END_ANGLE - BAR_START_ANGLE) / thisObject.params.MAX_VALUE + BAR_START_ANGLE
- let MIN_VALUE_ANGLE = thisObject.params.MIN_VALUE * (BAR_END_ANGLE - BAR_START_ANGLE) / thisObject.params.MAX_VALUE + BAR_START_ANGLE
- let INIT_VALUE_ANGLE = thisObject.params.INIT_VALUE * (BAR_END_ANGLE - BAR_START_ANGLE) / thisObject.params.MAX_VALUE + BAR_START_ANGLE
- let PROFIT_VALUE_ANGLE = CURRENT_VALUE_ANGLE
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
- if (CURRENT_VALUE_ANGLE > INIT_VALUE_ANGLE) { CURRENT_VALUE_ANGLE = INIT_VALUE_ANGLE }
- if (CURRENT_VALUE_ANGLE < MIN_VALUE_ANGLE) { CURRENT_VALUE_ANGLE = MIN_VALUE_ANGLE }
- if (PROFIT_VALUE_ANGLE > BAR_END_ANGLE) { PROFIT_VALUE_ANGLE = BAR_END_ANGLE }
+ function physics() {
- if (
- thisObject.params.VALUE > 0 &&
- thisObject.params.ASSET_NAME === thisObject.params.BASE_ASSET &&
- thisObject.params.POSITION_TAKEN === false
- ) {
- browserCanvasContext.setLineDash([0, 0])
+ }
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, BAR_START_ANGLE, MIN_VALUE_ANGLE)
+ function draw() {
+ if (thisObject.params === undefined) { return }
+ drawAssetCircle()
+ }
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
- browserCanvasContext.stroke()
- browserCanvasContext.closePath()
+ function drawAssetCircle() {
+ const RED_LINE_HIGHT = 2
+ const RADIUS = 50
+ const OPACITY = 1
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, MIN_VALUE_ANGLE, CURRENT_VALUE_ANGLE)
+ let centerPoint = {
+ x: 0,
+ y: 0
+ }
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
- browserCanvasContext.stroke()
- browserCanvasContext.closePath()
+ centerPoint = thisObject.container.frame.frameThisPoint(centerPoint)
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, CURRENT_VALUE_ANGLE, INIT_VALUE_ANGLE)
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RED + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
- browserCanvasContext.stroke()
- browserCanvasContext.closePath()
-
- if (PROFIT_VALUE_ANGLE > INIT_VALUE_ANGLE) {
browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, INIT_VALUE_ANGLE, PROFIT_VALUE_ANGLE)
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREEN + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
- browserCanvasContext.stroke()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, RADIUS + RED_LINE_HIGHT, 0 * Math.PI, 2.0 * Math.PI)
browserCanvasContext.closePath()
- }
- browserCanvasContext.setLineDash([2, 3])
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + OPACITY + ')'
+ browserCanvasContext.fill()
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, BAR_START_ANGLE, MIN_VALUE_ANGLE)
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_THICKNESS
- browserCanvasContext.stroke()
- browserCanvasContext.closePath()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, MIN_VALUE_ANGLE, CURRENT_VALUE_ANGLE)
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_THICKNESS
- browserCanvasContext.stroke()
- browserCanvasContext.closePath()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, CURRENT_VALUE_ANGLE, INIT_VALUE_ANGLE)
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RED + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_THICKNESS
- browserCanvasContext.stroke()
- browserCanvasContext.closePath()
-
- if (PROFIT_VALUE_ANGLE > INIT_VALUE_ANGLE) {
browserCanvasContext.beginPath()
- browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, INIT_VALUE_ANGLE, PROFIT_VALUE_ANGLE)
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREEN + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = VALUE_THICKNESS
- browserCanvasContext.stroke()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, RADIUS, 0.0 * Math.PI, 2.0 * Math.PI)
browserCanvasContext.closePath()
- }
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
+ browserCanvasContext.fill()
+
+ /* We draw the circle bar */
+
+ const DEFAULT_THICKNESS = 2
+ const VALUE_THICKNESS = 8
+ const VALUE_BG_THICKNESS = 1
+ const BAR_RADIUS = RADIUS * 0.85
+
+ let BAR_START_ANGLE = 0.85 * Math.PI
+ let BAR_END_ANGLE = 2.15 * Math.PI
+ let CURRENT_VALUE_ANGLE = thisObject.params.VALUE * (BAR_END_ANGLE - BAR_START_ANGLE) / thisObject.params.MAX_VALUE + BAR_START_ANGLE
+ let MIN_VALUE_ANGLE = thisObject.params.MIN_VALUE * (BAR_END_ANGLE - BAR_START_ANGLE) / thisObject.params.MAX_VALUE + BAR_START_ANGLE
+ let INIT_VALUE_ANGLE = thisObject.params.INIT_VALUE * (BAR_END_ANGLE - BAR_START_ANGLE) / thisObject.params.MAX_VALUE + BAR_START_ANGLE
+ let PROFIT_VALUE_ANGLE = CURRENT_VALUE_ANGLE
+
+ if (CURRENT_VALUE_ANGLE > INIT_VALUE_ANGLE) { CURRENT_VALUE_ANGLE = INIT_VALUE_ANGLE }
+ if (CURRENT_VALUE_ANGLE < MIN_VALUE_ANGLE) { CURRENT_VALUE_ANGLE = MIN_VALUE_ANGLE }
+ if (PROFIT_VALUE_ANGLE > BAR_END_ANGLE) { PROFIT_VALUE_ANGLE = BAR_END_ANGLE }
+
+ if (
+ thisObject.params.VALUE > 0 &&
+ thisObject.params.ASSET_NAME === thisObject.params.BASE_ASSET &&
+ thisObject.params.POSITION_TAKEN === false
+ ) {
+ browserCanvasContext.setLineDash([0, 0])
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, BAR_START_ANGLE, MIN_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, MIN_VALUE_ANGLE, CURRENT_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, CURRENT_VALUE_ANGLE, INIT_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RED + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+
+ if (PROFIT_VALUE_ANGLE > INIT_VALUE_ANGLE) {
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, INIT_VALUE_ANGLE, PROFIT_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREEN + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_BG_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+ }
+
+ browserCanvasContext.setLineDash([2, 3])
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, BAR_START_ANGLE, MIN_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, MIN_VALUE_ANGLE, CURRENT_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, CURRENT_VALUE_ANGLE, INIT_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RED + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+
+ if (PROFIT_VALUE_ANGLE > INIT_VALUE_ANGLE) {
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(centerPoint.x, centerPoint.y, BAR_RADIUS, INIT_VALUE_ANGLE, PROFIT_VALUE_ANGLE)
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREEN + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = VALUE_THICKNESS
+ browserCanvasContext.stroke()
+ browserCanvasContext.closePath()
+ }
+ }
+
+ /* Common Variables */
+
+ let fontSize
+ let label
+ let xOffset
+ let yOffset
+
+ /* We put the thisObject.params.VALUE in the middle */
+
+ label = thisObject.params.VALUE
+
+ if (isNaN(label) === false) {
+ label = Number(label)
+
+ label = dynamicDecimals(label, 2)
+ if (label === 0) { label = label.toFixed(2) }
+ }
+
+ fontSize = 22
+ if (label.length > 8) {
+ fontSize = 18
+ }
+ if (label.length > 10) {
+ fontSize = 14
+ }
+ if (label.length > 12) {
+ fontSize = 10
+ }
+ if (label.length > 14) {
+ fontSize = 8
+ }
+
+ browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
+
+ // label = label.substring(0, 6)
+
+ xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO + 7
+
+ labelPoint = {
+ x: centerPoint.x - xOffset,
+ y: centerPoint.y
+ }
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+
+ /* We put the top label */
+
+ fontSize = 12
+
+ browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
+
+ label = thisObject.params.ASSET_LABEL
+
+ xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO + 3
+ yOffset = 22
+
+ labelPoint = {
+ x: centerPoint.x - xOffset,
+ y: centerPoint.y - yOffset
+ }
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+
+ /* We put the bottom label */
+
+ fontSize = 12
+
+ browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
+
+ label = thisObject.params.ASSET_NAME + ' '
+
+ xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO + 3
+ yOffset = -15
+
+ labelPoint = {
+ x: centerPoint.x - xOffset,
+ y: centerPoint.y - yOffset
+ }
+
+ if (thisObject.params.ASSET_NAME === thisObject.params.BASE_ASSET) {
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+ } else {
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ }
+
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
-
- /* Common Variables */
-
- let fontSize
- let label
- let xOffset
- let yOffset
-
- /* We put the thisObject.params.VALUE in the middle */
-
- label = thisObject.params.VALUE
-
- if (isNaN(label) === false) {
- label = Number(label)
-
- label = dynamicDecimals(label, 2)
- if (label === 0) { label = label.toFixed(2) }
- }
-
- fontSize = 22
- if (label.length > 8) {
- fontSize = 18
- }
- if (label.length > 10) {
- fontSize = 14
- }
- if (label.length > 12) {
- fontSize = 10
- }
- if (label.length > 14) {
- fontSize = 8
- }
-
- browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
-
- // label = label.substring(0, 6)
-
- xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO + 7
-
- labelPoint = {
- x: centerPoint.x - xOffset,
- y: centerPoint.y
- }
-
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
-
- /* We put the top label */
-
- fontSize = 12
-
- browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
-
- label = thisObject.params.ASSET_LABEL
-
- xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO + 3
- yOffset = 22
-
- labelPoint = {
- x: centerPoint.x - xOffset,
- y: centerPoint.y - yOffset
- }
-
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
-
- /* We put the bottom label */
-
- fontSize = 12
-
- browserCanvasContext.font = 'bold ' + fontSize + 'px ' + UI_FONT.PRIMARY
-
- label = thisObject.params.ASSET_NAME + ' '
-
- xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO + 3
- yOffset = -15
-
- labelPoint = {
- x: centerPoint.x - xOffset,
- y: centerPoint.y - yOffset
- }
-
- if (thisObject.params.ASSET_NAME === thisObject.params.BASE_ASSET) {
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
- } else {
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- }
-
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
}
diff --git a/CanvasApp/Container.js b/CanvasApp/Container.js
index 56cf14085..f3afb66e5 100644
--- a/CanvasApp/Container.js
+++ b/CanvasApp/Container.js
@@ -1,262 +1,262 @@
-function newContainer () {
- let thisObject = {
- id: newUniqueId(),
- type: 'Rectangle',
- frame: undefined,
- eventHandler: undefined,
- parentContainer: undefined,
- isDraggeable: true,
- notDraggingOnX: false,
- notDraggingOnY: false,
- isClickeable: false,
- isWheelable: false,
- detectMouseOver: false,
- name: undefined,
- fitFunction: undefined,
- isVisibleFunction: undefined,
- displace: displace,
- initialize: initialize,
- finalize: finalize,
- connectToParent: connectToParent,
- isForThisPurpose: isForThisPurpose
- }
-
- let connectedToParentWidth = false
- let connectedToParentHeight = false
- let connectedToParentRadius = false
-
- let onDimmensionsChangedParentEvent = false
- let onMouseOverParentEvent = false
- let onMouseNotOverParentEvent = false
- let onFocusParentEvent = false
- let onNotFocusParentEvent = false
- let onDisplaceParentEvent = false
- let onDragStartedParentEvent = false
- let onDragFinishedParentEvent = false
-
- let isConnectedToParent = false
-
- let dimensionsChangedEventSubscriptionId
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
- let onFocusEventSubscriptionId
- let onNotFocusEventSubscriptionId
- let onDisplaceEventSubscriptionId
- let onDragStartedEventSubscriptionId
- let onDragFinishedEventSubscriptionId
-
- return thisObject
-
- function finalize () {
- if (isConnectedToParent === true) {
- thisObject.parentContainer.eventHandler.stopListening(dimensionsChangedEventSubscriptionId)
- thisObject.parentContainer.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.parentContainer.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- thisObject.parentContainer.eventHandler.stopListening(onFocusEventSubscriptionId)
- thisObject.parentContainer.eventHandler.stopListening(onNotFocusEventSubscriptionId)
- thisObject.parentContainer.eventHandler.stopListening(onDisplaceEventSubscriptionId)
- thisObject.parentContainer.eventHandler.stopListening(onDragStartedEventSubscriptionId)
- thisObject.parentContainer.eventHandler.stopListening(onDragFinishedEventSubscriptionId)
-
- thisObject.parentContainer = undefined
- thisObject.eventHandler.finalize()
-
- thisObject.frame.finalize()
- }
- }
-
- function initialize (pName, pType) {
- thisObject.name = pName
- thisObject.type = pType
-
- thisObject.frame = newFrame()
- thisObject.frame.initialize(pType)
- if (pName !== undefined) {
- thisObject.frame.containerName = pName
- }
- thisObject.frame.container = thisObject
-
- thisObject.eventHandler = newEventHandler()
- thisObject.eventHandler.name = pName
- }
-
- function connectToParent (
- parentContainer,
- onWidth,
- onHeight,
- onRadius,
- onDimmensionsChangedEvent,
- onMouseOverEvent,
- onMouseNotOverEvent,
- onFocusEvent,
- onNotFocusEvent,
- onDisplaceEvent,
- onDragStartedEvent,
- onDragFinishedEvent
- ) {
- connectedToParentWidth = onWidth
- connectedToParentHeight = onHeight
- connectedToParentRadius = onRadius
-
- onDimmensionsChangedParentEvent = onDimmensionsChangedEvent
- onMouseOverParentEvent = onMouseOverEvent
- onMouseNotOverParentEvent = onMouseNotOverEvent
- onFocusParentEvent = onFocusEvent
- onNotFocusParentEvent = onNotFocusEvent
- onDisplaceParentEvent = onDisplaceEvent
- onDragStartedParentEvent = onDragStartedEvent
- onDragFinishedParentEvent = onDragFinishedEvent
-
- isConnectedToParent = true
-
- thisObject.frame.parentFrame = parentContainer.frame
- thisObject.parentContainer = parentContainer
-
- if (onDimmensionsChangedParentEvent === true) {
- dimensionsChangedEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('Dimmensions Changed', onParentDimmensionsChanged)
- }
- if (onMouseOverParentEvent === true) {
- onMouseOverEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- }
- if (onMouseNotOverParentEvent === true) {
- onMouseNotOverEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- }
- if (onFocusParentEvent === true) {
- onFocusEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onFocus', onFocus)
- }
- if (onNotFocusParentEvent === true) {
- onNotFocusEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onNotFocus', onNotFocus)
- }
- if (onDisplaceParentEvent === true) {
- onDisplaceEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onDisplace', onDisplace)
- }
- if (onDragStartedParentEvent === true) {
- onDragStartedEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onDragStarted', onDragStarted)
- }
- if (onDragFinishedParentEvent === true) {
- onDragFinishedEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onDragFinished', onDragFinished)
+function newContainer() {
+ let thisObject = {
+ id: newUniqueId(),
+ type: 'Rectangle',
+ frame: undefined,
+ eventHandler: undefined,
+ parentContainer: undefined,
+ isDraggeable: true,
+ notDraggingOnX: false,
+ notDraggingOnY: false,
+ isClickeable: false,
+ isWheelable: false,
+ detectMouseOver: false,
+ name: undefined,
+ fitFunction: undefined,
+ isVisibleFunction: undefined,
+ displace: displace,
+ initialize: initialize,
+ finalize: finalize,
+ connectToParent: connectToParent,
+ isForThisPurpose: isForThisPurpose
}
- if (connectedToParentWidth) {
- thisObject.frame.width = thisObject.parentContainer.frame.width
- }
- if (connectedToParentHeight) {
- thisObject.frame.height = thisObject.parentContainer.frame.height
- }
- if (connectedToParentRadius) {
- thisObject.frame.radius = thisObject.parentContainer.frame.radius
- }
- }
+ let connectedToParentWidth = false
+ let connectedToParentHeight = false
+ let connectedToParentRadius = false
- function onParentDimmensionsChanged (event) {
- let dimmensionsChanged = false
- if (connectedToParentWidth) {
- thisObject.frame.width = thisObject.parentContainer.frame.width
- dimmensionsChanged = true
- }
- if (connectedToParentHeight) {
- thisObject.frame.height = thisObject.parentContainer.frame.height
- dimmensionsChanged = true
- }
- if (connectedToParentRadius) {
- thisObject.frame.radius = thisObject.parentContainer.frame.radius
- dimmensionsChanged = true
+ let onDimmensionsChangedParentEvent = false
+ let onMouseOverParentEvent = false
+ let onMouseNotOverParentEvent = false
+ let onFocusParentEvent = false
+ let onNotFocusParentEvent = false
+ let onDisplaceParentEvent = false
+ let onDragStartedParentEvent = false
+ let onDragFinishedParentEvent = false
+
+ let isConnectedToParent = false
+
+ let dimensionsChangedEventSubscriptionId
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
+ let onFocusEventSubscriptionId
+ let onNotFocusEventSubscriptionId
+ let onDisplaceEventSubscriptionId
+ let onDragStartedEventSubscriptionId
+ let onDragFinishedEventSubscriptionId
+
+ return thisObject
+
+ function finalize() {
+ if (isConnectedToParent === true) {
+ thisObject.parentContainer.eventHandler.stopListening(dimensionsChangedEventSubscriptionId)
+ thisObject.parentContainer.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.parentContainer.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
+ thisObject.parentContainer.eventHandler.stopListening(onFocusEventSubscriptionId)
+ thisObject.parentContainer.eventHandler.stopListening(onNotFocusEventSubscriptionId)
+ thisObject.parentContainer.eventHandler.stopListening(onDisplaceEventSubscriptionId)
+ thisObject.parentContainer.eventHandler.stopListening(onDragStartedEventSubscriptionId)
+ thisObject.parentContainer.eventHandler.stopListening(onDragFinishedEventSubscriptionId)
+
+ thisObject.parentContainer = undefined
+ thisObject.eventHandler.finalize()
+
+ thisObject.frame.finalize()
+ }
}
- if (dimmensionsChanged) {
- thisObject.eventHandler.raiseEvent('Dimmensions Changed', event)
+ function initialize(pName, pType) {
+ thisObject.name = pName
+ thisObject.type = pType
+
+ thisObject.frame = newFrame()
+ thisObject.frame.initialize(pType)
+ if (pName !== undefined) {
+ thisObject.frame.containerName = pName
+ }
+ thisObject.frame.container = thisObject
+
+ thisObject.eventHandler = newEventHandler()
+ thisObject.eventHandler.name = pName
}
- }
- function onMouseOver (event) {
- thisObject.eventHandler.raiseEvent('onMouseOver', event)
- }
+ function connectToParent(
+ parentContainer,
+ onWidth,
+ onHeight,
+ onRadius,
+ onDimmensionsChangedEvent,
+ onMouseOverEvent,
+ onMouseNotOverEvent,
+ onFocusEvent,
+ onNotFocusEvent,
+ onDisplaceEvent,
+ onDragStartedEvent,
+ onDragFinishedEvent
+ ) {
+ connectedToParentWidth = onWidth
+ connectedToParentHeight = onHeight
+ connectedToParentRadius = onRadius
- function onMouseNotOver (event) {
- thisObject.eventHandler.raiseEvent('onMouseNotOver', event)
- }
+ onDimmensionsChangedParentEvent = onDimmensionsChangedEvent
+ onMouseOverParentEvent = onMouseOverEvent
+ onMouseNotOverParentEvent = onMouseNotOverEvent
+ onFocusParentEvent = onFocusEvent
+ onNotFocusParentEvent = onNotFocusEvent
+ onDisplaceParentEvent = onDisplaceEvent
+ onDragStartedParentEvent = onDragStartedEvent
+ onDragFinishedParentEvent = onDragFinishedEvent
- function onFocus (event) {
- thisObject.eventHandler.raiseEvent('onFocus', event)
- }
+ isConnectedToParent = true
- function onNotFocus (event) {
- thisObject.eventHandler.raiseEvent('onNotFocus', event)
- }
+ thisObject.frame.parentFrame = parentContainer.frame
+ thisObject.parentContainer = parentContainer
- function onDisplace (event) {
- thisObject.eventHandler.raiseEvent('onDisplace', event)
- }
+ if (onDimmensionsChangedParentEvent === true) {
+ dimensionsChangedEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('Dimmensions Changed', onParentDimmensionsChanged)
+ }
+ if (onMouseOverParentEvent === true) {
+ onMouseOverEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ }
+ if (onMouseNotOverParentEvent === true) {
+ onMouseNotOverEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ }
+ if (onFocusParentEvent === true) {
+ onFocusEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onFocus', onFocus)
+ }
+ if (onNotFocusParentEvent === true) {
+ onNotFocusEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onNotFocus', onNotFocus)
+ }
+ if (onDisplaceParentEvent === true) {
+ onDisplaceEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onDisplace', onDisplace)
+ }
+ if (onDragStartedParentEvent === true) {
+ onDragStartedEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onDragStarted', onDragStarted)
+ }
+ if (onDragFinishedParentEvent === true) {
+ onDragFinishedEventSubscriptionId = thisObject.parentContainer.eventHandler.listenToEvent('onDragFinished', onDragFinished)
+ }
- function onDragStarted (event) {
- thisObject.eventHandler.raiseEvent('onDragStarted', event)
- }
-
- function onDragFinished (event) {
- thisObject.eventHandler.raiseEvent('onDragFinished', event)
- }
-
- function isForThisPurpose (purpose) {
- if (purpose !== undefined) {
- switch (purpose) {
- case GET_CONTAINER_PURPOSE.MOUSE_OVER:
- if (thisObject.detectMouseOver === true) {
- return true
- }
- break
- case GET_CONTAINER_PURPOSE.MOUSE_WHEEL:
- if (thisObject.isWheelable === true) {
- return true
- }
- break
- case GET_CONTAINER_PURPOSE.MOUSE_CLICK:
- if (thisObject.isClickeable === true) {
- return true
- }
- break
- case GET_CONTAINER_PURPOSE.DRAGGING:
- if (thisObject.isDraggeable === true) {
- return true
- }
- break
- default: { return false }
-
- }
+ if (connectedToParentWidth) {
+ thisObject.frame.width = thisObject.parentContainer.frame.width
+ }
+ if (connectedToParentHeight) {
+ thisObject.frame.height = thisObject.parentContainer.frame.height
+ }
+ if (connectedToParentRadius) {
+ thisObject.frame.radius = thisObject.parentContainer.frame.radius
+ }
}
- return false
- }
- function displace (point) {
- /* This function will move the container according to the vector received. If it has a visible function will use it
- to see if the container can be moved there or not. It wont if the center will not be visible.
+ function onParentDimmensionsChanged(event) {
+ let dimmensionsChanged = false
+ if (connectedToParentWidth) {
+ thisObject.frame.width = thisObject.parentContainer.frame.width
+ dimmensionsChanged = true
+ }
+ if (connectedToParentHeight) {
+ thisObject.frame.height = thisObject.parentContainer.frame.height
+ dimmensionsChanged = true
+ }
+ if (connectedToParentRadius) {
+ thisObject.frame.radius = thisObject.parentContainer.frame.radius
+ dimmensionsChanged = true
+ }
- Returns true if move was possible, false if not. */
+ if (dimmensionsChanged) {
+ thisObject.eventHandler.raiseEvent('Dimmensions Changed', event)
+ }
+ }
- let checkPoint = {}
+ function onMouseOver(event) {
+ thisObject.eventHandler.raiseEvent('onMouseOver', event)
+ }
- if (thisObject.isVisibleFunction === undefined) {
- drag()
- return true
- } else {
- checkPoint.x = thisObject.frame.position.x + point.x + thisObject.frame.width / 2
- checkPoint.y = thisObject.frame.position.y + point.y + thisObject.frame.height / 2
- let isVisible = thisObject.isVisibleFunction(checkPoint)
- if (isVisible === true) {
- drag()
- return true
- } else {
+ function onMouseNotOver(event) {
+ thisObject.eventHandler.raiseEvent('onMouseNotOver', event)
+ }
+
+ function onFocus(event) {
+ thisObject.eventHandler.raiseEvent('onFocus', event)
+ }
+
+ function onNotFocus(event) {
+ thisObject.eventHandler.raiseEvent('onNotFocus', event)
+ }
+
+ function onDisplace(event) {
+ thisObject.eventHandler.raiseEvent('onDisplace', event)
+ }
+
+ function onDragStarted(event) {
+ thisObject.eventHandler.raiseEvent('onDragStarted', event)
+ }
+
+ function onDragFinished(event) {
+ thisObject.eventHandler.raiseEvent('onDragFinished', event)
+ }
+
+ function isForThisPurpose(purpose) {
+ if (purpose !== undefined) {
+ switch (purpose) {
+ case GET_CONTAINER_PURPOSE.MOUSE_OVER:
+ if (thisObject.detectMouseOver === true) {
+ return true
+ }
+ break
+ case GET_CONTAINER_PURPOSE.MOUSE_WHEEL:
+ if (thisObject.isWheelable === true) {
+ return true
+ }
+ break
+ case GET_CONTAINER_PURPOSE.MOUSE_CLICK:
+ if (thisObject.isClickeable === true) {
+ return true
+ }
+ break
+ case GET_CONTAINER_PURPOSE.DRAGGING:
+ if (thisObject.isDraggeable === true) {
+ return true
+ }
+ break
+ default: { return false }
+
+ }
+ }
return false
- }
}
- function drag () {
- if (thisObject.notDraggingOnX === false) {
- thisObject.frame.position.x = thisObject.frame.position.x + point.x
- }
- if (thisObject.notDraggingOnY === false) {
- thisObject.frame.position.y = thisObject.frame.position.y + point.y
- }
- thisObject.eventHandler.raiseEvent('onDisplace', event)
+
+ function displace(point) {
+ /* This function will move the container according to the vector received. If it has a visible function will use it
+ to see if the container can be moved there or not. It wont if the center will not be visible.
+
+ Returns true if move was possible, false if not. */
+
+ let checkPoint = {}
+
+ if (thisObject.isVisibleFunction === undefined) {
+ drag()
+ return true
+ } else {
+ checkPoint.x = thisObject.frame.position.x + point.x + thisObject.frame.width / 2
+ checkPoint.y = thisObject.frame.position.y + point.y + thisObject.frame.height / 2
+ let isVisible = thisObject.isVisibleFunction(checkPoint)
+ if (isVisible === true) {
+ drag()
+ return true
+ } else {
+ return false
+ }
+ }
+ function drag() {
+ if (thisObject.notDraggingOnX === false) {
+ thisObject.frame.position.x = thisObject.frame.position.x + point.x
+ }
+ if (thisObject.notDraggingOnY === false) {
+ thisObject.frame.position.y = thisObject.frame.position.y + point.y
+ }
+ thisObject.eventHandler.raiseEvent('onDisplace', event)
+ }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CCXTFunctions.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CCXTFunctions.js
index 047c4dcf3..ff51d8cce 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CCXTFunctions.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/CCXTFunctions.js
@@ -1,224 +1,224 @@
-function newCCXTFunctions () {
- thisObject = {
- addMissingExchanges: addMissingExchanges,
- addMissingAssets: addMissingAssets,
- addMissingMarkets: addMissingMarkets
- }
-
- return thisObject
-
- function addMissingExchanges (node, functionLibraryUiObjectsFromNodes) {
- currentExchanges = new Map()
- let parent = node.payload.parentNode
- if (parent !== undefined) {
- for (let i = 0; i < parent.cryptoExchanges.length; i++) {
- let cryptoExchanges = parent.cryptoExchanges[i]
- for (let j = 0; j < cryptoExchanges.exchanges.length; j++) {
- let exchange = cryptoExchanges.exchanges[j]
- let codeName = loadPropertyFromNodeConfig(exchange.payload, 'codeName')
- currentExchanges.set(codeName, exchange)
- }
- }
+function newCCXTFunctions() {
+ thisObject = {
+ addMissingExchanges: addMissingExchanges,
+ addMissingAssets: addMissingAssets,
+ addMissingMarkets: addMissingMarkets
}
- let params = {
- method: 'listExchanges',
- has: {
- fetchOHLCV: true,
- fetchMarkets: true
- }
- }
+ return thisObject
- callServer(JSON.stringify(params), 'CCXT', onResponse)
-
- function onResponse (err, data) {
- if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
- return
- }
-
- let exchanges = JSON.parse(data)
- for (let i = 0; i < exchanges.length; i++) {
- let exchange = exchanges[i]
- let existingExchange = currentExchanges.get(exchange.id)
- if (existingExchange === undefined) {
- let newExchange = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Crypto Exchange')
- newExchange.name = exchange.name
- newExchange.config = '{ \n\"codeName\": \"' + exchange.id + '\"\n}'
- newExchange.payload.floatingObject.collapseToggle()
- newExchange.exchangeAssets.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
- newExchange.exchangeMarkets.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
- newExchange.exchangeAccounts.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
- newExchange.exchangeAssets.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
- newExchange.exchangeMarkets.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
- newExchange.exchangeAccounts.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_025X
- newExchange.exchangeAssets.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- newExchange.exchangeMarkets.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- newExchange.exchangeAccounts.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- }
- }
- }
- }
-
- function addMissingAssets (node, functionLibraryUiObjectsFromNodes) {
- if (node.payload.parentNode === undefined) { return }
-
- let currentAssets = new Map()
- for (let j = 0; j < node.assets.length; j++) {
- let asset = node.assets[j]
- let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName')
- currentAssets.set(codeName, asset)
- }
-
- let exchangeId = loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName')
-
- try {
- let params = {
- exchangeId: exchangeId,
- method: 'fetchMarkets'
- }
- callServer(JSON.stringify(params), 'CCXT', onResponse)
-
- function onResponse (err, data) {
- if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
- return
- }
- let queryParams = loadPropertyFromNodeConfig(node.payload, 'addMissingAssets')
-
- let markets = JSON.parse(data)
- for (let i = 0; i < markets.length; i++) {
- let market = markets[i]
-
- if (queryParams !== undefined) {
- if (queryParams.baseAsset !== undefined) {
- if (market.base.indexOf(queryParams.baseAsset) < 0) {
- continue
- }
+ function addMissingExchanges(node, functionLibraryUiObjectsFromNodes) {
+ currentExchanges = new Map()
+ let parent = node.payload.parentNode
+ if (parent !== undefined) {
+ for (let i = 0; i < parent.cryptoExchanges.length; i++) {
+ let cryptoExchanges = parent.cryptoExchanges[i]
+ for (let j = 0; j < cryptoExchanges.exchanges.length; j++) {
+ let exchange = cryptoExchanges.exchanges[j]
+ let codeName = loadPropertyFromNodeConfig(exchange.payload, 'codeName')
+ currentExchanges.set(codeName, exchange)
+ }
}
- if (queryParams.quotedAsset !== undefined) {
- if (market.quote.indexOf(queryParams.quotedAsset) < 0) {
- continue
- }
+ }
+
+ let params = {
+ method: 'listExchanges',
+ has: {
+ fetchOHLCV: true,
+ fetchMarkets: true
}
- }
- if (currentAssets.get(market.base) === undefined) {
- addAsset(market.base)
- currentAssets.set(market.base, market.base)
- }
- if (currentAssets.get(market.quote) === undefined) {
- addAsset(market.quote)
- currentAssets.set(market.quote, market.quote)
- }
-
- function addAsset (name) {
- let newAsseet = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Asset')
- newAsseet.name = name
- newAsseet.config = '{ \n\"codeName\": \"' + name + '\"\n}'
- }
- }
- }
- } catch (err) {
- node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
- console.log(err.stack)
- }
- }
-
- function addMissingMarkets (node, functionLibraryUiObjectsFromNodes, functionLibraryNodeCloning) {
- if (node.payload.parentNode === undefined) { return }
- if (node.payload.parentNode.exchangeAssets === undefined) { return }
- if (node.payload.parentNode.payload.parentNode === undefined) { return }
- if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.superActions === undefined) { return }
-
- let currentAssets = new Map()
- let exchangeAssets = node.payload.parentNode.exchangeAssets
- for (let j = 0; j < exchangeAssets.assets.length; j++) {
- let asset = exchangeAssets.assets[j]
- let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName')
- currentAssets.set(codeName, asset)
- }
-
- let currentMarkets = new Map()
- let exchangeMarkets = node
- for (let j = 0; j < exchangeMarkets.markets.length; j++) {
- let asset = exchangeMarkets.markets[j]
- let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName')
- currentMarkets.set(codeName, asset)
- }
-
- let exchangeId = loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName')
-
- try {
- let params = {
- exchangeId: exchangeId,
- method: 'fetchMarkets'
- }
- callServer(JSON.stringify(params), 'CCXT', onResponse)
-
- function onResponse (err, data) {
- if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
- return
}
- let markets = JSON.parse(data)
- for (let i = 0; i < markets.length; i++) {
- let market = markets[i]
- let baseAsset = currentAssets.get(market.base)
- let quotedAsset = currentAssets.get(market.quote)
+ callServer(JSON.stringify(params), 'CCXT', onResponse)
- if (baseAsset === undefined) {
- continue
- }
- if (quotedAsset === undefined) {
- continue
- }
+ function onResponse(err, data) {
+ if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
+ return
+ }
- if (currentMarkets.get(market.symbol) === undefined) {
- addMarket(market.symbol, baseAsset, quotedAsset)
- }
-
- function addMarket (name, baseAsset, quotedAsset) {
- let newMarket = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Market')
- newMarket.name = name
- newMarket.config = '{ \n\"codeName\": \"' + name + '\"\n}'
- newMarket.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
- newMarket.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
- newMarket.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- newMarket.baseAsset.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_45
- newMarket.quotedAsset.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_45
- newMarket.baseAsset.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
- newMarket.quotedAsset.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_150X
- newMarket.baseAsset.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- newMarket.quotedAsset.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- newMarket.baseAsset.payload.referenceParent = baseAsset
- newMarket.quotedAsset.payload.referenceParent = quotedAsset
-
- currentMarkets.set(name, newMarket)
-
- let superActions = node.payload.parentNode.payload.parentNode.payload.parentNode.superActions
-
- for (let j = 0; j < superActions.superActions.length; j++) {
- let superAction = superActions.superActions[j]
- let clone = functionLibraryNodeCloning.getNodeClone(superAction)
- functionLibraryUiObjectsFromNodes.createUiObjectFromNode(clone, newMarket, newMarket)
- newMarket.superActions.push(clone)
- switch (j) {
- case 0:
- clone.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_025X
- break
- case 1:
- clone.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
- break
- }
+ let exchanges = JSON.parse(data)
+ for (let i = 0; i < exchanges.length; i++) {
+ let exchange = exchanges[i]
+ let existingExchange = currentExchanges.get(exchange.id)
+ if (existingExchange === undefined) {
+ let newExchange = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Crypto Exchange')
+ newExchange.name = exchange.name
+ newExchange.config = '{ \n\"codeName\": \"' + exchange.id + '\"\n}'
+ newExchange.payload.floatingObject.collapseToggle()
+ newExchange.exchangeAssets.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
+ newExchange.exchangeMarkets.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
+ newExchange.exchangeAccounts.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
+ newExchange.exchangeAssets.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
+ newExchange.exchangeMarkets.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
+ newExchange.exchangeAccounts.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_025X
+ newExchange.exchangeAssets.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ newExchange.exchangeMarkets.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ newExchange.exchangeAccounts.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ }
}
- }
}
- }
- } catch (err) {
- node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
- console.log(err.stack)
}
- }
+
+ function addMissingAssets(node, functionLibraryUiObjectsFromNodes) {
+ if (node.payload.parentNode === undefined) { return }
+
+ let currentAssets = new Map()
+ for (let j = 0; j < node.assets.length; j++) {
+ let asset = node.assets[j]
+ let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName')
+ currentAssets.set(codeName, asset)
+ }
+
+ let exchangeId = loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName')
+
+ try {
+ let params = {
+ exchangeId: exchangeId,
+ method: 'fetchMarkets'
+ }
+ callServer(JSON.stringify(params), 'CCXT', onResponse)
+
+ function onResponse(err, data) {
+ if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
+ return
+ }
+ let queryParams = loadPropertyFromNodeConfig(node.payload, 'addMissingAssets')
+
+ let markets = JSON.parse(data)
+ for (let i = 0; i < markets.length; i++) {
+ let market = markets[i]
+
+ if (queryParams !== undefined) {
+ if (queryParams.baseAsset !== undefined) {
+ if (market.base.indexOf(queryParams.baseAsset) < 0) {
+ continue
+ }
+ }
+ if (queryParams.quotedAsset !== undefined) {
+ if (market.quote.indexOf(queryParams.quotedAsset) < 0) {
+ continue
+ }
+ }
+ }
+ if (currentAssets.get(market.base) === undefined) {
+ addAsset(market.base)
+ currentAssets.set(market.base, market.base)
+ }
+ if (currentAssets.get(market.quote) === undefined) {
+ addAsset(market.quote)
+ currentAssets.set(market.quote, market.quote)
+ }
+
+ function addAsset(name) {
+ let newAsseet = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Asset')
+ newAsseet.name = name
+ newAsseet.config = '{ \n\"codeName\": \"' + name + '\"\n}'
+ }
+ }
+ }
+ } catch (err) {
+ node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
+ console.log(err.stack)
+ }
+ }
+
+ function addMissingMarkets(node, functionLibraryUiObjectsFromNodes, functionLibraryNodeCloning) {
+ if (node.payload.parentNode === undefined) { return }
+ if (node.payload.parentNode.exchangeAssets === undefined) { return }
+ if (node.payload.parentNode.payload.parentNode === undefined) { return }
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) { return }
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.superActions === undefined) { return }
+
+ let currentAssets = new Map()
+ let exchangeAssets = node.payload.parentNode.exchangeAssets
+ for (let j = 0; j < exchangeAssets.assets.length; j++) {
+ let asset = exchangeAssets.assets[j]
+ let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName')
+ currentAssets.set(codeName, asset)
+ }
+
+ let currentMarkets = new Map()
+ let exchangeMarkets = node
+ for (let j = 0; j < exchangeMarkets.markets.length; j++) {
+ let asset = exchangeMarkets.markets[j]
+ let codeName = loadPropertyFromNodeConfig(asset.payload, 'codeName')
+ currentMarkets.set(codeName, asset)
+ }
+
+ let exchangeId = loadPropertyFromNodeConfig(node.payload.parentNode.payload, 'codeName')
+
+ try {
+ let params = {
+ exchangeId: exchangeId,
+ method: 'fetchMarkets'
+ }
+ callServer(JSON.stringify(params), 'CCXT', onResponse)
+
+ function onResponse(err, data) {
+ if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
+ return
+ }
+
+ let markets = JSON.parse(data)
+ for (let i = 0; i < markets.length; i++) {
+ let market = markets[i]
+ let baseAsset = currentAssets.get(market.base)
+ let quotedAsset = currentAssets.get(market.quote)
+
+ if (baseAsset === undefined) {
+ continue
+ }
+ if (quotedAsset === undefined) {
+ continue
+ }
+
+ if (currentMarkets.get(market.symbol) === undefined) {
+ addMarket(market.symbol, baseAsset, quotedAsset)
+ }
+
+ function addMarket(name, baseAsset, quotedAsset) {
+ let newMarket = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Market')
+ newMarket.name = name
+ newMarket.config = '{ \n\"codeName\": \"' + name + '\"\n}'
+ newMarket.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
+ newMarket.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
+ newMarket.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ newMarket.baseAsset.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_45
+ newMarket.quotedAsset.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_45
+ newMarket.baseAsset.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
+ newMarket.quotedAsset.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_150X
+ newMarket.baseAsset.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ newMarket.quotedAsset.payload.floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ newMarket.baseAsset.payload.referenceParent = baseAsset
+ newMarket.quotedAsset.payload.referenceParent = quotedAsset
+
+ currentMarkets.set(name, newMarket)
+
+ let superActions = node.payload.parentNode.payload.parentNode.payload.parentNode.superActions
+
+ for (let j = 0; j < superActions.superActions.length; j++) {
+ let superAction = superActions.superActions[j]
+ let clone = functionLibraryNodeCloning.getNodeClone(superAction)
+ functionLibraryUiObjectsFromNodes.createUiObjectFromNode(clone, newMarket, newMarket)
+ newMarket.superActions.push(clone)
+ switch (j) {
+ case 0:
+ clone.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_025X
+ break
+ case 1:
+ clone.payload.floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
+ break
+ }
+ }
+ }
+ }
+ }
+ } catch (err) {
+ node.payload.uiObject.setErrorMessage('Failed to Fetch Assets from the Exchange')
+ console.log(err.stack)
+ }
+ }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ChainAttachDetach.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ChainAttachDetach.js
index 5a75546ab..faff8bafb 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ChainAttachDetach.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ChainAttachDetach.js
@@ -1,221 +1,221 @@
-function newChainAttachDetach () {
- thisObject = {
- chainDetachNode: chainDetachNode,
- chainAttachNode: chainAttachNode
- }
+function newChainAttachDetach() {
+ thisObject = {
+ chainDetachNode: chainDetachNode,
+ chainAttachNode: chainAttachNode
+ }
- return thisObject
+ return thisObject
- function chainDetachNode (node, rootNodes) {
- if (node.payload.parentNode === undefined) { return }
- switch (node.type) {
- case 'Phase': {
- let payload = node.payload
- for (let i = 0; i < payload.parentNode.phases.length; i++) {
- let phase = payload.parentNode.phases[i]
- if (phase.id === node.id) {
- if (i < payload.parentNode.phases.length - 1) {
- let nextPhase = payload.parentNode.phases[i + 1]
- if (i > 0) {
- let previousPhase = payload.parentNode.phases[i - 1]
- nextPhase.payload.chainParent = previousPhase
- } else {
- nextPhase.payload.chainParent = payload.parentNode
- }
- }
- payload.parentNode.phases.splice(i, 1)
- completeDetachment(node, rootNodes)
- return
- }
- }
- return
- }
- default: {
- let nodeDefinition = getNodeDefinition (node)
- if (nodeDefinition !== undefined) {
- /* Detach from parent */
- if (node.payload.parentNode !== undefined) {
- let parentNodeDefinition = getNodeDefinition (node.payload.parentNode)
- if (parentNodeDefinition !== undefined) {
- if (parentNodeDefinition.properties !== undefined) {
- for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
- let property = parentNodeDefinition.properties[i]
- if (nodeDefinition.propertyNameAtParent === property.name) {
- switch (property.type) {
- case 'node': {
- node.payload.parentNode[property.name] = undefined
- }
- break
- case 'array': {
- let nodePropertyArray = node.payload.parentNode[property.name]
- if (nodePropertyArray !== undefined) {
- for (let j = 0; j < nodePropertyArray.length; j++) {
- let arrayItem = nodePropertyArray[j]
- if (arrayItem.id === node.id) {
- nodePropertyArray.splice(j, 1)
+ function chainDetachNode(node, rootNodes) {
+ if (node.payload.parentNode === undefined) { return }
+ switch (node.type) {
+ case 'Phase': {
+ let payload = node.payload
+ for (let i = 0; i < payload.parentNode.phases.length; i++) {
+ let phase = payload.parentNode.phases[i]
+ if (phase.id === node.id) {
+ if (i < payload.parentNode.phases.length - 1) {
+ let nextPhase = payload.parentNode.phases[i + 1]
+ if (i > 0) {
+ let previousPhase = payload.parentNode.phases[i - 1]
+ nextPhase.payload.chainParent = previousPhase
+ } else {
+ nextPhase.payload.chainParent = payload.parentNode
}
- }
}
- }
- break
+ payload.parentNode.phases.splice(i, 1)
+ completeDetachment(node, rootNodes)
+ return
}
- }
}
- }
+ return
+ }
+ default: {
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ /* Detach from parent */
+ if (node.payload.parentNode !== undefined) {
+ let parentNodeDefinition = getNodeDefinition(node.payload.parentNode)
+ if (parentNodeDefinition !== undefined) {
+ if (parentNodeDefinition.properties !== undefined) {
+ for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
+ let property = parentNodeDefinition.properties[i]
+ if (nodeDefinition.propertyNameAtParent === property.name) {
+ switch (property.type) {
+ case 'node': {
+ node.payload.parentNode[property.name] = undefined
+ }
+ break
+ case 'array': {
+ let nodePropertyArray = node.payload.parentNode[property.name]
+ if (nodePropertyArray !== undefined) {
+ for (let j = 0; j < nodePropertyArray.length; j++) {
+ let arrayItem = nodePropertyArray[j]
+ if (arrayItem.id === node.id) {
+ nodePropertyArray.splice(j, 1)
+ }
+ }
+ }
+ }
+ break
+ }
+ }
+ }
+ }
+ }
+ }
+ completeDetachment(node, rootNodes)
+ }
}
- }
- completeDetachment(node, rootNodes)
}
- }
}
- }
- function chainAttachNode (node, attachToNode, rootNodes) {
- switch (node.type) {
+ function chainAttachNode(node, attachToNode, rootNodes) {
+ switch (node.type) {
- case 'Exchange Account Key': {
- node.payload.parentNode = attachToNode
- node.payload.chainParent = attachToNode
- if (node.payload.parentNode.keys !== undefined) {
- node.payload.parentNode.keys.push(node)
- } else {
- node.payload.parentNode.key = node
- }
- completeAttachment(node, rootNodes)
- }
- break
-
- case 'Phase': {
- switch (attachToNode.type) {
- case 'Stop': {
- node.payload.parentNode = attachToNode
- if (attachToNode.phases.length > 0) {
- let phase = attachToNode.phases[attachToNode.phases.length - 1]
- node.payload.chainParent = phase
- } else {
- node.payload.chainParent = attachToNode
- }
- attachToNode.phases.push(node)
- completeAttachment(node, rootNodes)
- }
- break
- case 'Take Profit': {
- node.payload.parentNode = attachToNode
- if (attachToNode.phases.length > 0) {
- let phase = attachToNode.phases[attachToNode.phases.length - 1]
- node.payload.chainParent = phase
- } else {
- node.payload.chainParent = attachToNode
- }
- attachToNode.phases.push(node)
- completeAttachment(node, rootNodes)
- }
- break
- case 'Initial Stop': {
- if (attachToNode.phases.length >= 1) {
- return
- }
-
- node.payload.parentNode = attachToNode
- if (attachToNode.phases.length > 0) {
- let phase = attachToNode.phases[attachToNode.phases.length - 1]
- node.payload.chainParent = phase
- } else {
- node.payload.chainParent = attachToNode
- }
- attachToNode.phases.push(node)
- completeAttachment(node, rootNodes)
- }
- break
- case 'Initial Take Profit': {
- if (attachToNode.phases.length >= 1) {
- return
- }
- node.payload.parentNode = attachToNode
- if (attachToNode.phases.length > 0) {
- let phase = attachToNode.phases[attachToNode.phases.length - 1]
- node.payload.chainParent = phase
- } else {
- node.payload.chainParent = attachToNode
- }
- attachToNode.phases.push(node)
- completeAttachment(node, rootNodes)
- }
- break
- case 'Phase': {
- node.payload.parentNode = attachToNode.payload.parentNode
- for (let i = 0; i < node.payload.parentNode.phases.length; i++) {
- let phase = node.payload.parentNode.phases[i]
- if (attachToNode.id === phase.id) {
- if (i === node.payload.parentNode.phases.length - 1) {
- node.payload.chainParent = attachToNode
- node.payload.parentNode.phases.push(node)
- completeAttachment(node, rootNodes)
+ case 'Exchange Account Key': {
+ node.payload.parentNode = attachToNode
+ node.payload.chainParent = attachToNode
+ if (node.payload.parentNode.keys !== undefined) {
+ node.payload.parentNode.keys.push(node)
} else {
- node.payload.chainParent = attachToNode
- let nextPhase = node.payload.parentNode.phases[i + 1]
- nextPhase.payload.chainParent = node
- node.payload.parentNode.phases.splice(i + 1, 0, node)
- completeAttachment(node, rootNodes)
- return
+ node.payload.parentNode.key = node
}
- }
+ completeAttachment(node, rootNodes)
}
- }
- }
- }
- break
- default: {
- let nodeDefinition = getNodeDefinition (node)
- if (nodeDefinition !== undefined) {
- node.payload.parentNode = attachToNode
- node.payload.chainParent = attachToNode
- /* Attach to new parent */
- if (node.payload.parentNode !== undefined) {
- let parentNodeDefinition = getNodeDefinition (node.payload.parentNode)
- if (parentNodeDefinition !== undefined) {
- if (parentNodeDefinition.properties !== undefined) {
- for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
- let property = parentNodeDefinition.properties[i]
- if (nodeDefinition.propertyNameAtParent === property.name) {
- switch (property.type) {
- case 'node': {
- node.payload.parentNode[property.name] = node
- }
+ break
+
+ case 'Phase': {
+ switch (attachToNode.type) {
+ case 'Stop': {
+ node.payload.parentNode = attachToNode
+ if (attachToNode.phases.length > 0) {
+ let phase = attachToNode.phases[attachToNode.phases.length - 1]
+ node.payload.chainParent = phase
+ } else {
+ node.payload.chainParent = attachToNode
+ }
+ attachToNode.phases.push(node)
+ completeAttachment(node, rootNodes)
+ }
break
- case 'array': {
- if (node.payload.parentNode[property.name] === undefined) {
- node.payload.parentNode[property.name] = []
+ case 'Take Profit': {
+ node.payload.parentNode = attachToNode
+ if (attachToNode.phases.length > 0) {
+ let phase = attachToNode.phases[attachToNode.phases.length - 1]
+ node.payload.chainParent = phase
+ } else {
+ node.payload.chainParent = attachToNode
+ }
+ attachToNode.phases.push(node)
+ completeAttachment(node, rootNodes)
+ }
+ break
+ case 'Initial Stop': {
+ if (attachToNode.phases.length >= 1) {
+ return
+ }
+
+ node.payload.parentNode = attachToNode
+ if (attachToNode.phases.length > 0) {
+ let phase = attachToNode.phases[attachToNode.phases.length - 1]
+ node.payload.chainParent = phase
+ } else {
+ node.payload.chainParent = attachToNode
+ }
+ attachToNode.phases.push(node)
+ completeAttachment(node, rootNodes)
+ }
+ break
+ case 'Initial Take Profit': {
+ if (attachToNode.phases.length >= 1) {
+ return
+ }
+ node.payload.parentNode = attachToNode
+ if (attachToNode.phases.length > 0) {
+ let phase = attachToNode.phases[attachToNode.phases.length - 1]
+ node.payload.chainParent = phase
+ } else {
+ node.payload.chainParent = attachToNode
+ }
+ attachToNode.phases.push(node)
+ completeAttachment(node, rootNodes)
+ }
+ break
+ case 'Phase': {
+ node.payload.parentNode = attachToNode.payload.parentNode
+ for (let i = 0; i < node.payload.parentNode.phases.length; i++) {
+ let phase = node.payload.parentNode.phases[i]
+ if (attachToNode.id === phase.id) {
+ if (i === node.payload.parentNode.phases.length - 1) {
+ node.payload.chainParent = attachToNode
+ node.payload.parentNode.phases.push(node)
+ completeAttachment(node, rootNodes)
+ } else {
+ node.payload.chainParent = attachToNode
+ let nextPhase = node.payload.parentNode.phases[i + 1]
+ nextPhase.payload.chainParent = node
+ node.payload.parentNode.phases.splice(i + 1, 0, node)
+ completeAttachment(node, rootNodes)
+ return
+ }
+ }
}
- let nodePropertyArray = node.payload.parentNode[property.name]
- nodePropertyArray.push(node)
- }
- break
}
- }
}
- }
}
- }
- completeAttachment(node, rootNodes)
+ break
+ default: {
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ node.payload.parentNode = attachToNode
+ node.payload.chainParent = attachToNode
+ /* Attach to new parent */
+ if (node.payload.parentNode !== undefined) {
+ let parentNodeDefinition = getNodeDefinition(node.payload.parentNode)
+ if (parentNodeDefinition !== undefined) {
+ if (parentNodeDefinition.properties !== undefined) {
+ for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
+ let property = parentNodeDefinition.properties[i]
+ if (nodeDefinition.propertyNameAtParent === property.name) {
+ switch (property.type) {
+ case 'node': {
+ node.payload.parentNode[property.name] = node
+ }
+ break
+ case 'array': {
+ if (node.payload.parentNode[property.name] === undefined) {
+ node.payload.parentNode[property.name] = []
+ }
+ let nodePropertyArray = node.payload.parentNode[property.name]
+ nodePropertyArray.push(node)
+ }
+ break
+ }
+ }
+ }
+ }
+ }
+ }
+ completeAttachment(node, rootNodes)
+ }
+ }
}
- }
}
- }
- function completeDetachment (node, rootNodes) {
- node.payload.parentNode = undefined
- node.payload.chainParent = undefined
- rootNodes.push(node)
- }
+ function completeDetachment(node, rootNodes) {
+ node.payload.parentNode = undefined
+ node.payload.chainParent = undefined
+ rootNodes.push(node)
+ }
- function completeAttachment (node, rootNodes) {
- for (let i = 0; i < rootNodes.length; i++) {
- let rootNode = rootNodes[i]
- if (rootNode.id === node.id) {
- rootNodes.splice(i, 1)
- return
- }
+ function completeAttachment(node, rootNodes) {
+ for (let i = 0; i < rootNodes.length; i++) {
+ let rootNode = rootNodes[i]
+ if (rootNode.id === node.id) {
+ rootNodes.splice(i, 1)
+ return
+ }
+ }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/DependenciesFilter.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/DependenciesFilter.js
index 1e4fb26ac..88b9eb45d 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/DependenciesFilter.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/DependenciesFilter.js
@@ -1,74 +1,74 @@
-function newDependenciesFilter () {
- thisObject = {
- createFilter: createFilter
- }
+function newDependenciesFilter() {
+ thisObject = {
+ createFilter: createFilter
+ }
- return thisObject
+ return thisObject
- function createFilter (node) {
- let filters = new Map()
- recursiveFilter(node)
+ function createFilter(node) {
+ let filters = new Map()
+ recursiveFilter(node)
- return Array.from(filters.keys())
+ return Array.from(filters.keys())
- function recursiveFilter (node) {
- filter(node.code)
+ function recursiveFilter(node) {
+ filter(node.code)
- let nodeDefinition = getNodeDefinition (node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (node[property.name] !== undefined) {
- recursiveFilter(node[property.name])
- }
- previousPropertyName = property.name
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] !== undefined) {
+ recursiveFilter(node[property.name])
+ }
+ previousPropertyName = property.name
+ }
+ }
+ break
+ case 'array': {
+ let nodePropertyArray = node[property.name]
+ if (nodePropertyArray !== undefined) {
+ for (let j = 0; j < nodePropertyArray.length; j++) {
+ let nodeProperty = nodePropertyArray[j]
+ recursiveFilter(nodeProperty)
+ }
+ }
+ }
+ break
+ }
+ }
}
- }
- break
- case 'array': {
- let nodePropertyArray = node[property.name]
- if (nodePropertyArray !== undefined) {
- for (let j = 0; j < nodePropertyArray.length; j++) {
- let nodeProperty = nodePropertyArray[j]
- recursiveFilter(nodeProperty)
- }
- }
- }
- break
}
- }
}
- }
- }
- function filter (code) {
- if (code === undefined) { return }
+ function filter(code) {
+ if (code === undefined) { return }
- let instructionsArray = code.split(' ')
- for (let i = 0; i < instructionsArray.length; i++) {
- let instruction = instructionsArray[i]
- if (instruction.indexOf('chart') >= 0) {
- let parts = instruction.split('.')
- let timeFrame = parts[1]
- let product = parts[2]
- let productParts = product.split(',')
- product = productParts[0]
- productParts = product.split(')')
- product = productParts[0]
+ let instructionsArray = code.split(' ')
+ for (let i = 0; i < instructionsArray.length; i++) {
+ let instruction = instructionsArray[i]
+ if (instruction.indexOf('chart') >= 0) {
+ let parts = instruction.split('.')
+ let timeFrame = parts[1]
+ let product = parts[2]
+ let productParts = product.split(',')
+ product = productParts[0]
+ productParts = product.split(')')
+ product = productParts[0]
- // Example: chart.at01hs.popularSMA.sma200 - chart.at01hs.popularSMA.sma100 < 10
- if (timeFrame !== 'atAnyTimeFrame') {
- timeFrame = timeFrame.substring(2, 4) + '-' + timeFrame.substring(4, 7)
- }
- filters.set(timeFrame + '-' + product, true)
+ // Example: chart.at01hs.popularSMA.sma200 - chart.at01hs.popularSMA.sma100 < 10
+ if (timeFrame !== 'atAnyTimeFrame') {
+ timeFrame = timeFrame.substring(2, 4) + '-' + timeFrame.substring(4, 7)
+ }
+ filters.set(timeFrame + '-' + product, true)
+ }
+ }
}
- }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeChildren.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeChildren.js
index 0165b1ecd..30178d28f 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeChildren.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeChildren.js
@@ -1,67 +1,67 @@
-function newNodeChildren () {
- thisObject = {
- childrenCount: childrenCount
- }
-
- return thisObject
-
- function childrenCount (parentNode, childNode) {
- return countChildrenUiObject(parentNode, childNode)
- }
-
- function countChildrenUiObject (parentNode, childNode) {
- let response = {
- childrenCount: 0,
- childIndex: undefined
+function newNodeChildren() {
+ thisObject = {
+ childrenCount: childrenCount
}
- let parentNodeDefinition = getNodeDefinition (parentNode)
- if (parentNodeDefinition !== undefined) {
- if (parentNodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
- let property = parentNodeDefinition.properties[i]
- if (parentNode[property.name] !== undefined) {
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- response.childrenCount++
- if (parentNode[property.name].id === childNode.id) {
- response.childIndex = response.childrenCount
- }
- previousPropertyName = property.name
- }
- }
- break
- case 'array': {
- let nodeDefinition = getNodeDefinition (childNode)
- if (nodeDefinition !== undefined) {
- let nodePropertyArray = parentNode[property.name]
- for (let j = 0; j < nodePropertyArray.length; j++) {
- let child = nodePropertyArray[j]
- if (nodeDefinition.chainedToSameType === true) {
- if (j < 1) {
- response.childrenCount++
- if (child.id === childNode.id) {
- response.childIndex = response.childrenCount
- }
- }
- } else {
- response.childrenCount++
- if (child.id === childNode.id) {
- response.childIndex = response.childrenCount
- }
- }
- }
- }
- }
- break
- }
- }
+ return thisObject
+
+ function childrenCount(parentNode, childNode) {
+ return countChildrenUiObject(parentNode, childNode)
+ }
+
+ function countChildrenUiObject(parentNode, childNode) {
+ let response = {
+ childrenCount: 0,
+ childIndex: undefined
}
- }
- }
+ let parentNodeDefinition = getNodeDefinition(parentNode)
+ if (parentNodeDefinition !== undefined) {
+ if (parentNodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- return response
- }
+ for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
+ let property = parentNodeDefinition.properties[i]
+ if (parentNode[property.name] !== undefined) {
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ response.childrenCount++
+ if (parentNode[property.name].id === childNode.id) {
+ response.childIndex = response.childrenCount
+ }
+ previousPropertyName = property.name
+ }
+ }
+ break
+ case 'array': {
+ let nodeDefinition = getNodeDefinition(childNode)
+ if (nodeDefinition !== undefined) {
+ let nodePropertyArray = parentNode[property.name]
+ for (let j = 0; j < nodePropertyArray.length; j++) {
+ let child = nodePropertyArray[j]
+ if (nodeDefinition.chainedToSameType === true) {
+ if (j < 1) {
+ response.childrenCount++
+ if (child.id === childNode.id) {
+ response.childIndex = response.childrenCount
+ }
+ }
+ } else {
+ response.childrenCount++
+ if (child.id === childNode.id) {
+ response.childIndex = response.childrenCount
+ }
+ }
+ }
+ }
+ }
+ break
+ }
+ }
+ }
+ }
+ }
+
+ return response
+ }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeCloning.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeCloning.js
index 6de8afad8..9d5f920aa 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeCloning.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeCloning.js
@@ -1,176 +1,176 @@
-function newNodeCloning () {
- const MODULE_NAME = 'Node Cloning'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodeCloning() {
+ const MODULE_NAME = 'Node Cloning'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- thisObject = {
- getNodeClone: getNodeClone
- }
- return thisObject
+ thisObject = {
+ getNodeClone: getNodeClone
+ }
+ return thisObject
- function getNodeClone (node) {
- let idConversionMap = new Map()
+ function getNodeClone(node) {
+ let idConversionMap = new Map()
- let inmatureClone = cloneNode(node)
- let matureClone = redirectReferenceParents(inmatureClone)
+ let inmatureClone = cloneNode(node)
+ let matureClone = redirectReferenceParents(inmatureClone)
- return matureClone
+ return matureClone
- function cloneNode (node) {
- if (node === undefined) { return }
- let nodeDefinition = getNodeDefinition(node)
- if (nodeDefinition !== undefined) {
- let object = {
- type: node.type,
- name: node.name,
- code: node.code,
- config: node.config
- }
-
- /* Children Nodes */
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
-
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (node[property.name] !== undefined) {
- object[property.name] = cloneNode(node[property.name])
- }
- previousPropertyName = property.name
+ function cloneNode(node) {
+ if (node === undefined) { return }
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ let object = {
+ type: node.type,
+ name: node.name,
+ code: node.code,
+ config: node.config
}
- break
- }
- case 'array': {
- if (node[property.name] !== undefined) {
- let nodePropertyArray = node[property.name]
- object[property.name] = []
- for (let m = 0; m < nodePropertyArray.length; m++) {
- let protocolNode = cloneNode(nodePropertyArray[m])
- if (protocolNode !== undefined) {
- object[property.name].push(protocolNode)
+
+ /* Children Nodes */
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] !== undefined) {
+ object[property.name] = cloneNode(node[property.name])
+ }
+ previousPropertyName = property.name
+ }
+ break
+ }
+ case 'array': {
+ if (node[property.name] !== undefined) {
+ let nodePropertyArray = node[property.name]
+ object[property.name] = []
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ let protocolNode = cloneNode(nodePropertyArray[m])
+ if (protocolNode !== undefined) {
+ object[property.name].push(protocolNode)
+ }
+ }
+ }
+ break
+ }
+ }
}
- }
}
- break
- }
+
+ object.id = newUniqueId()
+ idConversionMap.set(node.id, object.id)
+
+ object.savedPayload = getSavedPayload(node)
+
+ return object
}
- }
}
- object.id = newUniqueId()
- idConversionMap.set(node.id, object.id)
-
- object.savedPayload = getSavedPayload(node)
-
- return object
- }
- }
-
- function redirectReferenceParents (node) {
- if (node === undefined) { return }
- let nodeDefinition = getNodeDefinition(node)
- if (nodeDefinition !== undefined) {
- let object = {
- type: node.type,
- name: node.name,
- code: node.code,
- config: node.config
- }
-
- /* Children Nodes */
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
-
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (node[property.name] !== undefined) {
- object[property.name] = redirectReferenceParents(node[property.name])
- }
- previousPropertyName = property.name
+ function redirectReferenceParents(node) {
+ if (node === undefined) { return }
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ let object = {
+ type: node.type,
+ name: node.name,
+ code: node.code,
+ config: node.config
}
- break
- }
- case 'array': {
- if (node[property.name] !== undefined) {
- let nodePropertyArray = node[property.name]
- object[property.name] = []
- for (let m = 0; m < nodePropertyArray.length; m++) {
- let protocolNode = redirectReferenceParents(nodePropertyArray[m])
- if (protocolNode !== undefined) {
- object[property.name].push(protocolNode)
+
+ /* Children Nodes */
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] !== undefined) {
+ object[property.name] = redirectReferenceParents(node[property.name])
+ }
+ previousPropertyName = property.name
+ }
+ break
+ }
+ case 'array': {
+ if (node[property.name] !== undefined) {
+ let nodePropertyArray = node[property.name]
+ object[property.name] = []
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ let protocolNode = redirectReferenceParents(nodePropertyArray[m])
+ if (protocolNode !== undefined) {
+ object[property.name].push(protocolNode)
+ }
+ }
+ }
+ break
+ }
+ }
}
- }
}
- break
- }
+
+ object.id = node.id
+
+ object.savedPayload = node.savedPayload
+
+ if (object.savedPayload !== undefined) {
+ if (object.savedPayload.referenceParent !== undefined) {
+ let newId = idConversionMap.get(object.savedPayload.referenceParent.id)
+ if (newId !== undefined) {
+ object.savedPayload.referenceParent.id = newId
+ }
+ }
+ }
+
+ return object
+ }
+ }
+ }
+
+ function getSavedPayload(node) {
+ if (node.payload === undefined) { return }
+ let savedPayload = {
+ position: {
+ x: node.payload.position.x,
+ y: node.payload.position.y
+ },
+ targetPosition: {
+ x: node.payload.targetPosition.x,
+ y: node.payload.targetPosition.y
+ },
+ floatingObject: {
+ isPinned: node.payload.floatingObject.isPinned,
+ isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
+ isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
+ angleToParent: (node.payload.floatingObject.angleToParent),
+ distanceToParent: (node.payload.floatingObject.distanceToParent),
+ arrangementStyle: (node.payload.floatingObject.arrangementStyle)
+ },
+ uiObject: {
+ isRunning: node.payload.uiObject.isRunning,
+ shortcutKey: node.payload.uiObject.shortcutKey
}
- }
}
- object.id = node.id
-
- object.savedPayload = node.savedPayload
-
- if (object.savedPayload !== undefined) {
- if (object.savedPayload.referenceParent !== undefined) {
- let newId = idConversionMap.get(object.savedPayload.referenceParent.id)
- if (newId !== undefined) {
- object.savedPayload.referenceParent.id = newId
+ /* Next for the ones that have a reference parent, we include it */
+ if (node.payload.referenceParent !== undefined) {
+ savedPayload.referenceParent = {
+ type: node.payload.referenceParent.type,
+ name: node.payload.referenceParent.name,
+ id: node.payload.referenceParent.id
+ }
+ } else {
+ /* The referenceParent property can be inherited from the previous saved payload. */
+ if (node.savedPayload !== undefined) {
+ savedPayload.referenceParent = node.savedPayload.referenceParent
}
- }
}
- return object
- }
+ return savedPayload
}
- }
-
- function getSavedPayload (node) {
- if (node.payload === undefined) { return }
- let savedPayload = {
- position: {
- x: node.payload.position.x,
- y: node.payload.position.y
- },
- targetPosition: {
- x: node.payload.targetPosition.x,
- y: node.payload.targetPosition.y
- },
- floatingObject: {
- isPinned: node.payload.floatingObject.isPinned,
- isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
- isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
- angleToParent: (node.payload.floatingObject.angleToParent),
- distanceToParent: (node.payload.floatingObject.distanceToParent),
- arrangementStyle: (node.payload.floatingObject.arrangementStyle)
- },
- uiObject: {
- isRunning: node.payload.uiObject.isRunning,
- shortcutKey: node.payload.uiObject.shortcutKey
- }
- }
-
- /* Next for the ones that have a reference parent, we include it */
- if (node.payload.referenceParent !== undefined) {
- savedPayload.referenceParent = {
- type: node.payload.referenceParent.type,
- name: node.payload.referenceParent.name,
- id: node.payload.referenceParent.id
- }
- } else {
- /* The referenceParent property can be inherited from the previous saved payload. */
- if (node.savedPayload !== undefined) {
- savedPayload.referenceParent = node.savedPayload.referenceParent
- }
- }
-
- return savedPayload
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js
index 7b17905dc..99b1d656f 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/NodeDeleter.js
@@ -1,138 +1,138 @@
-function newNodeDeleter () {
- thisObject = {
- deleteWorkspace: deleteWorkspace,
- deleteUIObject: deleteUIObject
- }
-
- return thisObject
-
- function destroyUiObject (node) {
- canvas.floatingSpace.uiObjectConstructor.destroyUiObject(node.payload)
- }
-
- function deleteWorkspace (node, rootNodes) {
- if (node.rootNodes !== undefined) {
- while (node.rootNodes.length > 0) {
- let rootNode = node.rootNodes[0]
- deleteUIObject(rootNode, rootNodes)
- }
+function newNodeDeleter() {
+ thisObject = {
+ deleteWorkspace: deleteWorkspace,
+ deleteUIObject: deleteUIObject
}
- completeDeletion(node, rootNodes)
- destroyUiObject(node)
- cleanNode(node)
- }
+ return thisObject
- function deleteUIObject (node, rootNodes) {
- /* First we restore the reference parent to its default state */
- if (node.payload !== undefined && node.payload.referenceParent !== undefined && node.payload.referenceParent.payload !== undefined && node.payload.referenceParent.payload.uiObject !== undefined) {
- node.payload.referenceParent.payload.uiObject.isShowing = false
+ function destroyUiObject(node) {
+ canvas.floatingSpace.uiObjectConstructor.destroyUiObject(node.payload)
}
- let nodeDefinition = getNodeDefinition (node)
- if (nodeDefinition !== undefined) {
- /* Remove all of its own children nodes. */
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
-
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (node[property.name] !== undefined) {
- deleteUIObject(node[property.name], rootNodes)
- }
- previousPropertyName = property.name
- }
+ function deleteWorkspace(node, rootNodes) {
+ if (node.rootNodes !== undefined) {
+ while (node.rootNodes.length > 0) {
+ let rootNode = node.rootNodes[0]
+ deleteUIObject(rootNode, rootNodes)
}
- break
- case 'array': {
- let nodePropertyArray = node[property.name]
- if (nodePropertyArray !== undefined) {
- while (nodePropertyArray.length > 0) {
- deleteUIObject(nodePropertyArray[0], rootNodes)
- }
- }
- }
- break
- }
}
- }
- /* Remove node from parent */
- if (node.payload !== undefined) {
- if (node.payload.parentNode !== undefined) {
- let parentNodeDefinition = getNodeDefinition (node.payload.parentNode)
- if (parentNodeDefinition !== undefined) {
- if (parentNodeDefinition.properties !== undefined) {
- for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
- let property = parentNodeDefinition.properties[i]
- if (nodeDefinition.propertyNameAtParent === property.name) {
- switch (property.type) {
- case 'node': {
- node.payload.parentNode[property.name] = undefined
- }
- break
- case 'array': {
- let nodePropertyArray = node.payload.parentNode[property.name]
- if (nodePropertyArray !== undefined) {
- for (let j = 0; j < nodePropertyArray.length; j++) {
- let arrayItem = nodePropertyArray[j]
- if (arrayItem.id === node.id) {
- /* If this object is chained to the ones of the same type we need to give the next in the chain the reference to the current chain parent */
- if (nodeDefinition.chainedToSameType === true) {
- if (j < nodePropertyArray.length - 1) {
- let nextArrayItem = nodePropertyArray[j + 1]
- nextArrayItem.payload.chainParent = node.payload.chainParent
- }
+ completeDeletion(node, rootNodes)
+ destroyUiObject(node)
+ cleanNode(node)
+ }
+
+ function deleteUIObject(node, rootNodes) {
+ /* First we restore the reference parent to its default state */
+ if (node.payload !== undefined && node.payload.referenceParent !== undefined && node.payload.referenceParent.payload !== undefined && node.payload.referenceParent.payload.uiObject !== undefined) {
+ node.payload.referenceParent.payload.uiObject.isShowing = false
+ }
+
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ /* Remove all of its own children nodes. */
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] !== undefined) {
+ deleteUIObject(node[property.name], rootNodes)
+ }
+ previousPropertyName = property.name
}
-
- nodePropertyArray.splice(j, 1)
- }
}
- }
+ break
+ case 'array': {
+ let nodePropertyArray = node[property.name]
+ if (nodePropertyArray !== undefined) {
+ while (nodePropertyArray.length > 0) {
+ deleteUIObject(nodePropertyArray[0], rootNodes)
+ }
+ }
+ }
+ break
}
- break
- }
}
- }
}
- }
+
+ /* Remove node from parent */
+ if (node.payload !== undefined) {
+ if (node.payload.parentNode !== undefined) {
+ let parentNodeDefinition = getNodeDefinition(node.payload.parentNode)
+ if (parentNodeDefinition !== undefined) {
+ if (parentNodeDefinition.properties !== undefined) {
+ for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
+ let property = parentNodeDefinition.properties[i]
+ if (nodeDefinition.propertyNameAtParent === property.name) {
+ switch (property.type) {
+ case 'node': {
+ node.payload.parentNode[property.name] = undefined
+ }
+ break
+ case 'array': {
+ let nodePropertyArray = node.payload.parentNode[property.name]
+ if (nodePropertyArray !== undefined) {
+ for (let j = 0; j < nodePropertyArray.length; j++) {
+ let arrayItem = nodePropertyArray[j]
+ if (arrayItem.id === node.id) {
+ /* If this object is chained to the ones of the same type we need to give the next in the chain the reference to the current chain parent */
+ if (nodeDefinition.chainedToSameType === true) {
+ if (j < nodePropertyArray.length - 1) {
+ let nextArrayItem = nodePropertyArray[j + 1]
+ nextArrayItem.payload.chainParent = node.payload.chainParent
+ }
+ }
+
+ nodePropertyArray.splice(j, 1)
+ }
+ }
+ }
+ }
+ break
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ completeDeletion(node, rootNodes)
+ destroyUiObject(node)
+ cleanNode(node)
}
- }
-
- completeDeletion(node, rootNodes)
- destroyUiObject(node)
- cleanNode(node)
}
- }
- function completeDeletion (node, rootNodes) {
- for (let i = 0; i < rootNodes.length; i++) {
- let rootNode = rootNodes[i]
- if (rootNode.id === node.id) {
- rootNodes.splice(i, 1)
- return
- }
+ function completeDeletion(node, rootNodes) {
+ for (let i = 0; i < rootNodes.length; i++) {
+ let rootNode = rootNodes[i]
+ if (rootNode.id === node.id) {
+ rootNodes.splice(i, 1)
+ return
+ }
+ }
}
- }
- function cleanNode (node) {
- if (node.payload === undefined) { return }
- if (node === undefined) { return }
+ function cleanNode(node) {
+ if (node.payload === undefined) { return }
+ if (node === undefined) { return }
- node.payload.targetPosition.x = undefined
- node.payload.targetPosition.y = undefined
- node.payload.visible = undefined
- node.payload.subTitle = undefined
- node.payload.title = undefined
- node.payload.node = undefined
- node.payload.parentNode = undefined
- node.payload.chainParent = undefined
- node.payload.onMenuItemClick = undefined
- node.handle = undefined
- node.payload = undefined
- node.cleaned = true
- }
+ node.payload.targetPosition.x = undefined
+ node.payload.targetPosition.y = undefined
+ node.payload.visible = undefined
+ node.payload.subTitle = undefined
+ node.payload.title = undefined
+ node.payload.node = undefined
+ node.payload.parentNode = undefined
+ node.payload.chainParent = undefined
+ node.payload.onMenuItemClick = undefined
+ node.handle = undefined
+ node.payload = undefined
+ node.cleaned = true
+ }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js
index 716114348..1b8bdff6e 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/OnFocus.js
@@ -1,56 +1,56 @@
-function newOnFocus () {
- thisObject = {
- getNodeThatIsOnFocus: getNodeThatIsOnFocus
- }
- return thisObject
+function newOnFocus() {
+ thisObject = {
+ getNodeThatIsOnFocus: getNodeThatIsOnFocus
+ }
+ return thisObject
- function getNodeThatIsOnFocus (node) {
- if (node === undefined || node === null) { return }
- if (node.payload === undefined) { return }
- let nodeDefinition = getNodeDefinition(node)
- if (nodeDefinition !== undefined) {
- /* First we ask the question to ourself */
- if (node.payload.uiObject.isOnFocus === true) {
- return node
- }
+ function getNodeThatIsOnFocus(node) {
+ if (node === undefined || node === null) { return }
+ if (node.payload === undefined) { return }
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ /* First we ask the question to ourself */
+ if (node.payload.uiObject.isOnFocus === true) {
+ return node
+ }
- /* Then we check all of its own children nodes. */
- if (node.payload.floatingObject.isCollapsed !== true) {
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
+ /* Then we check all of its own children nodes. */
+ if (node.payload.floatingObject.isCollapsed !== true) {
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (node[property.name] !== undefined) {
- let child
- child = getNodeThatIsOnFocus(node[property.name])
- if (child !== undefined) {
- return child
- }
- }
- previousPropertyName = property.name
- }
- }
- break
- case 'array': {
- let nodePropertyArray = node[property.name]
- if (nodePropertyArray !== undefined) {
- for (let m = 0; m < nodePropertyArray.length; m++) {
- child = getNodeThatIsOnFocus(nodePropertyArray[m])
- if (child !== undefined) {
- return child
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] !== undefined) {
+ let child
+ child = getNodeThatIsOnFocus(node[property.name])
+ if (child !== undefined) {
+ return child
+ }
+ }
+ previousPropertyName = property.name
+ }
+ }
+ break
+ case 'array': {
+ let nodePropertyArray = node[property.name]
+ if (nodePropertyArray !== undefined) {
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ child = getNodeThatIsOnFocus(nodePropertyArray[m])
+ if (child !== undefined) {
+ return child
+ }
+ }
+ }
+ }
+ break
+ }
}
- }
}
- }
- break
}
- }
}
- }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ProtocolNode.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ProtocolNode.js
index a6a533549..7284030f1 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ProtocolNode.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ProtocolNode.js
@@ -1,187 +1,187 @@
-function newProtocolNode () {
- const MODULE_NAME = 'Protocol Node'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newProtocolNode() {
+ const MODULE_NAME = 'Protocol Node'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- thisObject = {
- getProtocolNode: getProtocolNode
- }
- return thisObject
+ thisObject = {
+ getProtocolNode: getProtocolNode
+ }
+ return thisObject
- function getProtocolNode (node, removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, lightingPath) {
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
+ function getProtocolNode(node, removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, lightingPath) {
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
- let nodeDefinition = getNodeDefinition(node)
- if (nodeDefinition !== undefined) {
- if (removePersonalData === true && nodeDefinition.isPersonalData === true) { return }
- let object = {
- type: node.type,
- name: node.name,
- code: node.code,
- config: node.config
- }
-
- /* Children Nodes */
- if (nodeDefinition.properties !== undefined) {
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
-
- switch (property.type) {
- case 'node': {
- if (node[property.name] !== undefined) {
- if (lightingPath === undefined) {
- object[property.name] = getProtocolNode(node[property.name], removePersonalData, parseConfig, includeIds, includeReferencesInSavedPayload, includePayload)
- } else {
- let newLightingPath = getNewLightingPath(lightingPath, node.type, property.childType)
- if (newLightingPath !== undefined) {
- object[property.name] = getProtocolNode(node[property.name], removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
- }
- }
- }
- break
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ if (removePersonalData === true && nodeDefinition.isPersonalData === true) { return }
+ let object = {
+ type: node.type,
+ name: node.name,
+ code: node.code,
+ config: node.config
}
- case 'array': {
- if (node[property.name] !== undefined) {
- if (lightingPath === undefined) {
- let nodePropertyArray = node[property.name]
- object[property.name] = []
- for (let m = 0; m < nodePropertyArray.length; m++) {
- let protocolNode = getProtocolNode(nodePropertyArray[m], removePersonalData, parseConfig, includeIds, includeReferencesInSavedPayload, includePayload)
- if (protocolNode !== undefined) {
- object[property.name].push(protocolNode)
+
+ /* Children Nodes */
+ if (nodeDefinition.properties !== undefined) {
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+
+ switch (property.type) {
+ case 'node': {
+ if (node[property.name] !== undefined) {
+ if (lightingPath === undefined) {
+ object[property.name] = getProtocolNode(node[property.name], removePersonalData, parseConfig, includeIds, includeReferencesInSavedPayload, includePayload)
+ } else {
+ let newLightingPath = getNewLightingPath(lightingPath, node.type, property.childType)
+ if (newLightingPath !== undefined) {
+ object[property.name] = getProtocolNode(node[property.name], removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
+ }
+ }
+ }
+ break
+ }
+ case 'array': {
+ if (node[property.name] !== undefined) {
+ if (lightingPath === undefined) {
+ let nodePropertyArray = node[property.name]
+ object[property.name] = []
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ let protocolNode = getProtocolNode(nodePropertyArray[m], removePersonalData, parseConfig, includeIds, includeReferencesInSavedPayload, includePayload)
+ if (protocolNode !== undefined) {
+ object[property.name].push(protocolNode)
+ }
+ }
+ } else {
+ let newLightingPath = getNewLightingPath(lightingPath, node.type, property.childType)
+ if (newLightingPath !== undefined) {
+ let nodePropertyArray = node[property.name]
+ object[property.name] = []
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ let protocolNode = getProtocolNode(nodePropertyArray[m], removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
+ if (protocolNode !== undefined) {
+ object[property.name].push(protocolNode)
+ }
+ }
+ }
+ }
+ }
+ break
+ }
}
- }
- } else {
- let newLightingPath = getNewLightingPath(lightingPath, node.type, property.childType)
- if (newLightingPath !== undefined) {
- let nodePropertyArray = node[property.name]
- object[property.name] = []
- for (let m = 0; m < nodePropertyArray.length; m++) {
- let protocolNode = getProtocolNode(nodePropertyArray[m], removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
- if (protocolNode !== undefined) {
- object[property.name].push(protocolNode)
- }
- }
- }
}
- }
- break
}
- }
+
+ /* Parent Nodes */
+ if (node.payload.parentNode !== undefined) {
+ let newLightingPath = getNewLightingPath(lightingPath, node.type, node.payload.parentNode.type)
+ if (newLightingPath !== undefined) {
+ object.parentNode = getProtocolNode(node.payload.parentNode, removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
+ }
+ }
+ if (node.payload.referenceParent !== undefined) {
+ let newLightingPath = getNewLightingPath(lightingPath, node.type, node.payload.referenceParent.type)
+ if (newLightingPath !== undefined) {
+ object.referenceParent = getProtocolNode(node.payload.referenceParent, removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
+ }
+ }
+
+ if (parseConfig && object.config !== undefined && nodeDefinition.editors !== undefined) {
+ if (nodeDefinition.editors.config === true) {
+ try {
+ object.config = JSON.parse(node.config)
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> err = ' + err.stack) }
+ if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.type = ' + node.type) }
+ if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.name = ' + node.name) }
+ if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.config = ' + node.config) }
+ if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.id = ' + node.id) }
+ }
+ }
+ }
+
+ if (includeIds) {
+ object.id = node.id
+ }
+ if (includePayload) {
+ object.savedPayload = getSavedPayload(node, includeReferencesInSavedPayload)
+ }
+
+ return object
}
- }
-
- /* Parent Nodes */
- if (node.payload.parentNode !== undefined) {
- let newLightingPath = getNewLightingPath(lightingPath, node.type, node.payload.parentNode.type)
- if (newLightingPath !== undefined) {
- object.parentNode = getProtocolNode(node.payload.parentNode, removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
- }
- }
- if (node.payload.referenceParent !== undefined) {
- let newLightingPath = getNewLightingPath(lightingPath, node.type, node.payload.referenceParent.type)
- if (newLightingPath !== undefined) {
- object.referenceParent = getProtocolNode(node.payload.referenceParent, removePersonalData, parseConfig, includeIds, includePayload, includeReferencesInSavedPayload, newLightingPath)
- }
- }
-
- if (parseConfig && object.config !== undefined && nodeDefinition.editors !== undefined) {
- if (nodeDefinition.editors.config === true) {
- try {
- object.config = JSON.parse(node.config)
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> err = ' + err.stack) }
- if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.type = ' + node.type) }
- if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.name = ' + node.name) }
- if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.config = ' + node.config) }
- if (ERROR_LOG === true) { logger.write('[ERROR] getProtocolNode -> default -> node.id = ' + node.id) }
- }
- }
- }
-
- if (includeIds) {
- object.id = node.id
- }
- if (includePayload) {
- object.savedPayload = getSavedPayload(node, includeReferencesInSavedPayload)
- }
-
- return object
- }
- }
-
- function getNewLightingPath (lightingPath, currentNodeType, nextNodeType) {
- if (lightingPath === undefined) { return }
-
- if (currentNodeType === undefined) { return }
- if (nextNodeType === undefined) { return }
-
- let currentNodePosition = lightingPath.indexOf('->' + currentNodeType + '->')
- let nextNodePosition = lightingPath.indexOf('->' + nextNodeType + '->')
-
- let newLightingPath = lightingPath.substring(nextNodePosition, lightingPath.length + 1)
-
- if (nextNodePosition > currentNodePosition) {
- return newLightingPath
- } else {
- return
- }
- }
-
- function getSavedPayload (node, includeReferencesInSavedPayload) {
- if (node.payload === undefined) { return }
- let savedPayload = {
- position: {
- x: node.payload.position.x,
- y: node.payload.position.y
- },
- targetPosition: {
- x: node.payload.targetPosition.x,
- y: node.payload.targetPosition.y
- },
- floatingObject: {
- isPinned: node.payload.floatingObject.isPinned,
- isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
- isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
- angleToParent: (node.payload.floatingObject.angleToParent),
- distanceToParent: (node.payload.floatingObject.distanceToParent),
- arrangementStyle: (node.payload.floatingObject.arrangementStyle)
- },
- uiObject: {
- isRunning: node.payload.uiObject.isRunning,
- shortcutKey: node.payload.uiObject.shortcutKey
- }
}
- if (node.payload.frame !== undefined) {
- savedPayload.frame = {
- position: {
- x: node.payload.frame.position.x,
- y: node.payload.frame.position.y
- },
- width: node.payload.frame.width,
- height: node.payload.frame.height,
- radius: node.payload.frame.radius
- }
+ function getNewLightingPath(lightingPath, currentNodeType, nextNodeType) {
+ if (lightingPath === undefined) { return }
+
+ if (currentNodeType === undefined) { return }
+ if (nextNodeType === undefined) { return }
+
+ let currentNodePosition = lightingPath.indexOf('->' + currentNodeType + '->')
+ let nextNodePosition = lightingPath.indexOf('->' + nextNodeType + '->')
+
+ let newLightingPath = lightingPath.substring(nextNodePosition, lightingPath.length + 1)
+
+ if (nextNodePosition > currentNodePosition) {
+ return newLightingPath
+ } else {
+ return
+ }
}
- if (includeReferencesInSavedPayload) {
- /* Next for the ones that have a reference parent, we include it */
- if (node.payload.referenceParent !== undefined) {
- savedPayload.referenceParent = {
- type: node.payload.referenceParent.type,
- name: node.payload.referenceParent.name,
- id: node.payload.referenceParent.id
+ function getSavedPayload(node, includeReferencesInSavedPayload) {
+ if (node.payload === undefined) { return }
+ let savedPayload = {
+ position: {
+ x: node.payload.position.x,
+ y: node.payload.position.y
+ },
+ targetPosition: {
+ x: node.payload.targetPosition.x,
+ y: node.payload.targetPosition.y
+ },
+ floatingObject: {
+ isPinned: node.payload.floatingObject.isPinned,
+ isFrozen: (node.payload.floatingObject.isFrozen && node.payload.floatingObject.frozenManually),
+ isCollapsed: (node.payload.floatingObject.isCollapsed && node.payload.floatingObject.collapsedManually),
+ angleToParent: (node.payload.floatingObject.angleToParent),
+ distanceToParent: (node.payload.floatingObject.distanceToParent),
+ arrangementStyle: (node.payload.floatingObject.arrangementStyle)
+ },
+ uiObject: {
+ isRunning: node.payload.uiObject.isRunning,
+ shortcutKey: node.payload.uiObject.shortcutKey
+ }
}
- } else {
- /* The referenceParent property can be inherited from the previous saved payload. */
- if (node.savedPayload !== undefined) {
- savedPayload.referenceParent = node.savedPayload.referenceParent
+
+ if (node.payload.frame !== undefined) {
+ savedPayload.frame = {
+ position: {
+ x: node.payload.frame.position.x,
+ y: node.payload.frame.position.y
+ },
+ width: node.payload.frame.width,
+ height: node.payload.frame.height,
+ radius: node.payload.frame.radius
+ }
}
- }
+
+ if (includeReferencesInSavedPayload) {
+ /* Next for the ones that have a reference parent, we include it */
+ if (node.payload.referenceParent !== undefined) {
+ savedPayload.referenceParent = {
+ type: node.payload.referenceParent.type,
+ name: node.payload.referenceParent.name,
+ id: node.payload.referenceParent.id
+ }
+ } else {
+ /* The referenceParent property can be inherited from the previous saved payload. */
+ if (node.savedPayload !== undefined) {
+ savedPayload.referenceParent = node.savedPayload.referenceParent
+ }
+ }
+ }
+ return savedPayload
}
- return savedPayload
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js
index f9b6b3cd5..5b8ffe35a 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ReferenceAttachDetach.js
@@ -1,37 +1,37 @@
-function newReferenceAttachDetach () {
- thisObject = {
- referenceDetachNode: referenceDetachNode,
- referenceAttachNode: referenceAttachNode
- }
+function newReferenceAttachDetach() {
+ thisObject = {
+ referenceDetachNode: referenceDetachNode,
+ referenceAttachNode: referenceAttachNode
+ }
- return thisObject
+ return thisObject
- function referenceDetachNode (node) {
- completeDetachment(node)
- }
+ function referenceDetachNode(node) {
+ completeDetachment(node)
+ }
- function referenceAttachNode (node, attachToNode, rootNodes) {
- completeAttachment(node, attachToNode)
- }
+ function referenceAttachNode(node, attachToNode, rootNodes) {
+ completeAttachment(node, attachToNode)
+ }
- function completeAttachment (node, attachToNode) {
- node.payload.referenceParent = attachToNode
- }
+ function completeAttachment(node, attachToNode) {
+ node.payload.referenceParent = attachToNode
+ }
- function completeDetachment (node) {
- if (node.payload !== undefined !== undefined) {
- if (node.payload.referenceParent !== undefined) {
- if (node.payload.referenceParent.payload !== undefined) {
- if (node.payload.referenceParent.payload.uiObject !== undefined) {
- node.payload.referenceParent.payload.uiObject.isShowing = false
- }
+ function completeDetachment(node) {
+ if (node.payload !== undefined !== undefined) {
+ if (node.payload.referenceParent !== undefined) {
+ if (node.payload.referenceParent.payload !== undefined) {
+ if (node.payload.referenceParent.payload.uiObject !== undefined) {
+ node.payload.referenceParent.payload.uiObject.isShowing = false
+ }
+ }
+ }
}
- }
- }
- node.payload.referenceParent = undefined
- if (node.savedPayload !== undefined) {
- node.savedPayload.referenceParent = undefined
+ node.payload.referenceParent = undefined
+ if (node.savedPayload !== undefined) {
+ node.savedPayload.referenceParent = undefined
+ }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js
index e552a7c53..1dcf1c978 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SessionFunctions.js
@@ -1,185 +1,185 @@
-function newSessionFunctions () {
- thisObject = {
- runSession: runSession,
- stopSession: stopSession
- }
-
- return thisObject
-
- function runSession (node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, resume, callBackFunction) {
- if (validations(node) !== true) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
+function newSessionFunctions() {
+ thisObject = {
+ runSession: runSession,
+ stopSession: stopSession
}
- let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
- let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
+ return thisObject
- node.payload.uiObject.run(eventsServerClient, callBackFunction)
+ function runSession(node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, resume, callBackFunction) {
+ if (validations(node) !== true) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
- let key = node.name + '-' + node.type + '-' + node.id
+ let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
+ let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
- let lightingPath = '' +
- 'Trading System->' +
- 'Parameters->' +
- 'Base Asset->Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->' +
- 'Exchange Account Asset->Asset->' +
- 'Trading Strategy->' +
- 'Trigger Stage->Trigger On Event->Trigger Off Event->Take Position Event->' +
- 'Announcement->Formula->' +
- 'Open Stage->Initial Definition->Open Execution->' +
- 'Position Size->Position Rate->Formula->' +
- 'Initial Stop->Initial Take Profit->' +
- 'Manage Stage->' +
- 'Managed Stop Loss->Managed Take Profit->' +
- 'Phase->Formula->Next Phase Event->Move To Phase Event->Phase->' +
- 'Situation->Condition->Javascript Code->' +
- 'Close Stage->Close Execution->' +
- 'Announcement->Formula->' +
- 'Execution Algorithm->Market Buy Order->Market Sell Order->Limit Buy Order->Limit Sell Order->' +
- 'Create Order Event->Cancel Order Event->' +
- 'Position Size->Position Rate->Formula->' +
- 'Situation->Condition->Javascript Code->' +
- 'Market Order->Limit Order->' +
- 'Simulated Exchange Events->Simulated Partial Fill->Simulated Actual Rate->Simulated Fees Paid->Formula->'
+ node.payload.uiObject.run(eventsServerClient, callBackFunction)
- let tradingSystem = functionLibraryProtocolNode.getProtocolNode(node.tradingSystemReference.payload.referenceParent, false, true, true, false, false, lightingPath)
+ let key = node.name + '-' + node.type + '-' + node.id
- lightingPath = '' +
- 'Trading Engine->' +
- 'Dynamic Indicators->Indicator Function->Formula->' +
- 'Episode->Current->Last->Previous->' +
- 'Episode Counters->Episode Statistics->' +
- 'Periods->Strategies->Positions->Orders->Hits->Fails->' +
- 'Profit Loss->Hit Ratio->Days->ROI->Anualized Rate Of Return->User Defined Statistic->' +
- 'Formula->' +
- 'Candle->' +
- 'Begin->End->Open->Close->Min->Max->Index->' +
- 'Balance->Base Asset->Quoted Asset->' +
- 'Distance To Event->' +
- 'Trigger On->Trigger Off->Take Position->Close Position->Next Phase->Move To Phase->Create Order->Cancel Order->Close Order->' +
- 'Strategy->' +
- 'Serial Number->Identifier->Begin->End->Strategy Name->Index->Trigger Stage Status->Open Stage Status->Manage Stage Status->Close Stage Status->Status->Begin Rate->End Rate->Situation Name->' +
- 'Strategy Counters->Periods->' +
- 'Position->' +
- 'Serial Number->Identifier->Begin->End->Rate->Size->Open Stage Orders Size->Open Stage Filled Size->Close Stage Orders Size->Close Stage Filled Size->Exit Type->Status->Begin Rate->End Rate->Situation Name->' +
- 'Stop Loss->Stop Loss Stage->Stop Loss Phase->' +
- 'Take Profit->Take Profit Stage->Take Profit Phase->' +
- 'Position Counters->Periods->' +
- 'Position Statistics->Profit Loss->Days->ROI->Hit Fail->User Defined Statistic->' +
- 'Formula->' +
- 'Exchange Orders->Market Buy Orders->Market Sell Orders->Limit Buy Orders->Limit Sell Orders->' +
- 'Market Order->Limit Order->' +
- 'Serial Number->Identifier->Exchange Id->Begin->End->Rate->Size->Exit Type->Status->Order Name->Algorithm Name->Situation Name->' +
- 'Order Counters->Periods->' +
- 'Order Statistics->Size Filled->Percentage Filled->Amount Received->Actual Rate->Fees Paid->Days->User Defined Statistic->'
+ let lightingPath = '' +
+ 'Trading System->' +
+ 'Parameters->' +
+ 'Base Asset->Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->' +
+ 'Exchange Account Asset->Asset->' +
+ 'Trading Strategy->' +
+ 'Trigger Stage->Trigger On Event->Trigger Off Event->Take Position Event->' +
+ 'Announcement->Formula->' +
+ 'Open Stage->Initial Definition->Open Execution->' +
+ 'Position Size->Position Rate->Formula->' +
+ 'Initial Stop->Initial Take Profit->' +
+ 'Manage Stage->' +
+ 'Managed Stop Loss->Managed Take Profit->' +
+ 'Phase->Formula->Next Phase Event->Move To Phase Event->Phase->' +
+ 'Situation->Condition->Javascript Code->' +
+ 'Close Stage->Close Execution->' +
+ 'Announcement->Formula->' +
+ 'Execution Algorithm->Market Buy Order->Market Sell Order->Limit Buy Order->Limit Sell Order->' +
+ 'Create Order Event->Cancel Order Event->' +
+ 'Position Size->Position Rate->Formula->' +
+ 'Situation->Condition->Javascript Code->' +
+ 'Market Order->Limit Order->' +
+ 'Simulated Exchange Events->Simulated Partial Fill->Simulated Actual Rate->Simulated Fees Paid->Formula->'
- let tradingEngine = functionLibraryProtocolNode.getProtocolNode(node.tradingEngineReference.payload.referenceParent, false, true, true, false, false, lightingPath)
+ let tradingSystem = functionLibraryProtocolNode.getProtocolNode(node.tradingSystemReference.payload.referenceParent, false, true, true, false, false, lightingPath)
- lightingPath = '' +
- 'Backtesting Session->Paper Trading Session->Fordward Testing Session->Live Trading Session->' +
- 'Parameters->' +
- 'Session Base Asset->Session Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->Snapshots->User Defined Parameters->' +
- 'Exchange Account Asset->Asset->' +
- 'Social Bots->Telegram Bot->'
+ lightingPath = '' +
+ 'Trading Engine->' +
+ 'Dynamic Indicators->Indicator Function->Formula->' +
+ 'Episode->Current->Last->Previous->' +
+ 'Episode Counters->Episode Statistics->' +
+ 'Periods->Strategies->Positions->Orders->Hits->Fails->' +
+ 'Profit Loss->Hit Ratio->Days->ROI->Anualized Rate Of Return->User Defined Statistic->' +
+ 'Formula->' +
+ 'Candle->' +
+ 'Begin->End->Open->Close->Min->Max->Index->' +
+ 'Balance->Base Asset->Quoted Asset->' +
+ 'Distance To Event->' +
+ 'Trigger On->Trigger Off->Take Position->Close Position->Next Phase->Move To Phase->Create Order->Cancel Order->Close Order->' +
+ 'Strategy->' +
+ 'Serial Number->Identifier->Begin->End->Strategy Name->Index->Trigger Stage Status->Open Stage Status->Manage Stage Status->Close Stage Status->Status->Begin Rate->End Rate->Situation Name->' +
+ 'Strategy Counters->Periods->' +
+ 'Position->' +
+ 'Serial Number->Identifier->Begin->End->Rate->Size->Open Stage Orders Size->Open Stage Filled Size->Close Stage Orders Size->Close Stage Filled Size->Exit Type->Status->Begin Rate->End Rate->Situation Name->' +
+ 'Stop Loss->Stop Loss Stage->Stop Loss Phase->' +
+ 'Take Profit->Take Profit Stage->Take Profit Phase->' +
+ 'Position Counters->Periods->' +
+ 'Position Statistics->Profit Loss->Days->ROI->Hit Fail->User Defined Statistic->' +
+ 'Formula->' +
+ 'Exchange Orders->Market Buy Orders->Market Sell Orders->Limit Buy Orders->Limit Sell Orders->' +
+ 'Market Order->Limit Order->' +
+ 'Serial Number->Identifier->Exchange Id->Begin->End->Rate->Size->Exit Type->Status->Order Name->Algorithm Name->Situation Name->' +
+ 'Order Counters->Periods->' +
+ 'Order Statistics->Size Filled->Percentage Filled->Amount Received->Actual Rate->Fees Paid->Days->User Defined Statistic->'
- let session = functionLibraryProtocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)
+ let tradingEngine = functionLibraryProtocolNode.getProtocolNode(node.tradingEngineReference.payload.referenceParent, false, true, true, false, false, lightingPath)
- let dependencyFilter = functionLibraryDependenciesFilter.createFilter(node.tradingSystemReference.payload.referenceParent)
+ lightingPath = '' +
+ 'Backtesting Session->Paper Trading Session->Fordward Testing Session->Live Trading Session->' +
+ 'Parameters->' +
+ 'Session Base Asset->Session Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->Snapshots->User Defined Parameters->' +
+ 'Exchange Account Asset->Asset->' +
+ 'Social Bots->Telegram Bot->'
- /* Raise event to run the session */
- let event = {
- appSchema: JSON.stringify(APP_SCHEMA_ARRAY),
- session: JSON.stringify(session),
- tradingSystem: JSON.stringify(tradingSystem),
- tradingEngine: JSON.stringify(tradingEngine),
- dependencyFilter: JSON.stringify(dependencyFilter),
- resume: resume
+ let session = functionLibraryProtocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)
+
+ let dependencyFilter = functionLibraryDependenciesFilter.createFilter(node.tradingSystemReference.payload.referenceParent)
+
+ /* Raise event to run the session */
+ let event = {
+ appSchema: JSON.stringify(APP_SCHEMA_ARRAY),
+ session: JSON.stringify(session),
+ tradingSystem: JSON.stringify(tradingSystem),
+ tradingEngine: JSON.stringify(tradingEngine),
+ dependencyFilter: JSON.stringify(dependencyFilter),
+ resume: resume
+ }
+
+ eventsServerClient.raiseEvent(key, 'Run Session', event)
+
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
}
- eventsServerClient.raiseEvent(key, 'Run Session', event)
+ function stopSession(node, functionLibraryProtocolNode, callBackFunction) {
+ if (validations(node) !== true) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
- }
+ let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
+ let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
- function stopSession (node, functionLibraryProtocolNode, callBackFunction) {
- if (validations(node) !== true) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
+ let key = node.name + '-' + node.type + '-' + node.id
+ eventsServerClient.raiseEvent(key, 'Stop Session')
+
+ node.payload.uiObject.stop(callBackFunction)
}
- let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
- let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
+ function validations(node) {
+ if (node.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs a Process Instance parent to be able to run.')
+ return
+ }
- let key = node.name + '-' + node.type + '-' + node.id
- eventsServerClient.raiseEvent(key, 'Stop Session')
+ if (node.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs to be inside a Trading Process Instance.')
+ return
+ }
- node.payload.uiObject.stop(callBackFunction)
- }
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs to be inside a Task.')
+ return
+ }
- function validations (node) {
- if (node.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs a Process Instance parent to be able to run.')
- return
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs to be inside a Task Manager.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs to be inside Exchange Tasks.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs to be inside a Testing or Production Environment.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs to be inside a Network Node.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.uiObject.isRunning !== true) {
+ node.payload.uiObject.setErrorMessage('Session needs a Process Instance parent to be running.')
+ return
+ }
+
+ if (node.tradingSystemReference === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs a child Trading System Reference.')
+ return
+ }
+
+ if (node.tradingEngineReference === undefined) {
+ node.payload.uiObject.setErrorMessage('Session needs a child Trading Engine Reference.')
+ return
+ }
+
+ if (node.tradingSystemReference.payload.referenceParent === undefined) {
+ node.payload.uiObject.setErrorMessage('Trading System Reference needs to reference a Trading System.')
+ return
+ }
+
+ if (node.tradingEngineReference.payload.referenceParent === undefined) {
+ node.payload.uiObject.setErrorMessage('Trading Engine Reference needs to reference a Trading Engine.')
+ return
+ }
+ return true
}
-
- if (node.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs to be inside a Trading Process Instance.')
- return
- }
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs to be inside a Task.')
- return
- }
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs to be inside a Task Manager.')
- return
- }
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs to be inside Exchange Tasks.')
- return
- }
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs to be inside a Testing or Production Environment.')
- return
- }
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs to be inside a Network Node.')
- return
- }
-
- if (node.payload.parentNode.payload.uiObject.isRunning !== true) {
- node.payload.uiObject.setErrorMessage('Session needs a Process Instance parent to be running.')
- return
- }
-
- if (node.tradingSystemReference === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs a child Trading System Reference.')
- return
- }
-
- if (node.tradingEngineReference === undefined) {
- node.payload.uiObject.setErrorMessage('Session needs a child Trading Engine Reference.')
- return
- }
-
- if (node.tradingSystemReference.payload.referenceParent === undefined) {
- node.payload.uiObject.setErrorMessage('Trading System Reference needs to reference a Trading System.')
- return
- }
-
- if (node.tradingEngineReference.payload.referenceParent === undefined) {
- node.payload.uiObject.setErrorMessage('Trading Engine Reference needs to reference a Trading Engine.')
- return
- }
- return true
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js
index 2cd449769..94d7058eb 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/ShortcutKeys.js
@@ -1,55 +1,55 @@
-function newShortcutKeys () {
- thisObject = {
- getNodeByShortcutKey: getNodeByShortcutKey
- }
- return thisObject
+function newShortcutKeys() {
+ thisObject = {
+ getNodeByShortcutKey: getNodeByShortcutKey
+ }
+ return thisObject
- function getNodeByShortcutKey (node, searchingKey) {
- if (node === undefined) { return }
- let nodeDefinition = getNodeDefinition (node)
- if (nodeDefinition !== undefined) {
- /* Check Self first */
- if (node.payload.uiObject.shortcutKey === searchingKey) {
- return node
- }
+ function getNodeByShortcutKey(node, searchingKey) {
+ if (node === undefined) { return }
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ /* Check Self first */
+ if (node.payload.uiObject.shortcutKey === searchingKey) {
+ return node
+ }
- /* Check all of its own children nodes. */
- if (node.payload.floatingObject.isCollapsed !== true) {
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
+ /* Check all of its own children nodes. */
+ if (node.payload.floatingObject.isCollapsed !== true) {
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (node[property.name] !== undefined) {
- let child
- child = getNodeByShortcutKey(node[property.name], searchingKey)
- if (child !== undefined) {
- return child
- }
- }
- previousPropertyName = property.name
- }
- }
- break
- case 'array': {
- let nodePropertyArray = node[property.name]
- if (nodePropertyArray !== undefined) {
- for (let m = 0; m < nodePropertyArray.length; m++) {
- child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey)
- if (child !== undefined) {
- return child
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] !== undefined) {
+ let child
+ child = getNodeByShortcutKey(node[property.name], searchingKey)
+ if (child !== undefined) {
+ return child
+ }
+ }
+ previousPropertyName = property.name
+ }
+ }
+ break
+ case 'array': {
+ let nodePropertyArray = node[property.name]
+ if (nodePropertyArray !== undefined) {
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey)
+ if (child !== undefined) {
+ return child
+ }
+ }
+ }
+ }
+ break
+ }
}
- }
}
- }
- break
}
- }
}
- }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SuperScripts.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SuperScripts.js
index e8e6b8a90..bbb214083 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SuperScripts.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/SuperScripts.js
@@ -1,90 +1,90 @@
-function newSuperScriptsFunctions () {
- thisObject = {
- runSuperScript: runSuperScript
- }
+function newSuperScriptsFunctions() {
+ thisObject = {
+ runSuperScript: runSuperScript
+ }
- return thisObject
+ return thisObject
- function runSuperScript (node, rootNodes, functionLibraryNodeCloning, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter) {
- try {
- let clone = functionLibraryNodeCloning.getNodeClone
- let executionResult = true
- let superAction = node
+ function runSuperScript(node, rootNodes, functionLibraryNodeCloning, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter) {
+ try {
+ let clone = functionLibraryNodeCloning.getNodeClone
+ let executionResult = true
+ let superAction = node
- function setup (templateClone, target, exchange, exchangeNodeType, arrayPropertyName) {
- spawnPosition.x = target.payload.position.x
- spawnPosition.y = target.payload.position.y
+ function setup(templateClone, target, exchange, exchangeNodeType, arrayPropertyName) {
+ spawnPosition.x = target.payload.position.x
+ spawnPosition.y = target.payload.position.y
- if (exchange === undefined) {
- functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, target, target)
- } else {
- let definition = getNodeDefinition (target)
- for (let i = 0; i < definition.properties.length; i++) {
- let property = definition.properties[i]
- if (property.childType === exchangeNodeType) {
- let exchanges = target[property.name]
- if (exchanges === undefined) {
- exchanges = []
- }
- let targetExchange
- for (let j = 0; j < exchanges.length; j++) {
- let thisExchange = exchanges[j]
- if (thisExchange.payload.referenceParent !== undefined) {
- if (thisExchange.payload.referenceParent.id === exchange.id) {
- targetExchange = thisExchange
- }
+ if (exchange === undefined) {
+ functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, target, target)
+ } else {
+ let definition = getNodeDefinition(target)
+ for (let i = 0; i < definition.properties.length; i++) {
+ let property = definition.properties[i]
+ if (property.childType === exchangeNodeType) {
+ let exchanges = target[property.name]
+ if (exchanges === undefined) {
+ exchanges = []
+ }
+ let targetExchange
+ for (let j = 0; j < exchanges.length; j++) {
+ let thisExchange = exchanges[j]
+ if (thisExchange.payload.referenceParent !== undefined) {
+ if (thisExchange.payload.referenceParent.id === exchange.id) {
+ targetExchange = thisExchange
+ }
+ }
+ }
+ if (targetExchange === undefined) {
+ targetExchange = functionLibraryUiObjectsFromNodes.addUIObject(target, exchangeNodeType)
+ targetExchange.payload.referenceParent = exchange
+ }
+ let nodesArray = targetExchange[arrayPropertyName]
+ nodesArray.push(templateClone)
+ functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, targetExchange, targetExchange)
+ }
+ }
}
- }
- if (targetExchange === undefined) {
- targetExchange = functionLibraryUiObjectsFromNodes.addUIObject(target, exchangeNodeType)
- targetExchange.payload.referenceParent = exchange
- }
- let nodesArray = targetExchange[arrayPropertyName]
- nodesArray.push(templateClone)
- functionLibraryUiObjectsFromNodes.createUiObjectFromNode(templateClone, targetExchange, targetExchange)
}
- }
- }
- }
- function deleteNode (node) {
- functionLibraryNodeDeleter.deleteUIObject(node, rootNodes)
- }
+ function deleteNode(node) {
+ functionLibraryNodeDeleter.deleteUIObject(node, rootNodes)
+ }
- /* Validations */
- if (executionResult === true && node.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Super Action node needs a Parent Node.')
- executionResult = false
- }
- if (executionResult === true && node.payload.referenceParent === undefined) {
- node.payload.uiObject.setErrorMessage('Super Action node needs to reference a Master Script Node.')
- executionResult = false
- }
- if (executionResult === true && node.payload.referenceParent.javascriptCode === undefined) {
- node.payload.uiObject.setErrorMessage('Master Script Node needs to have a child Javascript Code Node.')
- executionResult = false
- }
+ /* Validations */
+ if (executionResult === true && node.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Super Action node needs a Parent Node.')
+ executionResult = false
+ }
+ if (executionResult === true && node.payload.referenceParent === undefined) {
+ node.payload.uiObject.setErrorMessage('Super Action node needs to reference a Master Script Node.')
+ executionResult = false
+ }
+ if (executionResult === true && node.payload.referenceParent.javascriptCode === undefined) {
+ node.payload.uiObject.setErrorMessage('Master Script Node needs to have a child Javascript Code Node.')
+ executionResult = false
+ }
- let masterScript = node.payload.referenceParent
+ let masterScript = node.payload.referenceParent
- eval(masterScript.javascriptCode.code)
+ eval(masterScript.javascriptCode.code)
- let masterScriptInstance = newNewMasterScriptInstance()
+ let masterScriptInstance = newNewMasterScriptInstance()
- if (executionResult === true) {
- executionResult = masterScriptInstance.runValidations(superAction, masterScript)
- }
- if (executionResult === true) {
- executionResult = masterScriptInstance.runScript(superAction, masterScript)
- }
- if (executionResult === true) {
- superAction.payload.uiObject.setValue('Execution Completed Successfully')
- } else {
- superAction.payload.uiObject.setValue('Execution Failed')
- }
- } catch (err) {
- superAction.payload.uiObject.setErrorMessage(err.message)
- superAction.payload.uiObject.setValue('Execution Failed')
+ if (executionResult === true) {
+ executionResult = masterScriptInstance.runValidations(superAction, masterScript)
+ }
+ if (executionResult === true) {
+ executionResult = masterScriptInstance.runScript(superAction, masterScript)
+ }
+ if (executionResult === true) {
+ superAction.payload.uiObject.setValue('Execution Completed Successfully')
+ } else {
+ superAction.payload.uiObject.setValue('Execution Failed')
+ }
+ } catch (err) {
+ superAction.payload.uiObject.setErrorMessage(err.message)
+ superAction.payload.uiObject.setValue('Execution Failed')
+ }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js
index 832e7bcd8..db9aa5e3f 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/TaskFunctions.js
@@ -1,228 +1,228 @@
-function newTaskFunctions () {
- thisObject = {
- runTask: runTask,
- stopTask: stopTask,
- runAllTasks: runAllTasks,
- stopAllTasks: stopAllTasks,
- runAllTaskManagers: runAllTaskManagers,
- stopAllTaskManagers: stopAllTaskManagers,
- runAllExchangeTasks: runAllExchangeTasks,
- stopAllExchangeTasks: stopAllExchangeTasks
- }
-
- return thisObject
-
- function runTask (node, functionLibraryProtocolNode, isDebugging, callBackFunction) {
- if (validations(node) !== true) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
+function newTaskFunctions() {
+ thisObject = {
+ runTask: runTask,
+ stopTask: stopTask,
+ runAllTasks: runAllTasks,
+ stopAllTasks: stopAllTasks,
+ runAllTaskManagers: runAllTaskManagers,
+ stopAllTaskManagers: stopAllTaskManagers,
+ runAllExchangeTasks: runAllExchangeTasks,
+ stopAllExchangeTasks: stopAllExchangeTasks
}
- let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
- let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
+ return thisObject
- for (let i = 0; i < node.bot.processes.length; i++) {
- let process = node.bot.processes[i]
- process.payload.uiObject.run(eventsServerClient)
+ function runTask(node, functionLibraryProtocolNode, isDebugging, callBackFunction) {
+ if (validations(node) !== true) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+
+ let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
+ let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
+
+ for (let i = 0; i < node.bot.processes.length; i++) {
+ let process = node.bot.processes[i]
+ process.payload.uiObject.run(eventsServerClient)
+ }
+
+ let taskLightingPath = '->Task->' +
+ 'Sensor Bot Instance->' +
+ 'Indicator Bot Instance->Time Frames Filter->' +
+ 'Trading Bot Instance->' +
+ 'Sensor Process Instance->Indicator Process Instance->Trading Process Instance->' +
+ 'Market Reference->' +
+ 'Key Reference->Exchange Account Key->' +
+ 'Market->Exchange Markets->Crypto Exchange->' +
+ 'Market Base Asset->Market Quoted Asset->Asset->' +
+ 'Backtesting Session->Live Trading Session->Paper Trading Session->Fordward Testing Session->' +
+ 'Process Definition->' +
+ 'Process Output->Output Dataset->Dataset Definition->Product Definition->' +
+ 'Process Dependencies->' +
+ 'Status Dependency->Status Report->Process Definition->' +
+ 'Data Dependency->Dataset Definition->Product Definition->' +
+ 'Record Definition->Record Property->Formula->' +
+ 'Data Building Procedure->' +
+ 'Procedure Initialization->Javascript Code->' +
+ 'Procedure Loop->Javascript Code->' +
+ 'Calculations Procedure->' +
+ 'Procedure Initialization->Javascript Code->' +
+ 'Procedure Loop->Javascript Code->' +
+ 'Status Report->' +
+ 'Execution Finished Event->' +
+ 'Execution Started Event->Execution Finished Event->Process Definition->' +
+ 'Sensor Bot->' +
+ 'Indicator Bot->' +
+ 'Trading Bot->' +
+ 'Data Mine->'
+
+ let taskDefinition = functionLibraryProtocolNode.getProtocolNode(node, false, true, true, false, false, taskLightingPath)
+
+ let networkLightingPath = '->Network->Network Node->' +
+ 'Data Storage->Session Independent Data->Exchange Data Products->' +
+ 'Single Market Data->Data Product->Product Definition->' +
+ 'Data Mining->Testing Environment->Production Environment->' +
+ 'Exchange Tasks->Crypto Exchange->' +
+ 'Task Manager->Task->' +
+ 'Indicator Bot Instance->Sensor Bot Instance->Trading Bot Instance->' +
+ 'Indicator Process Instance->Sensor Process Instance->Trading Process Instance->' +
+ 'Paper Trading Session->Forward Testing Session->Backtesting Session->Live Trading Session->' +
+ 'Market Reference->Market->' +
+ 'Process Definition->'
+
+ let networkDefinition = functionLibraryProtocolNode.getProtocolNode(networkNode.payload.parentNode, false, true, true, false, false, networkLightingPath)
+
+ let event = {
+ taskId: node.id,
+ taskName: node.name,
+ taskDefinition: JSON.stringify(taskDefinition),
+ networkDefinition: JSON.stringify(networkDefinition)
+ }
+
+ if (isDebugging === true) {
+ callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
+ eventsServerClient.raiseEvent('Task Server', 'Debug Task Started', event)
+ return
+ }
+
+ node.payload.uiObject.run(eventsServerClient, callBackFunction)
+ eventsServerClient.raiseEvent('Task Manager', 'Run Task', event)
}
- let taskLightingPath = '->Task->' +
- 'Sensor Bot Instance->' +
- 'Indicator Bot Instance->Time Frames Filter->' +
- 'Trading Bot Instance->' +
- 'Sensor Process Instance->Indicator Process Instance->Trading Process Instance->' +
- 'Market Reference->' +
- 'Key Reference->Exchange Account Key->' +
- 'Market->Exchange Markets->Crypto Exchange->' +
- 'Market Base Asset->Market Quoted Asset->Asset->' +
- 'Backtesting Session->Live Trading Session->Paper Trading Session->Fordward Testing Session->' +
- 'Process Definition->' +
- 'Process Output->Output Dataset->Dataset Definition->Product Definition->' +
- 'Process Dependencies->' +
- 'Status Dependency->Status Report->Process Definition->' +
- 'Data Dependency->Dataset Definition->Product Definition->' +
- 'Record Definition->Record Property->Formula->' +
- 'Data Building Procedure->' +
- 'Procedure Initialization->Javascript Code->' +
- 'Procedure Loop->Javascript Code->' +
- 'Calculations Procedure->' +
- 'Procedure Initialization->Javascript Code->' +
- 'Procedure Loop->Javascript Code->' +
- 'Status Report->' +
- 'Execution Finished Event->' +
- 'Execution Started Event->Execution Finished Event->Process Definition->' +
- 'Sensor Bot->' +
- 'Indicator Bot->' +
- 'Trading Bot->' +
- 'Data Mine->'
+ function stopTask(node, functionLibraryProtocolNode, callBackFunction) {
+ if (validations(node) !== true) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
- let taskDefinition = functionLibraryProtocolNode.getProtocolNode(node, false, true, true, false, false, taskLightingPath)
+ let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
+ let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
- let networkLightingPath = '->Network->Network Node->' +
- 'Data Storage->Session Independent Data->Exchange Data Products->' +
- 'Single Market Data->Data Product->Product Definition->' +
- 'Data Mining->Testing Environment->Production Environment->' +
- 'Exchange Tasks->Crypto Exchange->' +
- 'Task Manager->Task->' +
- 'Indicator Bot Instance->Sensor Bot Instance->Trading Bot Instance->' +
- 'Indicator Process Instance->Sensor Process Instance->Trading Process Instance->' +
- 'Paper Trading Session->Forward Testing Session->Backtesting Session->Live Trading Session->' +
- 'Market Reference->Market->' +
- 'Process Definition->'
+ let event = {
+ taskId: node.id,
+ taskName: node.name
+ }
- let networkDefinition = functionLibraryProtocolNode.getProtocolNode(networkNode.payload.parentNode, false, true, true, false, false, networkLightingPath)
+ node.payload.uiObject.stop(callBackFunction)
+ eventsServerClient.raiseEvent('Task Manager', 'Stop Task', event)
- let event = {
- taskId: node.id,
- taskName: node.name,
- taskDefinition: JSON.stringify(taskDefinition),
- networkDefinition: JSON.stringify(networkDefinition)
+ if (node.bot === undefined) { return }
+ if (node.bot.processes.length === 0) { return }
+
+ for (let i = 0; i < node.bot.processes.length; i++) {
+ let process = node.bot.processes[i]
+ process.payload.uiObject.stop()
+ }
}
- if (isDebugging === true) {
- callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
- eventsServerClient.raiseEvent('Task Server', 'Debug Task Started', event)
- return
+ function validations(node) {
+ if (node.bot === undefined) {
+ node.payload.uiObject.setErrorMessage('Task needs to have a Bot Instance.')
+ return
+ }
+ if (node.bot.processes.length === 0) {
+ node.payload.uiObject.setErrorMessage('Task Bot Instance needs to have al least once Process Instance.')
+ return
+ }
+
+ if (node.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Task needs to be inside a Task Manager.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Task needs to be inside Exchange Tasks.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Task needs to be inside a Testing or Production Environment or a Data Mining node.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Task needs to be inside a Network Node.')
+ return
+ }
+
+ if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
+ node.payload.uiObject.setErrorMessage('Task needs to be inside a Network.')
+ return
+ }
+
+ let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
+ if (loadPropertyFromNodeConfig(networkNode.payload, 'host') === undefined) {
+ node.payload.uiObject.setErrorMessage('Network Node needs to have a valid Host property at its config.')
+ return
+ }
+
+ if (loadPropertyFromNodeConfig(networkNode.payload, 'webPort') === undefined) {
+ node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webPort property at its config.')
+ return
+ }
+
+ if (loadPropertyFromNodeConfig(networkNode.payload, 'webSocketsPort') === undefined) {
+ node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webSocketsPort property at its config.')
+ return
+ }
+
+ return true
}
- node.payload.uiObject.run(eventsServerClient, callBackFunction)
- eventsServerClient.raiseEvent('Task Manager', 'Run Task', event)
- }
+ function runAllTasks(taskManager, functionLibraryProtocolNode) {
+ for (let i = 0; i < taskManager.tasks.length; i++) {
+ let node = taskManager.tasks[i]
+ let menu = node.payload.uiObject.menu
- function stopTask (node, functionLibraryProtocolNode, callBackFunction) {
- if (validations(node) !== true) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
+ menu.internalClick('Run Task')
+ }
}
- let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
- let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(networkNode.id)
+ function stopAllTasks(taskManager, functionLibraryProtocolNode) {
+ for (let i = 0; i < taskManager.tasks.length; i++) {
+ let node = taskManager.tasks[i]
+ let menu = node.payload.uiObject.menu
- let event = {
- taskId: node.id,
- taskName: node.name
+ menu.internalClick('Stop Task')
+ }
}
- node.payload.uiObject.stop(callBackFunction)
- eventsServerClient.raiseEvent('Task Manager', 'Stop Task', event)
+ function runAllTaskManagers(parent, functionLibraryProtocolNode) {
+ for (let i = 0; i < parent.taskManagers.length; i++) {
+ let node = parent.taskManagers[i]
+ let menu = node.payload.uiObject.menu
- if (node.bot === undefined) { return }
- if (node.bot.processes.length === 0) { return }
-
- for (let i = 0; i < node.bot.processes.length; i++) {
- let process = node.bot.processes[i]
- process.payload.uiObject.stop()
- }
- }
-
- function validations (node) {
- if (node.bot === undefined) {
- node.payload.uiObject.setErrorMessage('Task needs to have a Bot Instance.')
- return
- }
- if (node.bot.processes.length === 0) {
- node.payload.uiObject.setErrorMessage('Task Bot Instance needs to have al least once Process Instance.')
- return
+ menu.internalClick('Run All Tasks')
+ menu.internalClick('Run All Tasks')
+ }
}
- if (node.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Task needs to be inside a Task Manager.')
- return
+ function stopAllTaskManagers(parent, functionLibraryProtocolNode) {
+ for (let i = 0; i < parent.taskManagers.length; i++) {
+ let node = parent.taskManagers[i]
+ let menu = node.payload.uiObject.menu
+
+ menu.internalClick('Stop All Tasks')
+ menu.internalClick('Stop All Tasks')
+ }
+ }
+ function runAllExchangeTasks(parent, functionLibraryProtocolNode) {
+ for (let i = 0; i < parent.exchangeTasks.length; i++) {
+ let node = parent.exchangeTasks[i]
+ let menu = node.payload.uiObject.menu
+
+ menu.internalClick('Run All Task Managers')
+ menu.internalClick('Run All Task Managers')
+ }
}
- if (node.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Task needs to be inside Exchange Tasks.')
- return
+ function stopAllExchangeTasks(parent, functionLibraryProtocolNode) {
+ for (let i = 0; i < parent.exchangeTasks.length; i++) {
+ let node = parent.exchangeTasks[i]
+ let menu = node.payload.uiObject.menu
+
+ menu.internalClick('Stop All Task Managers')
+ menu.internalClick('Stop All Task Managers')
+ }
}
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Task needs to be inside a Testing or Production Environment or a Data Mining node.')
- return
- }
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Task needs to be inside a Network Node.')
- return
- }
-
- if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode === undefined) {
- node.payload.uiObject.setErrorMessage('Task needs to be inside a Network.')
- return
- }
-
- let networkNode = node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode
- if (loadPropertyFromNodeConfig(networkNode.payload, 'host') === undefined) {
- node.payload.uiObject.setErrorMessage('Network Node needs to have a valid Host property at its config.')
- return
- }
-
- if (loadPropertyFromNodeConfig(networkNode.payload, 'webPort') === undefined) {
- node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webPort property at its config.')
- return
- }
-
- if (loadPropertyFromNodeConfig(networkNode.payload, 'webSocketsPort') === undefined) {
- node.payload.uiObject.setErrorMessage('Network Node needs to have a valid webSocketsPort property at its config.')
- return
- }
-
- return true
- }
-
- function runAllTasks (taskManager, functionLibraryProtocolNode) {
- for (let i = 0; i < taskManager.tasks.length; i++) {
- let node = taskManager.tasks[i]
- let menu = node.payload.uiObject.menu
-
- menu.internalClick('Run Task')
- }
- }
-
- function stopAllTasks (taskManager, functionLibraryProtocolNode) {
- for (let i = 0; i < taskManager.tasks.length; i++) {
- let node = taskManager.tasks[i]
- let menu = node.payload.uiObject.menu
-
- menu.internalClick('Stop Task')
- }
- }
-
- function runAllTaskManagers (parent, functionLibraryProtocolNode) {
- for (let i = 0; i < parent.taskManagers.length; i++) {
- let node = parent.taskManagers[i]
- let menu = node.payload.uiObject.menu
-
- menu.internalClick('Run All Tasks')
- menu.internalClick('Run All Tasks')
- }
- }
-
- function stopAllTaskManagers (parent, functionLibraryProtocolNode) {
- for (let i = 0; i < parent.taskManagers.length; i++) {
- let node = parent.taskManagers[i]
- let menu = node.payload.uiObject.menu
-
- menu.internalClick('Stop All Tasks')
- menu.internalClick('Stop All Tasks')
- }
- }
- function runAllExchangeTasks (parent, functionLibraryProtocolNode) {
- for (let i = 0; i < parent.exchangeTasks.length; i++) {
- let node = parent.exchangeTasks[i]
- let menu = node.payload.uiObject.menu
-
- menu.internalClick('Run All Task Managers')
- menu.internalClick('Run All Task Managers')
- }
- }
-
- function stopAllExchangeTasks (parent, functionLibraryProtocolNode) {
- for (let i = 0; i < parent.exchangeTasks.length; i++) {
- let node = parent.exchangeTasks[i]
- let menu = node.payload.uiObject.menu
-
- menu.internalClick('Stop All Task Managers')
- menu.internalClick('Stop All Task Managers')
- }
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js
index c852cb93f..10edaa3a4 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/UiObjectsFromNodes.js
@@ -1,605 +1,605 @@
-function newUiObjectsFromNodes () {
- thisObject = {
- runTasks: runTasks,
- runSessions: runSessions,
- recreateWorkspace: recreateWorkspace,
- tryToConnectChildrenWithReferenceParents: tryToConnectChildrenWithReferenceParents,
- createUiObjectFromNode: createUiObjectFromNode,
- addUIObject: addUIObject,
- addMissingChildren: addMissingChildren
- }
-
- let mapOfReferenceChildren = new Map()
- let mapOfNodes
- let tasksToRun
- let sessionsToRun
-
- return thisObject
-
- function recreateWorkspace (node, callBackFunction) {
- mapOfNodes = new Map()
- tasksToRun = []
- sessionsToRun = []
-
- addIncludedNodes()
-
- function addIncludedNodes () {
- let blobService = newFileStorage()
-
- // if (node.config === undefined) {
- node.config = '{ \n"includeDataMines": ["Masters", "Sparta", "Masters-Trading"],\n"includeTradingSystems": ["Sparta-WHB-BTC-USDT", "Example-ETH-USDT", "Sparta-BRR-BTC-USDT"],\n"includeSuperScripts": ["Masters"]\n }'
- // }
-
- let config = JSON.parse(node.config)
- let includeDataMines = config.includeDataMines
- let includeTradingSystems = config.includeTradingSystems
- let includeSuperScripts = config.includeSuperScripts
-
- let totalIncluded = 0
-
- for (let i = 0; i < includeDataMines.length; i++) {
- let name = includeDataMines[i]
- blobService.getFileFromHost('DataMines' + '/' + name, onFileReceived, true)
- function onFileReceived (err, text, response) {
- if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
- return
- }
- let receivedNode = JSON.parse(text)
- for (let i = 0; i < node.rootNodes.length; i++) {
- let rootNode = node.rootNodes[i]
- if (rootNode.type === 'Data Mine') {
- if (rootNode.config !== undefined) {
- let config = JSON.parse(rootNode.config)
- if (config.name === name) {
- rootNodes.splice(i, 1)
- }
- }
- }
- }
- receivedNode.isIncluded = true
- node.rootNodes.push(receivedNode)
- totalIncluded++
- if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
- addUserDefinedNodes()
- }
- }
- }
-
- for (let i = 0; i < includeTradingSystems.length; i++) {
- let name = includeTradingSystems[i]
- blobService.getFileFromHost('TradingSystems' + '/' + name, onFileReceived, true)
- function onFileReceived (err, text, response) {
- if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
- return
- }
- let receivedNode = JSON.parse(text)
- for (let i = 0; i < node.rootNodes.length; i++) {
- let rootNode = node.rootNodes[i]
- if (rootNode.type === 'Trading System') {
- if (rootNode.config !== undefined) {
- let config = JSON.parse(rootNode.config)
- if (config.name === name) {
- rootNodes.splice(i, 1)
- }
- }
- }
- }
- receivedNode.isIncluded = true
- node.rootNodes.push(receivedNode)
- totalIncluded++
- if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
- addUserDefinedNodes()
- }
- }
- }
-
- for (let i = 0; i < includeSuperScripts.length; i++) {
- let name = includeSuperScripts[i]
- blobService.getFileFromHost('SuperScripts' + '/' + name, onFileReceived, true)
- function onFileReceived (err, text, response) {
- if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
- return
- }
- let receivedNode = JSON.parse(text)
- for (let i = 0; i < node.rootNodes.length; i++) {
- let rootNode = node.rootNodes[i]
- if (rootNode.type === 'Super Scripts') {
- if (rootNode.config !== undefined) {
- let config = JSON.parse(rootNode.config)
- if (config.name === name) {
- rootNodes.splice(i, 1)
- }
- }
- }
- }
- receivedNode.isIncluded = true
- node.rootNodes.push(receivedNode)
- totalIncluded++
- if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
- addUserDefinedNodes()
- }
- }
- }
+function newUiObjectsFromNodes() {
+ thisObject = {
+ runTasks: runTasks,
+ runSessions: runSessions,
+ recreateWorkspace: recreateWorkspace,
+ tryToConnectChildrenWithReferenceParents: tryToConnectChildrenWithReferenceParents,
+ createUiObjectFromNode: createUiObjectFromNode,
+ addUIObject: addUIObject,
+ addMissingChildren: addMissingChildren
}
- function addUserDefinedNodes () {
- /* Create the workspace UI OBject and then continue with the root nodes. */
- createUiObject(false, 'Workspace', node.name, node, undefined, undefined, 'Workspace')
- if (node.rootNodes !== undefined) {
- for (let i = 0; i < node.rootNodes.length; i++) {
- let rootNode = node.rootNodes[i]
- createUiObjectFromNode(rootNode, undefined, undefined)
- }
- }
+ let mapOfReferenceChildren = new Map()
+ let mapOfNodes
+ let tasksToRun
+ let sessionsToRun
- tryToConnectChildrenWithReferenceParents()
+ return thisObject
- if (callBackFunction !== undefined) {
- callBackFunction() // The recreation of the workspace is complete
- }
- }
- }
+ function recreateWorkspace(node, callBackFunction) {
+ mapOfNodes = new Map()
+ tasksToRun = []
+ sessionsToRun = []
- function runTasks () {
- for (let i = 0; i < tasksToRun.length; i++) {
- let node = tasksToRun[i]
- node.payload.uiObject.menu.internalClick('Run Task')
- }
- tasksToRun = undefined
- }
+ addIncludedNodes()
- function runSessions () {
- for (let i = 0; i < sessionsToRun.length; i++) {
- let node = sessionsToRun[i]
- node.payload.uiObject.menu.internalClick('Run Session')
- }
- sessionsToRun = undefined
- }
+ function addIncludedNodes() {
+ let blobService = newFileStorage()
- function tryToConnectChildrenWithReferenceParents () {
- /* We reconstruct here the reference relationships. */
- for (const [key, node] of mapOfNodes) {
- if (node.payload === undefined) { continue }
- if (node.payload.referenceParent !== undefined) {
- if (node.payload.referenceParent.cleaned === true) {
- node.payload.referenceParent = mapOfNodes.get(node.payload.referenceParent.id)
- continue // We were referencing a deleted node, so we replace it potentially with a newly created one.
- } else {
- continue // In this case the reference is already good.
- }
- }
- if (node.savedPayload !== undefined) {
- if (node.savedPayload.referenceParent !== undefined) { // these are children recreated
- node.payload.referenceParent = mapOfNodes.get(node.savedPayload.referenceParent.id)
- }
- }
- }
- }
+ // if (node.config === undefined) {
+ node.config = '{ \n"includeDataMines": ["Masters", "Sparta", "Masters-Trading"],\n"includeTradingSystems": ["Sparta-WHB-BTC-USDT", "Example-ETH-USDT", "Sparta-BRR-BTC-USDT"],\n"includeSuperScripts": ["Masters"]\n }'
+ // }
- function migrateCodeToConfig (node, nodeDefinition) {
- /* Code needed to Migrante from Beta 5 to Beta a Workspace */
- if (nodeDefinition.editors !== undefined) {
- if (nodeDefinition.editors.config === true) {
- if (node.code !== undefined) {
- node.config = node.code
- node.code = undefined
- }
- }
- }
- }
+ let config = JSON.parse(node.config)
+ let includeDataMines = config.includeDataMines
+ let includeTradingSystems = config.includeTradingSystems
+ let includeSuperScripts = config.includeSuperScripts
- function createUiObjectFromNode (node, parentNode, chainParent, positionOffset) {
- /* Code needed to Migrante from Beta 5 to Beta 6 a Trading System
- if (node.type === 'Take Profit') {
- node.type = 'Managed Take Profit'
- }
- if (node.type === 'Stop') {
- node.type = 'Managed Stop Loss'
- }
- */
+ let totalIncluded = 0
- /* Get node definition */
- let nodeDefinition = getNodeDefinition(node)
- if (nodeDefinition !== undefined) {
- migrateCodeToConfig(node, nodeDefinition)
-
- /* Resolve Initial Values */
- if (nodeDefinition.initialValues !== undefined) {
- if (nodeDefinition.initialValues.code !== undefined) {
- if (node.code === undefined) {
- node.code = nodeDefinition.initialValues.code
- }
- }
- if (nodeDefinition.initialValues.config !== undefined) {
- if (node.config === undefined) {
- node.config = nodeDefinition.initialValues.config
- }
- }
- }
-
- /* For the cases where an node is not chained to its parent but to the one at the parent before it at its collection */
- if (nodeDefinition.chainedToSameType === true) {
- if (parentNode !== undefined) {
- let parentNodeDefinition = getNodeDefinition(parentNode)
- if (parentNodeDefinition !== undefined) {
- if (parentNodeDefinition.properties !== undefined) {
- for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
- let property = parentNodeDefinition.properties[i]
- if (property.childType === node.type) {
- if (property.type === 'array') {
- if (parentNode[property.name] !== undefined) {
- if (parentNode[property.name].length > 1) {
- let nodeChildren = parentNode[property.name]
- for (let j = 0; j < nodeChildren.length; j++) {
- if (node.id === nodeChildren[j].id) {
- if (j > 0) {
- chainParent = nodeChildren[j - 1]
+ for (let i = 0; i < includeDataMines.length; i++) {
+ let name = includeDataMines[i]
+ blobService.getFileFromHost('DataMines' + '/' + name, onFileReceived, true)
+ function onFileReceived(err, text, response) {
+ if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
+ return
+ }
+ let receivedNode = JSON.parse(text)
+ for (let i = 0; i < node.rootNodes.length; i++) {
+ let rootNode = node.rootNodes[i]
+ if (rootNode.type === 'Data Mine') {
+ if (rootNode.config !== undefined) {
+ let config = JSON.parse(rootNode.config)
+ if (config.name === name) {
+ rootNodes.splice(i, 1)
+ }
}
- }
}
- }
+ }
+ receivedNode.isIncluded = true
+ node.rootNodes.push(receivedNode)
+ totalIncluded++
+ if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
+ addUserDefinedNodes()
}
- }
}
- }
}
- }
- }
- }
- /* Create Self */
- createUiObject(false, node.type, node.name, node, parentNode, chainParent, node.type, positionOffset)
- /* Create Children */
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
- if (node[property.name] !== undefined) {
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- createUiObjectFromNode(node[property.name], node, node, positionOffset)
- previousPropertyName = property.name
+ for (let i = 0; i < includeTradingSystems.length; i++) {
+ let name = includeTradingSystems[i]
+ blobService.getFileFromHost('TradingSystems' + '/' + name, onFileReceived, true)
+ function onFileReceived(err, text, response) {
+ if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
+ return
+ }
+ let receivedNode = JSON.parse(text)
+ for (let i = 0; i < node.rootNodes.length; i++) {
+ let rootNode = node.rootNodes[i]
+ if (rootNode.type === 'Trading System') {
+ if (rootNode.config !== undefined) {
+ let config = JSON.parse(rootNode.config)
+ if (config.name === name) {
+ rootNodes.splice(i, 1)
+ }
+ }
+ }
+ }
+ receivedNode.isIncluded = true
+ node.rootNodes.push(receivedNode)
+ totalIncluded++
+ if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
+ addUserDefinedNodes()
+ }
}
- }
- break
- case 'array': {
- let nodePropertyArray = node[property.name]
- for (let m = 0; m < nodePropertyArray.length; m++) {
- let arrayItem = nodePropertyArray[m]
- createUiObjectFromNode(arrayItem, node, node, positionOffset)
+ }
+
+ for (let i = 0; i < includeSuperScripts.length; i++) {
+ let name = includeSuperScripts[i]
+ blobService.getFileFromHost('SuperScripts' + '/' + name, onFileReceived, true)
+ function onFileReceived(err, text, response) {
+ if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ console.log('Cannot load included Data Mine ' + name + '. The workspace can not be loaded.')
+ return
+ }
+ let receivedNode = JSON.parse(text)
+ for (let i = 0; i < node.rootNodes.length; i++) {
+ let rootNode = node.rootNodes[i]
+ if (rootNode.type === 'Super Scripts') {
+ if (rootNode.config !== undefined) {
+ let config = JSON.parse(rootNode.config)
+ if (config.name === name) {
+ rootNodes.splice(i, 1)
+ }
+ }
+ }
+ }
+ receivedNode.isIncluded = true
+ node.rootNodes.push(receivedNode)
+ totalIncluded++
+ if (totalIncluded === includeDataMines.length + includeTradingSystems.length + includeSuperScripts.length) {
+ addUserDefinedNodes()
+ }
}
- }
- break
}
- } else {
- if (property.type === 'array') {
- node[property.name] = []
- }
- }
}
- }
- }
- }
- function addUIObject (parentNode, type) {
- let object = {
- name: 'New ' + type,
- type: type
- }
-
- let parentNodeDefinition = getNodeDefinition(parentNode)
- if (parentNodeDefinition === undefined) {
- console.log('Cannot addUIOBject from parent of ' + type + ' because that type it is not defined at the APP_SCHEMA.')
- }
- /* Resolve Initial Values */
- let nodeDefinition = getNodeDefinition(object)
-
- if (nodeDefinition === undefined) {
- console.log('Cannot addUIOBject of ' + type + ' because that type it is not defined at the APP_SCHEMA.')
- }
-
- if (nodeDefinition.initialValues !== undefined) {
- if (nodeDefinition.initialValues.code !== undefined) {
- object.code = nodeDefinition.initialValues.code
- }
- }
- if (nodeDefinition.initialValues !== undefined) {
- if (nodeDefinition.initialValues.config !== undefined) {
- object.config = nodeDefinition.initialValues.config
- }
- }
-
- if (nodeDefinition.isHierarchyHead === true) {
- parentNode.rootNodes.push(object)
- createUiObject(true, object.type, object.name, object, parentNode, undefined)
- return object
- }
-
- /* For the cases where an node is not chained to its parent but to the one at the parent before it at its collection */
- let chainParent = parentNode
- if (nodeDefinition.chainedToSameType === true) {
- if (parentNodeDefinition.properties !== undefined) {
- for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
- let property = parentNodeDefinition.properties[i]
- if (property.childType === type) {
- if (property.type === 'array') {
- if (parentNode[property.name] !== undefined) {
- if (parentNode[property.name].length > 0) {
- let nodeChildren = parentNode[property.name]
- chainParent = nodeChildren[nodeChildren.length - 1]
+ function addUserDefinedNodes() {
+ /* Create the workspace UI OBject and then continue with the root nodes. */
+ createUiObject(false, 'Workspace', node.name, node, undefined, undefined, 'Workspace')
+ if (node.rootNodes !== undefined) {
+ for (let i = 0; i < node.rootNodes.length; i++) {
+ let rootNode = node.rootNodes[i]
+ createUiObjectFromNode(rootNode, undefined, undefined)
}
- }
}
- }
- }
- }
- }
- /* Create Empty Arrays for properties of type Array */
- if (nodeDefinition.properties !== undefined) {
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
- if (property.type === 'array') {
- object[property.name] = []
- }
- }
- }
+ tryToConnectChildrenWithReferenceParents()
- 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
- }
- }
- }
-
- /* Connect to Parent */
- if (parentNodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
- let property = parentNodeDefinition.properties[i]
- if (property.childType === type) {
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- parentNode[property.name] = object
- previousPropertyName = property.name
- }
+ if (callBackFunction !== undefined) {
+ callBackFunction() // The recreation of the workspace is complete
}
- break
- case 'array': {
- if (parentNode[property.name] === undefined) {
- parentNode[property.name] = []
- }
- if (property.maxItems !== undefined) {
- if (parentNode[property.name].length < property.maxItems) {
- parentNode[property.name].push(object)
+ }
+ }
+
+ function runTasks() {
+ for (let i = 0; i < tasksToRun.length; i++) {
+ let node = tasksToRun[i]
+ node.payload.uiObject.menu.internalClick('Run Task')
+ }
+ tasksToRun = undefined
+ }
+
+ function runSessions() {
+ for (let i = 0; i < sessionsToRun.length; i++) {
+ let node = sessionsToRun[i]
+ node.payload.uiObject.menu.internalClick('Run Session')
+ }
+ sessionsToRun = undefined
+ }
+
+ function tryToConnectChildrenWithReferenceParents() {
+ /* We reconstruct here the reference relationships. */
+ for (const [key, node] of mapOfNodes) {
+ if (node.payload === undefined) { continue }
+ if (node.payload.referenceParent !== undefined) {
+ if (node.payload.referenceParent.cleaned === true) {
+ node.payload.referenceParent = mapOfNodes.get(node.payload.referenceParent.id)
+ continue // We were referencing a deleted node, so we replace it potentially with a newly created one.
} else {
- return // Object can not be created.
+ continue // In this case the reference is already good.
}
- } else {
- parentNode[property.name].push(object)
- }
}
- break
- }
- }
- }
- }
-
- createUiObject(true, object.type, object.name, object, parentNode, chainParent)
-
- /* Auto Add more Children */
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
-
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (property.autoAdd === true) {
- addUIObject(object, property.childType)
- previousPropertyName = property.name
- }
+ if (node.savedPayload !== undefined) {
+ if (node.savedPayload.referenceParent !== undefined) { // these are children recreated
+ node.payload.referenceParent = mapOfNodes.get(node.savedPayload.referenceParent.id)
+ }
}
- }
- break
- case 'array': {
- if (property.autoAdd === true) {
- if (object[property.name] === undefined) {
- object[property.name] = []
- }
- addUIObject(object, property.childType)
+ }
+ }
+
+ function migrateCodeToConfig(node, nodeDefinition) {
+ /* Code needed to Migrante from Beta 5 to Beta a Workspace */
+ if (nodeDefinition.editors !== undefined) {
+ if (nodeDefinition.editors.config === true) {
+ if (node.code !== undefined) {
+ node.config = node.code
+ node.code = undefined
+ }
}
- }
- break
}
- }
}
- return object
- }
+ function createUiObjectFromNode(node, parentNode, chainParent, positionOffset) {
+ /* Code needed to Migrante from Beta 5 to Beta 6 a Trading System
+ if (node.type === 'Take Profit') {
+ node.type = 'Managed Take Profit'
+ }
+ if (node.type === 'Stop') {
+ node.type = 'Managed Stop Loss'
+ }
+ */
- function addMissingChildren (node) {
- let nodeDefinition = getNodeDefinition(node)
+ /* Get node definition */
+ let nodeDefinition = getNodeDefinition(node)
+ if (nodeDefinition !== undefined) {
+ migrateCodeToConfig(node, nodeDefinition)
- /* Connect to Parent */
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
- if (property.type === 'node') {
- if (property.name !== previousPropertyName) {
- if (node[property.name] === undefined) {
- addUIObject(node, property.childType)
- previousPropertyName = property.name
+ /* Resolve Initial Values */
+ if (nodeDefinition.initialValues !== undefined) {
+ if (nodeDefinition.initialValues.code !== undefined) {
+ if (node.code === undefined) {
+ node.code = nodeDefinition.initialValues.code
+ }
+ }
+ if (nodeDefinition.initialValues.config !== undefined) {
+ if (node.config === undefined) {
+ node.config = nodeDefinition.initialValues.config
+ }
+ }
+ }
+
+ /* For the cases where an node is not chained to its parent but to the one at the parent before it at its collection */
+ if (nodeDefinition.chainedToSameType === true) {
+ if (parentNode !== undefined) {
+ let parentNodeDefinition = getNodeDefinition(parentNode)
+ if (parentNodeDefinition !== undefined) {
+ if (parentNodeDefinition.properties !== undefined) {
+ for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
+ let property = parentNodeDefinition.properties[i]
+ if (property.childType === node.type) {
+ if (property.type === 'array') {
+ if (parentNode[property.name] !== undefined) {
+ if (parentNode[property.name].length > 1) {
+ let nodeChildren = parentNode[property.name]
+ for (let j = 0; j < nodeChildren.length; j++) {
+ if (node.id === nodeChildren[j].id) {
+ if (j > 0) {
+ chainParent = nodeChildren[j - 1]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ /* Create Self */
+ createUiObject(false, node.type, node.name, node, parentNode, chainParent, node.type, positionOffset)
+
+ /* Create Children */
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+ if (node[property.name] !== undefined) {
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ createUiObjectFromNode(node[property.name], node, node, positionOffset)
+ previousPropertyName = property.name
+ }
+ }
+ break
+ case 'array': {
+ let nodePropertyArray = node[property.name]
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ let arrayItem = nodePropertyArray[m]
+ createUiObjectFromNode(arrayItem, node, node, positionOffset)
+ }
+ }
+ break
+ }
+ } else {
+ if (property.type === 'array') {
+ node[property.name] = []
+ }
+ }
+ }
}
- }
}
- }
- }
- }
-
- function createUiObject (userAddingNew, uiObjectType, name, node, parentNode, chainParent, title, positionOffset) {
- let payload = {}
-
- /* Mechanism related to keeping references when cloning */
- if (node.id === undefined) {
- node.id = newUniqueId()
- } else {
- let testNode = mapOfNodes.get(node.id)
- if (testNode !== undefined && testNode.cleaned !== true) {
- node.id = newUniqueId()
- }
}
- /* Default Naming */
- if (name === '' || name === undefined) { name = 'My ' + uiObjectType }
-
- /* If we are creating this object as the result of restoring a backup, share or clone, we will bring some of the saved properties to the new running instance. */
- if (userAddingNew === false && uiObjectType !== 'Workspace') {
- /* This following info can not be missing. */
- if (node.savedPayload === undefined) {
- console.log('Node ' + node.type + ' without savedPayload.', node)
- return
- }
- if (node.savedPayload.position === undefined) {
- console.log('Node ' + node.type + ' without savedPayload.position.', node)
- return
- }
- if (node.savedPayload.targetPosition === undefined) {
- console.log('Node ' + node.type + ' without savedPayload.targetPosition.', node)
- return
- }
-
- /* If there is not a position offset, which happens when we are dropping a node into the designer, we create a cero vector then. */
- if (positionOffset === undefined) {
- positionOffset = {
- x: 0,
- y: 0
+ function addUIObject(parentNode, type) {
+ let object = {
+ name: 'New ' + type,
+ type: type
}
- }
- /* Adding the offset to the saved positions. */
- node.savedPayload.targetPosition.x = node.savedPayload.targetPosition.x + positionOffset.x
- node.savedPayload.targetPosition.y = node.savedPayload.targetPosition.y + positionOffset.y
- node.savedPayload.position.x = node.savedPayload.position.x + positionOffset.x
- node.savedPayload.position.y = node.savedPayload.position.y + positionOffset.y
-
- /* Transferring the saved payload properties into the running instance being created. */
- payload.targetPosition = {
- x: node.savedPayload.targetPosition.x,
- y: node.savedPayload.targetPosition.y
- }
- node.savedPayload.targetPosition = undefined
-
- /* Reference children connection to parents */
- if (node.savedPayload.referenceParent !== undefined) {
- payload.referenceParent = mapOfNodes.get(node.savedPayload.referenceParent.id)
-
- if (payload.referenceParent !== undefined) {
- mapOfReferenceChildren.set(node.id, node)
+ let parentNodeDefinition = getNodeDefinition(parentNode)
+ if (parentNodeDefinition === undefined) {
+ console.log('Cannot addUIOBject from parent of ' + type + ' because that type it is not defined at the APP_SCHEMA.')
}
- }
+ /* Resolve Initial Values */
+ let nodeDefinition = getNodeDefinition(object)
+
+ if (nodeDefinition === undefined) {
+ console.log('Cannot addUIOBject of ' + type + ' because that type it is not defined at the APP_SCHEMA.')
+ }
+
+ if (nodeDefinition.initialValues !== undefined) {
+ if (nodeDefinition.initialValues.code !== undefined) {
+ object.code = nodeDefinition.initialValues.code
+ }
+ }
+ if (nodeDefinition.initialValues !== undefined) {
+ if (nodeDefinition.initialValues.config !== undefined) {
+ object.config = nodeDefinition.initialValues.config
+ }
+ }
+
+ if (nodeDefinition.isHierarchyHead === true) {
+ parentNode.rootNodes.push(object)
+ createUiObject(true, object.type, object.name, object, parentNode, undefined)
+ return object
+ }
+
+ /* For the cases where an node is not chained to its parent but to the one at the parent before it at its collection */
+ let chainParent = parentNode
+ if (nodeDefinition.chainedToSameType === true) {
+ if (parentNodeDefinition.properties !== undefined) {
+ for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
+ let property = parentNodeDefinition.properties[i]
+ if (property.childType === type) {
+ if (property.type === 'array') {
+ if (parentNode[property.name] !== undefined) {
+ if (parentNode[property.name].length > 0) {
+ let nodeChildren = parentNode[property.name]
+ chainParent = nodeChildren[nodeChildren.length - 1]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* Create Empty Arrays for properties of type Array */
+ if (nodeDefinition.properties !== undefined) {
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+ if (property.type === 'array') {
+ object[property.name] = []
+ }
+ }
+ }
+
+ 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
+ }
+ }
+ }
+
+ /* Connect to Parent */
+ if (parentNodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < parentNodeDefinition.properties.length; i++) {
+ let property = parentNodeDefinition.properties[i]
+ if (property.childType === type) {
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ parentNode[property.name] = object
+ previousPropertyName = property.name
+ }
+ }
+ break
+ case 'array': {
+ if (parentNode[property.name] === undefined) {
+ parentNode[property.name] = []
+ }
+ if (property.maxItems !== undefined) {
+ if (parentNode[property.name].length < property.maxItems) {
+ parentNode[property.name].push(object)
+ } else {
+ return // Object can not be created.
+ }
+ } else {
+ parentNode[property.name].push(object)
+ }
+ }
+ break
+ }
+ }
+ }
+ }
+
+ createUiObject(true, object.type, object.name, object, parentNode, chainParent)
+
+ /* Auto Add more Children */
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (property.autoAdd === true) {
+ addUIObject(object, property.childType)
+ previousPropertyName = property.name
+ }
+ }
+ }
+ break
+ case 'array': {
+ if (property.autoAdd === true) {
+ if (object[property.name] === undefined) {
+ object[property.name] = []
+ }
+ addUIObject(object, property.childType)
+ }
+ }
+ break
+ }
+ }
+ }
+
+ return object
}
- /* If we are adding a new object, then we set the initial values for position and targetPosition */
- if (userAddingNew === true || uiObjectType === 'Workspace') {
- /* Workspace allways to the spawn position */
- if (uiObjectType === 'Workspace') {
- payload.position = {
- x: spawnPosition.x,
- y: spawnPosition.y
- }
- }
+ function addMissingChildren(node) {
+ let nodeDefinition = getNodeDefinition(node)
- /* Chain parent pointing to the position of the chain parent if defined. */
- if (chainParent === undefined) {
- payload.targetPosition = {
- x: spawnPosition.x,
- y: spawnPosition.y
+ /* Connect to Parent */
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+ if (property.type === 'node') {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] === undefined) {
+ addUIObject(node, property.childType)
+ previousPropertyName = property.name
+ }
+ }
+ }
+ }
}
- } else {
- payload.targetPosition = {
- x: chainParent.payload.position.x,
- y: chainParent.payload.position.y
- }
- }
}
- /* Setting the title */
- if (title !== undefined) {
- payload.subTitle = title
- } else {
- payload.subTitle = uiObjectType
- }
+ function createUiObject(userAddingNew, uiObjectType, name, node, parentNode, chainParent, title, positionOffset) {
+ let payload = {}
- payload.visible = true
- payload.title = name
- payload.node = node
- payload.parentNode = parentNode
- payload.chainParent = chainParent
- payload.onMenuItemClick = canvas.designSpace.workspace.onMenuItemClick
-
- node.payload = payload
- node.type = uiObjectType
-
- /*
- Now we copy the possible frame saved to the payload where it can be used. A saved frame stores the position of a a chartingSpace object related to a node.
- This will prevent that if those charting space objects never get activated, that the frame information is lost when the workspace is saved.
- */
- if (node.savedPayload !== undefined) {
- if (node.savedPayload.frame !== undefined) {
- let frame = {
- position: {
- x: 0,
- y: 0
- }
+ /* Mechanism related to keeping references when cloning */
+ if (node.id === undefined) {
+ node.id = newUniqueId()
+ } else {
+ let testNode = mapOfNodes.get(node.id)
+ if (testNode !== undefined && testNode.cleaned !== true) {
+ node.id = newUniqueId()
+ }
}
- frame.position.x = node.savedPayload.frame.position.x
- frame.position.y = node.savedPayload.frame.position.y
- frame.width = node.savedPayload.frame.width
- frame.height = node.savedPayload.frame.height
- frame.radius = node.savedPayload.frame.radius
- saveFrame(payload, frame)
- }
- }
- /* Now we mount the floating object where the UIOBject will be laying on top of */
- canvas.floatingSpace.uiObjectConstructor.createUiObject(userAddingNew, payload)
+ /* Default Naming */
+ if (name === '' || name === undefined) { name = 'My ' + uiObjectType }
- mapOfNodes.set(node.id, node)
+ /* If we are creating this object as the result of restoring a backup, share or clone, we will bring some of the saved properties to the new running instance. */
+ if (userAddingNew === false && uiObjectType !== 'Workspace') {
+ /* This following info can not be missing. */
+ if (node.savedPayload === undefined) {
+ console.log('Node ' + node.type + ' without savedPayload.', node)
+ return
+ }
+ if (node.savedPayload.position === undefined) {
+ console.log('Node ' + node.type + ' without savedPayload.position.', node)
+ return
+ }
+ if (node.savedPayload.targetPosition === undefined) {
+ console.log('Node ' + node.type + ' without savedPayload.targetPosition.', node)
+ return
+ }
- /* Check if there are tasks to run */
- if (userAddingNew === false && uiObjectType === 'Task' && node.savedPayload !== undefined) {
- if (node.savedPayload.uiObject.isRunning === true) {
- if (node.payload.parentNode !== undefined) {
- if (tasksToRun !== undefined) { // it might be undefined when you are spawning a task that was running while backed up
- tasksToRun.push(node)
- }
+ /* If there is not a position offset, which happens when we are dropping a node into the designer, we create a cero vector then. */
+ if (positionOffset === undefined) {
+ positionOffset = {
+ x: 0,
+ y: 0
+ }
+ }
+
+ /* Adding the offset to the saved positions. */
+ node.savedPayload.targetPosition.x = node.savedPayload.targetPosition.x + positionOffset.x
+ node.savedPayload.targetPosition.y = node.savedPayload.targetPosition.y + positionOffset.y
+ node.savedPayload.position.x = node.savedPayload.position.x + positionOffset.x
+ node.savedPayload.position.y = node.savedPayload.position.y + positionOffset.y
+
+ /* Transferring the saved payload properties into the running instance being created. */
+ payload.targetPosition = {
+ x: node.savedPayload.targetPosition.x,
+ y: node.savedPayload.targetPosition.y
+ }
+ node.savedPayload.targetPosition = undefined
+
+ /* Reference children connection to parents */
+ if (node.savedPayload.referenceParent !== undefined) {
+ payload.referenceParent = mapOfNodes.get(node.savedPayload.referenceParent.id)
+
+ if (payload.referenceParent !== undefined) {
+ mapOfReferenceChildren.set(node.id, node)
+ }
+ }
+ }
+
+ /* If we are adding a new object, then we set the initial values for position and targetPosition */
+ if (userAddingNew === true || uiObjectType === 'Workspace') {
+ /* Workspace allways to the spawn position */
+ if (uiObjectType === 'Workspace') {
+ payload.position = {
+ x: spawnPosition.x,
+ y: spawnPosition.y
+ }
+ }
+
+ /* Chain parent pointing to the position of the chain parent if defined. */
+ if (chainParent === undefined) {
+ payload.targetPosition = {
+ x: spawnPosition.x,
+ y: spawnPosition.y
+ }
+ } else {
+ payload.targetPosition = {
+ x: chainParent.payload.position.x,
+ y: chainParent.payload.position.y
+ }
+ }
+ }
+
+ /* Setting the title */
+ if (title !== undefined) {
+ payload.subTitle = title
+ } else {
+ payload.subTitle = uiObjectType
+ }
+
+ payload.visible = true
+ payload.title = name
+ payload.node = node
+ payload.parentNode = parentNode
+ payload.chainParent = chainParent
+ payload.onMenuItemClick = canvas.designSpace.workspace.onMenuItemClick
+
+ node.payload = payload
+ node.type = uiObjectType
+
+ /*
+ Now we copy the possible frame saved to the payload where it can be used. A saved frame stores the position of a a chartingSpace object related to a node.
+ This will prevent that if those charting space objects never get activated, that the frame information is lost when the workspace is saved.
+ */
+ if (node.savedPayload !== undefined) {
+ if (node.savedPayload.frame !== undefined) {
+ let frame = {
+ position: {
+ x: 0,
+ y: 0
+ }
+ }
+ frame.position.x = node.savedPayload.frame.position.x
+ frame.position.y = node.savedPayload.frame.position.y
+ frame.width = node.savedPayload.frame.width
+ frame.height = node.savedPayload.frame.height
+ frame.radius = node.savedPayload.frame.radius
+ saveFrame(payload, frame)
+ }
+ }
+
+ /* Now we mount the floating object where the UIOBject will be laying on top of */
+ canvas.floatingSpace.uiObjectConstructor.createUiObject(userAddingNew, payload)
+
+ mapOfNodes.set(node.id, node)
+
+ /* Check if there are tasks to run */
+ if (userAddingNew === false && uiObjectType === 'Task' && node.savedPayload !== undefined) {
+ if (node.savedPayload.uiObject.isRunning === true) {
+ if (node.payload.parentNode !== undefined) {
+ if (tasksToRun !== undefined) { // it might be undefined when you are spawning a task that was running while backed up
+ tasksToRun.push(node)
+ }
+ }
+ }
}
- }
- }
/* Check if there are sessions to run */
- if (userAddingNew === false && node.savedPayload !== undefined) {
- if (uiObjectType === 'Live Trading Session' || uiObjectType === 'Fordward Testing Session' || uiObjectType === 'Backtesting Session' || uiObjectType === 'Paper Trading Session') {
- if (node.savedPayload.uiObject.isRunning === true) {
- if (node.payload.parentNode !== undefined) {
- if (sessionsToRun !== undefined) { // it might be undefined when you are spawning a session that was running while backed up
- sessionsToRun.push(node)
+ if (userAddingNew === false && node.savedPayload !== undefined) {
+ if (uiObjectType === 'Live Trading Session' || uiObjectType === 'Fordward Testing Session' || uiObjectType === 'Backtesting Session' || uiObjectType === 'Paper Trading Session') {
+ if (node.savedPayload.uiObject.isRunning === true) {
+ if (node.payload.parentNode !== undefined) {
+ if (sessionsToRun !== undefined) { // it might be undefined when you are spawning a session that was running while backed up
+ sessionsToRun.push(node)
+ }
+ }
+ }
}
- }
}
- }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/WebhookFunctions.js b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/WebhookFunctions.js
index ca7e6b2f1..609a94c5a 100644
--- a/CanvasApp/DesignSpace/Workspace/FunctionLibraries/WebhookFunctions.js
+++ b/CanvasApp/DesignSpace/Workspace/FunctionLibraries/WebhookFunctions.js
@@ -1,22 +1,22 @@
-function newWebhookFunctions () {
- thisObject = {
- sendTestMessage: sendTestMessage
- }
+function newWebhookFunctions() {
+ thisObject = {
+ sendTestMessage: sendTestMessage
+ }
- return thisObject
+ return thisObject
- function sendTestMessage (node, callBackFunction) {
- let testMessage = loadPropertyFromNodeConfig(node.payload, 'testMessage')
- let letURL = loadPropertyFromNodeConfig(node.payload, 'webhookURL')
+ function sendTestMessage(node, callBackFunction) {
+ let testMessage = loadPropertyFromNodeConfig(node.payload, 'testMessage')
+ let letURL = loadPropertyFromNodeConfig(node.payload, 'webhookURL')
- callServer(testMessage, letURL, onResponse)
+ callServer(testMessage, letURL, onResponse)
- function onResponse (err) {
- if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
- callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
- } else {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- }
+ function onResponse(err) {
+ if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
+ } else {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ }
+ }
}
- }
}
diff --git a/CanvasApp/DesignSpace/Workspace/Workspace.js b/CanvasApp/DesignSpace/Workspace/Workspace.js
index 5f1c80761..7008cb873 100644
--- a/CanvasApp/DesignSpace/Workspace/Workspace.js
+++ b/CanvasApp/DesignSpace/Workspace/Workspace.js
@@ -1,621 +1,621 @@
-function newWorkspace () {
- const MODULE_NAME = 'Workspace'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newWorkspace() {
+ const MODULE_NAME = 'Workspace'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- workspaceNode: undefined,
- container: undefined,
- enabled: false,
- nodeChildren: undefined,
- eventsServerClients: new Map(),
- replaceWorkspaceByLoadingOne: replaceWorkspaceByLoadingOne,
- save: saveWorkspace,
- getHierarchyHeads: getHierarchyHeads,
- getHierarchyHeadsById: getHierarchyHeadsById,
- getNodeThatIsOnFocus: getNodeThatIsOnFocus,
- getNodeByShortcutKey: getNodeByShortcutKey,
- stopAllRunningTasks: stopAllRunningTasks,
- onMenuItemClick: onMenuItemClick,
- physics: physics,
- draw: draw,
- spawn: spawn,
- chainDetachNode: chainDetachNode,
- chainAttachNode: chainAttachNode,
- referenceDetachNode: referenceDetachNode,
- referenceAttachNode: referenceAttachNode,
- initialize: initialize,
- finalize: finalize
- }
+ let thisObject = {
+ workspaceNode: undefined,
+ container: undefined,
+ enabled: false,
+ nodeChildren: undefined,
+ eventsServerClients: new Map(),
+ replaceWorkspaceByLoadingOne: replaceWorkspaceByLoadingOne,
+ save: saveWorkspace,
+ getHierarchyHeads: getHierarchyHeads,
+ getHierarchyHeadsById: getHierarchyHeadsById,
+ getNodeThatIsOnFocus: getNodeThatIsOnFocus,
+ getNodeByShortcutKey: getNodeByShortcutKey,
+ stopAllRunningTasks: stopAllRunningTasks,
+ onMenuItemClick: onMenuItemClick,
+ physics: physics,
+ draw: draw,
+ spawn: spawn,
+ chainDetachNode: chainDetachNode,
+ chainAttachNode: chainAttachNode,
+ referenceDetachNode: referenceDetachNode,
+ referenceAttachNode: referenceAttachNode,
+ initialize: initialize,
+ finalize: finalize
+ }
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = false
- thisObject.container.detectMouseOver = false
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
- thisObject.container.frame.width = 0
- thisObject.container.frame.height = 0
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = false
+ thisObject.container.detectMouseOver = false
+ thisObject.container.frame.radius = 0
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
+ thisObject.container.frame.width = 0
+ thisObject.container.frame.height = 0
- spawnPosition = {
- x: canvas.floatingSpace.container.frame.width / 2,
- y: canvas.floatingSpace.container.frame.height / 2
- }
+ spawnPosition = {
+ x: canvas.floatingSpace.container.frame.width / 2,
+ y: canvas.floatingSpace.container.frame.height / 2
+ }
- thisObject.workspaceNode = {}
- thisObject.workspaceNode.rootNodes = []
+ thisObject.workspaceNode = {}
+ thisObject.workspaceNode.rootNodes = []
- let functionLibraryReferenceAttachDetach = newReferenceAttachDetach()
- let functionLibraryChainAttachDetach = newChainAttachDetach()
- let functionLibraryNodeDeleter = newNodeDeleter()
- let functionLibraryUiObjectsFromNodes = newUiObjectsFromNodes()
- let functionLibraryProtocolNode = newProtocolNode()
- let functionLibraryNodeCloning = newNodeCloning()
- let functionLibraryTaskFunctions = newTaskFunctions()
- let functionLibrarySessionFunctions = newSessionFunctions()
- let functionLibraryShortcutKeys = newShortcutKeys()
- let functionLibraryOnFocus = newOnFocus()
- let functionLibrarySuperScripts = newSuperScriptsFunctions()
- let functionLibraryCCXTFunctions = newCCXTFunctions()
- let functionLibraryWebhookFunctions = newWebhookFunctions()
- let functionLibraryDependenciesFilter = newDependenciesFilter()
+ let functionLibraryReferenceAttachDetach = newReferenceAttachDetach()
+ let functionLibraryChainAttachDetach = newChainAttachDetach()
+ let functionLibraryNodeDeleter = newNodeDeleter()
+ let functionLibraryUiObjectsFromNodes = newUiObjectsFromNodes()
+ let functionLibraryProtocolNode = newProtocolNode()
+ let functionLibraryNodeCloning = newNodeCloning()
+ let functionLibraryTaskFunctions = newTaskFunctions()
+ let functionLibrarySessionFunctions = newSessionFunctions()
+ let functionLibraryShortcutKeys = newShortcutKeys()
+ let functionLibraryOnFocus = newOnFocus()
+ let functionLibrarySuperScripts = newSuperScriptsFunctions()
+ let functionLibraryCCXTFunctions = newCCXTFunctions()
+ let functionLibraryWebhookFunctions = newWebhookFunctions()
+ let functionLibraryDependenciesFilter = newDependenciesFilter()
- thisObject.nodeChildren = newNodeChildren()
+ thisObject.nodeChildren = newNodeChildren()
- let isInitialized = false
- let workingAtTask = 0
- let circularProgressBar = newBusyProgressBar()
- circularProgressBar.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
- let loadedWorkspaceNode
- let sessionTimestamp = (new Date()).valueOf()
- window.localStorage.setItem('Session Timestamp', sessionTimestamp)
+ let isInitialized = false
+ let workingAtTask = 0
+ let circularProgressBar = newBusyProgressBar()
+ circularProgressBar.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
+ let loadedWorkspaceNode
+ let sessionTimestamp = (new Date()).valueOf()
+ window.localStorage.setItem('Session Timestamp', sessionTimestamp)
- return thisObject
+ return thisObject
- function finalize () {
- thisObject.definition = undefined
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.workspaceNode = undefined
- circularProgressBar.finalize()
- circularProgressBar = undefined
- }
+ function finalize() {
+ thisObject.definition = undefined
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.workspaceNode = undefined
+ circularProgressBar.finalize()
+ circularProgressBar = undefined
+ }
- function initialize () {
- try {
- let lastUsedWorkspace = window.localStorage.getItem('Last Used Workspace')
+ function initialize() {
+ try {
+ let lastUsedWorkspace = window.localStorage.getItem('Last Used Workspace')
- if (lastUsedWorkspace !== 'undefined' && lastUsedWorkspace !== null && lastUsedWorkspace !== undefined) {
- let blobService = newFileStorage()
- blobService.getFileFromHost('LoadWorkspace' + '/' + lastUsedWorkspace, onFileReceived, true)
- function onFileReceived (err, text, response) {
- if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- canvas.cockpitSpace.setStatus('Could not load the last Workspace used, called "' + lastUsedWorkspace + '". Will switch to the default Workspace instead.', 500, canvas.cockpitSpace.statusTypes.WARNING)
- thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
- recreateWorkspace()
- return
- }
- thisObject.workspaceNode = JSON.parse(text)
- recreateWorkspace()
+ if (lastUsedWorkspace !== 'undefined' && lastUsedWorkspace !== null && lastUsedWorkspace !== undefined) {
+ let blobService = newFileStorage()
+ blobService.getFileFromHost('LoadWorkspace' + '/' + lastUsedWorkspace, onFileReceived, true)
+ function onFileReceived(err, text, response) {
+ if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ canvas.cockpitSpace.setStatus('Could not load the last Workspace used, called "' + lastUsedWorkspace + '". Will switch to the default Workspace instead.', 500, canvas.cockpitSpace.statusTypes.WARNING)
+ thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
+ recreateWorkspace()
+ return
+ }
+ thisObject.workspaceNode = JSON.parse(text)
+ recreateWorkspace()
+ }
+ } else {
+ thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
+ recreateWorkspace()
+ }
+
+ function recreateWorkspace() {
+ functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode, finishInitialization)
+ }
+
+ function finishInitialization() {
+ setupEventsServerClients()
+ runTasksAndSessions(false)
+ thisObject.enabled = true
+ canvas.cockpitSpace.initializePosition()
+ canvas.splashScreen.initialize()
+ setInterval(saveWorkspace, 60000)
+ isInitialized = true
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
}
- } else {
- thisObject.workspaceNode = getWorkspace() // This is the default workspace that comes with the system.
- recreateWorkspace()
- }
-
- function recreateWorkspace () {
- functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode, finishInitialization)
- }
-
- function finishInitialization () {
- setupEventsServerClients()
- runTasksAndSessions(false)
- thisObject.enabled = true
- canvas.cockpitSpace.initializePosition()
- canvas.splashScreen.initialize()
- setInterval(saveWorkspace, 60000)
- isInitialized = true
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
}
- }
- function runTasksAndSessions (replacingCurrentWorkspace) {
- if (replacingCurrentWorkspace === true) {
- // We need to wait all tasks that were potentially running to stop
- setTimeout(functionLibraryUiObjectsFromNodes.runTasks, 70000)
- // We give a few seconds for the tasks to start
- setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 80000)
- } else {
- functionLibraryUiObjectsFromNodes.runTasks()
- // We give a few seconds for the tasks to start
- setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 10000)
- }
- }
-
- function setupEventsServerClients () {
- for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
- let rootNode = thisObject.workspaceNode.rootNodes[i]
-
- if (rootNode.type === 'Network') {
- for (let j = 0; j < rootNode.networkNodes.length; j++) {
- let networkNode = rootNode.networkNodes[j]
-
- let host
- let webSocketsPort
- /* At this point the node does not have the payload property yet, that is why we have to do this manually */
- try {
- let config = JSON.parse(networkNode.config)
- host = config.host
- webSocketsPort = config.webSocketsPort
- } catch (err) {
- console.log('[ERROR] networkNode ' + networkNode.name + ' has an invalid configuration. Cannot know the host name and webSocketsPort.')
- return
- }
-
- if (host === undefined) { host = 'localhost' }
- if (webSocketsPort === undefined) { webSocketsPort = '8080' }
-
- let eventsServerClient = newEventsServerClient(host, webSocketsPort, networkNode.name)
- eventsServerClient.initialize()
-
- thisObject.eventsServerClients.set(networkNode.id, eventsServerClient)
- }
- }
- }
- }
-
- function chainDetachNode (node) {
- functionLibraryChainAttachDetach.chainDetachNode(node, thisObject.workspaceNode.rootNodes)
- }
-
- function chainAttachNode (node, attachToNode) {
- functionLibraryChainAttachDetach.chainAttachNode(node, attachToNode, thisObject.workspaceNode.rootNodes)
- }
-
- function referenceDetachNode (node) {
- functionLibraryReferenceAttachDetach.referenceDetachNode(node)
- }
-
- function referenceAttachNode (node, attachToNode) {
- functionLibraryReferenceAttachDetach.referenceAttachNode(node, attachToNode, thisObject.workspaceNode.rootNodes)
- }
-
- function saveWorkspace () {
- if (isInitialized === false) { return }
- /* When there is an exception while loading the app, the rootNodes of the workspace get into null value. To avoid saving a corrupt staate we are going to verufy we are not in that situation before saving. */
- let workspace = canvas.designSpace.workspace.workspaceNode
-
- let savedSessionTimestamp = window.localStorage.getItem('Session Timestamp')
- if (Number(savedSessionTimestamp) !== sessionTimestamp) {
- canvas.cockpitSpace.setStatus('Could not save the Workspace. You have more that one instance of the Superlagos User Interface open at the same time. Plese close this instance as it is older than the others.', 150, canvas.cockpitSpace.statusTypes.WARNING)
- } else {
- let textToSave = stringifyWorkspace()
- window.localStorage.setItem(CANVAS_APP_NAME + '.' + 'Workspace', textToSave)
- window.localStorage.setItem('Session Timestamp', sessionTimestamp)
-
- if (workspace.name !== undefined) {
- let url = 'SaveWorkspace/' + workspace.name
- callServer(textToSave, url, onResponse)
- }
-
- function onResponse (err) {
- if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
- window.localStorage.setItem('Last Used Workspace', workspace.name)
- window.localStorage.setItem('Session Timestamp', sessionTimestamp)
- if (ARE_WE_RECORDING_A_MARKET_PANORAMA === false) {
- canvas.cockpitSpace.setStatus(workspace.name + ' Saved.', 50, canvas.cockpitSpace.statusTypes.ALL_GOOD)
- }
+ function runTasksAndSessions(replacingCurrentWorkspace) {
+ if (replacingCurrentWorkspace === true) {
+ // We need to wait all tasks that were potentially running to stop
+ setTimeout(functionLibraryUiObjectsFromNodes.runTasks, 70000)
+ // We give a few seconds for the tasks to start
+ setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 80000)
} else {
- canvas.cockpitSpace.setStatus('Could not save the Workspace at the Backend. Please check the Backend Console for more information.', 150, canvas.cockpitSpace.statusTypes.WARNING)
+ functionLibraryUiObjectsFromNodes.runTasks()
+ // We give a few seconds for the tasks to start
+ setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 10000)
}
- }
- return true
- }
- }
-
- function physics () {
- eventsServerClientsPhysics()
- replacingWorkspacePhysics()
- }
-
- function eventsServerClientsPhysics () {
- thisObject.eventsServerClients.forEach(applyPhysics)
-
- function applyPhysics (eventServerClient) {
- eventServerClient.physics()
- }
- }
-
- function replacingWorkspacePhysics () {
- if (thisObject.enabled !== true) { return }
-
- if (workingAtTask > 0) {
- circularProgressBar.physics()
-
- switch (workingAtTask) {
- case 1:
- stopAllRunningTasks()
- workingAtTask++
- break
- case 2:
- functionLibraryNodeDeleter.deleteWorkspace(thisObject.workspaceNode, thisObject.workspaceNode.rootNodes)
- workingAtTask++
- break
- case 3:
- thisObject.workspaceNode = loadedWorkspaceNode
- loadedWorkspaceNode = undefined
- workingAtTask++
- break
- case 4:
- functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode)
- setupEventsServerClients()
- runTasksAndSessions(true)
- workingAtTask++
- break
- case 5:
- canvas.chartingSpace.reset()
- workingAtTask++
- break
- case 6:
- workingAtTask = 0
- circularProgressBar.visible = false
- break
- }
- }
- }
-
- function draw () {
- if (circularProgressBar !== undefined) {
- circularProgressBar.draw()
- }
- }
-
- function stringifyWorkspace (removePersonalData) {
- let stringifyReadyNodes = []
- for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
- let rootNode = thisObject.workspaceNode.rootNodes[i]
-
- if (rootNode.isIncluded !== true) {
- let node = functionLibraryProtocolNode.getProtocolNode(rootNode, removePersonalData, false, true, true, true)
- stringifyReadyNodes.push(node)
- }
- }
- let workspace = {
- type: 'Workspace',
- name: thisObject.workspaceNode.name,
- rootNodes: stringifyReadyNodes
}
- return JSON.stringify(workspace)
- }
+ function setupEventsServerClients() {
+ for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
+ let rootNode = thisObject.workspaceNode.rootNodes[i]
- function stopAllRunningTasks () {
- for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
- let rootNode = thisObject.workspaceNode.rootNodes[i]
- if (rootNode.type === 'Network') {
- if (rootNode.networkNodes !== undefined) {
- for (let j = 0; j < rootNode.networkNodes.length; j++) {
- let networkNode = rootNode.networkNodes[j]
- if (networkNode.dataMining !== undefined && networkNode.dataMining.payload !== undefined) {
- networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
- networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ if (rootNode.type === 'Network') {
+ for (let j = 0; j < rootNode.networkNodes.length; j++) {
+ let networkNode = rootNode.networkNodes[j]
+
+ let host
+ let webSocketsPort
+ /* At this point the node does not have the payload property yet, that is why we have to do this manually */
+ try {
+ let config = JSON.parse(networkNode.config)
+ host = config.host
+ webSocketsPort = config.webSocketsPort
+ } catch (err) {
+ console.log('[ERROR] networkNode ' + networkNode.name + ' has an invalid configuration. Cannot know the host name and webSocketsPort.')
+ return
+ }
+
+ if (host === undefined) { host = 'localhost' }
+ if (webSocketsPort === undefined) { webSocketsPort = '8080' }
+
+ let eventsServerClient = newEventsServerClient(host, webSocketsPort, networkNode.name)
+ eventsServerClient.initialize()
+
+ thisObject.eventsServerClients.set(networkNode.id, eventsServerClient)
+ }
}
- if (networkNode.testingEnvironment !== undefined && networkNode.testingEnvironment.payload !== undefined) {
- networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
- networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ }
+ }
+
+ function chainDetachNode(node) {
+ functionLibraryChainAttachDetach.chainDetachNode(node, thisObject.workspaceNode.rootNodes)
+ }
+
+ function chainAttachNode(node, attachToNode) {
+ functionLibraryChainAttachDetach.chainAttachNode(node, attachToNode, thisObject.workspaceNode.rootNodes)
+ }
+
+ function referenceDetachNode(node) {
+ functionLibraryReferenceAttachDetach.referenceDetachNode(node)
+ }
+
+ function referenceAttachNode(node, attachToNode) {
+ functionLibraryReferenceAttachDetach.referenceAttachNode(node, attachToNode, thisObject.workspaceNode.rootNodes)
+ }
+
+ function saveWorkspace() {
+ if (isInitialized === false) { return }
+ /* When there is an exception while loading the app, the rootNodes of the workspace get into null value. To avoid saving a corrupt staate we are going to verufy we are not in that situation before saving. */
+ let workspace = canvas.designSpace.workspace.workspaceNode
+
+ let savedSessionTimestamp = window.localStorage.getItem('Session Timestamp')
+ if (Number(savedSessionTimestamp) !== sessionTimestamp) {
+ canvas.cockpitSpace.setStatus('Could not save the Workspace. You have more that one instance of the Superlagos User Interface open at the same time. Plese close this instance as it is older than the others.', 150, canvas.cockpitSpace.statusTypes.WARNING)
+ } else {
+ let textToSave = stringifyWorkspace()
+ window.localStorage.setItem(CANVAS_APP_NAME + '.' + 'Workspace', textToSave)
+ window.localStorage.setItem('Session Timestamp', sessionTimestamp)
+
+ if (workspace.name !== undefined) {
+ let url = 'SaveWorkspace/' + workspace.name
+ callServer(textToSave, url, onResponse)
}
- if (networkNode.productionEnvironment !== undefined && networkNode.productionEnvironment.payload !== undefined) {
- networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
- networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+
+ function onResponse(err) {
+ if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ window.localStorage.setItem('Last Used Workspace', workspace.name)
+ window.localStorage.setItem('Session Timestamp', sessionTimestamp)
+ if (ARE_WE_RECORDING_A_MARKET_PANORAMA === false) {
+ canvas.cockpitSpace.setStatus(workspace.name + ' Saved.', 50, canvas.cockpitSpace.statusTypes.ALL_GOOD)
+ }
+ } else {
+ canvas.cockpitSpace.setStatus('Could not save the Workspace at the Backend. Please check the Backend Console for more information.', 150, canvas.cockpitSpace.statusTypes.WARNING)
+ }
}
- }
+ return true
}
- }
}
- }
- function getNodeByShortcutKey (searchingKey) {
- for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
- let rootNode = thisObject.workspaceNode.rootNodes[i]
- let node = functionLibraryShortcutKeys.getNodeByShortcutKey(rootNode, searchingKey)
- if (node !== undefined) { return node }
+ function physics() {
+ eventsServerClientsPhysics()
+ replacingWorkspacePhysics()
}
- }
- function getNodeThatIsOnFocus () {
- for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
- let rootNode = thisObject.workspaceNode.rootNodes[i]
- let node = functionLibraryOnFocus.getNodeThatIsOnFocus(rootNode)
- if (node !== undefined) { return node }
+ function eventsServerClientsPhysics() {
+ thisObject.eventsServerClients.forEach(applyPhysics)
+
+ function applyPhysics(eventServerClient) {
+ eventServerClient.physics()
+ }
}
- }
- function getHierarchyHeads () {
- let nodes = []
- for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
- let rootNode = thisObject.workspaceNode.rootNodes[i]
- let nodeDefinition = getNodeDefinition(rootNode)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.isHierarchyHead === true) {
- nodes.push(rootNode)
- }
- }
- }
- return nodes
- }
+ function replacingWorkspacePhysics() {
+ if (thisObject.enabled !== true) { return }
- function getHierarchyHeadsById (nodeId) {
- let hiriatchyHeads = getHierarchyHeads()
- for (let i = 0; i < hiriatchyHeads.length; i++) {
- let hiriatchyHead = hiriatchyHeads[i]
- if (hiriatchyHead.id === nodeId) {
- return hiriatchyHead
- }
- }
- }
+ if (workingAtTask > 0) {
+ circularProgressBar.physics()
- function replaceWorkspaceByLoadingOne (name) {
- let blobService = newFileStorage()
- blobService.getFileFromHost('LoadWorkspace' + '/' + name, onFileReceived, true)
- function onFileReceived (err, text, response) {
- if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- canvas.cockpitSpace.setStatus('Could not load the Workspace called "' + name + '". ', 500, canvas.cockpitSpace.statusTypes.WARNING)
- return
- }
-
- loadedWorkspaceNode = JSON.parse(text)
- saveWorkspace()
- canvas.cockpitSpace.toTop()
-
- let position = {
- x: browserCanvas.width / 2,
- y: browserCanvas.height / 2
- }
-
- circularProgressBar.initialize(position)
- circularProgressBar.visible = true
- workingAtTask = 1
- }
- }
-
- function spawn (nodeText, mousePointer) {
- try {
- let point = {
- x: mousePointer.x,
- y: mousePointer.y
- }
- point = canvas.floatingSpace.container.frame.unframeThisPoint(point)
- spawnPosition.x = point.x
- spawnPosition.y = point.y
-
- let droppedNode = JSON.parse(nodeText)
-
- if (droppedNode.type === 'Workspace') {
- loadedWorkspaceNode = droppedNode
- circularProgressBar.initialize(mousePointer)
- circularProgressBar.visible = true
- workingAtTask = 1
- return
- }
-
- /* It does not exist, so we recreeate it respecting the inner state of each object. */
- let positionOffset = {
- x: spawnPosition.x - droppedNode.savedPayload.position.x,
- y: spawnPosition.y - droppedNode.savedPayload.position.y
- }
-
- thisObject.workspaceNode.rootNodes.push(droppedNode)
- functionLibraryUiObjectsFromNodes.createUiObjectFromNode(droppedNode, undefined, undefined, positionOffset)
- functionLibraryUiObjectsFromNodes.tryToConnectChildrenWithReferenceParents()
-
- droppedNode = undefined
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] spawn -> err = ' + err.stack) }
- }
- }
-
- async function onMenuItemClick (payload, action, relatedUiObject, callBackFunction) {
- switch (action) {
- case 'Add UI Object':
- {
- functionLibraryUiObjectsFromNodes.addUIObject(payload.node, relatedUiObject)
- }
- break
- case 'Add Missing Children':
- {
- functionLibraryUiObjectsFromNodes.addMissingChildren(payload.node)
- }
- break
- case 'Delete UI Object':
- {
- functionLibraryNodeDeleter.deleteUIObject(payload.node, thisObject.workspaceNode.rootNodes)
- }
- break
- case 'Share Workspace':
- {
- let text = stringifyWorkspace(true)
- let fileName = 'Share - ' + payload.node.type + ' - ' + payload.node.name + '.json'
- downloadText(fileName, text)
- }
- break
- case 'Backup Workspace':
- {
- let text = stringifyWorkspace(false)
- let fileName = 'Backup - ' + payload.node.type + ' - ' + payload.node.name + '.json'
- downloadText(fileName, text)
- }
- break
- case 'Edit Code':
-
- break
- case 'Share':
- {
- let text = JSON.stringify(functionLibraryProtocolNode.getProtocolNode(payload.node, true, false, true, true, true))
-
- let nodeName = payload.node.name
- if (nodeName === undefined) {
- nodeName = ''
- } else {
- nodeName = '.' + nodeName
- }
- let fileName = 'Share - ' + payload.node.type + ' - ' + nodeName + '.json'
- downloadText(fileName, text)
- }
-
- break
- case 'Backup':
- {
- let text = JSON.stringify(functionLibraryProtocolNode.getProtocolNode(payload.node, false, false, true, true, true))
-
- let nodeName = payload.node.name
- if (nodeName === undefined) {
- nodeName = ''
- } else {
- nodeName = ' ' + nodeName
- }
- let fileName = 'Backup - ' + payload.node.type + ' - ' + nodeName + '.json'
- downloadText(fileName, text)
- }
-
- break
- case 'Clone':
- {
- let text = JSON.stringify(functionLibraryNodeCloning.getNodeClone(payload.node))
-
- let nodeName = payload.node.name
- if (nodeName === undefined) {
- nodeName = ''
- } else {
- nodeName = ' ' + nodeName
- }
- let fileName = 'Clone - ' + payload.node.type + ' - ' + nodeName + '.json'
- downloadText(fileName, text)
- }
-
- break
- case 'Debug Task':
- {
- functionLibraryTaskFunctions.runTask(payload.node, functionLibraryProtocolNode, true, callBackFunction)
- }
- break
- case 'Run Task':
- {
- functionLibraryTaskFunctions.runTask(payload.node, functionLibraryProtocolNode, false, callBackFunction)
- }
- break
- case 'Stop Task':
- {
- functionLibraryTaskFunctions.stopTask(payload.node, functionLibraryProtocolNode, callBackFunction)
- }
- break
- case 'Run All Tasks':
- {
- functionLibraryTaskFunctions.runAllTasks(payload.node, functionLibraryProtocolNode)
- }
- break
- case 'Stop All Tasks':
- {
- functionLibraryTaskFunctions.stopAllTasks(payload.node, functionLibraryProtocolNode)
- }
- break
- case 'Run All Task Managers':
- {
- functionLibraryTaskFunctions.runAllTaskManagers(payload.node, functionLibraryProtocolNode)
- }
- break
- case 'Stop All Task Managers':
- {
- functionLibraryTaskFunctions.stopAllTaskManagers(payload.node, functionLibraryProtocolNode)
- }
- break
- case 'Run All Exchange Tasks':
- {
- functionLibraryTaskFunctions.runAllExchangeTasks(payload.node, functionLibraryProtocolNode)
- }
- break
- case 'Stop All Exchange Tasks':
- {
- functionLibraryTaskFunctions.stopAllExchangeTasks(payload.node, functionLibraryProtocolNode)
- }
- break
- case 'Add Missing Crypto Exchanges':
- {
- functionLibraryCCXTFunctions.addMissingExchanges(payload.node, functionLibraryUiObjectsFromNodes)
- }
- break
- case 'Add Missing Assets':
- {
- functionLibraryCCXTFunctions.addMissingAssets(payload.node, functionLibraryUiObjectsFromNodes)
- }
- break
- case 'Add Missing Markets':
- {
- functionLibraryCCXTFunctions.addMissingMarkets(payload.node, functionLibraryUiObjectsFromNodes, functionLibraryNodeCloning)
- }
- break
- case 'Send Webhook Test Message':
- {
- functionLibraryWebhookFunctions.sendTestMessage(payload.node, callBackFunction)
- }
- break
- case 'Run Session':
- {
- functionLibrarySessionFunctions.runSession(payload.node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, false, callBackFunction)
- }
- break
- case 'Resume Session':
- {
- functionLibrarySessionFunctions.runSession(payload.node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, true, callBackFunction)
- }
- break
- case 'Stop Session':
- {
- functionLibrarySessionFunctions.stopSession(payload.node, functionLibraryProtocolNode, callBackFunction)
- }
- break
- case 'Run Super Action':
- {
- functionLibrarySuperScripts.runSuperScript(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryNodeCloning, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter)
- }
- break
- case 'Remove Parent':
- {
- chainDetachNode(payload.node)
- }
- break
- case 'Remove Reference':
- {
- referenceDetachNode(payload.node)
- }
- break
- case 'Push Code to Javascript Code':
- {
- payload.node.javascriptCode.code = payload.node.code
- }
- break
- case 'Fetch Code to Javascript Code':
- {
- payload.node.code = payload.node.javascriptCode.code
- }
- break
- case 'Open Documentation':
- {
- let definition = getNodeDefinition(payload.node)
- if (definition !== undefined) {
- if (definition.docURL !== undefined) {
- let newTab = window.open(definition.docURL, '_blank')
- newTab.focus()
+ switch (workingAtTask) {
+ case 1:
+ stopAllRunningTasks()
+ workingAtTask++
+ break
+ case 2:
+ functionLibraryNodeDeleter.deleteWorkspace(thisObject.workspaceNode, thisObject.workspaceNode.rootNodes)
+ workingAtTask++
+ break
+ case 3:
+ thisObject.workspaceNode = loadedWorkspaceNode
+ loadedWorkspaceNode = undefined
+ workingAtTask++
+ break
+ case 4:
+ functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode)
+ setupEventsServerClients()
+ runTasksAndSessions(true)
+ workingAtTask++
+ break
+ case 5:
+ canvas.chartingSpace.reset()
+ workingAtTask++
+ break
+ case 6:
+ workingAtTask = 0
+ circularProgressBar.visible = false
+ break
}
- }
}
- break
}
- }
+
+ function draw() {
+ if (circularProgressBar !== undefined) {
+ circularProgressBar.draw()
+ }
+ }
+
+ function stringifyWorkspace(removePersonalData) {
+ let stringifyReadyNodes = []
+ for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
+ let rootNode = thisObject.workspaceNode.rootNodes[i]
+
+ if (rootNode.isIncluded !== true) {
+ let node = functionLibraryProtocolNode.getProtocolNode(rootNode, removePersonalData, false, true, true, true)
+ stringifyReadyNodes.push(node)
+ }
+ }
+ let workspace = {
+ type: 'Workspace',
+ name: thisObject.workspaceNode.name,
+ rootNodes: stringifyReadyNodes
+ }
+
+ return JSON.stringify(workspace)
+ }
+
+ function stopAllRunningTasks() {
+ for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
+ let rootNode = thisObject.workspaceNode.rootNodes[i]
+ if (rootNode.type === 'Network') {
+ if (rootNode.networkNodes !== undefined) {
+ for (let j = 0; j < rootNode.networkNodes.length; j++) {
+ let networkNode = rootNode.networkNodes[j]
+ if (networkNode.dataMining !== undefined && networkNode.dataMining.payload !== undefined) {
+ networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ networkNode.dataMining.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ }
+ if (networkNode.testingEnvironment !== undefined && networkNode.testingEnvironment.payload !== undefined) {
+ networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ networkNode.testingEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ }
+ if (networkNode.productionEnvironment !== undefined && networkNode.productionEnvironment.payload !== undefined) {
+ networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ networkNode.productionEnvironment.payload.uiObject.menu.internalClick('Stop All Exchange Tasks')
+ }
+ }
+ }
+ }
+ }
+ }
+
+ function getNodeByShortcutKey(searchingKey) {
+ for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
+ let rootNode = thisObject.workspaceNode.rootNodes[i]
+ let node = functionLibraryShortcutKeys.getNodeByShortcutKey(rootNode, searchingKey)
+ if (node !== undefined) { return node }
+ }
+ }
+
+ function getNodeThatIsOnFocus() {
+ for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
+ let rootNode = thisObject.workspaceNode.rootNodes[i]
+ let node = functionLibraryOnFocus.getNodeThatIsOnFocus(rootNode)
+ if (node !== undefined) { return node }
+ }
+ }
+
+ function getHierarchyHeads() {
+ let nodes = []
+ for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
+ let rootNode = thisObject.workspaceNode.rootNodes[i]
+ let nodeDefinition = getNodeDefinition(rootNode)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.isHierarchyHead === true) {
+ nodes.push(rootNode)
+ }
+ }
+ }
+ return nodes
+ }
+
+ function getHierarchyHeadsById(nodeId) {
+ let hiriatchyHeads = getHierarchyHeads()
+ for (let i = 0; i < hiriatchyHeads.length; i++) {
+ let hiriatchyHead = hiriatchyHeads[i]
+ if (hiriatchyHead.id === nodeId) {
+ return hiriatchyHead
+ }
+ }
+ }
+
+ function replaceWorkspaceByLoadingOne(name) {
+ let blobService = newFileStorage()
+ blobService.getFileFromHost('LoadWorkspace' + '/' + name, onFileReceived, true)
+ function onFileReceived(err, text, response) {
+ if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ canvas.cockpitSpace.setStatus('Could not load the Workspace called "' + name + '". ', 500, canvas.cockpitSpace.statusTypes.WARNING)
+ return
+ }
+
+ loadedWorkspaceNode = JSON.parse(text)
+ saveWorkspace()
+ canvas.cockpitSpace.toTop()
+
+ let position = {
+ x: browserCanvas.width / 2,
+ y: browserCanvas.height / 2
+ }
+
+ circularProgressBar.initialize(position)
+ circularProgressBar.visible = true
+ workingAtTask = 1
+ }
+ }
+
+ function spawn(nodeText, mousePointer) {
+ try {
+ let point = {
+ x: mousePointer.x,
+ y: mousePointer.y
+ }
+ point = canvas.floatingSpace.container.frame.unframeThisPoint(point)
+ spawnPosition.x = point.x
+ spawnPosition.y = point.y
+
+ let droppedNode = JSON.parse(nodeText)
+
+ if (droppedNode.type === 'Workspace') {
+ loadedWorkspaceNode = droppedNode
+ circularProgressBar.initialize(mousePointer)
+ circularProgressBar.visible = true
+ workingAtTask = 1
+ return
+ }
+
+ /* It does not exist, so we recreeate it respecting the inner state of each object. */
+ let positionOffset = {
+ x: spawnPosition.x - droppedNode.savedPayload.position.x,
+ y: spawnPosition.y - droppedNode.savedPayload.position.y
+ }
+
+ thisObject.workspaceNode.rootNodes.push(droppedNode)
+ functionLibraryUiObjectsFromNodes.createUiObjectFromNode(droppedNode, undefined, undefined, positionOffset)
+ functionLibraryUiObjectsFromNodes.tryToConnectChildrenWithReferenceParents()
+
+ droppedNode = undefined
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] spawn -> err = ' + err.stack) }
+ }
+ }
+
+ async function onMenuItemClick(payload, action, relatedUiObject, callBackFunction) {
+ switch (action) {
+ case 'Add UI Object':
+ {
+ functionLibraryUiObjectsFromNodes.addUIObject(payload.node, relatedUiObject)
+ }
+ break
+ case 'Add Missing Children':
+ {
+ functionLibraryUiObjectsFromNodes.addMissingChildren(payload.node)
+ }
+ break
+ case 'Delete UI Object':
+ {
+ functionLibraryNodeDeleter.deleteUIObject(payload.node, thisObject.workspaceNode.rootNodes)
+ }
+ break
+ case 'Share Workspace':
+ {
+ let text = stringifyWorkspace(true)
+ let fileName = 'Share - ' + payload.node.type + ' - ' + payload.node.name + '.json'
+ downloadText(fileName, text)
+ }
+ break
+ case 'Backup Workspace':
+ {
+ let text = stringifyWorkspace(false)
+ let fileName = 'Backup - ' + payload.node.type + ' - ' + payload.node.name + '.json'
+ downloadText(fileName, text)
+ }
+ break
+ case 'Edit Code':
+
+ break
+ case 'Share':
+ {
+ let text = JSON.stringify(functionLibraryProtocolNode.getProtocolNode(payload.node, true, false, true, true, true))
+
+ let nodeName = payload.node.name
+ if (nodeName === undefined) {
+ nodeName = ''
+ } else {
+ nodeName = '.' + nodeName
+ }
+ let fileName = 'Share - ' + payload.node.type + ' - ' + nodeName + '.json'
+ downloadText(fileName, text)
+ }
+
+ break
+ case 'Backup':
+ {
+ let text = JSON.stringify(functionLibraryProtocolNode.getProtocolNode(payload.node, false, false, true, true, true))
+
+ let nodeName = payload.node.name
+ if (nodeName === undefined) {
+ nodeName = ''
+ } else {
+ nodeName = ' ' + nodeName
+ }
+ let fileName = 'Backup - ' + payload.node.type + ' - ' + nodeName + '.json'
+ downloadText(fileName, text)
+ }
+
+ break
+ case 'Clone':
+ {
+ let text = JSON.stringify(functionLibraryNodeCloning.getNodeClone(payload.node))
+
+ let nodeName = payload.node.name
+ if (nodeName === undefined) {
+ nodeName = ''
+ } else {
+ nodeName = ' ' + nodeName
+ }
+ let fileName = 'Clone - ' + payload.node.type + ' - ' + nodeName + '.json'
+ downloadText(fileName, text)
+ }
+
+ break
+ case 'Debug Task':
+ {
+ functionLibraryTaskFunctions.runTask(payload.node, functionLibraryProtocolNode, true, callBackFunction)
+ }
+ break
+ case 'Run Task':
+ {
+ functionLibraryTaskFunctions.runTask(payload.node, functionLibraryProtocolNode, false, callBackFunction)
+ }
+ break
+ case 'Stop Task':
+ {
+ functionLibraryTaskFunctions.stopTask(payload.node, functionLibraryProtocolNode, callBackFunction)
+ }
+ break
+ case 'Run All Tasks':
+ {
+ functionLibraryTaskFunctions.runAllTasks(payload.node, functionLibraryProtocolNode)
+ }
+ break
+ case 'Stop All Tasks':
+ {
+ functionLibraryTaskFunctions.stopAllTasks(payload.node, functionLibraryProtocolNode)
+ }
+ break
+ case 'Run All Task Managers':
+ {
+ functionLibraryTaskFunctions.runAllTaskManagers(payload.node, functionLibraryProtocolNode)
+ }
+ break
+ case 'Stop All Task Managers':
+ {
+ functionLibraryTaskFunctions.stopAllTaskManagers(payload.node, functionLibraryProtocolNode)
+ }
+ break
+ case 'Run All Exchange Tasks':
+ {
+ functionLibraryTaskFunctions.runAllExchangeTasks(payload.node, functionLibraryProtocolNode)
+ }
+ break
+ case 'Stop All Exchange Tasks':
+ {
+ functionLibraryTaskFunctions.stopAllExchangeTasks(payload.node, functionLibraryProtocolNode)
+ }
+ break
+ case 'Add Missing Crypto Exchanges':
+ {
+ functionLibraryCCXTFunctions.addMissingExchanges(payload.node, functionLibraryUiObjectsFromNodes)
+ }
+ break
+ case 'Add Missing Assets':
+ {
+ functionLibraryCCXTFunctions.addMissingAssets(payload.node, functionLibraryUiObjectsFromNodes)
+ }
+ break
+ case 'Add Missing Markets':
+ {
+ functionLibraryCCXTFunctions.addMissingMarkets(payload.node, functionLibraryUiObjectsFromNodes, functionLibraryNodeCloning)
+ }
+ break
+ case 'Send Webhook Test Message':
+ {
+ functionLibraryWebhookFunctions.sendTestMessage(payload.node, callBackFunction)
+ }
+ break
+ case 'Run Session':
+ {
+ functionLibrarySessionFunctions.runSession(payload.node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, false, callBackFunction)
+ }
+ break
+ case 'Resume Session':
+ {
+ functionLibrarySessionFunctions.runSession(payload.node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, true, callBackFunction)
+ }
+ break
+ case 'Stop Session':
+ {
+ functionLibrarySessionFunctions.stopSession(payload.node, functionLibraryProtocolNode, callBackFunction)
+ }
+ break
+ case 'Run Super Action':
+ {
+ functionLibrarySuperScripts.runSuperScript(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryNodeCloning, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter)
+ }
+ break
+ case 'Remove Parent':
+ {
+ chainDetachNode(payload.node)
+ }
+ break
+ case 'Remove Reference':
+ {
+ referenceDetachNode(payload.node)
+ }
+ break
+ case 'Push Code to Javascript Code':
+ {
+ payload.node.javascriptCode.code = payload.node.code
+ }
+ break
+ case 'Fetch Code to Javascript Code':
+ {
+ payload.node.code = payload.node.javascriptCode.code
+ }
+ break
+ case 'Open Documentation':
+ {
+ let definition = getNodeDefinition(payload.node)
+ if (definition !== undefined) {
+ if (definition.docURL !== undefined) {
+ let newTab = window.open(definition.docURL, '_blank')
+ newTab.focus()
+ }
+ }
+ }
+ break
+ }
+ }
}
diff --git a/CanvasApp/EventHandler.js b/CanvasApp/EventHandler.js
index d387e2b68..3820a8242 100644
--- a/CanvasApp/EventHandler.js
+++ b/CanvasApp/EventHandler.js
@@ -1,46 +1,46 @@
- 
-function newEventHandler () {
- let thisObject = {
- name: undefined, // This is for debugging purposes only.
- listenToEvent: listenToEvent,
- stopListening: stopListening,
- raiseEvent: raiseEvent,
- finalize: finalize
- }
- let eventHandlers = [] // Here we store all the functions we will call when an event is raiseed.
-
- return thisObject
-
- function finalize () {
- eventHandlers = []
- }
-
- function listenToEvent (eventType, handler, extraData) {
- let eventSubscriptionId = newUniqueId()
- eventHandlers.push([eventType, handler, extraData, eventSubscriptionId])
- return eventSubscriptionId
- }
-
- function stopListening (pEventSubscriptionId) {
- for (let i = 0; i < eventHandlers.length; i++) {
- if (pEventSubscriptionId === eventHandlers[i][3]) {
- eventHandlers.splice(i, 1)
- return
- }
+function newEventHandler() {
+ let thisObject = {
+ name: undefined, // This is for debugging purposes only.
+ listenToEvent: listenToEvent,
+ stopListening: stopListening,
+ raiseEvent: raiseEvent,
+ finalize: finalize
}
- }
- function raiseEvent (eventType, event) {
- for (var i = 0; i < eventHandlers.length; i++) {
+ let eventHandlers = [] // Here we store all the functions we will call when an event is raiseed.
+
+ return thisObject
+
+ function finalize() {
+ eventHandlers = []
+ }
+
+ function listenToEvent(eventType, handler, extraData) {
+ let eventSubscriptionId = newUniqueId()
+ eventHandlers.push([eventType, handler, extraData, eventSubscriptionId])
+ return eventSubscriptionId
+ }
+
+ function stopListening(pEventSubscriptionId) {
+ for (let i = 0; i < eventHandlers.length; i++) {
+ if (pEventSubscriptionId === eventHandlers[i][3]) {
+ eventHandlers.splice(i, 1)
+ return
+ }
+ }
+ }
+
+ function raiseEvent(eventType, event) {
+ for (var i = 0; i < eventHandlers.length; i++) {
/* We will execute all the functions listening to this event type. */
- if (eventHandlers[i][0] === eventType) {
- let handler = eventHandlers[i][1]
- let extraData = eventHandlers[i][2]
+ if (eventHandlers[i][0] === eventType) {
+ let handler = eventHandlers[i][1]
+ let extraData = eventHandlers[i][2]
- handler(event, extraData)
- }
+ handler(event, extraData)
+ }
+ }
}
- }
}
diff --git a/CanvasApp/EventsServerClient.js b/CanvasApp/EventsServerClient.js
index 4760a3c51..2956a6916 100644
--- a/CanvasApp/EventsServerClient.js
+++ b/CanvasApp/EventsServerClient.js
@@ -1,215 +1,215 @@
-function newEventsServerClient (host, port, hostName) {
- /* Web Sockets Connection */
+function newEventsServerClient(host, port, hostName) {
+ /* Web Sockets Connection */
- const MODULE_NAME = 'System Event Handler'
- const ERROR_LOG = true
- const INFO_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+ const MODULE_NAME = 'System Event Handler'
+ const ERROR_LOG = true
+ const INFO_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- if (host === '' || host === undefined) { host = 'localhost' }
- if (port === '' || port === undefined) { port = '8081' }
+ if (host === '' || host === undefined) { host = 'localhost' }
+ if (port === '' || port === undefined) { port = '8081' }
- const WEB_SOCKETS_URL = 'ws://' + host + ':' + port + ''
- let WEB_SOCKETS_CONNECTION
+ const WEB_SOCKETS_URL = 'ws://' + host + ':' + port + ''
+ let WEB_SOCKETS_CONNECTION
- let thisObject = {
- isConnected: isConnected,
- initialize: initialize,
- physics: physics,
- createEventHandler: createEventHandler,
- deleteEventHandler: deleteEventHandler,
- listenToEvent: listenToEvent,
- stopListening: stopListening,
- raiseEvent: raiseEvent
- }
-
- let eventListeners = new Map()
- let responseWaiters = new Map()
- let commandsWaitingConfirmation = new Map()
- let commandsSentByTimestamp = new Map()
- let nonce = 0
-
- return thisObject
-
- function initialize (callBackFunction) {
- setuptWebSockets(callBackFunction)
- }
-
- function isConnected () {
- if (WEB_SOCKETS_CONNECTION.readyState === 1) {
- return true
- } else {
- return false
- }
- }
-
- function sendCommand (command, responseCallBack, eventsCallBack) {
- if (command.action === 'listenToEvent') {
- let key
- if (command.callerId !== undefined) {
- key = command.eventHandlerName + '-' + command.eventType + '-' + command.callerId
- } else {
- key = command.eventHandlerName + '-' + command.eventType
- }
- eventListeners.set(key, eventsCallBack)
- }
- if (command.callerId && responseCallBack) {
- responseWaiters.set(command.callerId, responseCallBack)
+ let thisObject = {
+ isConnected: isConnected,
+ initialize: initialize,
+ physics: physics,
+ createEventHandler: createEventHandler,
+ deleteEventHandler: deleteEventHandler,
+ listenToEvent: listenToEvent,
+ stopListening: stopListening,
+ raiseEvent: raiseEvent
}
- sendToWebSocketServer(command)
- }
+ let eventListeners = new Map()
+ let responseWaiters = new Map()
+ let commandsWaitingConfirmation = new Map()
+ let commandsSentByTimestamp = new Map()
+ let nonce = 0
- function sendToWebSocketServer (command) {
- nonce++
- let stringNonce = nonce.toString()
- let timestamp = (new Date()).valueOf()
- commandsWaitingConfirmation.set(stringNonce, command)
- commandsSentByTimestamp.set(stringNonce, timestamp)
+ return thisObject
- let messageToWebSocketServer = 'Web Browser' + '|*|' + stringNonce + '|*|' + JSON.stringify(command)
-
- if (WEB_SOCKETS_CONNECTION.readyState === 1) {
- WEB_SOCKETS_CONNECTION.send(messageToWebSocketServer)
- } else {
- console.log('WebSocket message could not be sent because the connection was not ready. Will retry soon. Message = ' + JSON.stringify(command))
+ function initialize(callBackFunction) {
+ setuptWebSockets(callBackFunction)
}
- }
- function createEventHandler (eventHandlerName, callerId, responseCallBack) {
- let eventCommand = {
- action: 'createEventHandler',
- eventHandlerName: eventHandlerName,
- callerId: callerId
+ function isConnected() {
+ if (WEB_SOCKETS_CONNECTION.readyState === 1) {
+ return true
+ } else {
+ return false
+ }
}
- sendCommand(eventCommand, responseCallBack)
- }
- function deleteEventHandler (eventHandlerName, callerId, responseCallBack) {
- let eventCommand = {
- action: 'deleteEventHandler',
- eventHandlerName: eventHandlerName,
- callerId: callerId
- }
- sendCommand(eventCommand, responseCallBack)
- }
-
- function listenToEvent (eventHandlerName, eventType, extraData, callerId, responseCallBack, eventsCallBack) {
- let eventCommand = {
- action: 'listenToEvent',
- eventHandlerName: eventHandlerName,
- eventType: eventType,
- extraData: extraData,
- callerId: callerId
- }
- sendCommand(eventCommand, responseCallBack, eventsCallBack)
- }
-
- function stopListening (eventHandlerName, eventSubscriptionId, callerId, responseCallBack) {
- let eventCommand = {
- action: 'stopListening',
- eventHandlerName: eventHandlerName,
- eventSubscriptionId: eventSubscriptionId,
- callerId: callerId
- }
- sendCommand(eventCommand, responseCallBack)
- }
-
- function raiseEvent (eventHandlerName, eventType, event, callerId, responseCallBack) {
- let eventCommand = {
- action: 'raiseEvent',
- eventHandlerName: eventHandlerName,
- eventType: eventType,
- event: event,
- callerId: callerId
- }
- sendCommand(eventCommand, responseCallBack)
- }
-
- function retryCommandsPhysics () {
- commandsSentByTimestamp.forEach(checkTimestamp)
-
- function checkTimestamp (timestamp, nonce) {
- const MILISECONDS_TO_WAIT_FOR_RETRYING_A_COMMAND = 10000
- let now = (new Date()).valueOf()
-
- if ((now - timestamp) > MILISECONDS_TO_WAIT_FOR_RETRYING_A_COMMAND) {
- let command = commandsWaitingConfirmation.get(nonce)
- commandsWaitingConfirmation.delete(nonce)
- commandsSentByTimestamp.delete(nonce)
+ function sendCommand(command, responseCallBack, eventsCallBack) {
+ if (command.action === 'listenToEvent') {
+ let key
+ if (command.callerId !== undefined) {
+ key = command.eventHandlerName + '-' + command.eventType + '-' + command.callerId
+ } else {
+ key = command.eventHandlerName + '-' + command.eventType
+ }
+ eventListeners.set(key, eventsCallBack)
+ }
+ if (command.callerId && responseCallBack) {
+ responseWaiters.set(command.callerId, responseCallBack)
+ }
sendToWebSocketServer(command)
- }
- }
- }
-
- function physics () {
- if (WEB_SOCKETS_CONNECTION !== undefined) {
- if (WEB_SOCKETS_CONNECTION.readyState === 3) { // Connection closed. May happen after computer goes to sleep.
- setuptWebSockets(onOpen)
- function onOpen () {
- if (INFO_LOG === true) { logger.write('[INFO] setuptWebSockets -> Found Web Sockets Connection Closed. Reconnected to WebSockets Server.') }
- }
- }
}
- if (thisObject.isConnected() !== true) {
- canvas.cockpitSpace.setStatus('Connecting to Superalgos Backend at ' + hostName + ' Network Node. Please wait until the connection is established.', 100, canvas.cockpitSpace.statusTypes.WARNING)
- } else {
- retryCommandsPhysics()
+ function sendToWebSocketServer(command) {
+ nonce++
+ let stringNonce = nonce.toString()
+ let timestamp = (new Date()).valueOf()
+ commandsWaitingConfirmation.set(stringNonce, command)
+ commandsSentByTimestamp.set(stringNonce, timestamp)
+
+ let messageToWebSocketServer = 'Web Browser' + '|*|' + stringNonce + '|*|' + JSON.stringify(command)
+
+ if (WEB_SOCKETS_CONNECTION.readyState === 1) {
+ WEB_SOCKETS_CONNECTION.send(messageToWebSocketServer)
+ } else {
+ console.log('WebSocket message could not be sent because the connection was not ready. Will retry soon. Message = ' + JSON.stringify(command))
+ }
}
- DEBUG.variable4 = 'Commands Waiting For Confirmation from WS Server: ' + commandsWaitingConfirmation.size
- }
-
- function setuptWebSockets (callBackFunction) {
- try {
- WEB_SOCKETS_CONNECTION = new WebSocket(WEB_SOCKETS_URL)
- WEB_SOCKETS_CONNECTION.onerror = error => {
- console.log('WebSocket error:' + JSON.stringify(error))
- }
- WEB_SOCKETS_CONNECTION.onopen = () => {
- if (callBackFunction !== undefined) {
- callBackFunction()
+ function createEventHandler(eventHandlerName, callerId, responseCallBack) {
+ let eventCommand = {
+ action: 'createEventHandler',
+ eventHandlerName: eventHandlerName,
+ callerId: callerId
+ }
+ sendCommand(eventCommand, responseCallBack)
+ }
+
+ function deleteEventHandler(eventHandlerName, callerId, responseCallBack) {
+ let eventCommand = {
+ action: 'deleteEventHandler',
+ eventHandlerName: eventHandlerName,
+ callerId: callerId
+ }
+ sendCommand(eventCommand, responseCallBack)
+ }
+
+ function listenToEvent(eventHandlerName, eventType, extraData, callerId, responseCallBack, eventsCallBack) {
+ let eventCommand = {
+ action: 'listenToEvent',
+ eventHandlerName: eventHandlerName,
+ eventType: eventType,
+ extraData: extraData,
+ callerId: callerId
+ }
+ sendCommand(eventCommand, responseCallBack, eventsCallBack)
+ }
+
+ function stopListening(eventHandlerName, eventSubscriptionId, callerId, responseCallBack) {
+ let eventCommand = {
+ action: 'stopListening',
+ eventHandlerName: eventHandlerName,
+ eventSubscriptionId: eventSubscriptionId,
+ callerId: callerId
+ }
+ sendCommand(eventCommand, responseCallBack)
+ }
+
+ function raiseEvent(eventHandlerName, eventType, event, callerId, responseCallBack) {
+ let eventCommand = {
+ action: 'raiseEvent',
+ eventHandlerName: eventHandlerName,
+ eventType: eventType,
+ event: event,
+ callerId: callerId
+ }
+ sendCommand(eventCommand, responseCallBack)
+ }
+
+ function retryCommandsPhysics() {
+ commandsSentByTimestamp.forEach(checkTimestamp)
+
+ function checkTimestamp(timestamp, nonce) {
+ const MILISECONDS_TO_WAIT_FOR_RETRYING_A_COMMAND = 10000
+ let now = (new Date()).valueOf()
+
+ if ((now - timestamp) > MILISECONDS_TO_WAIT_FOR_RETRYING_A_COMMAND) {
+ let command = commandsWaitingConfirmation.get(nonce)
+ commandsWaitingConfirmation.delete(nonce)
+ commandsSentByTimestamp.delete(nonce)
+
+ sendToWebSocketServer(command)
+ }
+ }
+ }
+
+ function physics() {
+ if (WEB_SOCKETS_CONNECTION !== undefined) {
+ if (WEB_SOCKETS_CONNECTION.readyState === 3) { // Connection closed. May happen after computer goes to sleep.
+ setuptWebSockets(onOpen)
+ function onOpen() {
+ if (INFO_LOG === true) { logger.write('[INFO] setuptWebSockets -> Found Web Sockets Connection Closed. Reconnected to WebSockets Server.') }
+ }
+ }
+ }
+
+ if (thisObject.isConnected() !== true) {
+ canvas.cockpitSpace.setStatus('Connecting to Superalgos Backend at ' + hostName + ' Network Node. Please wait until the connection is established.', 100, canvas.cockpitSpace.statusTypes.WARNING)
+ } else {
+ retryCommandsPhysics()
+ }
+
+ DEBUG.variable4 = 'Commands Waiting For Confirmation from WS Server: ' + commandsWaitingConfirmation.size
+ }
+
+ function setuptWebSockets(callBackFunction) {
+ try {
+ WEB_SOCKETS_CONNECTION = new WebSocket(WEB_SOCKETS_URL)
+ WEB_SOCKETS_CONNECTION.onerror = error => {
+ console.log('WebSocket error:' + JSON.stringify(error))
+ }
+ WEB_SOCKETS_CONNECTION.onopen = () => {
+ if (callBackFunction !== undefined) {
+ callBackFunction()
+ }
+ }
+ WEB_SOCKETS_CONNECTION.onmessage = e => {
+ // console.log('Websoked Message Received: ' + e.data)
+
+ let message = JSON.parse(e.data)
+
+ if (message.action === 'Event Raised') {
+ let key
+ if (message.callerId !== undefined) {
+ key = message.eventHandlerName + '-' + message.eventType + '-' + message.callerId
+ } else {
+ key = message.eventHandlerName + '-' + message.eventType
+ }
+ let handler = eventListeners.get(key)
+ if (handler) {
+ handler(message)
+ }
+ return
+ }
+
+ if (message.action === 'Event Server Response') {
+ let handler = responseWaiters.get(message.callerId)
+ if (handler) {
+ handler(message)
+ }
+ return
+ }
+
+ if (message.action === 'Acknowledge') {
+ commandsWaitingConfirmation.delete(message.nonce)
+ commandsSentByTimestamp.delete(message.nonce)
+ return
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] setuptWebSockets -> err = ' + err.stack) }
}
- }
- WEB_SOCKETS_CONNECTION.onmessage = e => {
- // console.log('Websoked Message Received: ' + e.data)
-
- let message = JSON.parse(e.data)
-
- if (message.action === 'Event Raised') {
- let key
- if (message.callerId !== undefined) {
- key = message.eventHandlerName + '-' + message.eventType + '-' + message.callerId
- } else {
- key = message.eventHandlerName + '-' + message.eventType
- }
- let handler = eventListeners.get(key)
- if (handler) {
- handler(message)
- }
- return
- }
-
- if (message.action === 'Event Server Response') {
- let handler = responseWaiters.get(message.callerId)
- if (handler) {
- handler(message)
- }
- return
- }
-
- if (message.action === 'Acknowledge') {
- commandsWaitingConfirmation.delete(message.nonce)
- commandsSentByTimestamp.delete(message.nonce)
- return
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] setuptWebSockets -> err = ' + err.stack) }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/BusyProgressBar.js b/CanvasApp/FloatingSpace/BusyProgressBar.js
index a3c846b38..4b325000a 100644
--- a/CanvasApp/FloatingSpace/BusyProgressBar.js
+++ b/CanvasApp/FloatingSpace/BusyProgressBar.js
@@ -1,72 +1,72 @@
-function newBusyProgressBar () {
- const MODULE_NAME = 'Circular Progress Bar'
+function newBusyProgressBar() {
+ const MODULE_NAME = 'Circular Progress Bar'
- let thisObject = {
- container: undefined,
- isDeployed: undefined,
- visible: undefined,
- physics: physics,
- draw: draw,
- finalize: finalize,
- initialize: initialize
- }
-
- let position
- let addRadius
-
- let eventSubscriptionHeartbeat
-
- return thisObject
-
- function finalize () {
- thisObject.payload = undefined
- thisObject.fitFunction = undefined
- }
-
- function initialize (pPosition) {
- position = pPosition
-
- addRadius = 0
- }
-
- function physics () {
- addRadius = addRadius + 20
- }
-
- function draw () {
- if (thisObject.visible !== true) { return }
-
- let visiblePosition = {
- x: position.x,
- y: position.y
+ let thisObject = {
+ container: undefined,
+ isDeployed: undefined,
+ visible: undefined,
+ physics: physics,
+ draw: draw,
+ finalize: finalize,
+ initialize: initialize
}
- visiblePosition = thisObject.fitFunction(visiblePosition)
+ let position
+ let addRadius
- const RADIUS = 10 + addRadius
- let OPACITY = 1
+ let eventSubscriptionHeartbeat
- let initialAngle = 0
- let finalAngle = Math.PI * 2
+ return thisObject
- browserCanvasContext.beginPath()
+ function finalize() {
+ thisObject.payload = undefined
+ thisObject.fitFunction = undefined
+ }
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, RADIUS, initialAngle, finalAngle, false)
- browserCanvasContext.closePath()
+ function initialize(pPosition) {
+ position = pPosition
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', 1)'
+ addRadius = 0
+ }
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY * 2 + ')'
- browserCanvasContext.lineWidth = 15
- browserCanvasContext.setLineDash([3, 4])
+ function physics() {
+ addRadius = addRadius + 20
+ }
- browserCanvasContext.stroke()
+ function draw() {
+ if (thisObject.visible !== true) { return }
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([3, 4])
- browserCanvasContext.stroke()
- }
+ let visiblePosition = {
+ x: position.x,
+ y: position.y
+ }
+
+ visiblePosition = thisObject.fitFunction(visiblePosition)
+
+ const RADIUS = 10 + addRadius
+ let OPACITY = 1
+
+ let initialAngle = 0
+ let finalAngle = Math.PI * 2
+
+ browserCanvasContext.beginPath()
+
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, RADIUS, initialAngle, finalAngle, false)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', 1)'
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY * 2 + ')'
+ browserCanvasContext.lineWidth = 15
+ browserCanvasContext.setLineDash([3, 4])
+
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([3, 4])
+ browserCanvasContext.stroke()
+ }
}
diff --git a/CanvasApp/FloatingSpace/CircularMenu.js b/CanvasApp/FloatingSpace/CircularMenu.js
index 0ac7ccad9..efc2dda46 100644
--- a/CanvasApp/FloatingSpace/CircularMenu.js
+++ b/CanvasApp/FloatingSpace/CircularMenu.js
@@ -1,224 +1,224 @@
-function newCircularMenu () {
- const MODULE_NAME = 'Circular Menu'
+function newCircularMenu() {
+ const MODULE_NAME = 'Circular Menu'
- let thisObject = {
- container: undefined,
- isDeployed: undefined,
- internalClick: internalClick,
- physics: physics,
- invisiblePhysics: invisiblePhysics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME, 'Circle')
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
-
- let menuItems = []
-
- let selfFocusEventSubscriptionId
- let selfNotFocuskEventSubscriptionId
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(selfFocusEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfNotFocuskEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
-
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- menuItem.finalize()
+ let thisObject = {
+ container: undefined,
+ isDeployed: undefined,
+ internalClick: internalClick,
+ physics: physics,
+ invisiblePhysics: invisiblePhysics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- menuItems = undefined
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME, 'Circle')
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.radius = 0
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
- function initialize (menuItemsInitialValues, payload) {
-/* Create the array of Menu Items */
+ let menuItems = []
- let iconAndTextArray = []
- let iconOnlyArray
- let ringsArray = [[], [], [], []]
+ let selfFocusEventSubscriptionId
+ let selfNotFocuskEventSubscriptionId
- for (let i = 0; i < menuItemsInitialValues.length; i++) {
- let menuItem = newCircularMenuItem()
- let menuItemInitialValue = menuItemsInitialValues[i]
+ return thisObject
- menuItem.action = menuItemInitialValue.action
- menuItem.actionFunction = menuItemInitialValue.actionFunction
- menuItem.actionStatus = menuItemInitialValue.actionStatus
- menuItem.label = menuItemInitialValue.label
- menuItem.workingLabel = menuItemInitialValue.workingLabel
- menuItem.workDoneLabel = menuItemInitialValue.workDoneLabel
- menuItem.workFailedLabel = menuItemInitialValue.workFailedLabel
- menuItem.secondaryAction = menuItemInitialValue.secondaryAction
- menuItem.secondaryLabel = menuItemInitialValue.secondaryLabel
- menuItem.secondaryWorkingLabel = menuItemInitialValue.secondaryWorkingLabel
- menuItem.secondaryWorkDoneLabel = menuItemInitialValue.secondaryWorkDoneLabel
- menuItem.secondaryWorkFailedLabel = menuItemInitialValue.secondaryWorkFailedLabel
- menuItem.secondaryIcon = menuItemInitialValue.secondaryIcon
- menuItem.visible = menuItemInitialValue.visible
- menuItem.iconPathOn = menuItemInitialValue.iconPathOn
- menuItem.iconPathOff = menuItemInitialValue.iconPathOff
- menuItem.rawRadius = menuItemInitialValue.rawRadius
- menuItem.targetRadius = menuItemInitialValue.label
- menuItem.currentRadius = menuItemInitialValue.currentRadius
- menuItem.angle = menuItemInitialValue.angle
- menuItem.currentStatus = menuItemInitialValue.currentStatus
- menuItem.relatedUiObject = menuItemInitialValue.relatedUiObject
- menuItem.dontShowAtFullscreen = menuItemInitialValue.dontShowAtFullscreen
- menuItem.askConfirmation = menuItemInitialValue.askConfirmation
- menuItem.confirmationLabel = menuItemInitialValue.confirmationLabel
- menuItem.disableIfPropertyIsDefined = menuItemInitialValue.disableIfPropertyIsDefined
- menuItem.propertyToCheckFor = menuItemInitialValue.propertyToCheckFor
- menuItem.ring = menuItemInitialValue.ring
- menuItem.icons = menuItemInitialValue.icons
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(selfFocusEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfNotFocuskEventSubscriptionId)
- if (menuItem.label === undefined) {
- menuItem.type = 'Icon Only'
+ thisObject.container.finalize()
+ thisObject.container = undefined
- if (menuItem.ring === undefined) {
- menutItem.ring = 1
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ menuItem.finalize()
}
- iconOnlyArray = ringsArray[menuItem.ring - 1]
- iconOnlyArray.push(menuItem)
- } else {
- menuItem.type = 'Icon & Text'
- iconAndTextArray.push(menuItem)
- }
- menuItem.initialize(payload)
- menuItem.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true)
- menuItems.push(menuItem)
+ menuItems = undefined
}
- /* There are 4 possible rings of icons, we will go through each of them here. */
- let amplitudeArray = [80, 50, 40, 80]
- let initialAngleArray = [220, 205, 200, 180]
- for (let j = 1; j < ringsArray.length + 1; j++) {
- let iconOnlyArray = ringsArray[j - 1]
- /* Here we calculate the angles for each menu item, and then apply it if it was not previously defined. */
- let amplitude = amplitudeArray[j - 1]
- let initialAngle = initialAngleArray[j - 1]
- let step = amplitude / (iconOnlyArray.length - 1)
- if (iconOnlyArray.length === 1) {
- step = 0
- }
+ function initialize(menuItemsInitialValues, payload) {
+ /* Create the array of Menu Items */
- for (let i = 0; i < iconOnlyArray.length; i++) {
- let menuItem = iconOnlyArray[i]
- let angle = initialAngle - step * i
- if (menuItem.angle === undefined) {
- menuItem.angle = angle
+ let iconAndTextArray = []
+ let iconOnlyArray
+ let ringsArray = [[], [], [], []]
+
+ for (let i = 0; i < menuItemsInitialValues.length; i++) {
+ let menuItem = newCircularMenuItem()
+ let menuItemInitialValue = menuItemsInitialValues[i]
+
+ menuItem.action = menuItemInitialValue.action
+ menuItem.actionFunction = menuItemInitialValue.actionFunction
+ menuItem.actionStatus = menuItemInitialValue.actionStatus
+ menuItem.label = menuItemInitialValue.label
+ menuItem.workingLabel = menuItemInitialValue.workingLabel
+ menuItem.workDoneLabel = menuItemInitialValue.workDoneLabel
+ menuItem.workFailedLabel = menuItemInitialValue.workFailedLabel
+ menuItem.secondaryAction = menuItemInitialValue.secondaryAction
+ menuItem.secondaryLabel = menuItemInitialValue.secondaryLabel
+ menuItem.secondaryWorkingLabel = menuItemInitialValue.secondaryWorkingLabel
+ menuItem.secondaryWorkDoneLabel = menuItemInitialValue.secondaryWorkDoneLabel
+ menuItem.secondaryWorkFailedLabel = menuItemInitialValue.secondaryWorkFailedLabel
+ menuItem.secondaryIcon = menuItemInitialValue.secondaryIcon
+ menuItem.visible = menuItemInitialValue.visible
+ menuItem.iconPathOn = menuItemInitialValue.iconPathOn
+ menuItem.iconPathOff = menuItemInitialValue.iconPathOff
+ menuItem.rawRadius = menuItemInitialValue.rawRadius
+ menuItem.targetRadius = menuItemInitialValue.label
+ menuItem.currentRadius = menuItemInitialValue.currentRadius
+ menuItem.angle = menuItemInitialValue.angle
+ menuItem.currentStatus = menuItemInitialValue.currentStatus
+ menuItem.relatedUiObject = menuItemInitialValue.relatedUiObject
+ menuItem.dontShowAtFullscreen = menuItemInitialValue.dontShowAtFullscreen
+ menuItem.askConfirmation = menuItemInitialValue.askConfirmation
+ menuItem.confirmationLabel = menuItemInitialValue.confirmationLabel
+ menuItem.disableIfPropertyIsDefined = menuItemInitialValue.disableIfPropertyIsDefined
+ menuItem.propertyToCheckFor = menuItemInitialValue.propertyToCheckFor
+ menuItem.ring = menuItemInitialValue.ring
+ menuItem.icons = menuItemInitialValue.icons
+
+ if (menuItem.label === undefined) {
+ menuItem.type = 'Icon Only'
+
+ if (menuItem.ring === undefined) {
+ menutItem.ring = 1
+ }
+ iconOnlyArray = ringsArray[menuItem.ring - 1]
+ iconOnlyArray.push(menuItem)
+ } else {
+ menuItem.type = 'Icon & Text'
+ iconAndTextArray.push(menuItem)
+ }
+
+ menuItem.initialize(payload)
+ menuItem.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true)
+ menuItems.push(menuItem)
}
- }
- }
- /* Text and Icon */
- let amplitude = 140
- let initialAngle = -70
- step = amplitude / 7
- let currentItem = (7 - iconAndTextArray.length) / 2 + 1
- for (let i = 0; i < iconAndTextArray.length; i++) {
- let menuItem = iconAndTextArray[i]
- let angle = initialAngle + step * (currentItem - 0.5)
- currentItem++
- if (menuItem.angle === undefined) {
- menuItem.angle = angle
- }
- }
- iconOnlyArray = undefined
- iconAndTextArray = undefined
+ /* There are 4 possible rings of icons, we will go through each of them here. */
+ let amplitudeArray = [80, 50, 40, 80]
+ let initialAngleArray = [220, 205, 200, 180]
+ for (let j = 1; j < ringsArray.length + 1; j++) {
+ let iconOnlyArray = ringsArray[j - 1]
+ /* Here we calculate the angles for each menu item, and then apply it if it was not previously defined. */
+ let amplitude = amplitudeArray[j - 1]
+ let initialAngle = initialAngleArray[j - 1]
+ let step = amplitude / (iconOnlyArray.length - 1)
+ if (iconOnlyArray.length === 1) {
+ step = 0
+ }
- /* Listen to events */
- selfFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onFocus', onFocus)
- selfNotFocuskEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onNotFocus', onNotFocus)
- }
-
- function getContainer (point) {
- let container
-
- if (thisObject.isDeployed === true) {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- if (menuItem.visible === true) {
- container = menuItem.getContainer(point)
+ for (let i = 0; i < iconOnlyArray.length; i++) {
+ let menuItem = iconOnlyArray[i]
+ let angle = initialAngle - step * i
+ if (menuItem.angle === undefined) {
+ menuItem.angle = angle
+ }
+ }
}
- if (container !== undefined) { return container }
- }
- }
- }
-
- function internalClick (action) {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- if (menuItem.visible === true) {
- if (menuItem.nextAction === action) {
- menuItem.internalClick()
+ /* Text and Icon */
+ let amplitude = 140
+ let initialAngle = -70
+ step = amplitude / 7
+ let currentItem = (7 - iconAndTextArray.length) / 2 + 1
+ for (let i = 0; i < iconAndTextArray.length; i++) {
+ let menuItem = iconAndTextArray[i]
+ let angle = initialAngle + step * (currentItem - 0.5)
+ currentItem++
+ if (menuItem.angle === undefined) {
+ menuItem.angle = angle
+ }
}
- }
- }
- }
- function invisiblePhysics () {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- menuItem.invisiblePhysics()
- }
- }
+ iconOnlyArray = undefined
+ iconAndTextArray = undefined
- function physics () {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- menuItem.physics()
+ /* Listen to events */
+ selfFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onFocus', onFocus)
+ selfNotFocuskEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onNotFocus', onNotFocus)
}
- }
- function onFocus () {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- menuItem.targetRadius = menuItem.rawRadius * 1.5
- menuItem.isDeployed = true
- }
- thisObject.isDeployed = true
- }
+ function getContainer(point) {
+ let container
- function onNotFocus () {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- menuItem.targetRadius = menuItem.rawRadius * 0 - i * 1.5
- menuItem.isDeployed = false
+ if (thisObject.isDeployed === true) {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ if (menuItem.visible === true) {
+ container = menuItem.getContainer(point)
+ }
+ if (container !== undefined) { return container }
+ }
+ }
}
- thisObject.isDeployed = false
- }
- function drawBackground (pFloatingObject) {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- if (menuItem.visible === true) {
- menuItem.drawBackground()
- }
+ function internalClick(action) {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ if (menuItem.visible === true) {
+ if (menuItem.nextAction === action) {
+ menuItem.internalClick()
+ }
+ }
+ }
}
- }
- function drawForeground (pFloatingObject) {
- for (let i = 0; i < menuItems.length; i++) {
- let menuItem = menuItems[i]
- if (menuItem.visible === true) {
- menuItem.drawForeground()
- }
+ function invisiblePhysics() {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ menuItem.invisiblePhysics()
+ }
+ }
+
+ function physics() {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ menuItem.physics()
+ }
+ }
+
+ function onFocus() {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ menuItem.targetRadius = menuItem.rawRadius * 1.5
+ menuItem.isDeployed = true
+ }
+ thisObject.isDeployed = true
+ }
+
+ function onNotFocus() {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ menuItem.targetRadius = menuItem.rawRadius * 0 - i * 1.5
+ menuItem.isDeployed = false
+ }
+ thisObject.isDeployed = false
+ }
+
+ function drawBackground(pFloatingObject) {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ if (menuItem.visible === true) {
+ menuItem.drawBackground()
+ }
+ }
+ }
+
+ function drawForeground(pFloatingObject) {
+ for (let i = 0; i < menuItems.length; i++) {
+ let menuItem = menuItems[i]
+ if (menuItem.visible === true) {
+ menuItem.drawForeground()
+ }
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/CircularMenuItem.js b/CanvasApp/FloatingSpace/CircularMenuItem.js
index e344d69fc..dd32c595a 100644
--- a/CanvasApp/FloatingSpace/CircularMenuItem.js
+++ b/CanvasApp/FloatingSpace/CircularMenuItem.js
@@ -1,469 +1,469 @@
-function newCircularMenuItem () {
- const MODULE_NAME = 'Circular Menu Iem'
+function newCircularMenuItem() {
+ const MODULE_NAME = 'Circular Menu Iem'
- let thisObject = {
- type: undefined,
- isDeployed: undefined,
- askConfirmation: undefined,
- confirmationLabel: undefined,
- iconOn: undefined,
- iconOff: undefined,
- icons: undefined,
- currentIcon: undefined,
- disableIfPropertyIsDefined: undefined,
- propertyToCheckFor: undefined,
- action: undefined,
- actionFunction: undefined,
- actionStatus: undefined,
- label: undefined,
- workingLabel: undefined,
- workDoneLabel: undefined,
- workFailedLabel: undefined,
- secondaryAction: undefined,
- secondaryLabel: undefined,
- secondaryWorkingLabel: undefined,
- secondaryWorkDoneLabel: undefined,
- secondaryWorkFailedLabel: undefined,
- secondaryIcon: undefined,
- nextAction: undefined,
- visible: false,
- iconPathOn: undefined,
- iconPathOff: undefined,
- rawRadius: undefined,
- targetRadius: undefined,
- currentRadius: undefined,
- angle: undefined,
- container: undefined,
- payload: undefined,
- relatedUiObject: undefined,
- dontShowAtFullscreen: undefined,
- isEnabled: true,
- shorcutNumber: undefined,
- internalClick: internalClick,
- physics: physics,
- invisiblePhysics: invisiblePhysics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
- thisObject.container.detectMouseOver = true
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
- thisObject.container.frame.width = 0
- thisObject.container.frame.height = 40
-
- let isMouseOver = false
-
- let selfMouseOverEventSubscriptionId
- let selfMouseClickEventSubscriptionId
- let selfMouseNotOverEventSubscriptionId
-
- let labelToPrint = ''
- let defaultBackgroudColor = UI_COLOR.RED
- let backgroundColorToUse = UI_COLOR.RED
- let temporaryStatus = 0
- let temporaryStatusCounter = 0
-
- const EXTRA_MOUSE_OVER_ICON_SIZE = 6
-
- const STATUS_NO_ACTION_TAKEN_YET = 0
- const STATUS_PRIMARY_ACTION_WORKING = -1
- const STATUS_SECONDARY_ACTION_WORKING = -2
- const STATUS_PRIMARY_WORK_DONE = -3
- const STATUS_PRIMARY_WORK_FAILED = -4
- const STATUS_WAITING_CONFIRMATION = -5
- const STATUS_SECONDARY_WORK_DONE = -6
- const STATUS_SECONDARY_WORK_FAILED = -7
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(selfMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfMouseNotOverEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.iconOn = undefined
- thisObject.iconOff = undefined
- thisObject.icons = undefined
- thisObject.currentIcon = undefined
- thisObject.payload = undefined
- thisObject.actionFunction = undefined
- thisObject.actionStatus = undefined
- thisObject.disableIfPropertyIsDefined = undefined
- thisObject.propertyToCheckFor = undefined
- }
-
- function initialize (pPayload) {
- thisObject.payload = pPayload
-
- iconPhysics()
-
- selfMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
- selfMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
-
- if (thisObject.type === 'Icon & Text') {
- thisObject.container.frame.width = 220
- } else {
- thisObject.container.frame.width = 50
+ let thisObject = {
+ type: undefined,
+ isDeployed: undefined,
+ askConfirmation: undefined,
+ confirmationLabel: undefined,
+ iconOn: undefined,
+ iconOff: undefined,
+ icons: undefined,
+ currentIcon: undefined,
+ disableIfPropertyIsDefined: undefined,
+ propertyToCheckFor: undefined,
+ action: undefined,
+ actionFunction: undefined,
+ actionStatus: undefined,
+ label: undefined,
+ workingLabel: undefined,
+ workDoneLabel: undefined,
+ workFailedLabel: undefined,
+ secondaryAction: undefined,
+ secondaryLabel: undefined,
+ secondaryWorkingLabel: undefined,
+ secondaryWorkDoneLabel: undefined,
+ secondaryWorkFailedLabel: undefined,
+ secondaryIcon: undefined,
+ nextAction: undefined,
+ visible: false,
+ iconPathOn: undefined,
+ iconPathOff: undefined,
+ rawRadius: undefined,
+ targetRadius: undefined,
+ currentRadius: undefined,
+ angle: undefined,
+ container: undefined,
+ payload: undefined,
+ relatedUiObject: undefined,
+ dontShowAtFullscreen: undefined,
+ isEnabled: true,
+ shorcutNumber: undefined,
+ internalClick: internalClick,
+ physics: physics,
+ invisiblePhysics: invisiblePhysics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- thisObject.nextAction = thisObject.action
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+ thisObject.container.detectMouseOver = true
+ thisObject.container.frame.radius = 0
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
+ thisObject.container.frame.width = 0
+ thisObject.container.frame.height = 40
- function getContainer (point) {
- if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
+ let isMouseOver = false
- let container
- if (thisObject.isDeployed === true) {
- if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
- }
+ let selfMouseOverEventSubscriptionId
+ let selfMouseClickEventSubscriptionId
+ let selfMouseNotOverEventSubscriptionId
- function invisiblePhysics () {
- temporaryStatusPhysics()
- }
+ let labelToPrint = ''
+ let defaultBackgroudColor = UI_COLOR.RED
+ let backgroundColorToUse = UI_COLOR.RED
+ let temporaryStatus = 0
+ let temporaryStatusCounter = 0
- function temporaryStatusPhysics () {
- /* Temporary Status impacts on the label to use and the background of that label */
- if (temporaryStatusCounter > 0) {
- temporaryStatusCounter--
+ const EXTRA_MOUSE_OVER_ICON_SIZE = 6
+
+ const STATUS_NO_ACTION_TAKEN_YET = 0
+ const STATUS_PRIMARY_ACTION_WORKING = -1
+ const STATUS_SECONDARY_ACTION_WORKING = -2
+ const STATUS_PRIMARY_WORK_DONE = -3
+ const STATUS_PRIMARY_WORK_FAILED = -4
+ const STATUS_WAITING_CONFIRMATION = -5
+ const STATUS_SECONDARY_WORK_DONE = -6
+ const STATUS_SECONDARY_WORK_FAILED = -7
+
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(selfMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfMouseNotOverEventSubscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.iconOn = undefined
+ thisObject.iconOff = undefined
+ thisObject.icons = undefined
+ thisObject.currentIcon = undefined
+ thisObject.payload = undefined
+ thisObject.actionFunction = undefined
+ thisObject.actionStatus = undefined
+ thisObject.disableIfPropertyIsDefined = undefined
+ thisObject.propertyToCheckFor = undefined
}
- if (temporaryStatusCounter === 0) {
- temporaryStatus = STATUS_NO_ACTION_TAKEN_YET
- labelToPrint = thisObject.label
- backgroundColorToUse = defaultBackgroudColor
- thisObject.nextAction = thisObject.action
- }
- }
+ function initialize(pPayload) {
+ thisObject.payload = pPayload
- function physics () {
- if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
+ iconPhysics()
- let INCREASE_STEP = 2 // (thisObject.targetRadius - thisObject.rawRadius) / 4
- // if (INCREASE_STEP === 0) { INCREASE_STEP = 2 }
+ selfMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ selfMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= INCREASE_STEP) {
- if (thisObject.currentRadius < thisObject.targetRadius) {
- thisObject.currentRadius = thisObject.currentRadius + INCREASE_STEP
- } else {
- thisObject.currentRadius = thisObject.currentRadius - INCREASE_STEP
- }
- }
-
- let radiusGrowthFactor
- if (thisObject.type === 'Icon Only') {
- switch (thisObject.ring) {
- case 1: {
- radiusGrowthFactor = 5.5
- break
- }
- case 2: {
- radiusGrowthFactor = 4.0
- break
- }
- case 3: {
- radiusGrowthFactor = 3.0
- break
- }
- case 4: {
- radiusGrowthFactor = 2.0
- break
- }
- }
- } else {
- radiusGrowthFactor = 4
- }
-
- thisObject.container.frame.position.x = thisObject.payload.floatingObject.targetRadius * radiusGrowthFactor / 7 * Math.cos(toRadians(thisObject.angle)) - thisObject.currentRadius * 1.5
- thisObject.container.frame.position.y = thisObject.payload.floatingObject.targetRadius * radiusGrowthFactor / 7 * Math.sin(toRadians(thisObject.angle)) - thisObject.container.frame.height / 2
-
- temporaryStatusPhysics()
-
- /* Here we will check if we need to monitor a property that influences the status of the Menu Item. */
- if (thisObject.disableIfPropertyIsDefined === true) {
- if (thisObject.payload.node[thisObject.propertyToCheckFor] === undefined) {
- /* This menu item is enabled. */
- thisObject.isEnabled = true
- } else {
- /* This menu item is disabled. */
- thisObject.isEnabled = false
- }
- }
- iconPhysics()
- }
-
- function iconPhysics () {
- if (
- (
- temporaryStatus === STATUS_PRIMARY_WORK_DONE ||
- temporaryStatus === STATUS_SECONDARY_ACTION_WORKING ||
- temporaryStatus === STATUS_SECONDARY_WORK_DONE ||
- temporaryStatus === STATUS_SECONDARY_WORK_FAILED
- ) && thisObject.secondaryAction !== undefined
- ) {
- thisObject.iconOn = canvas.designSpace.iconCollection.get(thisObject.secondaryIcon)
- thisObject.iconOff = canvas.designSpace.iconCollection.get(thisObject.secondaryIcon)
- } else {
- if (thisObject.relatedUiObject !== undefined) {
- thisObject.iconOn = canvas.designSpace.iconByUiObjectType.get(thisObject.relatedUiObject)
- thisObject.iconOff = canvas.designSpace.iconByUiObjectType.get(thisObject.relatedUiObject)
- } else {
- if (thisObject.iconPathOn !== undefined && thisObject.iconPathOff !== undefined) {
- thisObject.iconOn = canvas.designSpace.iconCollection.get(thisObject.iconPathOn)
- thisObject.iconOff = canvas.designSpace.iconCollection.get(thisObject.iconPathOff)
+ if (thisObject.type === 'Icon & Text') {
+ thisObject.container.frame.width = 220
} else {
- thisObject.iconOn = canvas.designSpace.iconCollection.get(thisObject.icons[thisObject.actionStatus()])
- thisObject.iconOff = canvas.designSpace.iconCollection.get(thisObject.icons[thisObject.actionStatus()])
+ thisObject.container.frame.width = 50
}
- }
+
+ thisObject.nextAction = thisObject.action
}
- /* Current Status might be linked to some other object status */
+ function getContainer(point) {
+ if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
- if (thisObject.actionStatus !== undefined) {
- thisObject.currentStatus = thisObject.actionStatus()
+ let container
+ if (thisObject.isDeployed === true) {
+ if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
}
- /* Current Status sets the icon to be used */
-
- if (thisObject.currentStatus === true) {
- thisObject.icon = thisObject.iconOn
- } else {
- thisObject.icon = thisObject.iconOff
- }
- }
-
- function onMouseOver (point) {
- if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
- isMouseOver = true
- } else {
- isMouseOver = false
- }
- MENU_ITEM_ON_FOCUS = thisObject
- }
-
- function onMouseNotOver (point) {
- isMouseOver = false
- MENU_ITEM_ON_FOCUS = undefined
- }
-
- function internalClick () {
- if (thisObject.shorcutNumber !== undefined) {
- let label = thisObject.payload.node.name + ' ' + labelToPrint
- canvas.cockpitSpace.setStatus(label, 50, canvas.cockpitSpace.statusTypes.ALL_GOOD)
+ function invisiblePhysics() {
+ temporaryStatusPhysics()
}
- onMouseClick()
- }
+ function temporaryStatusPhysics() {
+ /* Temporary Status impacts on the label to use and the background of that label */
+ if (temporaryStatusCounter > 0) {
+ temporaryStatusCounter--
+ }
- function onMouseClick () {
- if (thisObject.isEnabled === false) { return }
-
- if (thisObject.label === undefined) {
- /* This is what we have in the case of menu items that are only Icons. In this situation there is no complex logic, just execute the specified action. */
- thisObject.actionFunction(thisObject.payload, thisObject.action, thisObject.relatedUiObject)
- return
+ if (temporaryStatusCounter === 0) {
+ temporaryStatus = STATUS_NO_ACTION_TAKEN_YET
+ labelToPrint = thisObject.label
+ backgroundColorToUse = defaultBackgroudColor
+ thisObject.nextAction = thisObject.action
+ }
}
- if (thisObject.askConfirmation !== true) { /* No confirmation is needed */
- if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET || temporaryStatus === STATUS_PRIMARY_WORK_DONE) {
- executeAction()
- } // Any click out of those states is ignored
- } else {
- /* Confirmation is needed */
+ function physics() {
+ if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
- /* The first click ask for confirmation. */
- if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET) {
- setStatus(thisObject.confirmationLabel, UI_COLOR.GOLDEN_ORANGE, 250, STATUS_WAITING_CONFIRMATION)
- return
- }
- /* A Click during confirmation executes the pre-defined action. */
- if (temporaryStatus === STATUS_WAITING_CONFIRMATION || temporaryStatus === STATUS_PRIMARY_WORK_DONE) {
- executeAction()
- if (thisObject.workDoneLabel !== undefined) {
- setStatus(thisObject.workDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
+ let INCREASE_STEP = 2 // (thisObject.targetRadius - thisObject.rawRadius) / 4
+ // if (INCREASE_STEP === 0) { INCREASE_STEP = 2 }
+
+ if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= INCREASE_STEP) {
+ if (thisObject.currentRadius < thisObject.targetRadius) {
+ thisObject.currentRadius = thisObject.currentRadius + INCREASE_STEP
+ } else {
+ thisObject.currentRadius = thisObject.currentRadius - INCREASE_STEP
+ }
+ }
+
+ let radiusGrowthFactor
+ if (thisObject.type === 'Icon Only') {
+ switch (thisObject.ring) {
+ case 1: {
+ radiusGrowthFactor = 5.5
+ break
+ }
+ case 2: {
+ radiusGrowthFactor = 4.0
+ break
+ }
+ case 3: {
+ radiusGrowthFactor = 3.0
+ break
+ }
+ case 4: {
+ radiusGrowthFactor = 2.0
+ break
+ }
+ }
} else {
- setStatus('Done', UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
+ radiusGrowthFactor = 4
}
- return
- }
+
+ thisObject.container.frame.position.x = thisObject.payload.floatingObject.targetRadius * radiusGrowthFactor / 7 * Math.cos(toRadians(thisObject.angle)) - thisObject.currentRadius * 1.5
+ thisObject.container.frame.position.y = thisObject.payload.floatingObject.targetRadius * radiusGrowthFactor / 7 * Math.sin(toRadians(thisObject.angle)) - thisObject.container.frame.height / 2
+
+ temporaryStatusPhysics()
+
+ /* Here we will check if we need to monitor a property that influences the status of the Menu Item. */
+ if (thisObject.disableIfPropertyIsDefined === true) {
+ if (thisObject.payload.node[thisObject.propertyToCheckFor] === undefined) {
+ /* This menu item is enabled. */
+ thisObject.isEnabled = true
+ } else {
+ /* This menu item is disabled. */
+ thisObject.isEnabled = false
+ }
+ }
+ iconPhysics()
}
- function executeAction () {
- if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET || temporaryStatus === STATUS_WAITING_CONFIRMATION) {
- /* We need to execute the main Action */
- /* If there is a working label defined, we use it here. */
- if (thisObject.workingLabel !== undefined) {
- setStatus(thisObject.workingLabel, UI_COLOR.GREY, undefined, STATUS_PRIMARY_ACTION_WORKING) // Status will not expire, will only change with a callback. Mouse Clicks will be ignored.
+ function iconPhysics() {
+ if (
+ (
+ temporaryStatus === STATUS_PRIMARY_WORK_DONE ||
+ temporaryStatus === STATUS_SECONDARY_ACTION_WORKING ||
+ temporaryStatus === STATUS_SECONDARY_WORK_DONE ||
+ temporaryStatus === STATUS_SECONDARY_WORK_FAILED
+ ) && thisObject.secondaryAction !== undefined
+ ) {
+ thisObject.iconOn = canvas.designSpace.iconCollection.get(thisObject.secondaryIcon)
+ thisObject.iconOff = canvas.designSpace.iconCollection.get(thisObject.secondaryIcon)
+ } else {
+ if (thisObject.relatedUiObject !== undefined) {
+ thisObject.iconOn = canvas.designSpace.iconByUiObjectType.get(thisObject.relatedUiObject)
+ thisObject.iconOff = canvas.designSpace.iconByUiObjectType.get(thisObject.relatedUiObject)
+ } else {
+ if (thisObject.iconPathOn !== undefined && thisObject.iconPathOff !== undefined) {
+ thisObject.iconOn = canvas.designSpace.iconCollection.get(thisObject.iconPathOn)
+ thisObject.iconOff = canvas.designSpace.iconCollection.get(thisObject.iconPathOff)
+ } else {
+ thisObject.iconOn = canvas.designSpace.iconCollection.get(thisObject.icons[thisObject.actionStatus()])
+ thisObject.iconOff = canvas.designSpace.iconCollection.get(thisObject.icons[thisObject.actionStatus()])
+ }
+ }
}
- /* Execute the action and wait for callbacks to update our statuus. */
- thisObject.actionFunction(thisObject.payload, thisObject.action, thisObject.relatedUiObject, onPrimaryCallBack)
- return
- }
- if (temporaryStatus === STATUS_PRIMARY_WORK_DONE && thisObject.secondaryAction !== undefined) {
- /* We need to execute the secondary action. */
- if (thisObject.secondaryWorkingLabel !== undefined) {
- setStatus(thisObject.secondaryWorkingLabel, UI_COLOR.GREY, undefined, STATUS_SECONDARY_ACTION_WORKING) // Status will not expire, will only change with a callback. Mouse Clicks will be ignored.
+ /* Current Status might be linked to some other object status */
+
+ if (thisObject.actionStatus !== undefined) {
+ thisObject.currentStatus = thisObject.actionStatus()
}
- /* Execute the action and wait for callbacks to update our statuus. */
- thisObject.actionFunction(thisObject.payload, thisObject.secondaryAction, thisObject.relatedUiObject, onSecondaryCallBack)
- return
- }
+ /* Current Status sets the icon to be used */
- function onPrimaryCallBack (err, event) {
- /* While the primary action is being executed some event might have happen. Following we process the ones we can */
+ if (thisObject.currentStatus === true) {
+ thisObject.icon = thisObject.iconOn
+ } else {
+ thisObject.icon = thisObject.iconOff
+ }
+ }
- if (event !== undefined) {
- if (event.type === 'Secondary Action Already Executed') {
- setStatus(thisObject.secondaryWorkDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
+ function onMouseOver(point) {
+ if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
+ isMouseOver = true
+ } else {
+ isMouseOver = false
+ }
+ MENU_ITEM_ON_FOCUS = thisObject
+ }
+
+ function onMouseNotOver(point) {
+ isMouseOver = false
+ MENU_ITEM_ON_FOCUS = undefined
+ }
+
+ function internalClick() {
+ if (thisObject.shorcutNumber !== undefined) {
+ let label = thisObject.payload.node.name + ' ' + labelToPrint
+ canvas.cockpitSpace.setStatus(label, 50, canvas.cockpitSpace.statusTypes.ALL_GOOD)
+ }
+
+ onMouseClick()
+ }
+
+ function onMouseClick() {
+ if (thisObject.isEnabled === false) { return }
+
+ if (thisObject.label === undefined) {
+ /* This is what we have in the case of menu items that are only Icons. In this situation there is no complex logic, just execute the specified action. */
+ thisObject.actionFunction(thisObject.payload, thisObject.action, thisObject.relatedUiObject)
return
- }
}
- /* If there is a secondary action we will act different that if there is not */
- if (thisObject.secondaryAction === undefined) { // This means there are no more possible actions.
- if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
- if (thisObject.workDoneLabel !== undefined) {
- setStatus(thisObject.workDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_PRIMARY_WORK_DONE)
- }
- } else {
- if (thisObject.workFailedLabel != undefined) {
- setStatus(thisObject.workFailedLabel, UI_COLOR.TITANIUM_YELLOW, 100, STATUS_PRIMARY_WORK_FAILED)
- }
- }
+ if (thisObject.askConfirmation !== true) { /* No confirmation is needed */
+ if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET || temporaryStatus === STATUS_PRIMARY_WORK_DONE) {
+ executeAction()
+ } // Any click out of those states is ignored
} else {
- if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
- if (thisObject.workDoneLabel !== undefined) {
- thisObject.nextAction = thisObject.secondaryAction
- setStatus(thisObject.secondaryLabel, defaultBackgroudColor, undefined, STATUS_PRIMARY_WORK_DONE)
+ /* Confirmation is needed */
+
+ /* The first click ask for confirmation. */
+ if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET) {
+ setStatus(thisObject.confirmationLabel, UI_COLOR.GOLDEN_ORANGE, 250, STATUS_WAITING_CONFIRMATION)
+ return
}
- } else {
- if (thisObject.workFailedLabel != undefined) {
- setStatus(thisObject.workFailedLabel, UI_COLOR.TITANIUM_YELLOW, 100, STATUS_PRIMARY_WORK_FAILED)
+ /* A Click during confirmation executes the pre-defined action. */
+ if (temporaryStatus === STATUS_WAITING_CONFIRMATION || temporaryStatus === STATUS_PRIMARY_WORK_DONE) {
+ executeAction()
+ if (thisObject.workDoneLabel !== undefined) {
+ setStatus(thisObject.workDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
+ } else {
+ setStatus('Done', UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
+ }
+ return
}
- }
- }
- }
- function onSecondaryCallBack (err) {
- if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
- if (thisObject.secondaryWorkDoneLabel !== undefined) {
- setStatus(thisObject.secondaryWorkDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
- }
- } else {
- if (thisObject.secondaryWorkFailedLabel != undefined) {
- setStatus(thisObject.secondaryWorkFailedLabel, UI_COLOR.TITANIUM_YELLOW, 100, STATUS_SECONDARY_WORK_FAILED)
- }
- }
- }
- }
- }
-
- function setStatus (text, backgroundColor, waitingCycles, newStatus) {
- labelToPrint = text
- backgroundColorToUse = backgroundColor
- temporaryStatus = newStatus
- temporaryStatusCounter = newStatus // This will often put this into negatives numbers, which will disable the counting back and automatic reseting.
- if (waitingCycles !== undefined) { // This will override the often negative value with a positive one that will tend to zero onto the default state.
- temporaryStatusCounter = waitingCycles
- }
- }
-
- function drawBackground () {
- if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
-
- if (thisObject.container.frame.position.x > 0 && thisObject.isDeployed === true && thisObject.currentRadius >= thisObject.targetRadius) {
- if (thisObject.type === 'Icon & Text') {
- let backgroundColor = backgroundColorToUse
- if (thisObject.isEnabled === false) {
- backgroundColor = UI_COLOR.GREY
- }
- let params = {
- cornerRadius: 5,
- lineWidth: 0.1,
- container: thisObject.container,
- borderColor: UI_COLOR.DARK,
- backgroundColor: backgroundColor,
- castShadow: false,
- xOffset: 60
}
- if (isMouseOver === true) {
- params.opacity = 1
- } else {
- params.opacity = 0.8
+ function executeAction() {
+ if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET || temporaryStatus === STATUS_WAITING_CONFIRMATION) {
+ /* We need to execute the main Action */
+ /* If there is a working label defined, we use it here. */
+ if (thisObject.workingLabel !== undefined) {
+ setStatus(thisObject.workingLabel, UI_COLOR.GREY, undefined, STATUS_PRIMARY_ACTION_WORKING) // Status will not expire, will only change with a callback. Mouse Clicks will be ignored.
+ }
+
+ /* Execute the action and wait for callbacks to update our statuus. */
+ thisObject.actionFunction(thisObject.payload, thisObject.action, thisObject.relatedUiObject, onPrimaryCallBack)
+ return
+ }
+ if (temporaryStatus === STATUS_PRIMARY_WORK_DONE && thisObject.secondaryAction !== undefined) {
+ /* We need to execute the secondary action. */
+ if (thisObject.secondaryWorkingLabel !== undefined) {
+ setStatus(thisObject.secondaryWorkingLabel, UI_COLOR.GREY, undefined, STATUS_SECONDARY_ACTION_WORKING) // Status will not expire, will only change with a callback. Mouse Clicks will be ignored.
+ }
+
+ /* Execute the action and wait for callbacks to update our statuus. */
+ thisObject.actionFunction(thisObject.payload, thisObject.secondaryAction, thisObject.relatedUiObject, onSecondaryCallBack)
+ return
+ }
+
+ function onPrimaryCallBack(err, event) {
+ /* While the primary action is being executed some event might have happen. Following we process the ones we can */
+
+ if (event !== undefined) {
+ if (event.type === 'Secondary Action Already Executed') {
+ setStatus(thisObject.secondaryWorkDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
+ return
+ }
+ }
+
+ /* If there is a secondary action we will act different that if there is not */
+ if (thisObject.secondaryAction === undefined) { // This means there are no more possible actions.
+ if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ if (thisObject.workDoneLabel !== undefined) {
+ setStatus(thisObject.workDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_PRIMARY_WORK_DONE)
+ }
+ } else {
+ if (thisObject.workFailedLabel != undefined) {
+ setStatus(thisObject.workFailedLabel, UI_COLOR.TITANIUM_YELLOW, 100, STATUS_PRIMARY_WORK_FAILED)
+ }
+ }
+ } else {
+ if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ if (thisObject.workDoneLabel !== undefined) {
+ thisObject.nextAction = thisObject.secondaryAction
+ setStatus(thisObject.secondaryLabel, defaultBackgroudColor, undefined, STATUS_PRIMARY_WORK_DONE)
+ }
+ } else {
+ if (thisObject.workFailedLabel != undefined) {
+ setStatus(thisObject.workFailedLabel, UI_COLOR.TITANIUM_YELLOW, 100, STATUS_PRIMARY_WORK_FAILED)
+ }
+ }
+ }
+ }
+ function onSecondaryCallBack(err) {
+ if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ if (thisObject.secondaryWorkDoneLabel !== undefined) {
+ setStatus(thisObject.secondaryWorkDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 100, STATUS_SECONDARY_WORK_DONE)
+ }
+ } else {
+ if (thisObject.secondaryWorkFailedLabel != undefined) {
+ setStatus(thisObject.secondaryWorkFailedLabel, UI_COLOR.TITANIUM_YELLOW, 100, STATUS_SECONDARY_WORK_FAILED)
+ }
+ }
+ }
}
-
- roundedCornersBackground(params)
- }
- }
- }
-
- function drawForeground () {
- if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
-
- let menuPosition = {
- x: thisObject.currentRadius * 1.5,
- y: thisObject.container.frame.height / 2
}
- menuPosition = thisObject.container.frame.frameThisPoint(menuPosition)
+ function setStatus(text, backgroundColor, waitingCycles, newStatus) {
+ labelToPrint = text
+ backgroundColorToUse = backgroundColor
+ temporaryStatus = newStatus
+ temporaryStatusCounter = newStatus // This will often put this into negatives numbers, which will disable the counting back and automatic reseting.
+ if (waitingCycles !== undefined) { // This will override the often negative value with a positive one that will tend to zero onto the default state.
+ temporaryStatusCounter = waitingCycles
+ }
+ }
+
+ function drawBackground() {
+ if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
+
+ if (thisObject.container.frame.position.x > 0 && thisObject.isDeployed === true && thisObject.currentRadius >= thisObject.targetRadius) {
+ if (thisObject.type === 'Icon & Text') {
+ let backgroundColor = backgroundColorToUse
+ if (thisObject.isEnabled === false) {
+ backgroundColor = UI_COLOR.GREY
+ }
+ let params = {
+ cornerRadius: 5,
+ lineWidth: 0.1,
+ container: thisObject.container,
+ borderColor: UI_COLOR.DARK,
+ backgroundColor: backgroundColor,
+ castShadow: false,
+ xOffset: 60
+ }
+
+ if (isMouseOver === true) {
+ params.opacity = 1
+ } else {
+ params.opacity = 0.8
+ }
+
+ roundedCornersBackground(params)
+ }
+ }
+ }
+
+ function drawForeground() {
+ if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
+
+ let menuPosition = {
+ x: thisObject.currentRadius * 1.5,
+ y: thisObject.container.frame.height / 2
+ }
+
+ menuPosition = thisObject.container.frame.frameThisPoint(menuPosition)
/* Menu Item */
- let iconSize
- if (isMouseOver === true) {
- iconSize = thisObject.currentRadius + EXTRA_MOUSE_OVER_ICON_SIZE
- } else {
- iconSize = thisObject.currentRadius
- }
-
- if (thisObject.icon === undefined) { return }
- if (thisObject.icon.canDrawIcon === true && thisObject.currentRadius > 1 && thisObject.isDeployed === true) {
- browserCanvasContext.drawImage(thisObject.icon, menuPosition.x - iconSize, menuPosition.y - iconSize, iconSize * 2, iconSize * 2)
-
- /* Menu Label */
-
- if (thisObject.type === 'Icon & Text') {
- label = labelToPrint
- if (thisObject.shorcutNumber !== undefined) {
- label = '' + thisObject.shorcutNumber + '- ' + labelToPrint
+ let iconSize
+ if (isMouseOver === true) {
+ iconSize = thisObject.currentRadius + EXTRA_MOUSE_OVER_ICON_SIZE
+ } else {
+ iconSize = thisObject.currentRadius
}
- let labelPoint
- let fontSize = 15
+ if (thisObject.icon === undefined) { return }
+ if (thisObject.icon.canDrawIcon === true && thisObject.currentRadius > 1 && thisObject.isDeployed === true) {
+ browserCanvasContext.drawImage(thisObject.icon, menuPosition.x - iconSize, menuPosition.y - iconSize, iconSize * 2, iconSize * 2)
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ /* Menu Label */
- if (thisObject.currentRadius >= thisObject.targetRadius) {
- labelPoint = {
- x: menuPosition.x + thisObject.currentRadius + 25,
- y: menuPosition.y + fontSize * FONT_ASPECT_RATIO
- }
+ if (thisObject.type === 'Icon & Text') {
+ label = labelToPrint
+ if (thisObject.shorcutNumber !== undefined) {
+ label = '' + thisObject.shorcutNumber + '- ' + labelToPrint
+ }
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ let labelPoint
+ let fontSize = 15
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+
+ if (thisObject.currentRadius >= thisObject.targetRadius) {
+ labelPoint = {
+ x: menuPosition.x + thisObject.currentRadius + 25,
+ y: menuPosition.y + fontSize * FONT_ASPECT_RATIO
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
}
- }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/CircularProgressBar.js b/CanvasApp/FloatingSpace/CircularProgressBar.js
index d662589c8..070f55e22 100644
--- a/CanvasApp/FloatingSpace/CircularProgressBar.js
+++ b/CanvasApp/FloatingSpace/CircularProgressBar.js
@@ -1,146 +1,146 @@
-function newCircularProgressBar () {
- const MODULE_NAME = 'Circular Progress Bar'
+function newCircularProgressBar() {
+ const MODULE_NAME = 'Circular Progress Bar'
- let thisObject = {
- container: undefined,
- isDeployed: undefined,
- physics: physics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME, 'Circle')
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
-
- let opacityCounters = []
- let eventSubscriptionIdHeartbeat
- let needToDrawRing = true
- let eventsServerClient
-
- return thisObject
-
- function finalize () {
- finalizeEventsServerClient()
-
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.fitFunction = undefined
- }
-
- function finalizeEventsServerClient () {
- if (eventsServerClient !== undefined) {
- let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
- if (eventSubscriptionIdHeartbeat !== undefined) {
- eventsServerClient.stopListening(key, eventSubscriptionIdHeartbeat)
- }
- }
- }
-
- function initialize (payload, pEventsServerClient) {
- thisObject.payload = payload
-
- finalizeEventsServerClient()
- eventsServerClient = pEventsServerClient
-
- for (let i = 0; i < 60; i++) {
- opacityCounters.push(0)
+ let thisObject = {
+ container: undefined,
+ isDeployed: undefined,
+ physics: physics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
- eventsServerClient.listenToEvent(key, 'Heartbeat', undefined, key, onResponse, onHeartBeat)
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME, 'Circle')
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.radius = 0
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
- function onResponse (message) {
- eventSubscriptionIdHeartbeat = message.eventSubscriptionId
- }
- }
+ let opacityCounters = []
+ let eventSubscriptionIdHeartbeat
+ let needToDrawRing = true
+ let eventsServerClient
- function onHeartBeat (message) {
- if (thisObject.payload === undefined) { return }
- if (thisObject.payload.uiObject === undefined) { return }
- opacityCounters[message.event.seconds] = 2000
- if (message.event.processingDate !== undefined) {
- thisObject.payload.uiObject.setValue(message.event.processingDate, 2000)
- }
- if (message.event.percentage !== undefined) {
- thisObject.payload.uiObject.setPercentage(message.event.percentage, 2000)
- }
- if (message.event.status !== undefined) {
- needToDrawRing = false
- thisObject.payload.uiObject.setStatus(message.event.status, 200000)
+ return thisObject
+
+ function finalize() {
+ finalizeEventsServerClient()
+
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.fitFunction = undefined
}
- thisObject.payload.uiObject.heartBeat()
- }
-
- function getContainer (point) {
- if (canvas.floatingSpace.inMapMode === true) { return }
- let container
-
- for (let i = 0; i < menuItems.length; i++) {
- let menutItem = menuItems[i]
- container = menutItem.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
-
- function physics () {
- for (let i = 0; i < 60; i++) {
- opacityCounters[i] = opacityCounters[i] - 2
-
- if (opacityCounters[i] < 0) {
- opacityCounters[i] = 0
- }
- }
- }
-
- function drawForeground (pFloatingObject) {
-
- }
-
- function drawBackground (pFloatingObject) {
- if (canvas.floatingSpace.inMapMode === true) { return }
- if (needToDrawRing !== true) { return }
-
- const VISIBLE_RADIUS = thisObject.container.frame.radius * 2
-
- let visiblePosition = {
- x: thisObject.container.frame.position.x,
- y: thisObject.container.frame.position.y
+ function finalizeEventsServerClient() {
+ if (eventsServerClient !== undefined) {
+ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+ if (eventSubscriptionIdHeartbeat !== undefined) {
+ eventsServerClient.stopListening(key, eventSubscriptionIdHeartbeat)
+ }
+ }
}
- visiblePosition = thisObject.container.frame.frameThisPoint(visiblePosition)
- visiblePosition = thisObject.fitFunction(visiblePosition)
+ function initialize(payload, pEventsServerClient) {
+ thisObject.payload = payload
- for (let i = 0; i < 60; i++) {
- let OPACITY = opacityCounters[i] / 1000
+ finalizeEventsServerClient()
+ eventsServerClient = pEventsServerClient
- if (OPACITY === 0) { continue }
+ for (let i = 0; i < 60; i++) {
+ opacityCounters.push(0)
+ }
- let initialAngle = Math.PI * 2 / 60 * i - Math.PI / 2
- let finalAngle = Math.PI * 2 / 60 * (i + 1) - Math.PI / 2
+ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+ eventsServerClient.listenToEvent(key, 'Heartbeat', undefined, key, onResponse, onHeartBeat)
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, initialAngle, finalAngle, false)
- browserCanvasContext.closePath()
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY * 2 + ')'
- browserCanvasContext.lineWidth = 6 + opacityCounters[i] / 100 / 2
- browserCanvasContext.setLineDash([3, 4])
- browserCanvasContext.stroke()
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 0 + opacityCounters[i] / 100 / 2
- browserCanvasContext.setLineDash([3, 4])
- browserCanvasContext.stroke()
+ function onResponse(message) {
+ eventSubscriptionIdHeartbeat = message.eventSubscriptionId
+ }
+ }
+
+ function onHeartBeat(message) {
+ if (thisObject.payload === undefined) { return }
+ if (thisObject.payload.uiObject === undefined) { return }
+ opacityCounters[message.event.seconds] = 2000
+ if (message.event.processingDate !== undefined) {
+ thisObject.payload.uiObject.setValue(message.event.processingDate, 2000)
+ }
+ if (message.event.percentage !== undefined) {
+ thisObject.payload.uiObject.setPercentage(message.event.percentage, 2000)
+ }
+ if (message.event.status !== undefined) {
+ needToDrawRing = false
+ thisObject.payload.uiObject.setStatus(message.event.status, 200000)
+ }
+
+ thisObject.payload.uiObject.heartBeat()
+ }
+
+ function getContainer(point) {
+ if (canvas.floatingSpace.inMapMode === true) { return }
+ let container
+
+ for (let i = 0; i < menuItems.length; i++) {
+ let menutItem = menuItems[i]
+ container = menutItem.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ function physics() {
+ for (let i = 0; i < 60; i++) {
+ opacityCounters[i] = opacityCounters[i] - 2
+
+ if (opacityCounters[i] < 0) {
+ opacityCounters[i] = 0
+ }
+ }
+ }
+
+ function drawForeground(pFloatingObject) {
+
+ }
+
+ function drawBackground(pFloatingObject) {
+ if (canvas.floatingSpace.inMapMode === true) { return }
+ if (needToDrawRing !== true) { return }
+
+ const VISIBLE_RADIUS = thisObject.container.frame.radius * 2
+
+ let visiblePosition = {
+ x: thisObject.container.frame.position.x,
+ y: thisObject.container.frame.position.y
+ }
+
+ visiblePosition = thisObject.container.frame.frameThisPoint(visiblePosition)
+ visiblePosition = thisObject.fitFunction(visiblePosition)
+
+ for (let i = 0; i < 60; i++) {
+ let OPACITY = opacityCounters[i] / 1000
+
+ if (OPACITY === 0) { continue }
+
+ let initialAngle = Math.PI * 2 / 60 * i - Math.PI / 2
+ let finalAngle = Math.PI * 2 / 60 * (i + 1) - Math.PI / 2
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, initialAngle, finalAngle, false)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY * 2 + ')'
+ browserCanvasContext.lineWidth = 6 + opacityCounters[i] / 100 / 2
+ browserCanvasContext.setLineDash([3, 4])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 0 + opacityCounters[i] / 100 / 2
+ browserCanvasContext.setLineDash([3, 4])
+ browserCanvasContext.stroke()
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/CodeEditor.js b/CanvasApp/FloatingSpace/CodeEditor.js
index 4dea3fb0c..6ab244702 100644
--- a/CanvasApp/FloatingSpace/CodeEditor.js
+++ b/CanvasApp/FloatingSpace/CodeEditor.js
@@ -1,199 +1,199 @@
-function newCodeEditor () {
- const MODULE_NAME = 'Code Editor'
+function newCodeEditor() {
+ const MODULE_NAME = 'Code Editor'
- let thisObject = {
- isVisibleFunction: undefined,
- visible: false,
- imagePathOK: undefined,
- imagePathNOT_OK: undefined,
- rawRadius: undefined,
- targetRadius: undefined,
- currentRadius: undefined,
- container: undefined,
- payload: undefined,
- deactivate: deactivate,
- activate: activate,
- physics: physics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.detectMouseOver = false
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
-
- let isMouseOver = false
- let SIZE_FACTOR = 1.4
-
- return thisObject
-
- function finalize () {
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.isVisibleFunction = undefined
- }
-
- function initialize () {
-
- }
-
- function deactivate () {
- if (thisObject.visible === true) {
- thisObject.visible = false
- let textArea = document.getElementById('textArea')
- textArea.style.display = 'none'
- thisObject.payload.node.code = textArea.value
- }
- EDITOR_ON_FOCUS = false
- }
-
- function activate (payload) {
- thisObject.visible = true
- thisObject.payload = payload
- thisObject.rawRadius = 8
- thisObject.targetRadius = thisObject.container.frame.radius
- thisObject.currentRadius = 0
- thisObject.payload.uiObject.setErrorMessage('', 0)
-
- let textArea = document.getElementById('textArea')
- textArea.value = payload.node.code
- textArea.style = 'resize: none;' +
- ' border: none;' +
- ' outline: none;' +
- 'box-shadow: none;' +
- 'overflow:hidden;' +
- 'font-family: ' + UI_FONT.PRIMARY + ';' +
- 'font-size: 14px;' +
- 'background-color: rgb(' + UI_COLOR.RUSTED_RED + ');' +
- 'color:rgb(255, 255, 255);' +
- 'width: ' + thisObject.container.frame.width + 'px;' +
- 'height: ' + thisObject.container.frame.height + 'px'
- textArea.style.display = 'block'
- textArea.focus()
- EDITOR_ON_FOCUS = true
- }
-
- function getContainer (point) {
- let container
- if (thisObject.visible === true) {
- if (point.x === VERY_LARGE_NUMBER) {
- /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
- anyone can react. In our case, the code editor has a text area that is not part of the canvas, so the event is
- triggered. We compensate recognizing this coordinate and returning our container. */
- return thisObject.container
- }
-
- if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
- }
-
- function physics () {
- if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= 0.5) {
- if (thisObject.currentRadius < thisObject.targetRadius) {
- thisObject.currentRadius = thisObject.currentRadius + 0.5
- } else {
- thisObject.currentRadius = thisObject.currentRadius - 0.5
- }
+ let thisObject = {
+ isVisibleFunction: undefined,
+ visible: false,
+ imagePathOK: undefined,
+ imagePathNOT_OK: undefined,
+ rawRadius: undefined,
+ targetRadius: undefined,
+ currentRadius: undefined,
+ container: undefined,
+ payload: undefined,
+ deactivate: deactivate,
+ activate: activate,
+ physics: physics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.detectMouseOver = false
+ thisObject.container.frame.radius = 0
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
- thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
- thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
+ let isMouseOver = false
+ let SIZE_FACTOR = 1.4
- let textAreaPosition = {
- x: 0 - thisObject.container.frame.width / 2,
- y: 0 - thisObject.container.frame.height * 3 / 7 + CURRENT_TOP_MARGIN
+ return thisObject
+
+ function finalize() {
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.isVisibleFunction = undefined
}
- textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition)
- if (thisObject.visible === true) {
- let checkPosition = {
- x: textAreaPosition.x,
- y: textAreaPosition.y - CURRENT_TOP_MARGIN
- }
- if (thisObject.isVisibleFunction(checkPosition) === false) {
- deactivate()
- }
- }
- if (thisObject.visible === true) {
- let textAreaDiv = document.getElementById('textAreaDiv')
- textAreaDiv.style = 'position:fixed; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; '
- }
- }
+ function initialize() {
- function drawBackground () {
- if (thisObject.visible === true) {
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- let radius = thisObject.container.frame.radius * SIZE_FACTOR
-
- if (radius > 0.5) {
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius * 1.3 + 3, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
- browserCanvasContext.fill()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius * 1.3, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + 1 + ')'
- browserCanvasContext.fill()
- }
- }
- }
- function drawForeground () {
- let iconPosition = {
- x: 0,
- y: thisObject.currentRadius * 1.5
}
- iconPosition = thisObject.container.frame.frameThisPoint(iconPosition)
+ function deactivate() {
+ if (thisObject.visible === true) {
+ thisObject.visible = false
+ let textArea = document.getElementById('textArea')
+ textArea.style.display = 'none'
+ thisObject.payload.node.code = textArea.value
+ }
+ EDITOR_ON_FOCUS = false
+ }
- /* Menu Item */
+ function activate(payload) {
+ thisObject.visible = true
+ thisObject.payload = payload
+ thisObject.rawRadius = 8
+ thisObject.targetRadius = thisObject.container.frame.radius
+ thisObject.currentRadius = 0
+ thisObject.payload.uiObject.setErrorMessage('', 0)
- if (thisObject.canDrawIcon === true && thisObject.currentRadius > 1) {
- browserCanvasContext.drawImage(thisObject.icon, iconPosition.x - thisObject.currentRadius, iconPosition.y - thisObject.currentRadius, thisObject.currentRadius * 2, thisObject.currentRadius * 2)
+ let textArea = document.getElementById('textArea')
+ textArea.value = payload.node.code
+ textArea.style = 'resize: none;' +
+ ' border: none;' +
+ ' outline: none;' +
+ 'box-shadow: none;' +
+ 'overflow:hidden;' +
+ 'font-family: ' + UI_FONT.PRIMARY + ';' +
+ 'font-size: 14px;' +
+ 'background-color: rgb(' + UI_COLOR.RUSTED_RED + ');' +
+ 'color:rgb(255, 255, 255);' +
+ 'width: ' + thisObject.container.frame.width + 'px;' +
+ 'height: ' + thisObject.container.frame.height + 'px'
+ textArea.style.display = 'block'
+ textArea.focus()
+ EDITOR_ON_FOCUS = true
+ }
- /* Menu Label */
+ function getContainer(point) {
+ let container
+ if (thisObject.visible === true) {
+ if (point.x === VERY_LARGE_NUMBER) {
+ /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
+ anyone can react. In our case, the code editor has a text area that is not part of the canvas, so the event is
+ triggered. We compensate recognizing this coordinate and returning our container. */
+ return thisObject.container
+ }
- let label = 'Code looks good!'
- let labelPoint
- let fontSize = 10
+ if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
+ }
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
-
- if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
- labelPoint = {
- x: iconPosition.x + thisObject.currentRadius + 10,
- y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+ function physics() {
+ if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= 0.5) {
+ if (thisObject.currentRadius < thisObject.targetRadius) {
+ thisObject.currentRadius = thisObject.currentRadius + 0.5
+ } else {
+ thisObject.currentRadius = thisObject.currentRadius - 0.5
+ }
}
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
+
+ thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
+ thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
+
+ let textAreaPosition = {
+ x: 0 - thisObject.container.frame.width / 2,
+ y: 0 - thisObject.container.frame.height * 3 / 7 + CURRENT_TOP_MARGIN
+ }
+
+ textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition)
+ if (thisObject.visible === true) {
+ let checkPosition = {
+ x: textAreaPosition.x,
+ y: textAreaPosition.y - CURRENT_TOP_MARGIN
+ }
+ if (thisObject.isVisibleFunction(checkPosition) === false) {
+ deactivate()
+ }
+ }
+ if (thisObject.visible === true) {
+ let textAreaDiv = document.getElementById('textAreaDiv')
+ textAreaDiv.style = 'position:fixed; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; '
+ }
+ }
+
+ function drawBackground() {
+ if (thisObject.visible === true) {
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ let radius = thisObject.container.frame.radius * SIZE_FACTOR
+
+ if (radius > 0.5) {
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius * 1.3 + 3, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius * 1.3, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+ }
+ }
+ }
+ function drawForeground() {
+ let iconPosition = {
+ x: 0,
+ y: thisObject.currentRadius * 1.5
+ }
+
+ iconPosition = thisObject.container.frame.frameThisPoint(iconPosition)
+
+ /* Menu Item */
+
+ if (thisObject.canDrawIcon === true && thisObject.currentRadius > 1) {
+ browserCanvasContext.drawImage(thisObject.icon, iconPosition.x - thisObject.currentRadius, iconPosition.y - thisObject.currentRadius, thisObject.currentRadius * 2, thisObject.currentRadius * 2)
+
+ /* Menu Label */
+
+ let label = 'Code looks good!'
+ let labelPoint
+ let fontSize = 10
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+
+ if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
+ labelPoint = {
+ x: iconPosition.x + thisObject.currentRadius + 10,
+ y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/ConditionEditor.js b/CanvasApp/FloatingSpace/ConditionEditor.js
index 5b22ff07e..443c9f231 100644
--- a/CanvasApp/FloatingSpace/ConditionEditor.js
+++ b/CanvasApp/FloatingSpace/ConditionEditor.js
@@ -1,1198 +1,1198 @@
-function newConditionEditor () {
- const MODULE_NAME = 'Condition Editor'
+function newConditionEditor() {
+ const MODULE_NAME = 'Condition Editor'
- let thisObject = {
- isVisibleFunction: undefined,
- visible: false,
- imagePathOK: undefined,
- imagePathNOT_OK: undefined,
- container: undefined,
- payload: undefined,
- deactivate: deactivate,
- activate: activate,
- physics: physics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME, 'Circle')
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.detectMouseOver = false
- thisObject.container.frame.radius = 750
- thisObject.container.frame.width = thisObject.container.frame.radius * 2
- thisObject.container.frame.height = thisObject.container.frame.radius * 2
- thisObject.container.frame.containerName = MODULE_NAME
-
- let isMouseOver = false
- let conditionStructure
- let scanResult
-
- let timeFrameIcon
- let dataMineIcon
- let botIcon
- let whenIcon
- let productIcon
- let propertyIcon
- let operationIcon
- let valueIcon
-
- const PICKER_WIDTH = 150
- const PICKER_HEIGHT = 60
-
- return thisObject
-
- function finalize () {
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.isVisibleFunction = undefined
-
- conditionStructure = undefined
- scanResult = undefined
-
- timeFrameIcon = undefined
- dataMineIcon = undefined
- whenIcon = undefined
- botIcon = undefined
- productIcon = undefined
- operationIcon = undefined
- propertyIcon = undefined
- valueIcon = undefined
- }
-
- function initialize () {
- timeFrameIcon = canvas.designSpace.iconCollection.get('time-period')
- dataMineIcon = canvas.designSpace.iconCollection.get('data-mine')
- botIcon = canvas.designSpace.iconCollection.get('bot-indicator')
- whenIcon = canvas.designSpace.iconCollection.get('chronometer')
- productIcon = canvas.designSpace.iconCollection.get('product-definition')
- propertyIcon = canvas.designSpace.iconCollection.get('record-property')
- operationIcon = canvas.designSpace.iconCollection.get('headphones')
- valueIcon = canvas.designSpace.iconCollection.get('competition')
- }
-
- function activate (payload) {
- thisObject.visible = true
- thisObject.payload = payload
- thisObject.payload.uiObject.setErrorMessage('', 0)
-
- conditionStructure = {
- code: '',
- logicOperands: []
+ let thisObject = {
+ isVisibleFunction: undefined,
+ visible: false,
+ imagePathOK: undefined,
+ imagePathNOT_OK: undefined,
+ container: undefined,
+ payload: undefined,
+ deactivate: deactivate,
+ activate: activate,
+ physics: physics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- scanDataMines()
- loadFromCode()
- EDITOR_ON_FOCUS = true
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME, 'Circle')
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.detectMouseOver = false
+ thisObject.container.frame.radius = 750
+ thisObject.container.frame.width = thisObject.container.frame.radius * 2
+ thisObject.container.frame.height = thisObject.container.frame.radius * 2
+ thisObject.container.frame.containerName = MODULE_NAME
- function deactivate () {
- convertToCode()
- finalizePickers()
+ let isMouseOver = false
+ let conditionStructure
+ let scanResult
- conditionStructure = undefined
+ let timeFrameIcon
+ let dataMineIcon
+ let botIcon
+ let whenIcon
+ let productIcon
+ let propertyIcon
+ let operationIcon
+ let valueIcon
- if (thisObject.visible === true) {
- thisObject.visible = false
- }
- EDITOR_ON_FOCUS = false
- }
+ const PICKER_WIDTH = 150
+ const PICKER_HEIGHT = 60
- function loadFromCode () {
- if (thisObject.payload.node.code === undefined) { thisObject.payload.node.code = '' }
- conditionStructure.code = thisObject.payload.node.code.replace(/ /g, '')
+ return thisObject
- /* LOGICAL ORs */
- let orArray = conditionStructure.code.split('||')
- for (let j = 0; j < 3; j++) {
- let logicOperand = {
- code: orArray[j],
- index: j,
- comparison: {},
- visible: false
- }
+ function finalize() {
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.isVisibleFunction = undefined
- if (logicOperand.code !== undefined) {
- logicOperand.visible = true
- if (orArray[j + 1] !== undefined) {
- logicOperand.operator = '||'
- }
- } else {
- logicOperand.code = ''
- }
+ conditionStructure = undefined
+ scanResult = undefined
- checkComparison(logicOperand, j)
- conditionStructure.logicOperands.push(logicOperand)
+ timeFrameIcon = undefined
+ dataMineIcon = undefined
+ whenIcon = undefined
+ botIcon = undefined
+ productIcon = undefined
+ operationIcon = undefined
+ propertyIcon = undefined
+ valueIcon = undefined
}
- function checkComparison (logicOperand) {
- /* We are going to decompose the code into 2 comparison operators */
- logicOperand.comparison.operandA = {
- index: 0,
- code: ''
- }
- logicOperand.comparison.operandB = {
- index: 1,
- code: ''
- }
-
- if (logicOperand.code.indexOf('>') > 0) {
- let codeArray = logicOperand.code.split('>')
- logicOperand.comparison.operandA.code = codeArray[0]
- logicOperand.comparison.operandB.code = codeArray[1]
- logicOperand.comparison.operator = '>'
- logicOperand.comparison.operatorIndex = 0
- }
-
- if (logicOperand.code.indexOf('<') > 0) {
- let codeArray = logicOperand.code.split('<')
- logicOperand.comparison.operandA.code = codeArray[0]
- logicOperand.comparison.operandB.code = codeArray[1]
- logicOperand.comparison.operator = '<'
- logicOperand.comparison.operatorIndex = 1
- }
-
- if (logicOperand.code.indexOf('>=') > 0) {
- let codeArray = logicOperand.code.split('>=')
- logicOperand.comparison.operandA.code = codeArray[0]
- logicOperand.comparison.operandB.code = codeArray[1]
- logicOperand.comparison.operator = '>='
- logicOperand.comparison.operatorIndex = 2
- }
-
- if (logicOperand.code.indexOf('<=') > 0) {
- let codeArray = logicOperand.code.split('<=')
- logicOperand.comparison.operandA.code = codeArray[0]
- logicOperand.comparison.operandB.code = codeArray[1]
- logicOperand.comparison.operator = '<='
- logicOperand.comparison.operatorIndex = 3
- }
-
- if (logicOperand.code.indexOf('===') > 0) {
- let codeArray = logicOperand.code.split('===')
- logicOperand.comparison.operandA.code = codeArray[0]
- logicOperand.comparison.operandB.code = codeArray[1]
- logicOperand.comparison.operator = '==='
- logicOperand.comparison.operatorIndex = 4
- }
-
- /* Each comparison code may have one or more algebra operators */
- checkAlgebra(logicOperand, logicOperand.comparison.operandA)
- checkAlgebra(logicOperand, logicOperand.comparison.operandB)
+ function initialize() {
+ timeFrameIcon = canvas.designSpace.iconCollection.get('time-period')
+ dataMineIcon = canvas.designSpace.iconCollection.get('data-mine')
+ botIcon = canvas.designSpace.iconCollection.get('bot-indicator')
+ whenIcon = canvas.designSpace.iconCollection.get('chronometer')
+ productIcon = canvas.designSpace.iconCollection.get('product-definition')
+ propertyIcon = canvas.designSpace.iconCollection.get('record-property')
+ operationIcon = canvas.designSpace.iconCollection.get('headphones')
+ valueIcon = canvas.designSpace.iconCollection.get('competition')
}
- function checkAlgebra (logicOperand, comparisonOperand) {
- comparisonOperand.algebra = {
- operandA: { index: 0},
- operandB: { index: 1}
- }
+ function activate(payload) {
+ thisObject.visible = true
+ thisObject.payload = payload
+ thisObject.payload.uiObject.setErrorMessage('', 0)
- /* The default situation is that there is no algebra operation, meaning we will setup a algebra operation only with operandA */
- comparisonOperand.algebra.operandA.code = comparisonOperand.code
- comparisonOperand.algebra.operandB.code = ''
- comparisonOperand.algebra.operator = '...'
- comparisonOperand.algebra.operatorIndex = 0
+ conditionStructure = {
+ code: '',
+ logicOperands: []
+ }
- if (comparisonOperand.code.indexOf('+') > 0) {
- let codeArray = comparisonOperand.code.split('+')
- comparisonOperand.algebra.operandA.code = codeArray[0]
- comparisonOperand.algebra.operandB.code = codeArray[1]
- comparisonOperand.algebra.operator = '+'
- comparisonOperand.algebra.operatorIndex = 1
- }
-
- if (comparisonOperand.code.indexOf('-') > 0) {
- let codeArray = comparisonOperand.code.split('-')
- comparisonOperand.algebra.operandA.code = codeArray[0]
- comparisonOperand.algebra.operandB.code = codeArray[1]
- comparisonOperand.algebra.operator = '-'
- comparisonOperand.algebra.operatorIndex = 2
- }
-
- if (comparisonOperand.code.indexOf('*') > 0) {
- let codeArray = comparisonOperand.code.split('*')
- comparisonOperand.algebra.operandA.code = codeArray[0]
- comparisonOperand.algebra.operandB.code = codeArray[1]
- comparisonOperand.algebra.operator = '*'
- comparisonOperand.algebra.operatorIndex = 3
- }
-
- if (comparisonOperand.code.indexOf('/') > 0) {
- let codeArray = comparisonOperand.code.split('/')
- comparisonOperand.algebra.operandA.code = codeArray[0]
- comparisonOperand.algebra.operandB.code = codeArray[1]
- comparisonOperand.algebra.operator = '/'
- comparisonOperand.algebra.operatorIndex = 4
- }
-
- initializePickersSet(logicOperand, comparisonOperand, comparisonOperand.algebra.operandA)
- initializePickersSet(logicOperand, comparisonOperand, comparisonOperand.algebra.operandB)
- updatePickers(logicOperand, comparisonOperand, comparisonOperand.algebra.operandA)
- updatePickers(logicOperand, comparisonOperand, comparisonOperand.algebra.operandB)
+ scanDataMines()
+ loadFromCode()
+ EDITOR_ON_FOCUS = true
}
- function initializePickersSet (logicOperand, comparisonOperand, algebraOperand) {
- const ALGEBRA_SEPARATION = PICKER_HEIGHT
- const COMPARISON_SEPARATION = ALGEBRA_SEPARATION * 2
- const LOGIC_SEPARATION = COMPARISON_SEPARATION * 2
+ function deactivate() {
+ convertToCode()
+ finalizePickers()
- let properties
- let parent
- let current
- let yOffset = (logicOperand.index - 1) * LOGIC_SEPARATION + (comparisonOperand.index - 0.5) * COMPARISON_SEPARATION + (algebraOperand.index - 0.5) * ALGEBRA_SEPARATION
+ conditionStructure = undefined
- if (algebraOperand.index === 0) {
- comparisonOperand.algebra.picker = newPicker()
- let picker = comparisonOperand.algebra.picker
- picker.name = 'Algebra'
- picker.container.connectToParent(thisObject.container)
- picker.container.frame.position.x = 0 - picker.container.frame.width / 2 + picker.container.frame.width * 2.5
- picker.container.frame.position.y = 0 - picker.container.frame.height / 2 + yOffset
- current = ['...', 'Plus', 'Minus', 'Times', 'Divided by']
- picker.initialize(current, current)
- switch (comparisonOperand.algebra.operator) {
- case '+': {
- picker.setSelected(undefined, undefined, undefined, 1)
- break
- }
- case '-': {
- picker.setSelected(undefined, undefined, undefined, 2)
- break
- }
- case '*': {
- picker.setSelected(undefined, undefined, undefined, 3)
- break
- }
- case '/': {
- picker.setSelected(undefined, undefined, undefined, 4)
- break
- }
+ if (thisObject.visible === true) {
+ thisObject.visible = false
}
- picker.visible = true
- let structureBranch = {
- logicOperand: logicOperand,
- comparisonOperand: comparisonOperand,
- algebraOperand: algebraOperand,
- pickerName: 'Algebra'
- }
- picker.eventSuscriptionId = picker.container.eventHandler.listenToEvent('onParentChanged', onParentChanged, structureBranch)
- }
-
- if (comparisonOperand.index === 0 && algebraOperand.index === 1) {
- logicOperand.comparison.picker = newPicker()
- let picker = logicOperand.comparison.picker
- picker.name = 'Comparison'
- picker.container.connectToParent(thisObject.container)
- picker.container.frame.position.x = 0 - picker.container.frame.width / 2 + picker.container.frame.width * 2.5
- picker.container.frame.position.y = 0 - picker.container.frame.height / 2 + yOffset
- let optionsList = ['Greater Than', 'Less Than', 'Greater or Equal Than', 'Less or Equal Than', 'Equal To']
- picker.initialize(optionsList)
- switch (logicOperand.comparison.operator) {
- case '>': {
- picker.setSelected(undefined, undefined, undefined, 0)
- break
- }
- case '<': {
- picker.setSelected(undefined, undefined, undefined, 1)
- break
- }
- case '>=': {
- picker.setSelected(undefined, undefined, undefined, 2)
- break
- }
- case '<=': {
- picker.setSelected(undefined, undefined, undefined, 3)
- break
- }
- case '===': {
- picker.setSelected(undefined, undefined, undefined, 4)
- break
- }
- }
- picker.visible = true
- let structureBranch = {
- logicOperand: logicOperand,
- comparisonOperand: comparisonOperand,
- algebraOperand: algebraOperand,
- pickerName: 'Comparison'
- }
- picker.eventSuscriptionId = picker.container.eventHandler.listenToEvent('onParentChanged', onParentChanged, structureBranch)
- }
-
- if (comparisonOperand.index === 1 && algebraOperand.index === 1 && logicOperand.index <= 1) {
- logicOperand.picker = newPicker()
- let picker = logicOperand.picker
- picker.name = 'Logic'
- picker.container.connectToParent(thisObject.container)
- picker.container.frame.position.x = 0 - picker.container.frame.width / 2 + picker.container.frame.width * 2.5
- picker.container.frame.position.y = 0 - picker.container.frame.height / 2 + yOffset
- let optionsList = ['...', 'OR']
- picker.initialize(optionsList)
- if (logicOperand.operator === '||') {
- picker.setSelected(undefined, undefined, undefined, 1)
- }
- picker.visible = true
- let structureBranch = {
- logicOperand: logicOperand,
- comparisonOperand: comparisonOperand,
- algebraOperand: algebraOperand,
- pickerName: 'Logic'
- }
- picker.eventSuscriptionId = picker.container.eventHandler.listenToEvent('onParentChanged', onParentChanged, structureBranch)
- }
-
- let visible = true
- if (algebraOperand.index === 1 && comparisonOperand.algebra.picker.getSelected() === '...') { visible = false }
- if (logicOperand.comparison.picker !== undefined && comparisonOperand.index === 1 && logicOperand.comparison.picker.getSelected() === 'Equal To') { visible = false }
-
- algebraOperand.whenPicker = newPicker()
- algebraOperand.whenPicker.name = 'When'
- algebraOperand.whenPicker.container.connectToParent(thisObject.container)
- algebraOperand.whenPicker.container.frame.position.x = 0 - algebraOperand.whenPicker.container.frame.width / 2 - algebraOperand.whenPicker.container.frame.width * 0.5
- algebraOperand.whenPicker.container.frame.position.y = 0 - algebraOperand.whenPicker.container.frame.height / 2 + yOffset
- current = ['Current', '1 Previous', '2 Previous', '3 Previous', '4 Previous', '5 Previous']
- algebraOperand.whenPicker.initialize(current, current)
- algebraOperand.whenPicker.visible = visible
-
- algebraOperand.dataMinePicker = newPicker()
- algebraOperand.dataMinePicker.name = 'Data Mine'
- algebraOperand.dataMinePicker.container.connectToParent(thisObject.container)
- algebraOperand.dataMinePicker.container.frame.position.x = 0 - algebraOperand.dataMinePicker.container.frame.width / 2 - algebraOperand.dataMinePicker.container.frame.width * 2.5
- algebraOperand.dataMinePicker.container.frame.position.y = 0 - algebraOperand.dataMinePicker.container.frame.height / 2 + yOffset
- current = scanResult
- properties = Object.keys(current)
- algebraOperand.dataMinePicker.initialize(properties, current)
- parent = current
- algebraOperand.dataMinePicker.visible = visible
-
- algebraOperand.botPicker = newPicker()
- algebraOperand.botPicker.name = 'Bot'
- algebraOperand.botPicker.container.connectToParent(thisObject.container)
- algebraOperand.botPicker.container.frame.position.x = 0 - algebraOperand.botPicker.container.frame.width / 2 - algebraOperand.botPicker.container.frame.width * 1.5
- algebraOperand.botPicker.container.frame.position.y = 0 - algebraOperand.botPicker.container.frame.height / 2 + yOffset
- current = parent[properties[0]]
- properties = Object.keys(current)
- algebraOperand.botPicker.initialize(properties, current, parent)
- parent = current
- algebraOperand.botPicker.visible = visible
-
- algebraOperand.productPicker = newPicker()
- algebraOperand.productPicker.name = 'Product'
- algebraOperand.productPicker.container.connectToParent(thisObject.container)
- algebraOperand.productPicker.container.frame.position.x = 0 - algebraOperand.productPicker.container.frame.width / 2 + algebraOperand.productPicker.container.frame.width * 0.5
- algebraOperand.productPicker.container.frame.position.y = 0 - algebraOperand.productPicker.container.frame.height / 2 + yOffset
- current = parent[properties[0]]
- properties = Object.keys(current)
- algebraOperand.productPicker.initialize(properties, current, parent)
- parent = current
- algebraOperand.productPicker.visible = visible
-
- let productParent = parent
- let productProperties = properties
-
- algebraOperand.propertyPicker = newPicker()
- algebraOperand.propertyPicker.name = 'Property'
- algebraOperand.propertyPicker.container.connectToParent(thisObject.container)
- algebraOperand.propertyPicker.container.frame.position.x = 0 - algebraOperand.propertyPicker.container.frame.width / 2 + algebraOperand.propertyPicker.container.frame.width * 1.5
- algebraOperand.propertyPicker.container.frame.position.y = 0 - algebraOperand.propertyPicker.container.frame.height / 2 + yOffset
- current = productParent[productProperties[0]]
- current = current.properties
- properties = Object.keys(current)
- algebraOperand.propertyPicker.initialize(properties, current, productParent, 'properties')
- parent = current
- algebraOperand.propertyPicker.visible = visible
-
- algebraOperand.valuePicker = newPicker()
- algebraOperand.valuePicker.name = 'Value'
- algebraOperand.valuePicker.container.connectToParent(thisObject.container)
- algebraOperand.valuePicker.container.frame.position.x = 0 - algebraOperand.valuePicker.container.frame.width / 2 + algebraOperand.valuePicker.container.frame.width * 3.5
- algebraOperand.valuePicker.container.frame.position.y = 0 - algebraOperand.valuePicker.container.frame.height / 2 + yOffset + ALGEBRA_SEPARATION
- current = parent[properties[0]]
- properties = current.possibleValues
- algebraOperand.valuePicker.initialize(properties, current, parent, 'possibleValues')
- parent = current
- algebraOperand.valuePicker.visible = false
- if (logicOperand.comparison.picker !== undefined && logicOperand.comparison.picker.getSelected() === 'Equal To') {
- comparisonOperand.algebra.operandA.valuePicker.visible = true
- }
-
- algebraOperand.timeFramePicker = newPicker()
- algebraOperand.timeFramePicker.name = 'Time Frame'
- algebraOperand.timeFramePicker.container.connectToParent(thisObject.container)
- algebraOperand.timeFramePicker.container.frame.position.x = 0 - algebraOperand.timeFramePicker.container.frame.width / 2 - algebraOperand.timeFramePicker.container.frame.width * 3.0
- algebraOperand.timeFramePicker.container.frame.position.y = 0 - algebraOperand.timeFramePicker.container.frame.height / 2 + yOffset
- algebraOperand.timeFramePicker.container.frame.width = algebraOperand.timeFramePicker.container.frame.width / 2
- current = productParent[productProperties[0]]
- properties = current.validTimeFrames
- algebraOperand.timeFramePicker.initialize(properties, current, productParent, 'validTimeFrames')
- parent = current
- algebraOperand.timeFramePicker.visible = visible
-
- algebraOperand.botPicker.eventSuscriptionId = algebraOperand.dataMinePicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.botPicker.onParentChanged)
- algebraOperand.productPicker.eventSuscriptionId = algebraOperand.botPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.productPicker.onParentChanged)
- algebraOperand.propertyPicker.eventSuscriptionId = algebraOperand.productPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.propertyPicker.onParentChanged)
- algebraOperand.valuePicker.eventSuscriptionId = algebraOperand.propertyPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.valuePicker.onParentChanged)
- algebraOperand.timeFramePicker.eventSuscriptionId = algebraOperand.productPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.timeFramePicker.onParentChanged)
+ EDITOR_ON_FOCUS = false
}
- function updatePickers (logicOperand, comparisonOperand, algebraOperand) {
- let codeArray = algebraOperand.code.split('.')
+ function loadFromCode() {
+ if (thisObject.payload.node.code === undefined) { thisObject.payload.node.code = '' }
+ conditionStructure.code = thisObject.payload.node.code.replace(/ /g, '')
- let codeTimeFrame
- if (codeArray[1] !== undefined) {
- codeTimeFrame = codeArray[1].substring(2, 4) + '-' + codeArray[1].substring(4, 7)
- }
+ /* LOGICAL ORs */
+ let orArray = conditionStructure.code.split('||')
+ for (let j = 0; j < 3; j++) {
+ let logicOperand = {
+ code: orArray[j],
+ index: j,
+ comparison: {},
+ visible: false
+ }
- let codeProduct
- if (codeArray[2] !== undefined) {
- codeProduct = codeArray[2]
- }
+ if (logicOperand.code !== undefined) {
+ logicOperand.visible = true
+ if (orArray[j + 1] !== undefined) {
+ logicOperand.operator = '||'
+ }
+ } else {
+ logicOperand.code = ''
+ }
- /* Parse When */
- let propertyDisplacement = 0
- let codeWhen = 'Current'
- if (codeArray[3] === 'previous') {
- propertyDisplacement++
- codeWhen = '1 Previous'
- }
- if (codeArray[4] === 'previous') {
- propertyDisplacement++
- codeWhen = '2 Previous'
- }
- if (codeArray[5] === 'previous') {
- propertyDisplacement++
- codeWhen = '3 Previous'
- }
- if (codeArray[6] === 'previous') {
- propertyDisplacement++
- codeWhen = '4 Previous'
- }
- if (codeArray[7] === 'previous') {
- propertyDisplacement++
- codeWhen = '5 Previous'
- }
- algebraOperand.whenPicker.setSelected(undefined, undefined, undefined, propertyDisplacement)
+ checkComparison(logicOperand, j)
+ conditionStructure.logicOperands.push(logicOperand)
+ }
- let codeProperty
- if (codeArray[3 + propertyDisplacement] !== undefined) {
- codeProperty = codeArray[3 + propertyDisplacement]
- }
+ function checkComparison(logicOperand) {
+ /* We are going to decompose the code into 2 comparison operators */
+ logicOperand.comparison.operandA = {
+ index: 0,
+ code: ''
+ }
+ logicOperand.comparison.operandB = {
+ index: 1,
+ code: ''
+ }
- let codeValue = logicOperand.comparison.operandB.code.replace('"', '').replace('"', '')
+ if (logicOperand.code.indexOf('>') > 0) {
+ let codeArray = logicOperand.code.split('>')
+ logicOperand.comparison.operandA.code = codeArray[0]
+ logicOperand.comparison.operandB.code = codeArray[1]
+ logicOperand.comparison.operator = '>'
+ logicOperand.comparison.operatorIndex = 0
+ }
- let dataMines = Object.keys(scanResult)
- for (let i = 0; i < dataMines.length; i++) {
- let dataMine = dataMines[i]
- let dataMineObject = scanResult[dataMine]
- let bots = Object.keys(dataMineObject)
- for (let j = 0; j < bots.length; j++) {
- let bot = bots[j]
- let botObject = dataMineObject[bot]
- let products = Object.keys(botObject)
- for (let k = 0; k < products.length; k++) {
- let product = products[k]
- let productObject = botObject[product]
- if (codeProduct === product) {
- algebraOperand.dataMinePicker.setSelected(dataMines, scanResult, undefined, i)
- algebraOperand.botPicker.setSelected(bots, dataMineObject, scanResult, j)
- algebraOperand.productPicker.setSelected(products, botObject, dataMineObject, k)
- let properties = Object.keys(productObject.properties)
- for (let m = 0; m < properties.length; m++) {
- let property = properties[m]
- let propertyObject = productObject.properties[property]
- if (codeProperty === property) {
- algebraOperand.propertyPicker.setSelected(properties, productObject.properties, botObject, m)
- let values = propertyObject.possibleValues
- for (let n = 0; n < values.length; n++) {
- let value = values[n]
- let valueObject = propertyObject[value]
- if (codeValue === value) {
- algebraOperand.valuePicker.setSelected(values, propertyObject, productObject, n)
+ if (logicOperand.code.indexOf('<') > 0) {
+ let codeArray = logicOperand.code.split('<')
+ logicOperand.comparison.operandA.code = codeArray[0]
+ logicOperand.comparison.operandB.code = codeArray[1]
+ logicOperand.comparison.operator = '<'
+ logicOperand.comparison.operatorIndex = 1
+ }
+
+ if (logicOperand.code.indexOf('>=') > 0) {
+ let codeArray = logicOperand.code.split('>=')
+ logicOperand.comparison.operandA.code = codeArray[0]
+ logicOperand.comparison.operandB.code = codeArray[1]
+ logicOperand.comparison.operator = '>='
+ logicOperand.comparison.operatorIndex = 2
+ }
+
+ if (logicOperand.code.indexOf('<=') > 0) {
+ let codeArray = logicOperand.code.split('<=')
+ logicOperand.comparison.operandA.code = codeArray[0]
+ logicOperand.comparison.operandB.code = codeArray[1]
+ logicOperand.comparison.operator = '<='
+ logicOperand.comparison.operatorIndex = 3
+ }
+
+ if (logicOperand.code.indexOf('===') > 0) {
+ let codeArray = logicOperand.code.split('===')
+ logicOperand.comparison.operandA.code = codeArray[0]
+ logicOperand.comparison.operandB.code = codeArray[1]
+ logicOperand.comparison.operator = '==='
+ logicOperand.comparison.operatorIndex = 4
+ }
+
+ /* Each comparison code may have one or more algebra operators */
+ checkAlgebra(logicOperand, logicOperand.comparison.operandA)
+ checkAlgebra(logicOperand, logicOperand.comparison.operandB)
+ }
+
+ function checkAlgebra(logicOperand, comparisonOperand) {
+ comparisonOperand.algebra = {
+ operandA: { index: 0 },
+ operandB: { index: 1 }
+ }
+
+ /* The default situation is that there is no algebra operation, meaning we will setup a algebra operation only with operandA */
+ comparisonOperand.algebra.operandA.code = comparisonOperand.code
+ comparisonOperand.algebra.operandB.code = ''
+ comparisonOperand.algebra.operator = '...'
+ comparisonOperand.algebra.operatorIndex = 0
+
+ if (comparisonOperand.code.indexOf('+') > 0) {
+ let codeArray = comparisonOperand.code.split('+')
+ comparisonOperand.algebra.operandA.code = codeArray[0]
+ comparisonOperand.algebra.operandB.code = codeArray[1]
+ comparisonOperand.algebra.operator = '+'
+ comparisonOperand.algebra.operatorIndex = 1
+ }
+
+ if (comparisonOperand.code.indexOf('-') > 0) {
+ let codeArray = comparisonOperand.code.split('-')
+ comparisonOperand.algebra.operandA.code = codeArray[0]
+ comparisonOperand.algebra.operandB.code = codeArray[1]
+ comparisonOperand.algebra.operator = '-'
+ comparisonOperand.algebra.operatorIndex = 2
+ }
+
+ if (comparisonOperand.code.indexOf('*') > 0) {
+ let codeArray = comparisonOperand.code.split('*')
+ comparisonOperand.algebra.operandA.code = codeArray[0]
+ comparisonOperand.algebra.operandB.code = codeArray[1]
+ comparisonOperand.algebra.operator = '*'
+ comparisonOperand.algebra.operatorIndex = 3
+ }
+
+ if (comparisonOperand.code.indexOf('/') > 0) {
+ let codeArray = comparisonOperand.code.split('/')
+ comparisonOperand.algebra.operandA.code = codeArray[0]
+ comparisonOperand.algebra.operandB.code = codeArray[1]
+ comparisonOperand.algebra.operator = '/'
+ comparisonOperand.algebra.operatorIndex = 4
+ }
+
+ initializePickersSet(logicOperand, comparisonOperand, comparisonOperand.algebra.operandA)
+ initializePickersSet(logicOperand, comparisonOperand, comparisonOperand.algebra.operandB)
+ updatePickers(logicOperand, comparisonOperand, comparisonOperand.algebra.operandA)
+ updatePickers(logicOperand, comparisonOperand, comparisonOperand.algebra.operandB)
+ }
+
+ function initializePickersSet(logicOperand, comparisonOperand, algebraOperand) {
+ const ALGEBRA_SEPARATION = PICKER_HEIGHT
+ const COMPARISON_SEPARATION = ALGEBRA_SEPARATION * 2
+ const LOGIC_SEPARATION = COMPARISON_SEPARATION * 2
+
+ let properties
+ let parent
+ let current
+ let yOffset = (logicOperand.index - 1) * LOGIC_SEPARATION + (comparisonOperand.index - 0.5) * COMPARISON_SEPARATION + (algebraOperand.index - 0.5) * ALGEBRA_SEPARATION
+
+ if (algebraOperand.index === 0) {
+ comparisonOperand.algebra.picker = newPicker()
+ let picker = comparisonOperand.algebra.picker
+ picker.name = 'Algebra'
+ picker.container.connectToParent(thisObject.container)
+ picker.container.frame.position.x = 0 - picker.container.frame.width / 2 + picker.container.frame.width * 2.5
+ picker.container.frame.position.y = 0 - picker.container.frame.height / 2 + yOffset
+ current = ['...', 'Plus', 'Minus', 'Times', 'Divided by']
+ picker.initialize(current, current)
+ switch (comparisonOperand.algebra.operator) {
+ case '+': {
+ picker.setSelected(undefined, undefined, undefined, 1)
+ break
+ }
+ case '-': {
+ picker.setSelected(undefined, undefined, undefined, 2)
+ break
+ }
+ case '*': {
+ picker.setSelected(undefined, undefined, undefined, 3)
+ break
+ }
+ case '/': {
+ picker.setSelected(undefined, undefined, undefined, 4)
+ break
}
- }
}
- }
- let timeFrames = productObject.validTimeFrames
- for (let m = 0; m < timeFrames.length; m++) {
- let timeFrame = timeFrames[m]
- let timeFrameObject = productObject.validTimeFrames[timeFrame]
- if (codeTimeFrame === timeFrame) {
- algebraOperand.timeFramePicker.setSelected(timeFrames, productObject, botObject, m)
+ picker.visible = true
+ let structureBranch = {
+ logicOperand: logicOperand,
+ comparisonOperand: comparisonOperand,
+ algebraOperand: algebraOperand,
+ pickerName: 'Algebra'
}
- }
+ picker.eventSuscriptionId = picker.container.eventHandler.listenToEvent('onParentChanged', onParentChanged, structureBranch)
}
- }
- }
- }
- }
- }
- function scanDataMines () {
- let selector = {}
-
- let workspace = canvas.designSpace.workspace.workspaceNode
-
- for (let i = 0; i < workspace.rootNodes.length; i++) {
- let rootNode = workspace.rootNodes[i]
- if (rootNode.type !== 'Data Mine') { continue }
- let dataMine = rootNode
- let dataMineName = loadPropertyFromNodeConfig(dataMine.payload, 'codeName')
- selector[dataMineName] = {}
- let bots = dataMine.sensorBots.concat(dataMine.indicatorBots)
- for (let j = 0; j < bots.length; j++) {
- let bot = bots[j]
- let botName = loadPropertyFromNodeConfig(bot.payload, 'codeName')
- let selectorDataMine = selector[dataMineName]
- selectorDataMine[botName] = {}
- for (let k = 0; k < bot.products.length; k++) {
- let product = bot.products[k]
- let productName = loadPropertyFromNodeConfig(product.payload, 'singularVariableName')
- if (productName === undefined) { continue }
- let selectorProduct = selectorDataMine[botName]
- selectorProduct[productName] = {
- properties: {}
- }
- if (product.record === undefined) { continue }
- for (let m = 0; m < product.record.properties.length; m++) {
- let property = product.record.properties[m]
- let propertyName = loadPropertyFromNodeConfig(property.payload, 'codeName')
- let selectorProperty = selectorProduct[productName]
- selectorProperty = selectorProperty.properties
- selectorProperty[propertyName] = {}
- let possibleValues = loadPropertyFromNodeConfig(property.payload, 'possibleValues')
- if (possibleValues === undefined) { possibleValues = [] }
- let selectorPossibleValue = selectorProperty[propertyName]
- selectorPossibleValue.possibleValues = possibleValues
- }
- let allPossibleTimeFrames = []
- for (let m = 0; m < product.datasets.length; m++) {
- let dataset = product.datasets[m]
- let validTimeFrames = loadPropertyFromNodeConfig(dataset.payload, 'validTimeFrames')
- if (validTimeFrames !== undefined) {
- allPossibleTimeFrames = allPossibleTimeFrames.concat(validTimeFrames)
+ if (comparisonOperand.index === 0 && algebraOperand.index === 1) {
+ logicOperand.comparison.picker = newPicker()
+ let picker = logicOperand.comparison.picker
+ picker.name = 'Comparison'
+ picker.container.connectToParent(thisObject.container)
+ picker.container.frame.position.x = 0 - picker.container.frame.width / 2 + picker.container.frame.width * 2.5
+ picker.container.frame.position.y = 0 - picker.container.frame.height / 2 + yOffset
+ let optionsList = ['Greater Than', 'Less Than', 'Greater or Equal Than', 'Less or Equal Than', 'Equal To']
+ picker.initialize(optionsList)
+ switch (logicOperand.comparison.operator) {
+ case '>': {
+ picker.setSelected(undefined, undefined, undefined, 0)
+ break
+ }
+ case '<': {
+ picker.setSelected(undefined, undefined, undefined, 1)
+ break
+ }
+ case '>=': {
+ picker.setSelected(undefined, undefined, undefined, 2)
+ break
+ }
+ case '<=': {
+ picker.setSelected(undefined, undefined, undefined, 3)
+ break
+ }
+ case '===': {
+ picker.setSelected(undefined, undefined, undefined, 4)
+ break
+ }
+ }
+ picker.visible = true
+ let structureBranch = {
+ logicOperand: logicOperand,
+ comparisonOperand: comparisonOperand,
+ algebraOperand: algebraOperand,
+ pickerName: 'Comparison'
+ }
+ picker.eventSuscriptionId = picker.container.eventHandler.listenToEvent('onParentChanged', onParentChanged, structureBranch)
}
- }
- let selectorValidTimeFrames = selectorProduct[productName]
- selectorValidTimeFrames.validTimeFrames = allPossibleTimeFrames
- let productKeys = Object.keys(selectorProduct[productName])
- if (productKeys.length === 0) {
- selectorProduct[productName] = undefined
- }
- }
- let botKeys = Object.keys(selectorDataMine[botName])
- if (botKeys.length === 0) {
- selectorDataMine[botName] = undefined
- }
- }
- let dataMineKeys = Object.keys(selector[dataMineName])
- if (dataMineKeys.length === 0) {
- selector[dataMineName] = undefined
- }
- }
- scanResult = JSON.parse(JSON.stringify(selector))
- }
+ if (comparisonOperand.index === 1 && algebraOperand.index === 1 && logicOperand.index <= 1) {
+ logicOperand.picker = newPicker()
+ let picker = logicOperand.picker
+ picker.name = 'Logic'
+ picker.container.connectToParent(thisObject.container)
+ picker.container.frame.position.x = 0 - picker.container.frame.width / 2 + picker.container.frame.width * 2.5
+ picker.container.frame.position.y = 0 - picker.container.frame.height / 2 + yOffset
+ let optionsList = ['...', 'OR']
+ picker.initialize(optionsList)
+ if (logicOperand.operator === '||') {
+ picker.setSelected(undefined, undefined, undefined, 1)
+ }
+ picker.visible = true
+ let structureBranch = {
+ logicOperand: logicOperand,
+ comparisonOperand: comparisonOperand,
+ algebraOperand: algebraOperand,
+ pickerName: 'Logic'
+ }
+ picker.eventSuscriptionId = picker.container.eventHandler.listenToEvent('onParentChanged', onParentChanged, structureBranch)
+ }
- function convertToCode () {
- if (conditionStructure === undefined) { return }
+ let visible = true
+ if (algebraOperand.index === 1 && comparisonOperand.algebra.picker.getSelected() === '...') { visible = false }
+ if (logicOperand.comparison.picker !== undefined && comparisonOperand.index === 1 && logicOperand.comparison.picker.getSelected() === 'Equal To') { visible = false }
- // chart.at01hs.bollingerSubChannel.previous.previous.slope=== "Extreme"
+ algebraOperand.whenPicker = newPicker()
+ algebraOperand.whenPicker.name = 'When'
+ algebraOperand.whenPicker.container.connectToParent(thisObject.container)
+ algebraOperand.whenPicker.container.frame.position.x = 0 - algebraOperand.whenPicker.container.frame.width / 2 - algebraOperand.whenPicker.container.frame.width * 0.5
+ algebraOperand.whenPicker.container.frame.position.y = 0 - algebraOperand.whenPicker.container.frame.height / 2 + yOffset
+ current = ['Current', '1 Previous', '2 Previous', '3 Previous', '4 Previous', '5 Previous']
+ algebraOperand.whenPicker.initialize(current, current)
+ algebraOperand.whenPicker.visible = visible
- let code = ''
+ algebraOperand.dataMinePicker = newPicker()
+ algebraOperand.dataMinePicker.name = 'Data Mine'
+ algebraOperand.dataMinePicker.container.connectToParent(thisObject.container)
+ algebraOperand.dataMinePicker.container.frame.position.x = 0 - algebraOperand.dataMinePicker.container.frame.width / 2 - algebraOperand.dataMinePicker.container.frame.width * 2.5
+ algebraOperand.dataMinePicker.container.frame.position.y = 0 - algebraOperand.dataMinePicker.container.frame.height / 2 + yOffset
+ current = scanResult
+ properties = Object.keys(current)
+ algebraOperand.dataMinePicker.initialize(properties, current)
+ parent = current
+ algebraOperand.dataMinePicker.visible = visible
- for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
- let logicOperand = conditionStructure.logicOperands[i]
- logicOperandToCode(logicOperand)
- if (logicOperand.picker.getSelected() !== 'OR') {
- break
- } else {
- code = code + ' || '
- }
- }
+ algebraOperand.botPicker = newPicker()
+ algebraOperand.botPicker.name = 'Bot'
+ algebraOperand.botPicker.container.connectToParent(thisObject.container)
+ algebraOperand.botPicker.container.frame.position.x = 0 - algebraOperand.botPicker.container.frame.width / 2 - algebraOperand.botPicker.container.frame.width * 1.5
+ algebraOperand.botPicker.container.frame.position.y = 0 - algebraOperand.botPicker.container.frame.height / 2 + yOffset
+ current = parent[properties[0]]
+ properties = Object.keys(current)
+ algebraOperand.botPicker.initialize(properties, current, parent)
+ parent = current
+ algebraOperand.botPicker.visible = visible
- thisObject.payload.node.code = code
+ algebraOperand.productPicker = newPicker()
+ algebraOperand.productPicker.name = 'Product'
+ algebraOperand.productPicker.container.connectToParent(thisObject.container)
+ algebraOperand.productPicker.container.frame.position.x = 0 - algebraOperand.productPicker.container.frame.width / 2 + algebraOperand.productPicker.container.frame.width * 0.5
+ algebraOperand.productPicker.container.frame.position.y = 0 - algebraOperand.productPicker.container.frame.height / 2 + yOffset
+ current = parent[properties[0]]
+ properties = Object.keys(current)
+ algebraOperand.productPicker.initialize(properties, current, parent)
+ parent = current
+ algebraOperand.productPicker.visible = visible
- function logicOperandToCode (logicOperand) {
- algebraOperandToCode(logicOperand.comparison.operandA.algebra.operandA)
- if (logicOperand.comparison.operandA.algebra.picker.getSelected() !== '...') {
- insertAlgebraOperator(logicOperand.comparison.operandA.algebra)
- algebraOperandToCode(logicOperand.comparison.operandA.algebra.operandB)
- }
+ let productParent = parent
+ let productProperties = properties
- switch (logicOperand.comparison.picker.getSelected()) {
- case 'Greater Than': {
- code = code + ' > '
- break
- }
- case 'Less Than': {
- code = code + ' < '
- break
- }
- case 'Greater or Equal Than': {
- code = code + ' >= '
- break
- }
- case 'Less or Equal Than': {
- code = code + ' <= '
- break
- }
- case 'Equal To': {
- code = code + ' === '
- break
- }
- }
+ algebraOperand.propertyPicker = newPicker()
+ algebraOperand.propertyPicker.name = 'Property'
+ algebraOperand.propertyPicker.container.connectToParent(thisObject.container)
+ algebraOperand.propertyPicker.container.frame.position.x = 0 - algebraOperand.propertyPicker.container.frame.width / 2 + algebraOperand.propertyPicker.container.frame.width * 1.5
+ algebraOperand.propertyPicker.container.frame.position.y = 0 - algebraOperand.propertyPicker.container.frame.height / 2 + yOffset
+ current = productParent[productProperties[0]]
+ current = current.properties
+ properties = Object.keys(current)
+ algebraOperand.propertyPicker.initialize(properties, current, productParent, 'properties')
+ parent = current
+ algebraOperand.propertyPicker.visible = visible
- if (logicOperand.comparison.picker.getSelected() === 'Equal To') {
- code = code + '"' + logicOperand.comparison.operandA.algebra.operandA.valuePicker.getSelected() + '"'
- } else {
- algebraOperandToCode(logicOperand.comparison.operandB.algebra.operandA)
- if (logicOperand.comparison.operandB.algebra.picker.getSelected() !== '...') {
- insertAlgebraOperator(logicOperand.comparison.operandB.algebra)
- algebraOperandToCode(logicOperand.comparison.operandB.algebra.operandB)
- }
- }
+ algebraOperand.valuePicker = newPicker()
+ algebraOperand.valuePicker.name = 'Value'
+ algebraOperand.valuePicker.container.connectToParent(thisObject.container)
+ algebraOperand.valuePicker.container.frame.position.x = 0 - algebraOperand.valuePicker.container.frame.width / 2 + algebraOperand.valuePicker.container.frame.width * 3.5
+ algebraOperand.valuePicker.container.frame.position.y = 0 - algebraOperand.valuePicker.container.frame.height / 2 + yOffset + ALGEBRA_SEPARATION
+ current = parent[properties[0]]
+ properties = current.possibleValues
+ algebraOperand.valuePicker.initialize(properties, current, parent, 'possibleValues')
+ parent = current
+ algebraOperand.valuePicker.visible = false
+ if (logicOperand.comparison.picker !== undefined && logicOperand.comparison.picker.getSelected() === 'Equal To') {
+ comparisonOperand.algebra.operandA.valuePicker.visible = true
+ }
- function algebraOperandToCode (algebraOperand) {
- if (algebraOperand.timeFramePicker.getSelected() === 'Any Time Frame') {
- code = code + 'chart.atAnyTimeFrame'
- } else {
- code = code + 'chart.at' + algebraOperand.timeFramePicker.getSelected().replace('-', '')
+ algebraOperand.timeFramePicker = newPicker()
+ algebraOperand.timeFramePicker.name = 'Time Frame'
+ algebraOperand.timeFramePicker.container.connectToParent(thisObject.container)
+ algebraOperand.timeFramePicker.container.frame.position.x = 0 - algebraOperand.timeFramePicker.container.frame.width / 2 - algebraOperand.timeFramePicker.container.frame.width * 3.0
+ algebraOperand.timeFramePicker.container.frame.position.y = 0 - algebraOperand.timeFramePicker.container.frame.height / 2 + yOffset
+ algebraOperand.timeFramePicker.container.frame.width = algebraOperand.timeFramePicker.container.frame.width / 2
+ current = productParent[productProperties[0]]
+ properties = current.validTimeFrames
+ algebraOperand.timeFramePicker.initialize(properties, current, productParent, 'validTimeFrames')
+ parent = current
+ algebraOperand.timeFramePicker.visible = visible
+
+ algebraOperand.botPicker.eventSuscriptionId = algebraOperand.dataMinePicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.botPicker.onParentChanged)
+ algebraOperand.productPicker.eventSuscriptionId = algebraOperand.botPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.productPicker.onParentChanged)
+ algebraOperand.propertyPicker.eventSuscriptionId = algebraOperand.productPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.propertyPicker.onParentChanged)
+ algebraOperand.valuePicker.eventSuscriptionId = algebraOperand.propertyPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.valuePicker.onParentChanged)
+ algebraOperand.timeFramePicker.eventSuscriptionId = algebraOperand.productPicker.container.eventHandler.listenToEvent('onParentChanged', algebraOperand.timeFramePicker.onParentChanged)
}
- code = code + '.' + algebraOperand.productPicker.getSelected()
- insertWhen(algebraOperand)
- code = code + '.' + algebraOperand.propertyPicker.getSelected()
- }
+ function updatePickers(logicOperand, comparisonOperand, algebraOperand) {
+ let codeArray = algebraOperand.code.split('.')
- function insertAlgebraOperator (algebra) {
- switch (algebra.picker.getSelected()) {
- case '...': {
- return
- }
- case 'Plus': {
- code = code + ' + '
- return
- }
- case 'Minus': {
- code = code + ' - '
- return
- }
- case 'Times': {
- code = code + ' * '
- return
- }
- case 'Divided by': {
- code = code + ' / '
- return
- }
+ let codeTimeFrame
+ if (codeArray[1] !== undefined) {
+ codeTimeFrame = codeArray[1].substring(2, 4) + '-' + codeArray[1].substring(4, 7)
+ }
+
+ let codeProduct
+ if (codeArray[2] !== undefined) {
+ codeProduct = codeArray[2]
+ }
+
+ /* Parse When */
+ let propertyDisplacement = 0
+ let codeWhen = 'Current'
+ if (codeArray[3] === 'previous') {
+ propertyDisplacement++
+ codeWhen = '1 Previous'
+ }
+ if (codeArray[4] === 'previous') {
+ propertyDisplacement++
+ codeWhen = '2 Previous'
+ }
+ if (codeArray[5] === 'previous') {
+ propertyDisplacement++
+ codeWhen = '3 Previous'
+ }
+ if (codeArray[6] === 'previous') {
+ propertyDisplacement++
+ codeWhen = '4 Previous'
+ }
+ if (codeArray[7] === 'previous') {
+ propertyDisplacement++
+ codeWhen = '5 Previous'
+ }
+ algebraOperand.whenPicker.setSelected(undefined, undefined, undefined, propertyDisplacement)
+
+ let codeProperty
+ if (codeArray[3 + propertyDisplacement] !== undefined) {
+ codeProperty = codeArray[3 + propertyDisplacement]
+ }
+
+ let codeValue = logicOperand.comparison.operandB.code.replace('"', '').replace('"', '')
+
+ let dataMines = Object.keys(scanResult)
+ for (let i = 0; i < dataMines.length; i++) {
+ let dataMine = dataMines[i]
+ let dataMineObject = scanResult[dataMine]
+ let bots = Object.keys(dataMineObject)
+ for (let j = 0; j < bots.length; j++) {
+ let bot = bots[j]
+ let botObject = dataMineObject[bot]
+ let products = Object.keys(botObject)
+ for (let k = 0; k < products.length; k++) {
+ let product = products[k]
+ let productObject = botObject[product]
+ if (codeProduct === product) {
+ algebraOperand.dataMinePicker.setSelected(dataMines, scanResult, undefined, i)
+ algebraOperand.botPicker.setSelected(bots, dataMineObject, scanResult, j)
+ algebraOperand.productPicker.setSelected(products, botObject, dataMineObject, k)
+ let properties = Object.keys(productObject.properties)
+ for (let m = 0; m < properties.length; m++) {
+ let property = properties[m]
+ let propertyObject = productObject.properties[property]
+ if (codeProperty === property) {
+ algebraOperand.propertyPicker.setSelected(properties, productObject.properties, botObject, m)
+ let values = propertyObject.possibleValues
+ for (let n = 0; n < values.length; n++) {
+ let value = values[n]
+ let valueObject = propertyObject[value]
+ if (codeValue === value) {
+ algebraOperand.valuePicker.setSelected(values, propertyObject, productObject, n)
+ }
+ }
+ }
+ }
+ let timeFrames = productObject.validTimeFrames
+ for (let m = 0; m < timeFrames.length; m++) {
+ let timeFrame = timeFrames[m]
+ let timeFrameObject = productObject.validTimeFrames[timeFrame]
+ if (codeTimeFrame === timeFrame) {
+ algebraOperand.timeFramePicker.setSelected(timeFrames, productObject, botObject, m)
+ }
+ }
+ }
+ }
+ }
+ }
}
- }
- function insertWhen (algebraOperand) {
- switch (algebraOperand.whenPicker.getSelected()) {
- case 'Current': {
- return
- }
- case '1 Previous': {
- code = code + '.previous'
- return
- }
- case '2 Previous': {
- code = code + '.previous.previous'
- return
- }
- case '3 Previous': {
- code = code + '.previous.previous.previous'
- return
- }
- case '4 Previous': {
- code = code + '.previous.previous.previous.previous'
- return
- }
- case '5 Previous': {
- code = code + '.previous.previous.previous.previous.previous'
- return
- }
+ }
+
+ function scanDataMines() {
+ let selector = {}
+
+ let workspace = canvas.designSpace.workspace.workspaceNode
+
+ for (let i = 0; i < workspace.rootNodes.length; i++) {
+ let rootNode = workspace.rootNodes[i]
+ if (rootNode.type !== 'Data Mine') { continue }
+ let dataMine = rootNode
+ let dataMineName = loadPropertyFromNodeConfig(dataMine.payload, 'codeName')
+ selector[dataMineName] = {}
+ let bots = dataMine.sensorBots.concat(dataMine.indicatorBots)
+ for (let j = 0; j < bots.length; j++) {
+ let bot = bots[j]
+ let botName = loadPropertyFromNodeConfig(bot.payload, 'codeName')
+ let selectorDataMine = selector[dataMineName]
+ selectorDataMine[botName] = {}
+ for (let k = 0; k < bot.products.length; k++) {
+ let product = bot.products[k]
+ let productName = loadPropertyFromNodeConfig(product.payload, 'singularVariableName')
+ if (productName === undefined) { continue }
+ let selectorProduct = selectorDataMine[botName]
+ selectorProduct[productName] = {
+ properties: {}
+ }
+ if (product.record === undefined) { continue }
+ for (let m = 0; m < product.record.properties.length; m++) {
+ let property = product.record.properties[m]
+ let propertyName = loadPropertyFromNodeConfig(property.payload, 'codeName')
+ let selectorProperty = selectorProduct[productName]
+ selectorProperty = selectorProperty.properties
+ selectorProperty[propertyName] = {}
+ let possibleValues = loadPropertyFromNodeConfig(property.payload, 'possibleValues')
+ if (possibleValues === undefined) { possibleValues = [] }
+ let selectorPossibleValue = selectorProperty[propertyName]
+ selectorPossibleValue.possibleValues = possibleValues
+ }
+ let allPossibleTimeFrames = []
+ for (let m = 0; m < product.datasets.length; m++) {
+ let dataset = product.datasets[m]
+ let validTimeFrames = loadPropertyFromNodeConfig(dataset.payload, 'validTimeFrames')
+ if (validTimeFrames !== undefined) {
+ allPossibleTimeFrames = allPossibleTimeFrames.concat(validTimeFrames)
+ }
+ }
+ let selectorValidTimeFrames = selectorProduct[productName]
+ selectorValidTimeFrames.validTimeFrames = allPossibleTimeFrames
+
+ let productKeys = Object.keys(selectorProduct[productName])
+ if (productKeys.length === 0) {
+ selectorProduct[productName] = undefined
+ }
+ }
+ let botKeys = Object.keys(selectorDataMine[botName])
+ if (botKeys.length === 0) {
+ selectorDataMine[botName] = undefined
+ }
+ }
+ let dataMineKeys = Object.keys(selector[dataMineName])
+ if (dataMineKeys.length === 0) {
+ selector[dataMineName] = undefined
+ }
}
- }
- }
- }
-
- function finalizePickers () {
- if (conditionStructure === undefined) { return }
- for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
- let logicOperand = conditionStructure.logicOperands[i]
- finalizeOperator(logicOperand.comparison.operandA.algebra.operandA)
- finalizeOperator(logicOperand.comparison.operandA.algebra.operandB)
- finalizeOperator(logicOperand.comparison.operandB.algebra.operandA)
- finalizeOperator(logicOperand.comparison.operandB.algebra.operandB)
-
- if (logicOperand.comparison.operandA.algebra.picker !== undefined) {
- logicOperand.comparison.operandA.algebra.picker.container.eventHandler.stopListening(logicOperand.comparison.operandA.algebra.picker.eventSuscriptionId)
- logicOperand.comparison.operandA.algebra.picker.finalize()
- }
-
- if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
- logicOperand.comparison.operandB.algebra.picker.container.eventHandler.stopListening(logicOperand.comparison.operandB.algebra.picker.eventSuscriptionId)
- logicOperand.comparison.operandB.algebra.picker.finalize()
- }
-
- if (logicOperand.comparison.picker !== undefined) {
- logicOperand.comparison.picker.container.eventHandler.stopListening(logicOperand.comparison.picker.eventSuscriptionId)
- logicOperand.comparison.picker.finalize()
- }
-
- if (logicOperand.picker !== undefined) {
- logicOperand.picker.container.eventHandler.stopListening(logicOperand.picker.eventSuscriptionId)
- logicOperand.picker.finalize()
- }
- }
- }
-
- function finalizeOperator (operand) {
- if (operand === undefined) { return }
-
- if (operand.whenPicker !== undefined) {
- operand.whenPicker.finalize()
- operand.whenPicker = undefined
+ scanResult = JSON.parse(JSON.stringify(selector))
}
- if (operand.dataMinePicker !== undefined) {
- operand.dataMinePicker.container.eventHandler.stopListening(operand.botPicker.eventSuscriptionId)
- operand.dataMinePicker.finalize()
- operand.dataMinePicker = undefined
- }
+ function convertToCode() {
+ if (conditionStructure === undefined) { return }
- if (operand.botPicker !== undefined) {
- operand.botPicker.container.eventHandler.stopListening(operand.productPicker.eventSuscriptionId)
- operand.botPicker.finalize()
- operand.botPicker = undefined
- }
+ // chart.at01hs.bollingerSubChannel.previous.previous.slope=== "Extreme"
- if (operand.productPicker !== undefined) {
- operand.productPicker.container.eventHandler.stopListening(operand.propertyPicker.eventSuscriptionId)
- operand.productPicker.container.eventHandler.stopListening(operand.timeFramePicker.eventSuscriptionId)
- operand.productPicker.finalize()
- operand.productPicker = undefined
- }
+ let code = ''
- if (operand.propertyPicker !== undefined) {
- operand.propertyPicker.container.eventHandler.stopListening(operand.valuePicker.eventSuscriptionId)
- operand.propertyPicker.finalize()
- operand.propertyPicker = undefined
- }
-
- if (operand.valuePicker !== undefined) {
- operand.valuePicker.finalize()
- operand.valuePicker = undefined
- }
-
- if (operand.timeFramePicker !== undefined) {
- operand.timeFramePicker.finalize()
- operand.timeFramePicker = undefined
- }
- }
-
- function onParentChanged (event, structureBranch) {
- let logicOperand = structureBranch.logicOperand
-
- if (structureBranch.pickerName === 'Logic') {
- if (event.selected === 0) {
- if (logicOperand.index === 0) {
- conditionStructure.logicOperands[1].visible = false
- conditionStructure.logicOperands[2].visible = false
- }
- if (logicOperand.index === 1) {
- conditionStructure.logicOperands[2].visible = false
- }
- } else {
- if (logicOperand.index === 0) {
- conditionStructure.logicOperands[1].visible = true
-
- if (conditionStructure.logicOperands[1].picker.getSelected() !== '...') {
- conditionStructure.logicOperands[2].visible = true
- }
- }
- if (logicOperand.index === 1) {
- conditionStructure.logicOperands[2].visible = true
- }
- }
- }
-
- if (structureBranch.pickerName === 'Algebra') {
- if (event.selected === 0) {
- setVisibility(structureBranch.comparisonOperand.algebra.operandB, false)
- } else {
- setVisibility(structureBranch.comparisonOperand.algebra.operandB, true)
- }
- }
-
- if (structureBranch.pickerName === 'Comparison') {
- if (event.selected === 4) {
- // this means Equal To
-
- logicOperand.comparison.operandA.algebra.operandA.valuePicker.visible = true
- logicOperand.comparison.operandA.algebra.picker.visible = false
- logicOperand.comparison.operandB.algebra.picker.visible = false
- setVisibility(logicOperand.comparison.operandA.algebra.operandB, false)
- setVisibility(logicOperand.comparison.operandB.algebra.operandA, false)
- setVisibility(logicOperand.comparison.operandB.algebra.operandB, false)
- } else {
- logicOperand.comparison.operandA.algebra.operandA.valuePicker.visible = false
- logicOperand.comparison.operandA.algebra.picker.visible = true
- logicOperand.comparison.operandB.algebra.picker.visible = true
- if (logicOperand.comparison.operandA.algebra.picker.getSelected() !== '...') {
- setVisibility(logicOperand.comparison.operandA.algebra.operandB, true)
+ for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
+ let logicOperand = conditionStructure.logicOperands[i]
+ logicOperandToCode(logicOperand)
+ if (logicOperand.picker.getSelected() !== 'OR') {
+ break
+ } else {
+ code = code + ' || '
+ }
}
- if (logicOperand.comparison.picker.getSelected() !== 'Equal To') {
- setVisibility(logicOperand.comparison.operandB.algebra.operandA, true)
+ thisObject.payload.node.code = code
+
+ function logicOperandToCode(logicOperand) {
+ algebraOperandToCode(logicOperand.comparison.operandA.algebra.operandA)
+ if (logicOperand.comparison.operandA.algebra.picker.getSelected() !== '...') {
+ insertAlgebraOperator(logicOperand.comparison.operandA.algebra)
+ algebraOperandToCode(logicOperand.comparison.operandA.algebra.operandB)
+ }
+
+ switch (logicOperand.comparison.picker.getSelected()) {
+ case 'Greater Than': {
+ code = code + ' > '
+ break
+ }
+ case 'Less Than': {
+ code = code + ' < '
+ break
+ }
+ case 'Greater or Equal Than': {
+ code = code + ' >= '
+ break
+ }
+ case 'Less or Equal Than': {
+ code = code + ' <= '
+ break
+ }
+ case 'Equal To': {
+ code = code + ' === '
+ break
+ }
+ }
+
+ if (logicOperand.comparison.picker.getSelected() === 'Equal To') {
+ code = code + '"' + logicOperand.comparison.operandA.algebra.operandA.valuePicker.getSelected() + '"'
+ } else {
+ algebraOperandToCode(logicOperand.comparison.operandB.algebra.operandA)
+ if (logicOperand.comparison.operandB.algebra.picker.getSelected() !== '...') {
+ insertAlgebraOperator(logicOperand.comparison.operandB.algebra)
+ algebraOperandToCode(logicOperand.comparison.operandB.algebra.operandB)
+ }
+ }
+
+ function algebraOperandToCode(algebraOperand) {
+ if (algebraOperand.timeFramePicker.getSelected() === 'Any Time Frame') {
+ code = code + 'chart.atAnyTimeFrame'
+ } else {
+ code = code + 'chart.at' + algebraOperand.timeFramePicker.getSelected().replace('-', '')
+ }
+
+ code = code + '.' + algebraOperand.productPicker.getSelected()
+ insertWhen(algebraOperand)
+ code = code + '.' + algebraOperand.propertyPicker.getSelected()
+ }
+
+ function insertAlgebraOperator(algebra) {
+ switch (algebra.picker.getSelected()) {
+ case '...': {
+ return
+ }
+ case 'Plus': {
+ code = code + ' + '
+ return
+ }
+ case 'Minus': {
+ code = code + ' - '
+ return
+ }
+ case 'Times': {
+ code = code + ' * '
+ return
+ }
+ case 'Divided by': {
+ code = code + ' / '
+ return
+ }
+ }
+ }
+ function insertWhen(algebraOperand) {
+ switch (algebraOperand.whenPicker.getSelected()) {
+ case 'Current': {
+ return
+ }
+ case '1 Previous': {
+ code = code + '.previous'
+ return
+ }
+ case '2 Previous': {
+ code = code + '.previous.previous'
+ return
+ }
+ case '3 Previous': {
+ code = code + '.previous.previous.previous'
+ return
+ }
+ case '4 Previous': {
+ code = code + '.previous.previous.previous.previous'
+ return
+ }
+ case '5 Previous': {
+ code = code + '.previous.previous.previous.previous.previous'
+ return
+ }
+ }
+ }
+ }
+ }
+
+ function finalizePickers() {
+ if (conditionStructure === undefined) { return }
+ for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
+ let logicOperand = conditionStructure.logicOperands[i]
+ finalizeOperator(logicOperand.comparison.operandA.algebra.operandA)
+ finalizeOperator(logicOperand.comparison.operandA.algebra.operandB)
+ finalizeOperator(logicOperand.comparison.operandB.algebra.operandA)
+ finalizeOperator(logicOperand.comparison.operandB.algebra.operandB)
+
+ if (logicOperand.comparison.operandA.algebra.picker !== undefined) {
+ logicOperand.comparison.operandA.algebra.picker.container.eventHandler.stopListening(logicOperand.comparison.operandA.algebra.picker.eventSuscriptionId)
+ logicOperand.comparison.operandA.algebra.picker.finalize()
+ }
+
+ if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
+ logicOperand.comparison.operandB.algebra.picker.container.eventHandler.stopListening(logicOperand.comparison.operandB.algebra.picker.eventSuscriptionId)
+ logicOperand.comparison.operandB.algebra.picker.finalize()
+ }
+
+ if (logicOperand.comparison.picker !== undefined) {
+ logicOperand.comparison.picker.container.eventHandler.stopListening(logicOperand.comparison.picker.eventSuscriptionId)
+ logicOperand.comparison.picker.finalize()
+ }
+
+ if (logicOperand.picker !== undefined) {
+ logicOperand.picker.container.eventHandler.stopListening(logicOperand.picker.eventSuscriptionId)
+ logicOperand.picker.finalize()
+ }
+ }
+ }
+
+ function finalizeOperator(operand) {
+ if (operand === undefined) { return }
+
+ if (operand.whenPicker !== undefined) {
+ operand.whenPicker.finalize()
+ operand.whenPicker = undefined
}
- if (logicOperand.comparison.operandB.algebra.picker.getSelected() !== '...') {
- setVisibility(logicOperand.comparison.operandB.algebra.operandB, true)
- }
- }
- }
-
- function setLogicOperanVisibility (logicOperand, isVisible) {
-
- }
-
- function setVisibility (algebraOperand, isVisible) {
- algebraOperand.whenPicker.visible = isVisible
- algebraOperand.dataMinePicker.visible = isVisible
- algebraOperand.botPicker.visible = isVisible
- algebraOperand.productPicker.visible = isVisible
- algebraOperand.propertyPicker.visible = isVisible
- algebraOperand.timeFramePicker.visible = isVisible
- }
- }
-
- function getContainer (point) {
- let container
- if (thisObject.visible === true) {
- if (conditionStructure === undefined) { return }
-
- for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
- let logicOperand = conditionStructure.logicOperands[i]
- if (logicOperand.visible !== true) { continue }
-
- container = operandGetContainer(point, logicOperand.comparison.operandA.algebra.operandA)
- if (container !== undefined) { return container }
- container = operandGetContainer(point, logicOperand.comparison.operandA.algebra.operandB)
- if (container !== undefined) { return container }
- container = operandGetContainer(point, logicOperand.comparison.operandB.algebra.operandA)
- if (container !== undefined) { return container }
- container = operandGetContainer(point, logicOperand.comparison.operandB.algebra.operandB)
- if (container !== undefined) { return container }
-
- if (container = logicOperand.comparison.operandA.algebra.picker !== undefined) {
- if (container = logicOperand.comparison.operandA.algebra.picker.visible === true) {
- container = logicOperand.comparison.operandA.algebra.picker.getContainer(point)
- if (container !== undefined) { return container }
- }
+ if (operand.dataMinePicker !== undefined) {
+ operand.dataMinePicker.container.eventHandler.stopListening(operand.botPicker.eventSuscriptionId)
+ operand.dataMinePicker.finalize()
+ operand.dataMinePicker = undefined
}
- if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
- if (container = logicOperand.comparison.operandB.algebra.picker.visible === true) {
- container = logicOperand.comparison.operandB.algebra.picker.getContainer(point)
- if (container !== undefined) { return container }
- }
+ if (operand.botPicker !== undefined) {
+ operand.botPicker.container.eventHandler.stopListening(operand.productPicker.eventSuscriptionId)
+ operand.botPicker.finalize()
+ operand.botPicker = undefined
}
- if (container = logicOperand.comparison.picker !== undefined) {
- if (container = logicOperand.comparison.picker.visible === true) {
- container = logicOperand.comparison.picker.getContainer(point)
- if (container !== undefined) { return container }
- }
+ if (operand.productPicker !== undefined) {
+ operand.productPicker.container.eventHandler.stopListening(operand.propertyPicker.eventSuscriptionId)
+ operand.productPicker.container.eventHandler.stopListening(operand.timeFramePicker.eventSuscriptionId)
+ operand.productPicker.finalize()
+ operand.productPicker = undefined
}
- if (container = logicOperand.picker !== undefined) {
- if (container = logicOperand.picker.visible === true) {
- container = logicOperand.picker.getContainer(point)
- if (container !== undefined) { return container }
- }
+ if (operand.propertyPicker !== undefined) {
+ operand.propertyPicker.container.eventHandler.stopListening(operand.valuePicker.eventSuscriptionId)
+ operand.propertyPicker.finalize()
+ operand.propertyPicker = undefined
}
- }
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
- }
-
- function operandGetContainer (point, operand) {
- let container
- if (operand.whenPicker !== undefined) {
- if (operand.whenPicker.visible === true) {
- container = operand.whenPicker.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
-
- if (operand.dataMinePicker !== undefined) {
- if (operand.dataMinePicker.visible === true) {
- container = operand.dataMinePicker.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
-
- if (operand.botPicker !== undefined) {
- if (operand.botPicker.visible === true) {
- container = operand.botPicker.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
-
- if (operand.productPicker !== undefined) {
- if (operand.productPicker.visible === true) {
- container = operand.productPicker.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
-
- if (operand.propertyPicker !== undefined) {
- if (operand.propertyPicker.visible === true) {
- container = operand.propertyPicker.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
-
- if (operand.valuePicker !== undefined) {
- if (operand.valuePicker.visible === true) {
- container = operand.valuePicker.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
-
- if (operand.timeFramePicker !== undefined) {
- if (operand.timeFramePicker.visible === true) {
- container = operand.timeFramePicker.getContainer(point)
- if (container !== undefined) { return container }
- }
- }
- }
-
- function physics () {
-
- }
-
- function drawBackground () {
- thisObjectDrawBackground()
- childrenDrawBackground()
- }
-
- function childrenDrawBackground () {
- if (conditionStructure === undefined) { return }
-
- for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
- let logicOperand = conditionStructure.logicOperands[i]
- if (logicOperand.visible !== true) { continue }
-
- operandDrawBackground(logicOperand.comparison.operandA.algebra.operandA)
- operandDrawBackground(logicOperand.comparison.operandA.algebra.operandB)
- operandDrawBackground(logicOperand.comparison.operandB.algebra.operandA)
- operandDrawBackground(logicOperand.comparison.operandB.algebra.operandB)
-
- if (logicOperand.comparison.operandA.algebra.picker !== undefined) {
- if (logicOperand.comparison.operandA.algebra.picker.visible === true) {
- logicOperand.comparison.operandA.algebra.picker.drawBackground()
+ if (operand.valuePicker !== undefined) {
+ operand.valuePicker.finalize()
+ operand.valuePicker = undefined
}
- }
- if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
- if (logicOperand.comparison.operandB.algebra.picker.visible === true) {
- logicOperand.comparison.operandB.algebra.picker.drawBackground()
+
+ if (operand.timeFramePicker !== undefined) {
+ operand.timeFramePicker.finalize()
+ operand.timeFramePicker = undefined
}
- }
- if (logicOperand.comparison.picker !== undefined) {
- if (logicOperand.comparison.picker.visible === true) {
- logicOperand.comparison.picker.drawBackground()
+ }
+
+ function onParentChanged(event, structureBranch) {
+ let logicOperand = structureBranch.logicOperand
+
+ if (structureBranch.pickerName === 'Logic') {
+ if (event.selected === 0) {
+ if (logicOperand.index === 0) {
+ conditionStructure.logicOperands[1].visible = false
+ conditionStructure.logicOperands[2].visible = false
+ }
+ if (logicOperand.index === 1) {
+ conditionStructure.logicOperands[2].visible = false
+ }
+ } else {
+ if (logicOperand.index === 0) {
+ conditionStructure.logicOperands[1].visible = true
+
+ if (conditionStructure.logicOperands[1].picker.getSelected() !== '...') {
+ conditionStructure.logicOperands[2].visible = true
+ }
+ }
+ if (logicOperand.index === 1) {
+ conditionStructure.logicOperands[2].visible = true
+ }
+ }
}
- }
- if (logicOperand.picker !== undefined) {
- if (logicOperand.picker.visible === true) {
- logicOperand.picker.drawBackground()
+
+ if (structureBranch.pickerName === 'Algebra') {
+ if (event.selected === 0) {
+ setVisibility(structureBranch.comparisonOperand.algebra.operandB, false)
+ } else {
+ setVisibility(structureBranch.comparisonOperand.algebra.operandB, true)
+ }
}
- }
- }
- }
- function operandDrawBackground (operand) {
- if (operand === undefined) { return }
+ if (structureBranch.pickerName === 'Comparison') {
+ if (event.selected === 4) {
+ // this means Equal To
- if (operand.whenPicker !== undefined) {
- if (operand.whenPicker.visible === true) {
- operand.whenPicker.drawBackground()
- }
- }
+ logicOperand.comparison.operandA.algebra.operandA.valuePicker.visible = true
+ logicOperand.comparison.operandA.algebra.picker.visible = false
+ logicOperand.comparison.operandB.algebra.picker.visible = false
+ setVisibility(logicOperand.comparison.operandA.algebra.operandB, false)
+ setVisibility(logicOperand.comparison.operandB.algebra.operandA, false)
+ setVisibility(logicOperand.comparison.operandB.algebra.operandB, false)
+ } else {
+ logicOperand.comparison.operandA.algebra.operandA.valuePicker.visible = false
+ logicOperand.comparison.operandA.algebra.picker.visible = true
+ logicOperand.comparison.operandB.algebra.picker.visible = true
+ if (logicOperand.comparison.operandA.algebra.picker.getSelected() !== '...') {
+ setVisibility(logicOperand.comparison.operandA.algebra.operandB, true)
+ }
- if (operand.dataMinePicker !== undefined) {
- if (operand.dataMinePicker.visible === true) {
- operand.dataMinePicker.drawBackground()
- }
- }
+ if (logicOperand.comparison.picker.getSelected() !== 'Equal To') {
+ setVisibility(logicOperand.comparison.operandB.algebra.operandA, true)
+ }
- if (operand.botPicker !== undefined) {
- if (operand.botPicker.visible === true) {
- operand.botPicker.drawBackground()
- }
- }
-
- if (operand.productPicker !== undefined) {
- if (operand.productPicker.visible === true) {
- operand.productPicker.drawBackground()
- }
- }
-
- if (operand.propertyPicker !== undefined) {
- if (operand.propertyPicker.visible === true) {
- operand.propertyPicker.drawBackground()
- }
- }
-
- if (operand.valuePicker !== undefined) {
- if (operand.valuePicker.visible === true) {
- operand.valuePicker.drawBackground()
- }
- }
-
- if (operand.timeFramePicker !== undefined) {
- if (operand.timeFramePicker.visible === true) {
- operand.timeFramePicker.drawBackground()
- }
- }
- }
-
- function thisObjectDrawBackground () {
- if (thisObject.visible === true) {
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- let radius = thisObject.container.frame.radius
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius + 3, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
- browserCanvasContext.fill()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.GREY + ', ' + 1 + ')'
- browserCanvasContext.fill()
- }
- }
-
- function drawForeground () {
- thisObjectDrawForeground()
- childrenDrawForeground()
- }
-
- function childrenDrawForeground () {
- if (conditionStructure === undefined) { return }
-
- for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
- let logicOperand = conditionStructure.logicOperands[i]
- if (logicOperand.visible !== true) { continue }
-
- operandDrawForeground(logicOperand.comparison.operandA.algebra.operandA)
- operandDrawForeground(logicOperand.comparison.operandA.algebra.operandB)
- operandDrawForeground(logicOperand.comparison.operandB.algebra.operandA)
- operandDrawForeground(logicOperand.comparison.operandB.algebra.operandB)
-
- if (logicOperand.comparison.operandA.algebra.picker !== undefined) {
- if (logicOperand.comparison.operandA.algebra.picker.visible === true) {
- logicOperand.comparison.operandA.algebra.picker.drawForeground()
+ if (logicOperand.comparison.operandB.algebra.picker.getSelected() !== '...') {
+ setVisibility(logicOperand.comparison.operandB.algebra.operandB, true)
+ }
+ }
}
- }
- if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
- if (logicOperand.comparison.operandB.algebra.picker.visible === true) {
- logicOperand.comparison.operandB.algebra.picker.drawForeground()
+
+ function setLogicOperanVisibility(logicOperand, isVisible) {
+
}
- }
- if (logicOperand.comparison.picker !== undefined) {
- if (logicOperand.comparison.picker.visible === true) {
- logicOperand.comparison.picker.drawForeground()
+
+ function setVisibility(algebraOperand, isVisible) {
+ algebraOperand.whenPicker.visible = isVisible
+ algebraOperand.dataMinePicker.visible = isVisible
+ algebraOperand.botPicker.visible = isVisible
+ algebraOperand.productPicker.visible = isVisible
+ algebraOperand.propertyPicker.visible = isVisible
+ algebraOperand.timeFramePicker.visible = isVisible
}
- }
- if (logicOperand.picker !== undefined) {
- if (logicOperand.picker.visible === true) {
- logicOperand.picker.drawForeground()
+ }
+
+ function getContainer(point) {
+ let container
+ if (thisObject.visible === true) {
+ if (conditionStructure === undefined) { return }
+
+ for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
+ let logicOperand = conditionStructure.logicOperands[i]
+ if (logicOperand.visible !== true) { continue }
+
+ container = operandGetContainer(point, logicOperand.comparison.operandA.algebra.operandA)
+ if (container !== undefined) { return container }
+ container = operandGetContainer(point, logicOperand.comparison.operandA.algebra.operandB)
+ if (container !== undefined) { return container }
+ container = operandGetContainer(point, logicOperand.comparison.operandB.algebra.operandA)
+ if (container !== undefined) { return container }
+ container = operandGetContainer(point, logicOperand.comparison.operandB.algebra.operandB)
+ if (container !== undefined) { return container }
+
+ if (container = logicOperand.comparison.operandA.algebra.picker !== undefined) {
+ if (container = logicOperand.comparison.operandA.algebra.picker.visible === true) {
+ container = logicOperand.comparison.operandA.algebra.picker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
+ if (container = logicOperand.comparison.operandB.algebra.picker.visible === true) {
+ container = logicOperand.comparison.operandB.algebra.picker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (container = logicOperand.comparison.picker !== undefined) {
+ if (container = logicOperand.comparison.picker.visible === true) {
+ container = logicOperand.comparison.picker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (container = logicOperand.picker !== undefined) {
+ if (container = logicOperand.picker.visible === true) {
+ container = logicOperand.picker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+ }
+
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
}
- }
- }
- }
-
- function operandDrawForeground (operand) {
- if (operand === undefined) { return }
-
- if (operand.whenPicker !== undefined) {
- if (operand.whenPicker.visible === true) {
- operand.whenPicker.drawForeground()
- }
}
- if (operand.dataMinePicker !== undefined) {
- if (operand.dataMinePicker.visible === true) {
- operand.dataMinePicker.drawForeground()
- }
+ function operandGetContainer(point, operand) {
+ let container
+ if (operand.whenPicker !== undefined) {
+ if (operand.whenPicker.visible === true) {
+ container = operand.whenPicker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (operand.dataMinePicker !== undefined) {
+ if (operand.dataMinePicker.visible === true) {
+ container = operand.dataMinePicker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (operand.botPicker !== undefined) {
+ if (operand.botPicker.visible === true) {
+ container = operand.botPicker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (operand.productPicker !== undefined) {
+ if (operand.productPicker.visible === true) {
+ container = operand.productPicker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (operand.propertyPicker !== undefined) {
+ if (operand.propertyPicker.visible === true) {
+ container = operand.propertyPicker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (operand.valuePicker !== undefined) {
+ if (operand.valuePicker.visible === true) {
+ container = operand.valuePicker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
+
+ if (operand.timeFramePicker !== undefined) {
+ if (operand.timeFramePicker.visible === true) {
+ container = operand.timeFramePicker.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+ }
}
- if (operand.botPicker !== undefined) {
- if (operand.botPicker.visible === true) {
- operand.botPicker.drawForeground()
- }
+ function physics() {
+
}
- if (operand.productPicker !== undefined) {
- if (operand.productPicker.visible === true) {
- operand.productPicker.drawForeground()
- }
+ function drawBackground() {
+ thisObjectDrawBackground()
+ childrenDrawBackground()
}
- if (operand.propertyPicker !== undefined) {
- if (operand.propertyPicker.visible === true) {
- operand.propertyPicker.drawForeground()
- }
+ function childrenDrawBackground() {
+ if (conditionStructure === undefined) { return }
+
+ for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
+ let logicOperand = conditionStructure.logicOperands[i]
+ if (logicOperand.visible !== true) { continue }
+
+ operandDrawBackground(logicOperand.comparison.operandA.algebra.operandA)
+ operandDrawBackground(logicOperand.comparison.operandA.algebra.operandB)
+ operandDrawBackground(logicOperand.comparison.operandB.algebra.operandA)
+ operandDrawBackground(logicOperand.comparison.operandB.algebra.operandB)
+
+ if (logicOperand.comparison.operandA.algebra.picker !== undefined) {
+ if (logicOperand.comparison.operandA.algebra.picker.visible === true) {
+ logicOperand.comparison.operandA.algebra.picker.drawBackground()
+ }
+ }
+ if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
+ if (logicOperand.comparison.operandB.algebra.picker.visible === true) {
+ logicOperand.comparison.operandB.algebra.picker.drawBackground()
+ }
+ }
+ if (logicOperand.comparison.picker !== undefined) {
+ if (logicOperand.comparison.picker.visible === true) {
+ logicOperand.comparison.picker.drawBackground()
+ }
+ }
+ if (logicOperand.picker !== undefined) {
+ if (logicOperand.picker.visible === true) {
+ logicOperand.picker.drawBackground()
+ }
+ }
+ }
}
- if (operand.valuePicker !== undefined) {
- if (operand.valuePicker.visible === true) {
- operand.valuePicker.drawForeground()
- }
+ function operandDrawBackground(operand) {
+ if (operand === undefined) { return }
+
+ if (operand.whenPicker !== undefined) {
+ if (operand.whenPicker.visible === true) {
+ operand.whenPicker.drawBackground()
+ }
+ }
+
+ if (operand.dataMinePicker !== undefined) {
+ if (operand.dataMinePicker.visible === true) {
+ operand.dataMinePicker.drawBackground()
+ }
+ }
+
+ if (operand.botPicker !== undefined) {
+ if (operand.botPicker.visible === true) {
+ operand.botPicker.drawBackground()
+ }
+ }
+
+ if (operand.productPicker !== undefined) {
+ if (operand.productPicker.visible === true) {
+ operand.productPicker.drawBackground()
+ }
+ }
+
+ if (operand.propertyPicker !== undefined) {
+ if (operand.propertyPicker.visible === true) {
+ operand.propertyPicker.drawBackground()
+ }
+ }
+
+ if (operand.valuePicker !== undefined) {
+ if (operand.valuePicker.visible === true) {
+ operand.valuePicker.drawBackground()
+ }
+ }
+
+ if (operand.timeFramePicker !== undefined) {
+ if (operand.timeFramePicker.visible === true) {
+ operand.timeFramePicker.drawBackground()
+ }
+ }
}
- if (operand.timeFramePicker !== undefined) {
- if (operand.timeFramePicker.visible === true) {
- operand.timeFramePicker.drawForeground()
- }
- }
- }
+ function thisObjectDrawBackground() {
+ if (thisObject.visible === true) {
+ let position = {
+ x: 0,
+ y: 0
+ }
- function thisObjectDrawForeground () {
- if (thisObject.visible === true) {
- const SIZE = 36
- drawIcon(timeFrameIcon, 0, 0, -PICKER_WIDTH * 3.25, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
- drawIcon(dataMineIcon, 0, 0, -PICKER_WIDTH * 2.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
- drawIcon(botIcon, 0, 0, -PICKER_WIDTH * 1.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
- drawIcon(whenIcon, 0, 0, -PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
- drawIcon(productIcon, 0, 0, PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
- drawIcon(propertyIcon, 0, 0, PICKER_WIDTH * 1.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
- drawIcon(operationIcon, 0, 0, PICKER_WIDTH * 2.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
- drawIcon(valueIcon, 0, 0, PICKER_WIDTH * 3.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ let radius = thisObject.container.frame.radius
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius + 3, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.GREY + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+ }
+ }
+
+ function drawForeground() {
+ thisObjectDrawForeground()
+ childrenDrawForeground()
+ }
+
+ function childrenDrawForeground() {
+ if (conditionStructure === undefined) { return }
+
+ for (let i = 0; i < conditionStructure.logicOperands.length; i++) {
+ let logicOperand = conditionStructure.logicOperands[i]
+ if (logicOperand.visible !== true) { continue }
+
+ operandDrawForeground(logicOperand.comparison.operandA.algebra.operandA)
+ operandDrawForeground(logicOperand.comparison.operandA.algebra.operandB)
+ operandDrawForeground(logicOperand.comparison.operandB.algebra.operandA)
+ operandDrawForeground(logicOperand.comparison.operandB.algebra.operandB)
+
+ if (logicOperand.comparison.operandA.algebra.picker !== undefined) {
+ if (logicOperand.comparison.operandA.algebra.picker.visible === true) {
+ logicOperand.comparison.operandA.algebra.picker.drawForeground()
+ }
+ }
+ if (logicOperand.comparison.operandB.algebra.picker !== undefined) {
+ if (logicOperand.comparison.operandB.algebra.picker.visible === true) {
+ logicOperand.comparison.operandB.algebra.picker.drawForeground()
+ }
+ }
+ if (logicOperand.comparison.picker !== undefined) {
+ if (logicOperand.comparison.picker.visible === true) {
+ logicOperand.comparison.picker.drawForeground()
+ }
+ }
+ if (logicOperand.picker !== undefined) {
+ if (logicOperand.picker.visible === true) {
+ logicOperand.picker.drawForeground()
+ }
+ }
+ }
+ }
+
+ function operandDrawForeground(operand) {
+ if (operand === undefined) { return }
+
+ if (operand.whenPicker !== undefined) {
+ if (operand.whenPicker.visible === true) {
+ operand.whenPicker.drawForeground()
+ }
+ }
+
+ if (operand.dataMinePicker !== undefined) {
+ if (operand.dataMinePicker.visible === true) {
+ operand.dataMinePicker.drawForeground()
+ }
+ }
+
+ if (operand.botPicker !== undefined) {
+ if (operand.botPicker.visible === true) {
+ operand.botPicker.drawForeground()
+ }
+ }
+
+ if (operand.productPicker !== undefined) {
+ if (operand.productPicker.visible === true) {
+ operand.productPicker.drawForeground()
+ }
+ }
+
+ if (operand.propertyPicker !== undefined) {
+ if (operand.propertyPicker.visible === true) {
+ operand.propertyPicker.drawForeground()
+ }
+ }
+
+ if (operand.valuePicker !== undefined) {
+ if (operand.valuePicker.visible === true) {
+ operand.valuePicker.drawForeground()
+ }
+ }
+
+ if (operand.timeFramePicker !== undefined) {
+ if (operand.timeFramePicker.visible === true) {
+ operand.timeFramePicker.drawForeground()
+ }
+ }
+ }
+
+ function thisObjectDrawForeground() {
+ if (thisObject.visible === true) {
+ const SIZE = 36
+ drawIcon(timeFrameIcon, 0, 0, -PICKER_WIDTH * 3.25, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ drawIcon(dataMineIcon, 0, 0, -PICKER_WIDTH * 2.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ drawIcon(botIcon, 0, 0, -PICKER_WIDTH * 1.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ drawIcon(whenIcon, 0, 0, -PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ drawIcon(productIcon, 0, 0, PICKER_WIDTH * 0.5, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ drawIcon(propertyIcon, 0, 0, PICKER_WIDTH * 1.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ drawIcon(operationIcon, 0, 0, PICKER_WIDTH * 2.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ drawIcon(valueIcon, 0, 0, PICKER_WIDTH * 3.45, -PICKER_HEIGHT * 7, SIZE, thisObject.container)
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/ConfigEditor.js b/CanvasApp/FloatingSpace/ConfigEditor.js
index 8cb2ffb83..e62179f68 100644
--- a/CanvasApp/FloatingSpace/ConfigEditor.js
+++ b/CanvasApp/FloatingSpace/ConfigEditor.js
@@ -1,205 +1,205 @@
-function newConfigEditor () {
- const MODULE_NAME = 'Config Editor'
+function newConfigEditor() {
+ const MODULE_NAME = 'Config Editor'
- let thisObject = {
- isVisibleFunction: undefined,
- visible: false,
- imagePathOK: undefined,
- imagePathNOT_OK: undefined,
- rawRadius: undefined,
- targetRadius: undefined,
- currentRadius: undefined,
- container: undefined,
- payload: undefined,
- deactivate: deactivate,
- activate: activate,
- physics: physics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.detectMouseOver = false
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
-
- let isMouseOver = false
- let SIZE_FACTOR = 1
-
- return thisObject
-
- function finalize () {
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.isVisibleFunction = undefined
- }
-
- function initialize () {
-
- }
-
- function deactivate () {
- if (thisObject.visible === true) {
- thisObject.visible = false
- let textArea = document.getElementById('textArea')
- textArea.style.display = 'none'
- thisObject.payload.node.config = textArea.value
-
- try {
- let config = JSON.parse(thisObject.payload.node.config)
- } catch (err) {
- thisObject.payload.uiObject.setErrorMessage(err.message, 10)
- }
- }
- EDITOR_ON_FOCUS = false
- }
-
- function activate (payload) {
- thisObject.visible = true
- thisObject.payload = payload
- thisObject.rawRadius = 8
- thisObject.targetRadius = thisObject.container.frame.radius
- thisObject.currentRadius = 0
- thisObject.payload.uiObject.setErrorMessage('', 0)
-
- let textArea = document.getElementById('textArea')
- textArea.value = payload.node.config
- textArea.style = 'resize: none;' +
- ' border: none;' +
- ' outline: none;' +
- 'box-shadow: none;' +
- 'overflow:hidden;' +
- 'font-family: ' + UI_FONT.PRIMARY + ';' +
- 'font-size: 14px;' +
- 'background-color: rgb(' + UI_COLOR.DARK_TURQUOISE + ');' +
- 'color:rgb(255, 255, 255);' +
- 'width: ' + thisObject.container.frame.width + 'px;' +
- 'height: ' + thisObject.container.frame.height + 'px'
- textArea.style.display = 'block'
- textArea.focus()
- EDITOR_ON_FOCUS = true
- }
-
- function getContainer (point) {
- let container
- if (thisObject.visible === true) {
- if (point.x === VERY_LARGE_NUMBER) {
- /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
- anyone can react. In our case, the config editor has a text area that is not part of the canvas, so the event is
- triggered. We compensate recognizing this coordinate and returning our container. */
- return thisObject.container
- }
-
- if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
- }
-
- function physics () {
- if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= 0.5) {
- if (thisObject.currentRadius < thisObject.targetRadius) {
- thisObject.currentRadius = thisObject.currentRadius + 0.5
- } else {
- thisObject.currentRadius = thisObject.currentRadius - 0.5
- }
+ let thisObject = {
+ isVisibleFunction: undefined,
+ visible: false,
+ imagePathOK: undefined,
+ imagePathNOT_OK: undefined,
+ rawRadius: undefined,
+ targetRadius: undefined,
+ currentRadius: undefined,
+ container: undefined,
+ payload: undefined,
+ deactivate: deactivate,
+ activate: activate,
+ physics: physics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.detectMouseOver = false
+ thisObject.container.frame.radius = 0
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
- thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
- thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
+ let isMouseOver = false
+ let SIZE_FACTOR = 1
- let textAreaPosition = {
- x: 0 - thisObject.container.frame.width / 2,
- y: 0 - thisObject.container.frame.height * 3 / 7 + CURRENT_TOP_MARGIN
+ return thisObject
+
+ function finalize() {
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.isVisibleFunction = undefined
}
- textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition)
- if (thisObject.visible === true) {
- let checkPosition = {
- x: textAreaPosition.x,
- y: textAreaPosition.y - CURRENT_TOP_MARGIN
- }
- if (thisObject.isVisibleFunction(checkPosition) === false) {
- deactivate()
- }
- }
- if (thisObject.visible === true) {
- let textAreaDiv = document.getElementById('textAreaDiv')
- textAreaDiv.style = 'position:fixed; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; '
- }
- }
+ function initialize() {
- function drawBackground () {
- if (thisObject.visible === true) {
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- let radius = thisObject.container.frame.radius * SIZE_FACTOR
-
- if (radius > 0.5) {
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius * 1.3 + 3, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
- browserCanvasContext.fill()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius * 1.3, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + 1 + ')'
- browserCanvasContext.fill()
- }
- }
- }
- function drawForeground () {
- let iconPosition = {
- x: 0,
- y: thisObject.currentRadius * 1.5
}
- iconPosition = thisObject.container.frame.frameThisPoint(iconPosition)
+ function deactivate() {
+ if (thisObject.visible === true) {
+ thisObject.visible = false
+ let textArea = document.getElementById('textArea')
+ textArea.style.display = 'none'
+ thisObject.payload.node.config = textArea.value
- /* Menu Item */
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+ } catch (err) {
+ thisObject.payload.uiObject.setErrorMessage(err.message, 10)
+ }
+ }
+ EDITOR_ON_FOCUS = false
+ }
- if (thisObject.canDrawIcon === true && thisObject.currentRadius > 1) {
- browserCanvasContext.drawImage(thisObject.icon, iconPosition.x - thisObject.currentRadius, iconPosition.y - thisObject.currentRadius, thisObject.currentRadius * 2, thisObject.currentRadius * 2)
+ function activate(payload) {
+ thisObject.visible = true
+ thisObject.payload = payload
+ thisObject.rawRadius = 8
+ thisObject.targetRadius = thisObject.container.frame.radius
+ thisObject.currentRadius = 0
+ thisObject.payload.uiObject.setErrorMessage('', 0)
- /* Menu Label */
+ let textArea = document.getElementById('textArea')
+ textArea.value = payload.node.config
+ textArea.style = 'resize: none;' +
+ ' border: none;' +
+ ' outline: none;' +
+ 'box-shadow: none;' +
+ 'overflow:hidden;' +
+ 'font-family: ' + UI_FONT.PRIMARY + ';' +
+ 'font-size: 14px;' +
+ 'background-color: rgb(' + UI_COLOR.DARK_TURQUOISE + ');' +
+ 'color:rgb(255, 255, 255);' +
+ 'width: ' + thisObject.container.frame.width + 'px;' +
+ 'height: ' + thisObject.container.frame.height + 'px'
+ textArea.style.display = 'block'
+ textArea.focus()
+ EDITOR_ON_FOCUS = true
+ }
- let label = 'Code looks good!'
- let labelPoint
- let fontSize = 10
+ function getContainer(point) {
+ let container
+ if (thisObject.visible === true) {
+ if (point.x === VERY_LARGE_NUMBER) {
+ /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
+ anyone can react. In our case, the config editor has a text area that is not part of the canvas, so the event is
+ triggered. We compensate recognizing this coordinate and returning our container. */
+ return thisObject.container
+ }
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
+ }
- if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
- labelPoint = {
- x: iconPosition.x + thisObject.currentRadius + 10,
- y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+ function physics() {
+ if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= 0.5) {
+ if (thisObject.currentRadius < thisObject.targetRadius) {
+ thisObject.currentRadius = thisObject.currentRadius + 0.5
+ } else {
+ thisObject.currentRadius = thisObject.currentRadius - 0.5
+ }
}
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
+
+ thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
+ thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
+
+ let textAreaPosition = {
+ x: 0 - thisObject.container.frame.width / 2,
+ y: 0 - thisObject.container.frame.height * 3 / 7 + CURRENT_TOP_MARGIN
+ }
+
+ textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition)
+ if (thisObject.visible === true) {
+ let checkPosition = {
+ x: textAreaPosition.x,
+ y: textAreaPosition.y - CURRENT_TOP_MARGIN
+ }
+ if (thisObject.isVisibleFunction(checkPosition) === false) {
+ deactivate()
+ }
+ }
+ if (thisObject.visible === true) {
+ let textAreaDiv = document.getElementById('textAreaDiv')
+ textAreaDiv.style = 'position:fixed; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; '
+ }
+ }
+
+ function drawBackground() {
+ if (thisObject.visible === true) {
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ let radius = thisObject.container.frame.radius * SIZE_FACTOR
+
+ if (radius > 0.5) {
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius * 1.3 + 3, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius * 1.3, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK_TURQUOISE + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+ }
+ }
+ }
+ function drawForeground() {
+ let iconPosition = {
+ x: 0,
+ y: thisObject.currentRadius * 1.5
+ }
+
+ iconPosition = thisObject.container.frame.frameThisPoint(iconPosition)
+
+ /* Menu Item */
+
+ if (thisObject.canDrawIcon === true && thisObject.currentRadius > 1) {
+ browserCanvasContext.drawImage(thisObject.icon, iconPosition.x - thisObject.currentRadius, iconPosition.y - thisObject.currentRadius, thisObject.currentRadius * 2, thisObject.currentRadius * 2)
+
+ /* Menu Label */
+
+ let label = 'Code looks good!'
+ let labelPoint
+ let fontSize = 10
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+
+ if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
+ labelPoint = {
+ x: iconPosition.x + thisObject.currentRadius + 10,
+ y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/FloatingLayer.js b/CanvasApp/FloatingSpace/FloatingLayer.js
index 4653bd532..bb59a9a7c 100644
--- a/CanvasApp/FloatingSpace/FloatingLayer.js
+++ b/CanvasApp/FloatingSpace/FloatingLayer.js
@@ -13,22 +13,22 @@
3. UI Objects: These are small balls that represent parts of an strategy.
*/
-function newFloatingLayer () {
- const MODULE_NAME = 'Floating Layer'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newFloatingLayer() {
+ const MODULE_NAME = 'Floating Layer'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- addFloatingObject: addFloatingObject,
- removeFloatingObject: removeFloatingObject,
- getFloatingObject: getFloatingObject,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
+ let thisObject = {
+ addFloatingObject: addFloatingObject,
+ removeFloatingObject: removeFloatingObject,
+ getFloatingObject: getFloatingObject,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
+ }
/*
When objects are added to this layer they are added to the invisibleFloatingObjects array and they stay there because they are invisible.
@@ -38,7 +38,7 @@ function newFloatingLayer () {
To save resources, the physics engine only apply its calculations to visible floating objects.
*/
- let invisibleFloatingObjects = []
+ let invisibleFloatingObjects = []
/*
Floating objects are accesible to plotters because they carry a "payload" object that was creted by them. This object includes the position
@@ -48,206 +48,206 @@ function newFloatingLayer () {
array.
*/
- let visibleFloatingObjects = []
+ let visibleFloatingObjects = []
- let maxTargetRepulsionForce = 0.001
- let currentHandle = 0
+ let maxTargetRepulsionForce = 0.001
+ let currentHandle = 0
- return thisObject
+ return thisObject
- function finalize () {
- invisibleFloatingObjects = []
- visibleFloatingObjects = []
- }
+ function finalize() {
+ invisibleFloatingObjects = []
+ visibleFloatingObjects = []
+ }
- function initialize () {
+ function initialize() {
/* We dont need to initialize anything right now. */
- }
-
- function getContainer (point) {
- let container
-
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
- container = floatingObject.getContainer(point)
- if (container !== undefined) { return container }
}
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
- container = floatingObject.getContainer(point)
- if (container !== undefined) { return container }
+ function getContainer(point) {
+ let container
+
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+ container = floatingObject.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[i]
+ container = floatingObject.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+
+ return container
}
- return container
- }
-
- function addFloatingObject (pFloatingObject) {
- currentHandle++
- pFloatingObject.handle = currentHandle // Math.floor((Math.random() * 10000000) + 1);
- visibleFloatingObjects.push(pFloatingObject)
- }
-
- function removeFloatingObject (pFloatingObjectHandle) {
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
-
- if (floatingObject.handle === pFloatingObjectHandle) {
- invisibleFloatingObjects.splice(i, 1) // Delete item from array.
- return
- }
+ function addFloatingObject(pFloatingObject) {
+ currentHandle++
+ pFloatingObject.handle = currentHandle // Math.floor((Math.random() * 10000000) + 1);
+ visibleFloatingObjects.push(pFloatingObject)
}
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
+ function removeFloatingObject(pFloatingObjectHandle) {
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[i]
- if (floatingObject.handle === pFloatingObjectHandle) {
- visibleFloatingObjects.splice(i, 1) // Delete item from array.
- return
- }
+ if (floatingObject.handle === pFloatingObjectHandle) {
+ invisibleFloatingObjects.splice(i, 1) // Delete item from array.
+ return
+ }
+ }
+
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+
+ if (floatingObject.handle === pFloatingObjectHandle) {
+ visibleFloatingObjects.splice(i, 1) // Delete item from array.
+ return
+ }
+ }
}
- }
- function getFloatingObject (pFloatingObjectHandle, pFloatingObjectIndex) {
+ function getFloatingObject(pFloatingObjectHandle, pFloatingObjectIndex) {
/*
There are two ways to look for a floating object: by handle or by index. The search by handle is done on the visible and invisible array.
The search by index is done only on the visible ones. The search by index is usually needed when mouse events occurs. In those cases
only objects visible to the end usser matters.
*/
- try {
- if (pFloatingObjectHandle !== undefined) {
+ try {
+ if (pFloatingObjectHandle !== undefined) {
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[i]
+
+ if (floatingObject.handle === pFloatingObjectHandle) {
+ return floatingObject
+ }
+ }
+
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+
+ if (floatingObject.handle === pFloatingObjectHandle) {
+ return floatingObject
+ }
+ }
+ }
+
+ if (pFloatingObjectIndex !== undefined) {
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+
+ if (i === pFloatingObjectIndex) {
+ return floatingObject
+ }
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] getFloatingObject -> err= ' + err.stack) }
+ }
+ }
+
+ function draw() {
+ drawInvisibleObjects()
+ drawVisibleObjects()
+ }
+
+ function drawInvisibleObjects() {
for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
+ let floatingObject = invisibleFloatingObjects[i]
+ floatingObject.drawBackground()
+ }
- if (floatingObject.handle === pFloatingObjectHandle) {
- return floatingObject
- }
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[i]
+ floatingObject.drawMiddleground()
+ }
+
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[invisibleFloatingObjects.length - i - 1]
+ floatingObject.drawForeground()
+ }
+ }
+
+ function drawVisibleObjects() {
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+ floatingObject.drawBackground()
}
for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
-
- if (floatingObject.handle === pFloatingObjectHandle) {
- return floatingObject
- }
+ let floatingObject = visibleFloatingObjects[i]
+ floatingObject.drawMiddleground()
}
- }
- if (pFloatingObjectIndex !== undefined) {
for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
-
- if (i === pFloatingObjectIndex) {
- return floatingObject
- }
+ let floatingObject = visibleFloatingObjects[visibleFloatingObjects.length - i - 1]
+ floatingObject.drawForeground()
}
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] getFloatingObject -> err= ' + err.stack) }
- }
- }
- function draw () {
- drawInvisibleObjects()
- drawVisibleObjects()
- }
+ /* Invisible objects on focus (freezed) should still have some priority */
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[i]
+ floatingObject.drawOnFocus()
+ }
- function drawInvisibleObjects () {
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
- floatingObject.drawBackground()
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+ floatingObject.drawOnFocus()
+ }
}
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
- floatingObject.drawMiddleground()
+ function collapsePhysics(thisObject) {
+ let parent = thisObject.payload.chainParent
+ if (parent === undefined) { return }
+ if (parent.payload === undefined) { return }
+ if (parent.payload.floatingObject === undefined) { return }
+
+ thisObject.isParentCollapsed = parent.payload.floatingObject.isCollapsed
+ if (thisObject.collapsedManually === false) {
+ thisObject.isCollapsed = parent.payload.floatingObject.isCollapsed
+ }
}
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[invisibleFloatingObjects.length - i - 1]
- floatingObject.drawForeground()
- }
- }
+ function makeVisible() {
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[i]
- function drawVisibleObjects () {
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
- floatingObject.drawBackground()
+ collapsePhysics(floatingObject)
+
+ if (floatingObject.isParentCollapsed === false) {
+ visibleFloatingObjects.push(floatingObject)
+ invisibleFloatingObjects.splice(i, 1) // Delete item from array.
+ makeVisible()
+ return // Only one at the time.
+ }
+ }
}
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
- floatingObject.drawMiddleground()
+ function makeInvisible() {
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+
+ collapsePhysics(floatingObject)
+
+ if (floatingObject.isParentCollapsed === true) {
+ invisibleFloatingObjects.push(floatingObject)
+ visibleFloatingObjects.splice(i, 1) // Delete item from array.
+ makeInvisible()
+ return // Only one at the time.
+ }
+ }
}
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[visibleFloatingObjects.length - i - 1]
- floatingObject.drawForeground()
- }
-
- /* Invisible objects on focus (freezed) should still have some priority */
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
- floatingObject.drawOnFocus()
- }
-
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
- floatingObject.drawOnFocus()
- }
- }
-
- function collapsePhysics (thisObject) {
- let parent = thisObject.payload.chainParent
- if (parent === undefined) { return }
- if (parent.payload === undefined) { return }
- if (parent.payload.floatingObject === undefined) { return }
-
- thisObject.isParentCollapsed = parent.payload.floatingObject.isCollapsed
- if (thisObject.collapsedManually === false) {
- thisObject.isCollapsed = parent.payload.floatingObject.isCollapsed
- }
- }
-
- function makeVisible () {
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
-
- collapsePhysics(floatingObject)
-
- if (floatingObject.isParentCollapsed === false) {
- visibleFloatingObjects.push(floatingObject)
- invisibleFloatingObjects.splice(i, 1) // Delete item from array.
- makeVisible()
- return // Only one at the time.
- }
- }
- }
-
- function makeInvisible () {
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
-
- collapsePhysics(floatingObject)
-
- if (floatingObject.isParentCollapsed === true) {
- invisibleFloatingObjects.push(floatingObject)
- visibleFloatingObjects.splice(i, 1) // Delete item from array.
- makeInvisible()
- return // Only one at the time.
- }
- }
- }
-
/******************************************/
/* */
/* Physics Engine Follows */
/* */
/******************************************/
- function physics () {
+ function physics() {
/*
The Physics engine is hooked at the animation loop, so it executes very very often. According to this Physics engine, each
floating object has a position and a speed. In fact, each floating object has two positions at the same time:
@@ -262,483 +262,483 @@ function newFloatingLayer () {
*/
- try {
- makeVisible()
- makeInvisible()
- invisiblePhysics()
- visiblePhysics()
- applyPhysics()
+ try {
+ makeVisible()
+ makeInvisible()
+ invisiblePhysics()
+ visiblePhysics()
+ applyPhysics()
- function invisiblePhysics () {
- for (let i = 0; i < invisibleFloatingObjects.length; i++) {
- let floatingObject = invisibleFloatingObjects[i]
- floatingObject.invisiblePhysics()
- }
- }
+ function invisiblePhysics() {
+ for (let i = 0; i < invisibleFloatingObjects.length; i++) {
+ let floatingObject = invisibleFloatingObjects[i]
+ floatingObject.invisiblePhysics()
+ }
+ }
- function visiblePhysics () {
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
- floatingObject.physics()
- }
- }
+ function visiblePhysics() {
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+ floatingObject.physics()
+ }
+ }
- function applyPhysics () {
+ function applyPhysics() {
/* This function makes all the calculations to apply phisycs on all visible floatingObjects in this layer. */
- try {
- DEBUG.variable1 = 'Invisible Floating Objets: ' + invisibleFloatingObjects.length
- DEBUG.variable2 = 'Visible Floating Objets: ' + visibleFloatingObjects.length
+ try {
+ DEBUG.variable1 = 'Invisible Floating Objets: ' + invisibleFloatingObjects.length
+ DEBUG.variable2 = 'Visible Floating Objets: ' + visibleFloatingObjects.length
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- let floatingObject = visibleFloatingObjects[i]
- if (floatingObject.isFrozen === true) { continue }
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ let floatingObject = visibleFloatingObjects[i]
+ if (floatingObject.isFrozen === true) { continue }
- /* From here on, only if they are not too far. */
- if (canvas.floatingSpace.isItFar(floatingObject.payload)) { continue }
+ /* From here on, only if they are not too far. */
+ if (canvas.floatingSpace.isItFar(floatingObject.payload)) { continue }
- if (floatingObject.positionLocked === false) {
- floatingObject.container.frame.position.x = floatingObject.container.frame.position.x + floatingObject.currentSpeed.x
- floatingObject.container.frame.position.y = floatingObject.container.frame.position.y + floatingObject.currentSpeed.y
- }
+ if (floatingObject.positionLocked === false) {
+ floatingObject.container.frame.position.x = floatingObject.container.frame.position.x + floatingObject.currentSpeed.x
+ floatingObject.container.frame.position.y = floatingObject.container.frame.position.y + floatingObject.currentSpeed.y
+ }
- if (floatingObject.friction < floatingObject.targetFriction) {
- floatingObject.friction = floatingObject.friction + 0.00001
- } else {
- floatingObject.friction = floatingObject.friction - 0.00001
- }
+ if (floatingObject.friction < floatingObject.targetFriction) {
+ floatingObject.friction = floatingObject.friction + 0.00001
+ } else {
+ floatingObject.friction = floatingObject.friction - 0.00001
+ }
- floatingObject.currentSpeed.x = floatingObject.currentSpeed.x * floatingObject.friction // Desaceleration factor.
- floatingObject.currentSpeed.y = floatingObject.currentSpeed.y * floatingObject.friction // Desaceleration factor.
+ floatingObject.currentSpeed.x = floatingObject.currentSpeed.x * floatingObject.friction // Desaceleration factor.
+ floatingObject.currentSpeed.y = floatingObject.currentSpeed.y * floatingObject.friction // Desaceleration factor.
- let payload = {
- position: undefined,
- visible: false
- }
+ let payload = {
+ position: undefined,
+ visible: false
+ }
- switch (floatingObject.type) {
- case 'UI Object': {
- payload.targetPosition = floatingObject.payload.targetPosition
- payload.visible = floatingObject.payload.visible
- break
- }
- default: {
- break
- }
- }
+ switch (floatingObject.type) {
+ case 'UI Object': {
+ payload.targetPosition = floatingObject.payload.targetPosition
+ payload.visible = floatingObject.payload.visible
+ break
+ }
+ default: {
+ break
+ }
+ }
- if (floatingObject.container.frame.position.x < payload.targetPosition.x) {
- floatingObject.currentSpeed.x = floatingObject.currentSpeed.x + 0.005
- } else {
- floatingObject.currentSpeed.x = floatingObject.currentSpeed.x - 0.005
- }
+ if (floatingObject.container.frame.position.x < payload.targetPosition.x) {
+ floatingObject.currentSpeed.x = floatingObject.currentSpeed.x + 0.005
+ } else {
+ floatingObject.currentSpeed.x = floatingObject.currentSpeed.x - 0.005
+ }
- if (floatingObject.container.frame.position.y < payload.targetPosition.y) {
- floatingObject.currentSpeed.y = floatingObject.currentSpeed.y + 0.005
- } else {
- floatingObject.currentSpeed.y = floatingObject.currentSpeed.y - 0.005
- }
+ if (floatingObject.container.frame.position.y < payload.targetPosition.y) {
+ floatingObject.currentSpeed.y = floatingObject.currentSpeed.y + 0.005
+ } else {
+ floatingObject.currentSpeed.y = floatingObject.currentSpeed.y - 0.005
+ }
- const MAX_SPEED = 10
+ const MAX_SPEED = 10
- if (floatingObject.currentSpeed.x > MAX_SPEED) {
- floatingObject.currentSpeed.x = MAX_SPEED
- }
+ if (floatingObject.currentSpeed.x > MAX_SPEED) {
+ floatingObject.currentSpeed.x = MAX_SPEED
+ }
- if (floatingObject.currentSpeed.y > MAX_SPEED) {
- floatingObject.currentSpeed.y = MAX_SPEED
- }
+ if (floatingObject.currentSpeed.y > MAX_SPEED) {
+ floatingObject.currentSpeed.y = MAX_SPEED
+ }
- if (floatingObject.currentSpeed.x < -MAX_SPEED) {
- floatingObject.currentSpeed.x = -MAX_SPEED
- }
+ if (floatingObject.currentSpeed.x < -MAX_SPEED) {
+ floatingObject.currentSpeed.x = -MAX_SPEED
+ }
- if (floatingObject.currentSpeed.y < -MAX_SPEED) {
- floatingObject.currentSpeed.y = -MAX_SPEED
- }
+ if (floatingObject.currentSpeed.y < -MAX_SPEED) {
+ floatingObject.currentSpeed.y = -MAX_SPEED
+ }
// We let the Floating Object animate the physics loops by itself.
- checkBoundaries(floatingObject)
+ checkBoundaries(floatingObject)
/* Collision Control */
- for (let k = i + 1; k < visibleFloatingObjects.length; k++) {
- if (colliding(visibleFloatingObjects[i], visibleFloatingObjects[k])) {
- resolveCollision(visibleFloatingObjects[k], visibleFloatingObjects[i])
- }
- }
+ for (let k = i + 1; k < visibleFloatingObjects.length; k++) {
+ if (colliding(visibleFloatingObjects[i], visibleFloatingObjects[k])) {
+ resolveCollision(visibleFloatingObjects[k], visibleFloatingObjects[i])
+ }
+ }
/* Calculate repulsion force produced by all other floatingObjects */
- repulsionForceBetweenFloatingObjects(i)
+ repulsionForceBetweenFloatingObjects(i)
- targetRepulsionForce(i)
+ targetRepulsionForce(i)
- gravityForce(floatingObject, payload)
+ gravityForce(floatingObject, payload)
- proximityBetweenFloatingObjects(i)
- }
+ proximityBetweenFloatingObjects(i)
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] physics -> applyPhysics -> err= ' + err.stack) }
+ }
+ }
} catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] physics -> applyPhysics -> err= ' + err.stack) }
+ if (ERROR_LOG === true) { logger.write('[ERROR] physics -> err= ' + err.stack) }
}
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] physics -> err= ' + err.stack) }
- }
- }
-
- function checkBoundaries (floatingObject) {
- if (floatingObject.container.frame.position.x - floatingObject.container.frame.radius < 0) {
- floatingObject.container.frame.position.x = floatingObject.container.frame.radius
- floatingObject.currentSpeed.x = -floatingObject.currentSpeed.x
}
- if (floatingObject.container.frame.position.x + floatingObject.container.frame.radius > canvas.floatingSpace.container.frame.width) {
- floatingObject.container.frame.position.x = canvas.floatingSpace.container.frame.width - floatingObject.container.frame.radius
- floatingObject.currentSpeed.x = -floatingObject.currentSpeed.x
+ function checkBoundaries(floatingObject) {
+ if (floatingObject.container.frame.position.x - floatingObject.container.frame.radius < 0) {
+ floatingObject.container.frame.position.x = floatingObject.container.frame.radius
+ floatingObject.currentSpeed.x = -floatingObject.currentSpeed.x
+ }
+
+ if (floatingObject.container.frame.position.x + floatingObject.container.frame.radius > canvas.floatingSpace.container.frame.width) {
+ floatingObject.container.frame.position.x = canvas.floatingSpace.container.frame.width - floatingObject.container.frame.radius
+ floatingObject.currentSpeed.x = -floatingObject.currentSpeed.x
+ }
+
+ if (floatingObject.container.frame.position.y - floatingObject.container.frame.radius < 0) {
+ floatingObject.container.frame.position.y = floatingObject.container.frame.radius
+ floatingObject.currentSpeed.y = -floatingObject.currentSpeed.y
+ }
+
+ if (floatingObject.container.frame.position.y + floatingObject.container.frame.radius > canvas.floatingSpace.container.frame.height) {
+ floatingObject.container.frame.position.y = canvas.floatingSpace.container.frame.height - floatingObject.container.frame.radius
+ floatingObject.currentSpeed.y = -floatingObject.currentSpeed.y
+ }
}
- if (floatingObject.container.frame.position.y - floatingObject.container.frame.radius < 0) {
- floatingObject.container.frame.position.y = floatingObject.container.frame.radius
- floatingObject.currentSpeed.y = -floatingObject.currentSpeed.y
- }
-
- if (floatingObject.container.frame.position.y + floatingObject.container.frame.radius > canvas.floatingSpace.container.frame.height) {
- floatingObject.container.frame.position.y = canvas.floatingSpace.container.frame.height - floatingObject.container.frame.radius
- floatingObject.currentSpeed.y = -floatingObject.currentSpeed.y
- }
- }
-
- function gravityForce (floatingObject, payload) {
- try {
+ function gravityForce(floatingObject, payload) {
+ try {
/* We simulate a kind of gravity towards the target point of each floatingObject. This force will make the floatingObject to keep pushing to reach that point. */
- const coulomb = 0.00001
- const minForce = 0.01
+ const coulomb = 0.00001
+ const minForce = 0.01
- let d = Math.sqrt(Math.pow(payload.targetPosition.x - floatingObject.container.frame.position.x, 2) + Math.pow(payload.targetPosition.y - floatingObject.container.frame.position.y, 2)) // ... we calculate the distance ...
+ let d = Math.sqrt(Math.pow(payload.targetPosition.x - floatingObject.container.frame.position.x, 2) + Math.pow(payload.targetPosition.y - floatingObject.container.frame.position.y, 2)) // ... we calculate the distance ...
- let force = coulomb * d * d / floatingObject.currentMass // In this case the mass of the floatingObject affects the gravity force that it receives, that gives priority to target position to bigger floatingObjects.
+ let force = coulomb * d * d / floatingObject.currentMass // In this case the mass of the floatingObject affects the gravity force that it receives, that gives priority to target position to bigger floatingObjects.
- if (force < minForce) { // We need this attraction force to overcome the friction we imposed to the system.
- force = minForce
- }
+ if (force < minForce) { // We need this attraction force to overcome the friction we imposed to the system.
+ force = minForce
+ }
- let pos1 = {
- x: floatingObject.container.frame.position.x,
- y: floatingObject.container.frame.position.y
- }
+ let pos1 = {
+ x: floatingObject.container.frame.position.x,
+ y: floatingObject.container.frame.position.y
+ }
- let pos2 = {
- x: payload.targetPosition.x,
- y: payload.targetPosition.y
- }
+ let pos2 = {
+ x: payload.targetPosition.x,
+ y: payload.targetPosition.y
+ }
- let posDiff = { // Next we need the vector resulting from the 2 positions.
- x: pos2.x - pos1.x,
- y: pos2.y - pos1.y
- }
+ let posDiff = { // Next we need the vector resulting from the 2 positions.
+ x: pos2.x - pos1.x,
+ y: pos2.y - pos1.y
+ }
- if (d !== 0) {
- let unitVector = { // To find the unit vector, we divide each component by the magnitude of the vector.
- x: posDiff.x / d,
- y: posDiff.y / d
+ if (d !== 0) {
+ let unitVector = { // To find the unit vector, we divide each component by the magnitude of the vector.
+ x: posDiff.x / d,
+ y: posDiff.y / d
+ }
+
+ let forceVector = {
+ x: unitVector.x * force,
+ y: unitVector.y * force
+ }
+
+ /* We add the force vector to the speed vector */
+ if (isNaN(forceVector.x) === false && isNaN(forceVector.y) === false) {
+ floatingObject.currentSpeed.x = floatingObject.currentSpeed.x + forceVector.x
+ floatingObject.currentSpeed.y = floatingObject.currentSpeed.y + forceVector.y
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] gravityForce -> err= ' + err.stack) }
}
-
- let forceVector = {
- x: unitVector.x * force,
- y: unitVector.y * force
- }
-
- /* We add the force vector to the speed vector */
- if (isNaN(forceVector.x) === false && isNaN(forceVector.y) === false) {
- floatingObject.currentSpeed.x = floatingObject.currentSpeed.x + forceVector.x
- floatingObject.currentSpeed.y = floatingObject.currentSpeed.y + forceVector.y
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] gravityForce -> err= ' + err.stack) }
}
- }
- function repulsionForceBetweenFloatingObjects (currentFloatingObject) {
- try {
+ function repulsionForceBetweenFloatingObjects(currentFloatingObject) {
+ try {
/* We generate a repulsion force between floatingObjects, that prevents them to be collisioning so often. */
- const coulomb = 2
+ const coulomb = 2
- let floatingObject1 = visibleFloatingObjects[currentFloatingObject]
+ let floatingObject1 = visibleFloatingObjects[currentFloatingObject]
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- // The force to be applied is considering all other floatingObjects...
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ // The force to be applied is considering all other floatingObjects...
- if (i !== currentFloatingObject) {
- // ... except for the current one.
+ if (i !== currentFloatingObject) {
+ // ... except for the current one.
- let floatingObject2 = visibleFloatingObjects[i] // So, for each floatingObject...
+ let floatingObject2 = visibleFloatingObjects[i] // So, for each floatingObject...
- let d = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2)) // ... we calculate the distance ...
+ let d = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2)) // ... we calculate the distance ...
- let force = coulomb * floatingObject2.currentMass / (d * d) // ... and with it the repulsion force.
+ let force = coulomb * floatingObject2.currentMass / (d * d) // ... and with it the repulsion force.
/* We need to put a hard limit to this force, in order to to eject very little floatingObjects to the infinite and beyond. */
- if (force > 1) {
- force = 1
- }
+ if (force > 1) {
+ force = 1
+ }
- let pos1 = {
- x: floatingObject1.container.frame.position.x,
- y: floatingObject1.container.frame.position.y
- }
+ let pos1 = {
+ x: floatingObject1.container.frame.position.x,
+ y: floatingObject1.container.frame.position.y
+ }
- let pos2 = {
- x: floatingObject2.container.frame.position.x,
- y: floatingObject2.container.frame.position.y
- }
+ let pos2 = {
+ x: floatingObject2.container.frame.position.x,
+ y: floatingObject2.container.frame.position.y
+ }
- let posDiff = { // Next we need the vector resulting from the 2 positions.
- x: pos2.x - pos1.x,
- y: pos2.y - pos1.y
- }
+ let posDiff = { // Next we need the vector resulting from the 2 positions.
+ x: pos2.x - pos1.x,
+ y: pos2.y - pos1.y
+ }
- let unitVector = { // To find the unit vector, we divide each component by the magnitude of the vector.
- x: posDiff.x / d,
- y: posDiff.y / d
- }
+ let unitVector = { // To find the unit vector, we divide each component by the magnitude of the vector.
+ x: posDiff.x / d,
+ y: posDiff.y / d
+ }
- let forceVector = {
- x: unitVector.x * force,
- y: unitVector.y * force
- }
+ let forceVector = {
+ x: unitVector.x * force,
+ y: unitVector.y * force
+ }
/* We substract the force vector to the speed vector of the current floatingObject */
- if (isNaN(forceVector.x) === false && isNaN(forceVector.y) === false) {
- floatingObject1.currentSpeed.x = floatingObject1.currentSpeed.x - forceVector.x
- floatingObject1.currentSpeed.y = floatingObject1.currentSpeed.y - forceVector.y
- }
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] repulsionForceBetweenFloatingObjects -> err= ' + err.stack) }
- }
- }
-
- function proximityBetweenFloatingObjects (currentFloatingObject) {
- try {
- let floatingObject1 = visibleFloatingObjects[currentFloatingObject]
- floatingObject1.nearbyFloatingObjects = []
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- if (i !== currentFloatingObject) {
- let floatingObject2 = visibleFloatingObjects[i] // So, for each floatingObject...
-
- let d = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2)) // ... we calculate the distance ...
-
- if (floatingObject1.nearbyFloatingObjects.length === 0) {
- floatingObject1.nearbyFloatingObjects.push([d, floatingObject2])
- } else {
- let recordAdded = false
- for (let j = 0; j < floatingObject1.nearbyFloatingObjects.length; j++) {
- let recordedDistance = floatingObject1.nearbyFloatingObjects[j][0]
- if (d < recordedDistance) {
- floatingObject1.nearbyFloatingObjects.splice(j, 0, [d, floatingObject2])
- recordAdded = true
- break
- }
+ if (isNaN(forceVector.x) === false && isNaN(forceVector.y) === false) {
+ floatingObject1.currentSpeed.x = floatingObject1.currentSpeed.x - forceVector.x
+ floatingObject1.currentSpeed.y = floatingObject1.currentSpeed.y - forceVector.y
+ }
+ }
}
- if (recordAdded === false) {
- floatingObject1.nearbyFloatingObjects.push([d, floatingObject2])
- }
- }
- floatingObject1.nearbyFloatingObjects.splice(10, floatingObject1.nearbyFloatingObjects.length)
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] repulsionForceBetweenFloatingObjects -> err= ' + err.stack) }
}
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] proximityBetweenFloatingObjects -> err= ' + err.stack) }
}
- }
- function targetRepulsionForce (currentFloatingObject) {
- try {
+ function proximityBetweenFloatingObjects(currentFloatingObject) {
+ try {
+ let floatingObject1 = visibleFloatingObjects[currentFloatingObject]
+ floatingObject1.nearbyFloatingObjects = []
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ if (i !== currentFloatingObject) {
+ let floatingObject2 = visibleFloatingObjects[i] // So, for each floatingObject...
+
+ let d = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2)) // ... we calculate the distance ...
+
+ if (floatingObject1.nearbyFloatingObjects.length === 0) {
+ floatingObject1.nearbyFloatingObjects.push([d, floatingObject2])
+ } else {
+ let recordAdded = false
+ for (let j = 0; j < floatingObject1.nearbyFloatingObjects.length; j++) {
+ let recordedDistance = floatingObject1.nearbyFloatingObjects[j][0]
+ if (d < recordedDistance) {
+ floatingObject1.nearbyFloatingObjects.splice(j, 0, [d, floatingObject2])
+ recordAdded = true
+ break
+ }
+ }
+ if (recordAdded === false) {
+ floatingObject1.nearbyFloatingObjects.push([d, floatingObject2])
+ }
+ }
+ floatingObject1.nearbyFloatingObjects.splice(10, floatingObject1.nearbyFloatingObjects.length)
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] proximityBetweenFloatingObjects -> err= ' + err.stack) }
+ }
+ }
+
+ function targetRepulsionForce(currentFloatingObject) {
+ try {
/* We generate a repulsion force between floatingObjects, that prevents them to be collisioning so often. */
- const coulomb = 2
+ const coulomb = 2
- let floatingObject1 = visibleFloatingObjects[currentFloatingObject]
+ let floatingObject1 = visibleFloatingObjects[currentFloatingObject]
- for (let i = 0; i < visibleFloatingObjects.length; i++) {
- // The force to be applied is considering all other floatingObjects...
+ for (let i = 0; i < visibleFloatingObjects.length; i++) {
+ // The force to be applied is considering all other floatingObjects...
- let floatingObject2 = visibleFloatingObjects[i] // So, for each floatingObject...
+ let floatingObject2 = visibleFloatingObjects[i] // So, for each floatingObject...
- let payload = {
- position: undefined
- }
+ let payload = {
+ position: undefined
+ }
- switch (floatingObject2.type) {
- case 'UI Object': {
- payload.targetPosition = floatingObject2.payload.targetPosition
- break
- }
- default: {
- break
- }
- }
+ switch (floatingObject2.type) {
+ case 'UI Object': {
+ payload.targetPosition = floatingObject2.payload.targetPosition
+ break
+ }
+ default: {
+ break
+ }
+ }
- let d = Math.sqrt(Math.pow(payload.targetPosition.x - floatingObject1.container.frame.position.x, 2) + Math.pow(payload.targetPosition.y - floatingObject1.container.frame.position.y, 2)) // ... we calculate the distance ...
+ let d = Math.sqrt(Math.pow(payload.targetPosition.x - floatingObject1.container.frame.position.x, 2) + Math.pow(payload.targetPosition.y - floatingObject1.container.frame.position.y, 2)) // ... we calculate the distance ...
- let force = coulomb * floatingObject2.currentMass / (d * d) // ... and with it the repulsion force.
+ let force = coulomb * floatingObject2.currentMass / (d * d) // ... and with it the repulsion force.
/* We need to put a hard limit to this force, in order to to eject very little floatingObjects to the infinite and beyond. */
- if (force > maxTargetRepulsionForce) {
- force = maxTargetRepulsionForce
+ if (force > maxTargetRepulsionForce) {
+ force = maxTargetRepulsionForce
+ }
+
+ let pos1 = {
+ x: floatingObject1.container.frame.position.x,
+ y: floatingObject1.container.frame.position.y
+ }
+
+ let pos2 = {
+ x: payload.targetPosition.x,
+ y: payload.targetPosition.y
+ }
+
+ let posDiff = { // Next we need the vector resulting from the 2 positions.
+ x: pos2.x - pos1.x,
+ y: pos2.y - pos1.y
+ }
+
+ if (d !== 0) {
+ let unitVector = { // To find the unit vector, we divide each component by the magnitude of the vector.
+ x: posDiff.x / d,
+ y: posDiff.y / d
+ }
+
+ let forceVector = {
+ x: unitVector.x * force,
+ y: unitVector.y * force
+ }
+
+ /* We substract the force vector to the speed vector of the current floatingObject */
+
+ if (isNaN(forceVector.x) === false && isNaN(forceVector.y) === false) {
+ floatingObject1.currentSpeed.x = floatingObject1.currentSpeed.x - forceVector.x
+ floatingObject1.currentSpeed.y = floatingObject1.currentSpeed.y - forceVector.y
+ }
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] targetRepulsionForce -> err= ' + err.stack) }
}
-
- let pos1 = {
- x: floatingObject1.container.frame.position.x,
- y: floatingObject1.container.frame.position.y
- }
-
- let pos2 = {
- x: payload.targetPosition.x,
- y: payload.targetPosition.y
- }
-
- let posDiff = { // Next we need the vector resulting from the 2 positions.
- x: pos2.x - pos1.x,
- y: pos2.y - pos1.y
- }
-
- if (d !== 0) {
- let unitVector = { // To find the unit vector, we divide each component by the magnitude of the vector.
- x: posDiff.x / d,
- y: posDiff.y / d
- }
-
- let forceVector = {
- x: unitVector.x * force,
- y: unitVector.y * force
- }
-
- /* We substract the force vector to the speed vector of the current floatingObject */
-
- if (isNaN(forceVector.x) === false && isNaN(forceVector.y) === false) {
- floatingObject1.currentSpeed.x = floatingObject1.currentSpeed.x - forceVector.x
- floatingObject1.currentSpeed.y = floatingObject1.currentSpeed.y - forceVector.y
- }
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] targetRepulsionForce -> err= ' + err.stack) }
}
- }
- function colliding (floatingObject1, floatingObject2) {
- try {
+ function colliding(floatingObject1, floatingObject2) {
+ try {
/* This function detects weather 2 floatingObjects collide with each other. */
- let r1 = floatingObject1.container.frame.radius
- let r2 = floatingObject2.container.frame.radius
+ let r1 = floatingObject1.container.frame.radius
+ let r2 = floatingObject2.container.frame.radius
- let distance = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2))
+ let distance = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2))
- if (distance > (r1 + r2)) {
+ if (distance > (r1 + r2)) {
// No solutions, the circles are too far apart.
- return false
- } else if (distance <= r1 + r2) {
+ return false
+ } else if (distance <= r1 + r2) {
// One circle contains the other.
- return true
- } else if ((distance === 0) && (r1 === r2)) {
+ return true
+ } else if ((distance === 0) && (r1 === r2)) {
// the circles coincide.
- return true
- } else return true
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] colliding -> err= ' + err.stack) }
+ return true
+ } else return true
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] colliding -> err= ' + err.stack) }
+ }
}
- }
- function distance (x1, y1, x2, y2) {
- return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2))
- }
+ function distance(x1, y1, x2, y2) {
+ return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2))
+ }
- function resolveCollision (floatingObject1, floatingObject2) {
- try {
+ function resolveCollision(floatingObject1, floatingObject2) {
+ try {
/* This function changes speed and position of floatingObjects that are in collision */
- let collisionision_angle = Math.atan2((floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y), (floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x))
+ let collisionision_angle = Math.atan2((floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y), (floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x))
- let speed1 = Math.sqrt(floatingObject1.currentSpeed.x * floatingObject1.currentSpeed.x + floatingObject1.currentSpeed.y * floatingObject1.currentSpeed.y) // Magnitude of Speed Vector for floatingObject 1
- let speed2 = Math.sqrt(floatingObject2.currentSpeed.x * floatingObject2.currentSpeed.x + floatingObject2.currentSpeed.y * floatingObject2.currentSpeed.y) // Magnitude of Speed Vector for floatingObject 2
+ let speed1 = Math.sqrt(floatingObject1.currentSpeed.x * floatingObject1.currentSpeed.x + floatingObject1.currentSpeed.y * floatingObject1.currentSpeed.y) // Magnitude of Speed Vector for floatingObject 1
+ let speed2 = Math.sqrt(floatingObject2.currentSpeed.x * floatingObject2.currentSpeed.x + floatingObject2.currentSpeed.y * floatingObject2.currentSpeed.y) // Magnitude of Speed Vector for floatingObject 2
- let direction_1 = Math.atan2(floatingObject1.currentSpeed.y, floatingObject1.currentSpeed.x)
- let direction_2 = Math.atan2(floatingObject2.currentSpeed.y, floatingObject2.currentSpeed.x)
+ let direction_1 = Math.atan2(floatingObject1.currentSpeed.y, floatingObject1.currentSpeed.x)
+ let direction_2 = Math.atan2(floatingObject2.currentSpeed.y, floatingObject2.currentSpeed.x)
- let new_xspeed_1 = speed1 * Math.cos(direction_1 - collisionision_angle)
- let new_yspeed_1 = speed1 * Math.sin(direction_1 - collisionision_angle)
- let new_xspeed_2 = speed2 * Math.cos(direction_2 - collisionision_angle)
- let new_yspeed_2 = speed2 * Math.sin(direction_2 - collisionision_angle)
+ let new_xspeed_1 = speed1 * Math.cos(direction_1 - collisionision_angle)
+ let new_yspeed_1 = speed1 * Math.sin(direction_1 - collisionision_angle)
+ let new_xspeed_2 = speed2 * Math.cos(direction_2 - collisionision_angle)
+ let new_yspeed_2 = speed2 * Math.sin(direction_2 - collisionision_angle)
- let final_xspeed_1 = ((floatingObject1.currentMass - floatingObject2.currentMass) * new_xspeed_1 + (floatingObject2.currentMass + floatingObject2.currentMass) * new_xspeed_2) / (floatingObject1.currentMass + floatingObject2.currentMass)
- let final_xspeed_2 = ((floatingObject1.currentMass + floatingObject1.currentMass) * new_xspeed_1 + (floatingObject2.currentMass - floatingObject1.currentMass) * new_xspeed_2) / (floatingObject1.currentMass + floatingObject2.currentMass)
- let final_yspeed_1 = new_yspeed_1
- let final_yspeed_2 = new_yspeed_2
+ let final_xspeed_1 = ((floatingObject1.currentMass - floatingObject2.currentMass) * new_xspeed_1 + (floatingObject2.currentMass + floatingObject2.currentMass) * new_xspeed_2) / (floatingObject1.currentMass + floatingObject2.currentMass)
+ let final_xspeed_2 = ((floatingObject1.currentMass + floatingObject1.currentMass) * new_xspeed_1 + (floatingObject2.currentMass - floatingObject1.currentMass) * new_xspeed_2) / (floatingObject1.currentMass + floatingObject2.currentMass)
+ let final_yspeed_1 = new_yspeed_1
+ let final_yspeed_2 = new_yspeed_2
- let cosAngle = Math.cos(collisionision_angle)
- let sinAngle = Math.sin(collisionision_angle)
+ let cosAngle = Math.cos(collisionision_angle)
+ let sinAngle = Math.sin(collisionision_angle)
- floatingObject1.currentSpeed.x = cosAngle * final_xspeed_1 - sinAngle * final_yspeed_1
- floatingObject1.currentSpeed.y = sinAngle * final_xspeed_1 + cosAngle * final_yspeed_1
+ floatingObject1.currentSpeed.x = cosAngle * final_xspeed_1 - sinAngle * final_yspeed_1
+ floatingObject1.currentSpeed.y = sinAngle * final_xspeed_1 + cosAngle * final_yspeed_1
- floatingObject2.currentSpeed.x = cosAngle * final_xspeed_2 - sinAngle * final_yspeed_2
- floatingObject2.currentSpeed.y = sinAngle * final_xspeed_2 + cosAngle * final_yspeed_2
+ floatingObject2.currentSpeed.x = cosAngle * final_xspeed_2 - sinAngle * final_yspeed_2
+ floatingObject2.currentSpeed.y = sinAngle * final_xspeed_2 + cosAngle * final_yspeed_2
- let pos1 = {
- x: floatingObject1.container.frame.position.x,
- y: floatingObject1.container.frame.position.y
- }
+ let pos1 = {
+ x: floatingObject1.container.frame.position.x,
+ y: floatingObject1.container.frame.position.y
+ }
- let pos2 = {
- x: floatingObject2.container.frame.position.x,
- y: floatingObject2.container.frame.position.y
- }
+ let pos2 = {
+ x: floatingObject2.container.frame.position.x,
+ y: floatingObject2.container.frame.position.y
+ }
// get the mtd
- let posDiff = {
- x: pos1.x - pos2.x,
- y: pos1.y - pos2.y
- }
+ let posDiff = {
+ x: pos1.x - pos2.x,
+ y: pos1.y - pos2.y
+ }
- let d = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2))
+ let d = Math.sqrt(Math.pow(floatingObject2.container.frame.position.x - floatingObject1.container.frame.position.x, 2) + Math.pow(floatingObject2.container.frame.position.y - floatingObject1.container.frame.position.y, 2))
// minimum translation distance to push floatingObjects apart after intersecting
- let scalar = (((floatingObject1.container.frame.radius + floatingObject2.container.frame.radius) - d) / d)
+ let scalar = (((floatingObject1.container.frame.radius + floatingObject2.container.frame.radius) - d) / d)
- let minTD = {
- x: posDiff.x * scalar,
- y: posDiff.y * scalar
- }
+ let minTD = {
+ x: posDiff.x * scalar,
+ y: posDiff.y * scalar
+ }
// resolve intersection --
// computing inverse mass quantities
- let im1 = 1 / floatingObject1.currentMass
- let im2 = 1 / floatingObject2.currentMass
+ let im1 = 1 / floatingObject1.currentMass
+ let im2 = 1 / floatingObject2.currentMass
// push-pull them apart based off their mass
- pos1.x = pos1.x + minTD.x * (im1 / (im1 + im2))
- pos1.y = pos1.y + minTD.y * (im1 / (im1 + im2))
- pos2.x = pos2.x - minTD.x * (im2 / (im1 + im2))
- pos2.y = pos2.y - minTD.y * (im2 / (im1 + im2))
+ pos1.x = pos1.x + minTD.x * (im1 / (im1 + im2))
+ pos1.y = pos1.y + minTD.y * (im1 / (im1 + im2))
+ pos2.x = pos2.x - minTD.x * (im2 / (im1 + im2))
+ pos2.y = pos2.y - minTD.y * (im2 / (im1 + im2))
- if (floatingObject1.positionLocked === false && isNaN(pos1.x) === false && isNaN(pos1.y) === false) {
- floatingObject1.container.frame.position = pos1
- }
- if (floatingObject2.positionLocked === false && isNaN(pos2.x) === false && isNaN(pos2.y) === false) {
- floatingObject2.container.frame.position = pos2
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] resolveCollision -> err= ' + err.stack) }
+ if (floatingObject1.positionLocked === false && isNaN(pos1.x) === false && isNaN(pos1.y) === false) {
+ floatingObject1.container.frame.position = pos1
+ }
+ if (floatingObject2.positionLocked === false && isNaN(pos2.x) === false && isNaN(pos2.y) === false) {
+ floatingObject2.container.frame.position = pos2
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] resolveCollision -> err= ' + err.stack) }
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/FloatingObject.js b/CanvasApp/FloatingSpace/FloatingObject.js
index 12cb186f6..7d15a19f3 100644
--- a/CanvasApp/FloatingSpace/FloatingObject.js
+++ b/CanvasApp/FloatingSpace/FloatingObject.js
@@ -1,715 +1,715 @@
-function newFloatingObject () {
- const MODULE_NAME = 'Floating Object'
- const ERROR_LOG = true
+function newFloatingObject() {
+ const MODULE_NAME = 'Floating Object'
+ const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- fitFunction: undefined,
- container: undefined,
- positionLocked: false,
- isOnFocus: false,
- payload: undefined, // This is a reference to an object controlled by a Plotter. The plotter can change its internal value and we will see them from here.
- type: undefined, // Currently there are two types of Floating Objects: Profile Balls, and Notes.
- currentSpeed: 0, // This is the current speed of the floating object.
- currentMass: 0, // This is the current mass of the floating object, including its zoom applied.
- friction: 0, // This is a factor that will ultimatelly desacelerate the floating object.
- targetFriction: 0,
- rawMass: 0, // This is the mass value without zoom.
- rawRadius: 0, // This is the radius of this floating object without zoom.
- targetRadius: 0, // This is the target radius of the floating object with zoom applied. It should be animated until reaching this value.
- isPinned: false,
- isFrozen: false,
- angleToParent: undefined,
- distanceToParent: undefined,
- arrangementStyle: ARRANGEMENT_STYLE.CONCAVE,
- isCollapsed: false,
- isParentCollapsed: false,
- frozenManually: false,
- collapsedManually: false,
- getPinStatus: getPinStatus,
- getFreezeStatus: getFreezeStatus,
- getCollapseStatus: getCollapseStatus,
- getAngleToParent: getAngleToParent,
- getDistanceToParent: getDistanceToParent,
- getArrangementStyle: getArrangementStyle,
- nearbyFloatingObjects: [],
- setPosition: setPosition,
- pinToggle: pinToggle,
- freezeToggle: freezeToggle,
- collapseToggle: collapseToggle,
- angleToParentToggle: angleToParentToggle,
- distanceToParentToggle: distanceToParentToggle,
- arrangementStyleToggle: arrangementStyleToggle,
- physics: physics,
- invisiblePhysics: invisiblePhysics,
- initializeMass: initializeMass,
- initializeRadius: initializeRadius,
- initializeImageSize: initializeImageSize,
- initializeFontSize: initializeFontSize,
- initializeHierarchyRing: initializeHierarchyRing,
- initializeCurrentPosition: initializeCurrentPosition,
- radomizeCurrentSpeed: radomizeCurrentSpeed,
- drawBackground: drawBackground,
- drawMiddleground: drawMiddleground,
- drawForeground: drawForeground,
- drawOnFocus: drawOnFocus,
- updateMass: updateMass, // Function to update the mass when the zoom level changed.
- updateRadius: updateRadius, // Function to update the radius when the zoom level changed.
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME, 'Circle')
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = true
- thisObject.container.detectMouseOver = true
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
-
- let selfMouseOverEventSubscriptionId
- let selfMouseClickEventSubscriptionId
- let spaceMouseOverEventSubscriptionId
- let spaceFocusAquiredEventSubscriptionId
- let lastParentAngle
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(selfMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
- canvas.floatingSpace.container.eventHandler.stopListening(spaceMouseOverEventSubscriptionId)
- canvas.floatingSpace.container.eventHandler.stopListening(spaceFocusAquiredEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.fitFunction = undefined
- thisObject.nearbyFloatingObjects = undefined
- }
-
- function initialize (type, payload) {
- thisObject.payload = payload
- thisObject.type = type
-
- selfMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
-
- /* To consider that this object lost the focus, we monitor the space for 2 key events */
- spaceMouseOverEventSubscriptionId = canvas.floatingSpace.container.eventHandler.listenToEvent('onMouseOver', mouseOverFlotingSpace)
- spaceFocusAquiredEventSubscriptionId = canvas.floatingSpace.container.eventHandler.listenToEvent('onFocusAquired', someoneAquiredFocus)
-
- /* Assign a position and speed */
-
- thisObject.initializeCurrentPosition(thisObject.payload.targetPosition)
- thisObject.radomizeCurrentSpeed()
- }
-
- function getContainer (point) {
- if (thisObject.payload === undefined) { return }
- if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) { return }
- if (canvas.floatingSpace.inMapMode === true) { return }
- let container
-
- container = thisObject.payload.uiObject.getContainer(point)
- if (container !== undefined) { return container }
-
- if (thisObject.container.frame.isThisScreenPointHere(point) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
-
- function getPinStatus () {
- return thisObject.isPinned
- }
-
- function pinToggle () {
- if (thisObject.isPinned !== true) {
- thisObject.isPinned = true
- thisObject.positionLocked = true
- } else {
- thisObject.isPinned = false
- }
- return thisObject.isPinned
- }
-
- function getFreezeStatus () {
- return thisObject.isFrozen
- }
-
- function getCollapseStatus () {
- return thisObject.isCollapsed
- }
-
- function getAngleToParent () {
- return thisObject.angleToParent
- }
-
- function getDistanceToParent () {
- return thisObject.distanceToParent
- }
-
- function getArrangementStyle () {
- return thisObject.arrangementStyle
- }
-
- function freezeToggle () {
- if (thisObject.isFrozen !== true) {
- thisObject.isFrozen = true
- thisObject.frozenManually = true
- } else {
- thisObject.isFrozen = false
- thisObject.frozenManually = false
- }
- return thisObject.isFrozen
- }
-
- function collapseToggle () {
- if (thisObject.isCollapsed !== true) {
- thisObject.isCollapsed = true
- thisObject.collapsedManually = true
- } else {
- thisObject.isCollapsed = false
- thisObject.collapsedManually = false
- }
- return thisObject.isCollapsed
- }
-
- function angleToParentToggle () {
- switch (thisObject.angleToParent) {
- case ANGLE_TO_PARENT.NOT_FIXED:
- thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_360
- break
- case ANGLE_TO_PARENT.RANGE_360:
- thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
- break
- case ANGLE_TO_PARENT.RANGE_180:
- thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_90
- break
- case ANGLE_TO_PARENT.RANGE_90:
- thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_45
- break
- case ANGLE_TO_PARENT.RANGE_45:
- thisObject.angleToParent = ANGLE_TO_PARENT.NOT_FIXED
- break
+ let thisObject = {
+ fitFunction: undefined,
+ container: undefined,
+ positionLocked: false,
+ isOnFocus: false,
+ payload: undefined, // This is a reference to an object controlled by a Plotter. The plotter can change its internal value and we will see them from here.
+ type: undefined, // Currently there are two types of Floating Objects: Profile Balls, and Notes.
+ currentSpeed: 0, // This is the current speed of the floating object.
+ currentMass: 0, // This is the current mass of the floating object, including its zoom applied.
+ friction: 0, // This is a factor that will ultimatelly desacelerate the floating object.
+ targetFriction: 0,
+ rawMass: 0, // This is the mass value without zoom.
+ rawRadius: 0, // This is the radius of this floating object without zoom.
+ targetRadius: 0, // This is the target radius of the floating object with zoom applied. It should be animated until reaching this value.
+ isPinned: false,
+ isFrozen: false,
+ angleToParent: undefined,
+ distanceToParent: undefined,
+ arrangementStyle: ARRANGEMENT_STYLE.CONCAVE,
+ isCollapsed: false,
+ isParentCollapsed: false,
+ frozenManually: false,
+ collapsedManually: false,
+ getPinStatus: getPinStatus,
+ getFreezeStatus: getFreezeStatus,
+ getCollapseStatus: getCollapseStatus,
+ getAngleToParent: getAngleToParent,
+ getDistanceToParent: getDistanceToParent,
+ getArrangementStyle: getArrangementStyle,
+ nearbyFloatingObjects: [],
+ setPosition: setPosition,
+ pinToggle: pinToggle,
+ freezeToggle: freezeToggle,
+ collapseToggle: collapseToggle,
+ angleToParentToggle: angleToParentToggle,
+ distanceToParentToggle: distanceToParentToggle,
+ arrangementStyleToggle: arrangementStyleToggle,
+ physics: physics,
+ invisiblePhysics: invisiblePhysics,
+ initializeMass: initializeMass,
+ initializeRadius: initializeRadius,
+ initializeImageSize: initializeImageSize,
+ initializeFontSize: initializeFontSize,
+ initializeHierarchyRing: initializeHierarchyRing,
+ initializeCurrentPosition: initializeCurrentPosition,
+ radomizeCurrentSpeed: radomizeCurrentSpeed,
+ drawBackground: drawBackground,
+ drawMiddleground: drawMiddleground,
+ drawForeground: drawForeground,
+ drawOnFocus: drawOnFocus,
+ updateMass: updateMass, // Function to update the mass when the zoom level changed.
+ updateRadius: updateRadius, // Function to update the radius when the zoom level changed.
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- return thisObject.angleToParent
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME, 'Circle')
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = true
+ thisObject.container.detectMouseOver = true
+ thisObject.container.frame.radius = 0
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
- function distanceToParentToggle () {
- switch (thisObject.distanceToParent) {
- case DISTANCE_TO_PARENT.NOT_FIXED:
- thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_025X
- break
- case DISTANCE_TO_PARENT.PARENT_025X:
- thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
- break
- case DISTANCE_TO_PARENT.PARENT_050X:
- thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
- break
- case DISTANCE_TO_PARENT.PARENT_100X:
- thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_150X
- break
- case DISTANCE_TO_PARENT.PARENT_150X:
- thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_200X
- break
- case DISTANCE_TO_PARENT.PARENT_200X:
- thisObject.distanceToParent = DISTANCE_TO_PARENT.NOT_FIXED
- break
+ let selfMouseOverEventSubscriptionId
+ let selfMouseClickEventSubscriptionId
+ let spaceMouseOverEventSubscriptionId
+ let spaceFocusAquiredEventSubscriptionId
+ let lastParentAngle
+
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(selfMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
+ canvas.floatingSpace.container.eventHandler.stopListening(spaceMouseOverEventSubscriptionId)
+ canvas.floatingSpace.container.eventHandler.stopListening(spaceFocusAquiredEventSubscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.fitFunction = undefined
+ thisObject.nearbyFloatingObjects = undefined
}
- return thisObject.distanceToParent
- }
+ function initialize(type, payload) {
+ thisObject.payload = payload
+ thisObject.type = type
- function arrangementStyleToggle () {
- switch (thisObject.arrangementStyle) {
- case ARRANGEMENT_STYLE.CONCAVE:
- thisObject.arrangementStyle = ARRANGEMENT_STYLE.CONVEX
- break
- case ARRANGEMENT_STYLE.CONVEX:
- thisObject.arrangementStyle = ARRANGEMENT_STYLE.VERTICAL_RIGHT
- break
- case ARRANGEMENT_STYLE.VERTICAL_RIGHT:
- thisObject.arrangementStyle = ARRANGEMENT_STYLE.VERTICAL_LEFT
- break
- case ARRANGEMENT_STYLE.VERTICAL_LEFT:
- thisObject.arrangementStyle = ARRANGEMENT_STYLE.HORIZONTAL_BOTTOM
- break
- case ARRANGEMENT_STYLE.HORIZONTAL_BOTTOM:
- thisObject.arrangementStyle = ARRANGEMENT_STYLE.HORIZONTAL_TOP
- break
- case ARRANGEMENT_STYLE.HORIZONTAL_TOP:
- thisObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- break
+ selfMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+
+ /* To consider that this object lost the focus, we monitor the space for 2 key events */
+ spaceMouseOverEventSubscriptionId = canvas.floatingSpace.container.eventHandler.listenToEvent('onMouseOver', mouseOverFlotingSpace)
+ spaceFocusAquiredEventSubscriptionId = canvas.floatingSpace.container.eventHandler.listenToEvent('onFocusAquired', someoneAquiredFocus)
+
+ /* Assign a position and speed */
+
+ thisObject.initializeCurrentPosition(thisObject.payload.targetPosition)
+ thisObject.radomizeCurrentSpeed()
}
- return thisObject.arrangementStyle
- }
+ function getContainer(point) {
+ if (thisObject.payload === undefined) { return }
+ if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) { return }
+ if (canvas.floatingSpace.inMapMode === true) { return }
+ let container
- function invisiblePhysics () {
- if (thisObject.payload.uiObject !== undefined) {
- thisObject.payload.uiObject.invisiblePhysics()
- }
- }
+ container = thisObject.payload.uiObject.getContainer(point)
+ if (container !== undefined) { return container }
- function physics () {
- frozenPhysics()
- /* From here on, only if they are not too far. */
- if (canvas.floatingSpace.isItFar(thisObject.payload)) { return }
- thisObjectPhysics()
- if (thisObject.payload.uiObject !== undefined) {
- thisObject.payload.uiObject.physics()
- }
- positionContraintsPhysics()
- }
-
- function frozenPhysics () {
- if (thisObject.frozenManually !== false) { return }
- if (thisObject.payload === undefined) { return }
- let parent = thisObject.payload.chainParent
- if (parent !== undefined) {
- if (parent.payload !== undefined) {
- if (parent.payload.floatingObject !== undefined) {
- thisObject.isFrozen = parent.payload.floatingObject.isFrozen
+ if (thisObject.container.frame.isThisScreenPointHere(point) === true) {
+ return thisObject.container
+ } else {
+ return undefined
}
- }
}
- }
- function positionContraintsPhysics () {
- const MAX_DISTANCE_TO_PARENT = 5000
- const MIN_DISTANCE_TO_PARENT = 100
+ function getPinStatus() {
+ return thisObject.isPinned
+ }
- if (thisObject.angleToParent !== ANGLE_TO_PARENT.NOT_FIXED && thisObject.isOnFocus !== true) {
- let parent = thisObject.payload.chainParent
- if (parent === undefined) { return }
- if (parent.payload === undefined) { return }
- if (parent.payload.position === undefined) { return }
+ function pinToggle() {
+ if (thisObject.isPinned !== true) {
+ thisObject.isPinned = true
+ thisObject.positionLocked = true
+ } else {
+ thisObject.isPinned = false
+ }
+ return thisObject.isPinned
+ }
- let distanceToParent = Math.sqrt(Math.pow(parent.payload.position.x - thisObject.container.frame.position.x, 2) + Math.pow(parent.payload.position.y - thisObject.container.frame.position.y, 2)) // ... we calculate the distance ...
- let parentChildren = canvas.designSpace.workspace.nodeChildren.childrenCount(parent, thisObject.payload.node)
- let axisCount = parentChildren.childrenCount
- let axisIndex = parentChildren.childIndex
- let baseAngle = 0
- let angleToParentAngle
+ function getFreezeStatus() {
+ return thisObject.isFrozen
+ }
- if (parent.payload.distance !== undefined) {
+ function getCollapseStatus() {
+ return thisObject.isCollapsed
+ }
+
+ function getAngleToParent() {
+ return thisObject.angleToParent
+ }
+
+ function getDistanceToParent() {
+ return thisObject.distanceToParent
+ }
+
+ function getArrangementStyle() {
+ return thisObject.arrangementStyle
+ }
+
+ function freezeToggle() {
+ if (thisObject.isFrozen !== true) {
+ thisObject.isFrozen = true
+ thisObject.frozenManually = true
+ } else {
+ thisObject.isFrozen = false
+ thisObject.frozenManually = false
+ }
+ return thisObject.isFrozen
+ }
+
+ function collapseToggle() {
+ if (thisObject.isCollapsed !== true) {
+ thisObject.isCollapsed = true
+ thisObject.collapsedManually = true
+ } else {
+ thisObject.isCollapsed = false
+ thisObject.collapsedManually = false
+ }
+ return thisObject.isCollapsed
+ }
+
+ function angleToParentToggle() {
+ switch (thisObject.angleToParent) {
+ case ANGLE_TO_PARENT.NOT_FIXED:
+ thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_360
+ break
+ case ANGLE_TO_PARENT.RANGE_360:
+ thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_180
+ break
+ case ANGLE_TO_PARENT.RANGE_180:
+ thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_90
+ break
+ case ANGLE_TO_PARENT.RANGE_90:
+ thisObject.angleToParent = ANGLE_TO_PARENT.RANGE_45
+ break
+ case ANGLE_TO_PARENT.RANGE_45:
+ thisObject.angleToParent = ANGLE_TO_PARENT.NOT_FIXED
+ break
+ }
+
+ return thisObject.angleToParent
+ }
+
+ function distanceToParentToggle() {
switch (thisObject.distanceToParent) {
- case DISTANCE_TO_PARENT.PARENT_025X:
- distanceToParent = parent.payload.distance / 4
- break
- case DISTANCE_TO_PARENT.PARENT_050X:
- distanceToParent = parent.payload.distance / 2
- break
- case DISTANCE_TO_PARENT.PARENT_100X:
- distanceToParent = parent.payload.distance
- break
- case DISTANCE_TO_PARENT.PARENT_150X:
- distanceToParent = parent.payload.distance * 1.5
- break
- case DISTANCE_TO_PARENT.PARENT_200X:
- distanceToParent = parent.payload.distance * 2
- break
+ case DISTANCE_TO_PARENT.NOT_FIXED:
+ thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_025X
+ break
+ case DISTANCE_TO_PARENT.PARENT_025X:
+ thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_050X
+ break
+ case DISTANCE_TO_PARENT.PARENT_050X:
+ thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
+ break
+ case DISTANCE_TO_PARENT.PARENT_100X:
+ thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_150X
+ break
+ case DISTANCE_TO_PARENT.PARENT_150X:
+ thisObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_200X
+ break
+ case DISTANCE_TO_PARENT.PARENT_200X:
+ thisObject.distanceToParent = DISTANCE_TO_PARENT.NOT_FIXED
+ break
}
- }
- if (distanceToParent > MAX_DISTANCE_TO_PARENT) {
- distanceToParent = MAX_DISTANCE_TO_PARENT
- }
+ return thisObject.distanceToParent
+ }
- if (distanceToParent < MIN_DISTANCE_TO_PARENT) {
- distanceToParent = MIN_DISTANCE_TO_PARENT
- }
-
- switch (thisObject.angleToParent) {
- case ANGLE_TO_PARENT.RANGE_360:
- angleToParentAngle = 360
- break
- case ANGLE_TO_PARENT.RANGE_180:
- angleToParentAngle = 180
- break
- case ANGLE_TO_PARENT.RANGE_90:
- angleToParentAngle = 90
- break
- case ANGLE_TO_PARENT.RANGE_45:
- angleToParentAngle = 45
- break
- }
-
- if (axisIndex === undefined) {
- axisCount = 1
- axisIndex = axisCount
- }
-
- if (parent.payload.chainParent !== undefined && parent.payload.angle !== undefined) {
- axisCount++
- axisIndex++
- baseAngle = parent.payload.angle + 180
- lastParentAngle = parent.payload.angle
- } else {
- if (lastParentAngle !== undefined) {
- axisCount++
- axisIndex++
- baseAngle = lastParentAngle + 180
+ function arrangementStyleToggle() {
+ switch (thisObject.arrangementStyle) {
+ case ARRANGEMENT_STYLE.CONCAVE:
+ thisObject.arrangementStyle = ARRANGEMENT_STYLE.CONVEX
+ break
+ case ARRANGEMENT_STYLE.CONVEX:
+ thisObject.arrangementStyle = ARRANGEMENT_STYLE.VERTICAL_RIGHT
+ break
+ case ARRANGEMENT_STYLE.VERTICAL_RIGHT:
+ thisObject.arrangementStyle = ARRANGEMENT_STYLE.VERTICAL_LEFT
+ break
+ case ARRANGEMENT_STYLE.VERTICAL_LEFT:
+ thisObject.arrangementStyle = ARRANGEMENT_STYLE.HORIZONTAL_BOTTOM
+ break
+ case ARRANGEMENT_STYLE.HORIZONTAL_BOTTOM:
+ thisObject.arrangementStyle = ARRANGEMENT_STYLE.HORIZONTAL_TOP
+ break
+ case ARRANGEMENT_STYLE.HORIZONTAL_TOP:
+ thisObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ break
}
- }
- let separatorAngle = (360 - angleToParentAngle) / 2
- let angleStep = angleToParentAngle / axisCount
+ return thisObject.arrangementStyle
+ }
- thisObject.payload.angle = baseAngle + separatorAngle + (axisIndex - 1) * angleStep
- if (thisObject.payload.angle >= 360) {
- thisObject.payload.angle = thisObject.payload.angle - 360
- }
-
- thisObject.payload.distance = distanceToParent
-
- if (thisObject.isPinned === true) {
- /* When an object is pinned, its angle to its parent needs to be calculated since it depends on where the user places the node. */
- /*
- if (thisObject.payload.chainParent !== undefined) {
- let x = thisObject.container.frame.position.x - thisObject.payload.chainParent.payload.floatingObject.container.frame.position.x
- let y = thisObject.container.frame.position.y - thisObject.payload.chainParent.payload.floatingObject.container.frame.position.y
-
- thisObject.payload.angle = Math.atan(y / x)
+ function invisiblePhysics() {
+ if (thisObject.payload.uiObject !== undefined) {
+ thisObject.payload.uiObject.invisiblePhysics()
}
- */
- return
- }
+ }
- let newPosition = {
- x: parent.payload.position.x,
- y: parent.payload.position.y
- }
-
- let displacement
-
- switch (thisObject.arrangementStyle) {
- case ARRANGEMENT_STYLE.CONCAVE: {
- displacement = {
- x: distanceToParent * Math.cos(toRadians(thisObject.payload.angle)),
- y: distanceToParent * Math.sin(toRadians(thisObject.payload.angle))
- }
-
- break
+ function physics() {
+ frozenPhysics()
+ /* From here on, only if they are not too far. */
+ if (canvas.floatingSpace.isItFar(thisObject.payload)) { return }
+ thisObjectPhysics()
+ if (thisObject.payload.uiObject !== undefined) {
+ thisObject.payload.uiObject.physics()
}
- case ARRANGEMENT_STYLE.CONVEX: {
- displacement = {
- x: 2 * distanceToParent * Math.cos(toRadians(lastParentAngle)) + distanceToParent * Math.cos(toRadians(thisObject.payload.angle + 180)),
- y: 2 * distanceToParent * Math.sin(toRadians(lastParentAngle)) + distanceToParent * Math.sin(toRadians(thisObject.payload.angle + 180))
- }
- break
+ positionContraintsPhysics()
+ }
+
+ function frozenPhysics() {
+ if (thisObject.frozenManually !== false) { return }
+ if (thisObject.payload === undefined) { return }
+ let parent = thisObject.payload.chainParent
+ if (parent !== undefined) {
+ if (parent.payload !== undefined) {
+ if (parent.payload.floatingObject !== undefined) {
+ thisObject.isFrozen = parent.payload.floatingObject.isFrozen
+ }
+ }
}
- case ARRANGEMENT_STYLE.HORIZONTAL_BOTTOM: {
- displacement = {
- x: distanceToParent * Math.tan(toRadians(thisObject.payload.angle)),
- y: distanceToParent
- }
- break
+ }
+
+ function positionContraintsPhysics() {
+ const MAX_DISTANCE_TO_PARENT = 5000
+ const MIN_DISTANCE_TO_PARENT = 100
+
+ if (thisObject.angleToParent !== ANGLE_TO_PARENT.NOT_FIXED && thisObject.isOnFocus !== true) {
+ let parent = thisObject.payload.chainParent
+ if (parent === undefined) { return }
+ if (parent.payload === undefined) { return }
+ if (parent.payload.position === undefined) { return }
+
+ let distanceToParent = Math.sqrt(Math.pow(parent.payload.position.x - thisObject.container.frame.position.x, 2) + Math.pow(parent.payload.position.y - thisObject.container.frame.position.y, 2)) // ... we calculate the distance ...
+ let parentChildren = canvas.designSpace.workspace.nodeChildren.childrenCount(parent, thisObject.payload.node)
+ let axisCount = parentChildren.childrenCount
+ let axisIndex = parentChildren.childIndex
+ let baseAngle = 0
+ let angleToParentAngle
+
+ if (parent.payload.distance !== undefined) {
+ switch (thisObject.distanceToParent) {
+ case DISTANCE_TO_PARENT.PARENT_025X:
+ distanceToParent = parent.payload.distance / 4
+ break
+ case DISTANCE_TO_PARENT.PARENT_050X:
+ distanceToParent = parent.payload.distance / 2
+ break
+ case DISTANCE_TO_PARENT.PARENT_100X:
+ distanceToParent = parent.payload.distance
+ break
+ case DISTANCE_TO_PARENT.PARENT_150X:
+ distanceToParent = parent.payload.distance * 1.5
+ break
+ case DISTANCE_TO_PARENT.PARENT_200X:
+ distanceToParent = parent.payload.distance * 2
+ break
+ }
+ }
+
+ if (distanceToParent > MAX_DISTANCE_TO_PARENT) {
+ distanceToParent = MAX_DISTANCE_TO_PARENT
+ }
+
+ if (distanceToParent < MIN_DISTANCE_TO_PARENT) {
+ distanceToParent = MIN_DISTANCE_TO_PARENT
+ }
+
+ switch (thisObject.angleToParent) {
+ case ANGLE_TO_PARENT.RANGE_360:
+ angleToParentAngle = 360
+ break
+ case ANGLE_TO_PARENT.RANGE_180:
+ angleToParentAngle = 180
+ break
+ case ANGLE_TO_PARENT.RANGE_90:
+ angleToParentAngle = 90
+ break
+ case ANGLE_TO_PARENT.RANGE_45:
+ angleToParentAngle = 45
+ break
+ }
+
+ if (axisIndex === undefined) {
+ axisCount = 1
+ axisIndex = axisCount
+ }
+
+ if (parent.payload.chainParent !== undefined && parent.payload.angle !== undefined) {
+ axisCount++
+ axisIndex++
+ baseAngle = parent.payload.angle + 180
+ lastParentAngle = parent.payload.angle
+ } else {
+ if (lastParentAngle !== undefined) {
+ axisCount++
+ axisIndex++
+ baseAngle = lastParentAngle + 180
+ }
+ }
+
+ let separatorAngle = (360 - angleToParentAngle) / 2
+ let angleStep = angleToParentAngle / axisCount
+
+ thisObject.payload.angle = baseAngle + separatorAngle + (axisIndex - 1) * angleStep
+ if (thisObject.payload.angle >= 360) {
+ thisObject.payload.angle = thisObject.payload.angle - 360
+ }
+
+ thisObject.payload.distance = distanceToParent
+
+ if (thisObject.isPinned === true) {
+ /* When an object is pinned, its angle to its parent needs to be calculated since it depends on where the user places the node. */
+ /*
+ if (thisObject.payload.chainParent !== undefined) {
+ let x = thisObject.container.frame.position.x - thisObject.payload.chainParent.payload.floatingObject.container.frame.position.x
+ let y = thisObject.container.frame.position.y - thisObject.payload.chainParent.payload.floatingObject.container.frame.position.y
+
+ thisObject.payload.angle = Math.atan(y / x)
+ }
+ */
+ return
+ }
+
+ let newPosition = {
+ x: parent.payload.position.x,
+ y: parent.payload.position.y
+ }
+
+ let displacement
+
+ switch (thisObject.arrangementStyle) {
+ case ARRANGEMENT_STYLE.CONCAVE: {
+ displacement = {
+ x: distanceToParent * Math.cos(toRadians(thisObject.payload.angle)),
+ y: distanceToParent * Math.sin(toRadians(thisObject.payload.angle))
+ }
+
+ break
+ }
+ case ARRANGEMENT_STYLE.CONVEX: {
+ displacement = {
+ x: 2 * distanceToParent * Math.cos(toRadians(lastParentAngle)) + distanceToParent * Math.cos(toRadians(thisObject.payload.angle + 180)),
+ y: 2 * distanceToParent * Math.sin(toRadians(lastParentAngle)) + distanceToParent * Math.sin(toRadians(thisObject.payload.angle + 180))
+ }
+ break
+ }
+ case ARRANGEMENT_STYLE.HORIZONTAL_BOTTOM: {
+ displacement = {
+ x: distanceToParent * Math.tan(toRadians(thisObject.payload.angle)),
+ y: distanceToParent
+ }
+ break
+ }
+ case ARRANGEMENT_STYLE.HORIZONTAL_TOP: {
+ displacement = {
+ x: -distanceToParent * Math.tan(toRadians(thisObject.payload.angle)),
+ y: -distanceToParent
+ }
+ break
+ }
+ case ARRANGEMENT_STYLE.VERTICAL_RIGHT: {
+ displacement = {
+ x: distanceToParent,
+ y: distanceToParent * Math.tan(toRadians(thisObject.payload.angle))
+ }
+ break
+ }
+ case ARRANGEMENT_STYLE.VERTICAL_LEFT: {
+ displacement = {
+ x: -distanceToParent,
+ y: -distanceToParent * Math.tan(toRadians(thisObject.payload.angle))
+ }
+ break
+ }
+ }
+
+ if (displacement.x > MAX_DISTANCE_TO_PARENT) {
+ displacement.x = MAX_DISTANCE_TO_PARENT
+ }
+ if (displacement.y > MAX_DISTANCE_TO_PARENT) {
+ displacement.y = MAX_DISTANCE_TO_PARENT
+ }
+
+ newPosition.x = newPosition.x + displacement.x
+ newPosition.y = newPosition.y + displacement.y
+
+ if (isNaN(newPosition.x) === false) {
+ thisObject.container.frame.position.x = newPosition.x
+ }
+ if (isNaN(newPosition.y) === false) {
+ thisObject.container.frame.position.y = newPosition.y
+ }
}
- case ARRANGEMENT_STYLE.HORIZONTAL_TOP: {
- displacement = {
- x: -distanceToParent * Math.tan(toRadians(thisObject.payload.angle)),
- y: -distanceToParent
- }
- break
+ }
+
+ function thisObjectPhysics() {
+ // The radius also have a target.
+ let ANIMATION_STEP = Math.abs(thisObject.targetRadius - thisObject.rawRadius) / 5
+
+ if (ANIMATION_STEP === 0) { ANIMATION_STEP = 10 }
+
+ if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= ANIMATION_STEP) {
+ if (thisObject.container.frame.radius < thisObject.targetRadius) {
+ thisObject.container.frame.radius = thisObject.container.frame.radius + ANIMATION_STEP
+ } else {
+ thisObject.container.frame.radius = thisObject.container.frame.radius - ANIMATION_STEP
+ }
+
+ thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
}
- case ARRANGEMENT_STYLE.VERTICAL_RIGHT: {
- displacement = {
- x: distanceToParent,
- y: distanceToParent * Math.tan(toRadians(thisObject.payload.angle))
- }
- break
+
+ // The imageSize also have a target.
+
+ if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= ANIMATION_STEP) {
+ if (thisObject.currentImageSize < thisObject.targetImageSize) {
+ thisObject.currentImageSize = thisObject.currentImageSize + ANIMATION_STEP
+ } else {
+ thisObject.currentImageSize = thisObject.currentImageSize - ANIMATION_STEP
+ }
}
- case ARRANGEMENT_STYLE.VERTICAL_LEFT: {
- displacement = {
- x: -distanceToParent,
- y: -distanceToParent * Math.tan(toRadians(thisObject.payload.angle))
- }
- break
+
+ // The fontSize also have a target.
+
+ if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= ANIMATION_STEP / 10) {
+ if (thisObject.currentFontSize < thisObject.targetFontSize) {
+ thisObject.currentFontSize = thisObject.currentFontSize + ANIMATION_STEP / 10
+ } else {
+ thisObject.currentFontSize = thisObject.currentFontSize - ANIMATION_STEP / 10
+ }
}
- }
- if (displacement.x > MAX_DISTANCE_TO_PARENT) {
- displacement.x = MAX_DISTANCE_TO_PARENT
- }
- if (displacement.y > MAX_DISTANCE_TO_PARENT) {
- displacement.y = MAX_DISTANCE_TO_PARENT
- }
+ if (Math.abs(thisObject.currentHierarchyRing - thisObject.targetHierarchyRing) >= ANIMATION_STEP) {
+ if (thisObject.currentHierarchyRing < thisObject.targetHierarchyRing) {
+ thisObject.currentHierarchyRing = thisObject.currentHierarchyRing + ANIMATION_STEP
+ } else {
+ thisObject.currentHierarchyRing = thisObject.currentHierarchyRing - ANIMATION_STEP
+ }
+ }
- newPosition.x = newPosition.x + displacement.x
- newPosition.y = newPosition.y + displacement.y
+ /* Floating object position in screen coordinates */
- if (isNaN(newPosition.x) === false) {
- thisObject.container.frame.position.x = newPosition.x
- }
- if (isNaN(newPosition.y) === false) {
- thisObject.container.frame.position.y = newPosition.y
- }
- }
- }
-
- function thisObjectPhysics () {
- // The radius also have a target.
- let ANIMATION_STEP = Math.abs(thisObject.targetRadius - thisObject.rawRadius) / 5
-
- if (ANIMATION_STEP === 0) { ANIMATION_STEP = 10 }
-
- if (Math.abs(thisObject.container.frame.radius - thisObject.targetRadius) >= ANIMATION_STEP) {
- if (thisObject.container.frame.radius < thisObject.targetRadius) {
- thisObject.container.frame.radius = thisObject.container.frame.radius + ANIMATION_STEP
- } else {
- thisObject.container.frame.radius = thisObject.container.frame.radius - ANIMATION_STEP
- }
-
- thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
+ thisObject.payload.position.x = thisObject.container.frame.position.x
+ thisObject.payload.position.y = thisObject.container.frame.position.y
}
- // The imageSize also have a target.
+ function onMouseOver(point) {
+ if (thisObject.isOnFocus === false) {
+ thisObject.targetRadius = thisObject.rawRadius * 6.0
+ thisObject.targetImageSize = thisObject.rawImageSize * 2.0
+ thisObject.targetFontSize = thisObject.rawFontSize * 2.0
+ thisObject.targetHierarchyRing = thisObject.rawHierarchyRing * 8.0
- if (Math.abs(thisObject.currentImageSize - thisObject.targetImageSize) >= ANIMATION_STEP) {
- if (thisObject.currentImageSize < thisObject.targetImageSize) {
- thisObject.currentImageSize = thisObject.currentImageSize + ANIMATION_STEP
- } else {
- thisObject.currentImageSize = thisObject.currentImageSize - ANIMATION_STEP
- }
+ thisObject.payload.uiObject.container.eventHandler.raiseEvent('onFocus', point)
+
+ thisObject.positionLocked = true
+
+ canvas.floatingSpace.container.eventHandler.raiseEvent('onFocusAquired', thisObject)
+ thisObject.isOnFocus = true
+ }
}
- // The fontSize also have a target.
-
- if (Math.abs(thisObject.currentFontSize - thisObject.targetFontSize) >= ANIMATION_STEP / 10) {
- if (thisObject.currentFontSize < thisObject.targetFontSize) {
- thisObject.currentFontSize = thisObject.currentFontSize + ANIMATION_STEP / 10
- } else {
- thisObject.currentFontSize = thisObject.currentFontSize - ANIMATION_STEP / 10
- }
+ function mouseOverFlotingSpace(point) {
+ removeFocus()
}
- if (Math.abs(thisObject.currentHierarchyRing - thisObject.targetHierarchyRing) >= ANIMATION_STEP) {
- if (thisObject.currentHierarchyRing < thisObject.targetHierarchyRing) {
- thisObject.currentHierarchyRing = thisObject.currentHierarchyRing + ANIMATION_STEP
- } else {
- thisObject.currentHierarchyRing = thisObject.currentHierarchyRing - ANIMATION_STEP
- }
+ function someoneAquiredFocus(floatingObject) {
+ if (floatingObject === undefined || floatingObject.container === undefined) {
+ return
+ }
+ if (thisObject.container === undefined) {
+ return
+ }
+ if (floatingObject.container.id !== thisObject.container.id) {
+ removeFocus()
+ }
}
- /* Floating object position in screen coordinates */
+ function removeFocus() {
+ if (thisObject.payload === undefined) { return }
+ if (thisObject.isOnFocus === true) {
+ thisObject.targetRadius = thisObject.rawRadius * 1
+ thisObject.targetImageSize = thisObject.rawImageSize * 1
+ thisObject.targetFontSize = thisObject.rawFontSize * 1
+ thisObject.targetHierarchyRing = thisObject.rawHierarchyRing * 1
- thisObject.payload.position.x = thisObject.container.frame.position.x
- thisObject.payload.position.y = thisObject.container.frame.position.y
- }
+ thisObject.payload.uiObject.container.eventHandler.raiseEvent('onNotFocus', thisObject.container)
- function onMouseOver (point) {
- if (thisObject.isOnFocus === false) {
- thisObject.targetRadius = thisObject.rawRadius * 6.0
- thisObject.targetImageSize = thisObject.rawImageSize * 2.0
- thisObject.targetFontSize = thisObject.rawFontSize * 2.0
- thisObject.targetHierarchyRing = thisObject.rawHierarchyRing * 8.0
-
- thisObject.payload.uiObject.container.eventHandler.raiseEvent('onFocus', point)
-
- thisObject.positionLocked = true
-
- canvas.floatingSpace.container.eventHandler.raiseEvent('onFocusAquired', thisObject)
- thisObject.isOnFocus = true
- }
- }
-
- function mouseOverFlotingSpace (point) {
- removeFocus()
- }
-
- function someoneAquiredFocus (floatingObject) {
- if (floatingObject === undefined || floatingObject.container === undefined) {
- return
- }
- if (thisObject.container === undefined) {
- return
- }
- if (floatingObject.container.id !== thisObject.container.id) {
- removeFocus()
- }
- }
-
- function removeFocus () {
- if (thisObject.payload === undefined) { return }
- if (thisObject.isOnFocus === true) {
- thisObject.targetRadius = thisObject.rawRadius * 1
- thisObject.targetImageSize = thisObject.rawImageSize * 1
- thisObject.targetFontSize = thisObject.rawFontSize * 1
- thisObject.targetHierarchyRing = thisObject.rawHierarchyRing * 1
-
- thisObject.payload.uiObject.container.eventHandler.raiseEvent('onNotFocus', thisObject.container)
-
- if (thisObject.isPinned !== true) {
- thisObject.positionLocked = false
- }
- thisObject.isOnFocus = false
- }
- }
-
- function onMouseClick (pPoint) {
- let event = {
- point: pPoint,
- parent: thisObject
- }
- thisObject.payload.uiObject.container.eventHandler.raiseEvent('onMouseClick', event)
- }
-
- function drawBackground () {
- if (canvas.floatingSpace.isItFar(thisObject.payload) && thisObject.payload.uiObject.isShowing === false) { return }
- if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) {
- if (thisObject.payload.uiObject.isShowing !== true) {
- return
- }
- }
- thisObject.payload.uiObject.drawBackground()
- }
-
- function drawMiddleground () {
- if (canvas.floatingSpace.isItFar(thisObject.payload) && thisObject.payload.uiObject.isShowing === false) { return }
- if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) {
- if (thisObject.payload.uiObject.isShowing !== true) {
- return
- }
- }
- thisObject.payload.uiObject.drawMiddleground()
- }
-
- function drawForeground () {
- if (canvas.floatingSpace.isItFar(thisObject.payload) && thisObject.payload.uiObject.isShowing === false) { return }
- if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) {
- if (thisObject.payload.uiObject.isShowing !== true) {
- return
- }
- }
- thisObject.payload.uiObject.drawForeground()
- }
-
- function drawOnFocus () {
- thisObject.payload.uiObject.drawOnFocus()
- }
-
- function initializeMass (suggestedValue) {
- let mass = suggestedValue
- if (mass < 0.1) {
- mass = 0.1
+ if (thisObject.isPinned !== true) {
+ thisObject.positionLocked = false
+ }
+ thisObject.isOnFocus = false
+ }
}
- thisObject.rawMass = mass
- thisObject.currentMass = mass
- }
-
- function initializeRadius (suggestedValue) {
- let radius = suggestedValue
- if (radius < 2) {
- radius = 2
+ function onMouseClick(pPoint) {
+ let event = {
+ point: pPoint,
+ parent: thisObject
+ }
+ thisObject.payload.uiObject.container.eventHandler.raiseEvent('onMouseClick', event)
}
- thisObject.rawRadius = radius
- thisObject.targetRadius = radius
- thisObject.container.frame.radius = radius / 5
-
- thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
- }
-
- function initializeImageSize (suggestedValue) {
- let size = suggestedValue
- if (size < 2) {
- size = 2
+ function drawBackground() {
+ if (canvas.floatingSpace.isItFar(thisObject.payload) && thisObject.payload.uiObject.isShowing === false) { return }
+ if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) {
+ if (thisObject.payload.uiObject.isShowing !== true) {
+ return
+ }
+ }
+ thisObject.payload.uiObject.drawBackground()
}
- thisObject.rawImageSize = size
- thisObject.targetImageSize = size
- thisObject.currentImageSize = size / 3
- }
-
- function initializeFontSize (suggestedValue) {
- let size = suggestedValue
- if (size < 3) {
- size = 3
+ function drawMiddleground() {
+ if (canvas.floatingSpace.isItFar(thisObject.payload) && thisObject.payload.uiObject.isShowing === false) { return }
+ if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) {
+ if (thisObject.payload.uiObject.isShowing !== true) {
+ return
+ }
+ }
+ thisObject.payload.uiObject.drawMiddleground()
}
- thisObject.rawFontSize = size
- thisObject.targetFontSize = size
- thisObject.currentFontSize = size / 3
- }
-
- function initializeHierarchyRing (suggestedValue) {
- let radius = suggestedValue
- if (radius < 3) {
- radius = 3
+ function drawForeground() {
+ if (canvas.floatingSpace.isItFar(thisObject.payload) && thisObject.payload.uiObject.isShowing === false) { return }
+ if ((thisObject.isCollapsed === true && thisObject.collapsedManually === false) || thisObject.isParentCollapsed === true) {
+ if (thisObject.payload.uiObject.isShowing !== true) {
+ return
+ }
+ }
+ thisObject.payload.uiObject.drawForeground()
}
- thisObject.rawHierarchyRing = radius
- thisObject.targetHierarchyRing = radius
- thisObject.currentHierarchyRing = radius
- }
-
- function initializeCurrentPosition (arroundPoint) {
- let position = {}
-
- if (thisObject.payload.position === undefined) {
- position = {
- x: Math.floor((Math.random() * (200) - 100)) + arroundPoint.x,
- y: Math.floor((Math.random() * (200) - 100)) + arroundPoint.y
- }
- } else {
- position = {
- x: thisObject.payload.position.x,
- y: thisObject.payload.position.y
- }
+ function drawOnFocus() {
+ thisObject.payload.uiObject.drawOnFocus()
}
- setPosition(position)
- }
+ function initializeMass(suggestedValue) {
+ let mass = suggestedValue
+ if (mass < 0.1) {
+ mass = 0.1
+ }
- function setPosition (position) {
- thisObject.container.frame.position.x = position.x
- thisObject.container.frame.position.y = position.y
-
- thisObject.payload.position = {}
- thisObject.payload.position.x = position.x
- thisObject.payload.position.y = position.y
- }
-
- function radomizeCurrentSpeed () {
- var initialXDirection
- var randomX = Math.floor((Math.random() * 10) + 1)
- if (randomX > 5) {
- initialXDirection = 1
- } else {
- initialXDirection = -1
+ thisObject.rawMass = mass
+ thisObject.currentMass = mass
}
- var initialYDirection
- var randomY = Math.floor((Math.random() * 10) + 1)
- if (randomY > 5) {
- initialYDirection = 1
- } else {
- initialYDirection = -1
+ function initializeRadius(suggestedValue) {
+ let radius = suggestedValue
+ if (radius < 2) {
+ radius = 2
+ }
+
+ thisObject.rawRadius = radius
+ thisObject.targetRadius = radius
+ thisObject.container.frame.radius = radius / 5
+
+ thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
}
- var velocity = {
- x: initialXDirection * Math.floor((Math.random() * 300) + 1) / 100,
- y: initialYDirection * Math.floor((Math.random() * 300) + 1) / 100
+ function initializeImageSize(suggestedValue) {
+ let size = suggestedValue
+ if (size < 2) {
+ size = 2
+ }
+
+ thisObject.rawImageSize = size
+ thisObject.targetImageSize = size
+ thisObject.currentImageSize = size / 3
}
- thisObject.currentSpeed = velocity
- }
+ function initializeFontSize(suggestedValue) {
+ let size = suggestedValue
+ if (size < 3) {
+ size = 3
+ }
- function updateMass () {
+ thisObject.rawFontSize = size
+ thisObject.targetFontSize = size
+ thisObject.currentFontSize = size / 3
+ }
- }
+ function initializeHierarchyRing(suggestedValue) {
+ let radius = suggestedValue
+ if (radius < 3) {
+ radius = 3
+ }
- function updateRadius () {
- }
+ thisObject.rawHierarchyRing = radius
+ thisObject.targetHierarchyRing = radius
+ thisObject.currentHierarchyRing = radius
+ }
+
+ function initializeCurrentPosition(arroundPoint) {
+ let position = {}
+
+ if (thisObject.payload.position === undefined) {
+ position = {
+ x: Math.floor((Math.random() * (200) - 100)) + arroundPoint.x,
+ y: Math.floor((Math.random() * (200) - 100)) + arroundPoint.y
+ }
+ } else {
+ position = {
+ x: thisObject.payload.position.x,
+ y: thisObject.payload.position.y
+ }
+ }
+
+ setPosition(position)
+ }
+
+ function setPosition(position) {
+ thisObject.container.frame.position.x = position.x
+ thisObject.container.frame.position.y = position.y
+
+ thisObject.payload.position = {}
+ thisObject.payload.position.x = position.x
+ thisObject.payload.position.y = position.y
+ }
+
+ function radomizeCurrentSpeed() {
+ var initialXDirection
+ var randomX = Math.floor((Math.random() * 10) + 1)
+ if (randomX > 5) {
+ initialXDirection = 1
+ } else {
+ initialXDirection = -1
+ }
+
+ var initialYDirection
+ var randomY = Math.floor((Math.random() * 10) + 1)
+ if (randomY > 5) {
+ initialYDirection = 1
+ } else {
+ initialYDirection = -1
+ }
+
+ var velocity = {
+ x: initialXDirection * Math.floor((Math.random() * 300) + 1) / 100,
+ y: initialYDirection * Math.floor((Math.random() * 300) + 1) / 100
+ }
+
+ thisObject.currentSpeed = velocity
+ }
+
+ function updateMass() {
+
+ }
+
+ function updateRadius() {
+ }
}
diff --git a/CanvasApp/FloatingSpace/FormulaEditor.js b/CanvasApp/FloatingSpace/FormulaEditor.js
index 596f1ba27..0b3887637 100644
--- a/CanvasApp/FloatingSpace/FormulaEditor.js
+++ b/CanvasApp/FloatingSpace/FormulaEditor.js
@@ -1,199 +1,199 @@
-function newFormulaEditor () {
- const MODULE_NAME = 'Formula Editor'
+function newFormulaEditor() {
+ const MODULE_NAME = 'Formula Editor'
- let thisObject = {
- isVisibleFunction: undefined,
- visible: false,
- imagePathOK: undefined,
- imagePathNOT_OK: undefined,
- rawRadius: undefined,
- targetRadius: undefined,
- currentRadius: undefined,
- container: undefined,
- payload: undefined,
- deactivate: deactivate,
- activate: activate,
- physics: physics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.detectMouseOver = false
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
-
- let isMouseOver = false
- let SIZE_FACTOR = 1.2
-
- return thisObject
-
- function finalize () {
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.isVisibleFunction = undefined
- }
-
- function initialize () {
-
- }
-
- function deactivate () {
- if (thisObject.visible === true) {
- thisObject.visible = false
- let textArea = document.getElementById('textArea')
- textArea.style.display = 'none'
- thisObject.payload.node.code = textArea.value
- }
- EDITOR_ON_FOCUS = false
- }
-
- function activate (payload) {
- thisObject.visible = true
- thisObject.payload = payload
- thisObject.rawRadius = 8
- thisObject.targetRadius = thisObject.container.frame.radius
- thisObject.currentRadius = 0
- thisObject.payload.uiObject.setErrorMessage('', 0)
-
- let textArea = document.getElementById('textArea')
- textArea.value = payload.node.code
- textArea.style = 'resize: none;' +
- ' border: none;' +
- ' outline: none;' +
- 'box-shadow: none;' +
- 'overflow:hidden;' +
- 'font-family: ' + UI_FONT.PRIMARY + ';' +
- 'font-size: 14px;' +
- 'background-color: rgb(' + UI_COLOR.MANGANESE_PURPLE + ');' +
- 'color:rgb(255, 255, 255);' +
- 'width: ' + thisObject.container.frame.width + 'px;' +
- 'height: ' + thisObject.container.frame.height + 'px'
- textArea.style.display = 'block'
- textArea.focus()
- EDITOR_ON_FOCUS = true
- }
-
- function getContainer (point) {
- let container
- if (thisObject.visible === true) {
- if (point.x === VERY_LARGE_NUMBER) {
- /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
- anyone can react. In our case, the code editor has a text area that is not part of the canvas, so the event is
- triggered. We compensate recognizing this coordinate and returning our container. */
- return thisObject.container
- }
-
- if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
- }
-
- function physics () {
- if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= 0.5) {
- if (thisObject.currentRadius < thisObject.targetRadius) {
- thisObject.currentRadius = thisObject.currentRadius + 0.5
- } else {
- thisObject.currentRadius = thisObject.currentRadius - 0.5
- }
+ let thisObject = {
+ isVisibleFunction: undefined,
+ visible: false,
+ imagePathOK: undefined,
+ imagePathNOT_OK: undefined,
+ rawRadius: undefined,
+ targetRadius: undefined,
+ currentRadius: undefined,
+ container: undefined,
+ payload: undefined,
+ deactivate: deactivate,
+ activate: activate,
+ physics: physics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.detectMouseOver = false
+ thisObject.container.frame.radius = 0
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
- thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
- thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
+ let isMouseOver = false
+ let SIZE_FACTOR = 1.2
- let textAreaPosition = {
- x: 0 - thisObject.container.frame.width / 2,
- y: 0 - thisObject.container.frame.height * 3 / 7 + CURRENT_TOP_MARGIN
+ return thisObject
+
+ function finalize() {
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.isVisibleFunction = undefined
}
- textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition)
- if (thisObject.visible === true) {
- let checkPosition = {
- x: textAreaPosition.x,
- y: textAreaPosition.y - CURRENT_TOP_MARGIN
- }
- if (thisObject.isVisibleFunction(checkPosition) === false) {
- deactivate()
- }
- }
- if (thisObject.visible === true) {
- let textAreaDiv = document.getElementById('textAreaDiv')
- textAreaDiv.style = 'position:fixed; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; '
- }
- }
+ function initialize() {
- function drawBackground () {
- if (thisObject.visible === true) {
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- let radius = thisObject.container.frame.radius * SIZE_FACTOR
-
- if (radius > 0.5) {
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius * 1.3 + 3, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
- browserCanvasContext.fill()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(position.x, position.y, radius * 1.3, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.MANGANESE_PURPLE + ', ' + 1 + ')'
- browserCanvasContext.fill()
- }
- }
- }
- function drawForeground () {
- let iconPosition = {
- x: 0,
- y: thisObject.currentRadius * 1.5
}
- iconPosition = thisObject.container.frame.frameThisPoint(iconPosition)
+ function deactivate() {
+ if (thisObject.visible === true) {
+ thisObject.visible = false
+ let textArea = document.getElementById('textArea')
+ textArea.style.display = 'none'
+ thisObject.payload.node.code = textArea.value
+ }
+ EDITOR_ON_FOCUS = false
+ }
- /* Menu Item */
+ function activate(payload) {
+ thisObject.visible = true
+ thisObject.payload = payload
+ thisObject.rawRadius = 8
+ thisObject.targetRadius = thisObject.container.frame.radius
+ thisObject.currentRadius = 0
+ thisObject.payload.uiObject.setErrorMessage('', 0)
- if (thisObject.canDrawIcon === true && thisObject.currentRadius > 1) {
- browserCanvasContext.drawImage(thisObject.icon, iconPosition.x - thisObject.currentRadius, iconPosition.y - thisObject.currentRadius, thisObject.currentRadius * 2, thisObject.currentRadius * 2)
+ let textArea = document.getElementById('textArea')
+ textArea.value = payload.node.code
+ textArea.style = 'resize: none;' +
+ ' border: none;' +
+ ' outline: none;' +
+ 'box-shadow: none;' +
+ 'overflow:hidden;' +
+ 'font-family: ' + UI_FONT.PRIMARY + ';' +
+ 'font-size: 14px;' +
+ 'background-color: rgb(' + UI_COLOR.MANGANESE_PURPLE + ');' +
+ 'color:rgb(255, 255, 255);' +
+ 'width: ' + thisObject.container.frame.width + 'px;' +
+ 'height: ' + thisObject.container.frame.height + 'px'
+ textArea.style.display = 'block'
+ textArea.focus()
+ EDITOR_ON_FOCUS = true
+ }
- /* Menu Label */
+ function getContainer(point) {
+ let container
+ if (thisObject.visible === true) {
+ if (point.x === VERY_LARGE_NUMBER) {
+ /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
+ anyone can react. In our case, the code editor has a text area that is not part of the canvas, so the event is
+ triggered. We compensate recognizing this coordinate and returning our container. */
+ return thisObject.container
+ }
- let label = 'Code looks good!'
- let labelPoint
- let fontSize = 10
+ if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
+ }
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
-
- if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
- labelPoint = {
- x: iconPosition.x + thisObject.currentRadius + 10,
- y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+ function physics() {
+ if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= 0.5) {
+ if (thisObject.currentRadius < thisObject.targetRadius) {
+ thisObject.currentRadius = thisObject.currentRadius + 0.5
+ } else {
+ thisObject.currentRadius = thisObject.currentRadius - 0.5
+ }
}
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
+
+ thisObject.container.frame.width = thisObject.container.frame.radius * 1.8 * SIZE_FACTOR
+ thisObject.container.frame.height = thisObject.container.frame.radius * 1 * SIZE_FACTOR
+
+ let textAreaPosition = {
+ x: 0 - thisObject.container.frame.width / 2,
+ y: 0 - thisObject.container.frame.height * 3 / 7 + CURRENT_TOP_MARGIN
+ }
+
+ textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition)
+ if (thisObject.visible === true) {
+ let checkPosition = {
+ x: textAreaPosition.x,
+ y: textAreaPosition.y - CURRENT_TOP_MARGIN
+ }
+ if (thisObject.isVisibleFunction(checkPosition) === false) {
+ deactivate()
+ }
+ }
+ if (thisObject.visible === true) {
+ let textAreaDiv = document.getElementById('textAreaDiv')
+ textAreaDiv.style = 'position:fixed; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; '
+ }
+ }
+
+ function drawBackground() {
+ if (thisObject.visible === true) {
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ let radius = thisObject.container.frame.radius * SIZE_FACTOR
+
+ if (radius > 0.5) {
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius * 1.3 + 3, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(position.x, position.y, radius * 1.3, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.MANGANESE_PURPLE + ', ' + 1 + ')'
+ browserCanvasContext.fill()
+ }
+ }
+ }
+ function drawForeground() {
+ let iconPosition = {
+ x: 0,
+ y: thisObject.currentRadius * 1.5
+ }
+
+ iconPosition = thisObject.container.frame.frameThisPoint(iconPosition)
+
+ /* Menu Item */
+
+ if (thisObject.canDrawIcon === true && thisObject.currentRadius > 1) {
+ browserCanvasContext.drawImage(thisObject.icon, iconPosition.x - thisObject.currentRadius, iconPosition.y - thisObject.currentRadius, thisObject.currentRadius * 2, thisObject.currentRadius * 2)
+
+ /* Menu Label */
+
+ let label = 'Code looks good!'
+ let labelPoint
+ let fontSize = 10
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+
+ if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
+ labelPoint = {
+ x: iconPosition.x + thisObject.currentRadius + 10,
+ y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/Picker.js b/CanvasApp/FloatingSpace/Picker.js
index b306ac85e..4d3a25759 100644
--- a/CanvasApp/FloatingSpace/Picker.js
+++ b/CanvasApp/FloatingSpace/Picker.js
@@ -1,220 +1,220 @@
-function newPicker () {
- const MODULE_NAME = 'Picker'
+function newPicker() {
+ const MODULE_NAME = 'Picker'
- let thisObject = {
- container: undefined,
- selectedItem: 0,
- onParentChanged: onParentChanged,
- getSelected: getSelected,
- setSelected: setSelected,
- physics: physics,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = true
- thisObject.container.detectMouseOver = true
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
- thisObject.container.frame.width = 150
- thisObject.container.frame.height = 60
-
- let isMouseOver
- let optionsList
- let parent
- let current
- let parentSelected = 0
- let propertyName
- let selected = 0
- let lastSelected = 0
- let onMouseWheelEventSubscriptionId
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- thisObject.container.finalize()
- thisObject.container = undefined
- optionsList = undefined
- parent = undefined
- current = undefined
- }
-
- function initialize (pOptionsList, pCurrent, pParent, pPropertyName) {
- optionsList = pOptionsList
- current = pCurrent
- parent = pParent
- propertyName = pPropertyName
- onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
- onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- }
-
- function onMouseOver (event) {
- isMouseOver = true
- }
-
- function onMouseNotOver () {
- isMouseOver = false
- }
-
- function getSelected () {
- return optionsList[selected]
- }
-
- function setSelected (pOptionsList, pCurrent, pParent, pSelected) {
- if (pOptionsList !== undefined) {
- optionsList = pOptionsList
- }
- if (pCurrent !== undefined) {
- current = pCurrent
- }
- if (pParent !== undefined) {
- parent = pParent
- }
- if (pSelected !== undefined) {
- selected = pSelected
- }
- raiseEventParentChanged()
- }
-
- function onParentChanged (event) {
- if (event.parent !== undefined) {
- parent = event.parent
- }
- parentSelected = event.selected
-
- selected = 0
- let parentKeys
-
- parentKeys = Object.keys(parent)
- checkPropertyName()
-
- function checkPropertyName () {
- if (propertyName === undefined) {
- current = parent[parentKeys[parentSelected]]
- checkArray()
- } else {
- current = parent[parentKeys[parentSelected]]
- current = current[propertyName]
- checkArray()
- }
+ let thisObject = {
+ container: undefined,
+ selectedItem: 0,
+ onParentChanged: onParentChanged,
+ getSelected: getSelected,
+ setSelected: setSelected,
+ physics: physics,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- function checkArray () {
- if (Array.isArray(current) === false) {
- optionsList = Object.keys(current)
- } else {
- optionsList = current
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = true
+ thisObject.container.detectMouseOver = true
+ thisObject.container.frame.radius = 0
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
+ thisObject.container.frame.width = 150
+ thisObject.container.frame.height = 60
+
+ let isMouseOver
+ let optionsList
+ let parent
+ let current
+ let parentSelected = 0
+ let propertyName
+ let selected = 0
+ let lastSelected = 0
+ let onMouseWheelEventSubscriptionId
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
+
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ optionsList = undefined
+ parent = undefined
+ current = undefined
}
- raiseEventParentChanged()
- }
-
- function getContainer (point) {
- let container
-
- if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
- return thisObject.container
- }
- }
-
- function getSelected () {
- return optionsList[selected]
- }
-
- function onMouseWheel () {
- delta = event.wheelDelta
- if (delta > 0) {
- delta = -1
- } else {
- delta = 1
+ function initialize(pOptionsList, pCurrent, pParent, pPropertyName) {
+ optionsList = pOptionsList
+ current = pCurrent
+ parent = pParent
+ propertyName = pPropertyName
+ onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
+ onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
}
- selected = selected + delta
- if (selected < 0) { selected = 0 }
- if (selected > optionsList.length - 1) {
- selected = optionsList.length - 1
+ function onMouseOver(event) {
+ isMouseOver = true
}
- if (selected !== lastSelected) {
- lastSelected = selected
- raiseEventParentChanged()
+ function onMouseNotOver() {
+ isMouseOver = false
}
- }
- function raiseEventParentChanged () {
- let event = {
- selected: selected,
- parent: current,
- propertyName: propertyName
+ function getSelected() {
+ return optionsList[selected]
}
- thisObject.container.eventHandler.raiseEvent('onParentChanged', event)
- }
- function physics () {
-
- }
-
- function drawBackground () {
-
- }
-
- function drawForeground () {
- const FONT_SIZE = 15
- const VISIBLE_LABELS = 5
- let fontSize
- let fontColor
- let opacity
-
- for (let i = 0; i < VISIBLE_LABELS; i++) {
- let index = i - 2 + selected
- let label = ''
- if (index >= 0 && index < optionsList.length) {
- label = optionsList[index]
- }
- fontColor = UI_COLOR.LIGHT_GREY
- switch (i) {
- case 0:
- fontSize = FONT_SIZE - 5
- opacity = 0.4
- break
- case 1:
- fontSize = FONT_SIZE - 3
- opacity = 0.5
- break
- case 2:
- fontSize = FONT_SIZE - 0
- fontColor = UI_COLOR.BLACK
- opacity = 1
- break
- case 3:
- fontSize = FONT_SIZE - 3
- opacity = 0.5
- break
- case 4:
- fontSize = FONT_SIZE - 5
- opacity = 0.4
- break
- }
-
- if (i === 2 || isMouseOver === true) {
- drawLabel(label, 1 / 2, i / VISIBLE_LABELS, 0, 0, fontSize, thisObject.container, fontColor, undefined, undefined, opacity)
- }
+ function setSelected(pOptionsList, pCurrent, pParent, pSelected) {
+ if (pOptionsList !== undefined) {
+ optionsList = pOptionsList
+ }
+ if (pCurrent !== undefined) {
+ current = pCurrent
+ }
+ if (pParent !== undefined) {
+ parent = pParent
+ }
+ if (pSelected !== undefined) {
+ selected = pSelected
+ }
+ raiseEventParentChanged()
+ }
+
+ function onParentChanged(event) {
+ if (event.parent !== undefined) {
+ parent = event.parent
+ }
+ parentSelected = event.selected
+
+ selected = 0
+ let parentKeys
+
+ parentKeys = Object.keys(parent)
+ checkPropertyName()
+
+ function checkPropertyName() {
+ if (propertyName === undefined) {
+ current = parent[parentKeys[parentSelected]]
+ checkArray()
+ } else {
+ current = parent[parentKeys[parentSelected]]
+ current = current[propertyName]
+ checkArray()
+ }
+ }
+
+ function checkArray() {
+ if (Array.isArray(current) === false) {
+ optionsList = Object.keys(current)
+ } else {
+ optionsList = current
+ }
+ }
+
+ raiseEventParentChanged()
+ }
+
+ function getContainer(point) {
+ let container
+
+ if (thisObject.container.frame.isThisPointHere(point, true, false) === true) {
+ return thisObject.container
+ }
+ }
+
+ function getSelected() {
+ return optionsList[selected]
+ }
+
+ function onMouseWheel() {
+ delta = event.wheelDelta
+ if (delta > 0) {
+ delta = -1
+ } else {
+ delta = 1
+ }
+
+ selected = selected + delta
+ if (selected < 0) { selected = 0 }
+ if (selected > optionsList.length - 1) {
+ selected = optionsList.length - 1
+ }
+
+ if (selected !== lastSelected) {
+ lastSelected = selected
+ raiseEventParentChanged()
+ }
+ }
+
+ function raiseEventParentChanged() {
+ let event = {
+ selected: selected,
+ parent: current,
+ propertyName: propertyName
+ }
+ thisObject.container.eventHandler.raiseEvent('onParentChanged', event)
+ }
+
+ function physics() {
+
+ }
+
+ function drawBackground() {
+
+ }
+
+ function drawForeground() {
+ const FONT_SIZE = 15
+ const VISIBLE_LABELS = 5
+ let fontSize
+ let fontColor
+ let opacity
+
+ for (let i = 0; i < VISIBLE_LABELS; i++) {
+ let index = i - 2 + selected
+ let label = ''
+ if (index >= 0 && index < optionsList.length) {
+ label = optionsList[index]
+ }
+ fontColor = UI_COLOR.LIGHT_GREY
+ switch (i) {
+ case 0:
+ fontSize = FONT_SIZE - 5
+ opacity = 0.4
+ break
+ case 1:
+ fontSize = FONT_SIZE - 3
+ opacity = 0.5
+ break
+ case 2:
+ fontSize = FONT_SIZE - 0
+ fontColor = UI_COLOR.BLACK
+ opacity = 1
+ break
+ case 3:
+ fontSize = FONT_SIZE - 3
+ opacity = 0.5
+ break
+ case 4:
+ fontSize = FONT_SIZE - 5
+ opacity = 0.4
+ break
+ }
+
+ if (i === 2 || isMouseOver === true) {
+ drawLabel(label, 1 / 2, i / VISIBLE_LABELS, 0, 0, fontSize, thisObject.container, fontColor, undefined, undefined, opacity)
+ }
+ }
}
- }
}
diff --git a/CanvasApp/FloatingSpace/UiObject.js b/CanvasApp/FloatingSpace/UiObject.js
index 62fdbbdec..be7190251 100644
--- a/CanvasApp/FloatingSpace/UiObject.js
+++ b/CanvasApp/FloatingSpace/UiObject.js
@@ -1,1885 +1,1885 @@
-function newUiObject () {
- const MODULE_NAME = 'UI Object'
- const ERROR_LOG = true
+function newUiObject() {
+ const MODULE_NAME = 'UI Object'
+ const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- fitFunction: undefined,
- isVisibleFunction: undefined,
- type: undefined,
- menu: undefined,
- isOnFocus: false,
- container: undefined,
- payload: undefined,
- codeEditor: undefined,
- configEditor: undefined,
- conditionEditor: undefined,
- formulaEditor: undefined,
- uiObjectTitle: undefined,
- circularProgressBar: undefined,
- isRunning: undefined,
- shortcutKey: undefined,
- isShowing: undefined,
- run: run,
- stop: stop,
- heartBeat: heartBeat,
- getReadyToChainAttach: getReadyToChainAttach,
- showAvailabilityToChainAttach: showAvailabilityToChainAttach,
- getReadyToReferenceAttach: getReadyToReferenceAttach,
- showAvailabilityToReferenceAttach: showAvailabilityToReferenceAttach,
- highlight: highlight,
- runningAtBackend: runningAtBackend,
- setErrorMessage: setErrorMessage,
- resetErrorMessage: resetErrorMessage,
- setValue: setValue,
- resetValue: resetValue,
- setPercentage: setPercentage,
- resetPercentage: resetPercentage,
- setStatus: setStatus,
- resetStatus: resetStatus,
- physics: physics,
- invisiblePhysics: invisiblePhysics,
- drawBackground: drawBackground,
- drawMiddleground: drawMiddleground,
- drawForeground: drawForeground,
- drawOnFocus: drawOnFocus,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME, 'Circle')
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = false
- thisObject.container.frame.radius = 0
- thisObject.container.frame.position.x = 0
- thisObject.container.frame.position.y = 0
-
- let icon
- let executingIcon
-
- let selfFocusEventSubscriptionId
- let selfNotFocusEventSubscriptionId
- let selfDisplaceEventSubscriptionId
- let selfDragStartedEventSubscriptionId
- let selfDragFinishedEventSubscriptionId
-
- let isHighlighted
- let highlightCounter = 0
-
- let isRunningAtBackend
- let runningAtBackendCounter = 0
-
- let hasError
- let errorMessageCounter = 0
-
- let hasValue
- let valueCounter = 0
-
- let hasPercentage
- let percentageCounter = 0
-
- let hasStatus
- let statusCounter = 0
-
- let previousDistanceToChainParent
- let readyToChainAttachDisplayCounter = 5
- let readyToChainAttachDisplayIncrement = 0.1
- let readyToChainAttachCounter = 0
- let isReadyToChainAttach
- let availableToChainAttachCounter = 0
- let isAvailableToChainAttach
- let isChainAttaching = false
- let chainAttachToNode
-
- let previousDistanceToReferenceParent
- let readyToReferenceAttachDisplayCounter = 5
- let readyToReferenceAttachDisplayIncrement = 0.1
- let readyToReferenceAttachCounter = 0
- let isReadyToReferenceAttach
- let availableToReferenceAttachCounter = 0
- let isAvailableToReferenceAttach
- let isReferenceAttaching = false
- let referenceAttachToNode
-
- let isDragging = false
-
- let errorMessage = ''
- let currentValue = 0
- let currentPercentage = ''
- let currentStatus = ''
- let rightDragging = false
-
- let eventSubscriptionIdOnError
- let eventSubscriptionIdOnRunning
- let eventSubscriptionIdOnStopped
- let lastHeartBeat
- let onRunningCallBackFunction
- let onRunningCallBackFunctionWasCalled = false
-
- let newUiObjectCounter = 25
- let referenceLineCounter = 0
- let chainLineCounter = 0
-
- let eventsServerClient
-
- return thisObject
-
- function finalize () {
- finalizeEventsServerClient()
-
- thisObject.container.eventHandler.stopListening(selfFocusEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfNotFocusEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfDisplaceEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfDragStartedEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfDragFinishedEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.menu.finalize()
- thisObject.menu = undefined
- thisObject.uiObjectTitle.finalize()
- thisObject.uiObjectTitle = undefined
- thisObject.fitFunction = undefined
- thisObject.isVisibleFunction = undefined
-
- if (thisObject.codeEditor !== undefined) {
- thisObject.codeEditor.finalize()
- thisObject.codeEditor = undefined
+ let thisObject = {
+ fitFunction: undefined,
+ isVisibleFunction: undefined,
+ type: undefined,
+ menu: undefined,
+ isOnFocus: false,
+ container: undefined,
+ payload: undefined,
+ codeEditor: undefined,
+ configEditor: undefined,
+ conditionEditor: undefined,
+ formulaEditor: undefined,
+ uiObjectTitle: undefined,
+ circularProgressBar: undefined,
+ isRunning: undefined,
+ shortcutKey: undefined,
+ isShowing: undefined,
+ run: run,
+ stop: stop,
+ heartBeat: heartBeat,
+ getReadyToChainAttach: getReadyToChainAttach,
+ showAvailabilityToChainAttach: showAvailabilityToChainAttach,
+ getReadyToReferenceAttach: getReadyToReferenceAttach,
+ showAvailabilityToReferenceAttach: showAvailabilityToReferenceAttach,
+ highlight: highlight,
+ runningAtBackend: runningAtBackend,
+ setErrorMessage: setErrorMessage,
+ resetErrorMessage: resetErrorMessage,
+ setValue: setValue,
+ resetValue: resetValue,
+ setPercentage: setPercentage,
+ resetPercentage: resetPercentage,
+ setStatus: setStatus,
+ resetStatus: resetStatus,
+ physics: physics,
+ invisiblePhysics: invisiblePhysics,
+ drawBackground: drawBackground,
+ drawMiddleground: drawMiddleground,
+ drawForeground: drawForeground,
+ drawOnFocus: drawOnFocus,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- if (thisObject.configEditor !== undefined) {
- thisObject.configEditor.finalize()
- thisObject.configEditor = undefined
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME, 'Circle')
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.radius = 0
+ thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.y = 0
- if (thisObject.conditionEditor !== undefined) {
- thisObject.conditionEditor.finalize()
- thisObject.conditionEditor = undefined
- }
+ let icon
+ let executingIcon
- if (thisObject.formulaEditor !== undefined) {
- thisObject.formulaEditor.finalize()
- thisObject.formulaEditor = undefined
- }
+ let selfFocusEventSubscriptionId
+ let selfNotFocusEventSubscriptionId
+ let selfDisplaceEventSubscriptionId
+ let selfDragStartedEventSubscriptionId
+ let selfDragFinishedEventSubscriptionId
- icon = undefined
- chainAttachToNode = undefined
- referenceAttachToNode = undefined
- lastHeartBeat = undefined
+ let isHighlighted
+ let highlightCounter = 0
- onRunningCallBackFunction = undefined
- }
+ let isRunningAtBackend
+ let runningAtBackendCounter = 0
- function finalizeEventsServerClient () {
- if (eventsServerClient !== undefined) {
- let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+ let hasError
+ let errorMessageCounter = 0
- if (eventSubscriptionIdOnRunning !== undefined) {
- eventsServerClient.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
- }
- if (eventSubscriptionIdOnStopped !== undefined) {
- eventsServerClient.stopListening(key, eventSubscriptionIdOnStopped, 'UiObject')
- }
- if (eventSubscriptionIdOnError !== undefined) {
- eventsServerClient.stopListening(key, eventSubscriptionIdOnError, 'UiObject')
- }
- }
- }
+ let hasValue
+ let valueCounter = 0
- function initialize (payload, menuItemsInitialValues) {
- thisObject.payload = payload
+ let hasPercentage
+ let percentageCounter = 0
-/* Initialize the Menu */
+ let hasStatus
+ let statusCounter = 0
- thisObject.menu = newCircularMenu()
- thisObject.menu.initialize(menuItemsInitialValues, thisObject.payload)
- thisObject.menu.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true)
+ let previousDistanceToChainParent
+ let readyToChainAttachDisplayCounter = 5
+ let readyToChainAttachDisplayIncrement = 0.1
+ let readyToChainAttachCounter = 0
+ let isReadyToChainAttach
+ let availableToChainAttachCounter = 0
+ let isAvailableToChainAttach
+ let isChainAttaching = false
+ let chainAttachToNode
-/* Initialize UI Object Title */
+ let previousDistanceToReferenceParent
+ let readyToReferenceAttachDisplayCounter = 5
+ let readyToReferenceAttachDisplayIncrement = 0.1
+ let readyToReferenceAttachCounter = 0
+ let isReadyToReferenceAttach
+ let availableToReferenceAttachCounter = 0
+ let isAvailableToReferenceAttach
+ let isReferenceAttaching = false
+ let referenceAttachToNode
- thisObject.uiObjectTitle = newUiObjectTitle()
- thisObject.uiObjectTitle.isVisibleFunction = thisObject.isVisibleFunction
- thisObject.uiObjectTitle.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true)
- thisObject.uiObjectTitle.fitFunction = thisObject.fitFunction
- thisObject.uiObjectTitle.initialize(thisObject.payload)
+ let isDragging = false
-/* Load UI Object Image */
+ let errorMessage = ''
+ let currentValue = 0
+ let currentPercentage = ''
+ let currentStatus = ''
+ let rightDragging = false
- iconPhysics()
+ let eventSubscriptionIdOnError
+ let eventSubscriptionIdOnRunning
+ let eventSubscriptionIdOnStopped
+ let lastHeartBeat
+ let onRunningCallBackFunction
+ let onRunningCallBackFunctionWasCalled = false
- selfFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onFocus', onFocus)
- selfNotFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onNotFocus', onNotFocus)
- selfDisplaceEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDisplace', onDisplace)
- selfDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
- selfDragFinishedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragFinished', onDragFinished)
- }
+ let newUiObjectCounter = 25
+ let referenceLineCounter = 0
+ let chainLineCounter = 0
- function getContainer (point) {
- let container
+ let eventsServerClient
- if (isDragging === false && thisObject.isOnFocus === true) {
- if (thisObject.codeEditor !== undefined) {
- container = thisObject.codeEditor.getContainer(point)
- if (container !== undefined) { return container }
- }
+ return thisObject
- if (thisObject.configEditor !== undefined) {
- container = thisObject.configEditor.getContainer(point)
- if (container !== undefined) { return container }
- }
+ function finalize() {
+ finalizeEventsServerClient()
- if (thisObject.conditionEditor !== undefined) {
- container = thisObject.conditionEditor.getContainer(point)
- if (container !== undefined) { return container }
- }
+ thisObject.container.eventHandler.stopListening(selfFocusEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfNotFocusEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfDisplaceEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfDragStartedEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfDragFinishedEventSubscriptionId)
- if (thisObject.formulaEditor !== undefined) {
- container = thisObject.formulaEditor.getContainer(point)
- if (container !== undefined) { return container }
- }
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.menu.finalize()
+ thisObject.menu = undefined
+ thisObject.uiObjectTitle.finalize()
+ thisObject.uiObjectTitle = undefined
+ thisObject.fitFunction = undefined
+ thisObject.isVisibleFunction = undefined
- let getitle = true
-
- if (thisObject.codeEditor !== undefined) {
- if (thisObject.codeEditor.visible === true) {
- getitle = false
+ if (thisObject.codeEditor !== undefined) {
+ thisObject.codeEditor.finalize()
+ thisObject.codeEditor = undefined
}
- }
- if (thisObject.configEditor !== undefined) {
- if (thisObject.configEditor.visible === true) {
- getitle = false
+
+ if (thisObject.configEditor !== undefined) {
+ thisObject.configEditor.finalize()
+ thisObject.configEditor = undefined
}
- }
- if (thisObject.conditionEditor !== undefined) {
- if (thisObject.conditionEditor.visible === true) {
- getitle = false
+
+ if (thisObject.conditionEditor !== undefined) {
+ thisObject.conditionEditor.finalize()
+ thisObject.conditionEditor = undefined
}
- }
- if (thisObject.formulaEditor !== undefined) {
- if (thisObject.formulaEditor.visible === true) {
- getitle = false
+
+ if (thisObject.formulaEditor !== undefined) {
+ thisObject.formulaEditor.finalize()
+ thisObject.formulaEditor = undefined
}
- }
- if (getitle === true) {
- container = thisObject.uiObjectTitle.getContainer(point)
- if (container !== undefined) { return container }
- }
-
- container = thisObject.menu.getContainer(point)
- if (container !== undefined) { return container }
- }
-
- if (thisObject.container.frame.isThisPointHere(point, true, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
-
- function invisiblePhysics () {
- thisObject.menu.invisiblePhysics()
- childrenRunningPhysics()
- }
-
- function physics () {
- thisObject.menu.physics()
- thisObject.uiObjectTitle.physics()
-
- if (thisObject.codeEditor !== undefined) {
- thisObject.codeEditor.physics()
- }
-
- if (thisObject.configEditor !== undefined) {
- thisObject.configEditor.physics()
- }
-
- if (thisObject.conditionEditor !== undefined) {
- thisObject.conditionEditor.physics()
- }
-
- if (thisObject.formulaEditor !== undefined) {
- thisObject.formulaEditor.physics()
- }
-
- if (thisObject.payload.chainParent === undefined || thisObject.payload.chainParent.payload === undefined) {
- thisObject.payload.targetPosition.x = thisObject.payload.position.x,
- thisObject.payload.targetPosition.y = thisObject.payload.position.y
- } else {
- if (thisObject.payload.chainParent.payload.position !== undefined) {
- thisObject.payload.targetPosition.x = thisObject.payload.chainParent.payload.position.x
- thisObject.payload.targetPosition.y = thisObject.payload.chainParent.payload.position.y
- }
- }
-
- if (thisObject.circularProgressBar !== undefined) {
- thisObject.circularProgressBar.physics()
- }
-
- iconPhysics()
- highlightPhisycs()
- runningAtBackendPhisycs()
- errorMessagePhisycs()
- valuePhisycs()
- percentagePhisycs()
- statusPhisycs()
- chainDetachingPhysics()
- chainAttachingPhysics()
- referenceDetachingPhysics()
- referenceAttachingPhysics()
- childrenRunningPhysics()
- newObjectPhysics()
- referenceLinePhysics()
- chainLinePhysics()
- }
-
- function referenceLinePhysics () {
- referenceLineCounter = referenceLineCounter + 2
- if (referenceLineCounter > 500) {
- referenceLineCounter = 0
- }
- }
-
- function chainLinePhysics () {
- chainLineCounter = chainLineCounter - 5
- if (chainLineCounter < 0) {
- chainLineCounter = 500
- }
- }
-
- function newObjectPhysics () {
- newUiObjectCounter--
- if (newUiObjectCounter < 0) {
- newUiObjectCounter = 0
- }
- }
-
- function heartBeatPhysics () {
- if (lastHeartBeat !== undefined) {
- const ONE_MIN = 60000
- nowTimestamp = (new Date()).valueOf()
- if (nowTimestamp - lastHeartBeat.valueOf() > ONE_MIN) {
+ icon = undefined
+ chainAttachToNode = undefined
+ referenceAttachToNode = undefined
lastHeartBeat = undefined
- thisObject.isRunning = false
- valueCounter = 0
- }
- } else {
- thisObject.isRunning = false
- }
- }
- function childrenRunningPhysics () {
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition.properties === undefined) { return }
- let monitorChildrenRunning = false
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
- if (property.monitorChildrenRunning === true) {
- let children = thisObject.payload.node[property.name]
- if (children === undefined) { continue }
- let totalRunning = 0
- for (let j = 0; j < children.length; j++) {
- let child = children[j]
- if (child.payload !== undefined) {
- if (child.payload.uiObject.isRunning === true) {
- totalRunning++
+ onRunningCallBackFunction = undefined
+ }
+
+ function finalizeEventsServerClient() {
+ if (eventsServerClient !== undefined) {
+ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+
+ if (eventSubscriptionIdOnRunning !== undefined) {
+ eventsServerClient.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
+ }
+ if (eventSubscriptionIdOnStopped !== undefined) {
+ eventsServerClient.stopListening(key, eventSubscriptionIdOnStopped, 'UiObject')
+ }
+ if (eventSubscriptionIdOnError !== undefined) {
+ eventsServerClient.stopListening(key, eventSubscriptionIdOnError, 'UiObject')
}
- }
}
- if (totalRunning > 0) {
- setValue(totalRunning + ' / ' + children.length + ' Running')
- thisObject.isRunning = true
- } else {
- thisObject.isRunning = false
- valueCounter = 0
- }
- monitorChildrenRunning = true
- return
- }
- }
- if (monitorChildrenRunning === false) {
- heartBeatPhysics()
- }
- }
-
- function chainAttachingPhysics () {
- chainAttacchingCounters()
-
- if (thisObject.isOnFocus !== true) { return }
- if (isDragging !== true) { return }
- if (rightDragging !== true) { return }
- if (thisObject.payload.chainParent !== undefined) { return }
-
- let nearbyFloatingObjects = thisObject.payload.floatingObject.nearbyFloatingObjects
- let compatibleTypes
-
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.chainAttachesTo !== undefined) {
- compatibleTypes = nodeDefinition.chainAttachesTo.compatibleTypes
- } else {
- return
- }
- } else {
- return
}
- let foundCompatible = false
- chainAttachToNode = undefined
- isChainAttaching = false
+ function initialize(payload, menuItemsInitialValues) {
+ thisObject.payload = payload
- for (let i = 0; i < nearbyFloatingObjects.length; i++) {
- let nearby = nearbyFloatingObjects[i]
- let distance = nearby[0]
- let floatingObject = nearby[1]
- let nearbyNode = floatingObject.payload.node
- if (compatibleTypes.indexOf('->' + nearbyNode.type + '->') >= 0) {
- /* Discard App Schema defined objects with busy coonection ports */
- nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition !== undefined) {
- let mustContinue = false
- let parentNodeDefinition = getNodeDefinition(nearbyNode)
- if (parentNodeDefinition !== undefined) {
- if (parentNodeDefinition.properties !== undefined) {
- for (let j = 0; j < parentNodeDefinition.properties.length; j++) {
- let property = parentNodeDefinition.properties[j]
- if (nodeDefinition.propertyNameAtParent === property.name) {
- switch (property.type) {
- case 'node': {
- if (nearbyNode[property.name] !== undefined) {
- mustContinue = true
- }
- }
- break
- case 'array': {
- /* Nothing to worry about since an array can take more than one element. */
- }
- break
- }
+ /* Initialize the Menu */
+
+ thisObject.menu = newCircularMenu()
+ thisObject.menu.initialize(menuItemsInitialValues, thisObject.payload)
+ thisObject.menu.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true)
+
+ /* Initialize UI Object Title */
+
+ thisObject.uiObjectTitle = newUiObjectTitle()
+ thisObject.uiObjectTitle.isVisibleFunction = thisObject.isVisibleFunction
+ thisObject.uiObjectTitle.container.connectToParent(thisObject.container, false, false, true, true, false, false, true, true)
+ thisObject.uiObjectTitle.fitFunction = thisObject.fitFunction
+ thisObject.uiObjectTitle.initialize(thisObject.payload)
+
+ /* Load UI Object Image */
+
+ iconPhysics()
+
+ selfFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onFocus', onFocus)
+ selfNotFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onNotFocus', onNotFocus)
+ selfDisplaceEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDisplace', onDisplace)
+ selfDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
+ selfDragFinishedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragFinished', onDragFinished)
+ }
+
+ function getContainer(point) {
+ let container
+
+ if (isDragging === false && thisObject.isOnFocus === true) {
+ if (thisObject.codeEditor !== undefined) {
+ container = thisObject.codeEditor.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+
+ if (thisObject.configEditor !== undefined) {
+ container = thisObject.configEditor.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+
+ if (thisObject.conditionEditor !== undefined) {
+ container = thisObject.conditionEditor.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+
+ if (thisObject.formulaEditor !== undefined) {
+ container = thisObject.formulaEditor.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+
+ let getitle = true
+
+ if (thisObject.codeEditor !== undefined) {
+ if (thisObject.codeEditor.visible === true) {
+ getitle = false
}
- }
}
- }
- if (mustContinue === true) { continue }
- }
-
- /* Discard Phases without partent */
- if (thisObject.payload.node.type === 'Phase' && nearbyNode.type === 'Phase' && nearbyNode.payload.parentNode === undefined) { continue }
- /* Control maxPhases */
- if (thisObject.payload.node.type === 'Phase') {
- if (nearbyNode.maxPhases !== undefined) {
- if (nearbyNode.phases.length >= nearbyNode.maxPhases) {
- continue
+ if (thisObject.configEditor !== undefined) {
+ if (thisObject.configEditor.visible === true) {
+ getitle = false
+ }
}
- }
- }
- if (thisObject.payload.node.type === 'Phase' && nearbyNode.type === 'Phase') {
- if (nearbyNode.payload.parentNode.maxPhases !== undefined) {
- if (nearbyNode.payload.parentNode.phases.length >= nearbyNode.payload.parentNode.maxPhases) {
- continue
+ if (thisObject.conditionEditor !== undefined) {
+ if (thisObject.conditionEditor.visible === true) {
+ getitle = false
+ }
}
- }
- }
- if (foundCompatible === false) {
- if (distance < thisObject.container.frame.radius * 1.5 + floatingObject.container.frame.radius * 1.5) {
- nearbyNode.payload.uiObject.getReadyToChainAttach()
- isChainAttaching = true
- chainAttachToNode = nearbyNode
- foundCompatible = true
- }
- }
- nearbyNode.payload.uiObject.showAvailabilityToChainAttach()
- }
- }
- }
-
- function chainAttacchingCounters () {
- if (readyToChainAttachDisplayCounter > 15) {
- readyToChainAttachDisplayIncrement = -0.25
- }
-
- if (readyToChainAttachDisplayCounter < 5) {
- readyToChainAttachDisplayIncrement = 0.25
- }
-
- readyToChainAttachDisplayCounter = readyToChainAttachDisplayCounter + readyToChainAttachDisplayIncrement
-
- readyToChainAttachCounter--
- if (readyToChainAttachCounter <= 0) {
- readyToChainAttachCounter = 0
- isReadyToChainAttach = false
- } else {
- isReadyToChainAttach = true
- }
-
- availableToChainAttachCounter--
- if (availableToChainAttachCounter <= 0) {
- availableToChainAttachCounter = 0
- isAvailableToChainAttach = false
- } else {
- isAvailableToChainAttach = true
- }
- }
-
- function getReadyToChainAttach () {
- readyToChainAttachCounter = 10
- }
-
- function showAvailabilityToChainAttach () {
- availableToChainAttachCounter = 10
- }
-
- function chainDetachingPhysics () {
- if (isDragging !== true) { return }
- if (thisObject.payload.floatingObject.isFrozen === true) { return }
- if (rightDragging === false) { return }
-
- let distanceToChainParent = Math.sqrt(Math.pow(thisObject.payload.position.x - thisObject.payload.targetPosition.x, 2) + Math.pow(thisObject.payload.position.y - thisObject.payload.targetPosition.y, 2))
- let ratio = distanceToChainParent / previousDistanceToChainParent
- if (previousDistanceToChainParent === 0) {
- previousDistanceToChainParent = distanceToChainParent
- return
- }
- previousDistanceToChainParent = distanceToChainParent
-
- if (thisObject.isOnFocus !== true) { return }
- if (thisObject.payload.chainParent === undefined) { return }
- if (thisObject.payload.parentNode === undefined) { return }
-
- let THRESHOLD = 1.15
-
- if (previousDistanceToChainParent !== undefined) {
- if (ratio > THRESHOLD) {
- canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node)
- }
- }
- }
-
- function referenceAttachingPhysics () {
- referenceAttacchingCounters()
-
- if (thisObject.isOnFocus !== true) { return }
- if (isDragging !== true) { return }
- if (rightDragging !== true) { return }
- if (thisObject.payload.referenceParent !== undefined) { return }
-
- let nearbyFloatingObjects = thisObject.payload.floatingObject.nearbyFloatingObjects
- let compatibleTypes
-
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.referenceAttachesTo !== undefined) {
- compatibleTypes = nodeDefinition.referenceAttachesTo.compatibleTypes
- } else {
- return
- }
- } else {
- return
- }
-
- let foundCompatible = false
- referenceAttachToNode = undefined
- isReferenceAttaching = false
-
- for (let i = 0; i < nearbyFloatingObjects.length; i++) {
- let nearby = nearbyFloatingObjects[i]
- let distance = nearby[0]
- let floatingObject = nearby[1]
- let nearbyNode = floatingObject.payload.node
- if (compatibleTypes.indexOf('->' + nearbyNode.type + '->') >= 0) {
- if (foundCompatible === false) {
- if (distance < thisObject.container.frame.radius * 1.5 + floatingObject.container.frame.radius * 1.5) {
- nearbyNode.payload.uiObject.getReadyToReferenceAttach()
- isReferenceAttaching = true
- referenceAttachToNode = nearbyNode
- foundCompatible = true
- }
- }
- nearbyNode.payload.uiObject.showAvailabilityToReferenceAttach()
- }
- }
- }
-
- function referenceAttacchingCounters () {
- if (readyToReferenceAttachDisplayCounter > 15) {
- readyToReferenceAttachDisplayIncrement = -0.25
- }
-
- if (readyToReferenceAttachDisplayCounter < 5) {
- readyToReferenceAttachDisplayIncrement = 0.25
- }
-
- readyToReferenceAttachDisplayCounter = readyToReferenceAttachDisplayCounter + readyToReferenceAttachDisplayIncrement
-
- readyToReferenceAttachCounter--
- if (readyToReferenceAttachCounter <= 0) {
- readyToReferenceAttachCounter = 0
- isReadyToReferenceAttach = false
- } else {
- isReadyToReferenceAttach = true
- }
-
- availableToReferenceAttachCounter--
- if (availableToReferenceAttachCounter <= 0) {
- availableToReferenceAttachCounter = 0
- isAvailableToReferenceAttach = false
- } else {
- isAvailableToReferenceAttach = true
- }
- }
-
- function getReadyToReferenceAttach () {
- readyToReferenceAttachCounter = 10
- }
-
- function showAvailabilityToReferenceAttach () {
- availableToReferenceAttachCounter = 10
- }
-
- function referenceDetachingPhysics () {
- if (isDragging !== true) { 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))
- let ratio = distanceToReferenceParent / previousDistanceToReferenceParent
- if (previousDistanceToReferenceParent === 0) {
- previousDistanceToReferenceParent = distanceToReferenceParent
- return
- }
- 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)
- }
- }
- }
-
- function highlightPhisycs () {
- highlightCounter--
- if (highlightCounter < 0) {
- highlightCounter = 0
- isHighlighted = false
- }
- }
-
- function runningAtBackendPhisycs () {
- runningAtBackendCounter--
- if (runningAtBackendCounter < 0) {
- runningAtBackendCounter = 0
- isRunningAtBackend = false
- }
- }
-
- function errorMessagePhisycs () {
- errorMessageCounter--
- if (errorMessageCounter < 0) {
- errorMessageCounter = 0
- hasError = false
- }
- }
-
- function valuePhisycs () {
- valueCounter--
- if (valueCounter < 0) {
- valueCounter = 0
- hasValue = false
- }
- }
-
- function percentagePhisycs () {
- percentageCounter--
- if (percentageCounter < 0) {
- percentageCounter = 0
- hasPercentage = false
- }
- }
-
- function statusPhisycs () {
- statusCounter--
- if (statusCounter < 0) {
- statusCounter = 0
- hasStatus = false
- }
- }
-
- function highlight (counter) {
- isHighlighted = true
- if (counter !== undefined) {
- highlightCounter = counter
- } else {
- highlightCounter = 30
- }
- }
-
- function runningAtBackend () {
- isRunningAtBackend = true
- runningAtBackendCounter = 5
- }
-
- function setErrorMessage (message, duration) {
- if (message !== undefined) {
- errorMessage = message
- hasError = true
- if (duration === undefined) { duration = 1 }
- errorMessageCounter = 100 * duration
- }
- }
-
- function resetErrorMessage () {
- errorMessage = undefined
- hasError = false
- }
-
- function setValue (value, counter) {
- if (value !== undefined) {
- currentValue = value
- hasValue = true
- if (counter !== undefined) {
- valueCounter = counter
- } else {
- valueCounter = 100
- }
- }
- }
-
- function resetValue () {
- currentValue = undefined
- hasValue = false
- valueCounter = 0
- }
-
- function setPercentage (percentage, counter) {
- if (percentage !== undefined) {
- currentPercentage = percentage
- hasPercentage = true
- if (counter !== undefined) {
- percentageCounter = counter
- } else {
- percentageCounter = 100
- }
- }
- }
-
- function resetPercentage () {
- currentPercentage = undefined
- hasPercentage = false
- percentageCounter = 0
- }
-
- function setStatus (status, counter) {
- if (status !== undefined) {
- currentStatus = status
- hasStatus = true
- if (counter !== undefined) {
- statusCounter = counter
- } else {
- statusCounter = 100
- }
- }
- }
-
- function resetStatus () {
- currentStatus = undefined
- hasStatus = false
- statusCounter = 0
- }
-
- function heartBeat () {
- lastHeartBeat = new Date()
- thisObject.isRunning = true
-
- if (onRunningCallBackFunctionWasCalled === false) {
- onRunningCallBackFunctionWasCalled = true
- if (onRunningCallBackFunction !== undefined) {
- onRunningCallBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
- }
- }
- }
-
- function run (pEventsServerClient, callBackFunction) {
- finalizeEventsServerClient()
- resetErrorMessage()
- resetPercentage()
- resetValue()
- resetStatus()
- eventsServerClient = pEventsServerClient
-
- /* We setup the circular progress bar. */
- if (thisObject.circularProgressBar !== undefined) {
- thisObject.circularProgressBar.finalize()
- }
-
- thisObject.circularProgressBar = newCircularProgressBar()
- thisObject.circularProgressBar.initialize(thisObject.payload, eventsServerClient)
- thisObject.circularProgressBar.fitFunction = thisObject.fitFunction
- thisObject.circularProgressBar.container = thisObject.container
-
- setupRunningEventListener(callBackFunction)
- setupErrorEventListener(callBackFunction)
- }
-
- function setupRunningEventListener (callBackFunction) {
- /* We will wait to hear the Running event in order to confirm the execution was really started */
- let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
- eventsServerClient.listenToEvent(key, 'Running', undefined, 'UiObject', onResponse, onRunning)
-
- onRunningCallBackFunction = callBackFunction
-
- function onResponse (message) {
- eventSubscriptionIdOnRunning = message.eventSubscriptionId
- }
-
- function onRunning () {
- if (thisObject.payload === undefined) { return }
-
- let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
- eventsServerClient.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
-
- thisObject.isRunning = true
-
- if (callBackFunction !== undefined) {
- callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
- onRunningCallBackFunctionWasCalled = true
- }
- }
-
- /*
- While it is running, it can happen that it naturally stops or is stopped not from the UI but from other means.
- In those cases, the stop function would never be called (from the UI). So what we will do is to call it from
- here with and event, and passing our own callBackFunction. In case there is an external source stopping this,
- this will produce an execution of the callback with our event, which will produce that the menu item is restored
- to its default stage.
-
- If on the other side, it is executed from the UI, then we will be processing the Stopped event twice, which in
- both cases will reset the menu item to its default state.
- */
-
- let event = {
- type: 'Secondary Action Already Executed'
- }
- stop(callBackFunction, event)
- }
-
- function setupErrorEventListener (callBackFunction) {
- let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
- eventsServerClient.listenToEvent(key, 'Error', undefined, key, onResponse, onError)
-
- function onResponse (message) {
- eventSubscriptionIdOnError = message.eventSubscriptionId
- }
-
- function onError (message) {
- setErrorMessage(message.event.errorMessage, 10)
-
- let event = {
- type: 'Secondary Action Already Executed'
- }
- completeStop(callBackFunction, event)
- }
- }
-
- function stop (callBackFunction, event) {
- /* We will wait to the event that the execution was terminated in order to call back the menu item */
- let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
- eventsServerClient.listenToEvent(key, 'Stopped', undefined, 'UiObject', onResponse, onStopped)
-
- function onResponse (message) {
- eventSubscriptionIdOnStopped = message.eventSubscriptionId
- }
-
- function onStopped () {
- completeStop(callBackFunction, event)
- }
- }
-
- function completeStop (callBackFunction, event) {
- if (thisObject.payload === undefined) { return }
- if (callBackFunction !== undefined) {
- callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, event)
- }
-
- if (thisObject.circularProgressBar !== undefined) {
- thisObject.circularProgressBar.finalize()
- thisObject.circularProgressBar = undefined
- }
- thisObject.isRunning = false
- hasValue = false
- hasPercentage = false
- hasStatus = false
- lastHeartBeat = undefined
-
- finalizeEventsServerClient()
- }
-
- function iconPhysics () {
- icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition.alternativeIcons !== undefined) {
- let nodeToUse = thisObject.payload.node
- if (nodeDefinition.alternativeIcons === 'Use Reference Parent') {
- if (thisObject.payload.node.payload.referenceParent !== undefined) {
- nodeToUse = thisObject.payload.node.payload.referenceParent
- }
- }
- if (nodeDefinition.alternativeIcons === 'Use Reference Grandparent') {
- if (thisObject.payload.node.payload.referenceParent !== undefined) {
- if (thisObject.payload.node.payload.referenceParent.payload !== undefined) {
- if (thisObject.payload.node.payload.referenceParent.payload.referenceParent !== undefined) {
- nodeToUse = thisObject.payload.node.payload.referenceParent.payload.referenceParent
+ if (thisObject.formulaEditor !== undefined) {
+ if (thisObject.formulaEditor.visible === true) {
+ getitle = false
+ }
}
- }
- }
- }
- nodeDefinition = getNodeDefinition(nodeToUse)
- let config = nodeToUse.config
- try {
- config = JSON.parse(config)
- let alternativeIcon
- let iconName
- for (let i = 0; i < nodeDefinition.alternativeIcons.length; i++) {
- alternativeIcon = nodeDefinition.alternativeIcons[i]
- if (alternativeIcon.codeName === config.codeName) {
- iconName = alternativeIcon.iconName
- }
- }
- let newIcon = canvas.designSpace.iconCollection.get(iconName)
- if (newIcon !== undefined) {
- icon = newIcon
- }
- } catch (err) {
- // Nothing to do if JSON is baddly formated.
- }
- }
- executingIcon = canvas.designSpace.iconCollection.get('attractive')
- }
+ if (getitle === true) {
+ container = thisObject.uiObjectTitle.getContainer(point)
+ if (container !== undefined) { return container }
+ }
- function onFocus () {
- thisObject.isOnFocus = true
-
- if (thisObject.payload !== undefined && thisObject.isOnFocus === true && thisObject.payload.referenceParent !== undefined) {
- if (thisObject.payload.referenceParent.payload !== undefined) {
- if (thisObject.payload.referenceParent.payload.uiObject !== undefined) {
- thisObject.payload.referenceParent.payload.uiObject.isShowing = true
- }
- }
- }
- }
-
- function onNotFocus () {
- thisObject.isOnFocus = false
- if (thisObject.codeEditor !== undefined) {
- thisObject.codeEditor.deactivate()
- }
- if (thisObject.configEditor !== undefined) {
- thisObject.configEditor.deactivate()
- }
- if (thisObject.conditionEditor !== undefined) {
- thisObject.conditionEditor.deactivate()
- }
- if (thisObject.formulaEditor !== undefined) {
- thisObject.formulaEditor.deactivate()
- }
-
- if (thisObject.payload !== undefined &&
- thisObject.isOnFocus === false &&
- thisObject.payload.referenceParent !== undefined &&
- thisObject.payload.referenceParent.payload !== undefined &&
- thisObject.payload.referenceParent.payload.uiObject !== undefined) {
- thisObject.payload.referenceParent.payload.uiObject.isShowing = false
- }
- }
-
- function onDisplace (event) {
- thisObject.uiObjectTitle.exitEditMode()
- }
-
- function onDragStarted (event) {
- thisObject.uiObjectTitle.exitEditMode()
- if (thisObject.codeEditor !== undefined) {
- thisObject.codeEditor.deactivate()
- }
- if (thisObject.configEditor !== undefined) {
- thisObject.configEditor.deactivate()
- }
- if (thisObject.conditionEditor !== undefined) {
- thisObject.conditionEditor.deactivate()
- }
- if (thisObject.formulaEditor !== undefined) {
- thisObject.formulaEditor.deactivate()
- }
- isDragging = true
- if (event.button === 2) {
- rightDragging = true
- } else {
- rightDragging = false
- }
-
- previousDistanceToReferenceParent = undefined
- previousDistanceToChainParent = undefined
- }
-
- function onDragFinished (event) {
- if (isChainAttaching === true) {
- canvas.designSpace.workspace.chainAttachNode(thisObject.payload.node, chainAttachToNode)
- chainAttachToNode = undefined
- isChainAttaching = false
- }
- if (isReferenceAttaching === true) {
- canvas.designSpace.workspace.referenceAttachNode(thisObject.payload.node, referenceAttachToNode)
- referenceAttachToNode = undefined
- isReferenceAttaching = false
- }
- isDragging = false
- }
-
- function drawBackground () {
- if (thisObject.isOnFocus === false) {
- drawReferenceLine()
- drawChainLine()
-
- if (isDragging === false && thisObject.isOnFocus === true) {
- thisObject.menu.drawBackground()
- }
- }
-
- if (thisObject.circularProgressBar !== undefined) {
- thisObject.circularProgressBar.drawBackground()
- }
- }
-
- function drawMiddleground () {
- if (thisObject.isOnFocus === false) {
- drawValue()
- drawPercentage()
- drawStatus()
- drawText()
- thisObject.uiObjectTitle.draw()
- }
- }
-
- function drawForeground () {
- if (thisObject.isOnFocus === false) {
- drawBodyAndPicture()
- if (isDragging === false) {
- thisObject.menu.drawForeground()
- }
- }
-
- if (thisObject.circularProgressBar !== undefined) {
- thisObject.circularProgressBar.drawForeground()
- }
- }
-
- function drawOnFocus () {
- if (thisObject.isOnFocus === true) {
- drawReferenceLine()
- drawChainLine()
-
- if (thisObject.codeEditor !== undefined) {
- thisObject.codeEditor.drawBackground()
- thisObject.codeEditor.drawForeground()
- }
- if (thisObject.configEditor !== undefined) {
- thisObject.configEditor.drawBackground()
- thisObject.configEditor.drawForeground()
- }
- if (thisObject.conditionEditor !== undefined) {
- thisObject.conditionEditor.drawBackground()
- thisObject.conditionEditor.drawForeground()
- }
- if (thisObject.formulaEditor !== undefined) {
- thisObject.formulaEditor.drawBackground()
- thisObject.formulaEditor.drawForeground()
- }
-
- let drawMenu = true
- let drawTitle = true
-
- if (thisObject.codeEditor !== undefined) {
- if (thisObject.codeEditor.visible === true) {
- drawMenu = false
- drawTitle = false
- }
- }
- if (thisObject.configEditor !== undefined) {
- if (thisObject.configEditor.visible === true) {
- drawMenu = false
- drawTitle = false
- }
- }
- if (thisObject.conditionEditor !== undefined) {
- if (thisObject.conditionEditor.visible === true) {
- drawMenu = false
- drawTitle = false
- }
- }
- if (thisObject.formulaEditor !== undefined) {
- if (thisObject.formulaEditor.visible === true) {
- drawMenu = false
- drawTitle = false
- }
- }
-
- if (drawMenu === true) {
- drawBodyAndPicture()
- if (isDragging === false) {
- thisObject.menu.drawBackground()
- thisObject.menu.drawForeground()
- }
- }
-
- drawErrorMessage()
- drawValue()
- drawPercentage()
- drawStatus()
- drawText()
-
- if (drawTitle === true) {
- thisObject.uiObjectTitle.draw()
- }
- }
- }
-
- function drawChainLine () {
- if (canvas.floatingSpace.drawChainLines === false) { return }
- if (thisObject.payload.chainParent === undefined) { return }
-
- let targetPoint = {
- x: thisObject.payload.chainParent.payload.floatingObject.container.frame.position.x,
- y: thisObject.payload.chainParent.payload.floatingObject.container.frame.position.y
- }
-
- let position = {
- x: 0,
- y: 0
- }
-
- targetPoint = canvas.floatingSpace.container.frame.frameThisPoint(targetPoint)
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (canvas.floatingSpace.inMapMode === true) {
- targetPoint = canvas.floatingSpace.transformPointToMap(targetPoint)
- position = canvas.floatingSpace.transformPointToMap(position)
- }
-
- if (thisObject.container.frame.radius > 1) {
- let LINE_STYLE = UI_COLOR.TITANIUM_YELLOW
- if (thisObject.payload.floatingObject.angleToParent !== ANGLE_TO_PARENT.NOT_FIXED) {
- LINE_STYLE = UI_COLOR.GOLDEN_ORANGE
- }
- if (thisObject.payload.floatingObject.isFrozen === true) {
- LINE_STYLE = UI_COLOR.TURQUOISE
- }
- if (newUiObjectCounter > 0) {
- LINE_STYLE = UI_COLOR.GREY
- }
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(position.x, position.y)
- browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
- browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
- browserCanvasContext.setLineDash([0, chainLineCounter, 2, 3, 0, 500 - chainLineCounter])
- browserCanvasContext.lineWidth = 2
- browserCanvasContext.stroke()
- browserCanvasContext.setLineDash([0, 0])
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(position.x, position.y)
- browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
- browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
- browserCanvasContext.setLineDash([3, 47])
- browserCanvasContext.lineWidth = 3
- browserCanvasContext.stroke()
- browserCanvasContext.setLineDash([0, 0])
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(position.x, position.y)
- browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
- browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
- browserCanvasContext.setLineDash([1, 9])
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.stroke()
- browserCanvasContext.setLineDash([0, 0])
- }
-
- if (thisObject.container.frame.radius > 0.5) {
- let radius = 1
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(targetPoint.x, targetPoint.y, radius, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.fill()
- }
- }
-
- function drawReferenceLine () {
- if (canvas.floatingSpace.drawReferenceLines === false && thisObject.isOnFocus === false) { return }
- if (thisObject.payload.referenceParent === undefined) { return }
- if (thisObject.payload.referenceParent.payload === undefined) { return }
- if (thisObject.payload.referenceParent.payload.floatingObject === undefined) { return }
- if (thisObject.payload.referenceParent.payload.floatingObject.isParentCollapsed === true && thisObject.isOnFocus === false) { return }
-
- let targetPoint = {
- x: thisObject.payload.referenceParent.payload.position.x,
- y: thisObject.payload.referenceParent.payload.position.y
- }
-
- let position = {
- x: 0,
- y: 0
- }
-
- targetPoint = canvas.floatingSpace.container.frame.frameThisPoint(targetPoint)
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (thisObject.isOnFocus === true) {
- targetPoint = thisObject.fitFunction(targetPoint)
- }
-
- if (canvas.floatingSpace.inMapMode === true) {
- position = canvas.floatingSpace.transformPointToMap(position)
- targetPoint = canvas.floatingSpace.transformPointToMap(targetPoint)
- }
-
- let LINE_STYLE = UI_COLOR.GREY
-
- if (thisObject.container.frame.radius > 1) {
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(position.x, position.y)
- browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
- browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
- browserCanvasContext.setLineDash([1, 9])
- browserCanvasContext.lineWidth = 0.75
- browserCanvasContext.stroke()
- browserCanvasContext.setLineDash([0, 0])
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(position.x, position.y)
- browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
- browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
- browserCanvasContext.setLineDash([0, referenceLineCounter, 1, 9, 2, 8, 3, 7, 4, 6, 0, 500 - referenceLineCounter])
- browserCanvasContext.lineWidth = 4
- browserCanvasContext.stroke()
- browserCanvasContext.setLineDash([0, 0])
- }
-
- if (thisObject.container.frame.radius > 0.5) {
- let radius = 1
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(targetPoint.x, targetPoint.y, radius, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.fill()
- }
- }
-
- function isEditorVisible () {
- if (thisObject.codeEditor !== undefined) {
- if (thisObject.codeEditor.visible === true) { return true }
- }
-
- if (thisObject.configEditor !== undefined) {
- if (thisObject.configEditor.visible === true) { return true }
- }
-
- if (thisObject.conditionEditor !== undefined) {
- if (thisObject.conditionEditor.visible === true) { return true }
- }
-
- if (thisObject.formulaEditor !== undefined) {
- if (thisObject.formulaEditor.visible === true) { return true }
- }
- }
-
- function drawText () {
- if (isEditorVisible() === true) { return }
-/* Text Follows */
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (canvas.floatingSpace.inMapMode === true) {
- position = canvas.floatingSpace.transformPointToMap(position)
- }
-
- let radius = thisObject.container.frame.radius
- /* Label Text */
- let labelPoint
- let fontSize = thisObject.payload.floatingObject.currentFontSize
- let label
-
- if (radius > 6) {
- const MAX_LABEL_LENGTH = 30
-
- label = thisObject.payload.subTitle
- label = addIndexNumber(label)
-
- if (label !== undefined) {
- if (label.length > MAX_LABEL_LENGTH) {
- label = label.substring(0, MAX_LABEL_LENGTH) + '...'
+ container = thisObject.menu.getContainer(point)
+ if (container !== undefined) { return container }
}
- labelPoint = {
- x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
- y: position.y + radius * 4 / 5 + fontSize * FONT_ASPECT_RATIO + 15
+ if (thisObject.container.frame.isThisPointHere(point, true, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
+
+ function invisiblePhysics() {
+ thisObject.menu.invisiblePhysics()
+ childrenRunningPhysics()
+ }
+
+ function physics() {
+ thisObject.menu.physics()
+ thisObject.uiObjectTitle.physics()
+
+ if (thisObject.codeEditor !== undefined) {
+ thisObject.codeEditor.physics()
+ }
+
+ if (thisObject.configEditor !== undefined) {
+ thisObject.configEditor.physics()
+ }
+
+ if (thisObject.conditionEditor !== undefined) {
+ thisObject.conditionEditor.physics()
+ }
+
+ if (thisObject.formulaEditor !== undefined) {
+ thisObject.formulaEditor.physics()
+ }
+
+ if (thisObject.payload.chainParent === undefined || thisObject.payload.chainParent.payload === undefined) {
+ thisObject.payload.targetPosition.x = thisObject.payload.position.x,
+ thisObject.payload.targetPosition.y = thisObject.payload.position.y
+ } else {
+ if (thisObject.payload.chainParent.payload.position !== undefined) {
+ thisObject.payload.targetPosition.x = thisObject.payload.chainParent.payload.position.x
+ thisObject.payload.targetPosition.y = thisObject.payload.chainParent.payload.position.y
+ }
+ }
+
+ if (thisObject.circularProgressBar !== undefined) {
+ thisObject.circularProgressBar.physics()
+ }
+
+ iconPhysics()
+ highlightPhisycs()
+ runningAtBackendPhisycs()
+ errorMessagePhisycs()
+ valuePhisycs()
+ percentagePhisycs()
+ statusPhisycs()
+ chainDetachingPhysics()
+ chainAttachingPhysics()
+ referenceDetachingPhysics()
+ referenceAttachingPhysics()
+ childrenRunningPhysics()
+ newObjectPhysics()
+ referenceLinePhysics()
+ chainLinePhysics()
+ }
+
+ function referenceLinePhysics() {
+ referenceLineCounter = referenceLineCounter + 2
+ if (referenceLineCounter > 500) {
+ referenceLineCounter = 0
+ }
+ }
+
+ function chainLinePhysics() {
+ chainLineCounter = chainLineCounter - 5
+ if (chainLineCounter < 0) {
+ chainLineCounter = 500
+ }
+ }
+
+ function newObjectPhysics() {
+ newUiObjectCounter--
+ if (newUiObjectCounter < 0) {
+ newUiObjectCounter = 0
+ }
+ }
+
+ function heartBeatPhysics() {
+ if (lastHeartBeat !== undefined) {
+ const ONE_MIN = 60000
+ nowTimestamp = (new Date()).valueOf()
+ if (nowTimestamp - lastHeartBeat.valueOf() > ONE_MIN) {
+ lastHeartBeat = undefined
+ thisObject.isRunning = false
+ valueCounter = 0
+ }
+ } else {
+ thisObject.isRunning = false
+ }
+ }
+
+ function childrenRunningPhysics() {
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition.properties === undefined) { return }
+ let monitorChildrenRunning = false
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
+ if (property.monitorChildrenRunning === true) {
+ let children = thisObject.payload.node[property.name]
+ if (children === undefined) { continue }
+ let totalRunning = 0
+ for (let j = 0; j < children.length; j++) {
+ let child = children[j]
+ if (child.payload !== undefined) {
+ if (child.payload.uiObject.isRunning === true) {
+ totalRunning++
+ }
+ }
+ }
+ if (totalRunning > 0) {
+ setValue(totalRunning + ' / ' + children.length + ' Running')
+ thisObject.isRunning = true
+ } else {
+ thisObject.isRunning = false
+ valueCounter = 0
+ }
+ monitorChildrenRunning = true
+ return
+ }
+ }
+ if (monitorChildrenRunning === false) {
+ heartBeatPhysics()
+ }
+ }
+
+ function chainAttachingPhysics() {
+ chainAttacchingCounters()
+
+ if (thisObject.isOnFocus !== true) { return }
+ if (isDragging !== true) { return }
+ if (rightDragging !== true) { return }
+ if (thisObject.payload.chainParent !== undefined) { return }
+
+ let nearbyFloatingObjects = thisObject.payload.floatingObject.nearbyFloatingObjects
+ let compatibleTypes
+
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.chainAttachesTo !== undefined) {
+ compatibleTypes = nodeDefinition.chainAttachesTo.compatibleTypes
+ } else {
+ return
+ }
+ } else {
+ return
+ }
+
+ let foundCompatible = false
+ chainAttachToNode = undefined
+ isChainAttaching = false
+
+ for (let i = 0; i < nearbyFloatingObjects.length; i++) {
+ let nearby = nearbyFloatingObjects[i]
+ let distance = nearby[0]
+ let floatingObject = nearby[1]
+ let nearbyNode = floatingObject.payload.node
+ if (compatibleTypes.indexOf('->' + nearbyNode.type + '->') >= 0) {
+ /* Discard App Schema defined objects with busy coonection ports */
+ nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition !== undefined) {
+ let mustContinue = false
+ let parentNodeDefinition = getNodeDefinition(nearbyNode)
+ if (parentNodeDefinition !== undefined) {
+ if (parentNodeDefinition.properties !== undefined) {
+ for (let j = 0; j < parentNodeDefinition.properties.length; j++) {
+ let property = parentNodeDefinition.properties[j]
+ if (nodeDefinition.propertyNameAtParent === property.name) {
+ switch (property.type) {
+ case 'node': {
+ if (nearbyNode[property.name] !== undefined) {
+ mustContinue = true
+ }
+ }
+ break
+ case 'array': {
+ /* Nothing to worry about since an array can take more than one element. */
+ }
+ break
+ }
+ }
+ }
+ }
+ }
+ if (mustContinue === true) { continue }
+ }
+
+ /* Discard Phases without partent */
+ if (thisObject.payload.node.type === 'Phase' && nearbyNode.type === 'Phase' && nearbyNode.payload.parentNode === undefined) { continue }
+ /* Control maxPhases */
+ if (thisObject.payload.node.type === 'Phase') {
+ if (nearbyNode.maxPhases !== undefined) {
+ if (nearbyNode.phases.length >= nearbyNode.maxPhases) {
+ continue
+ }
+ }
+ }
+ if (thisObject.payload.node.type === 'Phase' && nearbyNode.type === 'Phase') {
+ if (nearbyNode.payload.parentNode.maxPhases !== undefined) {
+ if (nearbyNode.payload.parentNode.phases.length >= nearbyNode.payload.parentNode.maxPhases) {
+ continue
+ }
+ }
+ }
+ if (foundCompatible === false) {
+ if (distance < thisObject.container.frame.radius * 1.5 + floatingObject.container.frame.radius * 1.5) {
+ nearbyNode.payload.uiObject.getReadyToChainAttach()
+ isChainAttaching = true
+ chainAttachToNode = nearbyNode
+ foundCompatible = true
+ }
+ }
+ nearbyNode.payload.uiObject.showAvailabilityToChainAttach()
+ }
+ }
+ }
+
+ function chainAttacchingCounters() {
+ if (readyToChainAttachDisplayCounter > 15) {
+ readyToChainAttachDisplayIncrement = -0.25
+ }
+
+ if (readyToChainAttachDisplayCounter < 5) {
+ readyToChainAttachDisplayIncrement = 0.25
+ }
+
+ readyToChainAttachDisplayCounter = readyToChainAttachDisplayCounter + readyToChainAttachDisplayIncrement
+
+ readyToChainAttachCounter--
+ if (readyToChainAttachCounter <= 0) {
+ readyToChainAttachCounter = 0
+ isReadyToChainAttach = false
+ } else {
+ isReadyToChainAttach = true
+ }
+
+ availableToChainAttachCounter--
+ if (availableToChainAttachCounter <= 0) {
+ availableToChainAttachCounter = 0
+ isAvailableToChainAttach = false
+ } else {
+ isAvailableToChainAttach = true
+ }
+ }
+
+ function getReadyToChainAttach() {
+ readyToChainAttachCounter = 10
+ }
+
+ function showAvailabilityToChainAttach() {
+ availableToChainAttachCounter = 10
+ }
+
+ function chainDetachingPhysics() {
+ if (isDragging !== true) { return }
+ if (thisObject.payload.floatingObject.isFrozen === true) { return }
+ if (rightDragging === false) { return }
+
+ let distanceToChainParent = Math.sqrt(Math.pow(thisObject.payload.position.x - thisObject.payload.targetPosition.x, 2) + Math.pow(thisObject.payload.position.y - thisObject.payload.targetPosition.y, 2))
+ let ratio = distanceToChainParent / previousDistanceToChainParent
+ if (previousDistanceToChainParent === 0) {
+ previousDistanceToChainParent = distanceToChainParent
+ return
+ }
+ previousDistanceToChainParent = distanceToChainParent
+
+ if (thisObject.isOnFocus !== true) { return }
+ if (thisObject.payload.chainParent === undefined) { return }
+ if (thisObject.payload.parentNode === undefined) { return }
+
+ let THRESHOLD = 1.15
+
+ if (previousDistanceToChainParent !== undefined) {
+ if (ratio > THRESHOLD) {
+ canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node)
+ }
+ }
+ }
+
+ function referenceAttachingPhysics() {
+ referenceAttacchingCounters()
+
+ if (thisObject.isOnFocus !== true) { return }
+ if (isDragging !== true) { return }
+ if (rightDragging !== true) { return }
+ if (thisObject.payload.referenceParent !== undefined) { return }
+
+ let nearbyFloatingObjects = thisObject.payload.floatingObject.nearbyFloatingObjects
+ let compatibleTypes
+
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.referenceAttachesTo !== undefined) {
+ compatibleTypes = nodeDefinition.referenceAttachesTo.compatibleTypes
+ } else {
+ return
+ }
+ } else {
+ return
+ }
+
+ let foundCompatible = false
+ referenceAttachToNode = undefined
+ isReferenceAttaching = false
+
+ for (let i = 0; i < nearbyFloatingObjects.length; i++) {
+ let nearby = nearbyFloatingObjects[i]
+ let distance = nearby[0]
+ let floatingObject = nearby[1]
+ let nearbyNode = floatingObject.payload.node
+ if (compatibleTypes.indexOf('->' + nearbyNode.type + '->') >= 0) {
+ if (foundCompatible === false) {
+ if (distance < thisObject.container.frame.radius * 1.5 + floatingObject.container.frame.radius * 1.5) {
+ nearbyNode.payload.uiObject.getReadyToReferenceAttach()
+ isReferenceAttaching = true
+ referenceAttachToNode = nearbyNode
+ foundCompatible = true
+ }
+ }
+ nearbyNode.payload.uiObject.showAvailabilityToReferenceAttach()
+ }
+ }
+ }
+
+ function referenceAttacchingCounters() {
+ if (readyToReferenceAttachDisplayCounter > 15) {
+ readyToReferenceAttachDisplayIncrement = -0.25
+ }
+
+ if (readyToReferenceAttachDisplayCounter < 5) {
+ readyToReferenceAttachDisplayIncrement = 0.25
+ }
+
+ readyToReferenceAttachDisplayCounter = readyToReferenceAttachDisplayCounter + readyToReferenceAttachDisplayIncrement
+
+ readyToReferenceAttachCounter--
+ if (readyToReferenceAttachCounter <= 0) {
+ readyToReferenceAttachCounter = 0
+ isReadyToReferenceAttach = false
+ } else {
+ isReadyToReferenceAttach = true
+ }
+
+ availableToReferenceAttachCounter--
+ if (availableToReferenceAttachCounter <= 0) {
+ availableToReferenceAttachCounter = 0
+ isAvailableToReferenceAttach = false
+ } else {
+ isAvailableToReferenceAttach = true
+ }
+ }
+
+ function getReadyToReferenceAttach() {
+ readyToReferenceAttachCounter = 10
+ }
+
+ function showAvailabilityToReferenceAttach() {
+ availableToReferenceAttachCounter = 10
+ }
+
+ function referenceDetachingPhysics() {
+ if (isDragging !== true) { 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))
+ let ratio = distanceToReferenceParent / previousDistanceToReferenceParent
+ if (previousDistanceToReferenceParent === 0) {
+ previousDistanceToReferenceParent = distanceToReferenceParent
+ return
+ }
+ 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)
+ }
+ }
+ }
+
+ function highlightPhisycs() {
+ highlightCounter--
+ if (highlightCounter < 0) {
+ highlightCounter = 0
+ isHighlighted = false
+ }
+ }
+
+ function runningAtBackendPhisycs() {
+ runningAtBackendCounter--
+ if (runningAtBackendCounter < 0) {
+ runningAtBackendCounter = 0
+ isRunningAtBackend = false
+ }
+ }
+
+ function errorMessagePhisycs() {
+ errorMessageCounter--
+ if (errorMessageCounter < 0) {
+ errorMessageCounter = 0
+ hasError = false
+ }
+ }
+
+ function valuePhisycs() {
+ valueCounter--
+ if (valueCounter < 0) {
+ valueCounter = 0
+ hasValue = false
+ }
+ }
+
+ function percentagePhisycs() {
+ percentageCounter--
+ if (percentageCounter < 0) {
+ percentageCounter = 0
+ hasPercentage = false
+ }
+ }
+
+ function statusPhisycs() {
+ statusCounter--
+ if (statusCounter < 0) {
+ statusCounter = 0
+ hasStatus = false
+ }
+ }
+
+ function highlight(counter) {
+ isHighlighted = true
+ if (counter !== undefined) {
+ highlightCounter = counter
+ } else {
+ highlightCounter = 30
+ }
+ }
+
+ function runningAtBackend() {
+ isRunningAtBackend = true
+ runningAtBackendCounter = 5
+ }
+
+ function setErrorMessage(message, duration) {
+ if (message !== undefined) {
+ errorMessage = message
+ hasError = true
+ if (duration === undefined) { duration = 1 }
+ errorMessageCounter = 100 * duration
+ }
+ }
+
+ function resetErrorMessage() {
+ errorMessage = undefined
+ hasError = false
+ }
+
+ function setValue(value, counter) {
+ if (value !== undefined) {
+ currentValue = value
+ hasValue = true
+ if (counter !== undefined) {
+ valueCounter = counter
+ } else {
+ valueCounter = 100
+ }
+ }
+ }
+
+ function resetValue() {
+ currentValue = undefined
+ hasValue = false
+ valueCounter = 0
+ }
+
+ function setPercentage(percentage, counter) {
+ if (percentage !== undefined) {
+ currentPercentage = percentage
+ hasPercentage = true
+ if (counter !== undefined) {
+ percentageCounter = counter
+ } else {
+ percentageCounter = 100
+ }
+ }
+ }
+
+ function resetPercentage() {
+ currentPercentage = undefined
+ hasPercentage = false
+ percentageCounter = 0
+ }
+
+ function setStatus(status, counter) {
+ if (status !== undefined) {
+ currentStatus = status
+ hasStatus = true
+ if (counter !== undefined) {
+ statusCounter = counter
+ } else {
+ statusCounter = 100
+ }
+ }
+ }
+
+ function resetStatus() {
+ currentStatus = undefined
+ hasStatus = false
+ statusCounter = 0
+ }
+
+ function heartBeat() {
+ lastHeartBeat = new Date()
+ thisObject.isRunning = true
+
+ if (onRunningCallBackFunctionWasCalled === false) {
+ onRunningCallBackFunctionWasCalled = true
+ if (onRunningCallBackFunction !== undefined) {
+ onRunningCallBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
+ }
+ }
+ }
+
+ function run(pEventsServerClient, callBackFunction) {
+ finalizeEventsServerClient()
+ resetErrorMessage()
+ resetPercentage()
+ resetValue()
+ resetStatus()
+ eventsServerClient = pEventsServerClient
+
+ /* We setup the circular progress bar. */
+ if (thisObject.circularProgressBar !== undefined) {
+ thisObject.circularProgressBar.finalize()
+ }
+
+ thisObject.circularProgressBar = newCircularProgressBar()
+ thisObject.circularProgressBar.initialize(thisObject.payload, eventsServerClient)
+ thisObject.circularProgressBar.fitFunction = thisObject.fitFunction
+ thisObject.circularProgressBar.container = thisObject.container
+
+ setupRunningEventListener(callBackFunction)
+ setupErrorEventListener(callBackFunction)
+ }
+
+ function setupRunningEventListener(callBackFunction) {
+ /* We will wait to hear the Running event in order to confirm the execution was really started */
+ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+ eventsServerClient.listenToEvent(key, 'Running', undefined, 'UiObject', onResponse, onRunning)
+
+ onRunningCallBackFunction = callBackFunction
+
+ function onResponse(message) {
+ eventSubscriptionIdOnRunning = message.eventSubscriptionId
+ }
+
+ function onRunning() {
+ if (thisObject.payload === undefined) { return }
+
+ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+ eventsServerClient.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
+
+ thisObject.isRunning = true
+
+ if (callBackFunction !== undefined) {
+ callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
+ onRunningCallBackFunctionWasCalled = true
+ }
+ }
+
+ /*
+ While it is running, it can happen that it naturally stops or is stopped not from the UI but from other means.
+ In those cases, the stop function would never be called (from the UI). So what we will do is to call it from
+ here with and event, and passing our own callBackFunction. In case there is an external source stopping this,
+ this will produce an execution of the callback with our event, which will produce that the menu item is restored
+ to its default stage.
+
+ If on the other side, it is executed from the UI, then we will be processing the Stopped event twice, which in
+ both cases will reset the menu item to its default state.
+ */
+
+ let event = {
+ type: 'Secondary Action Already Executed'
+ }
+ stop(callBackFunction, event)
+ }
+
+ function setupErrorEventListener(callBackFunction) {
+ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+ eventsServerClient.listenToEvent(key, 'Error', undefined, key, onResponse, onError)
+
+ function onResponse(message) {
+ eventSubscriptionIdOnError = message.eventSubscriptionId
+ }
+
+ function onError(message) {
+ setErrorMessage(message.event.errorMessage, 10)
+
+ let event = {
+ type: 'Secondary Action Already Executed'
+ }
+ completeStop(callBackFunction, event)
+ }
+ }
+
+ function stop(callBackFunction, event) {
+ /* We will wait to the event that the execution was terminated in order to call back the menu item */
+ let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
+ eventsServerClient.listenToEvent(key, 'Stopped', undefined, 'UiObject', onResponse, onStopped)
+
+ function onResponse(message) {
+ eventSubscriptionIdOnStopped = message.eventSubscriptionId
+ }
+
+ function onStopped() {
+ completeStop(callBackFunction, event)
+ }
+ }
+
+ function completeStop(callBackFunction, event) {
+ if (thisObject.payload === undefined) { return }
+ if (callBackFunction !== undefined) {
+ callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, event)
+ }
+
+ if (thisObject.circularProgressBar !== undefined) {
+ thisObject.circularProgressBar.finalize()
+ thisObject.circularProgressBar = undefined
+ }
+ thisObject.isRunning = false
+ hasValue = false
+ hasPercentage = false
+ hasStatus = false
+ lastHeartBeat = undefined
+
+ finalizeEventsServerClient()
+ }
+
+ function iconPhysics() {
+ icon = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition.alternativeIcons !== undefined) {
+ let nodeToUse = thisObject.payload.node
+ if (nodeDefinition.alternativeIcons === 'Use Reference Parent') {
+ if (thisObject.payload.node.payload.referenceParent !== undefined) {
+ nodeToUse = thisObject.payload.node.payload.referenceParent
+ }
+ }
+ if (nodeDefinition.alternativeIcons === 'Use Reference Grandparent') {
+ if (thisObject.payload.node.payload.referenceParent !== undefined) {
+ if (thisObject.payload.node.payload.referenceParent.payload !== undefined) {
+ if (thisObject.payload.node.payload.referenceParent.payload.referenceParent !== undefined) {
+ nodeToUse = thisObject.payload.node.payload.referenceParent.payload.referenceParent
+ }
+ }
+ }
+ }
+ nodeDefinition = getNodeDefinition(nodeToUse)
+ let config = nodeToUse.config
+ try {
+ config = JSON.parse(config)
+ let alternativeIcon
+ let iconName
+ for (let i = 0; i < nodeDefinition.alternativeIcons.length; i++) {
+ alternativeIcon = nodeDefinition.alternativeIcons[i]
+ if (alternativeIcon.codeName === config.codeName) {
+ iconName = alternativeIcon.iconName
+ }
+ }
+ let newIcon = canvas.designSpace.iconCollection.get(iconName)
+ if (newIcon !== undefined) {
+ icon = newIcon
+ }
+ } catch (err) {
+ // Nothing to do if JSON is baddly formated.
+ }
+ }
+
+ executingIcon = canvas.designSpace.iconCollection.get('attractive')
+ }
+
+ function onFocus() {
+ thisObject.isOnFocus = true
+
+ if (thisObject.payload !== undefined && thisObject.isOnFocus === true && thisObject.payload.referenceParent !== undefined) {
+ if (thisObject.payload.referenceParent.payload !== undefined) {
+ if (thisObject.payload.referenceParent.payload.uiObject !== undefined) {
+ thisObject.payload.referenceParent.payload.uiObject.isShowing = true
+ }
+ }
+ }
+ }
+
+ function onNotFocus() {
+ thisObject.isOnFocus = false
+ if (thisObject.codeEditor !== undefined) {
+ thisObject.codeEditor.deactivate()
+ }
+ if (thisObject.configEditor !== undefined) {
+ thisObject.configEditor.deactivate()
+ }
+ if (thisObject.conditionEditor !== undefined) {
+ thisObject.conditionEditor.deactivate()
+ }
+ if (thisObject.formulaEditor !== undefined) {
+ thisObject.formulaEditor.deactivate()
+ }
+
+ if (thisObject.payload !== undefined &&
+ thisObject.isOnFocus === false &&
+ thisObject.payload.referenceParent !== undefined &&
+ thisObject.payload.referenceParent.payload !== undefined &&
+ thisObject.payload.referenceParent.payload.uiObject !== undefined) {
+ thisObject.payload.referenceParent.payload.uiObject.isShowing = false
+ }
+ }
+
+ function onDisplace(event) {
+ thisObject.uiObjectTitle.exitEditMode()
+ }
+
+ function onDragStarted(event) {
+ thisObject.uiObjectTitle.exitEditMode()
+ if (thisObject.codeEditor !== undefined) {
+ thisObject.codeEditor.deactivate()
+ }
+ if (thisObject.configEditor !== undefined) {
+ thisObject.configEditor.deactivate()
+ }
+ if (thisObject.conditionEditor !== undefined) {
+ thisObject.conditionEditor.deactivate()
+ }
+ if (thisObject.formulaEditor !== undefined) {
+ thisObject.formulaEditor.deactivate()
+ }
+ isDragging = true
+ if (event.button === 2) {
+ rightDragging = true
+ } else {
+ rightDragging = false
+ }
+
+ previousDistanceToReferenceParent = undefined
+ previousDistanceToChainParent = undefined
+ }
+
+ function onDragFinished(event) {
+ if (isChainAttaching === true) {
+ canvas.designSpace.workspace.chainAttachNode(thisObject.payload.node, chainAttachToNode)
+ chainAttachToNode = undefined
+ isChainAttaching = false
+ }
+ if (isReferenceAttaching === true) {
+ canvas.designSpace.workspace.referenceAttachNode(thisObject.payload.node, referenceAttachToNode)
+ referenceAttachToNode = undefined
+ isReferenceAttaching = false
+ }
+ isDragging = false
+ }
+
+ function drawBackground() {
+ if (thisObject.isOnFocus === false) {
+ drawReferenceLine()
+ drawChainLine()
+
+ if (isDragging === false && thisObject.isOnFocus === true) {
+ thisObject.menu.drawBackground()
+ }
+ }
+
+ if (thisObject.circularProgressBar !== undefined) {
+ thisObject.circularProgressBar.drawBackground()
+ }
+ }
+
+ function drawMiddleground() {
+ if (thisObject.isOnFocus === false) {
+ drawValue()
+ drawPercentage()
+ drawStatus()
+ drawText()
+ thisObject.uiObjectTitle.draw()
+ }
+ }
+
+ function drawForeground() {
+ if (thisObject.isOnFocus === false) {
+ drawBodyAndPicture()
+ if (isDragging === false) {
+ thisObject.menu.drawForeground()
+ }
+ }
+
+ if (thisObject.circularProgressBar !== undefined) {
+ thisObject.circularProgressBar.drawForeground()
+ }
+ }
+
+ function drawOnFocus() {
+ if (thisObject.isOnFocus === true) {
+ drawReferenceLine()
+ drawChainLine()
+
+ if (thisObject.codeEditor !== undefined) {
+ thisObject.codeEditor.drawBackground()
+ thisObject.codeEditor.drawForeground()
+ }
+ if (thisObject.configEditor !== undefined) {
+ thisObject.configEditor.drawBackground()
+ thisObject.configEditor.drawForeground()
+ }
+ if (thisObject.conditionEditor !== undefined) {
+ thisObject.conditionEditor.drawBackground()
+ thisObject.conditionEditor.drawForeground()
+ }
+ if (thisObject.formulaEditor !== undefined) {
+ thisObject.formulaEditor.drawBackground()
+ thisObject.formulaEditor.drawForeground()
+ }
+
+ let drawMenu = true
+ let drawTitle = true
+
+ if (thisObject.codeEditor !== undefined) {
+ if (thisObject.codeEditor.visible === true) {
+ drawMenu = false
+ drawTitle = false
+ }
+ }
+ if (thisObject.configEditor !== undefined) {
+ if (thisObject.configEditor.visible === true) {
+ drawMenu = false
+ drawTitle = false
+ }
+ }
+ if (thisObject.conditionEditor !== undefined) {
+ if (thisObject.conditionEditor.visible === true) {
+ drawMenu = false
+ drawTitle = false
+ }
+ }
+ if (thisObject.formulaEditor !== undefined) {
+ if (thisObject.formulaEditor.visible === true) {
+ drawMenu = false
+ drawTitle = false
+ }
+ }
+
+ if (drawMenu === true) {
+ drawBodyAndPicture()
+ if (isDragging === false) {
+ thisObject.menu.drawBackground()
+ thisObject.menu.drawForeground()
+ }
+ }
+
+ drawErrorMessage()
+ drawValue()
+ drawPercentage()
+ drawStatus()
+ drawText()
+
+ if (drawTitle === true) {
+ thisObject.uiObjectTitle.draw()
+ }
+ }
+ }
+
+ function drawChainLine() {
+ if (canvas.floatingSpace.drawChainLines === false) { return }
+ if (thisObject.payload.chainParent === undefined) { return }
+
+ let targetPoint = {
+ x: thisObject.payload.chainParent.payload.floatingObject.container.frame.position.x,
+ y: thisObject.payload.chainParent.payload.floatingObject.container.frame.position.y
+ }
+
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ targetPoint = canvas.floatingSpace.container.frame.frameThisPoint(targetPoint)
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ targetPoint = canvas.floatingSpace.transformPointToMap(targetPoint)
+ position = canvas.floatingSpace.transformPointToMap(position)
+ }
+
+ if (thisObject.container.frame.radius > 1) {
+ let LINE_STYLE = UI_COLOR.TITANIUM_YELLOW
+ if (thisObject.payload.floatingObject.angleToParent !== ANGLE_TO_PARENT.NOT_FIXED) {
+ LINE_STYLE = UI_COLOR.GOLDEN_ORANGE
+ }
+ if (thisObject.payload.floatingObject.isFrozen === true) {
+ LINE_STYLE = UI_COLOR.TURQUOISE
+ }
+ if (newUiObjectCounter > 0) {
+ LINE_STYLE = UI_COLOR.GREY
+ }
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(position.x, position.y)
+ browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
+ browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
+ browserCanvasContext.setLineDash([0, chainLineCounter, 2, 3, 0, 500 - chainLineCounter])
+ browserCanvasContext.lineWidth = 2
+ browserCanvasContext.stroke()
+ browserCanvasContext.setLineDash([0, 0])
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(position.x, position.y)
+ browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
+ browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
+ browserCanvasContext.setLineDash([3, 47])
+ browserCanvasContext.lineWidth = 3
+ browserCanvasContext.stroke()
+ browserCanvasContext.setLineDash([0, 0])
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(position.x, position.y)
+ browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
+ browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
+ browserCanvasContext.setLineDash([1, 9])
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.stroke()
+ browserCanvasContext.setLineDash([0, 0])
+ }
+
+ if (thisObject.container.frame.radius > 0.5) {
+ let radius = 1
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(targetPoint.x, targetPoint.y, radius, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.fill()
+ }
+ }
+
+ function drawReferenceLine() {
+ if (canvas.floatingSpace.drawReferenceLines === false && thisObject.isOnFocus === false) { return }
+ if (thisObject.payload.referenceParent === undefined) { return }
+ if (thisObject.payload.referenceParent.payload === undefined) { return }
+ if (thisObject.payload.referenceParent.payload.floatingObject === undefined) { return }
+ if (thisObject.payload.referenceParent.payload.floatingObject.isParentCollapsed === true && thisObject.isOnFocus === false) { return }
+
+ let targetPoint = {
+ x: thisObject.payload.referenceParent.payload.position.x,
+ y: thisObject.payload.referenceParent.payload.position.y
+ }
+
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ targetPoint = canvas.floatingSpace.container.frame.frameThisPoint(targetPoint)
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (thisObject.isOnFocus === true) {
+ targetPoint = thisObject.fitFunction(targetPoint)
}
if (canvas.floatingSpace.inMapMode === true) {
- labelPoint.y = labelPoint.y - 20
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.isHierarchyHead !== true) {
- return
- }
- }
+ position = canvas.floatingSpace.transformPointToMap(position)
+ targetPoint = canvas.floatingSpace.transformPointToMap(targetPoint)
}
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
- }
- }
+ let LINE_STYLE = UI_COLOR.GREY
- function drawErrorMessage () {
- if (hasError === false) { return }
-
-/* Text Follows */
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (canvas.floatingSpace.inMapMode === true) {
- position = canvas.floatingSpace.transformPointToMap(position)
- }
-
- let radius = thisObject.container.frame.radius * 2.5
- /* Label Text */
- let labelPoint
- let fontSize = thisObject.payload.floatingObject.currentFontSize * 3 / 4
- let label
-
- if (radius > 6) {
- const MAX_LABEL_LENGTH = 80
-
- label = errorMessage
-
- if (label !== undefined) {
- if (label.length > MAX_LABEL_LENGTH) {
- label = label.substring(0, MAX_LABEL_LENGTH) + '...'
- }
-
- labelPoint = {
- x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
- y: position.y + radius * 2 / 5 + fontSize * FONT_ASPECT_RATIO + 15
- }
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
- }
- }
-
- function drawValue () {
- if (currentValue === null) { return }
- if (hasValue === false) { return }
- if (canvas.floatingSpace.inMapMode === true) { return }
- if (thisObject.payload === undefined) { return }
- if ((thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) || thisObject.payload.floatingObject.isParentCollapsed === true) { return }
-
- // if (currentValue === undefined || currentValue === '') { return }
-
-/* Text Follows */
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (canvas.floatingSpace.inMapMode === true) {
- position = canvas.floatingSpace.transformPointToMap(position)
- }
-
- let radius = thisObject.container.frame.radius * 1.35
- /* Label Text */
- let labelPoint
- let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4
- let label
-
- if (radius > 6) {
- const MAX_LABEL_LENGTH = 65
-
- label = currentValue
- if (!isNaN(currentValue)) {
- if (currentValue.toFixed !== undefined) {
- label = dynamicDecimals(currentValue)
- }
- }
-
- if (label !== undefined) {
- if (label.length > MAX_LABEL_LENGTH) {
- label = label.substring(0, MAX_LABEL_LENGTH) + '...'
- }
-
- if (label.length > 30) {
- fontSize = fontSize / 2
- }
-
- labelPoint = {
- x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
- y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
- }
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
- }
- }
-
- function drawPercentage () {
- if (hasPercentage === false) { return }
- if (canvas.floatingSpace.inMapMode === true) { return }
- if (thisObject.payload === undefined) { return }
- if ((thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) || thisObject.payload.floatingObject.isParentCollapsed === true) { return }
-
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (canvas.floatingSpace.inMapMode === true) {
- position = canvas.floatingSpace.transformPointToMap(position)
- }
-
- let radius = thisObject.container.frame.radius * 1.75
- /* Label Text */
- let labelPoint
- let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4
- let label
-
- if (radius > 6) {
- const MAX_LABEL_LENGTH = 65
-
- label = Number(currentPercentage).toFixed(0) + '%'
-
- if (label !== undefined) {
- if (label.length > MAX_LABEL_LENGTH) {
- label = label.substring(0, MAX_LABEL_LENGTH) + '...'
- }
-
- labelPoint = {
- x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
- y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
- }
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
- }
- }
-
- function drawStatus () {
- if (hasStatus === false) { return }
- if (canvas.floatingSpace.inMapMode === true) { return }
-
- let position = {
- x: 0,
- y: 0
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (canvas.floatingSpace.inMapMode === true) {
- position = canvas.floatingSpace.transformPointToMap(position)
- }
-
- let radius = thisObject.container.frame.radius * 0.9
- /* Label Text */
- let labelPoint
- let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4 / 2
- let label
-
- if (radius > 6) {
- const MAX_LABEL_LENGTH = 100
-
- label = currentStatus
-
- if (label !== undefined) {
- if (label.length > MAX_LABEL_LENGTH) {
- label = label.substring(0, MAX_LABEL_LENGTH) + '...'
- }
-
- labelPoint = {
- x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
- y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
- }
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
- }
- }
-
- function addIndexNumber (label) {
- switch (thisObject.payload.node.type) {
- case 'Phase': {
- let parent = thisObject.payload.parentNode
- if (parent !== undefined) {
- let granParent = parent.payload.parentNode
- if (granParent !== undefined) {
- if (granParent.type === 'Initial Definition') {
- return label + ' #' + 0
- }
- }
- for (let i = 0; i < parent.phases.length; i++) {
- let phase = parent.phases[i]
- if (phase.id === thisObject.payload.node.id) {
- label = label + ' #' + (i + 1)
- return label
- }
- }
- } else {
- return label
- }
-
- break
- }
- case 'Situation': {
- let parent = thisObject.payload.parentNode
- if (parent !== undefined) {
- for (let i = 0; i < parent.situations.length; i++) {
- let situation = parent.situations[i]
- if (situation.id === thisObject.payload.node.id) {
- label = label + ' #' + (i + 1)
- return label
- }
- }
- } else {
- return label
- }
-
- break
- }
- case 'Condition': {
- let parent = thisObject.payload.parentNode
- if (parent !== undefined) {
- for (let i = 0; i < parent.conditions.length; i++) {
- let condition = parent.conditions[i]
- if (condition.id === thisObject.payload.node.id) {
- label = label + ' #' + (i + 1)
- return label
- }
- }
- } else {
- return label
- }
-
- break
- }
- default: {
- return label
- }
- }
- }
-
- function drawBodyAndPicture () {
- let position = {
- x: thisObject.container.frame.position.x,
- y: thisObject.container.frame.position.y
- }
-
- position = thisObject.container.frame.frameThisPoint(position)
-
- if (thisObject.isShowing === true) {
- position = thisObject.fitFunction(position)
- }
-
- if (canvas.floatingSpace.inMapMode === true) {
- position = canvas.floatingSpace.transformPointToMap(position)
- }
-
- let radius = thisObject.container.frame.radius
-
- if (radius > 0.5) {
- let VISIBLE_RADIUS = 5
-
- let visiblePosition = {
- x: thisObject.container.frame.position.x,
- y: thisObject.container.frame.position.y
- }
-
- visiblePosition = thisObject.container.frame.frameThisPoint(visiblePosition)
-
- if (canvas.floatingSpace.inMapMode === true) {
- visiblePosition = canvas.floatingSpace.transformPointToMap(visiblePosition)
- radius = canvas.floatingSpace.transformRadiusToMap(radius)
- VISIBLE_RADIUS = canvas.floatingSpace.transformRadiusToMap(VISIBLE_RADIUS)
- } else {
- visiblePosition = thisObject.fitFunction(visiblePosition)
- }
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
-
- browserCanvasContext.fillStyle = thisObject.payload.floatingObject.fillStyle
-
- browserCanvasContext.fill()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS - 2, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
-
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 1)'
-
- browserCanvasContext.fill()
-
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.isHierarchyHead === true) {
- VISIBLE_RADIUS = thisObject.payload.floatingObject.currentHierarchyRing * 2.8
- if (canvas.floatingSpace.inMapMode === true) {
- VISIBLE_RADIUS = canvas.floatingSpace.transformRadiusToMap(VISIBLE_RADIUS)
- }
- let OPACITY = 1
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([4, 16])
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 1
- if (thisObject.payload.node.isIncluded === true) {
+ if (thisObject.container.frame.radius > 1) {
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(position.x, position.y)
+ browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
+ browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
+ browserCanvasContext.setLineDash([1, 9])
+ browserCanvasContext.lineWidth = 0.75
+ browserCanvasContext.stroke()
+ browserCanvasContext.setLineDash([0, 0])
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(position.x, position.y)
+ browserCanvasContext.lineTo(targetPoint.x, targetPoint.y)
+ browserCanvasContext.strokeStyle = 'rgba(' + LINE_STYLE + ', 1)'
+ browserCanvasContext.setLineDash([0, referenceLineCounter, 1, 9, 2, 8, 3, 7, 4, 6, 0, 500 - referenceLineCounter])
+ browserCanvasContext.lineWidth = 4
+ browserCanvasContext.stroke()
browserCanvasContext.setLineDash([0, 0])
- } else {
- browserCanvasContext.setLineDash([20, 20])
- }
- browserCanvasContext.stroke()
}
- }
- if (thisObject.isOnFocus === true) {
- VISIBLE_RADIUS = thisObject.container.frame.radius
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS - 2, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
+ if (thisObject.container.frame.radius > 0.5) {
+ let radius = 1
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 0.25)'
-
- browserCanvasContext.fill()
- }
-
- if (hasError === true) {
- VISIBLE_RADIUS = thisObject.container.frame.radius * 1
- let OPACITY = errorMessageCounter / 30
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RED + ', ' + OPACITY + ')'
-
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([19, 20])
- browserCanvasContext.stroke()
- }
-
- if (isHighlighted === true) {
- VISIBLE_RADIUS = thisObject.container.frame.radius * 1
- let OPACITY = highlightCounter / 10
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
-
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([4, 20])
- browserCanvasContext.stroke()
- }
-
- if (isReadyToChainAttach === true) {
- VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5 + readyToChainAttachDisplayCounter - readyToChainAttachDisplayCounter / 2
- let OPACITY = readyToChainAttachCounter / 10
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([10, 90])
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 5
- browserCanvasContext.setLineDash([5, 45])
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.setLineDash([2, 8])
- browserCanvasContext.stroke()
- }
-
- if (isAvailableToChainAttach === true && isReadyToChainAttach === false) {
- VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5
- let OPACITY = availableToChainAttachCounter / 10
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([8, 32])
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 2
- browserCanvasContext.setLineDash([3, 5])
- browserCanvasContext.stroke()
- }
-
- if (isReadyToReferenceAttach === true) {
- VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5 + readyToReferenceAttachDisplayCounter - readyToReferenceAttachDisplayCounter / 2
- let OPACITY = readyToReferenceAttachCounter / 10
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([10, 90])
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 5
- browserCanvasContext.setLineDash([5, 45])
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.setLineDash([2, 8])
- browserCanvasContext.stroke()
- }
-
- if (isAvailableToReferenceAttach === true && isReadyToReferenceAttach === false) {
- VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5
- let OPACITY = availableToReferenceAttachCounter / 10
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.setLineDash([8, 32])
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + OPACITY + ')'
- browserCanvasContext.lineWidth = 2
- browserCanvasContext.setLineDash([3, 5])
- browserCanvasContext.stroke()
- }
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(targetPoint.x, targetPoint.y, radius, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.fill()
+ }
}
+ function isEditorVisible() {
+ if (thisObject.codeEditor !== undefined) {
+ if (thisObject.codeEditor.visible === true) { return true }
+ }
+
+ if (thisObject.configEditor !== undefined) {
+ if (thisObject.configEditor.visible === true) { return true }
+ }
+
+ if (thisObject.conditionEditor !== undefined) {
+ if (thisObject.conditionEditor.visible === true) { return true }
+ }
+
+ if (thisObject.formulaEditor !== undefined) {
+ if (thisObject.formulaEditor.visible === true) { return true }
+ }
+ }
+
+ function drawText() {
+ if (isEditorVisible() === true) { return }
+ /* Text Follows */
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ position = canvas.floatingSpace.transformPointToMap(position)
+ }
+
+ let radius = thisObject.container.frame.radius
+ /* Label Text */
+ let labelPoint
+ let fontSize = thisObject.payload.floatingObject.currentFontSize
+ let label
+
+ if (radius > 6) {
+ const MAX_LABEL_LENGTH = 30
+
+ label = thisObject.payload.subTitle
+ label = addIndexNumber(label)
+
+ if (label !== undefined) {
+ if (label.length > MAX_LABEL_LENGTH) {
+ label = label.substring(0, MAX_LABEL_LENGTH) + '...'
+ }
+
+ labelPoint = {
+ x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
+ y: position.y + radius * 4 / 5 + fontSize * FONT_ASPECT_RATIO + 15
+ }
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ labelPoint.y = labelPoint.y - 20
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.isHierarchyHead !== true) {
+ return
+ }
+ }
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
+ }
+
+ function drawErrorMessage() {
+ if (hasError === false) { return }
+
+ /* Text Follows */
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ position = canvas.floatingSpace.transformPointToMap(position)
+ }
+
+ let radius = thisObject.container.frame.radius * 2.5
+ /* Label Text */
+ let labelPoint
+ let fontSize = thisObject.payload.floatingObject.currentFontSize * 3 / 4
+ let label
+
+ if (radius > 6) {
+ const MAX_LABEL_LENGTH = 80
+
+ label = errorMessage
+
+ if (label !== undefined) {
+ if (label.length > MAX_LABEL_LENGTH) {
+ label = label.substring(0, MAX_LABEL_LENGTH) + '...'
+ }
+
+ labelPoint = {
+ x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
+ y: position.y + radius * 2 / 5 + fontSize * FONT_ASPECT_RATIO + 15
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
+ }
+
+ function drawValue() {
+ if (currentValue === null) { return }
+ if (hasValue === false) { return }
+ if (canvas.floatingSpace.inMapMode === true) { return }
+ if (thisObject.payload === undefined) { return }
+ if ((thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) || thisObject.payload.floatingObject.isParentCollapsed === true) { return }
+
+ // if (currentValue === undefined || currentValue === '') { return }
+
+ /* Text Follows */
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ position = canvas.floatingSpace.transformPointToMap(position)
+ }
+
+ let radius = thisObject.container.frame.radius * 1.35
+ /* Label Text */
+ let labelPoint
+ let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4
+ let label
+
+ if (radius > 6) {
+ const MAX_LABEL_LENGTH = 65
+
+ label = currentValue
+ if (!isNaN(currentValue)) {
+ if (currentValue.toFixed !== undefined) {
+ label = dynamicDecimals(currentValue)
+ }
+ }
+
+ if (label !== undefined) {
+ if (label.length > MAX_LABEL_LENGTH) {
+ label = label.substring(0, MAX_LABEL_LENGTH) + '...'
+ }
+
+ if (label.length > 30) {
+ fontSize = fontSize / 2
+ }
+
+ labelPoint = {
+ x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
+ y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
+ }
+
+ function drawPercentage() {
+ if (hasPercentage === false) { return }
+ if (canvas.floatingSpace.inMapMode === true) { return }
+ if (thisObject.payload === undefined) { return }
+ if ((thisObject.payload.floatingObject.isCollapsed === true && thisObject.payload.floatingObject.collapsedManually === false) || thisObject.payload.floatingObject.isParentCollapsed === true) { return }
+
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ position = canvas.floatingSpace.transformPointToMap(position)
+ }
+
+ let radius = thisObject.container.frame.radius * 1.75
+ /* Label Text */
+ let labelPoint
+ let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4
+ let label
+
+ if (radius > 6) {
+ const MAX_LABEL_LENGTH = 65
+
+ label = Number(currentPercentage).toFixed(0) + '%'
+
+ if (label !== undefined) {
+ if (label.length > MAX_LABEL_LENGTH) {
+ label = label.substring(0, MAX_LABEL_LENGTH) + '...'
+ }
+
+ labelPoint = {
+ x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
+ y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
+ }
+
+ function drawStatus() {
+ if (hasStatus === false) { return }
+ if (canvas.floatingSpace.inMapMode === true) { return }
+
+ let position = {
+ x: 0,
+ y: 0
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ position = canvas.floatingSpace.transformPointToMap(position)
+ }
+
+ let radius = thisObject.container.frame.radius * 0.9
+ /* Label Text */
+ let labelPoint
+ let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4 / 2
+ let label
+
+ if (radius > 6) {
+ const MAX_LABEL_LENGTH = 100
+
+ label = currentStatus
+
+ if (label !== undefined) {
+ if (label.length > MAX_LABEL_LENGTH) {
+ label = label.substring(0, MAX_LABEL_LENGTH) + '...'
+ }
+
+ labelPoint = {
+ x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
+ y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+ }
+ }
+
+ function addIndexNumber(label) {
+ switch (thisObject.payload.node.type) {
+ case 'Phase': {
+ let parent = thisObject.payload.parentNode
+ if (parent !== undefined) {
+ let granParent = parent.payload.parentNode
+ if (granParent !== undefined) {
+ if (granParent.type === 'Initial Definition') {
+ return label + ' #' + 0
+ }
+ }
+ for (let i = 0; i < parent.phases.length; i++) {
+ let phase = parent.phases[i]
+ if (phase.id === thisObject.payload.node.id) {
+ label = label + ' #' + (i + 1)
+ return label
+ }
+ }
+ } else {
+ return label
+ }
+
+ break
+ }
+ case 'Situation': {
+ let parent = thisObject.payload.parentNode
+ if (parent !== undefined) {
+ for (let i = 0; i < parent.situations.length; i++) {
+ let situation = parent.situations[i]
+ if (situation.id === thisObject.payload.node.id) {
+ label = label + ' #' + (i + 1)
+ return label
+ }
+ }
+ } else {
+ return label
+ }
+
+ break
+ }
+ case 'Condition': {
+ let parent = thisObject.payload.parentNode
+ if (parent !== undefined) {
+ for (let i = 0; i < parent.conditions.length; i++) {
+ let condition = parent.conditions[i]
+ if (condition.id === thisObject.payload.node.id) {
+ label = label + ' #' + (i + 1)
+ return label
+ }
+ }
+ } else {
+ return label
+ }
+
+ break
+ }
+ default: {
+ return label
+ }
+ }
+ }
+
+ function drawBodyAndPicture() {
+ let position = {
+ x: thisObject.container.frame.position.x,
+ y: thisObject.container.frame.position.y
+ }
+
+ position = thisObject.container.frame.frameThisPoint(position)
+
+ if (thisObject.isShowing === true) {
+ position = thisObject.fitFunction(position)
+ }
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ position = canvas.floatingSpace.transformPointToMap(position)
+ }
+
+ let radius = thisObject.container.frame.radius
+
+ if (radius > 0.5) {
+ let VISIBLE_RADIUS = 5
+
+ let visiblePosition = {
+ x: thisObject.container.frame.position.x,
+ y: thisObject.container.frame.position.y
+ }
+
+ visiblePosition = thisObject.container.frame.frameThisPoint(visiblePosition)
+
+ if (canvas.floatingSpace.inMapMode === true) {
+ visiblePosition = canvas.floatingSpace.transformPointToMap(visiblePosition)
+ radius = canvas.floatingSpace.transformRadiusToMap(radius)
+ VISIBLE_RADIUS = canvas.floatingSpace.transformRadiusToMap(VISIBLE_RADIUS)
+ } else {
+ visiblePosition = thisObject.fitFunction(visiblePosition)
+ }
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.fillStyle = thisObject.payload.floatingObject.fillStyle
+
+ browserCanvasContext.fill()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS - 2, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 1)'
+
+ browserCanvasContext.fill()
+
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.isHierarchyHead === true) {
+ VISIBLE_RADIUS = thisObject.payload.floatingObject.currentHierarchyRing * 2.8
+ if (canvas.floatingSpace.inMapMode === true) {
+ VISIBLE_RADIUS = canvas.floatingSpace.transformRadiusToMap(VISIBLE_RADIUS)
+ }
+ let OPACITY = 1
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([4, 16])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 1
+ if (thisObject.payload.node.isIncluded === true) {
+ browserCanvasContext.setLineDash([0, 0])
+ } else {
+ browserCanvasContext.setLineDash([20, 20])
+ }
+ browserCanvasContext.stroke()
+ }
+ }
+
+ if (thisObject.isOnFocus === true) {
+ VISIBLE_RADIUS = thisObject.container.frame.radius
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS - 2, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 0.25)'
+
+ browserCanvasContext.fill()
+ }
+
+ if (hasError === true) {
+ VISIBLE_RADIUS = thisObject.container.frame.radius * 1
+ let OPACITY = errorMessageCounter / 30
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.RED + ', ' + OPACITY + ')'
+
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([19, 20])
+ browserCanvasContext.stroke()
+ }
+
+ if (isHighlighted === true) {
+ VISIBLE_RADIUS = thisObject.container.frame.radius * 1
+ let OPACITY = highlightCounter / 10
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([4, 20])
+ browserCanvasContext.stroke()
+ }
+
+ if (isReadyToChainAttach === true) {
+ VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5 + readyToChainAttachDisplayCounter - readyToChainAttachDisplayCounter / 2
+ let OPACITY = readyToChainAttachCounter / 10
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([10, 90])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 5
+ browserCanvasContext.setLineDash([5, 45])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.setLineDash([2, 8])
+ browserCanvasContext.stroke()
+ }
+
+ if (isAvailableToChainAttach === true && isReadyToChainAttach === false) {
+ VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5
+ let OPACITY = availableToChainAttachCounter / 10
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([8, 32])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 2
+ browserCanvasContext.setLineDash([3, 5])
+ browserCanvasContext.stroke()
+ }
+
+ if (isReadyToReferenceAttach === true) {
+ VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5 + readyToReferenceAttachDisplayCounter - readyToReferenceAttachDisplayCounter / 2
+ let OPACITY = readyToReferenceAttachCounter / 10
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([10, 90])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 5
+ browserCanvasContext.setLineDash([5, 45])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GOLDEN_ORANGE + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.setLineDash([2, 8])
+ browserCanvasContext.stroke()
+ }
+
+ if (isAvailableToReferenceAttach === true && isReadyToReferenceAttach === false) {
+ VISIBLE_RADIUS = thisObject.container.frame.radius * 2.5
+ let OPACITY = availableToReferenceAttachCounter / 10
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.setLineDash([8, 32])
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + OPACITY + ')'
+ browserCanvasContext.lineWidth = 2
+ browserCanvasContext.setLineDash([3, 5])
+ browserCanvasContext.stroke()
+ }
+ }
+
/* Image */
- if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- let additionalImageSize = 0
- if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 }
- let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize
- 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 (icon !== undefined) {
+ if (icon.canDrawIcon === true) {
+ let additionalImageSize = 0
+ if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 }
+ let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize
+ 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 (thisObject.isShowing === true) {
+ totalImageSize = 50
+ }
+
+ browserCanvasContext.drawImage(
+ icon, position.x - totalImageSize / 2,
+ position.y - totalImageSize / 2,
+ totalImageSize,
+ totalImageSize)
}
- }
}
- if (thisObject.isShowing === true) {
- totalImageSize = 50
- }
+ if (executingIcon !== undefined) {
+ if (executingIcon.canDrawIcon === true) {
+ if (isRunningAtBackend === true) {
+ const DISTANCE_FROM_CENTER = thisObject.container.frame.radius / 3 + 50
+ const EXECUTING_ICON_SIZE = 20 + thisObject.container.frame.radius / 6
- browserCanvasContext.drawImage(
- icon, position.x - totalImageSize / 2,
- position.y - totalImageSize / 2,
- totalImageSize,
- totalImageSize)
- }
+ browserCanvasContext.drawImage(
+ executingIcon, position.x - EXECUTING_ICON_SIZE / 2,
+ position.y - EXECUTING_ICON_SIZE / 2 - DISTANCE_FROM_CENTER,
+ EXECUTING_ICON_SIZE,
+ EXECUTING_ICON_SIZE)
+ }
+ }
+ }
}
-
- if (executingIcon !== undefined) {
- if (executingIcon.canDrawIcon === true) {
- if (isRunningAtBackend === true) {
- const DISTANCE_FROM_CENTER = thisObject.container.frame.radius / 3 + 50
- const EXECUTING_ICON_SIZE = 20 + thisObject.container.frame.radius / 6
-
- browserCanvasContext.drawImage(
- executingIcon, position.x - EXECUTING_ICON_SIZE / 2,
- position.y - EXECUTING_ICON_SIZE / 2 - DISTANCE_FROM_CENTER,
- EXECUTING_ICON_SIZE,
- EXECUTING_ICON_SIZE)
- }
- }
- }
- }
}
diff --git a/CanvasApp/FloatingSpace/UiObjectConstructor.js b/CanvasApp/FloatingSpace/UiObjectConstructor.js
index 1c17ca23c..83c151737 100644
--- a/CanvasApp/FloatingSpace/UiObjectConstructor.js
+++ b/CanvasApp/FloatingSpace/UiObjectConstructor.js
@@ -1,654 +1,654 @@
-function newUiObjectConstructor () {
- const MODULE_NAME = 'UI Object Constructor'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newUiObjectConstructor() {
+ const MODULE_NAME = 'UI Object Constructor'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- createUiObject: createUiObject,
- destroyUiObject: destroyUiObject,
- initialize: initialize,
- finalize: finalize
- }
-
- let floatingLayer
-
- return thisObject
-
- function finalize () {
- floatingLayer = undefined
- }
-
- function initialize (pFloatingLayer) {
- floatingLayer = pFloatingLayer
- }
-
- function createUiObject (userAddingNew, payload) {
- let floatingObject = newFloatingObject()
- floatingObject.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
- floatingObject.container.connectToParent(canvas.floatingSpace.container, false, false, false, false, false, false, false, false)
- floatingObject.initialize('UI Object', payload)
- payload.floatingObject = floatingObject
-
- /*
- When this object is created based on a backup, share or clone, we will have a savedPayload that we will use to set the initial properties.
- If it is a new object being created out of the user interface, we jusst continue with the construction process.
- */
- if (userAddingNew === false && payload.node.type !== 'Workspace') {
- let position = {
- x: 0,
- y: 0
- }
-
- position = {
- x: payload.node.savedPayload.position.x,
- y: payload.node.savedPayload.position.y
- }
-
- floatingObject.setPosition(position)
- payload.node.savedPayload.position = undefined
- if (payload.node.savedPayload.floatingObject.isPinned === true) {
- floatingObject.pinToggle()
- }
- if (payload.node.savedPayload.floatingObject.isFrozen === true) {
- floatingObject.freezeToggle()
- }
- if (payload.node.savedPayload.floatingObject.isCollapsed === true) {
- floatingObject.collapseToggle()
- }
- if (payload.node.savedPayload.floatingObject.angleToParent !== undefined) {
- floatingObject.angleToParent = payload.node.savedPayload.floatingObject.angleToParent
- }
- if (payload.node.savedPayload.floatingObject.distanceToParent !== undefined) {
- floatingObject.distanceToParent = payload.node.savedPayload.floatingObject.distanceToParent
- }
- if (payload.node.savedPayload.floatingObject.arrangementStyle !== undefined) {
- floatingObject.arrangementStyle = payload.node.savedPayload.floatingObject.arrangementStyle
- }
+ let thisObject = {
+ createUiObject: createUiObject,
+ destroyUiObject: destroyUiObject,
+ initialize: initialize,
+ finalize: finalize
}
- /*
- For brand new objects being created directly by the user, we will make them inherit some properties
- from their closest siblings, and if they don't have, from their parents.
- */
+ let floatingLayer
- if (userAddingNew === true) {
- let definition = getNodeDefinition(payload.parentNode)
- if (definition.properties !== undefined) {
- for (let i = 0; i < definition.properties.length; i++) {
- let property = definition.properties[i]
- if (property.childType === payload.node.type) {
- if (property.type === 'array') {
- let parentNode = payload.parentNode
- let parentNodeArray = parentNode[property.name]
- if (parentNodeArray.length > 1) { // the new node was already added
- let closestSibling = parentNodeArray[parentNodeArray.length - 2]
- if (closestSibling !== undefined) {
- floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
- floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
- floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
- break
- }
- }
+ return thisObject
+
+ function finalize() {
+ floatingLayer = undefined
+ }
+
+ function initialize(pFloatingLayer) {
+ floatingLayer = pFloatingLayer
+ }
+
+ function createUiObject(userAddingNew, payload) {
+ let floatingObject = newFloatingObject()
+ floatingObject.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
+ floatingObject.container.connectToParent(canvas.floatingSpace.container, false, false, false, false, false, false, false, false)
+ floatingObject.initialize('UI Object', payload)
+ payload.floatingObject = floatingObject
+
+ /*
+ When this object is created based on a backup, share or clone, we will have a savedPayload that we will use to set the initial properties.
+ If it is a new object being created out of the user interface, we jusst continue with the construction process.
+ */
+ if (userAddingNew === false && payload.node.type !== 'Workspace') {
+ let position = {
+ x: 0,
+ y: 0
}
+
+ position = {
+ x: payload.node.savedPayload.position.x,
+ y: payload.node.savedPayload.position.y
+ }
+
+ floatingObject.setPosition(position)
+ payload.node.savedPayload.position = undefined
+ if (payload.node.savedPayload.floatingObject.isPinned === true) {
+ floatingObject.pinToggle()
+ }
+ if (payload.node.savedPayload.floatingObject.isFrozen === true) {
+ floatingObject.freezeToggle()
+ }
+ if (payload.node.savedPayload.floatingObject.isCollapsed === true) {
+ floatingObject.collapseToggle()
+ }
+ if (payload.node.savedPayload.floatingObject.angleToParent !== undefined) {
+ floatingObject.angleToParent = payload.node.savedPayload.floatingObject.angleToParent
+ }
+ if (payload.node.savedPayload.floatingObject.distanceToParent !== undefined) {
+ floatingObject.distanceToParent = payload.node.savedPayload.floatingObject.distanceToParent
+ }
+ if (payload.node.savedPayload.floatingObject.arrangementStyle !== undefined) {
+ floatingObject.arrangementStyle = payload.node.savedPayload.floatingObject.arrangementStyle
+ }
+ }
+
+ /*
+ For brand new objects being created directly by the user, we will make them inherit some properties
+ from their closest siblings, and if they don't have, from their parents.
+ */
+
+ if (userAddingNew === true) {
+ let definition = getNodeDefinition(payload.parentNode)
+ if (definition.properties !== undefined) {
+ for (let i = 0; i < definition.properties.length; i++) {
+ let property = definition.properties[i]
+ if (property.childType === payload.node.type) {
+ if (property.type === 'array') {
+ let parentNode = payload.parentNode
+ let parentNodeArray = parentNode[property.name]
+ if (parentNodeArray.length > 1) { // the new node was already added
+ let closestSibling = parentNodeArray[parentNodeArray.length - 2]
+ if (closestSibling !== undefined) {
+ floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
+ floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
+ floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
+ break
+ }
+ }
+ }
+ if (floatingObject.angleToParent === undefined) {
+ for (let j = i - 1; j >= 0; j--) {
+ let siblingProperty = definition.properties[j]
+ let parentNode = payload.parentNode
+ let parentNodeProperty = parentNode[siblingProperty.name]
+ if (parentNodeProperty !== undefined) {
+ if (siblingProperty.type === 'array') {
+ if (parentNodeProperty.length > 0) {
+ let closestSibling = parentNodeProperty[parentNodeProperty.length - 1]
+ if (closestSibling !== undefined) {
+ floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
+ floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
+ floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
+ break
+ }
+ }
+ } else {
+ let closestSibling = parentNodeProperty
+ if (closestSibling !== undefined) {
+ floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
+ floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
+ floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
+ break
+ }
+ }
+ }
+ }
+ for (let j = i + 1; j < definition.properties.length; j++) {
+ let siblingProperty = definition.properties[j]
+ let parentNode = payload.parentNode
+ let parentNodeProperty = parentNode[siblingProperty.name]
+ if (parentNodeProperty !== undefined) {
+ if (siblingProperty.type === 'array') {
+ if (parentNodeProperty.length > 0) {
+ let closestSibling = parentNodeProperty[parentNodeProperty.length - 1]
+ if (closestSibling !== undefined) {
+ floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
+ floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
+ floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
+ break
+ }
+ }
+ } else {
+ let closestSibling = parentNodeProperty
+ if (closestSibling !== undefined) {
+ floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
+ floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
+ floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
+ break
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
if (floatingObject.angleToParent === undefined) {
- for (let j = i - 1; j >= 0; j--) {
- let siblingProperty = definition.properties[j]
- let parentNode = payload.parentNode
- let parentNodeProperty = parentNode[siblingProperty.name]
- if (parentNodeProperty !== undefined) {
- if (siblingProperty.type === 'array') {
- if (parentNodeProperty.length > 0) {
- let closestSibling = parentNodeProperty[parentNodeProperty.length - 1]
- if (closestSibling !== undefined) {
- floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
- floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
- floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
- break
- }
+ floatingObject.angleToParent = payload.parentNode.payload.floatingObject.angleToParent
+ floatingObject.distanceToParent = payload.parentNode.payload.floatingObject.distanceToParent
+ floatingObject.arrangementStyle = payload.parentNode.payload.floatingObject.arrangementStyle
+ }
+ }
+
+ /* Default Values in case there was no way to set a value previous to this. */
+ if (floatingObject.angleToParent === undefined) {
+ floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_360
+ }
+ if (floatingObject.distanceToParent === undefined) {
+ floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
+ }
+ if (floatingObject.arrangementStyle === undefined) {
+ floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
+ }
+
+ let uiObject = newUiObject()
+ payload.uiObject = uiObject
+ uiObject.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
+ uiObject.isVisibleFunction = canvas.floatingSpace.isThisPointVisible
+ let menuItemsInitialValues = getMenuItemsInitialValues(uiObject, floatingObject, payload)
+
+ for (let i = 0; i < APP_SCHEMA_ARRAY.length; i++) {
+ let schemaNode = APP_SCHEMA_ARRAY[i]
+ if (schemaNode.type === payload.node.type) {
+ let menuItems = schemaNode.menuItems
+ for (let j = 0; j < menuItems.length; j++) {
+ let item = menuItems[j]
+ item.angle = undefined
+ if (item.action.indexOf('Add Missing Children') >= 0) {
+ item.action = 'Add Missing Children'
}
- } else {
- let closestSibling = parentNodeProperty
- if (closestSibling !== undefined) {
- floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
- floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
- floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
- break
+ if (item.action.indexOf('Delete ') >= 0) {
+ // item.action = 'Delete UI Object'
+ }
+ if (item.action.indexOf('Configure ') >= 0) {
+ if (schemaNode.editors.config === true) {
+ // item.actionFunction = 'uiObject.configEditor.activate'
+ }
+ }
+ if (item.action.indexOf('Edit ') >= 0) {
+ if (schemaNode.editors.code === true) {
+ // item.actionFunction = 'uiObject.codeEditor.activate'
+ }
+ }
+ if (item.actionFunction === undefined) {
+ // item.actionFunction = 'payload.onMenuItemClick'
}
- }
}
- }
- for (let j = i + 1; j < definition.properties.length; j++) {
- let siblingProperty = definition.properties[j]
- let parentNode = payload.parentNode
- let parentNodeProperty = parentNode[siblingProperty.name]
- if (parentNodeProperty !== undefined) {
- if (siblingProperty.type === 'array') {
- if (parentNodeProperty.length > 0) {
- let closestSibling = parentNodeProperty[parentNodeProperty.length - 1]
- if (closestSibling !== undefined) {
- floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
- floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
- floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
- break
- }
- }
- } else {
- let closestSibling = parentNodeProperty
- if (closestSibling !== undefined) {
- floatingObject.angleToParent = closestSibling.payload.floatingObject.angleToParent
- floatingObject.distanceToParent = closestSibling.payload.floatingObject.distanceToParent
- floatingObject.arrangementStyle = closestSibling.payload.floatingObject.arrangementStyle
- break
- }
- }
+ }
+ }
+
+ uiObject.initialize(payload, menuItemsInitialValues)
+ uiObject.container.connectToParent(floatingObject.container, false, false, true, true, false, false, true, true, true, true, true)
+
+ setFloatingObjectBasicProperties(floatingObject, payload)
+
+ if (payload.node.savedPayload !== undefined) {
+ if (payload.node.savedPayload.uiObject !== undefined) {
+ payload.uiObject.shortcutKey = payload.node.savedPayload.uiObject.shortcutKey
+ }
+ }
+
+ floatingLayer.addFloatingObject(floatingObject)
+
+ return
+ }
+
+ function addLeftIcons(menuItemsInitialValues, floatingObject, isPersonalData) {
+ menuItemsInitialValues.push(
+ {
+ action: 'Pin / Unpin',
+ actionFunction: floatingObject.pinToggle,
+ actionStatus: floatingObject.getPinStatus,
+ currentStatus: false,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'menu-fix-pinned',
+ iconPathOff: 'menu-fix-unpinned',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 1
+ }
+ )
+ menuItemsInitialValues.push(
+ {
+ action: 'Change Tension Level',
+ actionFunction: floatingObject.angleToParentToggle,
+ actionStatus: floatingObject.getAngleToParent,
+ currentStatus: true,
+ label: undefined,
+ visible: true,
+ icons: ['angle-to-parent-000', 'angle-to-parent-360', 'angle-to-parent-180', 'angle-to-parent-090', 'angle-to-parent-045'],
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 1
+ }
+ )
+ menuItemsInitialValues.push(
+ {
+ action: 'Change Distance to Paarent',
+ actionFunction: floatingObject.distanceToParentToggle,
+ actionStatus: floatingObject.getDistanceToParent,
+ currentStatus: true,
+ label: undefined,
+ visible: true,
+ icons: ['distance-to-parent-000', 'distance-to-parent-025', 'distance-to-parent-050', 'distance-to-parent-100', 'distance-to-parent-150', 'distance-to-parent-200'],
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 1
+ }
+ )
+ menuItemsInitialValues.push(
+ {
+ action: 'Change Arrangement Style',
+ actionFunction: floatingObject.arrangementStyleToggle,
+ actionStatus: floatingObject.getArrangementStyle,
+ currentStatus: true,
+ label: undefined,
+ visible: true,
+ icons: ['arrangement-concave', 'arrangement-convex', 'arrangement-vertical-right', 'arrangement-vertical-left', 'arrangement-horizontal-bottom', 'arrangement-horizontal-top'],
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 1
+ }
+ )
+ menuItemsInitialValues.push(
+ {
+ action: 'Freeze / Unfreeze',
+ actionFunction: floatingObject.freezeToggle,
+ actionStatus: floatingObject.getFreezeStatus,
+ currentStatus: true,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'menu-mobility-unfreeze',
+ iconPathOff: 'menu-mobility-freeze',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 1
+ }
+ )
+ menuItemsInitialValues.push(
+ {
+ action: 'Collapse / Uncollapse',
+ actionFunction: floatingObject.collapseToggle,
+ actionStatus: floatingObject.getCollapseStatus,
+ currentStatus: false,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'menu-tree-plus',
+ iconPathOff: 'menu-tree-minus',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 1
+ }
+ )
+ menuItemsInitialValues.push(
+ {
+ action: 'Backup',
+ actionFunction: floatingObject.payload.onMenuItemClick,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'menu-backup',
+ iconPathOff: 'menu-backup',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 2
+ }
+ )
+ menuItemsInitialValues.push(
+ {
+ action: 'Clone',
+ actionFunction: floatingObject.payload.onMenuItemClick,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'clone',
+ iconPathOff: 'clone',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 2
+ }
+ )
+ if (isPersonalData !== true) {
+ menuItemsInitialValues.push(
+ {
+ action: 'Share',
+ actionFunction: floatingObject.payload.onMenuItemClick,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'menu-share',
+ iconPathOff: 'menu-share',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 2
}
- }
- }
- }
- }
- }
-
- if (floatingObject.angleToParent === undefined) {
- floatingObject.angleToParent = payload.parentNode.payload.floatingObject.angleToParent
- floatingObject.distanceToParent = payload.parentNode.payload.floatingObject.distanceToParent
- floatingObject.arrangementStyle = payload.parentNode.payload.floatingObject.arrangementStyle
- }
- }
-
- /* Default Values in case there was no way to set a value previous to this. */
- if (floatingObject.angleToParent === undefined) {
- floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_360
- }
- if (floatingObject.distanceToParent === undefined) {
- floatingObject.distanceToParent = DISTANCE_TO_PARENT.PARENT_100X
- }
- if (floatingObject.arrangementStyle === undefined) {
- floatingObject.arrangementStyle = ARRANGEMENT_STYLE.CONCAVE
- }
-
- let uiObject = newUiObject()
- payload.uiObject = uiObject
- uiObject.fitFunction = canvas.floatingSpace.fitIntoVisibleArea
- uiObject.isVisibleFunction = canvas.floatingSpace.isThisPointVisible
- let menuItemsInitialValues = getMenuItemsInitialValues(uiObject, floatingObject, payload)
-
- for (let i = 0; i < APP_SCHEMA_ARRAY.length; i++) {
- let schemaNode = APP_SCHEMA_ARRAY[i]
- if (schemaNode.type === payload.node.type) {
- let menuItems = schemaNode.menuItems
- for (let j = 0; j < menuItems.length; j++) {
- let item = menuItems[j]
- item.angle = undefined
- if (item.action.indexOf('Add Missing Children') >= 0) {
- item.action = 'Add Missing Children'
- }
- if (item.action.indexOf('Delete ') >= 0) {
- // item.action = 'Delete UI Object'
- }
- if (item.action.indexOf('Configure ') >= 0) {
- if (schemaNode.editors.config === true) {
- // item.actionFunction = 'uiObject.configEditor.activate'
- }
- }
- if (item.action.indexOf('Edit ') >= 0) {
- if (schemaNode.editors.code === true) {
- // item.actionFunction = 'uiObject.codeEditor.activate'
- }
- }
- if (item.actionFunction === undefined) {
- // item.actionFunction = 'payload.onMenuItemClick'
- }
- }
- }
- }
-
- uiObject.initialize(payload, menuItemsInitialValues)
- uiObject.container.connectToParent(floatingObject.container, false, false, true, true, false, false, true, true, true, true, true)
-
- setFloatingObjectBasicProperties(floatingObject, payload)
-
- if (payload.node.savedPayload !== undefined) {
- if (payload.node.savedPayload.uiObject !== undefined) {
- payload.uiObject.shortcutKey = payload.node.savedPayload.uiObject.shortcutKey
- }
- }
-
- floatingLayer.addFloatingObject(floatingObject)
-
- return
- }
-
- function addLeftIcons (menuItemsInitialValues, floatingObject, isPersonalData) {
- menuItemsInitialValues.push(
- {
- action: 'Pin / Unpin',
- actionFunction: floatingObject.pinToggle,
- actionStatus: floatingObject.getPinStatus,
- currentStatus: false,
- label: undefined,
- visible: true,
- iconPathOn: 'menu-fix-pinned',
- iconPathOff: 'menu-fix-unpinned',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 1
- }
- )
- menuItemsInitialValues.push(
- {
- action: 'Change Tension Level',
- actionFunction: floatingObject.angleToParentToggle,
- actionStatus: floatingObject.getAngleToParent,
- currentStatus: true,
- label: undefined,
- visible: true,
- icons: ['angle-to-parent-000', 'angle-to-parent-360', 'angle-to-parent-180', 'angle-to-parent-090', 'angle-to-parent-045'],
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 1
- }
- )
- menuItemsInitialValues.push(
- {
- action: 'Change Distance to Paarent',
- actionFunction: floatingObject.distanceToParentToggle,
- actionStatus: floatingObject.getDistanceToParent,
- currentStatus: true,
- label: undefined,
- visible: true,
- icons: ['distance-to-parent-000', 'distance-to-parent-025', 'distance-to-parent-050', 'distance-to-parent-100', 'distance-to-parent-150', 'distance-to-parent-200'],
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 1
- }
- )
- menuItemsInitialValues.push(
- {
- action: 'Change Arrangement Style',
- actionFunction: floatingObject.arrangementStyleToggle,
- actionStatus: floatingObject.getArrangementStyle,
- currentStatus: true,
- label: undefined,
- visible: true,
- icons: ['arrangement-concave', 'arrangement-convex', 'arrangement-vertical-right', 'arrangement-vertical-left', 'arrangement-horizontal-bottom', 'arrangement-horizontal-top'],
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 1
- }
)
- menuItemsInitialValues.push(
- {
- action: 'Freeze / Unfreeze',
- actionFunction: floatingObject.freezeToggle,
- actionStatus: floatingObject.getFreezeStatus,
- currentStatus: true,
- label: undefined,
- visible: true,
- iconPathOn: 'menu-mobility-unfreeze',
- iconPathOff: 'menu-mobility-freeze',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 1
- }
- )
- menuItemsInitialValues.push(
- {
- action: 'Collapse / Uncollapse',
- actionFunction: floatingObject.collapseToggle,
- actionStatus: floatingObject.getCollapseStatus,
- currentStatus: false,
- label: undefined,
- visible: true,
- iconPathOn: 'menu-tree-plus',
- iconPathOff: 'menu-tree-minus',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 1
- }
- )
- menuItemsInitialValues.push(
- {
- action: 'Backup',
- actionFunction: floatingObject.payload.onMenuItemClick,
- label: undefined,
- visible: true,
- iconPathOn: 'menu-backup',
- iconPathOff: 'menu-backup',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 2
- }
- )
- menuItemsInitialValues.push(
- {
- action: 'Clone',
- actionFunction: floatingObject.payload.onMenuItemClick,
- label: undefined,
- visible: true,
- iconPathOn: 'clone',
- iconPathOff: 'clone',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 2
- }
+ }
+ menuItemsInitialValues.push(
+ {
+ action: 'Remove Parent',
+ actionFunction: floatingObject.payload.onMenuItemClick,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'detach',
+ iconPathOff: 'detach',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 3
+ }
)
- if (isPersonalData !== true) {
- menuItemsInitialValues.push(
- {
- action: 'Share',
- actionFunction: floatingObject.payload.onMenuItemClick,
- label: undefined,
- visible: true,
- iconPathOn: 'menu-share',
- iconPathOff: 'menu-share',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 2
- }
- )
- }
- menuItemsInitialValues.push(
- {
- action: 'Remove Parent',
- actionFunction: floatingObject.payload.onMenuItemClick,
- label: undefined,
- visible: true,
- iconPathOn: 'detach',
- iconPathOff: 'detach',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 3
- }
+ menuItemsInitialValues.push(
+ {
+ action: 'Remove Reference',
+ actionFunction: floatingObject.payload.onMenuItemClick,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'delink',
+ iconPathOff: 'delink',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 3
+ }
)
- menuItemsInitialValues.push(
- {
- action: 'Remove Reference',
- actionFunction: floatingObject.payload.onMenuItemClick,
- label: undefined,
- visible: true,
- iconPathOn: 'delink',
- iconPathOff: 'delink',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 3
- }
- )
- menuItemsInitialValues.push(
- {
- action: 'Open Documentation',
- actionFunction: floatingObject.payload.onMenuItemClick,
- label: undefined,
- visible: true,
- iconPathOn: 'help',
- iconPathOff: 'help',
- rawRadius: 12,
- targetRadius: 0,
- currentRadius: 0,
- ring: 4
- }
- )
- }
-
- function getMenuItemsInitialValues (uiObject, floatingObject, payload) {
- let menuItemsInitialValues = []
-
- let nodeDefinition = getNodeDefinition(payload.node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.editors !== undefined) {
- if (nodeDefinition.editors.config === true) {
- uiObject.configEditor = newConfigEditor()
- uiObject.configEditor.isVisibleFunction = uiObject.isVisibleFunction
- uiObject.configEditor.container.connectToParent(uiObject.container, false, false, true, true, false, false, false, false)
- uiObject.configEditor.initialize()
- }
- if (nodeDefinition.editors.code === true) {
- uiObject.codeEditor = newCodeEditor()
- uiObject.codeEditor.isVisibleFunction = uiObject.isVisibleFunction
- uiObject.codeEditor.container.connectToParent(uiObject.container, false, false, true, true, false, false, false, false)
- uiObject.codeEditor.initialize()
- }
- if (nodeDefinition.editors.formula === true) {
- uiObject.formulaEditor = newFormulaEditor()
- uiObject.formulaEditor.isVisibleFunction = uiObject.isVisibleFunction
- uiObject.formulaEditor.container.connectToParent(uiObject.container, false, false, true, true, false, false, false, false)
- uiObject.formulaEditor.initialize()
- }
- if (nodeDefinition.editors.condition === true) {
- uiObject.conditionEditor = newConditionEditor()
- uiObject.conditionEditor.isVisibleFunction = uiObject.isVisibleFunction
- uiObject.conditionEditor.container.connectToParent(uiObject.container, false, false, false, true, false, false, false, false)
- uiObject.conditionEditor.initialize()
- }
- }
- if (nodeDefinition.addLeftIcons === true) {
- addLeftIcons(menuItemsInitialValues, floatingObject, nodeDefinition.isPersonalData)
- }
- if (nodeDefinition.isPinned === true) {
- floatingObject.isPinned = true
- }
- if (nodeDefinition.positionLocked === true) {
- floatingObject.positionLocked = true
- }
-
- for (let i = 0; i < nodeDefinition.menuItems.length; i++) {
- let menutItemDefinition = nodeDefinition.menuItems[i]
- let newMenuItem = JSON.parse(JSON.stringify(menutItemDefinition))
-
- /* We need to reference the real function based on its name */
- if (menutItemDefinition.actionFunction !== undefined) {
- try {
- newMenuItem.actionFunction = eval(menutItemDefinition.actionFunction)
- } catch (err) {
- console.log('Error at Menu Item Action Function: ' + menutItemDefinition.actionFunction + ' ' + err.stack)
- continue
- }
- }
-
- /* Adding default values */
- if (newMenuItem.visible === undefined) {
- newMenuItem.visible = true
- }
-
- if (newMenuItem.rawRadius === undefined) {
- newMenuItem.rawRadius = 12
- }
-
- if (newMenuItem.targetRadius === undefined) {
- newMenuItem.targetRadius = 0
- }
-
- if (newMenuItem.currentRadius === undefined) {
- newMenuItem.currentRadius = 0
- }
-
- menuItemsInitialValues.push(newMenuItem)
- }
- } else {
- if (ERROR_LOG === true) { logger.write('[ERROR] getMenuItemsInitialValues -> UI Object Type not Recognized -> type = ' + payload.node.type) }
+ menuItemsInitialValues.push(
+ {
+ action: 'Open Documentation',
+ actionFunction: floatingObject.payload.onMenuItemClick,
+ label: undefined,
+ visible: true,
+ iconPathOn: 'help',
+ iconPathOff: 'help',
+ rawRadius: 12,
+ targetRadius: 0,
+ currentRadius: 0,
+ ring: 4
+ }
+ )
}
- return menuItemsInitialValues
- }
+ function getMenuItemsInitialValues(uiObject, floatingObject, payload) {
+ let menuItemsInitialValues = []
- function setFloatingObjectBasicProperties (floatingObject, payload) {
- const FRICTION = 0.95
- const INITIAL_FRICTION = 0.97
- const INITIAL_FONT_SIZE = 12 * 1.5
- const INITIAL_RADIOUS = 45 * 1.5
- const INITIAL_IMAGE_SIZE = 80 * 1.2
- const INITIAL_HIERARCHY_RING = 20
-
- switch (payload.node.type) {
- case 'Workspace': {
- level_0()
- floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_360
- break
- }
-
- default: {
let nodeDefinition = getNodeDefinition(payload.node)
if (nodeDefinition !== undefined) {
- switch (nodeDefinition.level) {
- case 0: {
- level_0()
- break
+ if (nodeDefinition.editors !== undefined) {
+ if (nodeDefinition.editors.config === true) {
+ uiObject.configEditor = newConfigEditor()
+ uiObject.configEditor.isVisibleFunction = uiObject.isVisibleFunction
+ uiObject.configEditor.container.connectToParent(uiObject.container, false, false, true, true, false, false, false, false)
+ uiObject.configEditor.initialize()
+ }
+ if (nodeDefinition.editors.code === true) {
+ uiObject.codeEditor = newCodeEditor()
+ uiObject.codeEditor.isVisibleFunction = uiObject.isVisibleFunction
+ uiObject.codeEditor.container.connectToParent(uiObject.container, false, false, true, true, false, false, false, false)
+ uiObject.codeEditor.initialize()
+ }
+ if (nodeDefinition.editors.formula === true) {
+ uiObject.formulaEditor = newFormulaEditor()
+ uiObject.formulaEditor.isVisibleFunction = uiObject.isVisibleFunction
+ uiObject.formulaEditor.container.connectToParent(uiObject.container, false, false, true, true, false, false, false, false)
+ uiObject.formulaEditor.initialize()
+ }
+ if (nodeDefinition.editors.condition === true) {
+ uiObject.conditionEditor = newConditionEditor()
+ uiObject.conditionEditor.isVisibleFunction = uiObject.isVisibleFunction
+ uiObject.conditionEditor.container.connectToParent(uiObject.container, false, false, false, true, false, false, false, false)
+ uiObject.conditionEditor.initialize()
+ }
}
- case 1: {
- level_1()
- break
+ if (nodeDefinition.addLeftIcons === true) {
+ addLeftIcons(menuItemsInitialValues, floatingObject, nodeDefinition.isPersonalData)
}
- case 2: {
- level_2()
- break
+ if (nodeDefinition.isPinned === true) {
+ floatingObject.isPinned = true
}
- case 3: {
- level_3()
- break
+ if (nodeDefinition.positionLocked === true) {
+ floatingObject.positionLocked = true
}
- case 4: {
- level_4()
- break
+
+ for (let i = 0; i < nodeDefinition.menuItems.length; i++) {
+ let menutItemDefinition = nodeDefinition.menuItems[i]
+ let newMenuItem = JSON.parse(JSON.stringify(menutItemDefinition))
+
+ /* We need to reference the real function based on its name */
+ if (menutItemDefinition.actionFunction !== undefined) {
+ try {
+ newMenuItem.actionFunction = eval(menutItemDefinition.actionFunction)
+ } catch (err) {
+ console.log('Error at Menu Item Action Function: ' + menutItemDefinition.actionFunction + ' ' + err.stack)
+ continue
+ }
+ }
+
+ /* Adding default values */
+ if (newMenuItem.visible === undefined) {
+ newMenuItem.visible = true
+ }
+
+ if (newMenuItem.rawRadius === undefined) {
+ newMenuItem.rawRadius = 12
+ }
+
+ if (newMenuItem.targetRadius === undefined) {
+ newMenuItem.targetRadius = 0
+ }
+
+ if (newMenuItem.currentRadius === undefined) {
+ newMenuItem.currentRadius = 0
+ }
+
+ menuItemsInitialValues.push(newMenuItem)
}
- case 5: {
- level_5()
- break
- }
- }
+ } else {
+ if (ERROR_LOG === true) { logger.write('[ERROR] getMenuItemsInitialValues -> UI Object Type not Recognized -> type = ' + payload.node.type) }
}
- }
+
+ return menuItemsInitialValues
}
- function level_0 () {
- floatingObject.targetFriction = 0.93
- floatingObject.friction = INITIAL_FRICTION
+ function setFloatingObjectBasicProperties(floatingObject, payload) {
+ const FRICTION = 0.95
+ const INITIAL_FRICTION = 0.97
+ const INITIAL_FONT_SIZE = 12 * 1.5
+ const INITIAL_RADIOUS = 45 * 1.5
+ const INITIAL_IMAGE_SIZE = 80 * 1.2
+ const INITIAL_HIERARCHY_RING = 20
- floatingObject.initializeMass(500)
- floatingObject.initializeRadius(INITIAL_RADIOUS)
- floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
- floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE)
- floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+ switch (payload.node.type) {
+ case 'Workspace': {
+ level_0()
+ floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_360
+ break
+ }
- floatingObject.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- }
- function level_1 () {
- floatingObject.targetFriction = 0.94
- floatingObject.friction = INITIAL_FRICTION
+ default: {
+ let nodeDefinition = getNodeDefinition(payload.node)
+ if (nodeDefinition !== undefined) {
+ switch (nodeDefinition.level) {
+ case 0: {
+ level_0()
+ break
+ }
+ case 1: {
+ level_1()
+ break
+ }
+ case 2: {
+ level_2()
+ break
+ }
+ case 3: {
+ level_3()
+ break
+ }
+ case 4: {
+ level_4()
+ break
+ }
+ case 5: {
+ level_5()
+ break
+ }
+ }
+ }
+ }
+ }
- floatingObject.initializeMass(600)
- floatingObject.initializeRadius(INITIAL_RADIOUS)
- floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
- floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE)
- floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+ function level_0() {
+ floatingObject.targetFriction = 0.93
+ floatingObject.friction = INITIAL_FRICTION
- floatingObject.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ floatingObject.initializeMass(500)
+ floatingObject.initializeRadius(INITIAL_RADIOUS)
+ floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
+ floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE)
+ floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
- if (payload.node.savedPayload === undefined) {
- // floatingObject.angleToParentToggle()
- }
- }
- function level_2 () {
- floatingObject.targetFriction = FRICTION
- floatingObject.friction = INITIAL_FRICTION
+ floatingObject.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ }
+ function level_1() {
+ floatingObject.targetFriction = 0.94
+ floatingObject.friction = INITIAL_FRICTION
- floatingObject.initializeMass(300)
- floatingObject.initializeRadius(INITIAL_RADIOUS - 5)
- floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
- floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 10)
- floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+ floatingObject.initializeMass(600)
+ floatingObject.initializeRadius(INITIAL_RADIOUS)
+ floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
+ floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE)
+ floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
- floatingObject.fillStyle = 'rgba(' + UI_COLOR.GREEN + ', 1)'
+ floatingObject.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- if (payload.node.savedPayload === undefined) {
- // floatingObject.angleToParentToggle()
- }
- }
- function level_3 () {
- floatingObject.targetFriction = FRICTION
- floatingObject.friction = INITIAL_FRICTION
+ if (payload.node.savedPayload === undefined) {
+ // floatingObject.angleToParentToggle()
+ }
+ }
+ function level_2() {
+ floatingObject.targetFriction = FRICTION
+ floatingObject.friction = INITIAL_FRICTION
- floatingObject.initializeMass(150)
- floatingObject.initializeRadius(INITIAL_RADIOUS - 10)
- floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
- floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 20)
- floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+ floatingObject.initializeMass(300)
+ floatingObject.initializeRadius(INITIAL_RADIOUS - 5)
+ floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
+ floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 10)
+ floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
- floatingObject.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', 1)'
+ floatingObject.fillStyle = 'rgba(' + UI_COLOR.GREEN + ', 1)'
- if (payload.node.savedPayload === undefined) {
- // floatingObject.angleToParentToggle()
- }
- }
- function level_4 () {
- floatingObject.targetFriction = FRICTION
- floatingObject.friction = INITIAL_FRICTION
+ if (payload.node.savedPayload === undefined) {
+ // floatingObject.angleToParentToggle()
+ }
+ }
+ function level_3() {
+ floatingObject.targetFriction = FRICTION
+ floatingObject.friction = INITIAL_FRICTION
- floatingObject.initializeMass(75)
- floatingObject.initializeRadius(INITIAL_RADIOUS - 15)
- floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
- floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 30)
- floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+ floatingObject.initializeMass(150)
+ floatingObject.initializeRadius(INITIAL_RADIOUS - 10)
+ floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
+ floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 20)
+ floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
- floatingObject.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
+ floatingObject.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', 1)'
- if (payload.node.savedPayload === undefined) {
- // floatingObject.angleToParentToggle()
- }
- }
- function level_5 () {
- floatingObject.targetFriction = FRICTION
- floatingObject.friction = INITIAL_FRICTION
+ if (payload.node.savedPayload === undefined) {
+ // floatingObject.angleToParentToggle()
+ }
+ }
+ function level_4() {
+ floatingObject.targetFriction = FRICTION
+ floatingObject.friction = INITIAL_FRICTION
- floatingObject.initializeMass(50)
- floatingObject.initializeRadius(INITIAL_RADIOUS - 20)
- floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
- floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 40)
- floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+ floatingObject.initializeMass(75)
+ floatingObject.initializeRadius(INITIAL_RADIOUS - 15)
+ floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
+ floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 30)
+ floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
- floatingObject.fillStyle = 'rgba(' + UI_COLOR.RED + ', 1)'
- }
- function level_6 () {
- floatingObject.targetFriction = FRICTION
- floatingObject.friction = INITIAL_FRICTION
+ floatingObject.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
- floatingObject.initializeMass(25)
- floatingObject.initializeRadius(INITIAL_RADIOUS - 25)
- floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
- floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 50)
- floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+ if (payload.node.savedPayload === undefined) {
+ // floatingObject.angleToParentToggle()
+ }
+ }
+ function level_5() {
+ floatingObject.targetFriction = FRICTION
+ floatingObject.friction = INITIAL_FRICTION
- floatingObject.fillStyle = 'rgba(' + UI_COLOR.RED + ', 1)'
+ floatingObject.initializeMass(50)
+ floatingObject.initializeRadius(INITIAL_RADIOUS - 20)
+ floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
+ floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 40)
+ floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+
+ floatingObject.fillStyle = 'rgba(' + UI_COLOR.RED + ', 1)'
+ }
+ function level_6() {
+ floatingObject.targetFriction = FRICTION
+ floatingObject.friction = INITIAL_FRICTION
+
+ floatingObject.initializeMass(25)
+ floatingObject.initializeRadius(INITIAL_RADIOUS - 25)
+ floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
+ floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 50)
+ floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
+
+ floatingObject.fillStyle = 'rgba(' + UI_COLOR.RED + ', 1)'
+ }
+
+ floatingObject.labelStrokeStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
}
- floatingObject.labelStrokeStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- }
+ function destroyUiObject(payload) {
+ if (payload === undefined) { return }
+ floatingLayer.removeFloatingObject(payload.floatingObject.handle)
- function destroyUiObject (payload) {
- if (payload === undefined) { return }
- floatingLayer.removeFloatingObject(payload.floatingObject.handle)
+ payload.floatingObject.finalize()
+ payload.floatingObject = undefined
- payload.floatingObject.finalize()
- payload.floatingObject = undefined
+ payload.uiObject.finalize()
+ payload.uiObject = undefined
- payload.uiObject.finalize()
- payload.uiObject = undefined
-
- payload.referenceParent = undefined
- payload.parent = undefined
- payload.chainParent = undefined
- payload.node.savedPayload = undefined
- }
+ payload.referenceParent = undefined
+ payload.parent = undefined
+ payload.chainParent = undefined
+ payload.node.savedPayload = undefined
+ }
}
diff --git a/CanvasApp/FloatingSpace/UiObjectTitle.js b/CanvasApp/FloatingSpace/UiObjectTitle.js
index 2a6215ac5..2e387ef81 100644
--- a/CanvasApp/FloatingSpace/UiObjectTitle.js
+++ b/CanvasApp/FloatingSpace/UiObjectTitle.js
@@ -1,358 +1,358 @@
-function newUiObjectTitle () {
- const MODULE_NAME = 'UI Object Title'
- const ERROR_LOG = true
+function newUiObjectTitle() {
+ const MODULE_NAME = 'UI Object Title'
+ const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- fitFunction: undefined,
- isVisibleFunction: undefined,
- allwaysVisible: undefined,
- editMode: undefined,
- container: undefined,
- payload: undefined,
- isDefault: undefined,
- enterEditMode: enterEditMode,
- exitEditMode: exitEditMode,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
- thisObject.container.frame.radius = 0
-
- let selfFocusEventSubscriptionId
- let selfNotFocuskEventSubscriptionId
- let selfMouseClickEventSubscriptionId
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(selfFocusEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfNotFocuskEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.payload = undefined
- thisObject.isVisibleFunction = undefined
- thisObject.fitFunction = undefined
- }
-
- function initialize (payload) {
- thisObject.payload = payload
-
- thisObject.allwaysVisible = false // Default value
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.isTitleAllwaysVisible === true) {
- thisObject.allwaysVisible = true
- }
+ let thisObject = {
+ fitFunction: undefined,
+ isVisibleFunction: undefined,
+ allwaysVisible: undefined,
+ editMode: undefined,
+ container: undefined,
+ payload: undefined,
+ isDefault: undefined,
+ enterEditMode: enterEditMode,
+ exitEditMode: exitEditMode,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize
}
- selfFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onFocus', onFocus)
- selfNotFocuskEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onNotFocus', onNotFocus)
- selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.radius = 0
- function getContainer (point) {
- if (AT_FULL_SCREEN_MODE === true) { return } // Fullscreen mode does not allow INPUT elements
+ let selfFocusEventSubscriptionId
+ let selfNotFocuskEventSubscriptionId
+ let selfMouseClickEventSubscriptionId
- let container
+ return thisObject
- if (thisObject.editMode === true) {
- if (point.x === VERY_LARGE_NUMBER) {
- /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
- anyone can react. In our case, this object has an html input element that is not part of the canvas, so the event is
- triggered. We compensate recognizing this coordinate and returning our container. */
- return thisObject.container
- }
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(selfFocusEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfNotFocuskEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.payload = undefined
+ thisObject.isVisibleFunction = undefined
+ thisObject.fitFunction = undefined
}
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
- function physics () {
- inheritancePhysics()
- defaultPhysics()
- }
+ function initialize(payload) {
+ thisObject.payload = payload
- function defaultPhysics () {
- if (thisObject.payload.title !== 'New ' + thisObject.payload.node.type && thisObject.payload.title !== 'My ' + thisObject.payload.node.type) {
- thisObject.isDefault = false
- } else {
- thisObject.isDefault = true
- }
- }
-
- function inheritancePhysics () {
- if (thisObject.payload.title === undefined) { return }
-
- /* It is possible to override the default title by setting the APP SCHEMA property 'title' */
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition.title !== undefined) {
- thisObject.payload.title = ''
- thisObject.payload.node.name = ''
- let separator = ''
- for (let i = 0; i < nodeDefinition.title.length; i++) {
- let titleReference = nodeDefinition.title[i]
- switch (titleReference) {
- case 'Use Reference Parent': {
- let nodeToUse = thisObject.payload.node.payload.referenceParent
- 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
+ thisObject.allwaysVisible = false // Default value
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.isTitleAllwaysVisible === true) {
+ thisObject.allwaysVisible = true
}
- break
- }
- case 'Use Reference Grandparent': {
- let nodeToUse = thisObject.payload.node.payload.referenceParent
- if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
- nodeToUse = thisObject.payload.node.payload.referenceParent.payload.referenceParent
- if (nodeToUse !== undefined) {
- thisObject.payload.title = thisObject.payload.title + separator + nodeToUse.payload.title
- thisObject.payload.node.name = thisObject.payload.node.name + separator + nodeToUse.payload.node.name
- }
+ }
+
+ selfFocusEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onFocus', onFocus)
+ selfNotFocuskEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onNotFocus', onNotFocus)
+ selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ }
+
+ function getContainer(point) {
+ if (AT_FULL_SCREEN_MODE === true) { return } // Fullscreen mode does not allow INPUT elements
+
+ let container
+
+ if (thisObject.editMode === true) {
+ if (point.x === VERY_LARGE_NUMBER) {
+ /* The the mouse leaves the canvas, and event of mouse over with a ridiculous coordinate is triggered so that
+ anyone can react. In our case, this object has an html input element that is not part of the canvas, so the event is
+ triggered. We compensate recognizing this coordinate and returning our container. */
+ return thisObject.container
}
- break
- }
- case 'Use Reference 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) {
- thisObject.payload.title = thisObject.payload.title + separator + nodeToUse.payload.title
- thisObject.payload.node.name = thisObject.payload.node.name + separator + nodeToUse.payload.node.name
- }
- }
- 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
+ }
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
+
+ function physics() {
+ inheritancePhysics()
+ defaultPhysics()
+ }
+
+ function defaultPhysics() {
+ if (thisObject.payload.title !== 'New ' + thisObject.payload.node.type && thisObject.payload.title !== 'My ' + thisObject.payload.node.type) {
+ thisObject.isDefault = false
+ } else {
+ thisObject.isDefault = true
+ }
+ }
+
+ function inheritancePhysics() {
+ if (thisObject.payload.title === undefined) { return }
+
+ /* It is possible to override the default title by setting the APP SCHEMA property 'title' */
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition.title !== undefined) {
+ thisObject.payload.title = ''
+ thisObject.payload.node.name = ''
+ let separator = ''
+ for (let i = 0; i < nodeDefinition.title.length; i++) {
+ let titleReference = nodeDefinition.title[i]
+ switch (titleReference) {
+ case 'Use Reference Parent': {
+ let nodeToUse = thisObject.payload.node.payload.referenceParent
+ 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
+ }
+ case 'Use Reference Grandparent': {
+ let nodeToUse = thisObject.payload.node.payload.referenceParent
+ if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
+ nodeToUse = thisObject.payload.node.payload.referenceParent.payload.referenceParent
+ if (nodeToUse !== 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
+ }
+ case 'Use Reference 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) {
+ thisObject.payload.title = thisObject.payload.title + separator + nodeToUse.payload.title
+ thisObject.payload.node.name = thisObject.payload.node.name + separator + nodeToUse.payload.node.name
+ }
+ }
+ 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
+ }
+ 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)
+ let childNode = thisObject.payload.node[propertyName]
+ if (childNode === undefined) { break }
+ thisObject.payload.title = thisObject.payload.title + separator + childNode.name
+ thisObject.payload.node.name = thisObject.payload.node.name + separator + childNode.name
+ }
+ }
}
- }
+ separator = ' '
}
- 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
+ }
+
+ /* The name becomes the title. */
+ if (thisObject.payload.node.name !== undefined) {
+ thisObject.payload.title = thisObject.payload.node.name
+ }
+
+ let title = trimTitle(thisObject.payload.title)
+
+ /* Here we set the dimensions and position of this object */
+ const FRAME_HEIGHT = 25
+ const Y_OFFSET = -20
+ const FRAME_WIDTH = (title.length + 2) / 2 * thisObject.payload.floatingObject.currentFontSize * FONT_ASPECT_RATIO * 1.2 * 2
+ thisObject.container.frame.position.x = 0 - FRAME_WIDTH / 2
+ thisObject.container.frame.position.y = 0 - thisObject.container.frame.radius * 1 / 2 - thisObject.payload.floatingObject.currentFontSize * FONT_ASPECT_RATIO + Y_OFFSET - FRAME_HEIGHT
+
+ thisObject.container.frame.width = FRAME_WIDTH
+ thisObject.container.frame.height = FRAME_HEIGHT
+
+ if (thisObject.editMode === true) {
+ let inputPosition = {
+ x: 0,
+ y: 0 + CURRENT_TOP_MARGIN + Y_OFFSET
+ }
+
+ inputPosition = thisObject.container.frame.frameThisPoint(inputPosition)
+
+ if (inputPosition.y < CURRENT_TOP_MARGIN) { exitEditMode() }
+
+ let inputDiv = document.getElementById('inputDiv')
+ inputDiv.style = 'position:absolute; top:' + inputPosition.y + 'px; left:' + inputPosition.x + 'px; z-index:1; '
+ }
+ }
+
+ function onFocus() {
+ thisObject.isOnFocus = true
+ }
+
+ function onNotFocus() {
+ thisObject.isOnFocus = false
+ exitEditMode()
+ }
+
+ function onMouseClick(event) {
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition.title !== undefined) { return }
+
+ let checkPoint = {
+ x: 0,
+ y: 0
+ }
+ checkPoint = thisObject.container.frame.frameThisPoint(checkPoint)
+
+ if (thisObject.isVisibleFunction(checkPoint) === true) {
+ enterEditMode()
+ }
+ }
+
+ function exitEditMode() {
+ if (thisObject.editMode === true) {
+ thisObject.editMode = false
+ let input = document.getElementById('input')
+ input.style.display = 'none'
+ if (input.value.length > 2) {
+ thisObject.payload.title = input.value
+ thisObject.payload.node.name = input.value
+ }
+ }
+ let inputDiv = document.getElementById('inputDiv')
+ inputDiv.style = 'position:absolute; top:' + '-100' + 'px; left:' + '-100' + 'px; z-index:1; '
+ }
+
+ function enterEditMode() {
+ const WIDTH = thisObject.container.frame.width
+ const HEIGHT = thisObject.container.frame.height
+ let fontSize = thisObject.payload.floatingObject.currentFontSize
+
+ thisObject.editMode = true
+ let input = document.getElementById('input')
+ input.value = thisObject.payload.title
+
+ let backgroundColor = '0, 0, 0'
+ if (thisObject.payload.uiObject.codeEditor !== undefined) {
+ if (thisObject.payload.uiObject.codeEditor.visible === true) {
+ backgroundColor = '204, 88, 53'
+ }
+ }
+
+ input.style = 'resize: none; border: none; outline: none; box-shadow: none; overflow:hidden; font-family: Saira Condensed; font-size: ' + fontSize + 'px; background-color: rgb(' + backgroundColor + ');color:rgb(255, 255, 255); width: ' + WIDTH + 'px; height: ' + HEIGHT + 'px'
+ input.style.display = 'block'
+ input.focus()
+ }
+
+ function draw() {
+ if (thisObject.isOnFocus === true || thisObject.allwaysVisible === true || thisObject.isDefault === false) {
+ if (thisObject.payload.uiObject.codeEditor !== undefined) {
+ if (thisObject.payload.uiObject.codeEditor.visible !== true) {
+ drawTitleBackground()
}
- }
+ } else {
+ drawTitleBackground()
}
- break
- }
- default: {
- if (titleReference.indexOf('Use Child @') === 0) {
- let propertyName = titleReference.substring(titleReference.indexOf('@') + 1, titleReference.length)
- let childNode = thisObject.payload.node[propertyName]
- if (childNode === undefined) { break }
- thisObject.payload.title = thisObject.payload.title + separator + childNode.name
- thisObject.payload.node.name = thisObject.payload.node.name + separator + childNode.name
+
+ drawText()
+ }
+ }
+
+ function drawTitleBackground() {
+ if (thisObject.editMode !== true) {
+ let params = {
+ cornerRadius: 3,
+ lineWidth: 0.1,
+ container: thisObject.container,
+ borderColor: UI_COLOR.BLACK,
+ backgroundColor: UI_COLOR.BLACK,
+ castShadow: false,
+ opacity: 0.25
}
- }
+
+ roundedCornersBackground(params)
}
- separator = ' '
- }
}
- /* The name becomes the title. */
- if (thisObject.payload.node.name !== undefined) {
- thisObject.payload.title = thisObject.payload.node.name
- }
+ function drawText() {
+ if (thisObject.editMode !== true) {
+ let radius = thisObject.container.frame.radius
+ let labelPoint
+ let fontSize = thisObject.payload.floatingObject.currentFontSize
+ let label
- let title = trimTitle(thisObject.payload.title)
+ if (radius > 6 && (thisObject.isOnFocus === true || thisObject.allwaysVisible === true || thisObject.isDefault === false)) {
+ browserCanvasContext.strokeStyle = thisObject.payload.floatingObject.labelStrokeStyle
- /* Here we set the dimensions and position of this object */
- const FRAME_HEIGHT = 25
- const Y_OFFSET = -20
- const FRAME_WIDTH = (title.length + 2) / 2 * thisObject.payload.floatingObject.currentFontSize * FONT_ASPECT_RATIO * 1.2 * 2
- thisObject.container.frame.position.x = 0 - FRAME_WIDTH / 2
- thisObject.container.frame.position.y = 0 - thisObject.container.frame.radius * 1 / 2 - thisObject.payload.floatingObject.currentFontSize * FONT_ASPECT_RATIO + Y_OFFSET - FRAME_HEIGHT
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- thisObject.container.frame.width = FRAME_WIDTH
- thisObject.container.frame.height = FRAME_HEIGHT
+ label = thisObject.payload.title
- if (thisObject.editMode === true) {
- let inputPosition = {
- x: 0,
- y: 0 + CURRENT_TOP_MARGIN + Y_OFFSET
- }
+ if (label !== undefined) {
+ label = trimTitle(label)
- inputPosition = thisObject.container.frame.frameThisPoint(inputPosition)
+ labelPoint = {
+ x: 5,
+ y: thisObject.container.frame.height * 0.8
+ }
- if (inputPosition.y < CURRENT_TOP_MARGIN) { exitEditMode() }
+ labelPoint = thisObject.container.frame.frameThisPoint(labelPoint)
- let inputDiv = document.getElementById('inputDiv')
- inputDiv.style = 'position:absolute; top:' + inputPosition.y + 'px; left:' + inputPosition.x + 'px; z-index:1; '
- }
- }
+ if (canvas.floatingSpace.inMapMode === true) {
+ labelPoint = canvas.floatingSpace.transformPointToMap(labelPoint)
+ labelPoint.x = labelPoint.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO
+ labelPoint.y = labelPoint.y - 35
- function onFocus () {
- thisObject.isOnFocus = true
- }
+ let nodeDefinition = getNodeDefinition(thisObject.payload.node)
+ if (nodeDefinition !== undefined) {
+ if (nodeDefinition.isHierarchyHead !== true) {
+ return
+ }
+ }
+ }
- function onNotFocus () {
- thisObject.isOnFocus = false
- exitEditMode()
- }
-
- function onMouseClick (event) {
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition.title !== undefined) { return }
-
- let checkPoint = {
- x: 0,
- y: 0
- }
- checkPoint = thisObject.container.frame.frameThisPoint(checkPoint)
-
- if (thisObject.isVisibleFunction(checkPoint) === true) {
- enterEditMode()
- }
- }
-
- function exitEditMode () {
- if (thisObject.editMode === true) {
- thisObject.editMode = false
- let input = document.getElementById('input')
- input.style.display = 'none'
- if (input.value.length > 2) {
- thisObject.payload.title = input.value
- thisObject.payload.node.name = input.value
- }
- }
- let inputDiv = document.getElementById('inputDiv')
- inputDiv.style = 'position:absolute; top:' + '-100' + 'px; left:' + '-100' + 'px; z-index:1; '
- }
-
- function enterEditMode () {
- const WIDTH = thisObject.container.frame.width
- const HEIGHT = thisObject.container.frame.height
- let fontSize = thisObject.payload.floatingObject.currentFontSize
-
- thisObject.editMode = true
- let input = document.getElementById('input')
- input.value = thisObject.payload.title
-
- let backgroundColor = '0, 0, 0'
- if (thisObject.payload.uiObject.codeEditor !== undefined) {
- if (thisObject.payload.uiObject.codeEditor.visible === true) {
- backgroundColor = '204, 88, 53'
- }
- }
-
- input.style = 'resize: none; border: none; outline: none; box-shadow: none; overflow:hidden; font-family: Saira Condensed; font-size: ' + fontSize + 'px; background-color: rgb(' + backgroundColor + ');color:rgb(255, 255, 255); width: ' + WIDTH + 'px; height: ' + HEIGHT + 'px'
- input.style.display = 'block'
- input.focus()
- }
-
- function draw () {
- if (thisObject.isOnFocus === true || thisObject.allwaysVisible === true || thisObject.isDefault === false) {
- if (thisObject.payload.uiObject.codeEditor !== undefined) {
- if (thisObject.payload.uiObject.codeEditor.visible !== true) {
- drawTitleBackground()
- }
- } else {
- drawTitleBackground()
- }
-
- drawText()
- }
- }
-
- function drawTitleBackground () {
- if (thisObject.editMode !== true) {
- let params = {
- cornerRadius: 3,
- lineWidth: 0.1,
- container: thisObject.container,
- borderColor: UI_COLOR.BLACK,
- backgroundColor: UI_COLOR.BLACK,
- castShadow: false,
- opacity: 0.25
- }
-
- roundedCornersBackground(params)
- }
- }
-
- function drawText () {
- if (thisObject.editMode !== true) {
- let radius = thisObject.container.frame.radius
- let labelPoint
- let fontSize = thisObject.payload.floatingObject.currentFontSize
- let label
-
- if (radius > 6 && (thisObject.isOnFocus === true || thisObject.allwaysVisible === true || thisObject.isDefault === false)) {
- browserCanvasContext.strokeStyle = thisObject.payload.floatingObject.labelStrokeStyle
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
-
- label = thisObject.payload.title
-
- if (label !== undefined) {
- label = trimTitle(label)
-
- labelPoint = {
- x: 5,
- y: thisObject.container.frame.height * 0.8
- }
-
- labelPoint = thisObject.container.frame.frameThisPoint(labelPoint)
-
- if (canvas.floatingSpace.inMapMode === true) {
- labelPoint = canvas.floatingSpace.transformPointToMap(labelPoint)
- labelPoint.x = labelPoint.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO
- labelPoint.y = labelPoint.y - 35
-
- let nodeDefinition = getNodeDefinition(thisObject.payload.node)
- if (nodeDefinition !== undefined) {
- if (nodeDefinition.isHierarchyHead !== true) {
- return
- }
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
}
- }
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
- }
}
- }
- function trimTitle (title) {
- if (title === undefined) { return }
- const MAX_LABEL_LENGTH = 50
- if (title.length > MAX_LABEL_LENGTH) {
- title = title.substring(0, MAX_LABEL_LENGTH) + '...'
+ function trimTitle(title) {
+ if (title === undefined) { return }
+ const MAX_LABEL_LENGTH = 50
+ if (title.length > MAX_LABEL_LENGTH) {
+ title = title.substring(0, MAX_LABEL_LENGTH) + '...'
+ }
+ return title
}
- return title
- }
}
diff --git a/CanvasApp/Frame.js b/CanvasApp/Frame.js
index 7e27a2242..2f2405134 100644
--- a/CanvasApp/Frame.js
+++ b/CanvasApp/Frame.js
@@ -1,537 +1,537 @@
-function newFrame () {
- const PANEL_CORNERS_RADIUS = 5
- const TITLE_BAR_HEIGHT = 15 // this must be grater than radius
+function newFrame() {
+ const PANEL_CORNERS_RADIUS = 5
+ const TITLE_BAR_HEIGHT = 15 // this must be grater than radius
- let thisObject = {
- type: 'Rectangle',
- containerName: '', // This is for debugging purposes only.
- parentFrame: undefined, // Here we store the parent cointainer zoom object.
- radius: 0,
- offset: undefined,
- position: undefined,
- container: undefined,
- width: browserCanvas.width,
- height: browserCanvas.height,
- getBodyHeight: getBodyHeight,
- draw: draw,
- fitIntoFrame: fitIntoFrame,
- frameThisPoint: frameThisPoint, // This function changes the actual frame coordinate system to the screen coordinate system.
- unframeThisPoint: unframeThisPoint,
- isThisPointHere: isThisPointHere, // This function return true is the point received as parameter lives within this frame.
- isThisScreenPointHere: isThisScreenPointHere,
- isInViewPort: isInViewPort,
- isCenterInViewPort: isCenterInViewPort,
- initialize: initialize,
- finalize: finalize
- }
-
- return thisObject
-
- function finalize () {
- thisObject.parentFrame = undefined
- thisObject.position = undefined
- thisObject.offset = undefined
- }
-
- function initialize (pType) {
- if (pType !== undefined) { thisObject.type = pType }
-
- thisObject.position = {
- x: 0,
- y: 0
+ let thisObject = {
+ type: 'Rectangle',
+ containerName: '', // This is for debugging purposes only.
+ parentFrame: undefined, // Here we store the parent cointainer zoom object.
+ radius: 0,
+ offset: undefined,
+ position: undefined,
+ container: undefined,
+ width: browserCanvas.width,
+ height: browserCanvas.height,
+ getBodyHeight: getBodyHeight,
+ draw: draw,
+ fitIntoFrame: fitIntoFrame,
+ frameThisPoint: frameThisPoint, // This function changes the actual frame coordinate system to the screen coordinate system.
+ unframeThisPoint: unframeThisPoint,
+ isThisPointHere: isThisPointHere, // This function return true is the point received as parameter lives within this frame.
+ isThisScreenPointHere: isThisScreenPointHere,
+ isInViewPort: isInViewPort,
+ isCenterInViewPort: isCenterInViewPort,
+ initialize: initialize,
+ finalize: finalize
}
- thisObject.offset = {
- x: 0,
- y: 0
- }
- }
+ return thisObject
- function getBodyHeight () {
- return thisObject.height - TITLE_BAR_HEIGHT
- }
-
- function isInViewPort () {
- /* This function is usefull to know if the object who has this frame is currently appearing at least in part at the canvas.chartingSpace.viewport */
-
- point1 = {
- x: 0,
- y: 0
+ function finalize() {
+ thisObject.parentFrame = undefined
+ thisObject.position = undefined
+ thisObject.offset = undefined
}
- point3 = {
- x: thisObject.width,
- y: thisObject.height
+ function initialize(pType) {
+ if (pType !== undefined) { thisObject.type = pType }
+
+ thisObject.position = {
+ x: 0,
+ y: 0
+ }
+
+ thisObject.offset = {
+ x: 0,
+ y: 0
+ }
}
- /* Now the transformations. */
-
- point1 = transformThisPoint(point1, thisObject.container)
- point3 = transformThisPoint(point3, thisObject.container)
-
- if (point1.x < canvas.chartingSpace.viewport.visibleArea.topRight.x && point1.y < canvas.chartingSpace.viewport.visibleArea.bottomRight.y && point3.x > canvas.chartingSpace.viewport.visibleArea.bottomLeft.x && point3.y > canvas.chartingSpace.viewport.visibleArea.topLeft.y) {
- return true
- } else {
- return false
- }
- }
-
- function isCenterInViewPort () {
- /* This function is usefull to know if the object who has this frame is currently appearing at least in part at the canvas.chartingSpace.viewport */
-
- point1 = {
- x: thisObject.width * 40 / 100,
- y: thisObject.height * 40 / 100
+ function getBodyHeight() {
+ return thisObject.height - TITLE_BAR_HEIGHT
}
- point3 = {
- x: thisObject.width * 40 / 100,
- y: thisObject.height * 40 / 100
- }
+ function isInViewPort() {
+ /* This function is usefull to know if the object who has this frame is currently appearing at least in part at the canvas.chartingSpace.viewport */
+
+ point1 = {
+ x: 0,
+ y: 0
+ }
+
+ point3 = {
+ x: thisObject.width,
+ y: thisObject.height
+ }
/* Now the transformations. */
- point1 = transformThisPoint(point1, thisObject.container)
- point3 = transformThisPoint(point3, thisObject.container)
+ point1 = transformThisPoint(point1, thisObject.container)
+ point3 = transformThisPoint(point3, thisObject.container)
- if (point1.x < canvas.chartingSpace.viewport.visibleArea.topRight.x && point1.y < canvas.chartingSpace.viewport.visibleArea.bottomRight.y && point3.x > canvas.chartingSpace.viewport.visibleArea.bottomLeft.x && point3.y > canvas.chartingSpace.viewport.visibleArea.topLeft.y) {
- return true
- } else {
- return false
- }
- }
-
- function frameThisPoint (point) {
- /* We need not to modify the point received, so me make a copy of it. */
-
- let checkPoint = {
- x: point.x,
- y: point.y
+ if (point1.x < canvas.chartingSpace.viewport.visibleArea.topRight.x && point1.y < canvas.chartingSpace.viewport.visibleArea.bottomRight.y && point3.x > canvas.chartingSpace.viewport.visibleArea.bottomLeft.x && point3.y > canvas.chartingSpace.viewport.visibleArea.topLeft.y) {
+ return true
+ } else {
+ return false
+ }
}
- let parentPoint = {
- x: 0,
- y: 0
+ function isCenterInViewPort() {
+ /* This function is usefull to know if the object who has this frame is currently appearing at least in part at the canvas.chartingSpace.viewport */
+
+ point1 = {
+ x: thisObject.width * 40 / 100,
+ y: thisObject.height * 40 / 100
+ }
+
+ point3 = {
+ x: thisObject.width * 40 / 100,
+ y: thisObject.height * 40 / 100
+ }
+
+ /* Now the transformations. */
+
+ point1 = transformThisPoint(point1, thisObject.container)
+ point3 = transformThisPoint(point3, thisObject.container)
+
+ if (point1.x < canvas.chartingSpace.viewport.visibleArea.topRight.x && point1.y < canvas.chartingSpace.viewport.visibleArea.bottomRight.y && point3.x > canvas.chartingSpace.viewport.visibleArea.bottomLeft.x && point3.y > canvas.chartingSpace.viewport.visibleArea.topLeft.y) {
+ return true
+ } else {
+ return false
+ }
}
- let returnPoint = {
- x: 0,
- y: 0
+ function frameThisPoint(point) {
+ /* We need not to modify the point received, so me make a copy of it. */
+
+ let checkPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ let parentPoint = {
+ x: 0,
+ y: 0
+ }
+
+ let returnPoint = {
+ x: 0,
+ y: 0
+ }
+
+ if (thisObject.parentFrame !== undefined) {
+ parentPoint = thisObject.parentFrame.frameThisPoint(checkPoint)
+
+ returnPoint.x = parentPoint.x + thisObject.position.x + thisObject.offset.x
+ returnPoint.y = parentPoint.y + thisObject.position.y + thisObject.offset.y
+ } else {
+ returnPoint.x = checkPoint.x + thisObject.position.x + thisObject.offset.x
+ returnPoint.y = checkPoint.y + thisObject.position.y + thisObject.offset.y
+ }
+
+ return returnPoint
}
- if (thisObject.parentFrame !== undefined) {
- parentPoint = thisObject.parentFrame.frameThisPoint(checkPoint)
+ function unframeThisPoint(point) {
+ /* We need not to modify the point received, so me make a copy of it. */
- returnPoint.x = parentPoint.x + thisObject.position.x + thisObject.offset.x
- returnPoint.y = parentPoint.y + thisObject.position.y + thisObject.offset.y
- } else {
- returnPoint.x = checkPoint.x + thisObject.position.x + thisObject.offset.x
- returnPoint.y = checkPoint.y + thisObject.position.y + thisObject.offset.y
+ let checkPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ let parentPoint = {
+ x: 0,
+ y: 0
+ }
+
+ let returnPoint = {
+ x: 0,
+ y: 0
+ }
+
+ if (thisObject.parentFrame !== undefined) {
+ parentPoint = thisObject.parentFrame.unframeThisPoint(checkPoint)
+
+ returnPoint.x = parentPoint.x - thisObject.position.x
+ returnPoint.y = parentPoint.y - thisObject.position.y
+ } else {
+ returnPoint.x = checkPoint.x - thisObject.position.x
+ returnPoint.y = checkPoint.y - thisObject.position.y
+ }
+
+ return returnPoint
}
- return returnPoint
- }
-
- function unframeThisPoint (point) {
- /* We need not to modify the point received, so me make a copy of it. */
-
- let checkPoint = {
- x: point.x,
- y: point.y
- }
-
- let parentPoint = {
- x: 0,
- y: 0
- }
-
- let returnPoint = {
- x: 0,
- y: 0
- }
-
- if (thisObject.parentFrame !== undefined) {
- parentPoint = thisObject.parentFrame.unframeThisPoint(checkPoint)
-
- returnPoint.x = parentPoint.x - thisObject.position.x
- returnPoint.y = parentPoint.y - thisObject.position.y
- } else {
- returnPoint.x = checkPoint.x - thisObject.position.x
- returnPoint.y = checkPoint.y - thisObject.position.y
- }
-
- return returnPoint
- }
-
- function fitIntoFrame (point) {
+ function fitIntoFrame(point) {
/* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */
- if (point.x > thisObject.width) {
- point.x = thisObject.width
+ if (point.x > thisObject.width) {
+ point.x = thisObject.width
+ }
+
+ if (point.x < 0) {
+ point.x = 0
+ }
+
+ if (point.y > thisObject.height) {
+ point.y = thisObject.height
+ }
+
+ if (point.y < 0) {
+ point.y = 0
+ }
+
+ return point
}
- if (point.x < 0) {
- point.x = 0
+ function isThisPointHere(point, outsideViewPort, dontTransform, padding) {
+ // The second parameter is usefull when you want to check a point that you already know is outside the viewport.
+ // The padding is a distance to the borders of the container. Can be either negative (outside, to increase the cointainer size) or positive (inside to decrease the cointainer size)
+
+ if (padding === undefined) { padding = 0 }
+
+ /* We need not to modify the point received, so me make a copy of it. */
+ let checkPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ /* The point received is on the screen coordinates system, which already has zoom and displacement applied. We need to remove the zoom and displacement
+ in order to have the point on the containers coordinate system and be able to compare it with its dimmensions. */
+ if (dontTransform === false || dontTransform === undefined) {
+ if (outsideViewPort === true) {
+ checkPoint = thisObject.container.frame.unframeThisPoint(checkPoint)
+ } else {
+ checkPoint = unTransformThisPoint(checkPoint, thisObject.container)
+ }
+ }
+
+ /* Now we check if the resulting point is whin the current Frame. */
+ if (isNaN(checkPoint.x) || isNaN(checkPoint.y)) { return false }
+ if (thisObject.type === 'Circle') {
+ let distance = Math.sqrt(Math.pow(thisObject.position.x - checkPoint.x, 2) + Math.pow(thisObject.position.y - checkPoint.y, 2))
+
+ if (distance < thisObject.radius) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ if (thisObject.type === 'Rectangle') {
+ if (checkPoint.x < 0 + padding || checkPoint.y < 0 + padding || checkPoint.x > thisObject.width - padding || checkPoint.y > thisObject.height - padding) {
+ return false
+ } else {
+ return true
+ }
+ }
}
- if (point.y > thisObject.height) {
- point.y = thisObject.height
+ function isThisScreenPointHere(point) {
+ let checkPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ let thisPoint = {
+ x: thisObject.position.x,
+ y: thisObject.position.y
+ }
+
+ if (thisObject.parentFrame !== undefined) {
+ thisPoint = thisObject.parentFrame.frameThisPoint(thisPoint)
+ }
+
+ /* Now we check if the resulting point is whin the current Frame. */
+
+ if (thisObject.type === 'Circle') {
+ let distance = Math.sqrt(Math.pow(thisPoint.x - checkPoint.x, 2) + Math.pow(thisPoint.y - checkPoint.y, 2))
+
+ if (distance < thisObject.radius) {
+ return true
+ } else {
+ return false
+ }
+ }
+
+ if (thisObject.type === 'Rectangle') {
+ if (checkPoint.x < 0 || checkPoint.y < 0 || checkPoint.x > thisObject.width || checkPoint.y > thisObject.height) {
+ return false
+ } else {
+ return true
+ }
+ }
}
- if (point.y < 0) {
- point.y = 0
+ function draw(drawGrid, drawBorders, drawBackground, fitFunction, style) {
+ if (drawBorders === true) {
+ borders(fitFunction, style)
+ }
+
+ if (drawGrid === true) {
+ grid(fitFunction)
+ }
+
+ if (drawBackground === true) {
+ background(fitFunction)
+ }
}
- return point
- }
+ function background(fitFunction) {
+ let params = {
+ cornerRadius: 5,
+ lineWidth: 0.1,
+ opacity: 0.75,
+ container: thisObject.container,
+ borderColor: UI_COLOR.DARK,
+ backgroundColor: UI_COLOR.WHITE,
+ fitFunction: fitFunction
+ }
- function isThisPointHere (point, outsideViewPort, dontTransform, padding) {
- // The second parameter is usefull when you want to check a point that you already know is outside the viewport.
- // The padding is a distance to the borders of the container. Can be either negative (outside, to increase the cointainer size) or positive (inside to decrease the cointainer size)
+ roundedCornersBackground(params)
- if (padding === undefined) { padding = 0 }
-
- /* We need not to modify the point received, so me make a copy of it. */
- let checkPoint = {
- x: point.x,
- y: point.y
- }
-
- /* The point received is on the screen coordinates system, which already has zoom and displacement applied. We need to remove the zoom and displacement
- in order to have the point on the containers coordinate system and be able to compare it with its dimmensions. */
- if (dontTransform === false || dontTransform === undefined) {
- if (outsideViewPort === true) {
- checkPoint = thisObject.container.frame.unframeThisPoint(checkPoint)
- } else {
- checkPoint = unTransformThisPoint(checkPoint, thisObject.container)
- }
- }
-
- /* Now we check if the resulting point is whin the current Frame. */
- if (isNaN(checkPoint.x) || isNaN(checkPoint.y)) { return false }
- if (thisObject.type === 'Circle') {
- let distance = Math.sqrt(Math.pow(thisObject.position.x - checkPoint.x, 2) + Math.pow(thisObject.position.y - checkPoint.y, 2))
-
- if (distance < thisObject.radius) {
- return true
- } else {
- return false
- }
- }
-
- if (thisObject.type === 'Rectangle') {
- if (checkPoint.x < 0 + padding || checkPoint.y < 0 + padding || checkPoint.x > thisObject.width - padding || checkPoint.y > thisObject.height - padding) {
- return false
- } else {
- return true
- }
- }
- }
-
- function isThisScreenPointHere (point) {
- let checkPoint = {
- x: point.x,
- y: point.y
- }
-
- let thisPoint = {
- x: thisObject.position.x,
- y: thisObject.position.y
- }
-
- if (thisObject.parentFrame !== undefined) {
- thisPoint = thisObject.parentFrame.frameThisPoint(thisPoint)
- }
-
- /* Now we check if the resulting point is whin the current Frame. */
-
- if (thisObject.type === 'Circle') {
- let distance = Math.sqrt(Math.pow(thisPoint.x - checkPoint.x, 2) + Math.pow(thisPoint.y - checkPoint.y, 2))
-
- if (distance < thisObject.radius) {
- return true
- } else {
- return false
- }
- }
-
- if (thisObject.type === 'Rectangle') {
- if (checkPoint.x < 0 || checkPoint.y < 0 || checkPoint.x > thisObject.width || checkPoint.y > thisObject.height) {
- return false
- } else {
- return true
- }
- }
- }
-
- function draw (drawGrid, drawBorders, drawBackground, fitFunction, style) {
- if (drawBorders === true) {
- borders(fitFunction, style)
- }
-
- if (drawGrid === true) {
- grid(fitFunction)
- }
-
- if (drawBackground === true) {
- background(fitFunction)
- }
- }
-
- function background (fitFunction) {
- let params = {
- cornerRadius: 5,
- lineWidth: 0.1,
- opacity: 0.75,
- container: thisObject.container,
- borderColor: UI_COLOR.DARK,
- backgroundColor: UI_COLOR.WHITE,
- fitFunction: fitFunction
- }
-
- roundedCornersBackground(params)
-
- titleBarPoint1 = {
- x: 0,
- y: TITLE_BAR_HEIGHT
- }
-
- titleBarPoint2 = {
- x: thisObject.width,
- y: TITLE_BAR_HEIGHT
- }
-
- /* Now the transformations. */
-
- titleBarPoint1 = frameThisPoint(titleBarPoint1)
- titleBarPoint2 = frameThisPoint(titleBarPoint2)
-
- if (fitFunction !== undefined) {
- titleBarPoint1 = fitFunction(titleBarPoint1)
- titleBarPoint2 = fitFunction(titleBarPoint2)
- }
-
- /* We paint the title bar now */
-
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK + ', 1)'
- browserCanvasContext.beginPath()
-
- browserCanvasContext.moveTo(titleBarPoint1.x, titleBarPoint1.y)
- browserCanvasContext.lineTo(borderPoint1.x - PANEL_CORNERS_RADIUS, borderPoint1.y)
- browserCanvasContext.arc(borderPoint1.x, borderPoint1.y, PANEL_CORNERS_RADIUS, 1.0 * Math.PI, 1.5 * Math.PI)
- browserCanvasContext.lineTo(borderPoint2.x, borderPoint2.y - PANEL_CORNERS_RADIUS)
- browserCanvasContext.arc(borderPoint2.x, borderPoint2.y, PANEL_CORNERS_RADIUS, 1.5 * Math.PI, 2.0 * Math.PI)
- browserCanvasContext.lineTo(titleBarPoint2.x, titleBarPoint2.y)
-
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
-
- browserCanvasContext.lineWidth = 0.1
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.MANGANESE_PURPLE + ', 0.75)'
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.stroke()
-
- /* print the title */
-
- let labelPoint
- let fontSize = 10
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
-
- let label = thisObject.containerName
-
- let xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO
- let yOffset = (TITLE_BAR_HEIGHT - fontSize) / 2 + 2
-
- labelPoint = {
- x: thisObject.width / 2 - xOffset,
- y: TITLE_BAR_HEIGHT - yOffset
- }
-
- labelPoint = thisObject.frameThisPoint(labelPoint)
-
- if (fitFunction !== undefined) {
- labelPoint = fitFunction(labelPoint)
- }
-
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- }
-
- function borders (fitFunction, style) {
- /* Lest get the important points of the drawing so as to apply the needed transformations. */
-
- let point1
- let point2
- let point3
- let point4
-
- point1 = {
- x: 0,
- y: 0
- }
-
- point2 = {
- x: thisObject.width,
- y: 0
- }
-
- point3 = {
- x: thisObject.width,
- y: thisObject.height
- }
-
- point4 = {
- x: 0,
- y: thisObject.height
- }
-
- /* Now the transformations. */
- point1 = transformThisPoint(point1, thisObject.container)
- point2 = transformThisPoint(point2, thisObject.container)
- point3 = transformThisPoint(point3, thisObject.container)
- point4 = transformThisPoint(point4, thisObject.container)
-
- if (fitFunction !== undefined) {
- point1 = fitFunction(point1)
- point2 = fitFunction(point2)
- point3 = fitFunction(point3)
- point4 = fitFunction(point4)
- }
-
- /* Lets start the drawing. */
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.lineTo(point4.x, point4.y)
- browserCanvasContext.lineTo(point1.x, point1.y)
- browserCanvasContext.closePath()
-
- browserCanvasContext.strokeStyle = 'rgba(' + style.color + ', ' + style.opacity + ')'
- browserCanvasContext.lineWidth = style.lineWidth
- browserCanvasContext.setLineDash(style.lineDash)
- browserCanvasContext.stroke()
-
- browserCanvasContext.closePath()
- }
-
- function grid (fitFunction, smallLines) {
- if (smallLines === true) {
- /* Small Lines */
-
- let step = thisObject.width / 100
-
- browserCanvasContext.beginPath()
-
- for (let i = 0; i < thisObject.width; i = i + step) {
- for (let j = 0; j < thisObject.height; j = j + step) {
- let point1 = {
+ titleBarPoint1 = {
x: 0,
- y: j
- }
+ y: TITLE_BAR_HEIGHT
+ }
- let point2 = {
+ titleBarPoint2 = {
x: thisObject.width,
- y: j
- }
-
- point1 = transformThisPoint(point1, thisObject.container)
- point2 = transformThisPoint(point2, thisObject.container)
-
- if (fitFunction !== undefined) {
- point1 = fitFunction(point1)
- point2 = fitFunction(point2)
- }
-
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
+ y: TITLE_BAR_HEIGHT
}
- let point3 = {
- x: thisObject.width,
- y: thisObject.height
+ /* Now the transformations. */
+
+ titleBarPoint1 = frameThisPoint(titleBarPoint1)
+ titleBarPoint2 = frameThisPoint(titleBarPoint2)
+
+ if (fitFunction !== undefined) {
+ titleBarPoint1 = fitFunction(titleBarPoint1)
+ titleBarPoint2 = fitFunction(titleBarPoint2)
}
- let point4 = {
- x: 0,
- y: thisObject.height
+ /* We paint the title bar now */
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK + ', 1)'
+ browserCanvasContext.beginPath()
+
+ browserCanvasContext.moveTo(titleBarPoint1.x, titleBarPoint1.y)
+ browserCanvasContext.lineTo(borderPoint1.x - PANEL_CORNERS_RADIUS, borderPoint1.y)
+ browserCanvasContext.arc(borderPoint1.x, borderPoint1.y, PANEL_CORNERS_RADIUS, 1.0 * Math.PI, 1.5 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint2.x, borderPoint2.y - PANEL_CORNERS_RADIUS)
+ browserCanvasContext.arc(borderPoint2.x, borderPoint2.y, PANEL_CORNERS_RADIUS, 1.5 * Math.PI, 2.0 * Math.PI)
+ browserCanvasContext.lineTo(titleBarPoint2.x, titleBarPoint2.y)
+
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
+
+ browserCanvasContext.lineWidth = 0.1
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.MANGANESE_PURPLE + ', 0.75)'
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.stroke()
+
+ /* print the title */
+
+ let labelPoint
+ let fontSize = 10
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+
+ let label = thisObject.containerName
+
+ let xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO
+ let yOffset = (TITLE_BAR_HEIGHT - fontSize) / 2 + 2
+
+ labelPoint = {
+ x: thisObject.width / 2 - xOffset,
+ y: TITLE_BAR_HEIGHT - yOffset
}
+ labelPoint = thisObject.frameThisPoint(labelPoint)
+
+ if (fitFunction !== undefined) {
+ labelPoint = fitFunction(labelPoint)
+ }
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ }
+
+ function borders(fitFunction, style) {
+ /* Lest get the important points of the drawing so as to apply the needed transformations. */
+
+ let point1
+ let point2
+ let point3
+ let point4
+
+ point1 = {
+ x: 0,
+ y: 0
+ }
+
+ point2 = {
+ x: thisObject.width,
+ y: 0
+ }
+
+ point3 = {
+ x: thisObject.width,
+ y: thisObject.height
+ }
+
+ point4 = {
+ x: 0,
+ y: thisObject.height
+ }
+
+ /* Now the transformations. */
+ point1 = transformThisPoint(point1, thisObject.container)
+ point2 = transformThisPoint(point2, thisObject.container)
point3 = transformThisPoint(point3, thisObject.container)
point4 = transformThisPoint(point4, thisObject.container)
if (fitFunction !== undefined) {
- point3 = fitFunction(point3)
- point4 = fitFunction(point4)
- }
-
- browserCanvasContext.moveTo(point3.x, point3.y)
- browserCanvasContext.lineTo(point4.x, point4.y)
- }
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(150, 150, 150, 0.1)'
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.stroke()
- }
-
- /* Main Lines */
-
- let step = thisObject.width / 20
-
- browserCanvasContext.beginPath()
-
- for (let i = 0; i < thisObject.width; i = i + step) {
- for (let j = 0; j < thisObject.height; j = j + step) {
- let point1 = {
- x: 0,
- y: j
- }
-
- let point2 = {
- x: thisObject.width,
- y: j
- }
-
- point1 = transformThisPoint(point1, thisObject.container)
- point2 = transformThisPoint(point2, thisObject.container)
-
- if (fitFunction !== undefined) {
- point1 = fitFunction(point1)
- point2 = fitFunction(point2)
+ point1 = fitFunction(point1)
+ point2 = fitFunction(point2)
+ point3 = fitFunction(point3)
+ point4 = fitFunction(point4)
}
+ /* Lets start the drawing. */
+ browserCanvasContext.beginPath()
browserCanvasContext.moveTo(point1.x, point1.y)
browserCanvasContext.lineTo(point2.x, point2.y)
- }
+ browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.lineTo(point4.x, point4.y)
+ browserCanvasContext.lineTo(point1.x, point1.y)
+ browserCanvasContext.closePath()
- let point3 = {
- x: i,
- y: 0
- }
+ browserCanvasContext.strokeStyle = 'rgba(' + style.color + ', ' + style.opacity + ')'
+ browserCanvasContext.lineWidth = style.lineWidth
+ browserCanvasContext.setLineDash(style.lineDash)
+ browserCanvasContext.stroke()
- let point4 = {
- x: i,
- y: thisObject.height
- }
+ browserCanvasContext.closePath()
+ }
- point3 = transformThisPoint(point3, thisObject.container)
- point4 = transformThisPoint(point4, thisObject.container)
+ function grid(fitFunction, smallLines) {
+ if (smallLines === true) {
+ /* Small Lines */
- if (fitFunction !== undefined) {
- point3 = fitFunction(point3)
- point4 = fitFunction(point4)
- }
+ let step = thisObject.width / 100
- browserCanvasContext.moveTo(point3.x, point3.y)
- browserCanvasContext.lineTo(point4.x, point4.y)
+ browserCanvasContext.beginPath()
+
+ for (let i = 0; i < thisObject.width; i = i + step) {
+ for (let j = 0; j < thisObject.height; j = j + step) {
+ let point1 = {
+ x: 0,
+ y: j
+ }
+
+ let point2 = {
+ x: thisObject.width,
+ y: j
+ }
+
+ point1 = transformThisPoint(point1, thisObject.container)
+ point2 = transformThisPoint(point2, thisObject.container)
+
+ if (fitFunction !== undefined) {
+ point1 = fitFunction(point1)
+ point2 = fitFunction(point2)
+ }
+
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ }
+
+ let point3 = {
+ x: thisObject.width,
+ y: thisObject.height
+ }
+
+ let point4 = {
+ x: 0,
+ y: thisObject.height
+ }
+
+ point3 = transformThisPoint(point3, thisObject.container)
+ point4 = transformThisPoint(point4, thisObject.container)
+
+ if (fitFunction !== undefined) {
+ point3 = fitFunction(point3)
+ point4 = fitFunction(point4)
+ }
+
+ browserCanvasContext.moveTo(point3.x, point3.y)
+ browserCanvasContext.lineTo(point4.x, point4.y)
+ }
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(150, 150, 150, 0.1)'
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.stroke()
+ }
+
+ /* Main Lines */
+
+ let step = thisObject.width / 20
+
+ browserCanvasContext.beginPath()
+
+ for (let i = 0; i < thisObject.width; i = i + step) {
+ for (let j = 0; j < thisObject.height; j = j + step) {
+ let point1 = {
+ x: 0,
+ y: j
+ }
+
+ let point2 = {
+ x: thisObject.width,
+ y: j
+ }
+
+ point1 = transformThisPoint(point1, thisObject.container)
+ point2 = transformThisPoint(point2, thisObject.container)
+
+ if (fitFunction !== undefined) {
+ point1 = fitFunction(point1)
+ point2 = fitFunction(point2)
+ }
+
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ }
+
+ let point3 = {
+ x: i,
+ y: 0
+ }
+
+ let point4 = {
+ x: i,
+ y: thisObject.height
+ }
+
+ point3 = transformThisPoint(point3, thisObject.container)
+ point4 = transformThisPoint(point4, thisObject.container)
+
+ if (fitFunction !== undefined) {
+ point3 = fitFunction(point3)
+ point4 = fitFunction(point4)
+ }
+
+ browserCanvasContext.moveTo(point3.x, point3.y)
+ browserCanvasContext.lineTo(point4.x, point4.y)
+ }
+ browserCanvasContext.closePath()
+ browserCanvasContext.strokeStyle = 'rgba(100, 100, 100, 0.2)'
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.stroke()
}
- browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(100, 100, 100, 0.2)'
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.stroke()
- }
}
diff --git a/CanvasApp/Globals.js b/CanvasApp/Globals.js
index f47174216..88ede4643 100644
--- a/CanvasApp/Globals.js
+++ b/CanvasApp/Globals.js
@@ -1,5 +1,5 @@
- /* User Interface Colors */
+/* User Interface Colors */
const CANVAS_APP_NAME = 'Canvas App'
@@ -49,36 +49,36 @@ let FONT_ASPECT_RATIO = 0.32;
let ANIMATION_FRAME_PER_SECONDS
const GET_CONTAINER_PURPOSE = {
- MOUSE_OVER: 1,
- MOUSE_WHEEL: 2,
- MOUSE_CLICK: 3,
- DRAGGING: 4
+ MOUSE_OVER: 1,
+ MOUSE_WHEEL: 2,
+ MOUSE_CLICK: 3,
+ DRAGGING: 4
}
const ANGLE_TO_PARENT = {
- NOT_FIXED: 0,
- RANGE_360: 1,
- RANGE_180: 2,
- RANGE_90: 3,
- RANGE_45: 4
+ NOT_FIXED: 0,
+ RANGE_360: 1,
+ RANGE_180: 2,
+ RANGE_90: 3,
+ RANGE_45: 4
}
const DISTANCE_TO_PARENT = {
- NOT_FIXED: 0,
- PARENT_025X: 1,
- PARENT_050X: 2,
- PARENT_100X: 3,
- PARENT_150X: 4,
- PARENT_200X: 5
+ NOT_FIXED: 0,
+ PARENT_025X: 1,
+ PARENT_050X: 2,
+ PARENT_100X: 3,
+ PARENT_150X: 4,
+ PARENT_200X: 5
}
const ARRANGEMENT_STYLE = {
- CONCAVE: 0,
- CONVEX: 1,
- VERTICAL_RIGHT: 2,
- VERTICAL_LEFT: 3,
- HORIZONTAL_BOTTOM: 4,
- HORIZONTAL_TOP: 5
+ CONCAVE: 0,
+ CONVEX: 1,
+ VERTICAL_RIGHT: 2,
+ VERTICAL_LEFT: 3,
+ HORIZONTAL_BOTTOM: 4,
+ HORIZONTAL_TOP: 5
}
/* User Interface Panels */
@@ -138,11 +138,11 @@ let LOGGED_IN_USER_LOCAL_STORAGE_KEY
let LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY
if (testUser !== null) {
- LOGGED_IN_USER_LOCAL_STORAGE_KEY = "test_user"
- LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "test_access_token"
+ LOGGED_IN_USER_LOCAL_STORAGE_KEY = "test_user"
+ LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "test_access_token"
} else {
- LOGGED_IN_USER_LOCAL_STORAGE_KEY = "user"
- LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "access_token"
+ LOGGED_IN_USER_LOCAL_STORAGE_KEY = "user"
+ LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "access_token"
}
const MAX_DEFAULT_RATE_SCALE_VALUE = 35000; // This is needed to know the scale of the market time line.
@@ -222,7 +222,7 @@ const TIME_MACHINE_WIDTH = 8;
const TIME_MACHINE_HEIGHT = 8;
let mediaRecorder // to downloadText canvas animation as a mediaRecorder
-let marketPanoramaCanvas
+let marketPanoramaCanvas
let ARE_WE_RECORDING_A_VIDEO = false
let ARE_WE_RECORDING_A_MARKET_PANORAMA = false
let PANORAMA_WAS_PANNED = false
diff --git a/CanvasApp/Panels/Layer.js b/CanvasApp/Panels/Layer.js
index 8d4d16611..180378e5d 100644
--- a/CanvasApp/Panels/Layer.js
+++ b/CanvasApp/Panels/Layer.js
@@ -1,648 +1,648 @@
function newLayer() {
- const MODULE_NAME = 'Layer'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+ const MODULE_NAME = 'Layer'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- container: undefined,
- status: LAYER_STATUS.OFF,
- fitFunction: undefined,
- payload: undefined,
- definition: undefined,
- panels: undefined,
- baseAsset: undefined,
- quotedAsset: undefined,
- market: undefined,
- exchange: undefined,
- plotterModule: undefined,
- exchangeIcon: undefined,
- plotterTypeIcon: undefined,
- baseAssetIcon: undefined,
- quotedAssetIcon: undefined,
- networkNode: undefined,
- checkStatusAtShutDown: checkStatusAtShutDown,
- physics: physics,
- draw: draw,
- turnOff: turnOff,
- turnOn: turnOn,
- setDatetime: setDatetime,
- setTimeFrame: setTimeFrame,
- onMarketFileLoaded: onMarketFileLoaded,
- onDailyFileLoaded: onDailyFileLoaded,
- onSingleFileLoaded: onSingleFileLoaded,
- onFileSequenceLoaded: onFileSequenceLoaded,
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize,
- finalize: finalize
- }
-
- let LOADING_FILL_STYLE = 'rgba(234, 143, 23, @Opacity)'
- let LOADED_FILL_STYLE = 'rgba(45, 232, 28, @Opacity)'
- let UNLOADED_FILL_STYLE = 'rgba(226, 226, 226, @Opacity)'
-
- let LOADING_STROKE_STYLE = 'rgba(234, 143, 23, @Opacity)'
- let LOADED_STROKE_STYLE = 'rgba(45, 232, 28, @Opacity)'
- let UNLOADED_STROKE_STYLE = 'rgba(226, 226, 226, @Opacity)'
-
- let marketFileProgressBar = {
- value: 0,
- animatedValue: 0,
- fillStyle: UNLOADED_FILL_STYLE,
- strokeStyle: UNLOADED_STROKE_STYLE,
- opacity: 0.00
- }
-
- let dailyFileProgressBar = {
- value: 0,
- animatedValue: 0,
- fillStyle: UNLOADED_FILL_STYLE,
- strokeStyle: UNLOADED_STROKE_STYLE,
- opacity: 0.00
- }
-
- let singleFileProgressBar = {
- value: 0,
- animatedValue: 0,
- fillStyle: UNLOADED_FILL_STYLE,
- strokeStyle: UNLOADED_STROKE_STYLE,
- opacity: 0.00
- }
-
- let fileSequenceProgressBar = {
- value: 0,
- animatedValue: 0,
- fillStyle: UNLOADED_FILL_STYLE,
- strokeStyle: UNLOADED_STROKE_STYLE,
- opacity: 0.00
- }
-
- let timeFrame = INITIAL_TIME_PERIOD
- let datetime = NEW_SESSION_INITIAL_DATE
-
- /* Add an Event Handler */
-
- thisObject.eventHandler = newEventHandler()
- let imagesLoaded = 0
- let onMouseClickEventSuscriptionId
- let panelsVisibleButton
-
- return thisObject
-
- function finalize() {
- thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
-
- thisObject.container.finalize()
- thisObject.eventHandler.finalize()
- thisObject.container = undefined
- thisObject.eventHandler = undefined
- thisObject.status = undefined
- thisObject.fitFunction = undefined
- thisObject.payload = undefined
- thisObject.definition = undefined
- thisObject.panels = undefined
-
- timeFrame = undefined
- datetime = undefined
-
- LOADING_FILL_STYLE = undefined
- LOADED_FILL_STYLE = undefined
- UNLOADED_FILL_STYLE = undefined
-
- LOADING_STROKE_STYLE = undefined
- LOADED_STROKE_STYLE = undefined
- UNLOADED_STROKE_STYLE = undefined
-
- marketFileProgressBar = undefined
- dailyFileProgressBar = undefined
- singleFileProgressBar = undefined
- fileSequenceProgressBar = undefined
-
- panelsVisibleButton = undefined
-
- thisObject.baseAsset = undefined
- thisObject.quotedAsset = undefined
- thisObject.market = undefined
- thisObject.exchange = undefined
- thisObject.plotterModule = undefined
- thisObject.exchangeIcon = undefined
- thisObject.plotterTypeIcon = undefined
- thisObject.baseAssetIcon = undefined
- thisObject.quotedAssetIcon = undefined
- thisObject.networkNode = undefined
- }
-
- function initialize(callBackFunction) {
- /* Create this objects continer */
- try {
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME + ' ' + thisObject.payload.node.id)
- thisObject.container.isDraggeable = false
- thisObject.container.isClickeable = true
-
- /* Lets set the basic dimensions of this thisObject. */
- let position = {
- x: 0,
- y: 0
- }
-
- thisObject.container.frame.position = position
- thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
- thisObject.container.frame.height = 70
-
- let functionLibraryProtocolNode = newProtocolNode()
- let lightingPath =
- '->Layer->' +
- 'Data Product->Single Market Data->Exchange Data Products->' +
- 'Session Reference->Session Independent Data->Session Based Data->Exchange Sessions->Session Based Data->Data Storage->Network Node->' +
- 'Data Storage->Network Node->' +
- 'Backtesting Session->Paper Trading Session->Fordward Testing Session->Live Trading Session->' +
- 'Trading System Reference->Trading Engine Reference->Trading System->Trading Engine->' +
- 'Market->Market Base Asset->Asset->' +
- 'Market Quoted Asset->Asset->' +
- 'Exchange Markets->Crypto Exchange->' +
- 'Product Definition->' +
- 'Sensor Bot->Indicator Bot->Trading Bot->' +
- 'Data Mine->' +
- 'Dataset Definition->' +
- 'Record Definition->Record Property->Formula->' +
- 'Data Building Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
- 'Calculations Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
- 'Plotter Module->Plotter->' +
- 'Shapes->' +
- 'Chart Points->Point->Point Formula->' +
- 'Polygon->Polygon Condition->Polygon Body->Style->Style Condition->Style->' +
- 'Polygon Border->Style->Style Condition->Style->' +
- 'Polygon Vertex->Point->' +
- 'Image->Image Condition->Image Position->Point->' +
- 'Text->Text Condition->Text Position->Point->Text Formula->Text Style->' +
- 'Plotter Panel->Javascript Code->Panel Data->Data Formula->' +
- 'Nodes Highlights->Nodes Values->Nodes Errors->Nodes Status->Nodes Progress->Nodes Running->Nodes Announcements->Record Values->'
- thisObject.definition = functionLibraryProtocolNode.getProtocolNode(thisObject.payload.node, false, true, true, false, false, lightingPath)
-
- /* Here we validate that we have all the needed information */
- if (thisObject.definition.referenceParent === undefined) { return } // Data Product
- if (thisObject.definition.referenceParent.parentNode === undefined) { return } // Single Market Data
- if (thisObject.definition.referenceParent.parentNode.referenceParent === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.referenceParent.parentNode === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.referenceParent.parentNode.parentNode === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent === undefined) { return }
- if (thisObject.definition.referenceParent.referenceParent === undefined) { return }
- if (thisObject.definition.referenceParent.referenceParent.parentNode === undefined) { return }
- if (thisObject.definition.referenceParent.referenceParent.parentNode.parentNode === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.parentNode === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode === undefined) { return }
- if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.parentNode === undefined) { return }
-
- /* Lets listen to our own events to react when we have a Mouse Click */
- onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
-
- /* Get ready to draw this layer */
- thisObject.baseAsset = thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent
- thisObject.quotedAsset = thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent
- thisObject.market = thisObject.baseAsset.config.codeName + '/' + thisObject.quotedAsset.config.codeName
- thisObject.exchange = thisObject.definition.referenceParent.parentNode.referenceParent.parentNode.parentNode
-
- /* Some basic validations. */
- if (thisObject.definition.referenceParent === undefined) {
- console.log('[WARN] Could not start plotter because ' + thisObject.definition.type + ' ' + thisObject.definition.name + ' does not have a Reference Parent.')
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
-
- if (thisObject.definition.referenceParent.referenceParent === undefined) {
- console.log('[WARN] Could not start plotter because ' + thisObject.definition.referenceParent.type + ' ' + thisObject.definition.referenceParent.name + ' does not have a Reference Parent.')
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
-
- if (thisObject.definition.referenceParent.referenceParent.referenceParent === undefined) {
- console.log('[WARN] Could not start plotter because ' + thisObject.definition.referenceParent.referenceParent.type + ' ' + thisObject.definition.referenceParent.referenceParent.name + ' does not have a Reference Parent.')
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
-
- thisObject.plotterModule = thisObject.definition.referenceParent.referenceParent.referenceParent
- thisObject.exchangeIcon = getIcon(thisObject.exchange)
-
- if (thisObject.plotterModule.config.icon !== undefined) {
- thisObject.plotterTypeIcon = canvas.designSpace.iconCollection.get(thisObject.plotterModule.config.icon)
- }
-
- thisObject.baseAssetIcon = getIcon(thisObject.baseAsset)
- thisObject.quotedAssetIcon = getIcon(thisObject.quotedAsset)
-
- if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.type === 'Data Storage') {
- thisObject.networkNode = thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.parentNode
- } else {
- thisObject.networkNode = thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
- }
-
- function getIcon(node) {
- let nodeDefinition = getNodeDefinition(node)
- let iconName
- if (nodeDefinition.alternativeIcons !== undefined) {
- for (let i = 0; i < nodeDefinition.alternativeIcons.length; i++) {
- alternativeIcon = nodeDefinition.alternativeIcons[i]
- if (alternativeIcon.codeName === node.config.codeName) {
- iconName = alternativeIcon.iconName
- }
- }
- }
- if (iconName !== undefined) {
- icon = canvas.designSpace.iconCollection.get(iconName)
- } else {
- icon = canvas.designSpace.iconCollection.get(nodeDefinition.icon)
- }
- return icon
- }
-
- callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
+ let thisObject = {
+ container: undefined,
+ status: LAYER_STATUS.OFF,
+ fitFunction: undefined,
+ payload: undefined,
+ definition: undefined,
+ panels: undefined,
+ baseAsset: undefined,
+ quotedAsset: undefined,
+ market: undefined,
+ exchange: undefined,
+ plotterModule: undefined,
+ exchangeIcon: undefined,
+ plotterTypeIcon: undefined,
+ baseAssetIcon: undefined,
+ quotedAssetIcon: undefined,
+ networkNode: undefined,
+ checkStatusAtShutDown: checkStatusAtShutDown,
+ physics: physics,
+ draw: draw,
+ turnOff: turnOff,
+ turnOn: turnOn,
+ setDatetime: setDatetime,
+ setTimeFrame: setTimeFrame,
+ onMarketFileLoaded: onMarketFileLoaded,
+ onDailyFileLoaded: onDailyFileLoaded,
+ onSingleFileLoaded: onSingleFileLoaded,
+ onFileSequenceLoaded: onFileSequenceLoaded,
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize,
+ finalize: finalize
}
- }
- function checkStatusAtShutDown() {
- /* Mechanism to recover a layer that was left loading the last time the browser was shut dowm. */
- let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'status')
- if (storedValue !== undefined) {
- if (storedValue === LAYER_STATUS.LOADING) {
- resetProgressBars()
- changeStatusTo(LAYER_STATUS.LOADING)
- }
+ let LOADING_FILL_STYLE = 'rgba(234, 143, 23, @Opacity)'
+ let LOADED_FILL_STYLE = 'rgba(45, 232, 28, @Opacity)'
+ let UNLOADED_FILL_STYLE = 'rgba(226, 226, 226, @Opacity)'
+
+ let LOADING_STROKE_STYLE = 'rgba(234, 143, 23, @Opacity)'
+ let LOADED_STROKE_STYLE = 'rgba(45, 232, 28, @Opacity)'
+ let UNLOADED_STROKE_STYLE = 'rgba(226, 226, 226, @Opacity)'
+
+ let marketFileProgressBar = {
+ value: 0,
+ animatedValue: 0,
+ fillStyle: UNLOADED_FILL_STYLE,
+ strokeStyle: UNLOADED_STROKE_STYLE,
+ opacity: 0.00
}
- }
- function getContainer(point) {
- if (panelsVisibleButton !== undefined) {
- let container = panelsVisibleButton.getContainer(point)
- if (container !== undefined) {
- return container
- }
+ let dailyFileProgressBar = {
+ value: 0,
+ animatedValue: 0,
+ fillStyle: UNLOADED_FILL_STYLE,
+ strokeStyle: UNLOADED_STROKE_STYLE,
+ opacity: 0.00
}
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
+
+ let singleFileProgressBar = {
+ value: 0,
+ animatedValue: 0,
+ fillStyle: UNLOADED_FILL_STYLE,
+ strokeStyle: UNLOADED_STROKE_STYLE,
+ opacity: 0.00
}
- }
- function setDatetime(pDatetime) {
- /*
- When the datetime changes from one day to another, this forces cursors to potentially load more files, thus we reset this counter and
- get ready to receive events on files loaded.
- */
- let currentDate = Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS)
- let newDate = Math.trunc(pDatetime.valueOf() / ONE_DAY_IN_MILISECONDS)
-
- datetime = pDatetime
-
- if (currentDate !== newDate) {
- if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
- dailyFileProgressBar.animatedValue = 0
- }
+ let fileSequenceProgressBar = {
+ value: 0,
+ animatedValue: 0,
+ fillStyle: UNLOADED_FILL_STYLE,
+ strokeStyle: UNLOADED_STROKE_STYLE,
+ opacity: 0.00
}
- }
- function setTimeFrame(pTimeFrame) {
- /*
- When the time period below or equal to 1 hour changes, this forces cursors to potentially load more files, thus we reset this counter and
- get ready to receive events on files loaded.
- */
- if (timeFrame !== pTimeFrame) {
- timeFrame = pTimeFrame
+ let timeFrame = INITIAL_TIME_PERIOD
+ let datetime = NEW_SESSION_INITIAL_DATE
- if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
- dailyFileProgressBar.animatedValue = 0
- }
+ /* Add an Event Handler */
+
+ thisObject.eventHandler = newEventHandler()
+ let imagesLoaded = 0
+ let onMouseClickEventSuscriptionId
+ let panelsVisibleButton
+
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.eventHandler.finalize()
+ thisObject.container = undefined
+ thisObject.eventHandler = undefined
+ thisObject.status = undefined
+ thisObject.fitFunction = undefined
+ thisObject.payload = undefined
+ thisObject.definition = undefined
+ thisObject.panels = undefined
+
+ timeFrame = undefined
+ datetime = undefined
+
+ LOADING_FILL_STYLE = undefined
+ LOADED_FILL_STYLE = undefined
+ UNLOADED_FILL_STYLE = undefined
+
+ LOADING_STROKE_STYLE = undefined
+ LOADED_STROKE_STYLE = undefined
+ UNLOADED_STROKE_STYLE = undefined
+
+ marketFileProgressBar = undefined
+ dailyFileProgressBar = undefined
+ singleFileProgressBar = undefined
+ fileSequenceProgressBar = undefined
+
+ panelsVisibleButton = undefined
+
+ thisObject.baseAsset = undefined
+ thisObject.quotedAsset = undefined
+ thisObject.market = undefined
+ thisObject.exchange = undefined
+ thisObject.plotterModule = undefined
+ thisObject.exchangeIcon = undefined
+ thisObject.plotterTypeIcon = undefined
+ thisObject.baseAssetIcon = undefined
+ thisObject.quotedAssetIcon = undefined
+ thisObject.networkNode = undefined
}
- }
- function onMarketFileLoaded(event) {
- if (event.totalValue === 0) {
- marketFileProgressBar.value = 100
- return
- }
- marketFileProgressBar.value = Math.trunc((event.currentValue + event.filesNotLoaded) * 100 / event.totalValue)
- marketFileProgressBar.fillStyle = LOADING_FILL_STYLE
- marketFileProgressBar.strokeStyle = LOADING_STROKE_STYLE
+ function initialize(callBackFunction) {
+ /* Create this objects continer */
+ try {
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME + ' ' + thisObject.payload.node.id)
+ thisObject.container.isDraggeable = false
+ thisObject.container.isClickeable = true
- if (marketFileProgressBar.value > 100) { marketFileProgressBar.value = 100 }
- }
-
- function onDailyFileLoaded(event) {
- if (event.totalValue === 0) {
- dailyFileProgressBar.value = 100
- return
- }
- dailyFileProgressBar.value = Math.trunc(event.currentValue * 100 / event.totalValue)
- dailyFileProgressBar.fillStyle = LOADING_FILL_STYLE
- dailyFileProgressBar.strokeStyle = LOADING_STROKE_STYLE
-
- if (dailyFileProgressBar.value > 100) { dailyFileProgressBar.value = 100 }
- }
-
- function onSingleFileLoaded(event) {
- if (event.totalValue === 0) {
- singleFileProgressBar.value = 100
- return
- }
- singleFileProgressBar.value = Math.trunc(event.currentValue * 100 / event.totalValue)
- singleFileProgressBar.fillStyle = LOADING_FILL_STYLE
- singleFileProgressBar.strokeStyle = LOADING_STROKE_STYLE
-
- if (singleFileProgressBar.value > 100) { singleFileProgressBar.value = 100 }
- }
-
- function onFileSequenceLoaded(event) {
- if (event.totalValue === 0) {
- fileSequenceProgressBar.value = 100
- return
- }
- fileSequenceProgressBar.value = Math.trunc(event.currentValue * 100 / event.totalValue)
- fileSequenceProgressBar.fillStyle = LOADING_FILL_STYLE
- fileSequenceProgressBar.strokeStyle = LOADING_STROKE_STYLE
-
- if (fileSequenceProgressBar.value > 100) { fileSequenceProgressBar.value = 100 }
- }
-
- function turnOff() {
- if (thisObject.status !== LAYER_STATUS.OFF) {
- resetProgressBars()
- changeStatusTo(LAYER_STATUS.OFF)
- }
- }
-
- function turnOn() {
- if (thisObject.status === LAYER_STATUS.OFF) {
- resetProgressBars()
- changeStatusTo(LAYER_STATUS.LOADING)
- }
- }
-
- function onMouseClick(event) {
- switch (thisObject.status) {
- case LAYER_STATUS.ON:
- resetProgressBars()
- changeStatusTo(LAYER_STATUS.OFF)
- break
- case LAYER_STATUS.OFF:
- resetProgressBars()
- changeStatusTo(LAYER_STATUS.LOADING)
- break
- case LAYER_STATUS.LOADING:
- changeStatusTo(LAYER_STATUS.OFF)
- break
- }
- }
-
- function resetProgressBars() {
- marketFileProgressBar.animatedValue = 0
- marketFileProgressBar.value = 0
- marketFileProgressBar.fillStyle = UNLOADED_FILL_STYLE
- marketFileProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
-
- dailyFileProgressBar.animatedValue = 0
- dailyFileProgressBar.value = 0
- dailyFileProgressBar.fillStyle = UNLOADED_FILL_STYLE
- dailyFileProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
-
- singleFileProgressBar.animatedValue = 0
- singleFileProgressBar.value = 0
- singleFileProgressBar.fillStyle = UNLOADED_FILL_STYLE
- singleFileProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
-
- fileSequenceProgressBar.animatedValue = 0
- fileSequenceProgressBar.value = 0
- fileSequenceProgressBar.fillStyle = UNLOADED_FILL_STYLE
- fileSequenceProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
- }
-
- function physics() {
- statusPhysics()
- childrenPhysics()
- }
-
- function childrenPhysics() {
- /* Panels Visible Button Setup */
- if (thisObject.status === LAYER_STATUS.ON) {
- if (panelsVisibleButton === undefined) {
- if (thisObject.panels !== undefined) {
- if (thisObject.panels.length > 0) {
- panelsVisibleButton = newPanelsVisibleButton()
-
- let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'showPanels')
- if (storedValue !== undefined) {
- if (storedValue === true || storedValue === false) {
- panelsVisibleButton.showPanels = storedValue
- }
+ /* Lets set the basic dimensions of this thisObject. */
+ let position = {
+ x: 0,
+ y: 0
}
- panelsVisibleButton.initialize(thisObject.panels)
- panelsVisibleButton.container.connectToParent(thisObject.container)
- }
+ thisObject.container.frame.position = position
+ thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
+ thisObject.container.frame.height = 70
+
+ let functionLibraryProtocolNode = newProtocolNode()
+ let lightingPath =
+ '->Layer->' +
+ 'Data Product->Single Market Data->Exchange Data Products->' +
+ 'Session Reference->Session Independent Data->Session Based Data->Exchange Sessions->Session Based Data->Data Storage->Network Node->' +
+ 'Data Storage->Network Node->' +
+ 'Backtesting Session->Paper Trading Session->Fordward Testing Session->Live Trading Session->' +
+ 'Trading System Reference->Trading Engine Reference->Trading System->Trading Engine->' +
+ 'Market->Market Base Asset->Asset->' +
+ 'Market Quoted Asset->Asset->' +
+ 'Exchange Markets->Crypto Exchange->' +
+ 'Product Definition->' +
+ 'Sensor Bot->Indicator Bot->Trading Bot->' +
+ 'Data Mine->' +
+ 'Dataset Definition->' +
+ 'Record Definition->Record Property->Formula->' +
+ 'Data Building Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
+ 'Calculations Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
+ 'Plotter Module->Plotter->' +
+ 'Shapes->' +
+ 'Chart Points->Point->Point Formula->' +
+ 'Polygon->Polygon Condition->Polygon Body->Style->Style Condition->Style->' +
+ 'Polygon Border->Style->Style Condition->Style->' +
+ 'Polygon Vertex->Point->' +
+ 'Image->Image Condition->Image Position->Point->' +
+ 'Text->Text Condition->Text Position->Point->Text Formula->Text Style->' +
+ 'Plotter Panel->Javascript Code->Panel Data->Data Formula->' +
+ 'Nodes Highlights->Nodes Values->Nodes Errors->Nodes Status->Nodes Progress->Nodes Running->Nodes Announcements->Record Values->'
+ thisObject.definition = functionLibraryProtocolNode.getProtocolNode(thisObject.payload.node, false, true, true, false, false, lightingPath)
+
+ /* Here we validate that we have all the needed information */
+ if (thisObject.definition.referenceParent === undefined) { return } // Data Product
+ if (thisObject.definition.referenceParent.parentNode === undefined) { return } // Single Market Data
+ if (thisObject.definition.referenceParent.parentNode.referenceParent === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.referenceParent.parentNode === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.referenceParent.parentNode.parentNode === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent === undefined) { return }
+ if (thisObject.definition.referenceParent.referenceParent === undefined) { return }
+ if (thisObject.definition.referenceParent.referenceParent.parentNode === undefined) { return }
+ if (thisObject.definition.referenceParent.referenceParent.parentNode.parentNode === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.parentNode === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode === undefined) { return }
+ if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.parentNode === undefined) { return }
+
+ /* Lets listen to our own events to react when we have a Mouse Click */
+ onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+
+ /* Get ready to draw this layer */
+ thisObject.baseAsset = thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent
+ thisObject.quotedAsset = thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent
+ thisObject.market = thisObject.baseAsset.config.codeName + '/' + thisObject.quotedAsset.config.codeName
+ thisObject.exchange = thisObject.definition.referenceParent.parentNode.referenceParent.parentNode.parentNode
+
+ /* Some basic validations. */
+ if (thisObject.definition.referenceParent === undefined) {
+ console.log('[WARN] Could not start plotter because ' + thisObject.definition.type + ' ' + thisObject.definition.name + ' does not have a Reference Parent.')
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+
+ if (thisObject.definition.referenceParent.referenceParent === undefined) {
+ console.log('[WARN] Could not start plotter because ' + thisObject.definition.referenceParent.type + ' ' + thisObject.definition.referenceParent.name + ' does not have a Reference Parent.')
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+
+ if (thisObject.definition.referenceParent.referenceParent.referenceParent === undefined) {
+ console.log('[WARN] Could not start plotter because ' + thisObject.definition.referenceParent.referenceParent.type + ' ' + thisObject.definition.referenceParent.referenceParent.name + ' does not have a Reference Parent.')
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+
+ thisObject.plotterModule = thisObject.definition.referenceParent.referenceParent.referenceParent
+ thisObject.exchangeIcon = getIcon(thisObject.exchange)
+
+ if (thisObject.plotterModule.config.icon !== undefined) {
+ thisObject.plotterTypeIcon = canvas.designSpace.iconCollection.get(thisObject.plotterModule.config.icon)
+ }
+
+ thisObject.baseAssetIcon = getIcon(thisObject.baseAsset)
+ thisObject.quotedAssetIcon = getIcon(thisObject.quotedAsset)
+
+ if (thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.type === 'Data Storage') {
+ thisObject.networkNode = thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.parentNode
+ } else {
+ thisObject.networkNode = thisObject.definition.referenceParent.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
+ }
+
+ function getIcon(node) {
+ let nodeDefinition = getNodeDefinition(node)
+ let iconName
+ if (nodeDefinition.alternativeIcons !== undefined) {
+ for (let i = 0; i < nodeDefinition.alternativeIcons.length; i++) {
+ alternativeIcon = nodeDefinition.alternativeIcons[i]
+ if (alternativeIcon.codeName === node.config.codeName) {
+ iconName = alternativeIcon.iconName
+ }
+ }
+ }
+ if (iconName !== undefined) {
+ icon = canvas.designSpace.iconCollection.get(iconName)
+ } else {
+ icon = canvas.designSpace.iconCollection.get(nodeDefinition.icon)
+ }
+ return icon
+ }
+
+ callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
}
- } else {
- savePropertyAtNodeConfig(thisObject.payload, 'showPanels', panelsVisibleButton.showPanels)
- }
}
- }
- function statusPhysics() {
- /* We retrieve the stored status at the config. */
- try {
- let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'status')
+ function checkStatusAtShutDown() {
+ /* Mechanism to recover a layer that was left loading the last time the browser was shut dowm. */
+ let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'status')
+ if (storedValue !== undefined) {
+ if (storedValue === LAYER_STATUS.LOADING) {
+ resetProgressBars()
+ changeStatusTo(LAYER_STATUS.LOADING)
+ }
+ }
+ }
- if (storedValue !== undefined) {
- if (storedValue !== thisObject.status) {
- if (storedValue === LAYER_STATUS.ON) {
- resetProgressBars()
- changeStatusTo(LAYER_STATUS.LOADING)
- }
- if (storedValue === LAYER_STATUS.OFF) {
+ function getContainer(point) {
+ if (panelsVisibleButton !== undefined) {
+ let container = panelsVisibleButton.getContainer(point)
+ if (container !== undefined) {
+ return container
+ }
+ }
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ }
+ }
+
+ function setDatetime(pDatetime) {
+ /*
+ When the datetime changes from one day to another, this forces cursors to potentially load more files, thus we reset this counter and
+ get ready to receive events on files loaded.
+ */
+ let currentDate = Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS)
+ let newDate = Math.trunc(pDatetime.valueOf() / ONE_DAY_IN_MILISECONDS)
+
+ datetime = pDatetime
+
+ if (currentDate !== newDate) {
+ if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
+ dailyFileProgressBar.animatedValue = 0
+ }
+ }
+ }
+
+ function setTimeFrame(pTimeFrame) {
+ /*
+ When the time period below or equal to 1 hour changes, this forces cursors to potentially load more files, thus we reset this counter and
+ get ready to receive events on files loaded.
+ */
+ if (timeFrame !== pTimeFrame) {
+ timeFrame = pTimeFrame
+
+ if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
+ dailyFileProgressBar.animatedValue = 0
+ }
+ }
+ }
+
+ function onMarketFileLoaded(event) {
+ if (event.totalValue === 0) {
+ marketFileProgressBar.value = 100
+ return
+ }
+ marketFileProgressBar.value = Math.trunc((event.currentValue + event.filesNotLoaded) * 100 / event.totalValue)
+ marketFileProgressBar.fillStyle = LOADING_FILL_STYLE
+ marketFileProgressBar.strokeStyle = LOADING_STROKE_STYLE
+
+ if (marketFileProgressBar.value > 100) { marketFileProgressBar.value = 100 }
+ }
+
+ function onDailyFileLoaded(event) {
+ if (event.totalValue === 0) {
+ dailyFileProgressBar.value = 100
+ return
+ }
+ dailyFileProgressBar.value = Math.trunc(event.currentValue * 100 / event.totalValue)
+ dailyFileProgressBar.fillStyle = LOADING_FILL_STYLE
+ dailyFileProgressBar.strokeStyle = LOADING_STROKE_STYLE
+
+ if (dailyFileProgressBar.value > 100) { dailyFileProgressBar.value = 100 }
+ }
+
+ function onSingleFileLoaded(event) {
+ if (event.totalValue === 0) {
+ singleFileProgressBar.value = 100
+ return
+ }
+ singleFileProgressBar.value = Math.trunc(event.currentValue * 100 / event.totalValue)
+ singleFileProgressBar.fillStyle = LOADING_FILL_STYLE
+ singleFileProgressBar.strokeStyle = LOADING_STROKE_STYLE
+
+ if (singleFileProgressBar.value > 100) { singleFileProgressBar.value = 100 }
+ }
+
+ function onFileSequenceLoaded(event) {
+ if (event.totalValue === 0) {
+ fileSequenceProgressBar.value = 100
+ return
+ }
+ fileSequenceProgressBar.value = Math.trunc(event.currentValue * 100 / event.totalValue)
+ fileSequenceProgressBar.fillStyle = LOADING_FILL_STYLE
+ fileSequenceProgressBar.strokeStyle = LOADING_STROKE_STYLE
+
+ if (fileSequenceProgressBar.value > 100) { fileSequenceProgressBar.value = 100 }
+ }
+
+ function turnOff() {
+ if (thisObject.status !== LAYER_STATUS.OFF) {
resetProgressBars()
changeStatusTo(LAYER_STATUS.OFF)
- }
}
- } else {
- resetProgressBars()
- changeStatusTo(LAYER_STATUS.OFF)
- }
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
}
- /* Check when the loading finishes */
- if (
- thisObject.status === LAYER_STATUS.LOADING &&
- marketFileProgressBar.value === 100 &&
- dailyFileProgressBar.value === 100
- ) {
- changeStatusTo(LAYER_STATUS.ON)
+ function turnOn() {
+ if (thisObject.status === LAYER_STATUS.OFF) {
+ resetProgressBars()
+ changeStatusTo(LAYER_STATUS.LOADING)
+ }
}
- }
- function changeStatusTo(newStatus) {
- if (thisObject.status !== newStatus) {
- thisObject.status = newStatus
+ function onMouseClick(event) {
+ switch (thisObject.status) {
+ case LAYER_STATUS.ON:
+ resetProgressBars()
+ changeStatusTo(LAYER_STATUS.OFF)
+ break
+ case LAYER_STATUS.OFF:
+ resetProgressBars()
+ changeStatusTo(LAYER_STATUS.LOADING)
+ break
+ case LAYER_STATUS.LOADING:
+ changeStatusTo(LAYER_STATUS.OFF)
+ break
+ }
+ }
- if (thisObject.status === LAYER_STATUS.OFF) {
+ function resetProgressBars() {
+ marketFileProgressBar.animatedValue = 0
+ marketFileProgressBar.value = 0
+ marketFileProgressBar.fillStyle = UNLOADED_FILL_STYLE
+ marketFileProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
+
+ dailyFileProgressBar.animatedValue = 0
+ dailyFileProgressBar.value = 0
+ dailyFileProgressBar.fillStyle = UNLOADED_FILL_STYLE
+ dailyFileProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
+
+ singleFileProgressBar.animatedValue = 0
+ singleFileProgressBar.value = 0
+ singleFileProgressBar.fillStyle = UNLOADED_FILL_STYLE
+ singleFileProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
+
+ fileSequenceProgressBar.animatedValue = 0
+ fileSequenceProgressBar.value = 0
+ fileSequenceProgressBar.fillStyle = UNLOADED_FILL_STYLE
+ fileSequenceProgressBar.strokeStyle = UNLOADED_STROKE_STYLE
+ }
+
+ function physics() {
+ statusPhysics()
+ childrenPhysics()
+ }
+
+ function childrenPhysics() {
+ /* Panels Visible Button Setup */
+ if (thisObject.status === LAYER_STATUS.ON) {
+ if (panelsVisibleButton === undefined) {
+ if (thisObject.panels !== undefined) {
+ if (thisObject.panels.length > 0) {
+ panelsVisibleButton = newPanelsVisibleButton()
+
+ let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'showPanels')
+ if (storedValue !== undefined) {
+ if (storedValue === true || storedValue === false) {
+ panelsVisibleButton.showPanels = storedValue
+ }
+ }
+
+ panelsVisibleButton.initialize(thisObject.panels)
+ panelsVisibleButton.container.connectToParent(thisObject.container)
+ }
+ }
+ } else {
+ savePropertyAtNodeConfig(thisObject.payload, 'showPanels', panelsVisibleButton.showPanels)
+ }
+ }
+ }
+
+ function statusPhysics() {
+ /* We retrieve the stored status at the config. */
+ try {
+ let storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'status')
+
+ if (storedValue !== undefined) {
+ if (storedValue !== thisObject.status) {
+ if (storedValue === LAYER_STATUS.ON) {
+ resetProgressBars()
+ changeStatusTo(LAYER_STATUS.LOADING)
+ }
+ if (storedValue === LAYER_STATUS.OFF) {
+ resetProgressBars()
+ changeStatusTo(LAYER_STATUS.OFF)
+ }
+ }
+ } else {
+ resetProgressBars()
+ changeStatusTo(LAYER_STATUS.OFF)
+ }
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
+
+ /* Check when the loading finishes */
+ if (
+ thisObject.status === LAYER_STATUS.LOADING &&
+ marketFileProgressBar.value === 100 &&
+ dailyFileProgressBar.value === 100
+ ) {
+ changeStatusTo(LAYER_STATUS.ON)
+ }
+ }
+
+ function changeStatusTo(newStatus) {
+ if (thisObject.status !== newStatus) {
+ thisObject.status = newStatus
+
+ if (thisObject.status === LAYER_STATUS.OFF) {
+ if (panelsVisibleButton !== undefined) {
+ panelsVisibleButton.finalize()
+ panelsVisibleButton = undefined
+ }
+ }
+
+ savePropertyAtNodeConfig(thisObject.payload, 'status', thisObject.status)
+ let eventData = thisObject
+ thisObject.container.eventHandler.raiseEvent('Status Changed', eventData)
+ }
+ }
+
+ function draw() {
+ drawLayer()
if (panelsVisibleButton !== undefined) {
- panelsVisibleButton.finalize()
- panelsVisibleButton = undefined
+ panelsVisibleButton.draw()
}
- }
-
- savePropertyAtNodeConfig(thisObject.payload, 'status', thisObject.status)
- let eventData = thisObject
- thisObject.container.eventHandler.raiseEvent('Status Changed', eventData)
- }
- }
-
- function draw() {
- drawLayer()
- if (panelsVisibleButton !== undefined) {
- panelsVisibleButton.draw()
- }
- }
-
- function drawLayer() {
- drawLayerDisplay()
- }
-
- function drawProgressBar(progressBar, lineWidth, offsetY) {
- const ANIMATED_INCREMENT = 5
- const OPACITY_INCREMENT = 0.01
- const OPACITY_MIN = 1
-
- let point1
- let point2
- let horizontalMargin = 12
-
- if (progressBar.value === 0) {
- return
}
- /* Animate */
- if (progressBar.animatedValue < progressBar.value) {
- progressBar.animatedValue = progressBar.animatedValue + ANIMATED_INCREMENT
- progressBar.opacity = progressBar.opacity + OPACITY_INCREMENT
+ function drawLayer() {
+ drawLayerDisplay()
}
- if (progressBar.animatedValue >= 100) {
- progressBar.animatedValue = 100
+ function drawProgressBar(progressBar, lineWidth, offsetY) {
+ const ANIMATED_INCREMENT = 5
+ const OPACITY_INCREMENT = 0.01
+ const OPACITY_MIN = 1
- progressBar.opacity = progressBar.opacity - OPACITY_INCREMENT
- if (progressBar.opacity < OPACITY_MIN) { progressBar.opacity = OPACITY_MIN }
+ let point1
+ let point2
+ let horizontalMargin = 12
- progressBar.strokeStyle = LOADED_STROKE_STYLE.replace('@Opacity', progressBar.opacity.toString())
+ if (progressBar.value === 0) {
+ return
+ }
+
+ /* Animate */
+ if (progressBar.animatedValue < progressBar.value) {
+ progressBar.animatedValue = progressBar.animatedValue + ANIMATED_INCREMENT
+ progressBar.opacity = progressBar.opacity + OPACITY_INCREMENT
+ }
+
+ if (progressBar.animatedValue >= 100) {
+ progressBar.animatedValue = 100
+
+ progressBar.opacity = progressBar.opacity - OPACITY_INCREMENT
+ if (progressBar.opacity < OPACITY_MIN) { progressBar.opacity = OPACITY_MIN }
+
+ progressBar.strokeStyle = LOADED_STROKE_STYLE.replace('@Opacity', progressBar.opacity.toString())
+ }
+
+ point1 = {
+ x: 0 + horizontalMargin,
+ y: thisObject.container.frame.height + offsetY
+ }
+
+ point2 = {
+ x: (thisObject.container.frame.width - horizontalMargin * 2) * progressBar.animatedValue / 100 + horizontalMargin,
+ y: thisObject.container.frame.height + offsetY
+ }
+
+ /* Now the transformations. */
+ point1 = thisObject.container.frame.frameThisPoint(point1)
+ point2 = thisObject.container.frame.frameThisPoint(point2)
+
+ point1 = thisObject.fitFunction(point1)
+ point2 = thisObject.fitFunction(point2)
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.strokeStyle = progressBar.strokeStyle.replace('@Opacity', progressBar.opacity.toString())
+
+ browserCanvasContext.setLineDash([1, 4])
+ browserCanvasContext.lineWidth = lineWidth
+ browserCanvasContext.stroke()
}
- point1 = {
- x: 0 + horizontalMargin,
- y: thisObject.container.frame.height + offsetY
+ function drawLayerDisplay() {
+ let label1 = thisObject.payload.node.name
+ let label2 = thisObject.exchange.name.substring(0, 15) + ' - ' + thisObject.market
+ let label3 = thisObject.status.toUpperCase()
+
+ if (label1 !== undefined) {
+ label1 = label1.substring(0, 30)
+ }
+
+ let backgroundColor = UI_COLOR.BLACK
+
+ const RED_LINE_HIGHT = 4
+ const OPACITY = 0.75
+
+ let params = {
+ cornerRadius: 0,
+ lineWidth: 1,
+ container: thisObject.container,
+ borderColor: UI_COLOR.RUSTED_RED,
+ castShadow: false,
+ backgroundColor: backgroundColor,
+ opacity: OPACITY
+ }
+
+ roundedCornersBackground(params)
+
+ let parentLabel1FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label1FontSize')
+ let parentLabel2FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label2FontSize')
+ let parentLabel3FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label3FontSize')
+
+ let label1FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label1FontSize')
+ let label2FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label2FontSize')
+ let label3FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label3FontSize')
+
+ if (parentLabel1FontSize !== undefined) {
+ label1FontSize = parentLabel1FontSize
+ }
+ if (parentLabel2FontSize !== undefined) {
+ label2FontSize = parentLabel2FontSize
+ }
+ if (parentLabel3FontSize !== undefined) {
+ label3FontSize = parentLabel3FontSize
+ }
+
+ if (label1FontSize === undefined) {
+ if (label1.length > 20) {
+ label1FontSize = 12
+ } else {
+ label1FontSize = 15
+ }
+ }
+
+ if (label2FontSize === undefined) {
+ label2FontSize = 10
+ }
+
+ if (label3FontSize === undefined) {
+ label3FontSize = 9
+ }
+
+ drawLabel(label1, 1 / 2, 6 / 10, -5, 0, label1FontSize, thisObject.container)
+ drawLabel(label2, 1 / 2, 8.2 / 10, -5, 0, label2FontSize, thisObject.container)
+ drawLabel(label3, 1 / 2, 9.5 / 10, -5, 0, label3FontSize, thisObject.container)
+
+ drawProgressBar(marketFileProgressBar, 1, -45)
+ drawProgressBar(dailyFileProgressBar, 1, -46)
+ drawProgressBar(singleFileProgressBar, 1, -47)
+ drawProgressBar(fileSequenceProgressBar, 1, -48)
+
+ drawIcon(thisObject.exchangeIcon, 1 / 8, 2 / 10, 0, 0, 14, thisObject.container)
+ drawIcon(thisObject.plotterTypeIcon, 7 / 8, 2 / 10, 0, 0, 14, thisObject.container)
+ drawIcon(thisObject.baseAssetIcon, 3.4 / 8, 2 / 10, 0, 0, 14, thisObject.container)
+ drawIcon(thisObject.quotedAssetIcon, 4.6 / 8, 2 / 10, 0, 0, 14, thisObject.container)
}
-
- point2 = {
- x: (thisObject.container.frame.width - horizontalMargin * 2) * progressBar.animatedValue / 100 + horizontalMargin,
- y: thisObject.container.frame.height + offsetY
- }
-
- /* Now the transformations. */
- point1 = thisObject.container.frame.frameThisPoint(point1)
- point2 = thisObject.container.frame.frameThisPoint(point2)
-
- point1 = thisObject.fitFunction(point1)
- point2 = thisObject.fitFunction(point2)
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
-
- browserCanvasContext.closePath()
-
- browserCanvasContext.strokeStyle = progressBar.strokeStyle.replace('@Opacity', progressBar.opacity.toString())
-
- browserCanvasContext.setLineDash([1, 4])
- browserCanvasContext.lineWidth = lineWidth
- browserCanvasContext.stroke()
- }
-
- function drawLayerDisplay() {
- let label1 = thisObject.payload.node.name
- let label2 = thisObject.exchange.name.substring(0, 15) + ' - ' + thisObject.market
- let label3 = thisObject.status.toUpperCase()
-
- if (label1 !== undefined) {
- label1 = label1.substring(0, 30)
- }
-
- let backgroundColor = UI_COLOR.BLACK
-
- const RED_LINE_HIGHT = 4
- const OPACITY = 0.75
-
- let params = {
- cornerRadius: 0,
- lineWidth: 1,
- container: thisObject.container,
- borderColor: UI_COLOR.RUSTED_RED,
- castShadow: false,
- backgroundColor: backgroundColor,
- opacity: OPACITY
- }
-
- roundedCornersBackground(params)
-
- let parentLabel1FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label1FontSize')
- let parentLabel2FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label2FontSize')
- let parentLabel3FontSize = loadPropertyFromNodeConfig(thisObject.payload.parentNode.payload, 'label3FontSize')
-
- let label1FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label1FontSize')
- let label2FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label2FontSize')
- let label3FontSize = loadPropertyFromNodeConfig(thisObject.payload, 'label3FontSize')
-
- if (parentLabel1FontSize !== undefined) {
- label1FontSize = parentLabel1FontSize
- }
- if (parentLabel2FontSize !== undefined) {
- label2FontSize = parentLabel2FontSize
- }
- if (parentLabel3FontSize !== undefined) {
- label3FontSize = parentLabel3FontSize
- }
-
- if (label1FontSize === undefined) {
- if (label1.length > 20) {
- label1FontSize = 12
- } else {
- label1FontSize = 15
- }
- }
-
- if (label2FontSize === undefined) {
- label2FontSize = 10
- }
-
- if (label3FontSize === undefined) {
- label3FontSize = 9
- }
-
- drawLabel(label1, 1 / 2, 6 / 10, -5, 0, label1FontSize, thisObject.container)
- drawLabel(label2, 1 / 2, 8.2 / 10, -5, 0, label2FontSize, thisObject.container)
- drawLabel(label3, 1 / 2, 9.5 / 10, -5, 0, label3FontSize, thisObject.container)
-
- drawProgressBar(marketFileProgressBar, 1, -45)
- drawProgressBar(dailyFileProgressBar, 1, -46)
- drawProgressBar(singleFileProgressBar, 1, -47)
- drawProgressBar(fileSequenceProgressBar, 1, -48)
-
- drawIcon(thisObject.exchangeIcon, 1 / 8, 2 / 10, 0, 0, 14, thisObject.container)
- drawIcon(thisObject.plotterTypeIcon, 7 / 8, 2 / 10, 0, 0, 14, thisObject.container)
- drawIcon(thisObject.baseAssetIcon, 3.4 / 8, 2 / 10, 0, 0, 14, thisObject.container)
- drawIcon(thisObject.quotedAssetIcon, 4.6 / 8, 2 / 10, 0, 0, 14, thisObject.container)
- }
}
diff --git a/CanvasApp/Panels/LayersPanel.js b/CanvasApp/Panels/LayersPanel.js
index 1d50fc947..11d165da5 100644
--- a/CanvasApp/Panels/LayersPanel.js
+++ b/CanvasApp/Panels/LayersPanel.js
@@ -1,519 +1,519 @@
-function newLayersPanel () {
- let thisObject = {
- name: 'Layers Panel',
- fitFunction: undefined,
- container: undefined,
- layers: [],
- payload: undefined,
- isVisible: true,
- upDownButton: undefined,
- leftRightButton: undefined,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize()
- thisObject.container.isDraggeable = true
- thisObject.container.isWheelable = true
- thisObject.container.detectMouseOver = true
-
- let isInitialized = false
- let mouseOverCounter = 0
-
- let layersMap = new Map()
- let visibleLayers = []
- let firstVisibleLayer = 1
-
- const LAYER_SEPARATION = 0
-
- let headerHeight = 40
- let footerHeight = 10
- let layerHeight = 70
- let desiredVisibleLayers = 5
- let posibleVisibleLayers = 5
- let desiredPanelHeight = (layerHeight + LAYER_SEPARATION) * desiredVisibleLayers + headerHeight + footerHeight
- let posiblePanelHeight = (layerHeight + LAYER_SEPARATION) * posibleVisibleLayers + headerHeight + footerHeight
-
- let onMouseWheelEventSuscriptionId
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
-
- let isMouseOver
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseWheelEventSuscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
-
- thisObject.upDownButton.finalize()
- thisObject.upDownButton = undefined
-
- thisObject.leftRightButton.finalize()
- thisObject.leftRightButton = undefined
-
- layersMap = undefined
- visibleLayers = undefined
-
- thisObject.container.finalize()
- thisObject.container = undefined
-
- thisObject.payload = undefined
- thisObject = undefined
- }
-
- function initialize () {
- thisObject.container.name = thisObject.payload.node.name
- thisObject.container.frame.containerName = thisObject.container.name
- thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
- thisObject.container.frame.height = headerHeight
-
- let position = { // Default position
- x: canvas.chartingSpace.viewport.visibleArea.topLeft.x,
- y: canvas.chartingSpace.viewport.visibleArea.topLeft.y
+function newLayersPanel() {
+ let thisObject = {
+ name: 'Layers Panel',
+ fitFunction: undefined,
+ container: undefined,
+ layers: [],
+ payload: undefined,
+ isVisible: true,
+ upDownButton: undefined,
+ leftRightButton: undefined,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- thisObject.container.frame.position = position
- loadFrame(thisObject.payload, thisObject.container.frame)
+ thisObject.container = newContainer()
+ thisObject.container.initialize()
+ thisObject.container.isDraggeable = true
+ thisObject.container.isWheelable = true
+ thisObject.container.detectMouseOver = true
- thisObject.upDownButton = newUpDownButton()
- thisObject.upDownButton.parentContainer = thisObject.container
- thisObject.upDownButton.container.frame.parentFrame = thisObject.container.frame
- thisObject.upDownButton.fitFunction = thisObject.fitFunction
- thisObject.upDownButton.initialize()
+ let isInitialized = false
+ let mouseOverCounter = 0
- thisObject.leftRightButton = newLeftRightButton()
- thisObject.leftRightButton.parentContainer = thisObject.container
- thisObject.leftRightButton.container.frame.parentFrame = thisObject.container.frame
- thisObject.leftRightButton.fitFunction = thisObject.fitFunction
- thisObject.leftRightButton.initialize()
+ let layersMap = new Map()
+ let visibleLayers = []
+ let firstVisibleLayer = 1
- onMouseWheelEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
- onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ const LAYER_SEPARATION = 0
- readObjectState()
+ let headerHeight = 40
+ let footerHeight = 10
+ let layerHeight = 70
+ let desiredVisibleLayers = 5
+ let posibleVisibleLayers = 5
+ let desiredPanelHeight = (layerHeight + LAYER_SEPARATION) * desiredVisibleLayers + headerHeight + footerHeight
+ let posiblePanelHeight = (layerHeight + LAYER_SEPARATION) * posibleVisibleLayers + headerHeight + footerHeight
- isInitialized = true
- }
+ let onMouseWheelEventSuscriptionId
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
- function onMouseOver (event) {
- isMouseOver = true
- }
+ let isMouseOver
+ return thisObject
- function onMouseNotOver () {
- isMouseOver = false
- }
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseWheelEventSuscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- function saveObjectStateVisibleLayers () {
- savePropertyAtNodeConfig(thisObject.payload, 'visibleLayers', desiredVisibleLayers)
- }
+ thisObject.upDownButton.finalize()
+ thisObject.upDownButton = undefined
- function saveObjectStatePanelLocation () {
- let panelLocation = {
- upOrDown: thisObject.upDownButton.status,
- leftOrRight: thisObject.leftRightButton.status
+ thisObject.leftRightButton.finalize()
+ thisObject.leftRightButton = undefined
+
+ layersMap = undefined
+ visibleLayers = undefined
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
+
+ thisObject.payload = undefined
+ thisObject = undefined
}
- savePropertyAtNodeConfig(thisObject.payload, 'panelLocation', panelLocation)
- }
- function readObjectState () {
- let storedValue
+ function initialize() {
+ thisObject.container.name = thisObject.payload.node.name
+ thisObject.container.frame.containerName = thisObject.container.name
+ thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
+ thisObject.container.frame.height = headerHeight
- storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'visibleLayers')
+ let position = { // Default position
+ x: canvas.chartingSpace.viewport.visibleArea.topLeft.x,
+ y: canvas.chartingSpace.viewport.visibleArea.topLeft.y
+ }
- if (isNaN(storedValue) || storedValue === null || storedValue === undefined) {
- // not using this value
- saveObjectStateVisibleLayers() // this overrides any invalid value at the config.
- return
- } else {
- if (storedValue < 0) { storedValue = 0 }
- if (storedValue > thisObject.layers.length) {
- storedValue = thisObject.layers.length
- }
+ thisObject.container.frame.position = position
+ loadFrame(thisObject.payload, thisObject.container.frame)
- if (storedValue !== desiredVisibleLayers) {
- desiredVisibleLayers = storedValue
+ thisObject.upDownButton = newUpDownButton()
+ thisObject.upDownButton.parentContainer = thisObject.container
+ thisObject.upDownButton.container.frame.parentFrame = thisObject.container.frame
+ thisObject.upDownButton.fitFunction = thisObject.fitFunction
+ thisObject.upDownButton.initialize()
+
+ thisObject.leftRightButton = newLeftRightButton()
+ thisObject.leftRightButton.parentContainer = thisObject.container
+ thisObject.leftRightButton.container.frame.parentFrame = thisObject.container.frame
+ thisObject.leftRightButton.fitFunction = thisObject.fitFunction
+ thisObject.leftRightButton.initialize()
+
+ onMouseWheelEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
+ onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+
+ readObjectState()
+
+ isInitialized = true
+ }
+
+ function onMouseOver(event) {
+ isMouseOver = true
+ }
+
+ function onMouseNotOver() {
+ isMouseOver = false
+ }
+
+ function saveObjectStateVisibleLayers() {
+ savePropertyAtNodeConfig(thisObject.payload, 'visibleLayers', desiredVisibleLayers)
+ }
+
+ function saveObjectStatePanelLocation() {
+ let panelLocation = {
+ upOrDown: thisObject.upDownButton.status,
+ leftOrRight: thisObject.leftRightButton.status
+ }
+ savePropertyAtNodeConfig(thisObject.payload, 'panelLocation', panelLocation)
+ }
+
+ function readObjectState() {
+ let storedValue
+
+ storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'visibleLayers')
+
+ if (isNaN(storedValue) || storedValue === null || storedValue === undefined) {
+ // not using this value
+ saveObjectStateVisibleLayers() // this overrides any invalid value at the config.
+ return
+ } else {
+ if (storedValue < 0) { storedValue = 0 }
+ if (storedValue > thisObject.layers.length) {
+ storedValue = thisObject.layers.length
+ }
+
+ if (storedValue !== desiredVisibleLayers) {
+ desiredVisibleLayers = storedValue
+ desiredPanelHeight = (layerHeight + LAYER_SEPARATION) * desiredVisibleLayers + headerHeight + footerHeight
+ calculateVisbleLayers()
+ }
+ }
+
+ storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'panelLocation')
+
+ if (storedValue === null || storedValue === undefined) {
+ // not using this value
+ saveObjectStatePanelLocation() // this overrides any invalid value at the config.
+ return
+ } else {
+ if (storedValue.upOrDown !== 'up' && storedValue.upOrDown !== 'down') {
+ saveObjectStatePanelLocation() // this overrides any invalid value at the config.
+ return
+ }
+ if (storedValue.leftOrRight !== 'left' && storedValue.leftOrRight !== 'right') {
+ saveObjectStatePanelLocation() // this overrides any invalid value at the config.
+ return
+ }
+ thisObject.upDownButton.setStatus(storedValue.upOrDown)
+ thisObject.leftRightButton.setStatus(storedValue.leftOrRight)
+ saveObjectStatePanelLocation()
+ }
+ }
+
+ function removeLayer(id) {
+ let layer = layersMap.get(id)
+ layersMap.delete(id)
+ layer.turnOff()
+ layer.container.eventHandler.stopListening(layer.onLayerStatusChangedEventSuscriptionId)
+ layer.container.eventHandler.stopListening(layer.onMouseWheelEventSuscriptionId)
+ layer.finalize()
+ }
+
+ function addLayer(layerNode) {
+ /* Now we create Product objects */
+ let layer = newLayer()
+ layer.payload = layerNode.payload
+ layer.nodeId = layerNode.payload.node.id
+ layer.fitFunction = thisObject.fitFunction
+
+ /* Initialize it */
+ layer.initialize(onInitialized)
+
+ function onInitialized(err) {
+ if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ layersMap.set(layerNode.id, layer)
+
+ /* Container Stuff */
+ layer.container.frame.parentFrame = thisObject.container.frame
+ layer.container.parentContainer = thisObject.container
+ layer.container.isWheelable = true
+
+ /* Add to the Product Array */
+ thisObject.layers.push(layer)
+
+ /* Listen to Status Changes Events */
+ layer.onLayerStatusChangedEventSuscriptionId = layer.container.eventHandler.listenToEvent('Status Changed', onLayerStatusChanged)
+ layer.onMouseWheelEventSuscriptionId = layer.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
+
+ layer.checkStatusAtShutDown()
+
+ return
+ }
+ }
+ }
+
+ function onMouseWheel(event) {
+ delta = event.wheelDelta
+ if (delta > 0) {
+ delta = -1
+ } else {
+ delta = 1
+ }
+
+ if (event.y - thisObject.container.frame.position.y - CURRENT_TOP_MARGIN < headerHeight) { // Mouse wheel over the header, not a layer
+ desiredVisibleLayers = desiredVisibleLayers + delta
+ if (desiredVisibleLayers < 0) { desiredVisibleLayers = 0 }
+ if (desiredVisibleLayers > thisObject.layers.length) { desiredVisibleLayers = thisObject.layers.length }
+ } else {
+ firstVisibleLayer = firstVisibleLayer + delta
+ }
desiredPanelHeight = (layerHeight + LAYER_SEPARATION) * desiredVisibleLayers + headerHeight + footerHeight
calculateVisbleLayers()
- }
+ saveObjectStateVisibleLayers()
}
- storedValue = loadPropertyFromNodeConfig(thisObject.payload, 'panelLocation')
+ function panelSizePhysics() {
+ if (isInitialized === false || thisObject.isHidden === true) { return }
- if (storedValue === null || storedValue === undefined) {
- // not using this value
- saveObjectStatePanelLocation() // this overrides any invalid value at the config.
- return
- } else {
- if (storedValue.upOrDown !== 'up' && storedValue.upOrDown !== 'down') {
- saveObjectStatePanelLocation() // this overrides any invalid value at the config.
- return
- }
- if (storedValue.leftOrRight !== 'left' && storedValue.leftOrRight !== 'right') {
- saveObjectStatePanelLocation() // this overrides any invalid value at the config.
- return
- }
- thisObject.upDownButton.setStatus(storedValue.upOrDown)
- thisObject.leftRightButton.setStatus(storedValue.leftOrRight)
- saveObjectStatePanelLocation()
- }
- }
+ let viewPortHeight = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
- function removeLayer (id) {
- let layer = layersMap.get(id)
- layersMap.delete(id)
- layer.turnOff()
- layer.container.eventHandler.stopListening(layer.onLayerStatusChangedEventSuscriptionId)
- layer.container.eventHandler.stopListening(layer.onMouseWheelEventSuscriptionId)
- layer.finalize()
- }
-
- function addLayer (layerNode) {
- /* Now we create Product objects */
- let layer = newLayer()
- layer.payload = layerNode.payload
- layer.nodeId = layerNode.payload.node.id
- layer.fitFunction = thisObject.fitFunction
-
- /* Initialize it */
- layer.initialize(onInitialized)
-
- function onInitialized (err) {
- if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
- layersMap.set(layerNode.id, layer)
-
- /* Container Stuff */
- layer.container.frame.parentFrame = thisObject.container.frame
- layer.container.parentContainer = thisObject.container
- layer.container.isWheelable = true
-
- /* Add to the Product Array */
- thisObject.layers.push(layer)
-
- /* Listen to Status Changes Events */
- layer.onLayerStatusChangedEventSuscriptionId = layer.container.eventHandler.listenToEvent('Status Changed', onLayerStatusChanged)
- layer.onMouseWheelEventSuscriptionId = layer.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
-
- layer.checkStatusAtShutDown()
-
- return
- }
- }
- }
-
- function onMouseWheel (event) {
- delta = event.wheelDelta
- if (delta > 0) {
- delta = -1
- } else {
- delta = 1
- }
-
- if (event.y - thisObject.container.frame.position.y - CURRENT_TOP_MARGIN < headerHeight) { // Mouse wheel over the header, not a layer
- desiredVisibleLayers = desiredVisibleLayers + delta
- if (desiredVisibleLayers < 0) { desiredVisibleLayers = 0 }
- if (desiredVisibleLayers > thisObject.layers.length) { desiredVisibleLayers = thisObject.layers.length }
- } else {
- firstVisibleLayer = firstVisibleLayer + delta
- }
- desiredPanelHeight = (layerHeight + LAYER_SEPARATION) * desiredVisibleLayers + headerHeight + footerHeight
- calculateVisbleLayers()
- saveObjectStateVisibleLayers()
- }
-
- function panelSizePhysics () {
- if (isInitialized === false || thisObject.isHidden === true) { return }
-
- let viewPortHeight = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
-
- if (viewPortHeight < headerHeight) {
- thisObject.visible = false
- } else {
- thisObject.visible = true
- }
-
- if (thisObject.visible === false) { return }
-
- if (desiredPanelHeight > viewPortHeight) {
- posibleVisibleLayers = Math.trunc((viewPortHeight - headerHeight - footerHeight) / (layerHeight + LAYER_SEPARATION))
- } else {
- posibleVisibleLayers = desiredVisibleLayers
- }
- if (thisObject.layers.length < posibleVisibleLayers) { posibleVisibleLayers = thisObject.layers.length }
-
- if (posibleVisibleLayers === 0) {
- posiblePanelHeight = (layerHeight + LAYER_SEPARATION) * posibleVisibleLayers + headerHeight
- } else {
- posiblePanelHeight = (layerHeight + LAYER_SEPARATION) * posibleVisibleLayers + headerHeight + footerHeight
- }
-
- thisObject.container.frame.height = posiblePanelHeight
- }
-
- function calculateVisbleLayers () {
- panelSizePhysics()
- let availableSlots = posibleVisibleLayers
-
- if (firstVisibleLayer < 1) { firstVisibleLayer = 1 }
- if (firstVisibleLayer > (thisObject.layers.length - availableSlots + 1)) { firstVisibleLayer = thisObject.layers.length - availableSlots + 1 }
-
- visibleLayers = []
-
- for (let i = 0; i < thisObject.layers.length; i++) {
- if (i + 1 >= firstVisibleLayer && i + 1 < firstVisibleLayer + availableSlots) {
- let layer = thisObject.layers[i]
-
- layer.container.frame.position.x = 0
- layer.container.frame.position.y = (layerHeight + LAYER_SEPARATION) * visibleLayers.length + headerHeight
-
- /* Add to Visible Product Array */
- visibleLayers.push(layer)
- }
- }
- }
-
- function onLayerStatusChanged (layer) {
- thisObject.container.eventHandler.raiseEvent('Layer Status Changed', layer)
- }
-
- function getContainer (point, purpose) {
- if (isInitialized === false || thisObject.visible === false || thisObject.isHidden === true) { return }
- let container
-
- if (isMouseOver === true && purpose !== GET_CONTAINER_PURPOSE.MOUSE_OVER) {
- container = thisObject.upDownButton.getContainer(point)
- if (container !== undefined) { return container }
-
- container = thisObject.leftRightButton.getContainer(point)
- if (container !== undefined) { return container }
- }
-
- /* First we check if thisObject point is inside thisObject space. */
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- /* Now we see which is the inner most container that has it */
- for (let i = 0; i < visibleLayers.length; i++) {
- container = visibleLayers[i].getContainer(point)
-
- if (container !== undefined) {
- let checkPoint = {
- x: point.x,
- y: point.y
- }
-
- checkPoint = thisObject.fitFunction(checkPoint)
-
- if (point.x === checkPoint.x && point.y === checkPoint.y) {
- if (purpose !== GET_CONTAINER_PURPOSE.MOUSE_OVER) {
- return container
- }
- }
+ if (viewPortHeight < headerHeight) {
+ thisObject.visible = false
+ } else {
+ thisObject.visible = true
}
- }
- /* The point does not belong to any inner container, so we return the current container. */
- let checkPoint = {
- x: point.x,
- y: point.y
- }
+ if (thisObject.visible === false) { return }
- checkPoint = thisObject.fitFunction(checkPoint)
-
- if (point.x === checkPoint.x && point.y === checkPoint.y) {
- return thisObject.container
- }
- }
- }
-
- function childrenPhysics () {
- for (let i = 0; i < thisObject.layers.length; i++) {
- let layer = thisObject.layers[i]
- layer.physics()
- }
- }
-
- function syncWithConfigPhysics () {
- readObjectState()
- }
-
- function physics () {
- if (isInitialized === false) { return }
- if (thisObject.payload.node === undefined) { return }
-
- thisObject.upDownButton.physics()
- thisObject.leftRightButton.physics()
- saveFrame(thisObject.payload, thisObject.container.frame)
- syncWithConfigPhysics()
-
- /*
- The overall idea here is that we need to keep syncronized the panel with the layers that are
- defined at the Designer. Users can connect or disconnect any objext resulting in changes in which
- are valid layers and which not at any point in time. So what we do here is trying to keep the panel
- only with the layers that are connected to the Charting Space hiriarcy.
-
- To achieve this, first we are going to move all session related cards to a local array. Then we are
- going to check for layers at the designer, and will move back the cards which still have layers well
- defined to where they were.
-
- If we find new layers we will add them at that point. Finally, the cards that still remain at the
- local array after all the layers at the designer have been processed, are turned off and discarded.
- */
- childrenPhysics()
-
- let localLayers = []
- moveToLocalLayers()
- syncWithDesignerLayers()
-
- /* At this poins all the cards still at the local array need to be removed from the panel. */
- turnOffUnusedLayers()
- calculateVisbleLayers()
-
- function syncWithDesignerLayers () {
- if (thisObject.payload.node === undefined) { return }
- let layerManager = thisObject.payload.node
- for (let p = 0; p < layerManager.layers.length; p++) {
- let layerNode = layerManager.layers[p]
-
- let found = removeFromLocalLayers(layerNode.id)
- if (found !== true) {
- layer = addLayer(layerNode)
- if (layer !== undefined) {
- onLayerStatusChanged(layer)
- }
+ if (desiredPanelHeight > viewPortHeight) {
+ posibleVisibleLayers = Math.trunc((viewPortHeight - headerHeight - footerHeight) / (layerHeight + LAYER_SEPARATION))
+ } else {
+ posibleVisibleLayers = desiredVisibleLayers
}
- }
+ if (thisObject.layers.length < posibleVisibleLayers) { posibleVisibleLayers = thisObject.layers.length }
+
+ if (posibleVisibleLayers === 0) {
+ posiblePanelHeight = (layerHeight + LAYER_SEPARATION) * posibleVisibleLayers + headerHeight
+ } else {
+ posiblePanelHeight = (layerHeight + LAYER_SEPARATION) * posibleVisibleLayers + headerHeight + footerHeight
+ }
+
+ thisObject.container.frame.height = posiblePanelHeight
}
- function moveToLocalLayers () {
- removeNext()
+ function calculateVisbleLayers() {
+ panelSizePhysics()
+ let availableSlots = posibleVisibleLayers
+
+ if (firstVisibleLayer < 1) { firstVisibleLayer = 1 }
+ if (firstVisibleLayer > (thisObject.layers.length - availableSlots + 1)) { firstVisibleLayer = thisObject.layers.length - availableSlots + 1 }
+
+ visibleLayers = []
- function removeNext () {
for (let i = 0; i < thisObject.layers.length; i++) {
- let layer = thisObject.layers[i]
+ if (i + 1 >= firstVisibleLayer && i + 1 < firstVisibleLayer + availableSlots) {
+ let layer = thisObject.layers[i]
- thisObject.layers.splice(i, 1)
- localLayers.push(layer)
- removeNext()
+ layer.container.frame.position.x = 0
+ layer.container.frame.position.y = (layerHeight + LAYER_SEPARATION) * visibleLayers.length + headerHeight
+
+ /* Add to Visible Product Array */
+ visibleLayers.push(layer)
+ }
}
- }
}
- function removeFromLocalLayers (id) {
- for (let i = 0; i < localLayers.length; i++) {
- let layer = localLayers[i]
- if (layer.payload.node.id === id) {
- thisObject.layers.push(layer)
- localLayers.splice(i, 1)
- return true
+ function onLayerStatusChanged(layer) {
+ thisObject.container.eventHandler.raiseEvent('Layer Status Changed', layer)
+ }
+
+ function getContainer(point, purpose) {
+ if (isInitialized === false || thisObject.visible === false || thisObject.isHidden === true) { return }
+ let container
+
+ if (isMouseOver === true && purpose !== GET_CONTAINER_PURPOSE.MOUSE_OVER) {
+ container = thisObject.upDownButton.getContainer(point)
+ if (container !== undefined) { return container }
+
+ container = thisObject.leftRightButton.getContainer(point)
+ if (container !== undefined) { return container }
+ }
+
+ /* First we check if thisObject point is inside thisObject space. */
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ /* Now we see which is the inner most container that has it */
+ for (let i = 0; i < visibleLayers.length; i++) {
+ container = visibleLayers[i].getContainer(point)
+
+ if (container !== undefined) {
+ let checkPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ checkPoint = thisObject.fitFunction(checkPoint)
+
+ if (point.x === checkPoint.x && point.y === checkPoint.y) {
+ if (purpose !== GET_CONTAINER_PURPOSE.MOUSE_OVER) {
+ return container
+ }
+ }
+ }
+ }
+
+ /* The point does not belong to any inner container, so we return the current container. */
+ let checkPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ checkPoint = thisObject.fitFunction(checkPoint)
+
+ if (point.x === checkPoint.x && point.y === checkPoint.y) {
+ return thisObject.container
+ }
}
- }
}
- function turnOffUnusedLayers () {
- for (let i = 0; i < localLayers.length; i++) {
- let layer = localLayers[i]
- removeLayer(layer.nodeId)
- }
- }
- }
-
- function draw () {
- if (isInitialized === false || thisObject.visible === false || thisObject.isHidden === true) { return }
-
- // thisObject.container.frame.draw(false, false, false, thisObject.fitFunction)
-
- drawHeader()
- for (let i = 0; i < visibleLayers.length; i++) {
- visibleLayers[i].draw()
- }
- drawScrollBar()
- if (isMouseOver === true) {
- thisObject.upDownButton.draw()
- thisObject.leftRightButton.draw()
- }
- }
-
- function drawHeader () {
- if (thisObject.payload === undefined) { return }
- if (thisObject.payload.node === undefined) { return }
- if (thisObject.payload.node.payload.parentNode === undefined) { return }
- if (thisObject.payload.node.payload.parentNode.payload.parentNode === undefined) { return }
-
- let label1 = thisObject.payload.node.payload.parentNode.payload.parentNode.name.substring(0, 18)
- let label2 = thisObject.payload.node.payload.parentNode.name.substring(0, 18)
- let label3 = ''
-
- let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.payload.parentNode.type)
- let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
-
- let backgroundColor = UI_COLOR.BLACK
-
- let params = {
- cornerRadius: 5,
- lineWidth: 1,
- container: thisObject.container,
- borderColor: UI_COLOR.RUSTED_RED,
- castShadow: false,
- backgroundColor: backgroundColor,
- opacity: 1
+ function childrenPhysics() {
+ for (let i = 0; i < thisObject.layers.length; i++) {
+ let layer = thisObject.layers[i]
+ layer.physics()
+ }
}
- roundedCornersBackground(params)
-
- drawLabel(label1, 1 / 2, 0, 0, 15, 9, thisObject.container)
- drawLabel(label2, 1 / 2, 0, 0, 30, 9, thisObject.container)
-
- drawIcon(icon1, 1 / 8, 0, 0, 20, 28, thisObject.container)
- drawIcon(icon2, 7 / 8, 0, 0, 20, 28, thisObject.container)
- }
-
- function drawScrollBar () {
- if (thisObject.layers.length > posibleVisibleLayers && posibleVisibleLayers > 0) {
- let xOffset = 4
- let barTopPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: headerHeight
- }
- let barBottomPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: thisObject.container.frame.height - footerHeight
- }
- let ratio = posibleVisibleLayers / thisObject.layers.length
- let handleHeight = (posibleVisibleLayers * (layerHeight + LAYER_SEPARATION)) * ratio
- let handleTopPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: headerHeight + (layerHeight + LAYER_SEPARATION) * ratio * (firstVisibleLayer - 1)
- }
- let handleBottomPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: handleTopPoint.y + handleHeight
- }
- barTopPoint = thisObject.container.frame.frameThisPoint(barTopPoint)
- barBottomPoint = thisObject.container.frame.frameThisPoint(barBottomPoint)
- handleTopPoint = thisObject.container.frame.frameThisPoint(handleTopPoint)
- handleBottomPoint = thisObject.container.frame.frameThisPoint(handleBottomPoint)
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(barTopPoint.x, barTopPoint.y)
- browserCanvasContext.lineTo(barBottomPoint.x, barBottomPoint.y)
- browserCanvasContext.closePath()
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + 1 + ')'
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(handleTopPoint.x, handleTopPoint.y)
- browserCanvasContext.lineTo(handleBottomPoint.x, handleBottomPoint.y)
- browserCanvasContext.closePath()
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.lineWidth = 4
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', ' + 1 + ')'
- browserCanvasContext.stroke()
+ function syncWithConfigPhysics() {
+ readObjectState()
+ }
+
+ function physics() {
+ if (isInitialized === false) { return }
+ if (thisObject.payload.node === undefined) { return }
+
+ thisObject.upDownButton.physics()
+ thisObject.leftRightButton.physics()
+ saveFrame(thisObject.payload, thisObject.container.frame)
+ syncWithConfigPhysics()
+
+ /*
+ The overall idea here is that we need to keep syncronized the panel with the layers that are
+ defined at the Designer. Users can connect or disconnect any objext resulting in changes in which
+ are valid layers and which not at any point in time. So what we do here is trying to keep the panel
+ only with the layers that are connected to the Charting Space hiriarcy.
+
+ To achieve this, first we are going to move all session related cards to a local array. Then we are
+ going to check for layers at the designer, and will move back the cards which still have layers well
+ defined to where they were.
+
+ If we find new layers we will add them at that point. Finally, the cards that still remain at the
+ local array after all the layers at the designer have been processed, are turned off and discarded.
+ */
+ childrenPhysics()
+
+ let localLayers = []
+ moveToLocalLayers()
+ syncWithDesignerLayers()
+
+ /* At this poins all the cards still at the local array need to be removed from the panel. */
+ turnOffUnusedLayers()
+ calculateVisbleLayers()
+
+ function syncWithDesignerLayers() {
+ if (thisObject.payload.node === undefined) { return }
+ let layerManager = thisObject.payload.node
+ for (let p = 0; p < layerManager.layers.length; p++) {
+ let layerNode = layerManager.layers[p]
+
+ let found = removeFromLocalLayers(layerNode.id)
+ if (found !== true) {
+ layer = addLayer(layerNode)
+ if (layer !== undefined) {
+ onLayerStatusChanged(layer)
+ }
+ }
+ }
+ }
+
+ function moveToLocalLayers() {
+ removeNext()
+
+ function removeNext() {
+ for (let i = 0; i < thisObject.layers.length; i++) {
+ let layer = thisObject.layers[i]
+
+ thisObject.layers.splice(i, 1)
+ localLayers.push(layer)
+ removeNext()
+ }
+ }
+ }
+
+ function removeFromLocalLayers(id) {
+ for (let i = 0; i < localLayers.length; i++) {
+ let layer = localLayers[i]
+ if (layer.payload.node.id === id) {
+ thisObject.layers.push(layer)
+ localLayers.splice(i, 1)
+ return true
+ }
+ }
+ }
+
+ function turnOffUnusedLayers() {
+ for (let i = 0; i < localLayers.length; i++) {
+ let layer = localLayers[i]
+ removeLayer(layer.nodeId)
+ }
+ }
+ }
+
+ function draw() {
+ if (isInitialized === false || thisObject.visible === false || thisObject.isHidden === true) { return }
+
+ // thisObject.container.frame.draw(false, false, false, thisObject.fitFunction)
+
+ drawHeader()
+ for (let i = 0; i < visibleLayers.length; i++) {
+ visibleLayers[i].draw()
+ }
+ drawScrollBar()
+ if (isMouseOver === true) {
+ thisObject.upDownButton.draw()
+ thisObject.leftRightButton.draw()
+ }
+ }
+
+ function drawHeader() {
+ if (thisObject.payload === undefined) { return }
+ if (thisObject.payload.node === undefined) { return }
+ if (thisObject.payload.node.payload.parentNode === undefined) { return }
+ if (thisObject.payload.node.payload.parentNode.payload.parentNode === undefined) { return }
+
+ let label1 = thisObject.payload.node.payload.parentNode.payload.parentNode.name.substring(0, 18)
+ let label2 = thisObject.payload.node.payload.parentNode.name.substring(0, 18)
+ let label3 = ''
+
+ let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.payload.parentNode.type)
+ let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
+
+ let backgroundColor = UI_COLOR.BLACK
+
+ let params = {
+ cornerRadius: 5,
+ lineWidth: 1,
+ container: thisObject.container,
+ borderColor: UI_COLOR.RUSTED_RED,
+ castShadow: false,
+ backgroundColor: backgroundColor,
+ opacity: 1
+ }
+
+ roundedCornersBackground(params)
+
+ drawLabel(label1, 1 / 2, 0, 0, 15, 9, thisObject.container)
+ drawLabel(label2, 1 / 2, 0, 0, 30, 9, thisObject.container)
+
+ drawIcon(icon1, 1 / 8, 0, 0, 20, 28, thisObject.container)
+ drawIcon(icon2, 7 / 8, 0, 0, 20, 28, thisObject.container)
+ }
+
+ function drawScrollBar() {
+ if (thisObject.layers.length > posibleVisibleLayers && posibleVisibleLayers > 0) {
+ let xOffset = 4
+ let barTopPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: headerHeight
+ }
+ let barBottomPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: thisObject.container.frame.height - footerHeight
+ }
+ let ratio = posibleVisibleLayers / thisObject.layers.length
+ let handleHeight = (posibleVisibleLayers * (layerHeight + LAYER_SEPARATION)) * ratio
+ let handleTopPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: headerHeight + (layerHeight + LAYER_SEPARATION) * ratio * (firstVisibleLayer - 1)
+ }
+ let handleBottomPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: handleTopPoint.y + handleHeight
+ }
+ barTopPoint = thisObject.container.frame.frameThisPoint(barTopPoint)
+ barBottomPoint = thisObject.container.frame.frameThisPoint(barBottomPoint)
+ handleTopPoint = thisObject.container.frame.frameThisPoint(handleTopPoint)
+ handleBottomPoint = thisObject.container.frame.frameThisPoint(handleBottomPoint)
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(barTopPoint.x, barTopPoint.y)
+ browserCanvasContext.lineTo(barBottomPoint.x, barBottomPoint.y)
+ browserCanvasContext.closePath()
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + 1 + ')'
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(handleTopPoint.x, handleTopPoint.y)
+ browserCanvasContext.lineTo(handleBottomPoint.x, handleBottomPoint.y)
+ browserCanvasContext.closePath()
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.lineWidth = 4
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', ' + 1 + ')'
+ browserCanvasContext.stroke()
+ }
}
- }
}
diff --git a/CanvasApp/Panels/LeftRightButton.js b/CanvasApp/Panels/LeftRightButton.js
index cac7c7345..9478e83ee 100644
--- a/CanvasApp/Panels/LeftRightButton.js
+++ b/CanvasApp/Panels/LeftRightButton.js
@@ -1,244 +1,244 @@
-function newLeftRightButton () {
- let thisObject = {
- container: undefined,
- fitFunction: undefined,
- parentContainer: undefined,
- status: undefined,
- setStatus: setStatus,
- physics: physics,
- draw: draw,
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize,
- finalize: finalize
- }
-
- let isInitialized = false
- /* Cointainer stuff */
-
- thisObject.container = newContainer()
- thisObject.container.name = 'Left Right Button'
- thisObject.container.initialize()
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
- thisObject.container.frame.containerName = 'Left Right Button'
-
- thisObject.status = 'left'
- let leftPosition = {}
- let rightPosition = {}
- let transitionPosition = {}
-
- let onMouseClickEventSuscriptionId
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.parentContainer = undefined
-
- thisObject.status = undefined
- leftPosition = undefined
- rightPosition = undefined
- transitionPosition = undefined
- }
-
- function initialize () {
- thisObject.container.frame.width = 12
- thisObject.container.frame.height = 12
-
- let position = {
- x: thisObject.container.frame.parentFrame.width * 2.25 / 8 - thisObject.container.frame.width / 2,
- y: 40 * 4 / 8 - thisObject.container.frame.height / 2
+function newLeftRightButton() {
+ let thisObject = {
+ container: undefined,
+ fitFunction: undefined,
+ parentContainer: undefined,
+ status: undefined,
+ setStatus: setStatus,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize,
+ finalize: finalize
}
- thisObject.container.frame.position = position
+ let isInitialized = false
+ /* Cointainer stuff */
- leftPosition.x = thisObject.parentContainer.frame.position.x
- leftPosition.y = thisObject.parentContainer.frame.position.y
+ thisObject.container = newContainer()
+ thisObject.container.name = 'Left Right Button'
+ thisObject.container.initialize()
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.containerName = 'Left Right Button'
- rightPosition.x = thisObject.parentContainer.frame.position.x
- rightPosition.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y
+ thisObject.status = 'left'
+ let leftPosition = {}
+ let rightPosition = {}
+ let transitionPosition = {}
- transitionPosition.x = leftPosition.x
- transitionPosition.y = leftPosition.y
+ let onMouseClickEventSuscriptionId
+ return thisObject
- /* Lets listen to our own events to react when we have a Mouse Click */
- onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.parentContainer = undefined
- isInitialized = true
- }
-
- function setStatus (value) {
- if (value === 'left' && thisObject.status === 'right') {
- thisObject.status = 'going left'
+ thisObject.status = undefined
+ leftPosition = undefined
+ rightPosition = undefined
+ transitionPosition = undefined
}
- if (value === 'right' && thisObject.status === 'left') {
- thisObject.status = 'going right'
+
+ function initialize() {
+ thisObject.container.frame.width = 12
+ thisObject.container.frame.height = 12
+
+ let position = {
+ x: thisObject.container.frame.parentFrame.width * 2.25 / 8 - thisObject.container.frame.width / 2,
+ y: 40 * 4 / 8 - thisObject.container.frame.height / 2
+ }
+
+ thisObject.container.frame.position = position
+
+ leftPosition.x = thisObject.parentContainer.frame.position.x
+ leftPosition.y = thisObject.parentContainer.frame.position.y
+
+ rightPosition.x = thisObject.parentContainer.frame.position.x
+ rightPosition.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y
+
+ transitionPosition.x = leftPosition.x
+ transitionPosition.y = leftPosition.y
+
+ /* Lets listen to our own events to react when we have a Mouse Click */
+ onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+
+ isInitialized = true
}
- }
- function onMouseClick (event) {
- if (thisObject.status === 'left') {
- transitionPosition.x = leftPosition.x
- transitionPosition.y = leftPosition.y
-
- thisObject.status = 'going right'
- } else {
- transitionPosition.x = rightPosition.x
- transitionPosition.y = rightPosition.y
-
- thisObject.status = 'going left'
+ function setStatus(value) {
+ if (value === 'left' && thisObject.status === 'right') {
+ thisObject.status = 'going left'
+ }
+ if (value === 'right' && thisObject.status === 'left') {
+ thisObject.status = 'going right'
+ }
}
- }
- function physics () {
- if (isInitialized === false) { return }
+ function onMouseClick(event) {
+ if (thisObject.status === 'left') {
+ transitionPosition.x = leftPosition.x
+ transitionPosition.y = leftPosition.y
- leftPosition.x = canvas.chartingSpace.viewport.visibleArea.topLeft.x
- leftPosition.y = thisObject.parentContainer.frame.position.y
+ thisObject.status = 'going right'
+ } else {
+ transitionPosition.x = rightPosition.x
+ transitionPosition.y = rightPosition.y
- rightPosition.x = canvas.chartingSpace.viewport.visibleArea.bottomRight.x
- rightPosition.y = thisObject.parentContainer.frame.position.y
-
- if (thisObject.status === 'going right') {
- if (transitionPosition.x < rightPosition.x) {
- transitionPosition.x = transitionPosition.x + 50
- thisObject.parentContainer.frame.position.x = transitionPosition.x
- } else {
- thisObject.parentContainer.frame.position.x = rightPosition.x
- thisObject.status = 'right'
- }
+ thisObject.status = 'going left'
+ }
}
- if (thisObject.status === 'going left') {
- if (transitionPosition.x > leftPosition.x) {
- transitionPosition.x = transitionPosition.x - 50
- thisObject.parentContainer.frame.position.x = transitionPosition.x
- } else {
- thisObject.parentContainer.frame.position.x = leftPosition.x
- thisObject.status = 'left'
- }
+
+ function physics() {
+ if (isInitialized === false) { return }
+
+ leftPosition.x = canvas.chartingSpace.viewport.visibleArea.topLeft.x
+ leftPosition.y = thisObject.parentContainer.frame.position.y
+
+ rightPosition.x = canvas.chartingSpace.viewport.visibleArea.bottomRight.x
+ rightPosition.y = thisObject.parentContainer.frame.position.y
+
+ if (thisObject.status === 'going right') {
+ if (transitionPosition.x < rightPosition.x) {
+ transitionPosition.x = transitionPosition.x + 50
+ thisObject.parentContainer.frame.position.x = transitionPosition.x
+ } else {
+ thisObject.parentContainer.frame.position.x = rightPosition.x
+ thisObject.status = 'right'
+ }
+ }
+ if (thisObject.status === 'going left') {
+ if (transitionPosition.x > leftPosition.x) {
+ transitionPosition.x = transitionPosition.x - 50
+ thisObject.parentContainer.frame.position.x = transitionPosition.x
+ } else {
+ thisObject.parentContainer.frame.position.x = leftPosition.x
+ thisObject.status = 'left'
+ }
+ }
}
- }
- function draw () {
- if (isInitialized === false) { return }
+ function draw() {
+ if (isInitialized === false) { return }
- drawButton()
- }
-
- function getContainer (point, purpose) {
- let container
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
+ drawButton()
}
- }
- function drawButton () {
- let point1
- let point2
- let point3
-
- switch (thisObject.status) {
- case 'left': {
- point1 = {
- x: 3,
- y: 3
+ function getContainer(point, purpose) {
+ let container
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
}
-
- point2 = {
- x: 3,
- y: thisObject.container.frame.height - 3
- }
-
- point3 = {
- x: thisObject.container.frame.width - 3,
- y: thisObject.container.frame.height / 2
- }
- break
- }
-
- case 'going right': {
- point1 = {
- x: 4,
- y: 4
- }
-
- point2 = {
- x: 4,
- y: thisObject.container.frame.height - 4
- }
-
- point3 = {
- x: thisObject.container.frame.width - 4,
- y: thisObject.container.frame.height / 2
- }
- break
- }
-
- case 'going left': {
- point1 = {
- x: thisObject.container.frame.width - 4,
- y: 4
- }
-
- point2 = {
- x: thisObject.container.frame.width - 4,
- y: thisObject.container.frame.height - 4
- }
-
- point3 = {
- x: 4,
- y: thisObject.container.frame.height / 2
- }
- break
- }
-
- case 'right': {
- point1 = {
- x: thisObject.container.frame.width - 3,
- y: 3
- }
-
- point2 = {
- x: thisObject.container.frame.width - 3,
- y: thisObject.container.frame.height - 3
- }
-
- point3 = {
- x: 3,
- y: thisObject.container.frame.height / 2
- }
- break
- }
}
+ function drawButton() {
+ let point1
+ let point2
+ let point3
+
+ switch (thisObject.status) {
+ case 'left': {
+ point1 = {
+ x: 3,
+ y: 3
+ }
+
+ point2 = {
+ x: 3,
+ y: thisObject.container.frame.height - 3
+ }
+
+ point3 = {
+ x: thisObject.container.frame.width - 3,
+ y: thisObject.container.frame.height / 2
+ }
+ break
+ }
+
+ case 'going right': {
+ point1 = {
+ x: 4,
+ y: 4
+ }
+
+ point2 = {
+ x: 4,
+ y: thisObject.container.frame.height - 4
+ }
+
+ point3 = {
+ x: thisObject.container.frame.width - 4,
+ y: thisObject.container.frame.height / 2
+ }
+ break
+ }
+
+ case 'going left': {
+ point1 = {
+ x: thisObject.container.frame.width - 4,
+ y: 4
+ }
+
+ point2 = {
+ x: thisObject.container.frame.width - 4,
+ y: thisObject.container.frame.height - 4
+ }
+
+ point3 = {
+ x: 4,
+ y: thisObject.container.frame.height / 2
+ }
+ break
+ }
+
+ case 'right': {
+ point1 = {
+ x: thisObject.container.frame.width - 3,
+ y: 3
+ }
+
+ point2 = {
+ x: thisObject.container.frame.width - 3,
+ y: thisObject.container.frame.height - 3
+ }
+
+ point3 = {
+ x: 3,
+ y: thisObject.container.frame.height / 2
+ }
+ break
+ }
+ }
+
/* Now the transformations. */
- point1 = thisObject.container.frame.frameThisPoint(point1)
- point2 = thisObject.container.frame.frameThisPoint(point2)
- point3 = thisObject.container.frame.frameThisPoint(point3)
+ point1 = thisObject.container.frame.frameThisPoint(point1)
+ point2 = thisObject.container.frame.frameThisPoint(point2)
+ point3 = thisObject.container.frame.frameThisPoint(point3)
- if (thisObject.fitFunction !== undefined) {
- point1 = thisObject.fitFunction(point1)
- point2 = thisObject.fitFunction(point2)
- point3 = thisObject.fitFunction(point3)
- }
+ if (thisObject.fitFunction !== undefined) {
+ point1 = thisObject.fitFunction(point1)
+ point2 = thisObject.fitFunction(point2)
+ point3 = thisObject.fitFunction(point3)
+ }
/* Lets start the drawing. */
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.lineTo(point1.x, point1.y)
- browserCanvasContext.closePath()
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.lineTo(point1.x, point1.y)
+ browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(250, 250, 250, 1)'
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.stroke()
+ browserCanvasContext.strokeStyle = 'rgba(250, 250, 250, 1)'
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.stroke()
- browserCanvasContext.fillStyle = 'rgba(250, 250, 250, 1)'
- browserCanvasContext.fill()
- }
+ browserCanvasContext.fillStyle = 'rgba(250, 250, 250, 1)'
+ browserCanvasContext.fill()
+ }
}
diff --git a/CanvasApp/Panels/PanelsVisibleButton.js b/CanvasApp/Panels/PanelsVisibleButton.js
index b2266845e..7c2528eba 100644
--- a/CanvasApp/Panels/PanelsVisibleButton.js
+++ b/CanvasApp/Panels/PanelsVisibleButton.js
@@ -1,84 +1,84 @@
-function newPanelsVisibleButton () {
- let thisObject = {
- container: undefined,
- fitFunction: undefined,
- parentContainer: undefined,
- panels: undefined,
- showPanels: true,
- draw: draw,
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize,
- finalize: finalize
- }
-
- /* Cointainer stuff */
- thisObject.container = newContainer()
- thisObject.container.name = 'Panels Visible Button'
- thisObject.container.initialize()
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
- thisObject.container.frame.containerName = 'Panels Visible Button'
-
- let onMouseClickEventSuscriptionId
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.parentContainer = undefined
- thisObject.panels = undefined
- }
-
- function initialize (panels) {
- thisObject.panels = panels
- setPanelVisibility()
-
- thisObject.container.frame.width = 25
- thisObject.container.frame.height = 25
-
- let position = {
- x: thisObject.container.frame.width * 1 / 8,
- y: 45
+function newPanelsVisibleButton() {
+ let thisObject = {
+ container: undefined,
+ fitFunction: undefined,
+ parentContainer: undefined,
+ panels: undefined,
+ showPanels: true,
+ draw: draw,
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize,
+ finalize: finalize
}
- thisObject.container.frame.position = position
+ /* Cointainer stuff */
+ thisObject.container = newContainer()
+ thisObject.container.name = 'Panels Visible Button'
+ thisObject.container.initialize()
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.containerName = 'Panels Visible Button'
- /* Lets listen to our own events to react when we have a Mouse Click */
- onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
- }
+ let onMouseClickEventSuscriptionId
+ return thisObject
- function onMouseClick (event) {
- if (thisObject.showPanels === false) {
- thisObject.showPanels = true
- } else {
- thisObject.showPanels = false
- }
- setPanelVisibility()
- }
-
- function setPanelVisibility () {
- for (let i = 0; i < thisObject.panels.length; i++) {
- panel = canvas.panelsSpace.getPanel(thisObject.panels[i])
- panel.isVisible = thisObject.showPanels
- }
- }
-
- function getContainer (point) {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- }
- }
-
- function draw () {
- let icon
- if (thisObject.showPanels === true) {
- icon = canvas.designSpace.iconCollection.get('plotter-panel')
- } else {
- icon = canvas.designSpace.iconCollection.get('toggle-panel-off')
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.parentContainer = undefined
+ thisObject.panels = undefined
}
- drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 14, thisObject.container)
- }
+ function initialize(panels) {
+ thisObject.panels = panels
+ setPanelVisibility()
+
+ thisObject.container.frame.width = 25
+ thisObject.container.frame.height = 25
+
+ let position = {
+ x: thisObject.container.frame.width * 1 / 8,
+ y: 45
+ }
+
+ thisObject.container.frame.position = position
+
+ /* Lets listen to our own events to react when we have a Mouse Click */
+ onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ }
+
+ function onMouseClick(event) {
+ if (thisObject.showPanels === false) {
+ thisObject.showPanels = true
+ } else {
+ thisObject.showPanels = false
+ }
+ setPanelVisibility()
+ }
+
+ function setPanelVisibility() {
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ panel = canvas.panelsSpace.getPanel(thisObject.panels[i])
+ panel.isVisible = thisObject.showPanels
+ }
+ }
+
+ function getContainer(point) {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ }
+ }
+
+ function draw() {
+ let icon
+ if (thisObject.showPanels === true) {
+ icon = canvas.designSpace.iconCollection.get('plotter-panel')
+ } else {
+ icon = canvas.designSpace.iconCollection.get('toggle-panel-off')
+ }
+
+ drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 14, thisObject.container)
+ }
}
diff --git a/CanvasApp/Panels/PlotterPanel.js b/CanvasApp/Panels/PlotterPanel.js
index 2db96284a..2b02913b5 100644
--- a/CanvasApp/Panels/PlotterPanel.js
+++ b/CanvasApp/Panels/PlotterPanel.js
@@ -1,174 +1,174 @@
-function newPlotterPanel () {
- const MODULE_NAME = 'Plotter Panel'
- const ERROR_LOG = true
- const INTENSIVE_LOG = false
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newPlotterPanel() {
+ const MODULE_NAME = 'Plotter Panel'
+ const ERROR_LOG = true
+ const INTENSIVE_LOG = false
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- fitFunction: undefined,
- container: undefined,
- isVisible: true,
- onRecordChange: onRecordChange,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize('Plotter Panel')
-
- let heightFactor = 1
- let currentRecord
- let upDownButton
- let panelNode
-
- return thisObject
-
- function finalize () {
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.isVisible = undefined
-
- heightFactor = undefined
- currentRecord = undefined
- upDownButton.finalize()
- upDownButton = undefined
- panelNode = undefined
- }
-
- function initialize (pPanelNode) {
- panelNode = pPanelNode
- thisObject.container.frame.containerName = panelNode.name
-
- thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
- thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL
-
- thisObject.container.frame.position.x = canvas.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width - thisObject.container.frame.width * Math.random() * 8
- thisObject.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height - thisObject.container.frame.height * Math.random() * 1.5
-
- upDownButton = newUpDownButton()
- upDownButton.parentContainer = thisObject.container
- upDownButton.container.frame.parentFrame = thisObject.container.frame
- upDownButton.fitFunction = thisObject.fitFunction
- upDownButton.initialize()
- }
-
- function getContainer (point) {
- if (thisObject.isVisible !== true) { return }
- let container
-
- container = upDownButton.getContainer(point)
- if (container !== undefined) { return container }
-
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- let checkPoint = {
- x: point.x,
- y: point.y
- }
-
- checkPoint = thisObject.fitFunction(checkPoint)
-
- if (point.x === checkPoint.x && point.y === checkPoint.y) {
- return thisObject.container
- }
- }
- }
-
- function onRecordChange (pCurrentRecord) {
- currentRecord = pCurrentRecord
- }
-
- function draw () {
- if (thisObject.isVisible !== true) { return }
-
- thisObject.container.frame.draw(false, false, true, thisObject.fitFunction)
- plotCurrentRecordData()
- upDownButton.draw()
- }
-
- function plotCurrentRecordData () {
- const frameBodyHeight = thisObject.container.frame.getBodyHeight()
- const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight
-
- const X_AXIS = thisObject.container.frame.width / 2
- const Y_AXIS = frameTitleHeight + frameBodyHeight / 2
-
- const PANEL_HEIGHT = UI_PANEL.HEIGHT.NORMAL
-
- if (currentRecord === undefined) { return }
- let record = currentRecord
-
- /* First we execute code if provided. */
- if (panelNode.javascriptCode !== undefined) {
- try {
- eval(panelNode.javascriptCode.code)
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> err = ' + err.stack) }
- if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> javascriptCode.code = ' + panelNode.javascriptCode.code) }
- }
+ let thisObject = {
+ fitFunction: undefined,
+ container: undefined,
+ isVisible: true,
+ onRecordChange: onRecordChange,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- /* Second we go through the panel data. */
- if (panelNode.panelData === undefined) { return }
- for (let i = 0; i < panelNode.panelData.length; i++) {
- let panelData = panelNode.panelData[i]
+ thisObject.container = newContainer()
+ thisObject.container.initialize('Plotter Panel')
- let labelText = panelData.name
- let labelPosition = i * 10 + 12
- let valuePosition = i * 10 + 17
- let value = 'No value defined.'
+ let heightFactor = 1
+ let currentRecord
+ let upDownButton
+ let panelNode
- if (valuePosition > 100) {
- thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.25
- }
+ return thisObject
- if (valuePosition > 125) {
- thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.50
- }
+ function finalize() {
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.isVisible = undefined
- if (valuePosition > 150) {
- thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.75
- }
+ heightFactor = undefined
+ currentRecord = undefined
+ upDownButton.finalize()
+ upDownButton = undefined
+ panelNode = undefined
+ }
- if (valuePosition > 175) {
- thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 2.00
- }
+ function initialize(pPanelNode) {
+ panelNode = pPanelNode
+ thisObject.container.frame.containerName = panelNode.name
- if (panelData.dataFormula !== undefined) {
- try {
- value = eval(panelData.dataFormula.code)
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> err = ' + err.stack) }
- if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> dataFormula.code = ' + panelData.dataFormula.code) }
+ thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
+ thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL
+
+ thisObject.container.frame.position.x = canvas.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width - thisObject.container.frame.width * Math.random() * 8
+ thisObject.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height - thisObject.container.frame.height * Math.random() * 1.5
+
+ upDownButton = newUpDownButton()
+ upDownButton.parentContainer = thisObject.container
+ upDownButton.container.frame.parentFrame = thisObject.container.frame
+ upDownButton.fitFunction = thisObject.fitFunction
+ upDownButton.initialize()
+ }
+
+ function getContainer(point) {
+ if (thisObject.isVisible !== true) { return }
+ let container
+
+ container = upDownButton.getContainer(point)
+ if (container !== undefined) { return container }
+
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ let checkPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ checkPoint = thisObject.fitFunction(checkPoint)
+
+ if (point.x === checkPoint.x && point.y === checkPoint.y) {
+ return thisObject.container
+ }
+ }
+ }
+
+ function onRecordChange(pCurrentRecord) {
+ currentRecord = pCurrentRecord
+ }
+
+ function draw() {
+ if (thisObject.isVisible !== true) { return }
+
+ thisObject.container.frame.draw(false, false, true, thisObject.fitFunction)
+ plotCurrentRecordData()
+ upDownButton.draw()
+ }
+
+ function plotCurrentRecordData() {
+ const frameBodyHeight = thisObject.container.frame.getBodyHeight()
+ const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight
+
+ const X_AXIS = thisObject.container.frame.width / 2
+ const Y_AXIS = frameTitleHeight + frameBodyHeight / 2
+
+ const PANEL_HEIGHT = UI_PANEL.HEIGHT.NORMAL
+
+ if (currentRecord === undefined) { return }
+ let record = currentRecord
+
+ /* First we execute code if provided. */
+ if (panelNode.javascriptCode !== undefined) {
+ try {
+ eval(panelNode.javascriptCode.code)
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> err = ' + err.stack) }
+ if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> javascriptCode.code = ' + panelNode.javascriptCode.code) }
+ }
+ }
+
+ /* Second we go through the panel data. */
+ if (panelNode.panelData === undefined) { return }
+ for (let i = 0; i < panelNode.panelData.length; i++) {
+ let panelData = panelNode.panelData[i]
+
+ let labelText = panelData.name
+ let labelPosition = i * 10 + 12
+ let valuePosition = i * 10 + 17
+ let value = 'No value defined.'
+
+ if (valuePosition > 100) {
+ thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.25
+ }
+
+ if (valuePosition > 125) {
+ thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.50
+ }
+
+ if (valuePosition > 150) {
+ thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.75
+ }
+
+ if (valuePosition > 175) {
+ thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 2.00
+ }
+
+ if (panelData.dataFormula !== undefined) {
+ try {
+ value = eval(panelData.dataFormula.code)
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> err = ' + err.stack) }
+ if (ERROR_LOG === true) { logger.write('[ERROR] plotCurrentRecordData -> dataFormula.code = ' + panelData.dataFormula.code) }
+ }
+ }
+
+ if (panelData.config.valueDecimals !== undefined) {
+ if (value !== undefined) {
+ if (isNaN(value) === false) {
+ value = dynamicDecimals(value, panelData.config.valueDecimals)
+ }
+ }
+ }
+
+ if (panelData.config.labelText !== undefined) {
+ labelText = panelData.config.labelText
+ }
+
+ if (panelData.config.labelPosition !== undefined) {
+ labelPosition = panelData.config.labelPosition
+ }
+
+ if (panelData.config.valuePosition !== undefined) {
+ valuePosition = panelData.config.valuePosition
+ }
+
+ printLabel(labelText, X_AXIS, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
+ printLabel(value, X_AXIS, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction, false, true)
}
- }
-
- if (panelData.config.valueDecimals !== undefined) {
- if (value !== undefined) {
- if (isNaN(value) === false) {
- value = dynamicDecimals(value, panelData.config.valueDecimals)
- }
- }
- }
-
- if (panelData.config.labelText !== undefined) {
- labelText = panelData.config.labelText
- }
-
- if (panelData.config.labelPosition !== undefined) {
- labelPosition = panelData.config.labelPosition
- }
-
- if (panelData.config.valuePosition !== undefined) {
- valuePosition = panelData.config.valuePosition
- }
-
- printLabel(labelText, X_AXIS, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
- printLabel(value, X_AXIS, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction, false, true)
}
- }
}
diff --git a/CanvasApp/Panels/UpDownButton.js b/CanvasApp/Panels/UpDownButton.js
index bb542d183..ffdca4eaa 100644
--- a/CanvasApp/Panels/UpDownButton.js
+++ b/CanvasApp/Panels/UpDownButton.js
@@ -1,244 +1,244 @@
-function newUpDownButton () {
- let thisObject = {
- container: undefined,
- fitFunction: undefined,
- parentContainer: undefined,
- status: undefined,
- setStatus: setStatus,
- physics: physics,
- draw: draw,
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize,
- finalize: finalize
- }
-
- let isInitialized = false
- /* Cointainer stuff */
-
- thisObject.container = newContainer()
- thisObject.container.name = 'Up Down Button'
- thisObject.container.initialize()
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
- thisObject.container.frame.containerName = 'Up Down Button'
-
- thisObject.status = 'up'
- let upPosition = {}
- let downPosition = {}
- let transitionPosition = {}
-
- let onMouseClickEventSuscriptionId
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.parentContainer = undefined
-
- thisObject.status = undefined
- upPosition = undefined
- downPosition = undefined
- transitionPosition = undefined
- }
-
- function initialize () {
- thisObject.container.frame.width = 12
- thisObject.container.frame.height = 12
-
- let position = {
- x: thisObject.container.frame.parentFrame.width * 5.75 / 8 - thisObject.container.frame.width / 2,
- y: 40 * 4 / 8 - thisObject.container.frame.height / 2
+function newUpDownButton() {
+ let thisObject = {
+ container: undefined,
+ fitFunction: undefined,
+ parentContainer: undefined,
+ status: undefined,
+ setStatus: setStatus,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize,
+ finalize: finalize
}
- thisObject.container.frame.position = position
+ let isInitialized = false
+ /* Cointainer stuff */
- upPosition.x = thisObject.parentContainer.frame.position.x
- upPosition.y = thisObject.parentContainer.frame.position.y
+ thisObject.container = newContainer()
+ thisObject.container.name = 'Up Down Button'
+ thisObject.container.initialize()
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.containerName = 'Up Down Button'
- downPosition.x = thisObject.parentContainer.frame.position.x
- downPosition.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y
+ thisObject.status = 'up'
+ let upPosition = {}
+ let downPosition = {}
+ let transitionPosition = {}
- transitionPosition.x = upPosition.x
- transitionPosition.y = upPosition.y
+ let onMouseClickEventSuscriptionId
+ return thisObject
- /* Lets listen to our own events to react when we have a Mouse Click */
- onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.parentContainer = undefined
- isInitialized = true
- }
-
- function setStatus (value) {
- if (value === 'up' && thisObject.status === 'down') {
- thisObject.status = 'going up'
+ thisObject.status = undefined
+ upPosition = undefined
+ downPosition = undefined
+ transitionPosition = undefined
}
- if (value === 'down' && thisObject.status === 'up') {
- thisObject.status = 'going down'
+
+ function initialize() {
+ thisObject.container.frame.width = 12
+ thisObject.container.frame.height = 12
+
+ let position = {
+ x: thisObject.container.frame.parentFrame.width * 5.75 / 8 - thisObject.container.frame.width / 2,
+ y: 40 * 4 / 8 - thisObject.container.frame.height / 2
+ }
+
+ thisObject.container.frame.position = position
+
+ upPosition.x = thisObject.parentContainer.frame.position.x
+ upPosition.y = thisObject.parentContainer.frame.position.y
+
+ downPosition.x = thisObject.parentContainer.frame.position.x
+ downPosition.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y
+
+ transitionPosition.x = upPosition.x
+ transitionPosition.y = upPosition.y
+
+ /* Lets listen to our own events to react when we have a Mouse Click */
+ onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+
+ isInitialized = true
}
- }
- function onMouseClick (event) {
- if (thisObject.status === 'up') {
- transitionPosition.x = upPosition.x
- transitionPosition.y = upPosition.y
-
- thisObject.status = 'going down'
- } else {
- transitionPosition.x = downPosition.x
- transitionPosition.y = downPosition.y
-
- thisObject.status = 'going up'
+ function setStatus(value) {
+ if (value === 'up' && thisObject.status === 'down') {
+ thisObject.status = 'going up'
+ }
+ if (value === 'down' && thisObject.status === 'up') {
+ thisObject.status = 'going down'
+ }
}
- }
- function physics () {
- if (isInitialized === false) { return }
+ function onMouseClick(event) {
+ if (thisObject.status === 'up') {
+ transitionPosition.x = upPosition.x
+ transitionPosition.y = upPosition.y
- upPosition.x = thisObject.parentContainer.frame.position.x
- upPosition.y = canvas.chartingSpace.viewport.visibleArea.topRight.y
+ thisObject.status = 'going down'
+ } else {
+ transitionPosition.x = downPosition.x
+ transitionPosition.y = downPosition.y
- downPosition.x = thisObject.parentContainer.frame.position.x
- downPosition.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y
-
- if (thisObject.status === 'going down') {
- if (transitionPosition.y < downPosition.y) {
- transitionPosition.y = transitionPosition.y + 50
- thisObject.parentContainer.frame.position.y = transitionPosition.y
- } else {
- thisObject.parentContainer.frame.position.y = downPosition.y
- thisObject.status = 'down'
- }
+ thisObject.status = 'going up'
+ }
}
- if (thisObject.status === 'going up') {
- if (transitionPosition.y > upPosition.y) {
- transitionPosition.y = transitionPosition.y - 50
- thisObject.parentContainer.frame.position.y = transitionPosition.y
- } else {
- thisObject.parentContainer.frame.position.y = upPosition.y
- thisObject.status = 'up'
- }
+
+ function physics() {
+ if (isInitialized === false) { return }
+
+ upPosition.x = thisObject.parentContainer.frame.position.x
+ upPosition.y = canvas.chartingSpace.viewport.visibleArea.topRight.y
+
+ downPosition.x = thisObject.parentContainer.frame.position.x
+ downPosition.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y
+
+ if (thisObject.status === 'going down') {
+ if (transitionPosition.y < downPosition.y) {
+ transitionPosition.y = transitionPosition.y + 50
+ thisObject.parentContainer.frame.position.y = transitionPosition.y
+ } else {
+ thisObject.parentContainer.frame.position.y = downPosition.y
+ thisObject.status = 'down'
+ }
+ }
+ if (thisObject.status === 'going up') {
+ if (transitionPosition.y > upPosition.y) {
+ transitionPosition.y = transitionPosition.y - 50
+ thisObject.parentContainer.frame.position.y = transitionPosition.y
+ } else {
+ thisObject.parentContainer.frame.position.y = upPosition.y
+ thisObject.status = 'up'
+ }
+ }
}
- }
- function draw () {
- if (isInitialized === false) { return }
+ function draw() {
+ if (isInitialized === false) { return }
- drawButton()
- }
-
- function getContainer (point, purpose) {
- let container
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
+ drawButton()
}
- }
- function drawButton () {
- let point1
- let point2
- let point3
-
- switch (thisObject.status) {
- case 'up': {
- point1 = {
- x: 3,
- y: 3
+ function getContainer(point, purpose) {
+ let container
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
}
-
- point2 = {
- x: thisObject.container.frame.width - 3,
- y: 3
- }
-
- point3 = {
- x: thisObject.container.frame.width / 2,
- y: thisObject.container.frame.height - 3
- }
- break
- }
-
- case 'going down': {
- point1 = {
- x: 4,
- y: 4
- }
-
- point2 = {
- x: thisObject.container.frame.width - 4,
- y: 4
- }
-
- point3 = {
- x: thisObject.container.frame.width / 2,
- y: thisObject.container.frame.height - 4
- }
- break
- }
-
- case 'going up': {
- point1 = {
- x: 4,
- y: thisObject.container.frame.height - 4
- }
-
- point2 = {
- x: thisObject.container.frame.width - 4,
- y: thisObject.container.frame.height - 4
- }
-
- point3 = {
- x: thisObject.container.frame.width / 2,
- y: 4
- }
- break
- }
-
- case 'down': {
- point1 = {
- x: 3,
- y: thisObject.container.frame.height - 3
- }
-
- point2 = {
- x: thisObject.container.frame.width - 3,
- y: thisObject.container.frame.height - 3
- }
-
- point3 = {
- x: thisObject.container.frame.width / 2,
- y: 3
- }
- break
- }
}
+ function drawButton() {
+ let point1
+ let point2
+ let point3
+
+ switch (thisObject.status) {
+ case 'up': {
+ point1 = {
+ x: 3,
+ y: 3
+ }
+
+ point2 = {
+ x: thisObject.container.frame.width - 3,
+ y: 3
+ }
+
+ point3 = {
+ x: thisObject.container.frame.width / 2,
+ y: thisObject.container.frame.height - 3
+ }
+ break
+ }
+
+ case 'going down': {
+ point1 = {
+ x: 4,
+ y: 4
+ }
+
+ point2 = {
+ x: thisObject.container.frame.width - 4,
+ y: 4
+ }
+
+ point3 = {
+ x: thisObject.container.frame.width / 2,
+ y: thisObject.container.frame.height - 4
+ }
+ break
+ }
+
+ case 'going up': {
+ point1 = {
+ x: 4,
+ y: thisObject.container.frame.height - 4
+ }
+
+ point2 = {
+ x: thisObject.container.frame.width - 4,
+ y: thisObject.container.frame.height - 4
+ }
+
+ point3 = {
+ x: thisObject.container.frame.width / 2,
+ y: 4
+ }
+ break
+ }
+
+ case 'down': {
+ point1 = {
+ x: 3,
+ y: thisObject.container.frame.height - 3
+ }
+
+ point2 = {
+ x: thisObject.container.frame.width - 3,
+ y: thisObject.container.frame.height - 3
+ }
+
+ point3 = {
+ x: thisObject.container.frame.width / 2,
+ y: 3
+ }
+ break
+ }
+ }
+
/* Now the transformations. */
- point1 = thisObject.container.frame.frameThisPoint(point1)
- point2 = thisObject.container.frame.frameThisPoint(point2)
- point3 = thisObject.container.frame.frameThisPoint(point3)
+ point1 = thisObject.container.frame.frameThisPoint(point1)
+ point2 = thisObject.container.frame.frameThisPoint(point2)
+ point3 = thisObject.container.frame.frameThisPoint(point3)
- if (thisObject.fitFunction !== undefined) {
- point1 = thisObject.fitFunction(point1)
- point2 = thisObject.fitFunction(point2)
- point3 = thisObject.fitFunction(point3)
- }
+ if (thisObject.fitFunction !== undefined) {
+ point1 = thisObject.fitFunction(point1)
+ point2 = thisObject.fitFunction(point2)
+ point3 = thisObject.fitFunction(point3)
+ }
/* Lets start the drawing. */
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.lineTo(point1.x, point1.y)
- browserCanvasContext.closePath()
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.lineTo(point1.x, point1.y)
+ browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(250, 250, 250, 1)'
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.stroke()
+ browserCanvasContext.strokeStyle = 'rgba(250, 250, 250, 1)'
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.stroke()
- browserCanvasContext.fillStyle = 'rgba(250, 250, 250, 1)'
- browserCanvasContext.fill()
- }
+ browserCanvasContext.fillStyle = 'rgba(250, 250, 250, 1)'
+ browserCanvasContext.fill()
+ }
}
diff --git a/CanvasApp/Plotting/NodesAnnouncements.js b/CanvasApp/Plotting/NodesAnnouncements.js
index 16116df03..2eb21d98e 100644
--- a/CanvasApp/Plotting/NodesAnnouncements.js
+++ b/CanvasApp/Plotting/NodesAnnouncements.js
@@ -1,46 +1,46 @@
-function newNodesAnnouncements () {
- const MODULE_NAME = 'Nodes Announcements'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodesAnnouncements() {
+ const MODULE_NAME = 'Nodes Announcements'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
-
- let hiriarchyMap
- return thisObject
-
- function finalize () {
- hiriarchyMap = undefined
- }
-
- function initialize (pRootNode) {
- let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
- hiriarchyMap = getHiriarchyMap(rootNode)
- }
-
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- let array = currentRecord.announcements
- if (array === undefined) { return }
- for (let i = 0; i < array.length; i++) {
- let arrayItem = array[i]
- let nodeId = arrayItem[0]
- let value = arrayItem[1]
- applyValue(nodeId, value)
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
}
- }
- function applyValue (nodeId, value) {
- if (canvas.chartingSpace.visible !== true) { return }
- let node = hiriarchyMap.get(nodeId)
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
- if (node.payload.uiObject === undefined) { return }
- if (value === true) { value = 'true' }
- if (value === false) { value = 'false' }
- node.payload.uiObject.setValue(value, 20)
- }
+ let hiriarchyMap
+ return thisObject
+
+ function finalize() {
+ hiriarchyMap = undefined
+ }
+
+ function initialize(pRootNode) {
+ let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
+ hiriarchyMap = getHiriarchyMap(rootNode)
+ }
+
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ let array = currentRecord.announcements
+ if (array === undefined) { return }
+ for (let i = 0; i < array.length; i++) {
+ let arrayItem = array[i]
+ let nodeId = arrayItem[0]
+ let value = arrayItem[1]
+ applyValue(nodeId, value)
+ }
+ }
+
+ function applyValue(nodeId, value) {
+ if (canvas.chartingSpace.visible !== true) { return }
+ let node = hiriarchyMap.get(nodeId)
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
+ if (node.payload.uiObject === undefined) { return }
+ if (value === true) { value = 'true' }
+ if (value === false) { value = 'false' }
+ node.payload.uiObject.setValue(value, 20)
+ }
}
diff --git a/CanvasApp/Plotting/NodesErrors.js b/CanvasApp/Plotting/NodesErrors.js
index 1a083597d..5d1ce2d1a 100644
--- a/CanvasApp/Plotting/NodesErrors.js
+++ b/CanvasApp/Plotting/NodesErrors.js
@@ -1,47 +1,47 @@
-function newNodesErrors () {
- const MODULE_NAME = 'Nodes Errors'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodesErrors() {
+ const MODULE_NAME = 'Nodes Errors'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
- let hiriarchyMap
- return thisObject
-
- function finalize () {
- hiriarchyMap = undefined
- }
-
- function initialize (pRootNode) {
- let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
- hiriarchyMap = getHiriarchyMap(rootNode)
- }
-
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- let array = currentRecord.errors
- if (array === undefined) { return }
- for (let i = 0; i < array.length; i++) {
- let arrayItem = array[i]
- let nodeId = arrayItem[0]
- let value = arrayItem[1]
- applyValue(nodeId, value)
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
}
- }
+ let hiriarchyMap
+ return thisObject
- function applyValue (nodeId, value) {
- if (canvas.chartingSpace.visible !== true) { return }
- let node = hiriarchyMap.get(nodeId)
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
- if (node.payload.uiObject === undefined) { return }
- if (value === '') {
- node.payload.uiObject.resetErrorMessage()
- } else {
- node.payload.uiObject.setErrorMessage(value)
+ function finalize() {
+ hiriarchyMap = undefined
+ }
+
+ function initialize(pRootNode) {
+ let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
+ hiriarchyMap = getHiriarchyMap(rootNode)
+ }
+
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ let array = currentRecord.errors
+ if (array === undefined) { return }
+ for (let i = 0; i < array.length; i++) {
+ let arrayItem = array[i]
+ let nodeId = arrayItem[0]
+ let value = arrayItem[1]
+ applyValue(nodeId, value)
+ }
+ }
+
+ function applyValue(nodeId, value) {
+ if (canvas.chartingSpace.visible !== true) { return }
+ let node = hiriarchyMap.get(nodeId)
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
+ if (node.payload.uiObject === undefined) { return }
+ if (value === '') {
+ node.payload.uiObject.resetErrorMessage()
+ } else {
+ node.payload.uiObject.setErrorMessage(value)
+ }
}
- }
}
diff --git a/CanvasApp/Plotting/NodesHighlights.js b/CanvasApp/Plotting/NodesHighlights.js
index 443166ad6..d843faf63 100644
--- a/CanvasApp/Plotting/NodesHighlights.js
+++ b/CanvasApp/Plotting/NodesHighlights.js
@@ -1,42 +1,42 @@
-function newNodesHighlights () {
- const MODULE_NAME = 'Nodes Highlights'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodesHighlights() {
+ const MODULE_NAME = 'Nodes Highlights'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
-
- let hiriarchyMap
- return thisObject
-
- function finalize () {
- hiriarchyMap = undefined
- }
-
- function initialize (pRootNode) {
- let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
- hiriarchyMap = getHiriarchyMap(rootNode)
- }
-
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- let array = currentRecord.highlights
- if (array === undefined) { return }
- for (let i = 0; i < array.length; i++) {
- let nodeId = array[i]
- highlight(nodeId)
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
}
- }
- function highlight (nodeId) {
- if (canvas.chartingSpace.visible !== true) { return }
- let node = hiriarchyMap.get(nodeId)
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
- if (node.payload.uiObject === undefined) { return }
- node.payload.uiObject.highlight(10)
- }
+ let hiriarchyMap
+ return thisObject
+
+ function finalize() {
+ hiriarchyMap = undefined
+ }
+
+ function initialize(pRootNode) {
+ let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
+ hiriarchyMap = getHiriarchyMap(rootNode)
+ }
+
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ let array = currentRecord.highlights
+ if (array === undefined) { return }
+ for (let i = 0; i < array.length; i++) {
+ let nodeId = array[i]
+ highlight(nodeId)
+ }
+ }
+
+ function highlight(nodeId) {
+ if (canvas.chartingSpace.visible !== true) { return }
+ let node = hiriarchyMap.get(nodeId)
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
+ if (node.payload.uiObject === undefined) { return }
+ node.payload.uiObject.highlight(10)
+ }
}
diff --git a/CanvasApp/Plotting/NodesProgress.js b/CanvasApp/Plotting/NodesProgress.js
index cba36be9f..bd31d4802 100644
--- a/CanvasApp/Plotting/NodesProgress.js
+++ b/CanvasApp/Plotting/NodesProgress.js
@@ -1,47 +1,47 @@
-function newNodesProgress () {
- const MODULE_NAME = 'Nodes Progress'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodesProgress() {
+ const MODULE_NAME = 'Nodes Progress'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
-
- let hiriarchyMap
- return thisObject
-
- function finalize () {
- hiriarchyMap = undefined
- }
-
- function initialize (pRootNode) {
- let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
- hiriarchyMap = getHiriarchyMap(rootNode)
- }
-
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- let array = currentRecord.progress
- if (array === undefined) { return }
- for (let i = 0; i < array.length; i++) {
- let arrayItem = array[i]
- let nodeId = arrayItem[0]
- let value = arrayItem[1]
- applyValue(nodeId, value)
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
}
- }
- function applyValue (nodeId, value) {
- if (canvas.chartingSpace.visible !== true) { return }
- let node = hiriarchyMap.get(nodeId)
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
- if (node.payload.uiObject === undefined) { return }
- if (value === true) { value = 'true' }
- if (value === false) { value = 'false' }
- node.payload.uiObject.setPercentage(value, 30)
- }
+ let hiriarchyMap
+ return thisObject
+
+ function finalize() {
+ hiriarchyMap = undefined
+ }
+
+ function initialize(pRootNode) {
+ let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
+ hiriarchyMap = getHiriarchyMap(rootNode)
+ }
+
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ let array = currentRecord.progress
+ if (array === undefined) { return }
+ for (let i = 0; i < array.length; i++) {
+ let arrayItem = array[i]
+ let nodeId = arrayItem[0]
+ let value = arrayItem[1]
+ applyValue(nodeId, value)
+ }
+ }
+
+ function applyValue(nodeId, value) {
+ if (canvas.chartingSpace.visible !== true) { return }
+ let node = hiriarchyMap.get(nodeId)
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
+ if (node.payload.uiObject === undefined) { return }
+ if (value === true) { value = 'true' }
+ if (value === false) { value = 'false' }
+ node.payload.uiObject.setPercentage(value, 30)
+ }
}
diff --git a/CanvasApp/Plotting/NodesRunning.js b/CanvasApp/Plotting/NodesRunning.js
index 130a7a8f8..2ccaa6eeb 100644
--- a/CanvasApp/Plotting/NodesRunning.js
+++ b/CanvasApp/Plotting/NodesRunning.js
@@ -1,47 +1,47 @@
-function newNodesRunning () {
- const MODULE_NAME = 'Nodes Running'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodesRunning() {
+ const MODULE_NAME = 'Nodes Running'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
-
- let hiriarchyMap
- return thisObject
-
- function finalize () {
- hiriarchyMap = undefined
- }
-
- function initialize (pRootNode) {
- let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
- hiriarchyMap = getHiriarchyMap(rootNode)
- }
-
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- let array = currentRecord.running
- if (array === undefined) { return }
- for (let i = 0; i < array.length; i++) {
- let arrayItem = array[i]
- let nodeId = arrayItem[0]
- let value = arrayItem[1]
- applyValue(nodeId, value)
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
}
- }
- function applyValue (nodeId, value) {
- if (canvas.chartingSpace.visible !== true) { return }
- let node = hiriarchyMap.get(nodeId)
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
- if (node.payload.uiObject === undefined) { return }
- if (value === true) { value = 'true' }
- if (value === false) { value = 'false' }
- node.payload.uiObject.runningAtBackend()
- }
+ let hiriarchyMap
+ return thisObject
+
+ function finalize() {
+ hiriarchyMap = undefined
+ }
+
+ function initialize(pRootNode) {
+ let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
+ hiriarchyMap = getHiriarchyMap(rootNode)
+ }
+
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ let array = currentRecord.running
+ if (array === undefined) { return }
+ for (let i = 0; i < array.length; i++) {
+ let arrayItem = array[i]
+ let nodeId = arrayItem[0]
+ let value = arrayItem[1]
+ applyValue(nodeId, value)
+ }
+ }
+
+ function applyValue(nodeId, value) {
+ if (canvas.chartingSpace.visible !== true) { return }
+ let node = hiriarchyMap.get(nodeId)
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
+ if (node.payload.uiObject === undefined) { return }
+ if (value === true) { value = 'true' }
+ if (value === false) { value = 'false' }
+ node.payload.uiObject.runningAtBackend()
+ }
}
diff --git a/CanvasApp/Plotting/NodesStatus.js b/CanvasApp/Plotting/NodesStatus.js
index 699c70741..36e596f47 100644
--- a/CanvasApp/Plotting/NodesStatus.js
+++ b/CanvasApp/Plotting/NodesStatus.js
@@ -1,47 +1,47 @@
-function newNodesStatus () {
- const MODULE_NAME = 'Nodes Status'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodesStatus() {
+ const MODULE_NAME = 'Nodes Status'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
-
- let hiriarchyMap
- return thisObject
-
- function finalize () {
- hiriarchyMap = undefined
- }
-
- function initialize (pRootNode) {
- let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
- hiriarchyMap = getHiriarchyMap(rootNode)
- }
-
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- let array = currentRecord.status
- if (array === undefined) { return }
- for (let i = 0; i < array.length; i++) {
- let arrayItem = array[i]
- let nodeId = arrayItem[0]
- let value = arrayItem[1]
- applyValue(nodeId, value)
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
}
- }
- function applyValue (nodeId, value) {
- if (canvas.chartingSpace.visible !== true) { return }
- let node = hiriarchyMap.get(nodeId)
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
- if (node.payload.uiObject === undefined) { return }
- if (value === true) { value = 'true' }
- if (value === false) { value = 'false' }
- node.payload.uiObject.setStatus(value, 30)
- }
+ let hiriarchyMap
+ return thisObject
+
+ function finalize() {
+ hiriarchyMap = undefined
+ }
+
+ function initialize(pRootNode) {
+ let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
+ hiriarchyMap = getHiriarchyMap(rootNode)
+ }
+
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ let array = currentRecord.status
+ if (array === undefined) { return }
+ for (let i = 0; i < array.length; i++) {
+ let arrayItem = array[i]
+ let nodeId = arrayItem[0]
+ let value = arrayItem[1]
+ applyValue(nodeId, value)
+ }
+ }
+
+ function applyValue(nodeId, value) {
+ if (canvas.chartingSpace.visible !== true) { return }
+ let node = hiriarchyMap.get(nodeId)
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
+ if (node.payload.uiObject === undefined) { return }
+ if (value === true) { value = 'true' }
+ if (value === false) { value = 'false' }
+ node.payload.uiObject.setStatus(value, 30)
+ }
}
diff --git a/CanvasApp/Plotting/NodesValues.js b/CanvasApp/Plotting/NodesValues.js
index 53dfbfa60..c7fabb5e1 100644
--- a/CanvasApp/Plotting/NodesValues.js
+++ b/CanvasApp/Plotting/NodesValues.js
@@ -1,47 +1,47 @@
-function newNodesValues () {
- const MODULE_NAME = 'Nodes Values'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newNodesValues() {
+ const MODULE_NAME = 'Nodes Values'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
-
- let hiriarchyMap
- return thisObject
-
- function finalize () {
- hiriarchyMap = undefined
- }
-
- function initialize (pRootNode) {
- let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
- hiriarchyMap = getHiriarchyMap(rootNode)
- }
-
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- let array = currentRecord.values
- if (array === undefined) { return }
- for (let i = 0; i < array.length; i++) {
- let arrayItem = array[i]
- let nodeId = arrayItem[0]
- let value = arrayItem[1]
- applyValue(nodeId, value)
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
}
- }
- function applyValue (nodeId, value) {
- if (canvas.chartingSpace.visible !== true) { return }
- let node = hiriarchyMap.get(nodeId)
- if (node === undefined) { return }
- if (node.payload === undefined) { return }
- if (node.payload.uiObject === undefined) { return }
- if (value === true) { value = 'true' }
- if (value === false) { value = 'false' }
- node.payload.uiObject.setValue(value, 1)
- }
+ let hiriarchyMap
+ return thisObject
+
+ function finalize() {
+ hiriarchyMap = undefined
+ }
+
+ function initialize(pRootNode) {
+ let rootNode = canvas.designSpace.workspace.getHierarchyHeadsById(pRootNode.id)
+ hiriarchyMap = getHiriarchyMap(rootNode)
+ }
+
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ let array = currentRecord.values
+ if (array === undefined) { return }
+ for (let i = 0; i < array.length; i++) {
+ let arrayItem = array[i]
+ let nodeId = arrayItem[0]
+ let value = arrayItem[1]
+ applyValue(nodeId, value)
+ }
+ }
+
+ function applyValue(nodeId, value) {
+ if (canvas.chartingSpace.visible !== true) { return }
+ let node = hiriarchyMap.get(nodeId)
+ if (node === undefined) { return }
+ if (node.payload === undefined) { return }
+ if (node.payload.uiObject === undefined) { return }
+ if (value === true) { value = 'true' }
+ if (value === false) { value = 'false' }
+ node.payload.uiObject.setValue(value, 1)
+ }
}
diff --git a/CanvasApp/Plotting/Plotter.js b/CanvasApp/Plotting/Plotter.js
index 332af2705..6b96b66d2 100644
--- a/CanvasApp/Plotting/Plotter.js
+++ b/CanvasApp/Plotting/Plotter.js
@@ -1,915 +1,915 @@
function newPlotter() {
- const MODULE_NAME = 'Plotter'
- const ERROR_LOG = true
- const INTENSIVE_LOG = false
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+ const MODULE_NAME = 'Plotter'
+ const ERROR_LOG = true
+ const INTENSIVE_LOG = false
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- currentRecord: undefined,
- container: undefined,
- fitFunction: undefined,
- onDailyFileLoaded: onDailyFileLoaded,
- initialize: initialize,
- finalize: finalize,
- getContainer: getContainer,
- setTimeFrame: setTimeFrame,
- setDatetime: setDatetime,
- setCoordinateSystem: setCoordinateSystem,
- draw: draw
- }
-
- let container = newContainer()
- container.initialize()
- thisObject.container = container
-
- let coordinateSystem
- let slotHeight = (canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y) / 10 // This is the amount of slots available
- let mustRecalculateDataPoints = false
- let atMousePositionFillStyles = new Map()
- let atMousePositionStrokeStyles = new Map()
-
- let timeFrame // This will hold the current Time Frame the user is at.
- let datetime // This will hold the current Datetime the user is at.
-
- let marketFile // This is the current Market File being plotted.
- let fileCursor // This is the current File Cursor being used to retrieve Daily Files.
-
- let marketFiles // This object will provide the different Market Files at different Time Periods.
- let dailyFiles // This object will provide the different File Cursors at different Time Periods.
-
- let productDefinition // Here we store a snapshot of the product definition which references this plotter.
-
- let records = [] // We will have the information to be plotted here.
- let userPositionDate
- let minUserPositionRate
- let maxUserPositionRate
-
- let onMouseOverEventSuscriptionId
- let zoomChangedEventSubscriptionId
- let offsetChangedEventSubscriptionId
- let dragFinishedEventSubscriptionId
- let dimmensionsChangedEventSubscriptionId
- let marketFilesUpdatedEventSubscriptionId
- let dailyFilesUpdatedEventSubscriptionId
- let onDisplaceEventSubscriptionId
- let scaleChangedEventSubscriptionId
-
- let logged = false
- return thisObject
-
- function finalize() {
- try {
- /* Stop listening to the necesary events. */
- thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
- canvas.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId)
- canvas.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId)
- canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
- marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId)
- dailyFiles.eventHandler.stopListening(dailyFilesUpdatedEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onDisplaceEventSubscriptionId)
- thisObject.fitFunction = undefined
-
- /* Clear References */
- marketFiles = undefined
- dailyFiles = undefined
-
- datetime = undefined
- timeFrame = undefined
-
- marketFile = undefined
- fileCursor = undefined
-
- finalizeCoordinateSystem()
- coordinateSystem = undefined
- slotHeight = undefined
- mustRecalculateDataPoints = undefined
- atMousePositionFillStyles = undefined
- atMousePositionStrokeStyles = undefined
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack.stack) }
- }
- }
-
- function initialize(pStorage, pDatetime, pTimeFrame, pCoordinateSystem, callBackFunction, pProductDefinition) {
- try {
- /* Store the information received. */
- marketFiles = pStorage.marketFiles[0]
- dailyFiles = pStorage.dailyFiles[0]
-
- datetime = pDatetime
- timeFrame = pTimeFrame
- coordinateSystem = pCoordinateSystem
- initializeCoordinateSystem()
-
- productDefinition = pProductDefinition
-
- /* We need a Market File in order to calculate the Y scale, since this scale depends on actual data. */
- marketFile = marketFiles.getFile(ONE_DAY_IN_MILISECONDS) // This file is the one processed faster.
-
- /* Now we set the right files according to current Period. */
- marketFile = marketFiles.getFile(pTimeFrame)
- fileCursor = dailyFiles.getFileCursor(pTimeFrame)
-
- /* Listen to the necesary events. */
- zoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent('Zoom Changed', onViewportZoomChanged)
- offsetChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent('Position Changed', onViewportPositionChanged)
- dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent('Drag Finished', onDragFinished)
- marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent('Files Updated', onMarketFilesUpdated)
- dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent('Files Updated', onDailyFilesUpdated)
- onDisplaceEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDisplace', onDisplace)
- onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
-
- /* Get ready for plotting. */
- recalculate()
- dimmensionsChangedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('Dimmensions Changed', function () {
- recalculate()
- })
-
- callBackFunction()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- }
- }
-
- function initializeCoordinateSystem() {
- scaleChangedEventSubscriptionId = coordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
- }
-
- function finalizeCoordinateSystem() {
- coordinateSystem.eventHandler.stopListening(scaleChangedEventSubscriptionId)
- }
-
- function onScaleChanged() {
- mustRecalculateDataPoints = true
- recalculate()
- }
-
- function onMouseOver(event) {
- let userPosition = getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
- userPositionDate = userPosition.valueOf()
-
- let minPositionPoint = {
- x: event.x,
- y: event.y + 2
- }
- minUserPositionRate = getRateFromPointAtBrowserCanvas(minPositionPoint, thisObject.container, coordinateSystem)
-
- let maxPositionPoint = {
- x: event.x,
- y: event.y - 2
- }
- maxUserPositionRate = getRateFromPointAtBrowserCanvas(maxPositionPoint, thisObject.container, coordinateSystem)
- }
-
- function onMarketFilesUpdated() {
- try {
- let newMarketFile = marketFiles.getFile(timeFrame)
- if (newMarketFile !== undefined) {
- marketFile = newMarketFile
- mustRecalculateDataPoints = true
- recalculate()
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onMarketFilesUpdated -> err = ' + err.stack.stack) }
- }
- }
-
- function onDailyFilesUpdated() {
- try {
- let newFileCursor = dailyFiles.getFileCursor(timeFrame)
- if (newFileCursor !== undefined) {
- fileCursor = newFileCursor
- mustRecalculateDataPoints = true
- recalculate()
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onDailyFilesUpdated -> err = ' + err.stack.stack) }
- }
- }
-
- function getContainer(point) {
- try {
- let container
- /* First we check if this point is inside this space. */
- if (thisObject.container.frame.isThisPointHere(point) === true) {
- return thisObject.container
- } else {
- /* This point does not belong to this space. */
- return undefined
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] getContainer -> err = ' + err.stack) }
- }
- }
-
- function setTimeFrame(pTimeFrame) {
- try {
- if (timeFrame !== pTimeFrame) {
- timeFrame = pTimeFrame
- mustRecalculateDataPoints = true
- if (timeFrame >= _1_HOUR_IN_MILISECONDS) {
- marketFile = marketFiles.getFile(pTimeFrame)
- } else {
- fileCursor = dailyFiles.getFileCursor(pTimeFrame)
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] setTimeFrame -> err = ' + err.stack) }
- }
- }
-
- function setDatetime(pDatetime) {
- datetime = pDatetime
- }
-
- function setCoordinateSystem(pCoordinateSystem) {
- finalizeCoordinateSystem()
- coordinateSystem = pCoordinateSystem
- initializeCoordinateSystem()
- }
-
- function onDailyFileLoaded(event) {
- try {
- if (event.currentValue === event.totalValue) {
- /* This happens only when all of the files in the cursor have been loaded. */
- recalculate()
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onDailyFileLoaded -> err = ' + err.stack) }
- }
- }
-
- function draw() {
- try {
- thisObject.container.frame.draw()
- plot()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] draw -> err = ' + err.stack) }
- }
- }
-
- function recalculate() {
- try {
- if (timeFrame >= _1_HOUR_IN_MILISECONDS) {
- recalculateUsingMarketFiles()
- } else {
- recalculateUsingDailyFiles()
- }
- thisObject.container.eventHandler.raiseEvent('CandleStairs Changed', records) // --> Check This
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] recalculate -> err = ' + err.stack) }
- }
- }
-
- function jsonifyDataFile(dataFile, recordDefinition, farLeftDate, farRightDate) {
- /*
- This function has as an input the raw data on files and creates with it an array of JSON objects
- with not calculated properties for later being consumed by Formulas
- */
-
- let jsonifiedArray = []
- let previous
-
- for (let i = 0; i < dataFile.length; i++) {
- let record = {}
- for (let j = 0; j < recordDefinition.properties.length; j++) {
- let property = recordDefinition.properties[j]
- if (property.config.isCalculated !== true) {
- record[property.config.codeName] = dataFile[i][j]
- }
- }
-
- if (
- (record.begin >= farLeftDate.valueOf() && record.end <= farRightDate.valueOf()) &&
- (record.end >= coordinateSystem.min.x && record.begin <= coordinateSystem.max.x)
- ) {
- record.previous = previous
- jsonifiedArray.push(record)
- previous = record
-
- if (record.begin === undefined || record.end === undefined) { console.log('Could not find the property begin or end which are needed for the plotter to work.') }
- if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
- thisObject.currentRecord = record
- thisObject.container.eventHandler.raiseEvent('Current Record Changed', thisObject.currentRecord)
- }
- }
+ let thisObject = {
+ currentRecord: undefined,
+ container: undefined,
+ fitFunction: undefined,
+ onDailyFileLoaded: onDailyFileLoaded,
+ initialize: initialize,
+ finalize: finalize,
+ getContainer: getContainer,
+ setTimeFrame: setTimeFrame,
+ setDatetime: setDatetime,
+ setCoordinateSystem: setCoordinateSystem,
+ draw: draw
}
- return jsonifiedArray
- }
+ let container = newContainer()
+ container.initialize()
+ thisObject.container = container
- function calculationsProcedure(jsonArray, recordDefinition, calculationsProcedure, timeFrame) {
- /*
- This function has as an input an array of JSON objects, and it adds calculated properties to
- complete the set of properties that will be available.
- */
+ let coordinateSystem
+ let slotHeight = (canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y) / 10 // This is the amount of slots available
+ let mustRecalculateDataPoints = false
+ let atMousePositionFillStyles = new Map()
+ let atMousePositionStrokeStyles = new Map()
- let system = { // These are the available system variables to be used in User Code and Formulas
- timeFrame: timeFrame,
- ONE_DAY_IN_MILISECONDS: ONE_DAY_IN_MILISECONDS
- }
- let variable = {} // This is the structure where the user will define its own variables that will be shared across different config blocks and formulas.
- let results = []
+ let timeFrame // This will hold the current Time Frame the user is at.
+ let datetime // This will hold the current Datetime the user is at.
- /* This is Initialization Code */
- if (calculationsProcedure.initialization !== undefined) {
- if (calculationsProcedure.initialization.javascriptCode !== undefined) {
+ let marketFile // This is the current Market File being plotted.
+ let fileCursor // This is the current File Cursor being used to retrieve Daily Files.
+
+ let marketFiles // This object will provide the different Market Files at different Time Periods.
+ let dailyFiles // This object will provide the different File Cursors at different Time Periods.
+
+ let productDefinition // Here we store a snapshot of the product definition which references this plotter.
+
+ let records = [] // We will have the information to be plotted here.
+ let userPositionDate
+ let minUserPositionRate
+ let maxUserPositionRate
+
+ let onMouseOverEventSuscriptionId
+ let zoomChangedEventSubscriptionId
+ let offsetChangedEventSubscriptionId
+ let dragFinishedEventSubscriptionId
+ let dimmensionsChangedEventSubscriptionId
+ let marketFilesUpdatedEventSubscriptionId
+ let dailyFilesUpdatedEventSubscriptionId
+ let onDisplaceEventSubscriptionId
+ let scaleChangedEventSubscriptionId
+
+ let logged = false
+ return thisObject
+
+ function finalize() {
try {
- eval(calculationsProcedure.initialization.javascriptCode.code)
+ /* Stop listening to the necesary events. */
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
+ canvas.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId)
+ canvas.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId)
+ canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
+ marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId)
+ dailyFiles.eventHandler.stopListening(dailyFilesUpdatedEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onDisplaceEventSubscriptionId)
+ thisObject.fitFunction = undefined
+
+ /* Clear References */
+ marketFiles = undefined
+ dailyFiles = undefined
+
+ datetime = undefined
+ timeFrame = undefined
+
+ marketFile = undefined
+ fileCursor = undefined
+
+ finalizeCoordinateSystem()
+ coordinateSystem = undefined
+ slotHeight = undefined
+ mustRecalculateDataPoints = undefined
+ atMousePositionFillStyles = undefined
+ atMousePositionStrokeStyles = undefined
} catch (err) {
- logger.write('[ERROR] calculationsProcedure -> initialization -> Error executing User Code. Error = ' + err.stack.stack)
- logger.write('[ERROR] calculationsProcedure -> initialization -> Error executing User Code. Code = ' + calculationsProcedure.initialization.javascriptCode.code)
- throw ('Error Executing User Code.')
+ if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack.stack) }
}
- }
}
- /* This is Initialization Code */
- if (calculationsProcedure.loop !== undefined) {
- if (calculationsProcedure.loop.javascriptCode !== undefined) {
- for (let index = 0; index < jsonArray.length; index++) {
- let product = jsonArray[index]
+ function initialize(pStorage, pDatetime, pTimeFrame, pCoordinateSystem, callBackFunction, pProductDefinition) {
+ try {
+ /* Store the information received. */
+ marketFiles = pStorage.marketFiles[0]
+ dailyFiles = pStorage.dailyFiles[0]
- /* This is Loop Code */
- try {
- eval(calculationsProcedure.loop.javascriptCode.code)
- } catch (err) {
- logger.write('[ERROR] calculationsProcedure -> loop -> Error executing User Code. Error = ' + err.stack.stack)
- logger.write('[ERROR] calculationsProcedure -> loop -> Error executing User Code. product = ' + JSON.stringify(product))
- logger.write('[ERROR] calculationsProcedure -> loop -> Error executing User Code. Code = ' + calculationsProcedure.loop.javascriptCode.code)
- throw ('Error Executing User Code.')
- }
+ datetime = pDatetime
+ timeFrame = pTimeFrame
+ coordinateSystem = pCoordinateSystem
+ initializeCoordinateSystem()
- /* For each calculated property we apply its formula */
- for (let j = 0; j < recordDefinition.properties.length; j++) {
- let property = recordDefinition.properties[j]
- if (property.config.isCalculated === true) {
- if (property.formula !== undefined) {
- if (property.formula.code !== undefined) {
- try {
- let newValue = eval(property.formula.code)
- let currentRecord = product
- currentRecord[property.config.codeName] = newValue
- } catch (err) {
- logger.write('[ERROR] calculationsProcedure -> loop -> formula -> Error executing User Code. Error = ' + err.stack.stack)
- logger.write('[ERROR] calculationsProcedure -> loop -> formula -> Error executing User Code. product = ' + JSON.stringify(product))
- logger.write('[ERROR] calculationsProcedure -> loop -> formula -> Error executing User Code. Code = ' + property.formula.code)
- throw ('Error Executing User Code.')
- }
- }
- }
+ productDefinition = pProductDefinition
+
+ /* We need a Market File in order to calculate the Y scale, since this scale depends on actual data. */
+ marketFile = marketFiles.getFile(ONE_DAY_IN_MILISECONDS) // This file is the one processed faster.
+
+ /* Now we set the right files according to current Period. */
+ marketFile = marketFiles.getFile(pTimeFrame)
+ fileCursor = dailyFiles.getFileCursor(pTimeFrame)
+
+ /* Listen to the necesary events. */
+ zoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent('Zoom Changed', onViewportZoomChanged)
+ offsetChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent('Position Changed', onViewportPositionChanged)
+ dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent('Drag Finished', onDragFinished)
+ marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent('Files Updated', onMarketFilesUpdated)
+ dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent('Files Updated', onDailyFilesUpdated)
+ onDisplaceEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDisplace', onDisplace)
+ onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+
+ /* Get ready for plotting. */
+ recalculate()
+ dimmensionsChangedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('Dimmensions Changed', function () {
+ recalculate()
+ })
+
+ callBackFunction()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ }
+ }
+
+ function initializeCoordinateSystem() {
+ scaleChangedEventSubscriptionId = coordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
+ }
+
+ function finalizeCoordinateSystem() {
+ coordinateSystem.eventHandler.stopListening(scaleChangedEventSubscriptionId)
+ }
+
+ function onScaleChanged() {
+ mustRecalculateDataPoints = true
+ recalculate()
+ }
+
+ function onMouseOver(event) {
+ let userPosition = getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
+ userPositionDate = userPosition.valueOf()
+
+ let minPositionPoint = {
+ x: event.x,
+ y: event.y + 2
+ }
+ minUserPositionRate = getRateFromPointAtBrowserCanvas(minPositionPoint, thisObject.container, coordinateSystem)
+
+ let maxPositionPoint = {
+ x: event.x,
+ y: event.y - 2
+ }
+ maxUserPositionRate = getRateFromPointAtBrowserCanvas(maxPositionPoint, thisObject.container, coordinateSystem)
+ }
+
+ function onMarketFilesUpdated() {
+ try {
+ let newMarketFile = marketFiles.getFile(timeFrame)
+ if (newMarketFile !== undefined) {
+ marketFile = newMarketFile
+ mustRecalculateDataPoints = true
+ recalculate()
}
- }
-
- /* Adding the new element to the resulting array */
- results.push(product)
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onMarketFilesUpdated -> err = ' + err.stack.stack) }
}
- }
}
- return results
- }
- function recalculateUsingDailyFiles() {
- try {
- if (fileCursor === undefined) {
- records = []
- return
- } // We need to wait until there is a fileCursor available or maybe this indicator does not produce data for the current Time Frame
- if (fileCursor.files.size === 0) { return } // We need to wait until there are files in the cursor
-
- let daysOnSides = getSideDays(timeFrame)
-
- let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
- let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
-
- let dateDiff = rightDate.valueOf() - leftDate.valueOf()
-
- let farLeftDate = new Date(leftDate.valueOf() - dateDiff * 1.5)
- let farRightDate = new Date(rightDate.valueOf() + dateDiff * 1.5)
-
- let currentDate = new Date(farLeftDate.valueOf())
-
- records = []
-
- while (currentDate.valueOf() <= farRightDate.valueOf() + ONE_DAY_IN_MILISECONDS) {
- let stringDate = currentDate.getFullYear() + '-' + pad(currentDate.getMonth() + 1, 2) + '-' + pad(currentDate.getDate(), 2)
-
- let dailyFile = fileCursor.files.get(stringDate)
-
- if (dailyFile !== undefined) {
- /* Transform the current file content into an array of JSON objects */
- let jsonData = jsonifyDataFile(dailyFile, productDefinition.record, farLeftDate, farRightDate)
-
- /* Add the calculated properties */
- if (productDefinition.calculations !== undefined) {
- let calculationsResult = calculationsProcedure(jsonData, productDefinition.record, productDefinition.calculations, timeFrame)
- records.push(...calculationsResult) // This adds records to the current array.
- } else {
- records.push(...jsonData)// This adds records to the current array.
- }
+ function onDailyFilesUpdated() {
+ try {
+ let newFileCursor = dailyFiles.getFileCursor(timeFrame)
+ if (newFileCursor !== undefined) {
+ fileCursor = newFileCursor
+ mustRecalculateDataPoints = true
+ recalculate()
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onDailyFilesUpdated -> err = ' + err.stack.stack) }
}
+ }
- currentDate = new Date(currentDate.valueOf() + ONE_DAY_IN_MILISECONDS)
- }
-
- /* Lests check if all the visible screen is going to be covered by candle-record. */
- let lowerEnd = leftDate.valueOf()
- let upperEnd = rightDate.valueOf()
-
- if (records.length > 0) {
- if (records[0].begin > lowerEnd || records[records.length - 1].end < upperEnd) {
- setTimeout(recalculate, 2000)
+ function getContainer(point) {
+ try {
+ let container
+ /* First we check if this point is inside this space. */
+ if (thisObject.container.frame.isThisPointHere(point) === true) {
+ return thisObject.container
+ } else {
+ /* This point does not belong to this space. */
+ return undefined
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] getContainer -> err = ' + err.stack) }
}
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] recalculateUsingDailyFiles -> err = ' + err.stack) }
}
- }
- function recalculateUsingMarketFiles() {
- try {
- if (marketFile === undefined) {
- records = []
- return
- } // Initialization not complete yet or this indicator does not produce data for the current time frame
-
- let daysOnSides = getSideDays(timeFrame)
-
- let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
- let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
-
- let dateDiff = rightDate.valueOf() - leftDate.valueOf()
-
- leftDate = new Date(leftDate.valueOf() - dateDiff * 1.5)
- rightDate = new Date(rightDate.valueOf() + dateDiff * 1.5)
-
- for (let i = 0; i < records.length; i++) {
- let record = records[i]
- record.fillStyle = undefined
- record.strokeStyle = undefined
- record.dataPoints = undefined
- record.previous = undefined
- records[i] = {}
- }
- records = []
-
- /* Transform the current file content into an array of JSON objects */
- let jsonData = jsonifyDataFile(marketFile, productDefinition.record, leftDate, rightDate)
-
- /* Add the calculated properties */
- if (productDefinition.calculations !== undefined) {
- let calculationsResult = calculationsProcedure(jsonData, productDefinition.record, productDefinition.calculations, timeFrame)
- records.push(...calculationsResult) // This adds records to the current array.
- } else {
- records.push(...jsonData)// This adds records to the current array.
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] recalculateUsingMarketFiles -> err = ' + err.stack) }
+ function setTimeFrame(pTimeFrame) {
+ try {
+ if (timeFrame !== pTimeFrame) {
+ timeFrame = pTimeFrame
+ mustRecalculateDataPoints = true
+ if (timeFrame >= _1_HOUR_IN_MILISECONDS) {
+ marketFile = marketFiles.getFile(pTimeFrame)
+ } else {
+ fileCursor = dailyFiles.getFileCursor(pTimeFrame)
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] setTimeFrame -> err = ' + err.stack) }
+ }
}
- }
- function recalculateScale() {
- try {
- if (coordinateSystem.maxValue > 0) { return } // Already calculated.
- /* First we calculate the default scale */
- let minValue = {
- x: MIN_PLOTABLE_DATE.valueOf(),
- y: 0
- }
-
- let maxValue = {
- x: MAX_PLOTABLE_DATE.valueOf(),
- y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4 // TODO: This 4 is temporary
- }
-
- coordinateSystem.initialize(
- minValue,
- maxValue,
- thisObject.container.frame.width,
- thisObject.container.frame.height
- )
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] recalculateScale -> err = ' + err.stack) }
+ function setDatetime(pDatetime) {
+ datetime = pDatetime
}
- }
- function plot() {
- try {
- /* Clean the pannel at places where there is no record. */
- thisObject.container.eventHandler.raiseEvent('Current Record Changed', undefined)
+ function setCoordinateSystem(pCoordinateSystem) {
+ finalizeCoordinateSystem()
+ coordinateSystem = pCoordinateSystem
+ initializeCoordinateSystem()
+ }
- for (let i = 0; i < records.length; i++) {
- let record = records[i]
+ function onDailyFileLoaded(event) {
+ try {
+ if (event.currentValue === event.totalValue) {
+ /* This happens only when all of the files in the cursor have been loaded. */
+ recalculate()
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onDailyFileLoaded -> err = ' + err.stack) }
+ }
+ }
+ function draw() {
+ try {
+ thisObject.container.frame.draw()
+ plot()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] draw -> err = ' + err.stack) }
+ }
+ }
+
+ function recalculate() {
+ try {
+ if (timeFrame >= _1_HOUR_IN_MILISECONDS) {
+ recalculateUsingMarketFiles()
+ } else {
+ recalculateUsingDailyFiles()
+ }
+ thisObject.container.eventHandler.raiseEvent('CandleStairs Changed', records) // --> Check This
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] recalculate -> err = ' + err.stack) }
+ }
+ }
+
+ function jsonifyDataFile(dataFile, recordDefinition, farLeftDate, farRightDate) {
/*
- In the formulas to create plotters, we allos users to reference the previous record.
- To enable that we need to link all records to the previous one in this way.
+ This function has as an input the raw data on files and creates with it an array of JSON objects
+ with not calculated properties for later being consumed by Formulas
*/
- if (i == 0) {
- record.previous = {} // this way it wont be undefined
- } else {
- record.previous = records[i - 1]
- }
- let beginPoint = {
- x: record.begin,
- y: 0
- }
+ let jsonifiedArray = []
+ let previous
- let endPoint = {
- x: record.end,
- y: 0
- }
-
- beginPoint = coordinateSystem.transformThisPoint(beginPoint)
- endPoint = coordinateSystem.transformThisPoint(endPoint)
-
- beginPoint = transformThisPoint(beginPoint, thisObject.container)
- endPoint = transformThisPoint(endPoint, thisObject.container)
-
- beginPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(beginPoint)
- endPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(endPoint)
-
- beginPoint = thisObject.fitFunction(beginPoint)
- endPoint = thisObject.fitFunction(endPoint)
-
- if (endPoint.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || beginPoint.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
- continue
- }
-
- let atMousePosition = false
- if (userPositionDate >= record.begin && userPositionDate <= record.end) {
- if (record.rate !== undefined && productDefinition.referenceParent.config.useRateAtMousePosition === true) {
- /* Current Record depends also on rate */
- if (record.rate >= minUserPositionRate && record.rate <= maxUserPositionRate) {
- atMousePosition = true
- thisObject.container.eventHandler.raiseEvent('Current Record Changed', record)
- }
- } else {
- /* Current Record depends only on begin and end. */
- atMousePosition = true
- thisObject.container.eventHandler.raiseEvent('Current Record Changed', record)
- }
- }
-
- /* If there is code we execute it now. */
- if (productDefinition.referenceParent.javascriptCode !== undefined) {
- eval(productDefinition.referenceParent.javascriptCode.code)
- }
-
- if (productDefinition.referenceParent.shapes === undefined) { continue }
- if (productDefinition.referenceParent.shapes.chartPoints === undefined) { continue }
- let dataPoints = new Map()
- if (record.dataPoints !== undefined && mustRecalculateDataPoints === false) {
- /* We use the datapoints already calculated. */
- dataPoints = record.dataPoints
- } else {
- if (logged === false) {
- logged = true
- }
- /* It seems we need to calculate the data points this time. */
- for (let k = 0; k < productDefinition.referenceParent.shapes.chartPoints.length; k++) {
- let chartPoints = productDefinition.referenceParent.shapes.chartPoints[k]
- for (let j = 0; j < chartPoints.points.length; j++) {
- let point = chartPoints.points[j]
- if (point.pointFormula !== undefined) {
- let x = 0
- let y = 0
- eval(point.pointFormula.code)
- let rawPoint = {
- x: x,
- y: y
+ for (let i = 0; i < dataFile.length; i++) {
+ let record = {}
+ for (let j = 0; j < recordDefinition.properties.length; j++) {
+ let property = recordDefinition.properties[j]
+ if (property.config.isCalculated !== true) {
+ record[property.config.codeName] = dataFile[i][j]
}
+ }
+
+ if (
+ (record.begin >= farLeftDate.valueOf() && record.end <= farRightDate.valueOf()) &&
+ (record.end >= coordinateSystem.min.x && record.begin <= coordinateSystem.max.x)
+ ) {
+ record.previous = previous
+ jsonifiedArray.push(record)
+ previous = record
+
+ if (record.begin === undefined || record.end === undefined) { console.log('Could not find the property begin or end which are needed for the plotter to work.') }
+ if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
+ thisObject.currentRecord = record
+ thisObject.container.eventHandler.raiseEvent('Current Record Changed', thisObject.currentRecord)
+ }
+ }
+ }
+
+ return jsonifiedArray
+ }
+
+ function calculationsProcedure(jsonArray, recordDefinition, calculationsProcedure, timeFrame) {
+ /*
+ This function has as an input an array of JSON objects, and it adds calculated properties to
+ complete the set of properties that will be available.
+ */
+
+ let system = { // These are the available system variables to be used in User Code and Formulas
+ timeFrame: timeFrame,
+ ONE_DAY_IN_MILISECONDS: ONE_DAY_IN_MILISECONDS
+ }
+ let variable = {} // This is the structure where the user will define its own variables that will be shared across different config blocks and formulas.
+ let results = []
+
+ /* This is Initialization Code */
+ if (calculationsProcedure.initialization !== undefined) {
+ if (calculationsProcedure.initialization.javascriptCode !== undefined) {
+ try {
+ eval(calculationsProcedure.initialization.javascriptCode.code)
+ } catch (err) {
+ logger.write('[ERROR] calculationsProcedure -> initialization -> Error executing User Code. Error = ' + err.stack.stack)
+ logger.write('[ERROR] calculationsProcedure -> initialization -> Error executing User Code. Code = ' + calculationsProcedure.initialization.javascriptCode.code)
+ throw ('Error Executing User Code.')
+ }
+ }
+ }
+
+ /* This is Initialization Code */
+ if (calculationsProcedure.loop !== undefined) {
+ if (calculationsProcedure.loop.javascriptCode !== undefined) {
+ for (let index = 0; index < jsonArray.length; index++) {
+ let product = jsonArray[index]
+
+ /* This is Loop Code */
+ try {
+ eval(calculationsProcedure.loop.javascriptCode.code)
+ } catch (err) {
+ logger.write('[ERROR] calculationsProcedure -> loop -> Error executing User Code. Error = ' + err.stack.stack)
+ logger.write('[ERROR] calculationsProcedure -> loop -> Error executing User Code. product = ' + JSON.stringify(product))
+ logger.write('[ERROR] calculationsProcedure -> loop -> Error executing User Code. Code = ' + calculationsProcedure.loop.javascriptCode.code)
+ throw ('Error Executing User Code.')
+ }
+
+ /* For each calculated property we apply its formula */
+ for (let j = 0; j < recordDefinition.properties.length; j++) {
+ let property = recordDefinition.properties[j]
+ if (property.config.isCalculated === true) {
+ if (property.formula !== undefined) {
+ if (property.formula.code !== undefined) {
+ try {
+ let newValue = eval(property.formula.code)
+ let currentRecord = product
+ currentRecord[property.config.codeName] = newValue
+ } catch (err) {
+ logger.write('[ERROR] calculationsProcedure -> loop -> formula -> Error executing User Code. Error = ' + err.stack.stack)
+ logger.write('[ERROR] calculationsProcedure -> loop -> formula -> Error executing User Code. product = ' + JSON.stringify(product))
+ logger.write('[ERROR] calculationsProcedure -> loop -> formula -> Error executing User Code. Code = ' + property.formula.code)
+ throw ('Error Executing User Code.')
+ }
+ }
+ }
+ }
+ }
+
+ /* Adding the new element to the resulting array */
+ results.push(product)
+ }
+ }
+ }
+ return results
+ }
+
+ function recalculateUsingDailyFiles() {
+ try {
+ if (fileCursor === undefined) {
+ records = []
+ return
+ } // We need to wait until there is a fileCursor available or maybe this indicator does not produce data for the current Time Frame
+ if (fileCursor.files.size === 0) { return } // We need to wait until there are files in the cursor
+
+ let daysOnSides = getSideDays(timeFrame)
+
+ let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
+ let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
+
+ let dateDiff = rightDate.valueOf() - leftDate.valueOf()
+
+ let farLeftDate = new Date(leftDate.valueOf() - dateDiff * 1.5)
+ let farRightDate = new Date(rightDate.valueOf() + dateDiff * 1.5)
+
+ let currentDate = new Date(farLeftDate.valueOf())
+
+ records = []
+
+ while (currentDate.valueOf() <= farRightDate.valueOf() + ONE_DAY_IN_MILISECONDS) {
+ let stringDate = currentDate.getFullYear() + '-' + pad(currentDate.getMonth() + 1, 2) + '-' + pad(currentDate.getDate(), 2)
+
+ let dailyFile = fileCursor.files.get(stringDate)
+
+ if (dailyFile !== undefined) {
+ /* Transform the current file content into an array of JSON objects */
+ let jsonData = jsonifyDataFile(dailyFile, productDefinition.record, farLeftDate, farRightDate)
+
+ /* Add the calculated properties */
+ if (productDefinition.calculations !== undefined) {
+ let calculationsResult = calculationsProcedure(jsonData, productDefinition.record, productDefinition.calculations, timeFrame)
+ records.push(...calculationsResult) // This adds records to the current array.
+ } else {
+ records.push(...jsonData)// This adds records to the current array.
+ }
+ }
+
+ currentDate = new Date(currentDate.valueOf() + ONE_DAY_IN_MILISECONDS)
+ }
+
+ /* Lests check if all the visible screen is going to be covered by candle-record. */
+ let lowerEnd = leftDate.valueOf()
+ let upperEnd = rightDate.valueOf()
+
+ if (records.length > 0) {
+ if (records[0].begin > lowerEnd || records[records.length - 1].end < upperEnd) {
+ setTimeout(recalculate, 2000)
+ }
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] recalculateUsingDailyFiles -> err = ' + err.stack) }
+ }
+ }
+
+ function recalculateUsingMarketFiles() {
+ try {
+ if (marketFile === undefined) {
+ records = []
+ return
+ } // Initialization not complete yet or this indicator does not produce data for the current time frame
+
+ let daysOnSides = getSideDays(timeFrame)
+
+ let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem)
+ let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem)
+
+ let dateDiff = rightDate.valueOf() - leftDate.valueOf()
+
+ leftDate = new Date(leftDate.valueOf() - dateDiff * 1.5)
+ rightDate = new Date(rightDate.valueOf() + dateDiff * 1.5)
+
+ for (let i = 0; i < records.length; i++) {
+ let record = records[i]
+ record.fillStyle = undefined
+ record.strokeStyle = undefined
+ record.dataPoints = undefined
+ record.previous = undefined
+ records[i] = {}
+ }
+ records = []
+
+ /* Transform the current file content into an array of JSON objects */
+ let jsonData = jsonifyDataFile(marketFile, productDefinition.record, leftDate, rightDate)
+
+ /* Add the calculated properties */
+ if (productDefinition.calculations !== undefined) {
+ let calculationsResult = calculationsProcedure(jsonData, productDefinition.record, productDefinition.calculations, timeFrame)
+ records.push(...calculationsResult) // This adds records to the current array.
+ } else {
+ records.push(...jsonData)// This adds records to the current array.
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] recalculateUsingMarketFiles -> err = ' + err.stack) }
+ }
+ }
+
+ function recalculateScale() {
+ try {
+ if (coordinateSystem.maxValue > 0) { return } // Already calculated.
+ /* First we calculate the default scale */
+ let minValue = {
+ x: MIN_PLOTABLE_DATE.valueOf(),
+ y: 0
+ }
+
+ let maxValue = {
+ x: MAX_PLOTABLE_DATE.valueOf(),
+ y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4 // TODO: This 4 is temporary
+ }
+
+ coordinateSystem.initialize(
+ minValue,
+ maxValue,
+ thisObject.container.frame.width,
+ thisObject.container.frame.height
+ )
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] recalculateScale -> err = ' + err.stack) }
+ }
+ }
+
+ function plot() {
+ try {
+ /* Clean the pannel at places where there is no record. */
+ thisObject.container.eventHandler.raiseEvent('Current Record Changed', undefined)
+
+ for (let i = 0; i < records.length; i++) {
+ let record = records[i]
/*
- The information we store in files is independent from the charing system and its coordinate systems.
- That means that the first thing we allways need to do is to trasform these points to the coordinate system of the timeline.
+ In the formulas to create plotters, we allos users to reference the previous record.
+ To enable that we need to link all records to the previous one in this way.
*/
- let dataPoint
- dataPoint = coordinateSystem.transformThisPoint(rawPoint)
- dataPoint = transformThisPoint(dataPoint, thisObject.container)
- dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
- dataPoint = thisObject.fitFunction(dataPoint)
-
- /* Store the data point at the local map */
- dataPoint.rawPoint = rawPoint
- dataPoints.set(point.id, dataPoint)
- }
- }
- }
-
- /* Remember this datapoints, so that we do not need to calculate them again. */
- record.dataPoints = dataPoints
- }
-
- /* Here we are going to plot all the polygons. */
- for (let j = 0; j < productDefinition.referenceParent.shapes.polygons.length; j++) {
- let polygon = productDefinition.referenceParent.shapes.polygons[j]
- /* We will check if we need to plot this Polygon or not. */
- if (polygon.polygonCondition !== undefined) {
- let mustPlot = eval(polygon.polygonCondition.code)
- if (mustPlot !== true) { continue }
- }
-
- let calculatedStyle
-
- /* Finding out the fill style */
- let fillStyle = { // default values
- opacity: 1,
- paletteColor: UI_COLOR.BLACK
- }
- if (polygon.polygonBody !== undefined) {
- if (record.fillStyle === undefined) {
- record.fillStyle = new Map()
- }
- calculatedStyle = record.fillStyle.get(polygon.id)
- if (calculatedStyle !== undefined) {
- /* We use the already calculated style */
- fillStyle = calculatedStyle
- } else {
- /* Get the default style if exists */
- if (polygon.polygonBody.style !== undefined) {
- if (polygon.polygonBody.style.config !== undefined) {
- if (polygon.polygonBody.style.config.default !== undefined) {
- let bodyStyle = polygon.polygonBody.style.config.default
- if (bodyStyle.opacity !== undefined) { fillStyle.opacity = bodyStyle.opacity }
- if (bodyStyle.paletteColor !== undefined) { fillStyle.paletteColor = eval(bodyStyle.paletteColor) }
- }
+ if (i == 0) {
+ record.previous = {} // this way it wont be undefined
+ } else {
+ record.previous = records[i - 1]
}
- }
- /* Apply conditional styles */
- if (polygon.polygonBody.styleConditions !== undefined) {
- for (let k = 0; k < polygon.polygonBody.styleConditions.length; k++) {
- let condition = polygon.polygonBody.styleConditions[k]
- let value = eval(condition.code)
- if (value === true) {
- if (condition.style !== undefined) {
- let bodyStyle = condition.style.config
- if (bodyStyle.opacity !== undefined) { fillStyle.opacity = bodyStyle.opacity }
- if (bodyStyle.paletteColor !== undefined) { fillStyle.paletteColor = eval(bodyStyle.paletteColor) }
+
+ let beginPoint = {
+ x: record.begin,
+ y: 0
+ }
+
+ let endPoint = {
+ x: record.end,
+ y: 0
+ }
+
+ beginPoint = coordinateSystem.transformThisPoint(beginPoint)
+ endPoint = coordinateSystem.transformThisPoint(endPoint)
+
+ beginPoint = transformThisPoint(beginPoint, thisObject.container)
+ endPoint = transformThisPoint(endPoint, thisObject.container)
+
+ beginPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(beginPoint)
+ endPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(endPoint)
+
+ beginPoint = thisObject.fitFunction(beginPoint)
+ endPoint = thisObject.fitFunction(endPoint)
+
+ if (endPoint.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || beginPoint.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
+ continue
+ }
+
+ let atMousePosition = false
+ if (userPositionDate >= record.begin && userPositionDate <= record.end) {
+ if (record.rate !== undefined && productDefinition.referenceParent.config.useRateAtMousePosition === true) {
+ /* Current Record depends also on rate */
+ if (record.rate >= minUserPositionRate && record.rate <= maxUserPositionRate) {
+ atMousePosition = true
+ thisObject.container.eventHandler.raiseEvent('Current Record Changed', record)
+ }
+ } else {
+ /* Current Record depends only on begin and end. */
+ atMousePosition = true
+ thisObject.container.eventHandler.raiseEvent('Current Record Changed', record)
}
- }
}
- }
- /* Get the atMousePosition style if exists */
- if (polygon.polygonBody.style !== undefined) {
- if (polygon.polygonBody.style.config.atMousePosition !== undefined) {
- let atMousePositionStyleDefinition = polygon.polygonBody.style.config.atMousePosition
- let atMousePositionStyle = {}
- if (atMousePositionStyleDefinition.opacity !== undefined) { atMousePositionStyle.opacity = atMousePositionStyleDefinition.opacity }
- if (atMousePositionStyleDefinition.paletteColor !== undefined) { atMousePositionStyle.paletteColor = eval(atMousePositionStyleDefinition.paletteColor) }
- atMousePositionFillStyles.set(polygon.id, atMousePositionStyle)
- }
- }
- record.fillStyle.set(polygon.id, fillStyle)
- }
- }
-
- /* Finding out the stroke style */
- let strokeStyle = { // default values
- opacity: 1,
- paletteColor: UI_COLOR.BLACK,
- lineWidth: 1,
- lineDash: [0, 0]
- }
- if (polygon.polygonBorder !== undefined) {
- if (record.strokeStyle === undefined) {
- record.strokeStyle = new Map()
- }
- calculatedStyle = record.strokeStyle.get(polygon.id)
- if (calculatedStyle !== undefined) {
- /* We use the already calculated style */
- strokeStyle = calculatedStyle
- } else {
- /* Get the default style if exists */
- if (polygon.polygonBorder.style !== undefined) {
- if (polygon.polygonBorder.style.config !== undefined) {
- if (polygon.polygonBorder.style.config.default !== undefined) {
- let borderStyle = polygon.polygonBorder.style.config.default
- if (borderStyle.opacity !== undefined) { strokeStyle.opacity = borderStyle.opacity }
- if (borderStyle.paletteColor !== undefined) { strokeStyle.paletteColor = eval(borderStyle.paletteColor) }
- if (borderStyle.lineWidth !== undefined) { strokeStyle.lineWidth = borderStyle.lineWidth }
- if (borderStyle.lineDash !== undefined) { strokeStyle.lineDash = borderStyle.lineDash }
- }
+ /* If there is code we execute it now. */
+ if (productDefinition.referenceParent.javascriptCode !== undefined) {
+ eval(productDefinition.referenceParent.javascriptCode.code)
}
- }
- /* Apply conditional styles */
- if (polygon.polygonBorder.styleConditions !== undefined) {
- for (let k = 0; k < polygon.polygonBorder.styleConditions.length; k++) {
- let condition = polygon.polygonBorder.styleConditions[k]
- let value = eval(condition.code)
- if (value === true) {
- if (condition.style !== undefined) {
- let borderStyle = condition.style.config
- if (borderStyle.opacity !== undefined) { strokeStyle.opacity = borderStyle.opacity }
- if (borderStyle.paletteColor !== undefined) { strokeStyle.paletteColor = eval(borderStyle.paletteColor) }
- if (borderStyle.lineWidth !== undefined) { strokeStyle.lineWidth = borderStyle.lineWidth }
- if (borderStyle.lineDash !== undefined) { strokeStyle.lineDash = borderStyle.lineDash }
+
+ if (productDefinition.referenceParent.shapes === undefined) { continue }
+ if (productDefinition.referenceParent.shapes.chartPoints === undefined) { continue }
+ let dataPoints = new Map()
+ if (record.dataPoints !== undefined && mustRecalculateDataPoints === false) {
+ /* We use the datapoints already calculated. */
+ dataPoints = record.dataPoints
+ } else {
+ if (logged === false) {
+ logged = true
}
- }
+ /* It seems we need to calculate the data points this time. */
+ for (let k = 0; k < productDefinition.referenceParent.shapes.chartPoints.length; k++) {
+ let chartPoints = productDefinition.referenceParent.shapes.chartPoints[k]
+ for (let j = 0; j < chartPoints.points.length; j++) {
+ let point = chartPoints.points[j]
+ if (point.pointFormula !== undefined) {
+ let x = 0
+ let y = 0
+ eval(point.pointFormula.code)
+ let rawPoint = {
+ x: x,
+ y: y
+ }
+
+ /*
+ The information we store in files is independent from the charing system and its coordinate systems.
+ That means that the first thing we allways need to do is to trasform these points to the coordinate system of the timeline.
+ */
+ let dataPoint
+ dataPoint = coordinateSystem.transformThisPoint(rawPoint)
+ dataPoint = transformThisPoint(dataPoint, thisObject.container)
+ dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
+ dataPoint = thisObject.fitFunction(dataPoint)
+
+ /* Store the data point at the local map */
+ dataPoint.rawPoint = rawPoint
+ dataPoints.set(point.id, dataPoint)
+ }
+ }
+ }
+
+ /* Remember this datapoints, so that we do not need to calculate them again. */
+ record.dataPoints = dataPoints
}
- }
- /* Get the atMousePosition style if exists */
- if (polygon.polygonBorder.style !== undefined) {
- if (polygon.polygonBorder.style.config.atMousePosition !== undefined) {
- let atMousePositionStyleDefinition = polygon.polygonBorder.style.config.atMousePosition
- let atMousePositionStyle = {}
- if (atMousePositionStyleDefinition.opacity !== undefined) { atMousePositionStyle.opacity = atMousePositionStyleDefinition.opacity }
- if (atMousePositionStyleDefinition.paletteColor !== undefined) { atMousePositionStyle.paletteColor = eval(atMousePositionStyleDefinition.paletteColor) }
- if (atMousePositionStyleDefinition.lineWidth !== undefined) { atMousePositionStyle.lineWidth = atMousePositionStyleDefinition.lineWidth }
- if (atMousePositionStyleDefinition.lineDash !== undefined) { atMousePositionStyle.lineDash = atMousePositionStyleDefinition.lineDash }
- atMousePositionStrokeStyles.set(polygon.id, atMousePositionStyle)
+
+ /* Here we are going to plot all the polygons. */
+ for (let j = 0; j < productDefinition.referenceParent.shapes.polygons.length; j++) {
+ let polygon = productDefinition.referenceParent.shapes.polygons[j]
+ /* We will check if we need to plot this Polygon or not. */
+ if (polygon.polygonCondition !== undefined) {
+ let mustPlot = eval(polygon.polygonCondition.code)
+ if (mustPlot !== true) { continue }
+ }
+
+ let calculatedStyle
+
+ /* Finding out the fill style */
+ let fillStyle = { // default values
+ opacity: 1,
+ paletteColor: UI_COLOR.BLACK
+ }
+ if (polygon.polygonBody !== undefined) {
+ if (record.fillStyle === undefined) {
+ record.fillStyle = new Map()
+ }
+ calculatedStyle = record.fillStyle.get(polygon.id)
+ if (calculatedStyle !== undefined) {
+ /* We use the already calculated style */
+ fillStyle = calculatedStyle
+ } else {
+ /* Get the default style if exists */
+ if (polygon.polygonBody.style !== undefined) {
+ if (polygon.polygonBody.style.config !== undefined) {
+ if (polygon.polygonBody.style.config.default !== undefined) {
+ let bodyStyle = polygon.polygonBody.style.config.default
+ if (bodyStyle.opacity !== undefined) { fillStyle.opacity = bodyStyle.opacity }
+ if (bodyStyle.paletteColor !== undefined) { fillStyle.paletteColor = eval(bodyStyle.paletteColor) }
+ }
+ }
+ }
+ /* Apply conditional styles */
+ if (polygon.polygonBody.styleConditions !== undefined) {
+ for (let k = 0; k < polygon.polygonBody.styleConditions.length; k++) {
+ let condition = polygon.polygonBody.styleConditions[k]
+ let value = eval(condition.code)
+ if (value === true) {
+ if (condition.style !== undefined) {
+ let bodyStyle = condition.style.config
+ if (bodyStyle.opacity !== undefined) { fillStyle.opacity = bodyStyle.opacity }
+ if (bodyStyle.paletteColor !== undefined) { fillStyle.paletteColor = eval(bodyStyle.paletteColor) }
+ }
+ }
+ }
+ }
+ /* Get the atMousePosition style if exists */
+ if (polygon.polygonBody.style !== undefined) {
+ if (polygon.polygonBody.style.config.atMousePosition !== undefined) {
+ let atMousePositionStyleDefinition = polygon.polygonBody.style.config.atMousePosition
+ let atMousePositionStyle = {}
+ if (atMousePositionStyleDefinition.opacity !== undefined) { atMousePositionStyle.opacity = atMousePositionStyleDefinition.opacity }
+ if (atMousePositionStyleDefinition.paletteColor !== undefined) { atMousePositionStyle.paletteColor = eval(atMousePositionStyleDefinition.paletteColor) }
+ atMousePositionFillStyles.set(polygon.id, atMousePositionStyle)
+ }
+ }
+
+ record.fillStyle.set(polygon.id, fillStyle)
+ }
+ }
+
+ /* Finding out the stroke style */
+ let strokeStyle = { // default values
+ opacity: 1,
+ paletteColor: UI_COLOR.BLACK,
+ lineWidth: 1,
+ lineDash: [0, 0]
+ }
+ if (polygon.polygonBorder !== undefined) {
+ if (record.strokeStyle === undefined) {
+ record.strokeStyle = new Map()
+ }
+ calculatedStyle = record.strokeStyle.get(polygon.id)
+ if (calculatedStyle !== undefined) {
+ /* We use the already calculated style */
+ strokeStyle = calculatedStyle
+ } else {
+ /* Get the default style if exists */
+ if (polygon.polygonBorder.style !== undefined) {
+ if (polygon.polygonBorder.style.config !== undefined) {
+ if (polygon.polygonBorder.style.config.default !== undefined) {
+ let borderStyle = polygon.polygonBorder.style.config.default
+ if (borderStyle.opacity !== undefined) { strokeStyle.opacity = borderStyle.opacity }
+ if (borderStyle.paletteColor !== undefined) { strokeStyle.paletteColor = eval(borderStyle.paletteColor) }
+ if (borderStyle.lineWidth !== undefined) { strokeStyle.lineWidth = borderStyle.lineWidth }
+ if (borderStyle.lineDash !== undefined) { strokeStyle.lineDash = borderStyle.lineDash }
+ }
+ }
+ }
+ /* Apply conditional styles */
+ if (polygon.polygonBorder.styleConditions !== undefined) {
+ for (let k = 0; k < polygon.polygonBorder.styleConditions.length; k++) {
+ let condition = polygon.polygonBorder.styleConditions[k]
+ let value = eval(condition.code)
+ if (value === true) {
+ if (condition.style !== undefined) {
+ let borderStyle = condition.style.config
+ if (borderStyle.opacity !== undefined) { strokeStyle.opacity = borderStyle.opacity }
+ if (borderStyle.paletteColor !== undefined) { strokeStyle.paletteColor = eval(borderStyle.paletteColor) }
+ if (borderStyle.lineWidth !== undefined) { strokeStyle.lineWidth = borderStyle.lineWidth }
+ if (borderStyle.lineDash !== undefined) { strokeStyle.lineDash = borderStyle.lineDash }
+ }
+ }
+ }
+ }
+ /* Get the atMousePosition style if exists */
+ if (polygon.polygonBorder.style !== undefined) {
+ if (polygon.polygonBorder.style.config.atMousePosition !== undefined) {
+ let atMousePositionStyleDefinition = polygon.polygonBorder.style.config.atMousePosition
+ let atMousePositionStyle = {}
+ if (atMousePositionStyleDefinition.opacity !== undefined) { atMousePositionStyle.opacity = atMousePositionStyleDefinition.opacity }
+ if (atMousePositionStyleDefinition.paletteColor !== undefined) { atMousePositionStyle.paletteColor = eval(atMousePositionStyleDefinition.paletteColor) }
+ if (atMousePositionStyleDefinition.lineWidth !== undefined) { atMousePositionStyle.lineWidth = atMousePositionStyleDefinition.lineWidth }
+ if (atMousePositionStyleDefinition.lineDash !== undefined) { atMousePositionStyle.lineDash = atMousePositionStyleDefinition.lineDash }
+ atMousePositionStrokeStyles.set(polygon.id, atMousePositionStyle)
+ }
+ }
+
+ record.strokeStyle.set(polygon.id, strokeStyle)
+ }
+ }
+
+ /* Draw the Polygon */
+ browserCanvasContext.beginPath()
+ for (let k = 0; k < polygon.polygonVertexes.length; k++) {
+ let polygonVertex = polygon.polygonVertexes[k]
+ if (polygonVertex.referenceParent !== undefined) {
+ let dataPointObject = dataPoints.get(polygonVertex.referenceParent.id)
+ if (dataPointObject === undefined) {
+ console.log('[WARN] You have a Polygon Vertex not referencing any Point.')
+ continue
+ }
+
+ /* Contributing to Auto-Scale */
+ if (dataPointObject.rawPoint.y > 1 && dataPointObject.rawPoint.y !== undefined && isNaN(dataPointObject.rawPoint.y) === false) {
+ coordinateSystem.reportYValue(dataPointObject.rawPoint.y)
+ }
+
+ let dataPoint = {
+ x: dataPointObject.x,
+ y: dataPointObject.y
+ }
+ /* We make sure the points do not fall outside the viewport visible area. This step allways need to be done. */
+ dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
+ dataPoint = thisObject.fitFunction(dataPoint)
+ if (k === 0) {
+ browserCanvasContext.moveTo(dataPoint.x, dataPoint.y)
+ } else {
+ browserCanvasContext.lineTo(dataPoint.x, dataPoint.y)
+ }
+ }
+ }
+ browserCanvasContext.closePath()
+
+ /* Apply the fill style to the canvas object */
+ if (polygon.polygonBody !== undefined) {
+ /* Replace the fill style if we are at mouse position */
+ if (atMousePosition === true) {
+ let atMousePositionFillStyle = atMousePositionFillStyles.get(polygon.id)
+ if (atMousePositionFillStyle !== undefined) {
+ fillStyle = atMousePositionFillStyle
+ }
+ }
+
+ browserCanvasContext.fillStyle = 'rgba(' + fillStyle.paletteColor + ', ' + fillStyle.opacity + ')'
+ browserCanvasContext.fill()
+ }
+
+ /* Apply the stroke style to the canvas object */
+ if (polygon.polygonBorder !== undefined) {
+ /* Replace the stroke style if we are at mouse position */
+ if (atMousePosition === true) {
+ let atMousePositionStrokeStyle = atMousePositionStrokeStyles.get(polygon.id)
+ if (atMousePositionStrokeStyle !== undefined) {
+ strokeStyle = atMousePositionStrokeStyle
+ }
+ }
+
+ browserCanvasContext.lineWidth = strokeStyle.lineWidth
+ browserCanvasContext.setLineDash(strokeStyle.lineDash)
+ browserCanvasContext.strokeStyle = 'rgba(' + strokeStyle.paletteColor + ', ' + strokeStyle.opacity + ')'
+ browserCanvasContext.stroke()
+ }
}
- }
- record.strokeStyle.set(polygon.id, strokeStyle)
- }
- }
+ /* Here we are going to plot images. */
+ for (let j = 0; j < productDefinition.referenceParent.shapes.images.length; j++) {
+ let image = productDefinition.referenceParent.shapes.images[j]
+ if (image.imagePosition === undefined) { continue }
+ if (image.imagePosition.referenceParent === undefined) { continue }
+ if (image.imageCondition !== undefined) {
+ let mustPlot = eval(image.imageCondition.code)
+ if (mustPlot !== true) { continue }
+ }
+ let imageName = ''
+ let imageSize = 0
+ let offsetX = 0
+ let offsetY = 0
+ let imagePosition = { x: 0, y: 0 }
+ if (image.config.codeName !== undefined) { imageName = image.config.codeName }
+ if (image.config.size !== undefined) { imageSize = image.config.size }
+ if (image.imagePosition.config.offsetX !== undefined) { offsetX = image.imagePosition.config.offsetX }
+ if (image.imagePosition.config.offsetY !== undefined) { offsetY = image.imagePosition.config.offsetY }
+ let dataPointObject = dataPoints.get(image.imagePosition.referenceParent.id)
+ if (dataPointObject === undefined) { continue }
+ let dataPoint = {
+ x: dataPointObject.x,
+ y: dataPointObject.y
+ }
+ dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
+ dataPoint = thisObject.fitFunction(dataPoint)
+ imagePosition.x = dataPoint.x
+ imagePosition.y = dataPoint.y
+ let imageToDraw = canvas.designSpace.iconCollection.get(imageName)
+ if (imageToDraw.canDrawIcon === true) {
+ browserCanvasContext.drawImage(imageToDraw, imagePosition.x - imageSize / 2 + offsetX, imagePosition.y - imageSize / 2 - offsetY, imageSize, imageSize)
+ }
+ }
- /* Draw the Polygon */
- browserCanvasContext.beginPath()
- for (let k = 0; k < polygon.polygonVertexes.length; k++) {
- let polygonVertex = polygon.polygonVertexes[k]
- if (polygonVertex.referenceParent !== undefined) {
- let dataPointObject = dataPoints.get(polygonVertex.referenceParent.id)
- if (dataPointObject === undefined) {
- console.log('[WARN] You have a Polygon Vertex not referencing any Point.')
- continue
- }
+ /* Here we are going to plot texts. */
+ for (let j = 0; j < productDefinition.referenceParent.shapes.texts.length; j++) {
+ let text = productDefinition.referenceParent.shapes.texts[j]
+ if (text.textPosition === undefined) { continue }
+ if (text.textPosition.referenceParent === undefined) { continue }
+ if (text.textCondition !== undefined) {
+ let mustPlot = eval(text.textCondition.code)
+ if (mustPlot !== true) { continue }
+ }
+ if (text.textFormula === undefined) { continue }
+ if (text.textStyle === undefined) { continue }
+ let value = eval(text.textFormula.code)
+ let fontSize = 0
+ let opacity = 0
+ let paletteColor = UI_COLOR.GREY
+ let offsetX = 0
+ let offsetY = 0
+ let textPosition = { x: 0, y: 0 }
+ if (text.textStyle.config.fontSize !== undefined) { fontSize = text.textStyle.config.fontSize }
+ if (text.textStyle.config.opacity !== undefined) { opacity = text.textStyle.config.opacity }
+ if (text.textStyle.config.paletteColor !== undefined) { paletteColor = eval(text.textStyle.config.paletteColor) }
+ if (text.textPosition.config.offsetX !== undefined) { offsetX = text.textPosition.config.offsetX }
+ if (text.textPosition.config.offsetY !== undefined) { offsetY = text.textPosition.config.offsetY }
+ let dataPointObject = dataPoints.get(text.textPosition.referenceParent.id)
+ if (dataPointObject === undefined) { continue }
+ let dataPoint = {
+ x: dataPointObject.x,
+ y: dataPointObject.y
+ }
+ dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
+ dataPoint = thisObject.fitFunction(dataPoint)
+ textPosition.x = dataPoint.x
+ textPosition.y = dataPoint.y
- /* Contributing to Auto-Scale */
- if (dataPointObject.rawPoint.y > 1 && dataPointObject.rawPoint.y !== undefined && isNaN(dataPointObject.rawPoint.y) === false) {
- coordinateSystem.reportYValue(dataPointObject.rawPoint.y)
- }
-
- let dataPoint = {
- x: dataPointObject.x,
- y: dataPointObject.y
- }
- /* We make sure the points do not fall outside the viewport visible area. This step allways need to be done. */
- dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
- dataPoint = thisObject.fitFunction(dataPoint)
- if (k === 0) {
- browserCanvasContext.moveTo(dataPoint.x, dataPoint.y)
- } else {
- browserCanvasContext.lineTo(dataPoint.x, dataPoint.y)
- }
- }
- }
- browserCanvasContext.closePath()
-
- /* Apply the fill style to the canvas object */
- if (polygon.polygonBody !== undefined) {
- /* Replace the fill style if we are at mouse position */
- if (atMousePosition === true) {
- let atMousePositionFillStyle = atMousePositionFillStyles.get(polygon.id)
- if (atMousePositionFillStyle !== undefined) {
- fillStyle = atMousePositionFillStyle
- }
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + paletteColor + ', ' + opacity + ')'
+ browserCanvasContext.fillText(value, textPosition.x + offsetX, textPosition.y - offsetY)
+ }
}
- browserCanvasContext.fillStyle = 'rgba(' + fillStyle.paletteColor + ', ' + fillStyle.opacity + ')'
- browserCanvasContext.fill()
- }
-
- /* Apply the stroke style to the canvas object */
- if (polygon.polygonBorder !== undefined) {
- /* Replace the stroke style if we are at mouse position */
- if (atMousePosition === true) {
- let atMousePositionStrokeStyle = atMousePositionStrokeStyles.get(polygon.id)
- if (atMousePositionStrokeStyle !== undefined) {
- strokeStyle = atMousePositionStrokeStyle
- }
+ if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMinYScale === true) {
+ mustRecalculateDataPoints = true
+ } else {
+ mustRecalculateDataPoints = false
}
- browserCanvasContext.lineWidth = strokeStyle.lineWidth
- browserCanvasContext.setLineDash(strokeStyle.lineDash)
- browserCanvasContext.strokeStyle = 'rgba(' + strokeStyle.paletteColor + ', ' + strokeStyle.opacity + ')'
- browserCanvasContext.stroke()
- }
+ logged = false
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] plot -> err = ' + err.stack) }
}
-
- /* Here we are going to plot images. */
- for (let j = 0; j < productDefinition.referenceParent.shapes.images.length; j++) {
- let image = productDefinition.referenceParent.shapes.images[j]
- if (image.imagePosition === undefined) { continue }
- if (image.imagePosition.referenceParent === undefined) { continue }
- if (image.imageCondition !== undefined) {
- let mustPlot = eval(image.imageCondition.code)
- if (mustPlot !== true) { continue }
- }
- let imageName = ''
- let imageSize = 0
- let offsetX = 0
- let offsetY = 0
- let imagePosition = { x: 0, y: 0 }
- if (image.config.codeName !== undefined) { imageName = image.config.codeName }
- if (image.config.size !== undefined) { imageSize = image.config.size }
- if (image.imagePosition.config.offsetX !== undefined) { offsetX = image.imagePosition.config.offsetX }
- if (image.imagePosition.config.offsetY !== undefined) { offsetY = image.imagePosition.config.offsetY }
- let dataPointObject = dataPoints.get(image.imagePosition.referenceParent.id)
- if (dataPointObject === undefined) { continue }
- let dataPoint = {
- x: dataPointObject.x,
- y: dataPointObject.y
- }
- dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
- dataPoint = thisObject.fitFunction(dataPoint)
- imagePosition.x = dataPoint.x
- imagePosition.y = dataPoint.y
- let imageToDraw = canvas.designSpace.iconCollection.get(imageName)
- if (imageToDraw.canDrawIcon === true) {
- browserCanvasContext.drawImage(imageToDraw, imagePosition.x - imageSize / 2 + offsetX, imagePosition.y - imageSize / 2 - offsetY, imageSize, imageSize)
- }
- }
-
- /* Here we are going to plot texts. */
- for (let j = 0; j < productDefinition.referenceParent.shapes.texts.length; j++) {
- let text = productDefinition.referenceParent.shapes.texts[j]
- if (text.textPosition === undefined) { continue }
- if (text.textPosition.referenceParent === undefined) { continue }
- if (text.textCondition !== undefined) {
- let mustPlot = eval(text.textCondition.code)
- if (mustPlot !== true) { continue }
- }
- if (text.textFormula === undefined) { continue }
- if (text.textStyle === undefined) { continue }
- let value = eval(text.textFormula.code)
- let fontSize = 0
- let opacity = 0
- let paletteColor = UI_COLOR.GREY
- let offsetX = 0
- let offsetY = 0
- let textPosition = { x: 0, y: 0 }
- if (text.textStyle.config.fontSize !== undefined) { fontSize = text.textStyle.config.fontSize }
- if (text.textStyle.config.opacity !== undefined) { opacity = text.textStyle.config.opacity }
- if (text.textStyle.config.paletteColor !== undefined) { paletteColor = eval(text.textStyle.config.paletteColor) }
- if (text.textPosition.config.offsetX !== undefined) { offsetX = text.textPosition.config.offsetX }
- if (text.textPosition.config.offsetY !== undefined) { offsetY = text.textPosition.config.offsetY }
- let dataPointObject = dataPoints.get(text.textPosition.referenceParent.id)
- if (dataPointObject === undefined) { continue }
- let dataPoint = {
- x: dataPointObject.x,
- y: dataPointObject.y
- }
- dataPoint = canvas.chartingSpace.viewport.fitIntoVisibleArea(dataPoint)
- dataPoint = thisObject.fitFunction(dataPoint)
- textPosition.x = dataPoint.x
- textPosition.y = dataPoint.y
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + paletteColor + ', ' + opacity + ')'
- browserCanvasContext.fillText(value, textPosition.x + offsetX, textPosition.y - offsetY)
- }
- }
-
- if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMinYScale === true) {
- mustRecalculateDataPoints = true
- } else {
- mustRecalculateDataPoints = false
- }
-
- logged = false
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] plot -> err = ' + err.stack) }
}
- }
- function onViewportZoomChanged(event) {
- try {
- mustRecalculateDataPoints = true
- recalculate()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] onViewportZoomChanged -> err = ' + err.stack) }
+ function onViewportZoomChanged(event) {
+ try {
+ mustRecalculateDataPoints = true
+ recalculate()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] onViewportZoomChanged -> err = ' + err.stack) }
+ }
}
- }
- function onDragFinished() {
- recalculate()
- }
-
- function onDisplace(event) {
- recalculateAll(event)
- }
-
- function onViewportPositionChanged(event) {
- recalculateAll(event)
- }
-
- function recalculateAll(event) {
- mustRecalculateDataPoints = true
- if (event !== undefined) {
- if (event.recalculate === true) {
+ function onDragFinished() {
recalculate()
- return
- }
}
- if (Math.random() * 100 > 95) {
- recalculate()
+
+ function onDisplace(event) {
+ recalculateAll(event)
+ }
+
+ function onViewportPositionChanged(event) {
+ recalculateAll(event)
+ }
+
+ function recalculateAll(event) {
+ mustRecalculateDataPoints = true
+ if (event !== undefined) {
+ if (event.recalculate === true) {
+ recalculate()
+ return
+ }
+ }
+ if (Math.random() * 100 > 95) {
+ recalculate()
+ }
}
- }
}
diff --git a/CanvasApp/Plotting/RecordValues.js b/CanvasApp/Plotting/RecordValues.js
index 8f84ba629..486e81e4c 100644
--- a/CanvasApp/Plotting/RecordValues.js
+++ b/CanvasApp/Plotting/RecordValues.js
@@ -1,92 +1,92 @@
-function newRecordValues () {
- const MODULE_NAME = 'Record Values'
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newRecordValues() {
+ const MODULE_NAME = 'Record Values'
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- onRecordChange: onRecordChange,
- initialize: initialize,
- finalize: finalize
- }
+ let thisObject = {
+ onRecordChange: onRecordChange,
+ initialize: initialize,
+ finalize: finalize
+ }
- let tradingSystem
- let tradingEngine
- let productDefinition
- let propertyTargetNodeMap = new Map()
- return thisObject
+ let tradingSystem
+ let tradingEngine
+ let productDefinition
+ let propertyTargetNodeMap = new Map()
+ return thisObject
- function finalize () {
- tradingSystem = undefined
- tradingEngine = undefined
- productDefinition = undefined
- propertyTargetNodeMap = undefined
- }
+ function finalize() {
+ tradingSystem = undefined
+ tradingEngine = undefined
+ productDefinition = undefined
+ propertyTargetNodeMap = undefined
+ }
- function initialize (pTradingSystem, pTradingEngine, pProductDefinition) {
- tradingSystem = canvas.designSpace.workspace.getHierarchyHeadsById(pTradingSystem.id)
- tradingEngine = canvas.designSpace.workspace.getHierarchyHeadsById(pTradingEngine.id)
- productDefinition = pProductDefinition
+ function initialize(pTradingSystem, pTradingEngine, pProductDefinition) {
+ tradingSystem = canvas.designSpace.workspace.getHierarchyHeadsById(pTradingSystem.id)
+ tradingEngine = canvas.designSpace.workspace.getHierarchyHeadsById(pTradingEngine.id)
+ productDefinition = pProductDefinition
- /*
- The product root can be a node or a node property of type array.
- */
- let productRoot = eval(productDefinition.config.nodePath)
-
- if (productDefinition.config.nodePathType === 'array') {
/*
- This means that the configured nodePath is not pointing to a node, but to a node property that is an array.
- For that reason we will assume that each element of the array is a record to be outputed
+ The product root can be a node or a node property of type array.
*/
- for (let index = 0; index < productRoot.length; index++) {
+ let productRoot = eval(productDefinition.config.nodePath)
+
+ if (productDefinition.config.nodePathType === 'array') {
+ /*
+ This means that the configured nodePath is not pointing to a node, but to a node property that is an array.
+ For that reason we will assume that each element of the array is a record to be outputed
+ */
+ for (let index = 0; index < productRoot.length; index++) {
+ /*
+ The Product Root Node is the root of the node hiriarchy from where we are going to extract the record values.
+ */
+ let productRootNode = productRoot[index]
+ scanProperties(productRootNode, index)
+ }
+ } else {
+ /*
+ This means that the configured nodePath points to a single node, which is the one whose children constitutes
+ the record to be saved at the output file.
+ */
/*
The Product Root Node is the root of the node hiriarchy from where we are going to extract the record values.
*/
- let productRootNode = productRoot[index]
- scanProperties(productRootNode, index)
- }
- } else {
- /*
- This means that the configured nodePath points to a single node, which is the one whose children constitutes
- the record to be saved at the output file.
- */
- /*
- The Product Root Node is the root of the node hiriarchy from where we are going to extract the record values.
- */
- let productRootNode = productRoot
- scanProperties(productRootNode)
- }
-
- function scanProperties (productRootNode, index) {
- for (let i = 0; i < productDefinition.record.properties.length; i++) {
- let property = productDefinition.record.properties[i]
- if (property.config.nodePath !== undefined) {
- let propertyRoot = eval(property.config.nodePath)
- propertyTargetNodeMap.set(property.id, propertyRoot)
- } else {
- propertyTargetNodeMap.set(property.id, productRootNode)
+ let productRootNode = productRoot
+ scanProperties(productRootNode)
}
- }
- }
- }
- function onRecordChange (currentRecord) {
- if (currentRecord === undefined) { return }
- for (let i = 0; i < productDefinition.record.properties.length; i++) {
- let property = productDefinition.record.properties[i]
- let value = currentRecord[property.config.codeName]
- let targetNode = propertyTargetNodeMap.get(property.id)
- applyValue(targetNode[property.config.codeName], value)
+ function scanProperties(productRootNode, index) {
+ for (let i = 0; i < productDefinition.record.properties.length; i++) {
+ let property = productDefinition.record.properties[i]
+ if (property.config.nodePath !== undefined) {
+ let propertyRoot = eval(property.config.nodePath)
+ propertyTargetNodeMap.set(property.id, propertyRoot)
+ } else {
+ propertyTargetNodeMap.set(property.id, productRootNode)
+ }
+ }
+ }
}
- }
- function applyValue (node, value) {
- 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' }
- if (value === false) { value = 'false' }
- node.payload.uiObject.setValue(value, 1)
- }
+ function onRecordChange(currentRecord) {
+ if (currentRecord === undefined) { return }
+ for (let i = 0; i < productDefinition.record.properties.length; i++) {
+ let property = productDefinition.record.properties[i]
+ let value = currentRecord[property.config.codeName]
+ let targetNode = propertyTargetNodeMap.get(property.id)
+ applyValue(targetNode[property.config.codeName], value)
+ }
+ }
+
+ function applyValue(node, value) {
+ 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' }
+ if (value === false) { value = 'false' }
+ node.payload.uiObject.setValue(value, 1)
+ }
}
diff --git a/CanvasApp/PostLoader.js b/CanvasApp/PostLoader.js
index 82c268bec..8dd748334 100644
--- a/CanvasApp/PostLoader.js
+++ b/CanvasApp/PostLoader.js
@@ -4,86 +4,86 @@ let markets
let APP_SCHEMA_MAP = new Map()
let APP_SCHEMA_ARRAY = []
-function newDashboard () {
- const MODULE_NAME = 'Dashboard'
- const ERROR_LOG = true
- const INTENSIVE_LOG = false
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newDashboard() {
+ const MODULE_NAME = 'Dashboard'
+ const ERROR_LOG = true
+ const INTENSIVE_LOG = false
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- start: start
- }
-
- const DEBUG_START_UP_DELAY = 0 // 3000; // This is a waiting time in case there is a need to debug the very first steps of initialization, to be able to hit F12 on time.
-
- return thisObject
-
- function start () {
- try {
- setBrowserEvents()
- setUpAppSchema()
-
- function setUpAppSchema () {
- APP_SCHEMA_ARRAY = getAppSchema()
- for (let i = 0; i < APP_SCHEMA_ARRAY.length; i++) {
- let nodeDefinition = APP_SCHEMA_ARRAY[i]
- let key = nodeDefinition.type
- APP_SCHEMA_MAP.set(key, nodeDefinition)
- }
- startCanvas()
- }
-
- function startCanvas () {
- /* If this method is executed for a second time, it should finalize the current execution structure */
-
- if (canvas !== undefined) { canvas.finalize() }
-
- setTimeout(delayedStart, DEBUG_START_UP_DELAY)
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] start -> err = ' + err.stack) }
+ let thisObject = {
+ start: start
}
- }
- function delayedStart () {
- try {
+ const DEBUG_START_UP_DELAY = 0 // 3000; // This is a waiting time in case there is a need to debug the very first steps of initialization, to be able to hit F12 on time.
+
+ return thisObject
+
+ function start() {
+ try {
+ setBrowserEvents()
+ setUpAppSchema()
+
+ function setUpAppSchema() {
+ APP_SCHEMA_ARRAY = getAppSchema()
+ for (let i = 0; i < APP_SCHEMA_ARRAY.length; i++) {
+ let nodeDefinition = APP_SCHEMA_ARRAY[i]
+ let key = nodeDefinition.type
+ APP_SCHEMA_MAP.set(key, nodeDefinition)
+ }
+ startCanvas()
+ }
+
+ function startCanvas() {
+ /* If this method is executed for a second time, it should finalize the current execution structure */
+
+ if (canvas !== undefined) { canvas.finalize() }
+
+ setTimeout(delayedStart, DEBUG_START_UP_DELAY)
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] start -> err = ' + err.stack) }
+ }
+ }
+
+ function delayedStart() {
+ try {
/* For now, we are supporting only one market. */
- let market = {
- id: 2,
- baseAsset: 'USDT',
- quotedAsset: 'BTC'
- }
+ let market = {
+ id: 2,
+ baseAsset: 'USDT',
+ quotedAsset: 'BTC'
+ }
- markets = new Map()
+ markets = new Map()
- markets.set(market.id, market)
+ markets.set(market.id, market)
- canvas = newCanvas()
- canvas.initialize()
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] delayedStart -> err = ' + err.stack) }
- }
- }
-
- function setBrowserEvents () {
- window.onbeforeunload = saveWorkspace
-
- /* handles backspace and refresh(F5) from keyboard */
- window.manageBackRefresh = function (event) {
- var tag = event.target.tagName.toLowerCase()
- if (event.keyCode == 8 && tag != 'input' && tag != 'textarea') { // Backbutton pressed
- saveWorkspace()
- } else if (event.keyCode == 116) { // F5 pressed
- saveWorkspace()
- }
+ canvas = newCanvas()
+ canvas.initialize()
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] delayedStart -> err = ' + err.stack) }
+ }
}
- window.addEventListener('keydown', window.manageBackRefresh)
+ function setBrowserEvents() {
+ window.onbeforeunload = saveWorkspace
- function saveWorkspace () {
- canvas.designSpace.workspace.save()
+ /* handles backspace and refresh(F5) from keyboard */
+ window.manageBackRefresh = function (event) {
+ var tag = event.target.tagName.toLowerCase()
+ if (event.keyCode == 8 && tag != 'input' && tag != 'textarea') { // Backbutton pressed
+ saveWorkspace()
+ } else if (event.keyCode == 116) { // F5 pressed
+ saveWorkspace()
+ }
+ }
+
+ window.addEventListener('keydown', window.manageBackRefresh)
+
+ function saveWorkspace() {
+ canvas.designSpace.workspace.save()
+ }
}
- }
}
diff --git a/CanvasApp/ProductStorage.js b/CanvasApp/ProductStorage.js
index 57c8e6b8a..6f83e19b2 100644
--- a/CanvasApp/ProductStorage.js
+++ b/CanvasApp/ProductStorage.js
@@ -1,9 +1,9 @@
- 
-function newProductStorage (name) {
- const MODULE_NAME = 'Product Storage'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+
+function newProductStorage(name) {
+ const MODULE_NAME = 'Product Storage'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
/*
@@ -24,310 +24,310 @@ function newProductStorage (name) {
*/
- let thisObject = {
- eventHandler: undefined,
- marketFiles: [],
- dailyFiles: [],
- singleFile: [],
- fileSequences: [],
- setDatetime: setDatetime,
- setTimeFrame: setTimeFrame,
- initialize: initialize,
- finalize: finalize
- }
+ let thisObject = {
+ eventHandler: undefined,
+ marketFiles: [],
+ dailyFiles: [],
+ singleFile: [],
+ fileSequences: [],
+ setDatetime: setDatetime,
+ setTimeFrame: setTimeFrame,
+ initialize: initialize,
+ finalize: finalize
+ }
- thisObject.eventHandler = newEventHandler()
+ thisObject.eventHandler = newEventHandler()
/* We name the event Handler to easy debugging. */
- thisObject.eventHandler.name = 'Storage-' + name
+ thisObject.eventHandler.name = 'Storage-' + name
- let datetime
- let timeFrame
+ let datetime
+ let timeFrame
- return thisObject
+ return thisObject
- function finalize () {
- try {
- for (let i = 0; i < thisObject.marketFiles.length; i++) {
- let marketFile = thisObject.marketFiles[i]
- marketFile.finalize()
- }
+ function finalize() {
+ try {
+ for (let i = 0; i < thisObject.marketFiles.length; i++) {
+ let marketFile = thisObject.marketFiles[i]
+ marketFile.finalize()
+ }
- thisObject.marketFiles = undefined
+ thisObject.marketFiles = undefined
- for (let i = 0; i < thisObject.dailyFiles.length; i++) {
- let dailyFile = thisObject.dailyFiles[i]
- dailyFile.finalize()
- }
+ for (let i = 0; i < thisObject.dailyFiles.length; i++) {
+ let dailyFile = thisObject.dailyFiles[i]
+ dailyFile.finalize()
+ }
- thisObject.dailyFiles = undefined
+ thisObject.dailyFiles = undefined
- for (let i = 0; i < thisObject.fileSequences.length; i++) {
- let fileSequence = thisObject.fileSequences[i]
- fileSequence.finalize()
- }
+ for (let i = 0; i < thisObject.fileSequences.length; i++) {
+ let fileSequence = thisObject.fileSequences[i]
+ fileSequence.finalize()
+ }
- thisObject.fileSequences = undefined
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) }
+ thisObject.fileSequences = undefined
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) }
+ }
}
- }
- function initialize (dataMine, bot, session, product, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, callBackFunction) {
- try {
- datetime = pDatetime
- timeFrame = pTimeFrame
+ function initialize(dataMine, bot, session, product, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, callBackFunction) {
+ try {
+ datetime = pDatetime
+ timeFrame = pTimeFrame
- let dataSetsToLoad = 0
- let dataSetsLoaded = 0
+ let dataSetsToLoad = 0
+ let dataSetsLoaded = 0
- for (let i = 0; i < product.datasets.length; i++) {
- let dataset = product.datasets[i]
+ for (let i = 0; i < product.datasets.length; i++) {
+ let dataset = product.datasets[i]
- switch (dataset.config.type) {
- case 'Market Files': {
- dataSetsToLoad++
+ switch (dataset.config.type) {
+ case 'Market Files': {
+ dataSetsToLoad++
- let marketFiles = newMarketFiles()
- marketFiles.initialize(dataMine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onMarketFileReady)
- thisObject.marketFiles.push(marketFiles)
- }
- break
+ let marketFiles = newMarketFiles()
+ marketFiles.initialize(dataMine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onMarketFileReady)
+ thisObject.marketFiles.push(marketFiles)
+ }
+ break
- case 'Daily Files': {
- dataSetsToLoad++
+ case 'Daily Files': {
+ dataSetsToLoad++
- let dailyFiles = newDailyFiles()
- dailyFiles.initialize(dataMine, bot, session, product, dataset, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, onDailyFileReady)
- thisObject.dailyFiles.push(dailyFiles)
- }
- break
+ let dailyFiles = newDailyFiles()
+ dailyFiles.initialize(dataMine, bot, session, product, dataset, exchange, market, pDatetime, pTimeFrame, host, port, eventsServerClient, onDailyFileReady)
+ thisObject.dailyFiles.push(dailyFiles)
+ }
+ break
- case 'Single File': {
- dataSetsToLoad++
+ case 'Single File': {
+ dataSetsToLoad++
- let singleFile = newSingleFile()
- singleFile.initialize(dataMine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onSingleFileReady)
- thisObject.singleFile.push(singleFile)
- }
- break
+ let singleFile = newSingleFile()
+ singleFile.initialize(dataMine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onSingleFileReady)
+ thisObject.singleFile.push(singleFile)
+ }
+ break
- case 'File Sequence': {
- dataSetsToLoad++
+ case 'File Sequence': {
+ dataSetsToLoad++
- let fileSequences = newFileSequence()
- fileSequences.initialize(dataMine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onFileSequenceReady)
- thisObject.fileSequences.push(fileSequences)
- }
- break
- default:
- if (ERROR_LOG === true) { logger.write('[WARN] initialize -> dataset with no type defined or type not supported -> dataset.config.type = ' + dataset.config.type) }
- }
-
- function onMarketFileReady (err, pCaller) {
- try {
- switch (err.result) {
- case GLOBAL.DEFAULT_OK_RESPONSE.result: {
- break
- }
- case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
- }
- let event = {
- totalValue: pCaller.getExpectedFiles(),
- currentValue: pCaller.getFilesLoaded(),
- filesNotLoaded: pCaller.getFilesNotLoaded()
- }
-
- thisObject.eventHandler.raiseEvent('Market File Loaded', event)
-
- if (event.filesNotLoaded === event.totalValue) {
- dataSetsToLoad--
- checkInitializeComplete()
- return
- }
-
- if (event.currentValue + event.filesNotLoaded === event.totalValue) {
- dataSetsLoaded++
- checkInitializeComplete()
- }
- } catch (err) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- }
- }
-
- function onDailyFileReady (err, pCaller) {
- try {
- switch (err.result) {
- case GLOBAL.DEFAULT_OK_RESPONSE.result: {
- break
- }
-
- case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
-
- case GLOBAL.CUSTOM_FAIL_RESPONSE.result: {
- if (err.message === 'Dataset Unavailable.') {
- dataSetsToLoad--
- checkInitializeComplete()
- return
- } else {
- callBackFunction(err)
- return
+ let fileSequences = newFileSequence()
+ fileSequences.initialize(dataMine, bot, session, product, dataset, exchange, market, host, port, eventsServerClient, onFileSequenceReady)
+ thisObject.fileSequences.push(fileSequences)
+ }
+ break
+ default:
+ if (ERROR_LOG === true) { logger.write('[WARN] initialize -> dataset with no type defined or type not supported -> dataset.config.type = ' + dataset.config.type) }
}
- }
- default: {
- callBackFunction(err)
- return
- }
- }
- let event = {
- totalValue: pCaller.getExpectedFiles(),
- currentValue: pCaller.getFilesLoaded()
- }
+ function onMarketFileReady(err, pCaller) {
+ try {
+ switch (err.result) {
+ case GLOBAL.DEFAULT_OK_RESPONSE.result: {
+ break
+ }
+ case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+ }
+ let event = {
+ totalValue: pCaller.getExpectedFiles(),
+ currentValue: pCaller.getFilesLoaded(),
+ filesNotLoaded: pCaller.getFilesNotLoaded()
+ }
- thisObject.eventHandler.raiseEvent('Daily File Loaded', event)
+ thisObject.eventHandler.raiseEvent('Market File Loaded', event)
- if (event.currentValue === event.totalValue) {
- dataSetsLoaded++
- checkInitializeComplete()
+ if (event.filesNotLoaded === event.totalValue) {
+ dataSetsToLoad--
+ checkInitializeComplete()
+ return
+ }
+
+ if (event.currentValue + event.filesNotLoaded === event.totalValue) {
+ dataSetsLoaded++
+ checkInitializeComplete()
+ }
+ } catch (err) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ }
+ }
+
+ function onDailyFileReady(err, pCaller) {
+ try {
+ switch (err.result) {
+ case GLOBAL.DEFAULT_OK_RESPONSE.result: {
+ break
+ }
+
+ case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+
+ case GLOBAL.CUSTOM_FAIL_RESPONSE.result: {
+ if (err.message === 'Dataset Unavailable.') {
+ dataSetsToLoad--
+ checkInitializeComplete()
+ return
+ } else {
+ callBackFunction(err)
+ return
+ }
+ }
+ default: {
+ callBackFunction(err)
+ return
+ }
+ }
+
+ let event = {
+ totalValue: pCaller.getExpectedFiles(),
+ currentValue: pCaller.getFilesLoaded()
+ }
+
+ thisObject.eventHandler.raiseEvent('Daily File Loaded', event)
+
+ if (event.currentValue === event.totalValue) {
+ dataSetsLoaded++
+ checkInitializeComplete()
+ }
+ } catch (err) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ }
+ }
+
+ function onSingleFileReady(err, pCaller) {
+ try {
+ switch (err.result) {
+ case GLOBAL.DEFAULT_OK_RESPONSE.result: {
+ break
+ }
+
+ case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+
+ case GLOBAL.CUSTOM_FAIL_RESPONSE.result: {
+ callBackFunction(err)
+ return
+ }
+
+ default: {
+ callBackFunction(err)
+ return
+ }
+ }
+ let event = {
+ totalValue: 1,
+ currentValue: 1
+ }
+ thisObject.eventHandler.raiseEvent('Single File Loaded', event)
+
+ if (event.currentValue === event.totalValue) {
+ dataSetsLoaded++
+ checkInitializeComplete()
+ }
+ } catch (err) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ }
+ }
+
+ function onFileSequenceReady(err, pCaller) {
+ try {
+ switch (err.result) {
+ case GLOBAL.DEFAULT_OK_RESPONSE.result: {
+ break
+ }
+ case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ return
+ }
+ case GLOBAL.CUSTOM_FAIL_RESPONSE.result: {
+ callBackFunction(err)
+ return
+ }
+ default: {
+ callBackFunction(err)
+ return
+ }
+ }
+ let event
+ if (pCaller !== undefined) {
+ event = {
+ totalValue: pCaller.getExpectedFiles(),
+ currentValue: pCaller.getFilesLoaded()
+ }
+ } else { // When there are no data the reference to the caller wont arrive here.
+ event = {
+ totalValue: 1,
+ currentValue: 1
+ }
+ }
+
+ thisObject.eventHandler.raiseEvent('File Sequence Loaded', event)
+
+ if (event.currentValue === event.totalValue) {
+ dataSetsLoaded++
+ checkInitializeComplete()
+ }
+ } catch (err) {
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ }
+ }
+
+ function checkInitializeComplete() {
+ try {
+ if (dataSetsLoaded === dataSetsToLoad) {
+ callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
+ }
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> checkInitializeComplete -> err = ' + err.stack) }
+ callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
+ }
+ }
}
- } catch (err) {
+ } catch (err) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- }
}
-
- function onSingleFileReady (err, pCaller) {
- try {
- switch (err.result) {
- case GLOBAL.DEFAULT_OK_RESPONSE.result: {
- break
- }
-
- case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
-
- case GLOBAL.CUSTOM_FAIL_RESPONSE.result: {
- callBackFunction(err)
- return
- }
-
- default: {
- callBackFunction(err)
- return
- }
- }
- let event = {
- totalValue: 1,
- currentValue: 1
- }
- thisObject.eventHandler.raiseEvent('Single File Loaded', event)
-
- if (event.currentValue === event.totalValue) {
- dataSetsLoaded++
- checkInitializeComplete()
- }
- } catch (err) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- }
- }
-
- function onFileSequenceReady (err, pCaller) {
- try {
- switch (err.result) {
- case GLOBAL.DEFAULT_OK_RESPONSE.result: {
- break
- }
- case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- return
- }
- case GLOBAL.CUSTOM_FAIL_RESPONSE.result: {
- callBackFunction(err)
- return
- }
- default: {
- callBackFunction(err)
- return
- }
- }
- let event
- if (pCaller !== undefined) {
- event = {
- totalValue: pCaller.getExpectedFiles(),
- currentValue: pCaller.getFilesLoaded()
- }
- } else { // When there are no data the reference to the caller wont arrive here.
- event = {
- totalValue: 1,
- currentValue: 1
- }
- }
-
- thisObject.eventHandler.raiseEvent('File Sequence Loaded', event)
-
- if (event.currentValue === event.totalValue) {
- dataSetsLoaded++
- checkInitializeComplete()
- }
- } catch (err) {
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- }
- }
-
- function checkInitializeComplete () {
- try {
- if (dataSetsLoaded === dataSetsToLoad) {
- callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> checkInitializeComplete -> err = ' + err.stack) }
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
- }
- }
- }
- } catch (err) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
- callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
}
- }
- function setDatetime (pDatetime) {
+ function setDatetime(pDatetime) {
/* If there is a change in the day, then we take some actions, otherwise, we dont. */
- let currentDate = Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS)
- let newDate = Math.trunc(pDatetime.valueOf() / ONE_DAY_IN_MILISECONDS)
+ let currentDate = Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS)
+ let newDate = Math.trunc(pDatetime.valueOf() / ONE_DAY_IN_MILISECONDS)
- datetime = new Date(pDatetime)
+ datetime = new Date(pDatetime)
- if (currentDate !== newDate) {
- if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
- for (let i = 0; i < thisObject.dailyFiles.length; i++) {
- thisObject.dailyFiles[i].setDatetime(pDatetime)
+ if (currentDate !== newDate) {
+ if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
+ for (let i = 0; i < thisObject.dailyFiles.length; i++) {
+ thisObject.dailyFiles[i].setDatetime(pDatetime)
+ }
+ }
}
- }
}
- }
- function setTimeFrame (pTimeFrame) {
+ function setTimeFrame(pTimeFrame) {
/* We are going to filter out the cases in which the timeFrame received is the same that the one we already know. */
- if (timeFrame !== pTimeFrame) {
- timeFrame = pTimeFrame
+ if (timeFrame !== pTimeFrame) {
+ timeFrame = pTimeFrame
- if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
- for (let i = 0; i < thisObject.dailyFiles.length; i++) {
- thisObject.dailyFiles[i].setTimeFrame(pTimeFrame, datetime)
+ if (timeFrame <= _1_HOUR_IN_MILISECONDS) {
+ for (let i = 0; i < thisObject.dailyFiles.length; i++) {
+ thisObject.dailyFiles[i].setTimeFrame(pTimeFrame, datetime)
+ }
+ }
}
- }
}
- }
}
diff --git a/CanvasApp/Scales/AutoScaleButton.js b/CanvasApp/Scales/AutoScaleButton.js
index 597f1c2b2..5e56c6984 100644
--- a/CanvasApp/Scales/AutoScaleButton.js
+++ b/CanvasApp/Scales/AutoScaleButton.js
@@ -1,206 +1,206 @@
-function newAutoScaleButton () {
- let thisObject = {
- container: undefined,
- fitFunction: undefined,
- parentContainer: undefined,
- autoMinScale: undefined,
- autoMaxScale: undefined,
- setStatus: setStatus,
- draw: draw,
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize,
- finalize: finalize
- }
+function newAutoScaleButton() {
+ let thisObject = {
+ container: undefined,
+ fitFunction: undefined,
+ parentContainer: undefined,
+ autoMinScale: undefined,
+ autoMaxScale: undefined,
+ setStatus: setStatus,
+ draw: draw,
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize,
+ finalize: finalize
+ }
- /* Cointainer stuff */
- thisObject.container = newContainer()
- thisObject.container.name = 'Auto Scale Button'
- thisObject.container.initialize()
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
- thisObject.container.frame.containerName = 'Auto Scale Button'
+ /* Cointainer stuff */
+ thisObject.container = newContainer()
+ thisObject.container.name = 'Auto Scale Button'
+ thisObject.container.initialize()
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+ thisObject.container.frame.containerName = 'Auto Scale Button'
- const ICON_SIZE = 36
- let onMouseWheelEventSubscriptionId
- let coordinateSystem
- let axis
- let currentStatus
- return thisObject
+ const ICON_SIZE = 36
+ let onMouseWheelEventSubscriptionId
+ let coordinateSystem
+ let axis
+ let currentStatus
+ return thisObject
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.parentContainer = undefined
- thisObject.panels = undefined
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.parentContainer = undefined
+ thisObject.panels = undefined
- coordinateSystem = undefined
- axis = undefined
- }
+ coordinateSystem = undefined
+ axis = undefined
+ }
- function initialize (pAxis, pCoordinateSystem) {
- axis = pAxis
- coordinateSystem = pCoordinateSystem
- thisObject.autoMinScale = coordinateSystem.autoMinYScale
- thisObject.autoMaxScale = coordinateSystem.autoMaxYScale
+ function initialize(pAxis, pCoordinateSystem) {
+ axis = pAxis
+ coordinateSystem = pCoordinateSystem
+ thisObject.autoMinScale = coordinateSystem.autoMinYScale
+ thisObject.autoMaxScale = coordinateSystem.autoMaxYScale
- switch (axis) {
- case 'X': {
- thisObject.container.frame.width = ICON_SIZE
- thisObject.container.frame.height = ICON_SIZE
+ switch (axis) {
+ case 'X': {
+ thisObject.container.frame.width = ICON_SIZE
+ thisObject.container.frame.height = ICON_SIZE
- let position = {
- x: thisObject.container.parentContainer.frame.width * 7 / 8,
- y: thisObject.container.parentContainer.frame.height / 2
+ let position = {
+ x: thisObject.container.parentContainer.frame.width * 7 / 8,
+ y: thisObject.container.parentContainer.frame.height / 2
+ }
+
+ thisObject.container.frame.position = position
+ break
+ }
+ case 'Y': {
+ thisObject.container.frame.width = ICON_SIZE
+ thisObject.container.frame.height = ICON_SIZE
+
+ let position = {
+ x: thisObject.container.parentContainer.frame.width * 7 / 8,
+ y: thisObject.container.parentContainer.frame.height / 2
+ }
+
+ thisObject.container.frame.position = position
+ break
+ }
}
-
- thisObject.container.frame.position = position
- break
- }
- case 'Y': {
- thisObject.container.frame.width = ICON_SIZE
- thisObject.container.frame.height = ICON_SIZE
-
- let position = {
- x: thisObject.container.parentContainer.frame.width * 7 / 8,
- y: thisObject.container.parentContainer.frame.height / 2
- }
-
- thisObject.container.frame.position = position
- break
- }
- }
- onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
- }
-
- function setStatus (autoMinScale, autoMaxScale) {
- thisObject.autoMinScale = autoMinScale
- thisObject.autoMaxScale = autoMaxScale
-
- if (thisObject.autoMinScale === false && thisObject.autoMaxScale === false) {
- currentStatus = 1
- }
- if (thisObject.autoMinScale === true && thisObject.autoMaxScale === false) {
- currentStatus = 2
- }
- if (thisObject.autoMinScale === false && thisObject.autoMaxScale === true) {
- currentStatus = 4
- }
- if (thisObject.autoMinScale === true && thisObject.autoMaxScale === true) {
- currentStatus = 6
- }
- }
- function onMouseWheel (event) {
- let factor
- let delta = event.wheelDelta
- if (delta < 0) {
- delta = -1
- } else {
- delta = 1
- }
- currentStatus = currentStatus + delta
- if (currentStatus === 7) { currentStatus = 1 }
- if (currentStatus === 0) { currentStatus = 6 }
-
- switch (currentStatus) {
- case 1: {
- thisObject.autoMinScale = false
- thisObject.autoMaxScale = false
- update()
- return
- }
- case 2: {
- thisObject.autoMinScale = true
- thisObject.autoMaxScale = false
- update()
- return
- }
- case 3: {
- thisObject.autoMinScale = false
- thisObject.autoMaxScale = false
- update()
- return
- }
- case 4: {
- thisObject.autoMinScale = false
- thisObject.autoMaxScale = true
- update()
- return
- }
- case 5: {
- thisObject.autoMinScale = false
- thisObject.autoMaxScale = false
- update()
- return
- }
- case 6: {
- thisObject.autoMinScale = true
- thisObject.autoMaxScale = true
- update()
- return
- }
+ onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
}
- function update () {
- switch (axis) {
- case 'X': {
- coordinateSystem.autoMinXScale = thisObject.autoMinScale
- coordinateSystem.autoMaxXScale = thisObject.autoMaxScale
- break
- }
- case 'Y': {
- coordinateSystem.autoMinYScale = thisObject.autoMinScale
- coordinateSystem.autoMaxYScale = thisObject.autoMaxScale
- break
- }
- }
+ function setStatus(autoMinScale, autoMaxScale) {
+ thisObject.autoMinScale = autoMinScale
+ thisObject.autoMaxScale = autoMaxScale
- coordinateSystem.recalculateScale()
- }
- }
-
- function getContainer (point, purpose) {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- }
- }
-
- function draw () {
- let icon
- switch (axis) {
- case 'X': {
if (thisObject.autoMinScale === false && thisObject.autoMaxScale === false) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-manual')
+ currentStatus = 1
}
if (thisObject.autoMinScale === true && thisObject.autoMaxScale === false) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-auto-min')
+ currentStatus = 2
}
if (thisObject.autoMinScale === false && thisObject.autoMaxScale === true) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-auto-max')
+ currentStatus = 4
}
if (thisObject.autoMinScale === true && thisObject.autoMaxScale === true) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-auto-min-max')
+ currentStatus = 6
+ }
+ }
+ function onMouseWheel(event) {
+ let factor
+ let delta = event.wheelDelta
+ if (delta < 0) {
+ delta = -1
+ } else {
+ delta = 1
+ }
+ currentStatus = currentStatus + delta
+ if (currentStatus === 7) { currentStatus = 1 }
+ if (currentStatus === 0) { currentStatus = 6 }
+
+ switch (currentStatus) {
+ case 1: {
+ thisObject.autoMinScale = false
+ thisObject.autoMaxScale = false
+ update()
+ return
+ }
+ case 2: {
+ thisObject.autoMinScale = true
+ thisObject.autoMaxScale = false
+ update()
+ return
+ }
+ case 3: {
+ thisObject.autoMinScale = false
+ thisObject.autoMaxScale = false
+ update()
+ return
+ }
+ case 4: {
+ thisObject.autoMinScale = false
+ thisObject.autoMaxScale = true
+ update()
+ return
+ }
+ case 5: {
+ thisObject.autoMinScale = false
+ thisObject.autoMaxScale = false
+ update()
+ return
+ }
+ case 6: {
+ thisObject.autoMinScale = true
+ thisObject.autoMaxScale = true
+ update()
+ return
+ }
+ }
+
+ function update() {
+ switch (axis) {
+ case 'X': {
+ coordinateSystem.autoMinXScale = thisObject.autoMinScale
+ coordinateSystem.autoMaxXScale = thisObject.autoMaxScale
+ break
+ }
+ case 'Y': {
+ coordinateSystem.autoMinYScale = thisObject.autoMinScale
+ coordinateSystem.autoMaxYScale = thisObject.autoMaxScale
+ break
+ }
+ }
+
+ coordinateSystem.recalculateScale()
+ }
+ }
+
+ function getContainer(point, purpose) {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ }
+ }
+
+ function draw() {
+ let icon
+ switch (axis) {
+ case 'X': {
+ if (thisObject.autoMinScale === false && thisObject.autoMaxScale === false) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-manual')
+ }
+ if (thisObject.autoMinScale === true && thisObject.autoMaxScale === false) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-auto-min')
+ }
+ if (thisObject.autoMinScale === false && thisObject.autoMaxScale === true) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-auto-max')
+ }
+ if (thisObject.autoMinScale === true && thisObject.autoMaxScale === true) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-time-scale-auto-min-max')
+ }
+ drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
+ break
+ }
+ case 'Y': {
+ if (thisObject.autoMinScale === false && thisObject.autoMaxScale === false) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-manual')
+ }
+ if (thisObject.autoMinScale === true && thisObject.autoMaxScale === false) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-auto-min')
+ }
+ if (thisObject.autoMinScale === false && thisObject.autoMaxScale === true) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-auto-max')
+ }
+ if (thisObject.autoMinScale === true && thisObject.autoMaxScale === true) {
+ icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-auto-min-max')
+ }
+ drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
+ break
+ }
}
- drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
- break
- }
- case 'Y': {
- if (thisObject.autoMinScale === false && thisObject.autoMaxScale === false) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-manual')
- }
- if (thisObject.autoMinScale === true && thisObject.autoMaxScale === false) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-auto-min')
- }
- if (thisObject.autoMinScale === false && thisObject.autoMaxScale === true) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-auto-max')
- }
- if (thisObject.autoMinScale === true && thisObject.autoMaxScale === true) {
- icon = canvas.designSpace.iconCollection.get('toggle-auto-scale-auto-min-max')
- }
- drawIcon(icon, 0, 0, 0, 0, ICON_SIZE, thisObject.container)
- break
- }
}
- }
}
diff --git a/CanvasApp/Scales/Commons.js b/CanvasApp/Scales/Commons.js
index 49dda6e71..13f926ca3 100644
--- a/CanvasApp/Scales/Commons.js
+++ b/CanvasApp/Scales/Commons.js
@@ -1,45 +1,45 @@
-function drawScaleDisplay (label1, label2, label3, xExtraOffSet1, xExtraOffSet2, xExtraOffSet3, icon1, icon2, container, backgroundColor) {
- const RED_LINE_HIGHT = 4
- const OPACITY = 1
+function drawScaleDisplay(label1, label2, label3, xExtraOffSet1, xExtraOffSet2, xExtraOffSet3, icon1, icon2, container, backgroundColor) {
+ const RED_LINE_HIGHT = 4
+ const OPACITY = 1
- let params = {
- cornerRadius: 5,
- lineWidth: 1,
- container: container,
- borderColor: UI_COLOR.RUSTED_RED,
- castShadow: false,
- backgroundColor: backgroundColor,
- opacity: OPACITY
- }
+ let params = {
+ cornerRadius: 5,
+ lineWidth: 1,
+ container: container,
+ borderColor: UI_COLOR.RUSTED_RED,
+ castShadow: false,
+ backgroundColor: backgroundColor,
+ opacity: OPACITY
+ }
- roundedCornersBackground(params)
+ roundedCornersBackground(params)
- /* Place the Text */
+ /* Place the Text */
- label1 = label1.substring(0, 18)
- label2 = label2.substring(0, 20)
- label3 = label3.substring(0, 20)
+ label1 = label1.substring(0, 18)
+ label2 = label2.substring(0, 20)
+ label3 = label3.substring(0, 20)
- drawLabel(label1, 1 / 2, 92 / 100, 0, 0, 9, container)
- drawLabel(label2, 1 / 2, 42 / 100, 0, 0, 17, container)
- drawLabel(label3, 1 / 2, 67 / 100, 0, 0, 9, container)
+ drawLabel(label1, 1 / 2, 92 / 100, 0, 0, 9, container)
+ drawLabel(label2, 1 / 2, 42 / 100, 0, 0, 17, container)
+ drawLabel(label3, 1 / 2, 67 / 100, 0, 0, 9, container)
- drawIcon(icon1, 1 / 8, 1 / 2, 0, 0, 28, container)
- drawIcon(icon2, 7 / 8, 1 / 2, 0, 0, 28, container)
+ drawIcon(icon1, 1 / 8, 1 / 2, 0, 0, 28, container)
+ drawIcon(icon2, 7 / 8, 1 / 2, 0, 0, 28, container)
}
-function drawScaleDisplayCover (container) {
- let params = {
- cornerRadius: 5,
- lineWidth: 1,
- container: container,
- borderColor: UI_COLOR.WHITE,
- castShadow: false,
- backgroundColor: UI_COLOR.WHITE,
- opacity: '0.25'
- }
+function drawScaleDisplayCover(container) {
+ let params = {
+ cornerRadius: 5,
+ lineWidth: 1,
+ container: container,
+ borderColor: UI_COLOR.WHITE,
+ castShadow: false,
+ backgroundColor: UI_COLOR.WHITE,
+ opacity: '0.25'
+ }
- roundedCornersBackground(params)
+ roundedCornersBackground(params)
}
diff --git a/CanvasApp/Scales/RateScale.js b/CanvasApp/Scales/RateScale.js
index 93ca0cf9d..216de1e8e 100644
--- a/CanvasApp/Scales/RateScale.js
+++ b/CanvasApp/Scales/RateScale.js
@@ -1,566 +1,566 @@
-function newRateScale () {
- const MODULE_NAME = 'Right Scale'
+function newRateScale() {
+ const MODULE_NAME = 'Right Scale'
- let thisObject = {
- container: undefined,
- rate: undefined,
- fitFunction: undefined,
- payload: undefined,
- minValue: undefined,
- maxValue: undefined,
- isVisible: true,
- layersOn: undefined,
- onUpstreamScaleChanged: onUpstreamScaleChanged,
- onMouseOverSomeTimeMachineContainer: onMouseOverSomeTimeMachineContainer,
- physics: physics,
- draw: draw,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
-
- thisObject.container.isDraggeable = false
- thisObject.container.isClickeable = false
- thisObject.container.isWheelable = true
- thisObject.container.detectMouseOver = true
-
- thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
- thisObject.container.frame.height = 40
-
- let draggeableContainer = newContainer()
- draggeableContainer.initialize(MODULE_NAME + ' Draggeable')
- draggeableContainer.isDraggeable = true
-
- let visible = true
- let isMouseOver
-
- let onMouseWheelEventSubscriptionId
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
- let onScaleChangedEventSubscriptionId
- let onDragStartedEventSubscriptionId
-
- let coordinateSystem
- let coordinateSystemWhenDragStarted
-
- let limitingContainer
- let rateCalculationsContainer
-
- mouseWhenDragStarted = {
- position: {
- x: 0,
- y: 0
- }
- }
-
- parentFrameWhenDragStarted = {
- position: {
- x: 0,
- y: 0
- },
- width: 0,
- height: 0
- }
-
- let scaleDisplayTimer = 0
- let autoScaleButton
-
- let wheelDeltaDirection
- let wheelDeltaCounter = 0
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- coordinateSystem.eventHandler.stopListening(onScaleChangedEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.payload = undefined
-
- if (coordinateSystemWhenDragStarted !== undefined) {
- coordinateSystemWhenDragStarted.finalize()
+ let thisObject = {
+ container: undefined,
+ rate: undefined,
+ fitFunction: undefined,
+ payload: undefined,
+ minValue: undefined,
+ maxValue: undefined,
+ isVisible: true,
+ layersOn: undefined,
+ onUpstreamScaleChanged: onUpstreamScaleChanged,
+ onMouseOverSomeTimeMachineContainer: onMouseOverSomeTimeMachineContainer,
+ physics: physics,
+ draw: draw,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- coordinateSystemWhenDragStarted = undefined
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
- coordinateSystem = undefined
- limitingContainer = undefined
- rateCalculationsContainer = undefined
+ thisObject.container.isDraggeable = false
+ thisObject.container.isClickeable = false
+ thisObject.container.isWheelable = true
+ thisObject.container.detectMouseOver = true
- mouseWhenDragStarted = undefined
- parentFrameWhenDragStarted = undefined
+ thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
+ thisObject.container.frame.height = 40
- autoScaleButton.finalize()
- autoScaleButton = undefined
- }
+ let draggeableContainer = newContainer()
+ draggeableContainer.initialize(MODULE_NAME + ' Draggeable')
+ draggeableContainer.isDraggeable = true
- function initialize (pCoordinateSystem, pLimitingContainer, pRateCalculationsContainer) {
- coordinateSystem = pCoordinateSystem
- limitingContainer = pLimitingContainer
- rateCalculationsContainer = pRateCalculationsContainer
+ let visible = true
+ let isMouseOver
- thisObject.minValue = coordinateSystem.min.y
- thisObject.maxValue = coordinateSystem.max.y
+ let onMouseWheelEventSubscriptionId
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
+ let onScaleChangedEventSubscriptionId
+ let onDragStartedEventSubscriptionId
- onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
- onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- onScaleChangedEventSubscriptionId = coordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
- onDragStartedEventSubscriptionId = draggeableContainer.eventHandler.listenToEvent('onDragStarted', onDragStarted)
+ let coordinateSystem
+ let coordinateSystemWhenDragStarted
- autoScaleButton = newAutoScaleButton()
- autoScaleButton.container.connectToParent(thisObject.container)
- autoScaleButton.initialize('Y', coordinateSystem)
+ let limitingContainer
+ let rateCalculationsContainer
- readObjectState()
- }
-
- function onMouseOverSomeTimeMachineContainer (event) {
- if (event.containerId === undefined) {
- /* This happens when the mouse over was not at the instance of a certain scale, but anywhere else. */
- visible = true
- } else {
- if (event.containerId === thisObject.container.id) {
- visible = true
- } else {
- visible = false
- turnOnCounter = 0
- }
- }
- }
-
- function onScaleChanged () {
- saveObjectState()
- }
-
- function onMouseOver (event) {
- isMouseOver = true
- event.containerId = thisObject.container.id
- thisObject.container.eventHandler.raiseEvent('onMouseOverScale', event)
- }
-
- function onMouseNotOver () {
- isMouseOver = false
- scaleDisplayTimer = 0
- }
-
- function onMouseWheel (event) {
- if (IS_MAC) {
- let sensitivity
- if (event.wheelDelta < 0) {
- if (event.shiftKey === true) {
- sensitivity = 20
- } else {
- sensitivity = 5
- }
- if (wheelDeltaDirection === -1) {
- wheelDeltaCounter++
- if (wheelDeltaCounter < sensitivity) {
- return
- } else {
- wheelDeltaCounter = 0
- }
- } else {
- wheelDeltaCounter = 0
- wheelDeltaDirection = -1
- return
- }
- } else {
- if (wheelDeltaDirection === 1) {
- wheelDeltaCounter++
- if (wheelDeltaCounter < sensitivity) {
- return
- } else {
- wheelDeltaCounter = 0
- }
- } else {
- wheelDeltaCounter = 0
- wheelDeltaDirection = 1
- return
- }
- }
- }
-
- if (event.shiftKey === true) {
- autoScaleButton.container.eventHandler.raiseEvent('onMouseWheel', event)
- return
- }
-
- let factor
- let morePower = 10
- if (event.buttons === 4) { morePower = 1 } // Mouse wheel pressed.
-
- let delta = event.wheelDelta
- if (delta < 0) {
- factor = -0.01 * morePower
- } else {
- factor = 0.01 * morePower
- }
-
- coordinateSystem.zoomY(factor, event, limitingContainer)
- scaleDisplayTimer = 100
- }
-
- function onDragStarted (event) {
mouseWhenDragStarted = {
- position: {
- x: event.x,
- y: event.y
- }
+ position: {
+ x: 0,
+ y: 0
+ }
}
parentFrameWhenDragStarted = {
- position: {
- x: limitingContainer.frame.position.x,
- y: limitingContainer.frame.position.y
- },
- width: limitingContainer.frame.width,
- height: limitingContainer.frame.height
+ position: {
+ x: 0,
+ y: 0
+ },
+ width: 0,
+ height: 0
}
- coordinateSystemWhenDragStarted = newCoordinateSystem()
+ let scaleDisplayTimer = 0
+ let autoScaleButton
- let minValue = {
- x: coordinateSystem.min.x,
- y: coordinateSystem.min.y
- }
+ let wheelDeltaDirection
+ let wheelDeltaCounter = 0
- let maxValue = {
- x: coordinateSystem.max.x,
- y: coordinateSystem.max.y
- }
+ return thisObject
- coordinateSystemWhenDragStarted.initialize(minValue, maxValue, coordinateSystem.maxWidth, coordinateSystem.maxHeight)
- }
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
+ coordinateSystem.eventHandler.stopListening(onScaleChangedEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
- function getContainer (point, purpose) {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- if (purpose === GET_CONTAINER_PURPOSE.DRAGGING) {
- return draggeableContainer
- }
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.payload = undefined
- return thisObject.container
- }
- }
-
- function saveObjectState () {
- try {
- let config = JSON.parse(thisObject.payload.node.config)
- config.minValue = coordinateSystem.min.y
- config.maxValue = coordinateSystem.max.y
- config.autoMinScale = coordinateSystem.autoMinYScale
- config.autoMaxScale = coordinateSystem.autoMaxYScale
- thisObject.payload.node.config = JSON.stringify(config, null, 4)
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
- }
-
- function readObjectState () {
- try {
- let config = JSON.parse(thisObject.payload.node.config)
-
- if (
- (isNaN(config.minValue) || config.minValue === null || config.minValue === undefined) ||
- (isNaN(config.maxValue) || config.maxValue === null || config.maxValue === undefined)
- ) {
- // not using this value
- } else {
- if (
- thisObject.minValue !== config.minValue ||
- thisObject.maxValue !== config.maxValue ||
- coordinateSystem.autoMinYScale !== config.autoMinScale ||
- coordinateSystem.autoMaxYScale !== config.autoMaxScale
- ) {
- thisObject.minValue = config.minValue
- thisObject.maxValue = config.maxValue
- coordinateSystem.min.y = thisObject.minValue
- coordinateSystem.max.y = thisObject.maxValue
-
- if (config.autoMinScale !== undefined && (config.autoMinScale === true || config.autoMinScale === false) && config.autoMaxScale !== undefined && (config.autoMaxScale === true || config.autoMaxScale === false)) {
- coordinateSystem.autoMinYScale = config.autoMinScale
- coordinateSystem.autoMaxYScale = config.autoMaxScale
- autoScaleButton.setStatus(config.autoMinScale, config.autoMaxScale)
- }
-
- coordinateSystem.recalculateScale()
+ if (coordinateSystemWhenDragStarted !== undefined) {
+ coordinateSystemWhenDragStarted.finalize()
}
- }
- saveObjectState() // this overrides any invalid value at the config.
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
- }
- function physics () {
- scaleDisplayTimer--
- readObjectState()
- positioningPhysics()
- draggingPhysics()
- }
+ coordinateSystemWhenDragStarted = undefined
- function draggingPhysics () {
- if (coordinateSystemWhenDragStarted === undefined) { return }
- if (draggeableContainer.frame.position.y === 0) { return }
+ coordinateSystem = undefined
+ limitingContainer = undefined
+ rateCalculationsContainer = undefined
- let mouseNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(canvas.mouse.position)
- let mouseWhenDragStartedNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mouseWhenDragStarted.position)
+ mouseWhenDragStarted = undefined
+ parentFrameWhenDragStarted = undefined
- let dragVectorWhenDragStarted = {
- x: 0,
- y: mouseNoZoom.y - mouseWhenDragStartedNoZoom.y
+ autoScaleButton.finalize()
+ autoScaleButton = undefined
}
- let dragVector = {
- x: 0,
- y: draggeableContainer.frame.position.y
+ function initialize(pCoordinateSystem, pLimitingContainer, pRateCalculationsContainer) {
+ coordinateSystem = pCoordinateSystem
+ limitingContainer = pLimitingContainer
+ rateCalculationsContainer = pRateCalculationsContainer
+
+ thisObject.minValue = coordinateSystem.min.y
+ thisObject.maxValue = coordinateSystem.max.y
+
+ onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
+ onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ onScaleChangedEventSubscriptionId = coordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
+ onDragStartedEventSubscriptionId = draggeableContainer.eventHandler.listenToEvent('onDragStarted', onDragStarted)
+
+ autoScaleButton = newAutoScaleButton()
+ autoScaleButton.container.connectToParent(thisObject.container)
+ autoScaleButton.initialize('Y', coordinateSystem)
+
+ readObjectState()
}
- draggeableContainer.frame.position.y = 0
-
- let point = {
- x: 0,
- y: (-dragVectorWhenDragStarted.y)
- }
-
- let newMaxRate = getRateFromPointAtContainer(point, limitingContainer, coordinateSystemWhenDragStarted)
- let yDifferenceMaxMin = coordinateSystemWhenDragStarted.max.y - coordinateSystemWhenDragStarted.min.y
-
- coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
- coordinateSystem.max.y = newMaxRate
- let event = {
- type: 'center dragged',
- dragVector: dragVector
- }
- coordinateSystem.recalculateScale()
- }
-
- function onUpstreamScaleChanged (event) {
- if (event === undefined) { return }
- if (event.dragVector.y === 0) { return }
- if (event.type === 'center dragged') {
- let point = {
- x: event.dragVector.x,
- y: -event.dragVector.y
- }
- let newMaxRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
- let yDifferenceMaxMin = coordinateSystem.max.y - coordinateSystem.min.y
- coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
- coordinateSystem.max.y = newMaxRate
-
- coordinateSystem.recalculateScale()
- }
- if (event.type === 'top dragged') {
- let point = {
- x: event.dragVector.x,
- y: event.dragVector.y
- }
- let newMaxRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
-
- coordinateSystem.max.y = newMaxRate
- coordinateSystem.maxHeight = rateCalculationsContainer.frame.height
- coordinateSystem.recalculateScale()
- }
- if (event.type === 'bottom dragged') {
- let point = {
- x: event.dragVector.x,
- y: event.dragVector.y + rateCalculationsContainer.frame.height
- }
- let newMinRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
-
- coordinateSystem.min.y = newMinRate
- coordinateSystem.maxHeight = rateCalculationsContainer.frame.height
- coordinateSystem.recalculateScale()
- }
- }
-
- function positioningPhysics () {
- /* Container Limits */
-
- let upCorner = {
- x: 0,
- y: 0
- }
-
- let bottonCorner = {
- x: limitingContainer.frame.width,
- y: limitingContainer.frame.height
- }
-
- upCorner = transformThisPoint(upCorner, limitingContainer)
- bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
-
- upCorner = limitingContainer.fitFunction(upCorner, true)
- bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
-
- /* We will check if we need to change the bottom because of being one of many scales of the same type */
- let displaceFactor = 0
- if (thisObject.payload.parentNode === undefined) { return } // This happens when in the process of deleting the scale, timeline chart or time machine.
- if (thisObject.payload.parentNode.type === 'Timeline Chart') {
- if (thisObject.payload.parentNode.payload.parentNode !== undefined) {
- if (thisObject.payload.parentNode.payload.parentNode.rateScale !== undefined) {
- if (thisObject.payload.parentNode.payload.parentNode.rateScale.payload.isVisible === true) {
- displaceFactor++
- }
- }
- for (let i = 0; i < thisObject.payload.parentNode.payload.parentNode.timelineCharts.length; i++) {
- let timelineChart = thisObject.payload.parentNode.payload.parentNode.timelineCharts[i]
- if (timelineChart.rateScale !== undefined) {
- if (thisObject.payload.node.id !== timelineChart.rateScale.id) {
- if (timelineChart.rateScale.payload.isVisible === true) {
- displaceFactor++
- }
+ function onMouseOverSomeTimeMachineContainer(event) {
+ if (event.containerId === undefined) {
+ /* This happens when the mouse over was not at the instance of a certain scale, but anywhere else. */
+ visible = true
+ } else {
+ if (event.containerId === thisObject.container.id) {
+ visible = true
} else {
- break
+ visible = false
+ turnOnCounter = 0
}
- }
}
- }
- }
- bottonCorner.x = bottonCorner.x - thisObject.container.frame.width * displaceFactor
-
- /* Mouse Position Rate Calculation */
- let ratePoint = {
- x: 0,
- y: canvas.mouse.position.y
}
- thisObject.rate = getRateFromPointAtBrowserCanvas(ratePoint, rateCalculationsContainer, coordinateSystem)
-
- /* rateScale Positioning */
- ratePoint = {
- x: limitingContainer.frame.width,
- y: 0
+ function onScaleChanged() {
+ saveObjectState()
}
- ratePoint = transformThisPoint(ratePoint, limitingContainer.frame.container)
- ratePoint.y = canvas.mouse.position.y - thisObject.container.frame.height / 2 + thisObject.container.frame.height
-
- /* Checking against the container limits. */
- if (ratePoint.x < upCorner.x) { ratePoint.x = upCorner.x }
- if (ratePoint.x + thisObject.container.frame.width > bottonCorner.x) { ratePoint.x = bottonCorner.x }
- if (ratePoint.y < upCorner.y + thisObject.container.frame.height) { ratePoint.y = upCorner.y + thisObject.container.frame.height }
- if (ratePoint.y > bottonCorner.y) { ratePoint.y = bottonCorner.y }
-
- thisObject.container.frame.position.y = ratePoint.y - thisObject.container.frame.height
- thisObject.container.frame.position.x = ratePoint.x - thisObject.container.frame.width
-
- thisObject.isVisible = true
- thisObject.payload.isVisible = true
- if (thisObject.container.frame.position.y + thisObject.container.frame.height * 2 > bottonCorner.y ||
- thisObject.container.frame.position.y - thisObject.container.frame.height * 1 < upCorner.y ||
- thisObject.container.frame.position.x < upCorner.x
- ) {
- thisObject.isVisible = false
- thisObject.payload.isVisible = false
- }
- if (thisObject.layersOn === 0) {
- thisObject.isVisible = false
- thisObject.payload.isVisible = false
+ function onMouseOver(event) {
+ isMouseOver = true
+ event.containerId = thisObject.container.id
+ thisObject.container.eventHandler.raiseEvent('onMouseOverScale', event)
}
- if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_SCALES) {
- thisObject.isVisible = false
- }
- }
-
- function draw () {
- drawScaleBox()
- autoScaleButton.draw()
- if (visible === false) {
- drawScaleDisplayCover(thisObject.container)
- }
- }
-
- function drawForeground () {
- if (isMouseOver === true) {
- drawScaleBox()
- autoScaleButton.draw()
- }
- }
-
- function drawBackground () {
- drawScale()
- }
-
- function drawScale () {
- const SEPARATION = 50
- const NUMBER_OF_LABELS = Math.trunc(canvas.chartingSpace.viewport.height / SEPARATION)
- const FONT_SIZE = 15
-
- for (let i = 0; i <= NUMBER_OF_LABELS; i++) {
- let ratePoint1 = {
- x: 0,
- y: TOP_SPACE_HEIGHT + SEPARATION * (i + 1)
- }
- let ratePoint2 = {
- x: 0,
- y: TOP_SPACE_HEIGHT + SEPARATION * (i + 0)
- }
-
- let rate = getRateFromPointAtBrowserCanvas(ratePoint1, rateCalculationsContainer, coordinateSystem)
- let labels = scaleLabels(rate)
- let decimalsDisplace = labels[1].length * FONT_SIZE * FONT_ASPECT_RATIO
-
- let fitPoint1 = thisObject.fitFunction(ratePoint1)
- let fitPoint2 = thisObject.fitFunction(ratePoint2)
-
- if (fitPoint1.y === ratePoint1.y && fitPoint2.y === ratePoint2.y) {
- drawLabel(labels[1], 1 / 2, 0, 0, 0, FONT_SIZE, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
- drawLabel(labels[2], 1 / 2, 0, decimalsDisplace, -5, 9, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
- }
- }
- }
-
- function drawScaleBox () {
- if (thisObject.rate === undefined) { return }
- if (thisObject.payload === undefined) { return }
- if (thisObject.payload.node === undefined) { return }
-
- let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
- let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
-
- let backgroundColor = UI_COLOR.BLACK
- let labels = scaleLabels(thisObject.rate)
-
- drawScaleDisplay(labels[0], labels[1], labels[2], 0, 0, 0, icon1, icon2, thisObject.container, backgroundColor)
- }
-
- function scaleLabels (rate) {
- if (rate < coordinateSystem.min.y) {
- rate = coordinateSystem.min.y
- }
- if (rate > coordinateSystem.max.y) {
- rate = coordinateSystem.max.y
+ function onMouseNotOver() {
+ isMouseOver = false
+ scaleDisplayTimer = 0
}
- let label = dynamicDecimals(rate)
- let labelArray = label.split('.')
- let label1 = thisObject.payload.node.payload.parentNode.name
- let label2 = (Math.trunc(rate)).toLocaleString()
- let label3 = labelArray[1]
- if (label3 === undefined) { label3 = '00' }
+ function onMouseWheel(event) {
+ if (IS_MAC) {
+ let sensitivity
+ if (event.wheelDelta < 0) {
+ if (event.shiftKey === true) {
+ sensitivity = 20
+ } else {
+ sensitivity = 5
+ }
+ if (wheelDeltaDirection === -1) {
+ wheelDeltaCounter++
+ if (wheelDeltaCounter < sensitivity) {
+ return
+ } else {
+ wheelDeltaCounter = 0
+ }
+ } else {
+ wheelDeltaCounter = 0
+ wheelDeltaDirection = -1
+ return
+ }
+ } else {
+ if (wheelDeltaDirection === 1) {
+ wheelDeltaCounter++
+ if (wheelDeltaCounter < sensitivity) {
+ return
+ } else {
+ wheelDeltaCounter = 0
+ }
+ } else {
+ wheelDeltaCounter = 0
+ wheelDeltaDirection = 1
+ return
+ }
+ }
+ }
- if (rate < 1) {
- label2 = label
- label3 = ''
+ if (event.shiftKey === true) {
+ autoScaleButton.container.eventHandler.raiseEvent('onMouseWheel', event)
+ return
+ }
+
+ let factor
+ let morePower = 10
+ if (event.buttons === 4) { morePower = 1 } // Mouse wheel pressed.
+
+ let delta = event.wheelDelta
+ if (delta < 0) {
+ factor = -0.01 * morePower
+ } else {
+ factor = 0.01 * morePower
+ }
+
+ coordinateSystem.zoomY(factor, event, limitingContainer)
+ scaleDisplayTimer = 100
}
- if (scaleDisplayTimer > 0) {
- label2 = (coordinateSystem.scale.y * 10000).toFixed(2)
- label3 = 'SCALE'
+ function onDragStarted(event) {
+ mouseWhenDragStarted = {
+ position: {
+ x: event.x,
+ y: event.y
+ }
+ }
+
+ parentFrameWhenDragStarted = {
+ position: {
+ x: limitingContainer.frame.position.x,
+ y: limitingContainer.frame.position.y
+ },
+ width: limitingContainer.frame.width,
+ height: limitingContainer.frame.height
+ }
+
+ coordinateSystemWhenDragStarted = newCoordinateSystem()
+
+ let minValue = {
+ x: coordinateSystem.min.x,
+ y: coordinateSystem.min.y
+ }
+
+ let maxValue = {
+ x: coordinateSystem.max.x,
+ y: coordinateSystem.max.y
+ }
+
+ coordinateSystemWhenDragStarted.initialize(minValue, maxValue, coordinateSystem.maxWidth, coordinateSystem.maxHeight)
}
- return [label1, label2, label3]
- }
+ function getContainer(point, purpose) {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ if (purpose === GET_CONTAINER_PURPOSE.DRAGGING) {
+ return draggeableContainer
+ }
+
+ return thisObject.container
+ }
+ }
+
+ function saveObjectState() {
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+ config.minValue = coordinateSystem.min.y
+ config.maxValue = coordinateSystem.max.y
+ config.autoMinScale = coordinateSystem.autoMinYScale
+ config.autoMaxScale = coordinateSystem.autoMaxYScale
+ thisObject.payload.node.config = JSON.stringify(config, null, 4)
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
+ }
+
+ function readObjectState() {
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+
+ if (
+ (isNaN(config.minValue) || config.minValue === null || config.minValue === undefined) ||
+ (isNaN(config.maxValue) || config.maxValue === null || config.maxValue === undefined)
+ ) {
+ // not using this value
+ } else {
+ if (
+ thisObject.minValue !== config.minValue ||
+ thisObject.maxValue !== config.maxValue ||
+ coordinateSystem.autoMinYScale !== config.autoMinScale ||
+ coordinateSystem.autoMaxYScale !== config.autoMaxScale
+ ) {
+ thisObject.minValue = config.minValue
+ thisObject.maxValue = config.maxValue
+ coordinateSystem.min.y = thisObject.minValue
+ coordinateSystem.max.y = thisObject.maxValue
+
+ if (config.autoMinScale !== undefined && (config.autoMinScale === true || config.autoMinScale === false) && config.autoMaxScale !== undefined && (config.autoMaxScale === true || config.autoMaxScale === false)) {
+ coordinateSystem.autoMinYScale = config.autoMinScale
+ coordinateSystem.autoMaxYScale = config.autoMaxScale
+ autoScaleButton.setStatus(config.autoMinScale, config.autoMaxScale)
+ }
+
+ coordinateSystem.recalculateScale()
+ }
+ }
+ saveObjectState() // this overrides any invalid value at the config.
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
+ }
+
+ function physics() {
+ scaleDisplayTimer--
+ readObjectState()
+ positioningPhysics()
+ draggingPhysics()
+ }
+
+ function draggingPhysics() {
+ if (coordinateSystemWhenDragStarted === undefined) { return }
+ if (draggeableContainer.frame.position.y === 0) { return }
+
+ let mouseNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(canvas.mouse.position)
+ let mouseWhenDragStartedNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mouseWhenDragStarted.position)
+
+ let dragVectorWhenDragStarted = {
+ x: 0,
+ y: mouseNoZoom.y - mouseWhenDragStartedNoZoom.y
+ }
+
+ let dragVector = {
+ x: 0,
+ y: draggeableContainer.frame.position.y
+ }
+
+ draggeableContainer.frame.position.y = 0
+
+ let point = {
+ x: 0,
+ y: (-dragVectorWhenDragStarted.y)
+ }
+
+ let newMaxRate = getRateFromPointAtContainer(point, limitingContainer, coordinateSystemWhenDragStarted)
+ let yDifferenceMaxMin = coordinateSystemWhenDragStarted.max.y - coordinateSystemWhenDragStarted.min.y
+
+ coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
+ coordinateSystem.max.y = newMaxRate
+ let event = {
+ type: 'center dragged',
+ dragVector: dragVector
+ }
+ coordinateSystem.recalculateScale()
+ }
+
+ function onUpstreamScaleChanged(event) {
+ if (event === undefined) { return }
+ if (event.dragVector.y === 0) { return }
+ if (event.type === 'center dragged') {
+ let point = {
+ x: event.dragVector.x,
+ y: -event.dragVector.y
+ }
+ let newMaxRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
+ let yDifferenceMaxMin = coordinateSystem.max.y - coordinateSystem.min.y
+ coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
+ coordinateSystem.max.y = newMaxRate
+
+ coordinateSystem.recalculateScale()
+ }
+ if (event.type === 'top dragged') {
+ let point = {
+ x: event.dragVector.x,
+ y: event.dragVector.y
+ }
+ let newMaxRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
+
+ coordinateSystem.max.y = newMaxRate
+ coordinateSystem.maxHeight = rateCalculationsContainer.frame.height
+ coordinateSystem.recalculateScale()
+ }
+ if (event.type === 'bottom dragged') {
+ let point = {
+ x: event.dragVector.x,
+ y: event.dragVector.y + rateCalculationsContainer.frame.height
+ }
+ let newMinRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
+
+ coordinateSystem.min.y = newMinRate
+ coordinateSystem.maxHeight = rateCalculationsContainer.frame.height
+ coordinateSystem.recalculateScale()
+ }
+ }
+
+ function positioningPhysics() {
+ /* Container Limits */
+
+ let upCorner = {
+ x: 0,
+ y: 0
+ }
+
+ let bottonCorner = {
+ x: limitingContainer.frame.width,
+ y: limitingContainer.frame.height
+ }
+
+ upCorner = transformThisPoint(upCorner, limitingContainer)
+ bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
+
+ upCorner = limitingContainer.fitFunction(upCorner, true)
+ bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
+
+ /* We will check if we need to change the bottom because of being one of many scales of the same type */
+ let displaceFactor = 0
+ if (thisObject.payload.parentNode === undefined) { return } // This happens when in the process of deleting the scale, timeline chart or time machine.
+ if (thisObject.payload.parentNode.type === 'Timeline Chart') {
+ if (thisObject.payload.parentNode.payload.parentNode !== undefined) {
+ if (thisObject.payload.parentNode.payload.parentNode.rateScale !== undefined) {
+ if (thisObject.payload.parentNode.payload.parentNode.rateScale.payload.isVisible === true) {
+ displaceFactor++
+ }
+ }
+ for (let i = 0; i < thisObject.payload.parentNode.payload.parentNode.timelineCharts.length; i++) {
+ let timelineChart = thisObject.payload.parentNode.payload.parentNode.timelineCharts[i]
+ if (timelineChart.rateScale !== undefined) {
+ if (thisObject.payload.node.id !== timelineChart.rateScale.id) {
+ if (timelineChart.rateScale.payload.isVisible === true) {
+ displaceFactor++
+ }
+ } else {
+ break
+ }
+ }
+ }
+ }
+ }
+ bottonCorner.x = bottonCorner.x - thisObject.container.frame.width * displaceFactor
+
+ /* Mouse Position Rate Calculation */
+ let ratePoint = {
+ x: 0,
+ y: canvas.mouse.position.y
+ }
+
+ thisObject.rate = getRateFromPointAtBrowserCanvas(ratePoint, rateCalculationsContainer, coordinateSystem)
+
+ /* rateScale Positioning */
+ ratePoint = {
+ x: limitingContainer.frame.width,
+ y: 0
+ }
+
+ ratePoint = transformThisPoint(ratePoint, limitingContainer.frame.container)
+ ratePoint.y = canvas.mouse.position.y - thisObject.container.frame.height / 2 + thisObject.container.frame.height
+
+ /* Checking against the container limits. */
+ if (ratePoint.x < upCorner.x) { ratePoint.x = upCorner.x }
+ if (ratePoint.x + thisObject.container.frame.width > bottonCorner.x) { ratePoint.x = bottonCorner.x }
+ if (ratePoint.y < upCorner.y + thisObject.container.frame.height) { ratePoint.y = upCorner.y + thisObject.container.frame.height }
+ if (ratePoint.y > bottonCorner.y) { ratePoint.y = bottonCorner.y }
+
+ thisObject.container.frame.position.y = ratePoint.y - thisObject.container.frame.height
+ thisObject.container.frame.position.x = ratePoint.x - thisObject.container.frame.width
+
+ thisObject.isVisible = true
+ thisObject.payload.isVisible = true
+ if (thisObject.container.frame.position.y + thisObject.container.frame.height * 2 > bottonCorner.y ||
+ thisObject.container.frame.position.y - thisObject.container.frame.height * 1 < upCorner.y ||
+ thisObject.container.frame.position.x < upCorner.x
+ ) {
+ thisObject.isVisible = false
+ thisObject.payload.isVisible = false
+ }
+ if (thisObject.layersOn === 0) {
+ thisObject.isVisible = false
+ thisObject.payload.isVisible = false
+ }
+
+ if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_SCALES) {
+ thisObject.isVisible = false
+ }
+ }
+
+ function draw() {
+ drawScaleBox()
+ autoScaleButton.draw()
+ if (visible === false) {
+ drawScaleDisplayCover(thisObject.container)
+ }
+ }
+
+ function drawForeground() {
+ if (isMouseOver === true) {
+ drawScaleBox()
+ autoScaleButton.draw()
+ }
+ }
+
+ function drawBackground() {
+ drawScale()
+ }
+
+ function drawScale() {
+ const SEPARATION = 50
+ const NUMBER_OF_LABELS = Math.trunc(canvas.chartingSpace.viewport.height / SEPARATION)
+ const FONT_SIZE = 15
+
+ for (let i = 0; i <= NUMBER_OF_LABELS; i++) {
+ let ratePoint1 = {
+ x: 0,
+ y: TOP_SPACE_HEIGHT + SEPARATION * (i + 1)
+ }
+ let ratePoint2 = {
+ x: 0,
+ y: TOP_SPACE_HEIGHT + SEPARATION * (i + 0)
+ }
+
+ let rate = getRateFromPointAtBrowserCanvas(ratePoint1, rateCalculationsContainer, coordinateSystem)
+ let labels = scaleLabels(rate)
+ let decimalsDisplace = labels[1].length * FONT_SIZE * FONT_ASPECT_RATIO
+
+ let fitPoint1 = thisObject.fitFunction(ratePoint1)
+ let fitPoint2 = thisObject.fitFunction(ratePoint2)
+
+ if (fitPoint1.y === ratePoint1.y && fitPoint2.y === ratePoint2.y) {
+ drawLabel(labels[1], 1 / 2, 0, 0, 0, FONT_SIZE, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
+ drawLabel(labels[2], 1 / 2, 0, decimalsDisplace, -5, 9, thisObject.container, UI_COLOR.GREY, undefined, ratePoint1.y)
+ }
+ }
+ }
+
+ function drawScaleBox() {
+ if (thisObject.rate === undefined) { return }
+ if (thisObject.payload === undefined) { return }
+ if (thisObject.payload.node === undefined) { return }
+
+ let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
+ let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
+
+ let backgroundColor = UI_COLOR.BLACK
+ let labels = scaleLabels(thisObject.rate)
+
+ drawScaleDisplay(labels[0], labels[1], labels[2], 0, 0, 0, icon1, icon2, thisObject.container, backgroundColor)
+ }
+
+ function scaleLabels(rate) {
+ if (rate < coordinateSystem.min.y) {
+ rate = coordinateSystem.min.y
+ }
+ if (rate > coordinateSystem.max.y) {
+ rate = coordinateSystem.max.y
+ }
+
+ let label = dynamicDecimals(rate)
+ let labelArray = label.split('.')
+ let label1 = thisObject.payload.node.payload.parentNode.name
+ let label2 = (Math.trunc(rate)).toLocaleString()
+ let label3 = labelArray[1]
+ if (label3 === undefined) { label3 = '00' }
+
+ if (rate < 1) {
+ label2 = label
+ label3 = ''
+ }
+
+ if (scaleDisplayTimer > 0) {
+ label2 = (coordinateSystem.scale.y * 10000).toFixed(2)
+ label3 = 'SCALE'
+ }
+
+ return [label1, label2, label3]
+ }
}
diff --git a/CanvasApp/Scales/TimeFrameScale.js b/CanvasApp/Scales/TimeFrameScale.js
index 3d0d41cd0..26442ef5d 100644
--- a/CanvasApp/Scales/TimeFrameScale.js
+++ b/CanvasApp/Scales/TimeFrameScale.js
@@ -1,389 +1,389 @@
-function newTimeFrameScale () {
- const MODULE_NAME = 'Time Frame Scale'
+function newTimeFrameScale() {
+ const MODULE_NAME = 'Time Frame Scale'
- let thisObject = {
- timeFrame: undefined,
- container: undefined,
- fitFunction: undefined,
- payload: undefined,
- isVisible: true,
- layersOn: undefined,
- adjustTimeFrame: adjustTimeFrame,
- onMouseOverSomeTimeMachineContainer: onMouseOverSomeTimeMachineContainer,
- draw: draw,
- drawForeground: drawForeground,
- physics: physics,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- const FILES_PERIOD_DEFAULT_VALUE = 0
- const TIME_PERIOD_DEFAULT_VALUE = 0
- const MIN_HEIGHT = 50
-
- let displayingRealTimeFrame = true
- let greyOutCoverLayer = false
- let isMouseOver
-
- let filePeriodIndex = FILES_PERIOD_DEFAULT_VALUE
- let timeFrameIndex = TIME_PERIOD_DEFAULT_VALUE
- let timeFramesMasterArray = [marketFilesPeriods, dailyFilePeriods]
- let timeFrameLabel = '24-hs'
-
- let onMouseWheelEventSubscriptionId
- let onViewportZoomChangedEventSubscriptionId
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
-
- let limitingContainer
-
- setupContainer()
-
- let wheelDeltaDirection
- let wheelDeltaCounter = 0
-
- return thisObject
-
- function setupContainer () {
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
-
- thisObject.container.isDraggeable = false
- thisObject.container.isClickeable = false
- thisObject.container.isWheelable = true
- thisObject.container.detectMouseOver = true
-
- thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
- thisObject.container.frame.height = 40
- }
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
- canvas.chartingSpace.viewport.eventHandler.stopListening(onViewportZoomChangedEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.payload = undefined
-
- limitingContainer = undefined
- }
-
- function initialize (pLimitingContainer) {
- limitingContainer = pLimitingContainer
-
- readObjectState()
- newTimeFrame()
-
- onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
- onViewportZoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent('Zoom Changed', onViewportZoomChanged)
- onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- }
-
- function onMouseOverSomeTimeMachineContainer (event) {
- if (event.containerId === undefined) {
- /* This happens when the mouse over was not at the instance of a certain scale, but anywhere else. */
- greyOutCoverLayer = false
- } else {
- if (event.containerId === thisObject.container.id) {
- greyOutCoverLayer = false
- } else {
- greyOutCoverLayer = true
- turnOnCounter = 0
- }
- }
- }
-
- function onMouseOver (event) {
- isMouseOver = true
- event.containerId = thisObject.container.id
- thisObject.container.eventHandler.raiseEvent('onMouseOverScale', event)
- }
-
- function onMouseNotOver () {
- isMouseOver = false
- }
-
- function physics () {
- readObjectState()
- positioningPhysics()
- }
-
- function adjustTimeFrame (elementsPlotted) {
- const ELEMENTS_PLOTTED_THREASHOLD = 500
- if (
- canvas.chartingSpace.viewport.zoomTargetLevel >= ZOOM_OUT_THRESHOLD_FOR_CHANGING_TIME_FRAME &&
- displayingRealTimeFrame === false
- ) {
- let event = {}
- event.timeFrame = thisObject.timeFrame
- thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)
- displayingRealTimeFrame = true
- }
- if (
- elementsPlotted > ELEMENTS_PLOTTED_THREASHOLD &&
- canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_CHANGING_TIME_FRAME &&
- displayingRealTimeFrame === true
- ) {
- let event = {}
- event.timeFrame = ONE_DAY_IN_MILISECONDS
- thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)
- displayingRealTimeFrame = false
- }
- }
-
- function positioningPhysics () {
- /* Container Limits */
-
- let upCorner = {
- x: 0,
- y: 0
+ let thisObject = {
+ timeFrame: undefined,
+ container: undefined,
+ fitFunction: undefined,
+ payload: undefined,
+ isVisible: true,
+ layersOn: undefined,
+ adjustTimeFrame: adjustTimeFrame,
+ onMouseOverSomeTimeMachineContainer: onMouseOverSomeTimeMachineContainer,
+ draw: draw,
+ drawForeground: drawForeground,
+ physics: physics,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- let bottonCorner = {
- x: limitingContainer.frame.width,
- y: limitingContainer.frame.height
+ const FILES_PERIOD_DEFAULT_VALUE = 0
+ const TIME_PERIOD_DEFAULT_VALUE = 0
+ const MIN_HEIGHT = 50
+
+ let displayingRealTimeFrame = true
+ let greyOutCoverLayer = false
+ let isMouseOver
+
+ let filePeriodIndex = FILES_PERIOD_DEFAULT_VALUE
+ let timeFrameIndex = TIME_PERIOD_DEFAULT_VALUE
+ let timeFramesMasterArray = [marketFilesPeriods, dailyFilePeriods]
+ let timeFrameLabel = '24-hs'
+
+ let onMouseWheelEventSubscriptionId
+ let onViewportZoomChangedEventSubscriptionId
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
+
+ let limitingContainer
+
+ setupContainer()
+
+ let wheelDeltaDirection
+ let wheelDeltaCounter = 0
+
+ return thisObject
+
+ function setupContainer() {
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+
+ thisObject.container.isDraggeable = false
+ thisObject.container.isClickeable = false
+ thisObject.container.isWheelable = true
+ thisObject.container.detectMouseOver = true
+
+ thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
+ thisObject.container.frame.height = 40
}
- upCorner = transformThisPoint(upCorner, limitingContainer)
- bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
+ canvas.chartingSpace.viewport.eventHandler.stopListening(onViewportZoomChangedEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- upCorner = limitingContainer.fitFunction(upCorner, true)
- bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.payload = undefined
- /* We will check if we need to change the bottom because of being one of many scales of the same type */
- let displaceFactor = 0
- if (thisObject.payload.parentNode === undefined) { return } // This happens when in the process of deleting the scale, timeline chart or time machine.
- if (thisObject.payload.parentNode.type === 'Timeline Chart') {
- if (thisObject.payload.parentNode.payload.parentNode !== undefined) {
- if (thisObject.payload.parentNode.payload.parentNode.timeFrameScale !== undefined) {
- if (thisObject.payload.parentNode.payload.parentNode.timeFrameScale.payload.isVisible === true) {
- displaceFactor++
- }
- }
- for (let i = 0; i < thisObject.payload.parentNode.payload.parentNode.timelineCharts.length; i++) {
- let timelineChart = thisObject.payload.parentNode.payload.parentNode.timelineCharts[i]
- if (timelineChart.timeFrameScale !== undefined) {
- if (thisObject.payload.node.id !== timelineChart.timeFrameScale.id) {
- if (timelineChart.timeFrameScale.payload.isVisible === true) {
- displaceFactor++
- }
+ limitingContainer = undefined
+ }
+
+ function initialize(pLimitingContainer) {
+ limitingContainer = pLimitingContainer
+
+ readObjectState()
+ newTimeFrame()
+
+ onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
+ onViewportZoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent('Zoom Changed', onViewportZoomChanged)
+ onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ }
+
+ function onMouseOverSomeTimeMachineContainer(event) {
+ if (event.containerId === undefined) {
+ /* This happens when the mouse over was not at the instance of a certain scale, but anywhere else. */
+ greyOutCoverLayer = false
+ } else {
+ if (event.containerId === thisObject.container.id) {
+ greyOutCoverLayer = false
} else {
- break
+ greyOutCoverLayer = true
+ turnOnCounter = 0
}
- }
}
- }
- }
- bottonCorner.y = bottonCorner.y - thisObject.container.frame.height * displaceFactor
-
- /* Positioning */
- timePoint = {
- x: 0,
- y: limitingContainer.frame.height
}
- timePoint = transformThisPoint(timePoint, limitingContainer.frame.container)
- timePoint.x = canvas.mouse.position.x - thisObject.container.frame.width / 2
-
- /* Checking against the container limits. */
- if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x }
- if (timePoint.x + thisObject.container.frame.width > bottonCorner.x) { timePoint.x = bottonCorner.x - thisObject.container.frame.width }
- if (timePoint.y < upCorner.y + thisObject.container.frame.height) { timePoint.y = upCorner.y + thisObject.container.frame.height }
- if (timePoint.y > bottonCorner.y) { timePoint.y = bottonCorner.y }
-
- thisObject.container.frame.position.x = timePoint.x
- thisObject.container.frame.position.y = timePoint.y - thisObject.container.frame.height
-
- thisObject.isVisible = true
- thisObject.payload.isVisible = true
- if (thisObject.container.frame.position.y + thisObject.container.frame.height > bottonCorner.y ||
- thisObject.container.frame.position.y - thisObject.container.frame.height * 3 < upCorner.y ||
- thisObject.container.frame.position.x < upCorner.x) {
- thisObject.isVisible = false
- thisObject.payload.isVisible = false
- }
- if (thisObject.layersOn === 0) {
- thisObject.isVisible = false
- thisObject.payload.isVisible = false
+ function onMouseOver(event) {
+ isMouseOver = true
+ event.containerId = thisObject.container.id
+ thisObject.container.eventHandler.raiseEvent('onMouseOverScale', event)
}
- if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_SCALES) {
- thisObject.isVisible = false
+ function onMouseNotOver() {
+ isMouseOver = false
}
- }
- function onViewportZoomChanged (event) {
- if (event !== undefined) { // it is undefined when the level is just being animated.
- if (event.shiftKey === false) { return } // with no shft key pressed, no automatic change in scale
- let currentTimeFrame = thisObject.timeFrame
- let timeFrame = recalculatePeriod(event.newLevel)
- if (timeFrame !== currentTimeFrame) {
- for (let i = 0; i < timeFramesMasterArray.length; i++) {
- let timeFrameArray = timeFramesMasterArray[i]
- for (let j = 0; j < timeFrameArray.length; j++) {
- let record = timeFrameArray[j]
- if (timeFrame === record[0]) {
- filePeriodIndex = i
- timeFrameIndex = j
+ function physics() {
+ readObjectState()
+ positioningPhysics()
+ }
+
+ function adjustTimeFrame(elementsPlotted) {
+ const ELEMENTS_PLOTTED_THREASHOLD = 500
+ if (
+ canvas.chartingSpace.viewport.zoomTargetLevel >= ZOOM_OUT_THRESHOLD_FOR_CHANGING_TIME_FRAME &&
+ displayingRealTimeFrame === false
+ ) {
+ let event = {}
+ event.timeFrame = thisObject.timeFrame
+ thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)
+ displayingRealTimeFrame = true
+ }
+ if (
+ elementsPlotted > ELEMENTS_PLOTTED_THREASHOLD &&
+ canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_CHANGING_TIME_FRAME &&
+ displayingRealTimeFrame === true
+ ) {
+ let event = {}
+ event.timeFrame = ONE_DAY_IN_MILISECONDS
+ thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)
+ displayingRealTimeFrame = false
+ }
+ }
+
+ function positioningPhysics() {
+ /* Container Limits */
+
+ let upCorner = {
+ x: 0,
+ y: 0
+ }
+
+ let bottonCorner = {
+ x: limitingContainer.frame.width,
+ y: limitingContainer.frame.height
+ }
+
+ upCorner = transformThisPoint(upCorner, limitingContainer)
+ bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
+
+ upCorner = limitingContainer.fitFunction(upCorner, true)
+ bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
+
+ /* We will check if we need to change the bottom because of being one of many scales of the same type */
+ let displaceFactor = 0
+ if (thisObject.payload.parentNode === undefined) { return } // This happens when in the process of deleting the scale, timeline chart or time machine.
+ if (thisObject.payload.parentNode.type === 'Timeline Chart') {
+ if (thisObject.payload.parentNode.payload.parentNode !== undefined) {
+ if (thisObject.payload.parentNode.payload.parentNode.timeFrameScale !== undefined) {
+ if (thisObject.payload.parentNode.payload.parentNode.timeFrameScale.payload.isVisible === true) {
+ displaceFactor++
+ }
+ }
+ for (let i = 0; i < thisObject.payload.parentNode.payload.parentNode.timelineCharts.length; i++) {
+ let timelineChart = thisObject.payload.parentNode.payload.parentNode.timelineCharts[i]
+ if (timelineChart.timeFrameScale !== undefined) {
+ if (thisObject.payload.node.id !== timelineChart.timeFrameScale.id) {
+ if (timelineChart.timeFrameScale.payload.isVisible === true) {
+ displaceFactor++
+ }
+ } else {
+ break
+ }
+ }
+ }
}
- }
}
+ bottonCorner.y = bottonCorner.y - thisObject.container.frame.height * displaceFactor
+
+ /* Positioning */
+ timePoint = {
+ x: 0,
+ y: limitingContainer.frame.height
+ }
+
+ timePoint = transformThisPoint(timePoint, limitingContainer.frame.container)
+ timePoint.x = canvas.mouse.position.x - thisObject.container.frame.width / 2
+
+ /* Checking against the container limits. */
+ if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x }
+ if (timePoint.x + thisObject.container.frame.width > bottonCorner.x) { timePoint.x = bottonCorner.x - thisObject.container.frame.width }
+ if (timePoint.y < upCorner.y + thisObject.container.frame.height) { timePoint.y = upCorner.y + thisObject.container.frame.height }
+ if (timePoint.y > bottonCorner.y) { timePoint.y = bottonCorner.y }
+
+ thisObject.container.frame.position.x = timePoint.x
+ thisObject.container.frame.position.y = timePoint.y - thisObject.container.frame.height
+
+ thisObject.isVisible = true
+ thisObject.payload.isVisible = true
+ if (thisObject.container.frame.position.y + thisObject.container.frame.height > bottonCorner.y ||
+ thisObject.container.frame.position.y - thisObject.container.frame.height * 3 < upCorner.y ||
+ thisObject.container.frame.position.x < upCorner.x) {
+ thisObject.isVisible = false
+ thisObject.payload.isVisible = false
+ }
+ if (thisObject.layersOn === 0) {
+ thisObject.isVisible = false
+ thisObject.payload.isVisible = false
+ }
+
+ if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_SCALES) {
+ thisObject.isVisible = false
+ }
+ }
+
+ function onViewportZoomChanged(event) {
+ if (event !== undefined) { // it is undefined when the level is just being animated.
+ if (event.shiftKey === false) { return } // with no shft key pressed, no automatic change in scale
+ let currentTimeFrame = thisObject.timeFrame
+ let timeFrame = recalculatePeriod(event.newLevel)
+ if (timeFrame !== currentTimeFrame) {
+ for (let i = 0; i < timeFramesMasterArray.length; i++) {
+ let timeFrameArray = timeFramesMasterArray[i]
+ for (let j = 0; j < timeFrameArray.length; j++) {
+ let record = timeFrameArray[j]
+ if (timeFrame === record[0]) {
+ filePeriodIndex = i
+ timeFrameIndex = j
+ }
+ }
+ }
+ newTimeFrame()
+ saveObjectState()
+ }
+ }
+ }
+
+ function onMouseWheel(event) {
+ if (IS_MAC) {
+ let sensitivity
+ if (event.wheelDelta < 0) {
+ if (event.shiftKey === true) {
+ sensitivity = 20
+ } else {
+ sensitivity = 5
+ }
+ if (wheelDeltaDirection === -1) {
+ wheelDeltaCounter++
+ if (wheelDeltaCounter < sensitivity) {
+ return
+ } else {
+ wheelDeltaCounter = 0
+ }
+ } else {
+ wheelDeltaCounter = 0
+ wheelDeltaDirection = -1
+ return
+ }
+ } else {
+ if (wheelDeltaDirection === 1) {
+ wheelDeltaCounter++
+ if (wheelDeltaCounter < sensitivity) {
+ return
+ } else {
+ wheelDeltaCounter = 0
+ }
+ } else {
+ wheelDeltaCounter = 0
+ wheelDeltaDirection = 1
+ return
+ }
+ }
+ }
+
+ let delta = event.wheelDelta
+ if (delta < 0) {
+ timeFrameIndex--
+ if (timeFrameIndex < 0) {
+ filePeriodIndex--
+ if (filePeriodIndex < 0) {
+ filePeriodIndex = 0
+ timeFrameIndex = 0
+ } else {
+ timeFrameIndex = timeFramesMasterArray[filePeriodIndex].length - 1
+ }
+ }
+ } else {
+ timeFrameIndex++
+ if (timeFrameIndex > timeFramesMasterArray[filePeriodIndex].length - 1) {
+ filePeriodIndex++
+ if (filePeriodIndex > timeFramesMasterArray.length - 1) {
+ filePeriodIndex = timeFramesMasterArray.length - 1
+ timeFrameIndex = timeFramesMasterArray[filePeriodIndex].length - 1
+ } else {
+ timeFrameIndex = 0
+ }
+ }
+ }
+
newTimeFrame()
saveObjectState()
- }
- }
- }
-
- function onMouseWheel (event) {
- if (IS_MAC) {
- let sensitivity
- if (event.wheelDelta < 0) {
- if (event.shiftKey === true) {
- sensitivity = 20
- } else {
- sensitivity = 5
- }
- if (wheelDeltaDirection === -1) {
- wheelDeltaCounter++
- if (wheelDeltaCounter < sensitivity) {
- return
- } else {
- wheelDeltaCounter = 0
- }
- } else {
- wheelDeltaCounter = 0
- wheelDeltaDirection = -1
- return
- }
- } else {
- if (wheelDeltaDirection === 1) {
- wheelDeltaCounter++
- if (wheelDeltaCounter < sensitivity) {
- return
- } else {
- wheelDeltaCounter = 0
- }
- } else {
- wheelDeltaCounter = 0
- wheelDeltaDirection = 1
- return
- }
- }
}
- let delta = event.wheelDelta
- if (delta < 0) {
- timeFrameIndex--
- if (timeFrameIndex < 0) {
- filePeriodIndex--
- if (filePeriodIndex < 0) {
- filePeriodIndex = 0
- timeFrameIndex = 0
- } else {
- timeFrameIndex = timeFramesMasterArray[filePeriodIndex].length - 1
+ function getContainer(point) {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
}
- }
- } else {
- timeFrameIndex++
- if (timeFrameIndex > timeFramesMasterArray[filePeriodIndex].length - 1) {
- filePeriodIndex++
- if (filePeriodIndex > timeFramesMasterArray.length - 1) {
- filePeriodIndex = timeFramesMasterArray.length - 1
- timeFrameIndex = timeFramesMasterArray[filePeriodIndex].length - 1
- } else {
- timeFrameIndex = 0
+ }
+
+ function saveObjectState() {
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+ config.value = timeFrameLabel
+ thisObject.payload.node.config = JSON.stringify(config)
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
}
- }
}
- newTimeFrame()
- saveObjectState()
- }
-
- function getContainer (point) {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- }
- }
-
- function saveObjectState () {
- try {
- let config = JSON.parse(thisObject.payload.node.config)
- config.value = timeFrameLabel
- thisObject.payload.node.config = JSON.stringify(config)
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
- }
-
- function readObjectState () {
- try {
- let config = JSON.parse(thisObject.payload.node.config)
- if (config.value !== timeFrameLabel) {
- let found = false
- for (let i = 0; i < timeFramesMasterArray.length; i++) {
- let timeFrameArray = timeFramesMasterArray[i]
- for (let j = 0; j < timeFrameArray.length; j++) {
- let record = timeFrameArray[j]
- if (config.value === record[1]) {
- filePeriodIndex = i
- timeFrameIndex = j
- found = true
+ function readObjectState() {
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+ if (config.value !== timeFrameLabel) {
+ let found = false
+ for (let i = 0; i < timeFramesMasterArray.length; i++) {
+ let timeFrameArray = timeFramesMasterArray[i]
+ for (let j = 0; j < timeFrameArray.length; j++) {
+ let record = timeFrameArray[j]
+ if (config.value === record[1]) {
+ filePeriodIndex = i
+ timeFrameIndex = j
+ found = true
+ }
+ }
+ }
+ if (found === true) {
+ newTimeFrame()
+ } else {
+ saveObjectState()
+ }
}
- }
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
}
- if (found === true) {
- newTimeFrame()
- } else {
- saveObjectState()
+ }
+
+ function newTimeFrame() {
+ let timeFrameArray = timeFramesMasterArray[filePeriodIndex]
+ thisObject.timeFrame = timeFrameArray[timeFrameIndex][0]
+ timeFrameLabel = timeFrameArray[timeFrameIndex][1]
+ // console.log('NEW TIME FRAME LABEL', timeFrameLabel)
+ let event = {}
+ event.timeFrame = thisObject.timeFrame
+ thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)
+ }
+
+ function draw() {
+ drawScaleBox()
+ if (greyOutCoverLayer === true) {
+ drawScaleDisplayCover(thisObject.container)
}
- }
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
}
- }
- function newTimeFrame () {
- let timeFrameArray = timeFramesMasterArray[filePeriodIndex]
- thisObject.timeFrame = timeFrameArray[timeFrameIndex][0]
- timeFrameLabel = timeFrameArray[timeFrameIndex][1]
- // console.log('NEW TIME FRAME LABEL', timeFrameLabel)
- let event = {}
- event.timeFrame = thisObject.timeFrame
- thisObject.container.eventHandler.raiseEvent('Time Frame Value Changed', event)
- }
-
- function draw () {
- drawScaleBox()
- if (greyOutCoverLayer === true) {
- drawScaleDisplayCover(thisObject.container)
+ function drawForeground() {
+ if (isMouseOver === true) {
+ drawScaleBox()
+ }
}
- }
- function drawForeground () {
- if (isMouseOver === true) {
- drawScaleBox()
+ function drawScaleBox() {
+ if (timeFrameLabel === undefined) { return }
+
+ let label = timeFrameLabel.split('-')
+ let label1 = thisObject.payload.node.payload.parentNode.name
+ let label2 = label[0]
+ let label3 = label[1].toUpperCase()
+
+ let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
+ let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
+
+ let backgroundColor = UI_COLOR.BLACK
+
+ drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container, backgroundColor)
}
- }
-
- function drawScaleBox () {
- if (timeFrameLabel === undefined) { return }
-
- let label = timeFrameLabel.split('-')
- let label1 = thisObject.payload.node.payload.parentNode.name
- let label2 = label[0]
- let label3 = label[1].toUpperCase()
-
- let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
- let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
-
- let backgroundColor = UI_COLOR.BLACK
-
- drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container, backgroundColor)
- }
}
diff --git a/CanvasApp/Scales/TimeScale.js b/CanvasApp/Scales/TimeScale.js
index 90ee96fb0..af0a3dbc8 100644
--- a/CanvasApp/Scales/TimeScale.js
+++ b/CanvasApp/Scales/TimeScale.js
@@ -1,359 +1,359 @@
-function newTimeScale () {
- const MODULE_NAME = 'Time Scale'
+function newTimeScale() {
+ const MODULE_NAME = 'Time Scale'
- let thisObject = {
- container: undefined,
- date: undefined,
- fitFunction: undefined,
- payload: undefined,
- isVisible: true,
- fromDate: undefined,
- toDate: undefined,
- onMouseOverSomeTimeMachineContainer: onMouseOverSomeTimeMachineContainer,
- physics: physics,
- draw: draw,
- drawBackground: drawBackground,
- drawForeground: drawForeground,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
-
- thisObject.container.isDraggeable = false
- thisObject.container.isClickeable = false
- thisObject.container.isWheelable = true
- thisObject.container.detectMouseOver = true
-
- thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
- thisObject.container.frame.height = 40
-
- let visible = true
- let autoScaleButton
- let isMouseOver
-
- let onMouseWheelEventSubscriptionId
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
- let onScaleChangedEventSubscriptionId
-
- let coordinateSystem
- let limitingContainer
-
- let wheelDeltaDirection
- let wheelDeltaCounter = 0
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- coordinateSystem.eventHandler.stopListening(onScaleChangedEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- thisObject.payload = undefined
-
- coordinateSystem = undefined
- limitingContainer = undefined
-
- autoScaleButton.finalize()
- autoScaleButton = undefined
- }
-
- function initialize (pCoordinateSystem, pLimitingContainer) {
- coordinateSystem = pCoordinateSystem
- limitingContainer = pLimitingContainer
-
- onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
- onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- onScaleChangedEventSubscriptionId = coordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
-
- autoScaleButton = newAutoScaleButton()
- autoScaleButton.container.connectToParent(thisObject.container)
- autoScaleButton.initialize('X', coordinateSystem)
-
- readObjectState()
- }
-
- function onMouseOverSomeTimeMachineContainer (event) {
- if (event.containerId === undefined) {
- /* This happens when the mouse over was not at the instance of a certain scale, but anywhere else. */
- visible = true
- } else {
- if (event.containerId === thisObject.container.id) {
- visible = true
- } else {
- visible = false
- turnOnCounter = 0
- }
+ let thisObject = {
+ container: undefined,
+ date: undefined,
+ fitFunction: undefined,
+ payload: undefined,
+ isVisible: true,
+ fromDate: undefined,
+ toDate: undefined,
+ onMouseOverSomeTimeMachineContainer: onMouseOverSomeTimeMachineContainer,
+ physics: physics,
+ draw: draw,
+ drawBackground: drawBackground,
+ drawForeground: drawForeground,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- }
- function onMouseOver (event) {
- isMouseOver = true
- event.containerId = thisObject.container.id
- thisObject.container.eventHandler.raiseEvent('onMouseOverScale', event)
- }
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
- function onMouseNotOver () {
- isMouseOver = false
- }
+ thisObject.container.isDraggeable = false
+ thisObject.container.isClickeable = false
+ thisObject.container.isWheelable = true
+ thisObject.container.detectMouseOver = true
+
+ thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL
+ thisObject.container.frame.height = 40
+
+ let visible = true
+ let autoScaleButton
+ let isMouseOver
+
+ let onMouseWheelEventSubscriptionId
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
+ let onScaleChangedEventSubscriptionId
+
+ let coordinateSystem
+ let limitingContainer
+
+ let wheelDeltaDirection
+ let wheelDeltaCounter = 0
+
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
+ coordinateSystem.eventHandler.stopListening(onScaleChangedEventSubscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
+ thisObject.payload = undefined
+
+ coordinateSystem = undefined
+ limitingContainer = undefined
+
+ autoScaleButton.finalize()
+ autoScaleButton = undefined
+ }
+
+ function initialize(pCoordinateSystem, pLimitingContainer) {
+ coordinateSystem = pCoordinateSystem
+ limitingContainer = pLimitingContainer
+
+ onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
+ onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ onScaleChangedEventSubscriptionId = coordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
+
+ autoScaleButton = newAutoScaleButton()
+ autoScaleButton.container.connectToParent(thisObject.container)
+ autoScaleButton.initialize('X', coordinateSystem)
+
+ readObjectState()
+ }
+
+ function onMouseOverSomeTimeMachineContainer(event) {
+ if (event.containerId === undefined) {
+ /* This happens when the mouse over was not at the instance of a certain scale, but anywhere else. */
+ visible = true
+ } else {
+ if (event.containerId === thisObject.container.id) {
+ visible = true
+ } else {
+ visible = false
+ turnOnCounter = 0
+ }
+ }
+ }
+
+ function onMouseOver(event) {
+ isMouseOver = true
+ event.containerId = thisObject.container.id
+ thisObject.container.eventHandler.raiseEvent('onMouseOverScale', event)
+ }
+
+ function onMouseNotOver() {
+ isMouseOver = false
+ }
+
+ function onMouseWheel(event) {
+ if (IS_MAC) {
+ let sensitivity
+ if (event.wheelDelta < 0) {
+ if (event.shiftKey === true) {
+ sensitivity = 20
+ } else {
+ sensitivity = 5
+ }
+ if (wheelDeltaDirection === -1) {
+ wheelDeltaCounter++
+ if (wheelDeltaCounter < sensitivity) {
+ return
+ } else {
+ wheelDeltaCounter = 0
+ }
+ } else {
+ wheelDeltaCounter = 0
+ wheelDeltaDirection = -1
+ return
+ }
+ } else {
+ if (wheelDeltaDirection === 1) {
+ wheelDeltaCounter++
+ if (wheelDeltaCounter < sensitivity) {
+ return
+ } else {
+ wheelDeltaCounter = 0
+ }
+ } else {
+ wheelDeltaCounter = 0
+ wheelDeltaDirection = 1
+ return
+ }
+ }
+ }
- function onMouseWheel (event) {
- if (IS_MAC) {
- let sensitivity
- if (event.wheelDelta < 0) {
if (event.shiftKey === true) {
- sensitivity = 20
- } else {
- sensitivity = 5
- }
- if (wheelDeltaDirection === -1) {
- wheelDeltaCounter++
- if (wheelDeltaCounter < sensitivity) {
+ autoScaleButton.container.eventHandler.raiseEvent('onMouseWheel', event)
return
- } else {
- wheelDeltaCounter = 0
- }
+ }
+ let factor
+ let morePower = 10
+ if (event.buttons === 4) { morePower = 1 } // Mouse wheel pressed.
+
+ let delta = event.wheelDelta
+ if (delta < 0) {
+ factor = -0.01 * morePower
} else {
- wheelDeltaCounter = 0
- wheelDeltaDirection = -1
- return
+ factor = 0.01 * morePower
}
- } else {
- if (wheelDeltaDirection === 1) {
- wheelDeltaCounter++
- if (wheelDeltaCounter < sensitivity) {
- return
- } else {
- wheelDeltaCounter = 0
- }
- } else {
- wheelDeltaCounter = 0
- wheelDeltaDirection = 1
- return
+
+ coordinateSystem.zoomX(factor, event, limitingContainer, MODULE_NAME)
+ }
+
+ function onScaleChanged() {
+ saveObjectState()
+ }
+
+ function getContainer(point, purpose) {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
}
- }
}
- if (event.shiftKey === true) {
- autoScaleButton.container.eventHandler.raiseEvent('onMouseWheel', event)
- return
- }
- let factor
- let morePower = 10
- if (event.buttons === 4) { morePower = 1 } // Mouse wheel pressed.
-
- let delta = event.wheelDelta
- if (delta < 0) {
- factor = -0.01 * morePower
- } else {
- factor = 0.01 * morePower
- }
-
- coordinateSystem.zoomX(factor, event, limitingContainer, MODULE_NAME)
- }
-
- function onScaleChanged () {
- saveObjectState()
- }
-
- function getContainer (point, purpose) {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- }
- }
-
- function saveObjectState () {
- try {
- let config = JSON.parse(thisObject.payload.node.config)
- config.fromDate = (new Date(coordinateSystem.min.x)).toISOString()
- config.toDate = (new Date(coordinateSystem.max.x)).toISOString()
- config.autoMinScale = coordinateSystem.autoMinXScale
- config.autoMaxScale = coordinateSystem.autoMaxXScale
- thisObject.payload.node.config = JSON.stringify(config, null, 4)
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
- }
-
- function readObjectState () {
- try {
- let config = JSON.parse(thisObject.payload.node.config)
-
- if (
- (isNaN(Date.parse(config.fromDate)) || config.fromDate === null || config.fromDate === undefined) ||
- (isNaN(Date.parse(config.toDate)) || config.toDate === null || config.toDate === undefined)
- ) {
- // not using this value
- } else {
- if (thisObject.fromDate !== Date.parse(config.fromDate) || thisObject.toDate !== Date.parse(config.toDate)) {
- thisObject.fromDate = Date.parse(config.fromDate)
- thisObject.toDate = Date.parse(config.toDate)
- coordinateSystem.min.x = thisObject.fromDate
- coordinateSystem.max.x = thisObject.toDate
-
- if (config.autoMinScale !== undefined && (config.autoMinScale === true || config.autoMinScale === false) && config.autoMaxScale !== undefined && (config.autoMaxScale === true || config.autoMaxScale === false)) {
- coordinateSystem.autoMinXScale = config.autoMinScale
- coordinateSystem.autoMaxXScale = config.autoMaxScale
- autoScaleButton.setStatus(config.autoMinScale, config.autoMaxScale)
- }
- coordinateSystem.recalculateScale()
+ function saveObjectState() {
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+ config.fromDate = (new Date(coordinateSystem.min.x)).toISOString()
+ config.toDate = (new Date(coordinateSystem.max.x)).toISOString()
+ config.autoMinScale = coordinateSystem.autoMinXScale
+ config.autoMaxScale = coordinateSystem.autoMaxXScale
+ thisObject.payload.node.config = JSON.stringify(config, null, 4)
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
}
- }
- saveObjectState() // this overrides any invalid value at the config.
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
- }
-
- function physics () {
- readObjectState()
- positioningPhysics()
- }
-
- function positioningPhysics () {
- /* Container Limits */
-
- let upCorner = {
- x: 0,
- y: 0
}
- let bottonCorner = {
- x: limitingContainer.frame.width,
- y: limitingContainer.frame.height
+ function readObjectState() {
+ try {
+ let config = JSON.parse(thisObject.payload.node.config)
+
+ if (
+ (isNaN(Date.parse(config.fromDate)) || config.fromDate === null || config.fromDate === undefined) ||
+ (isNaN(Date.parse(config.toDate)) || config.toDate === null || config.toDate === undefined)
+ ) {
+ // not using this value
+ } else {
+ if (thisObject.fromDate !== Date.parse(config.fromDate) || thisObject.toDate !== Date.parse(config.toDate)) {
+ thisObject.fromDate = Date.parse(config.fromDate)
+ thisObject.toDate = Date.parse(config.toDate)
+ coordinateSystem.min.x = thisObject.fromDate
+ coordinateSystem.max.x = thisObject.toDate
+
+ if (config.autoMinScale !== undefined && (config.autoMinScale === true || config.autoMinScale === false) && config.autoMaxScale !== undefined && (config.autoMaxScale === true || config.autoMaxScale === false)) {
+ coordinateSystem.autoMinXScale = config.autoMinScale
+ coordinateSystem.autoMaxXScale = config.autoMaxScale
+ autoScaleButton.setStatus(config.autoMinScale, config.autoMaxScale)
+ }
+ coordinateSystem.recalculateScale()
+ }
+ }
+ saveObjectState() // this overrides any invalid value at the config.
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
}
- upCorner = transformThisPoint(upCorner, limitingContainer)
- bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
-
- upCorner = limitingContainer.fitFunction(upCorner, true)
- bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
-
- /* Mouse Position Date Calculation */
- let timePoint = {
- x: canvas.mouse.position.x,
- y: 0
+ function physics() {
+ readObjectState()
+ positioningPhysics()
}
- let mouseDate = getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
+ function positioningPhysics() {
+ /* Container Limits */
- thisObject.date = new Date(mouseDate)
+ let upCorner = {
+ x: 0,
+ y: 0
+ }
- /* timeScale Positioning */
- timePoint = {
- x: 0,
- y: 0
+ let bottonCorner = {
+ x: limitingContainer.frame.width,
+ y: limitingContainer.frame.height
+ }
+
+ upCorner = transformThisPoint(upCorner, limitingContainer)
+ bottonCorner = transformThisPoint(bottonCorner, limitingContainer)
+
+ upCorner = limitingContainer.fitFunction(upCorner, true)
+ bottonCorner = limitingContainer.fitFunction(bottonCorner, true)
+
+ /* Mouse Position Date Calculation */
+ let timePoint = {
+ x: canvas.mouse.position.x,
+ y: 0
+ }
+
+ let mouseDate = getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
+
+ thisObject.date = new Date(mouseDate)
+
+ /* timeScale Positioning */
+ timePoint = {
+ x: 0,
+ y: 0
+ }
+
+ timePoint = transformThisPoint(timePoint, limitingContainer.frame.container)
+ timePoint.x = canvas.mouse.position.x - thisObject.container.frame.width / 2
+
+ /* Checking against the container limits. */
+ if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x }
+ if (timePoint.x + thisObject.container.frame.width > bottonCorner.x) { timePoint.x = bottonCorner.x - thisObject.container.frame.width }
+ if (timePoint.y < upCorner.y) { timePoint.y = upCorner.y }
+ if (timePoint.y + thisObject.container.frame.height > bottonCorner.y) { timePoint.y = bottonCorner.y - thisObject.container.frame.height }
+
+ thisObject.container.frame.position.x = timePoint.x
+ thisObject.container.frame.position.y = timePoint.y
+
+ thisObject.isVisible = true
+ if (thisObject.container.frame.position.y + thisObject.container.frame.height * 4 > bottonCorner.y ||
+ thisObject.container.frame.position.y < upCorner.y ||
+ thisObject.container.frame.position.x < upCorner.x) {
+ thisObject.isVisible = false
+ }
+
+ if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_SCALES) {
+ thisObject.isVisible = false
+ }
}
- timePoint = transformThisPoint(timePoint, limitingContainer.frame.container)
- timePoint.x = canvas.mouse.position.x - thisObject.container.frame.width / 2
-
- /* Checking against the container limits. */
- if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x }
- if (timePoint.x + thisObject.container.frame.width > bottonCorner.x) { timePoint.x = bottonCorner.x - thisObject.container.frame.width }
- if (timePoint.y < upCorner.y) { timePoint.y = upCorner.y }
- if (timePoint.y + thisObject.container.frame.height > bottonCorner.y) { timePoint.y = bottonCorner.y - thisObject.container.frame.height }
-
- thisObject.container.frame.position.x = timePoint.x
- thisObject.container.frame.position.y = timePoint.y
-
- thisObject.isVisible = true
- if (thisObject.container.frame.position.y + thisObject.container.frame.height * 4 > bottonCorner.y ||
- thisObject.container.frame.position.y < upCorner.y ||
- thisObject.container.frame.position.x < upCorner.x) {
- thisObject.isVisible = false
+ function drawBackground() {
+ drawScale()
}
- if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_DISPLAYING_SCALES) {
- thisObject.isVisible = false
- }
- }
+ function drawScale() {
+ const SEPARATION = 150
+ const NUMBER_OF_LABELS = Math.trunc(canvas.chartingSpace.viewport.width / SEPARATION)
+ const FONT_SIZE = 15
- function drawBackground () {
- drawScale()
- }
+ for (let i = 0; i <= NUMBER_OF_LABELS; i++) {
+ let timePoint = {
+ x: SEPARATION * (i + 1),
+ y: 0
+ }
- function drawScale () {
- const SEPARATION = 150
- const NUMBER_OF_LABELS = Math.trunc(canvas.chartingSpace.viewport.width / SEPARATION)
- const FONT_SIZE = 15
+ let time = getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
+ let labels = scaleLabels(time, true)
+ let labelDisplace = labels[1].length * FONT_SIZE * FONT_ASPECT_RATIO
- for (let i = 0; i <= NUMBER_OF_LABELS; i++) {
- let timePoint = {
- x: SEPARATION * (i + 1),
- y: 0
- }
+ let timePoint1 = {
+ x: SEPARATION * (i + 1) - labelDisplace,
+ y: 0
+ }
+ let timePoint2 = {
+ x: SEPARATION * (i + 1) + labelDisplace,
+ y: 0
+ }
- let time = getDateFromPointAtBrowserCanvas(timePoint, limitingContainer, coordinateSystem)
- let labels = scaleLabels(time, true)
- let labelDisplace = labels[1].length * FONT_SIZE * FONT_ASPECT_RATIO
+ let fitPoint1 = thisObject.fitFunction(timePoint1)
+ let fitPoint2 = thisObject.fitFunction(timePoint2)
- let timePoint1 = {
- x: SEPARATION * (i + 1) - labelDisplace,
- y: 0
- }
- let timePoint2 = {
- x: SEPARATION * (i + 1) + labelDisplace,
- y: 0
- }
-
- let fitPoint1 = thisObject.fitFunction(timePoint1)
- let fitPoint2 = thisObject.fitFunction(timePoint2)
-
- if (fitPoint1.x === timePoint1.x && fitPoint2.x === timePoint2.x) {
- drawLabel(labels[1], 1 / 2, 0, 18, 17, FONT_SIZE, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
- drawLabel(labels[2], 1 / 2, 0, 18, 30, 12, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
- }
- }
- }
-
- function draw () {
- drawScaleBox()
- autoScaleButton.draw()
- if (visible === false) {
- drawScaleDisplayCover(thisObject.container)
- }
- }
-
- function drawForeground () {
- if (isMouseOver === true) {
- drawScaleBox()
- autoScaleButton.draw()
- }
- }
-
- function drawScaleBox () {
- if (thisObject.date === undefined) { return }
-
- let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
- let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
-
- let backgroundColor = UI_COLOR.BLACK
- let labels = scaleLabels(thisObject.date)
-
- drawScaleDisplay(labels[0], labels[1], labels[2], 0, 0, 0, icon1, icon2, thisObject.container, backgroundColor)
- }
-
- function scaleLabels (date, excludeYear) {
- let label = date.toUTCString()
- let labelArray = label.split(' ')
- let label1 = thisObject.payload.node.payload.parentNode.name
- let label2 = labelArray[1] + ' ' + labelArray[2] + ' ' + labelArray[3]
- let label3 = labelArray[4]
-
- if (excludeYear === true) {
- label2 = labelArray[1] + ' ' + labelArray[2]
+ if (fitPoint1.x === timePoint1.x && fitPoint2.x === timePoint2.x) {
+ drawLabel(labels[1], 1 / 2, 0, 18, 17, FONT_SIZE, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
+ drawLabel(labels[2], 1 / 2, 0, 18, 30, 12, thisObject.container, UI_COLOR.GREY, timePoint1.x, undefined)
+ }
+ }
}
- return [label1, label2, label3]
- }
+ function draw() {
+ drawScaleBox()
+ autoScaleButton.draw()
+ if (visible === false) {
+ drawScaleDisplayCover(thisObject.container)
+ }
+ }
+
+ function drawForeground() {
+ if (isMouseOver === true) {
+ drawScaleBox()
+ autoScaleButton.draw()
+ }
+ }
+
+ function drawScaleBox() {
+ if (thisObject.date === undefined) { return }
+
+ let icon1 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
+ let icon2 = canvas.designSpace.iconByUiObjectType.get(thisObject.payload.node.type)
+
+ let backgroundColor = UI_COLOR.BLACK
+ let labels = scaleLabels(thisObject.date)
+
+ drawScaleDisplay(labels[0], labels[1], labels[2], 0, 0, 0, icon1, icon2, thisObject.container, backgroundColor)
+ }
+
+ function scaleLabels(date, excludeYear) {
+ let label = date.toUTCString()
+ let labelArray = label.split(' ')
+ let label1 = thisObject.payload.node.payload.parentNode.name
+ let label2 = labelArray[1] + ' ' + labelArray[2] + ' ' + labelArray[3]
+ let label3 = labelArray[4]
+
+ if (excludeYear === true) {
+ label2 = labelArray[1] + ' ' + labelArray[2]
+ }
+
+ return [label1, label2, label3]
+ }
}
diff --git a/CanvasApp/SideSpace/ListItem.js b/CanvasApp/SideSpace/ListItem.js
index 59e982979..fdb2f3478 100644
--- a/CanvasApp/SideSpace/ListItem.js
+++ b/CanvasApp/SideSpace/ListItem.js
@@ -1,107 +1,107 @@
-function newListItem () {
- const MODULE_NAME = 'List Item'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newListItem() {
+ const MODULE_NAME = 'List Item'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- container: undefined,
- fitFunction: undefined,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize()
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = false
- thisObject.container.detectMouseOver = true
- thisObject.container.isClickeable = true
- thisObject.container.frame.width = SIDE_PANEL_WIDTH * 0.75
- thisObject.container.frame.height = SIDE_PANEL_WIDTH * 0.75
-
- let name
- let type
-
- let onMouseOverEventSubscriptionId
- let onMouseNotOverEventSubscriptionId
- let onMouseClickEventSubscriptionId
-
- let isMouseOver = false
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(onMouseClickEventSubscriptionId)
-
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fitFunction = undefined
- }
-
- function initialize (pName, pType) {
- name = pName
- type = pType
-
- onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
- onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
- onMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
- }
-
- function getContainer (point) {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- }
- }
-
- function onMouseOver (event) {
- isMouseOver = true
- }
-
- function onMouseNotOver () {
- isMouseOver = false
- }
-
- function onMouseClick (event) {
- canvas.designSpace.workspace.replaceWorkspaceByLoadingOne(name)
- }
-
- function physics () {
-
- }
-
- function draw () {
- let icon = canvas.designSpace.iconByUiObjectType.get(type)
- let backgroundColor = UI_COLOR.BLACK
- let labelColor
-
- const RED_LINE_HIGHT = 4
- const OPACITY = 1
-
- let params = {
- cornerRadius: 0,
- lineWidth: 1,
- container: thisObject.container,
- borderColor: UI_COLOR.RUSTED_RED,
- castShadow: false,
- backgroundColor: backgroundColor,
- opacity: OPACITY
+ let thisObject = {
+ container: undefined,
+ fitFunction: undefined,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- if (isMouseOver === false) {
- labelColor = UI_COLOR.WHITE
- } else {
- labelColor = UI_COLOR.TITANIUM_YELLOW
+ thisObject.container = newContainer()
+ thisObject.container.initialize()
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = false
+ thisObject.container.detectMouseOver = true
+ thisObject.container.isClickeable = true
+ thisObject.container.frame.width = SIDE_PANEL_WIDTH * 0.75
+ thisObject.container.frame.height = SIDE_PANEL_WIDTH * 0.75
+
+ let name
+ let type
+
+ let onMouseOverEventSubscriptionId
+ let onMouseNotOverEventSubscriptionId
+ let onMouseClickEventSubscriptionId
+
+ let isMouseOver = false
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseNotOverEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(onMouseClickEventSubscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fitFunction = undefined
}
- roundedCornersBackground(params)
+ function initialize(pName, pType) {
+ name = pName
+ type = pType
- drawLabel(name, 1 / 2, 3.0 / 10, -5, 0, 15, thisObject.container, labelColor)
- drawLabel(type, 1 / 2, 7.2 / 10, -5, 0, 15, thisObject.container, labelColor)
- drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 80, thisObject.container)
- }
+ onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+ onMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
+ onMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ }
+
+ function getContainer(point) {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ }
+ }
+
+ function onMouseOver(event) {
+ isMouseOver = true
+ }
+
+ function onMouseNotOver() {
+ isMouseOver = false
+ }
+
+ function onMouseClick(event) {
+ canvas.designSpace.workspace.replaceWorkspaceByLoadingOne(name)
+ }
+
+ function physics() {
+
+ }
+
+ function draw() {
+ let icon = canvas.designSpace.iconByUiObjectType.get(type)
+ let backgroundColor = UI_COLOR.BLACK
+ let labelColor
+
+ const RED_LINE_HIGHT = 4
+ const OPACITY = 1
+
+ let params = {
+ cornerRadius: 0,
+ lineWidth: 1,
+ container: thisObject.container,
+ borderColor: UI_COLOR.RUSTED_RED,
+ castShadow: false,
+ backgroundColor: backgroundColor,
+ opacity: OPACITY
+ }
+
+ if (isMouseOver === false) {
+ labelColor = UI_COLOR.WHITE
+ } else {
+ labelColor = UI_COLOR.TITANIUM_YELLOW
+ }
+
+ roundedCornersBackground(params)
+
+ drawLabel(name, 1 / 2, 3.0 / 10, -5, 0, 15, thisObject.container, labelColor)
+ drawLabel(type, 1 / 2, 7.2 / 10, -5, 0, 15, thisObject.container, labelColor)
+ drawIcon(icon, 1 / 2, 1 / 2, 0, 0, 80, thisObject.container)
+ }
}
diff --git a/CanvasApp/SideSpace/ListView.js b/CanvasApp/SideSpace/ListView.js
index e066f7b73..5aac6fb7e 100644
--- a/CanvasApp/SideSpace/ListView.js
+++ b/CanvasApp/SideSpace/ListView.js
@@ -1,271 +1,271 @@
-function newListView () {
- const MODULE_NAME = 'List View'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newListView() {
+ const MODULE_NAME = 'List View'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- fitFunction: undefined,
- container: undefined,
- listItems: [],
- payload: undefined,
- isVisible: false,
- resize: resize,
- turnOn: turnOn,
- turnOff: turnOff,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize()
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = true
- thisObject.container.detectMouseOver = true
-
- let isInitialized = false
-
- let listItemsMap = new Map()
- let visibleListItems = []
- let firstVisibleListItem
-
- let headerHeight = 40
- let footerHeight = 30
- let listItemHeight = SIDE_PANEL_WIDTH * 0.75
-
- let posibleVisibleListItems
-
- let itemSeparation
-
- let onMouseWheelEventSuscriptionId
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onMouseWheelEventSuscriptionId)
-
- listItemsMap = undefined
- visibleListItems = undefined
-
- thisObject.container.finalize()
- thisObject.container = undefined
-
- thisObject.payload = undefined
- thisObject = undefined
- }
-
- function initialize () {
- thisObject.container.name = MODULE_NAME
- thisObject.container.frame.containerName = thisObject.container.name
- thisObject.container.frame.width = SIDE_PANEL_WIDTH * 0.75
-
- let position = { // Default position
- x: SIDE_PANEL_WIDTH * 0.25 / 2,
- y: 20
+ let thisObject = {
+ fitFunction: undefined,
+ container: undefined,
+ listItems: [],
+ payload: undefined,
+ isVisible: false,
+ resize: resize,
+ turnOn: turnOn,
+ turnOff: turnOff,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- thisObject.container.frame.position = position
+ thisObject.container = newContainer()
+ thisObject.container.initialize()
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = true
+ thisObject.container.detectMouseOver = true
- onMouseWheelEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
+ let isInitialized = false
- resize()
- turnOn()
- }
+ let listItemsMap = new Map()
+ let visibleListItems = []
+ let firstVisibleListItem
- function resize () {
- thisObject.container.frame.height = browserCanvas.height - thisObject.container.frame.position.y * 2
+ let headerHeight = 40
+ let footerHeight = 30
+ let listItemHeight = SIDE_PANEL_WIDTH * 0.75
- let spaceForListItems = (thisObject.container.frame.height - headerHeight - footerHeight)
- posibleVisibleListItems = Math.trunc(spaceForListItems / (listItemHeight))
- if ((posibleVisibleListItems - 1) !== 0) {
- itemSeparation = (spaceForListItems - listItemHeight * posibleVisibleListItems) / (posibleVisibleListItems - 1)
- } else {
- itemSeparation = 0
- }
- }
+ let posibleVisibleListItems
- function turnOn () {
- firstVisibleListItem = 1
+ let itemSeparation
- callServer(undefined, 'ListWorkspaces', onResponse)
+ let onMouseWheelEventSuscriptionId
- function onResponse (err, text) {
- if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
- if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> Could not load the list of your workspaces from the backend. ') }
- return
- }
+ return thisObject
- let workspacelist = JSON.parse(text)
- thisObject.listItems = []
- for (let i = 0; i < workspacelist.length; i++) {
- let workspace = workspacelist[i].replace('.json', '')
- let listItem = newListItem()
- listItem.initialize(workspace, 'Workspace')
- listItem.container.connectToParent(thisObject.container, false, false)
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onMouseWheelEventSuscriptionId)
- thisObject.listItems.push(listItem)
- }
- calculateVisbleListItems()
- isInitialized = true
- thisObject.isVisible = true
- }
- }
+ listItemsMap = undefined
+ visibleListItems = undefined
- function turnOff () {
- thisObject.isVisible = false
- }
+ thisObject.container.finalize()
+ thisObject.container = undefined
- function onMouseWheel (event) {
- delta = event.wheelDelta
- if (delta > 0) {
- delta = -1
- } else {
- delta = 1
+ thisObject.payload = undefined
+ thisObject = undefined
}
- firstVisibleListItem = firstVisibleListItem + delta
+ function initialize() {
+ thisObject.container.name = MODULE_NAME
+ thisObject.container.frame.containerName = thisObject.container.name
+ thisObject.container.frame.width = SIDE_PANEL_WIDTH * 0.75
- calculateVisbleListItems()
- }
-
- function calculateVisbleListItems () {
- let availableSlots = Math.trunc(posibleVisibleListItems)
-
- if (firstVisibleListItem < 1) { firstVisibleListItem = 1 }
- if (firstVisibleListItem > (thisObject.listItems.length - availableSlots + 1)) { firstVisibleListItem = thisObject.listItems.length - availableSlots + 1 }
-
- visibleListItems = []
-
- for (let i = 0; i < thisObject.listItems.length; i++) {
- if (i + 1 >= firstVisibleListItem && i + 1 < firstVisibleListItem + availableSlots) {
- let listItem = thisObject.listItems[i]
-
- listItem.container.frame.position.x = 0
- listItem.container.frame.position.y = (listItemHeight + itemSeparation) * visibleListItems.length + headerHeight
-
- /* Add to Visible Product Array */
- visibleListItems.push(listItem)
- }
- }
- }
-
- function getContainer (point, purpose) {
- if (isInitialized === false || thisObject.isVisible === false) { return }
- let container
-
- /* First we check if thisObject point is inside thisObject space. */
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- /* Now we see which is the inner most container that has it */
- for (let i = 0; i < visibleListItems.length; i++) {
- container = visibleListItems[i].getContainer(point)
-
- if (container !== undefined) {
- if (container.isForThisPurpose(purpose) === true) {
- return container
- }
+ let position = { // Default position
+ x: SIDE_PANEL_WIDTH * 0.25 / 2,
+ y: 20
}
- }
- return thisObject.container
- }
- }
+ thisObject.container.frame.position = position
- function childrenPhysics () {
- for (let i = 0; i < thisObject.listItems.length; i++) {
- let listItem = thisObject.listItems[i]
- listItem.physics()
- }
- }
+ onMouseWheelEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
- function physics () {
- if (isInitialized === false || thisObject.isVisible === false) { return }
- if (isInitialized === false) { return }
- if (thisObject.isVisible === false) { return }
- childrenPhysics()
- }
-
- function draw () {
- if (isInitialized === false || thisObject.isVisible === false) { return }
-
- drawBackground()
- drawChildren()
- drawScrollBar()
- }
-
- function drawChildren () {
- for (let i = 0; i < visibleListItems.length; i++) {
- let listItem = visibleListItems[i]
- if (listItem !== undefined) {
- listItem.draw()
- }
- }
- }
-
- function drawBackground () {
- let label = 'Your Workspaces'
-
- let backgroundColor = UI_COLOR.WHITE
- let params = {
- cornerRadius: 5,
- lineWidth: 1,
- container: thisObject.container,
- borderColor: UI_COLOR.RUSTED_RED,
- castShadow: false,
- backgroundColor: backgroundColor,
- opacity: 1
+ resize()
+ turnOn()
}
- roundedCornersBackground(params)
+ function resize() {
+ thisObject.container.frame.height = browserCanvas.height - thisObject.container.frame.position.y * 2
- drawLabel(label, 1 / 2, 0, 0, 25, 15, thisObject.container, UI_COLOR.BLACK)
- }
-
- function drawScrollBar () {
- if (thisObject.listItems.length > posibleVisibleListItems && posibleVisibleListItems > 0) {
- let xOffset = 4
- let barTopPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: headerHeight
- }
- let barBottomPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: thisObject.container.frame.height - footerHeight
- }
- let ratio = (posibleVisibleListItems * listItemHeight + (posibleVisibleListItems - 1) * itemSeparation) / (thisObject.listItems.length * listItemHeight + (thisObject.listItems.length - 1) * itemSeparation)
- let handleHeight = posibleVisibleListItems * (listItemHeight * ratio) + (posibleVisibleListItems - 1) * itemSeparation * ratio
- let handleTopPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: headerHeight + (listItemHeight * ratio * (firstVisibleListItem - 1) + itemSeparation * ratio * (firstVisibleListItem - 1))
- }
- let handleBottomPoint = {
- x: thisObject.container.frame.width - xOffset,
- y: handleTopPoint.y + handleHeight
- }
- barTopPoint = thisObject.container.frame.frameThisPoint(barTopPoint)
- barBottomPoint = thisObject.container.frame.frameThisPoint(barBottomPoint)
- handleTopPoint = thisObject.container.frame.frameThisPoint(handleTopPoint)
- handleBottomPoint = thisObject.container.frame.frameThisPoint(handleBottomPoint)
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(barTopPoint.x, barTopPoint.y)
- browserCanvasContext.lineTo(barBottomPoint.x, barBottomPoint.y)
- browserCanvasContext.closePath()
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + 1 + ')'
- browserCanvasContext.stroke()
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(handleTopPoint.x, handleTopPoint.y)
- browserCanvasContext.lineTo(handleBottomPoint.x, handleBottomPoint.y)
- browserCanvasContext.closePath()
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.lineWidth = 4
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', ' + 1 + ')'
- browserCanvasContext.stroke()
+ let spaceForListItems = (thisObject.container.frame.height - headerHeight - footerHeight)
+ posibleVisibleListItems = Math.trunc(spaceForListItems / (listItemHeight))
+ if ((posibleVisibleListItems - 1) !== 0) {
+ itemSeparation = (spaceForListItems - listItemHeight * posibleVisibleListItems) / (posibleVisibleListItems - 1)
+ } else {
+ itemSeparation = 0
+ }
+ }
+
+ function turnOn() {
+ firstVisibleListItem = 1
+
+ callServer(undefined, 'ListWorkspaces', onResponse)
+
+ function onResponse(err, text) {
+ if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
+ if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> Could not load the list of your workspaces from the backend. ') }
+ return
+ }
+
+ let workspacelist = JSON.parse(text)
+ thisObject.listItems = []
+ for (let i = 0; i < workspacelist.length; i++) {
+ let workspace = workspacelist[i].replace('.json', '')
+ let listItem = newListItem()
+ listItem.initialize(workspace, 'Workspace')
+ listItem.container.connectToParent(thisObject.container, false, false)
+
+ thisObject.listItems.push(listItem)
+ }
+ calculateVisbleListItems()
+ isInitialized = true
+ thisObject.isVisible = true
+ }
+ }
+
+ function turnOff() {
+ thisObject.isVisible = false
+ }
+
+ function onMouseWheel(event) {
+ delta = event.wheelDelta
+ if (delta > 0) {
+ delta = -1
+ } else {
+ delta = 1
+ }
+
+ firstVisibleListItem = firstVisibleListItem + delta
+
+ calculateVisbleListItems()
+ }
+
+ function calculateVisbleListItems() {
+ let availableSlots = Math.trunc(posibleVisibleListItems)
+
+ if (firstVisibleListItem < 1) { firstVisibleListItem = 1 }
+ if (firstVisibleListItem > (thisObject.listItems.length - availableSlots + 1)) { firstVisibleListItem = thisObject.listItems.length - availableSlots + 1 }
+
+ visibleListItems = []
+
+ for (let i = 0; i < thisObject.listItems.length; i++) {
+ if (i + 1 >= firstVisibleListItem && i + 1 < firstVisibleListItem + availableSlots) {
+ let listItem = thisObject.listItems[i]
+
+ listItem.container.frame.position.x = 0
+ listItem.container.frame.position.y = (listItemHeight + itemSeparation) * visibleListItems.length + headerHeight
+
+ /* Add to Visible Product Array */
+ visibleListItems.push(listItem)
+ }
+ }
+ }
+
+ function getContainer(point, purpose) {
+ if (isInitialized === false || thisObject.isVisible === false) { return }
+ let container
+
+ /* First we check if thisObject point is inside thisObject space. */
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ /* Now we see which is the inner most container that has it */
+ for (let i = 0; i < visibleListItems.length; i++) {
+ container = visibleListItems[i].getContainer(point)
+
+ if (container !== undefined) {
+ if (container.isForThisPurpose(purpose) === true) {
+ return container
+ }
+ }
+ }
+
+ return thisObject.container
+ }
+ }
+
+ function childrenPhysics() {
+ for (let i = 0; i < thisObject.listItems.length; i++) {
+ let listItem = thisObject.listItems[i]
+ listItem.physics()
+ }
+ }
+
+ function physics() {
+ if (isInitialized === false || thisObject.isVisible === false) { return }
+ if (isInitialized === false) { return }
+ if (thisObject.isVisible === false) { return }
+ childrenPhysics()
+ }
+
+ function draw() {
+ if (isInitialized === false || thisObject.isVisible === false) { return }
+
+ drawBackground()
+ drawChildren()
+ drawScrollBar()
+ }
+
+ function drawChildren() {
+ for (let i = 0; i < visibleListItems.length; i++) {
+ let listItem = visibleListItems[i]
+ if (listItem !== undefined) {
+ listItem.draw()
+ }
+ }
+ }
+
+ function drawBackground() {
+ let label = 'Your Workspaces'
+
+ let backgroundColor = UI_COLOR.WHITE
+ let params = {
+ cornerRadius: 5,
+ lineWidth: 1,
+ container: thisObject.container,
+ borderColor: UI_COLOR.RUSTED_RED,
+ castShadow: false,
+ backgroundColor: backgroundColor,
+ opacity: 1
+ }
+
+ roundedCornersBackground(params)
+
+ drawLabel(label, 1 / 2, 0, 0, 25, 15, thisObject.container, UI_COLOR.BLACK)
+ }
+
+ function drawScrollBar() {
+ if (thisObject.listItems.length > posibleVisibleListItems && posibleVisibleListItems > 0) {
+ let xOffset = 4
+ let barTopPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: headerHeight
+ }
+ let barBottomPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: thisObject.container.frame.height - footerHeight
+ }
+ let ratio = (posibleVisibleListItems * listItemHeight + (posibleVisibleListItems - 1) * itemSeparation) / (thisObject.listItems.length * listItemHeight + (thisObject.listItems.length - 1) * itemSeparation)
+ let handleHeight = posibleVisibleListItems * (listItemHeight * ratio) + (posibleVisibleListItems - 1) * itemSeparation * ratio
+ let handleTopPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: headerHeight + (listItemHeight * ratio * (firstVisibleListItem - 1) + itemSeparation * ratio * (firstVisibleListItem - 1))
+ }
+ let handleBottomPoint = {
+ x: thisObject.container.frame.width - xOffset,
+ y: handleTopPoint.y + handleHeight
+ }
+ barTopPoint = thisObject.container.frame.frameThisPoint(barTopPoint)
+ barBottomPoint = thisObject.container.frame.frameThisPoint(barBottomPoint)
+ handleTopPoint = thisObject.container.frame.frameThisPoint(handleTopPoint)
+ handleBottomPoint = thisObject.container.frame.frameThisPoint(handleBottomPoint)
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(barTopPoint.x, barTopPoint.y)
+ browserCanvasContext.lineTo(barBottomPoint.x, barBottomPoint.y)
+ browserCanvasContext.closePath()
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + 1 + ')'
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(handleTopPoint.x, handleTopPoint.y)
+ browserCanvasContext.lineTo(handleBottomPoint.x, handleBottomPoint.y)
+ browserCanvasContext.closePath()
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.lineWidth = 4
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', ' + 1 + ')'
+ browserCanvasContext.stroke()
+ }
}
- }
}
diff --git a/CanvasApp/SideSpace/SidePanelTab.js b/CanvasApp/SideSpace/SidePanelTab.js
index 1934b2337..2d1a2c161 100644
--- a/CanvasApp/SideSpace/SidePanelTab.js
+++ b/CanvasApp/SideSpace/SidePanelTab.js
@@ -1,237 +1,237 @@
-function newSidePanelTab () {
- const MODULE_NAME = 'Side Panel Tab'
- let thisObject = {
- pointerDirection: 'left',
- container: undefined,
- resize: resize,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize
- }
-
- const TAB_WIDTH = 25
- const TAB_HEIGHT = 60
-
- let isInitialized = false
- let animation = 'none'
- let ORIGINAL_PARENT_POSITON
- let xOffset = 0
-
- thisObject.container = newContainer()
- thisObject.container.name = MODULE_NAME
- thisObject.container.initialize()
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
-
- return thisObject
-
- function initialize () {
- thisObject.container.frame.width = TAB_WIDTH
- thisObject.container.frame.height = TAB_HEIGHT
-
- ORIGINAL_PARENT_POSITON = thisObject.container.parentContainer.frame.position.x
-
- thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
- resize()
- isInitialized = true
- }
-
- function resize () {
- thisObject.container.frame.position.x = 0 + thisObject.container.parentContainer.frame.width
- thisObject.container.frame.position.y = 69
- setClosed()
- }
-
- function onMouseClick (event) {
- if (thisObject.pointerDirection === 'left') {
- animation = 'opening'
- thisObject.container.eventHandler.raiseEvent('opening')
- } else {
- animation = 'closing'
- thisObject.container.eventHandler.raiseEvent('closing')
- }
- }
-
- function getContainer (point) {
- let container
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
-
- function physics () {
- if (isInitialized === false) { return }
- animate()
- }
-
- function draw () {
- if (isInitialized === false) { return }
- borders()
- arrow()
- }
-
- function animate () {
- const STEP = 50
-
- if (animation === 'opening') {
- xOffset = xOffset + STEP
- thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON + xOffset
- if (xOffset >= thisObject.container.parentContainer.frame.width) {
- setOpened()
- thisObject.container.eventHandler.raiseEvent('opened')
- }
+function newSidePanelTab() {
+ const MODULE_NAME = 'Side Panel Tab'
+ let thisObject = {
+ pointerDirection: 'left',
+ container: undefined,
+ resize: resize,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize
}
- if (animation === 'closing') {
- xOffset = xOffset - STEP
- thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON + xOffset
- if (xOffset <= 0) {
+ const TAB_WIDTH = 25
+ const TAB_HEIGHT = 60
+
+ let isInitialized = false
+ let animation = 'none'
+ let ORIGINAL_PARENT_POSITON
+ let xOffset = 0
+
+ thisObject.container = newContainer()
+ thisObject.container.name = MODULE_NAME
+ thisObject.container.initialize()
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+
+ return thisObject
+
+ function initialize() {
+ thisObject.container.frame.width = TAB_WIDTH
+ thisObject.container.frame.height = TAB_HEIGHT
+
+ ORIGINAL_PARENT_POSITON = thisObject.container.parentContainer.frame.position.x
+
+ thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ resize()
+ isInitialized = true
+ }
+
+ function resize() {
+ thisObject.container.frame.position.x = 0 + thisObject.container.parentContainer.frame.width
+ thisObject.container.frame.position.y = 69
setClosed()
- thisObject.container.eventHandler.raiseEvent('closed')
- }
- }
- }
-
- function setOpened () {
- animation = 'none'
- xOffset = thisObject.container.parentContainer.frame.width
- thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON + xOffset
- thisObject.container.parentContainer.status = 'visible'
- thisObject.pointerDirection = 'right'
- }
- function setClosed () {
- animation = 'none'
- xOffset = 0
- thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON
- thisObject.container.parentContainer.status = 'hidden'
- thisObject.pointerDirection = 'left'
- }
-
- function arrow () {
- let point1
- let point2
- let point3
-
- if (thisObject.pointerDirection === 'left') {
- point1 = {
- x: TAB_WIDTH * 3.5 / 10,
- y: TAB_HEIGHT * 12.5 / 30
- }
-
- point2 = {
- x: TAB_WIDTH * 6.5 / 10,
- y: TAB_HEIGHT * 15 / 30
- }
-
- point3 = {
- x: TAB_WIDTH * 3.5 / 10,
- y: TAB_HEIGHT * 17.5 / 30
- }
- } else {
- point1 = {
- x: TAB_WIDTH * 6.5 / 10,
- y: TAB_HEIGHT * 12.5 / 30
- }
-
- point2 = {
- x: TAB_WIDTH * 3.5 / 10,
- y: TAB_HEIGHT * 15 / 30
- }
-
- point3 = {
- x: TAB_WIDTH * 6.5 / 10,
- y: TAB_HEIGHT * 17.5 / 30
- }
}
- point1 = thisObject.container.frame.frameThisPoint(point1)
- point2 = thisObject.container.frame.frameThisPoint(point2)
- point3 = thisObject.container.frame.frameThisPoint(point3)
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.closePath()
-
- let opacity = 1
-
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.GREY + ', ' + opacity + ''
- browserCanvasContext.fill()
- }
-
- function borders () {
- let point1
- let point2
- let point3
- let point4
-
- point1 = {
- x: 0,
- y: 0
+ function onMouseClick(event) {
+ if (thisObject.pointerDirection === 'left') {
+ animation = 'opening'
+ thisObject.container.eventHandler.raiseEvent('opening')
+ } else {
+ animation = 'closing'
+ thisObject.container.eventHandler.raiseEvent('closing')
+ }
}
- point2 = {
- x: TAB_WIDTH,
- y: 0
+ function getContainer(point) {
+ let container
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
}
- point3 = {
- x: TAB_WIDTH,
- y: TAB_HEIGHT
+ function physics() {
+ if (isInitialized === false) { return }
+ animate()
}
- point4 = {
- x: 0,
- y: TAB_HEIGHT
+ function draw() {
+ if (isInitialized === false) { return }
+ borders()
+ arrow()
}
- point1 = thisObject.container.frame.frameThisPoint(point1)
- point2 = thisObject.container.frame.frameThisPoint(point2)
- point3 = thisObject.container.frame.frameThisPoint(point3)
- point4 = thisObject.container.frame.frameThisPoint(point4)
+ function animate() {
+ const STEP = 50
- let opacity
+ if (animation === 'opening') {
+ xOffset = xOffset + STEP
+ thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON + xOffset
+ if (xOffset >= thisObject.container.parentContainer.frame.width) {
+ setOpened()
+ thisObject.container.eventHandler.raiseEvent('opened')
+ }
+ }
- /* Shadow */
-
- for (let i = 0; i <= 5; i++) {
- opacity = 1 - (i / 100) - 0.93
-
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x + i, point1.y + i)
- browserCanvasContext.lineTo(point2.x + i, point2.y + i)
- browserCanvasContext.lineTo(point3.x + i, point3.y + i)
- browserCanvasContext.lineTo(point4.x + i, point4.y + i)
- browserCanvasContext.lineTo(point1.x + i, point1.y + i)
- browserCanvasContext.closePath()
-
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + opacity + ''
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.stroke()
+ if (animation === 'closing') {
+ xOffset = xOffset - STEP
+ thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON + xOffset
+ if (xOffset <= 0) {
+ setClosed()
+ thisObject.container.eventHandler.raiseEvent('closed')
+ }
+ }
}
- /* Background and Border */
+ function setOpened() {
+ animation = 'none'
+ xOffset = thisObject.container.parentContainer.frame.width
+ thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON + xOffset
+ thisObject.container.parentContainer.status = 'visible'
+ thisObject.pointerDirection = 'right'
+ }
+ function setClosed() {
+ animation = 'none'
+ xOffset = 0
+ thisObject.container.parentContainer.frame.position.x = ORIGINAL_PARENT_POSITON
+ thisObject.container.parentContainer.status = 'hidden'
+ thisObject.pointerDirection = 'left'
+ }
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.lineTo(point4.x, point4.y)
- browserCanvasContext.lineTo(point1.x, point1.y)
- browserCanvasContext.closePath()
+ function arrow() {
+ let point1
+ let point2
+ let point3
- opacity = 1
+ if (thisObject.pointerDirection === 'left') {
+ point1 = {
+ x: TAB_WIDTH * 3.5 / 10,
+ y: TAB_HEIGHT * 12.5 / 30
+ }
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ''
- browserCanvasContext.fill()
+ point2 = {
+ x: TAB_WIDTH * 6.5 / 10,
+ y: TAB_HEIGHT * 15 / 30
+ }
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + opacity + ''
- browserCanvasContext.lineWidth = 0.3
- browserCanvasContext.stroke()
- }
+ point3 = {
+ x: TAB_WIDTH * 3.5 / 10,
+ y: TAB_HEIGHT * 17.5 / 30
+ }
+ } else {
+ point1 = {
+ x: TAB_WIDTH * 6.5 / 10,
+ y: TAB_HEIGHT * 12.5 / 30
+ }
+
+ point2 = {
+ x: TAB_WIDTH * 3.5 / 10,
+ y: TAB_HEIGHT * 15 / 30
+ }
+
+ point3 = {
+ x: TAB_WIDTH * 6.5 / 10,
+ y: TAB_HEIGHT * 17.5 / 30
+ }
+ }
+
+ point1 = thisObject.container.frame.frameThisPoint(point1)
+ point2 = thisObject.container.frame.frameThisPoint(point2)
+ point3 = thisObject.container.frame.frameThisPoint(point3)
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.closePath()
+
+ let opacity = 1
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.GREY + ', ' + opacity + ''
+ browserCanvasContext.fill()
+ }
+
+ function borders() {
+ let point1
+ let point2
+ let point3
+ let point4
+
+ point1 = {
+ x: 0,
+ y: 0
+ }
+
+ point2 = {
+ x: TAB_WIDTH,
+ y: 0
+ }
+
+ point3 = {
+ x: TAB_WIDTH,
+ y: TAB_HEIGHT
+ }
+
+ point4 = {
+ x: 0,
+ y: TAB_HEIGHT
+ }
+
+ point1 = thisObject.container.frame.frameThisPoint(point1)
+ point2 = thisObject.container.frame.frameThisPoint(point2)
+ point3 = thisObject.container.frame.frameThisPoint(point3)
+ point4 = thisObject.container.frame.frameThisPoint(point4)
+
+ let opacity
+
+ /* Shadow */
+
+ for (let i = 0; i <= 5; i++) {
+ opacity = 1 - (i / 100) - 0.93
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point1.x + i, point1.y + i)
+ browserCanvasContext.lineTo(point2.x + i, point2.y + i)
+ browserCanvasContext.lineTo(point3.x + i, point3.y + i)
+ browserCanvasContext.lineTo(point4.x + i, point4.y + i)
+ browserCanvasContext.lineTo(point1.x + i, point1.y + i)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + opacity + ''
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.stroke()
+ }
+
+ /* Background and Border */
+
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.lineTo(point4.x, point4.y)
+ browserCanvasContext.lineTo(point1.x, point1.y)
+ browserCanvasContext.closePath()
+
+ opacity = 1
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ''
+ browserCanvasContext.fill()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + opacity + ''
+ browserCanvasContext.lineWidth = 0.3
+ browserCanvasContext.stroke()
+ }
}
diff --git a/CanvasApp/Spaces/ChartingSpace.js b/CanvasApp/Spaces/ChartingSpace.js
index afbca8ce9..f42e0c77c 100644
--- a/CanvasApp/Spaces/ChartingSpace.js
+++ b/CanvasApp/Spaces/ChartingSpace.js
@@ -6,441 +6,441 @@ changes, then all charts in it are replotted with the corresponging data.
*/
-function newChartingSpace () {
- const MODULE_NAME = 'Charting Space'
- const ERROR_LOG = true
- const logger = newWebDebugLog()
- logger.fileName = MODULE_NAME
+function newChartingSpace() {
+ const MODULE_NAME = 'Charting Space'
+ const ERROR_LOG = true
+ const logger = newWebDebugLog()
+ logger.fileName = MODULE_NAME
- let thisObject = {
- visible: false,
- container: undefined,
- inViewport: undefined,
- timeMachines: undefined,
- viewport: undefined,
- payload: undefined,
- onKeyPressed: onKeyPressed,
- reset: reset,
- oneScreenUp: oneScreenUp,
- oneScreenDown: oneScreenDown,
- oneScreenLeft: oneScreenLeft,
- oneScreenRight: oneScreenRight,
- fitFunction: fitFunction,
- isThisPointVisible: isThisPointVisible,
- physics: physics,
- draw: draw,
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize,
- finalize: finalize
- }
+ let thisObject = {
+ visible: false,
+ container: undefined,
+ inViewport: undefined,
+ timeMachines: undefined,
+ viewport: undefined,
+ payload: undefined,
+ onKeyPressed: onKeyPressed,
+ reset: reset,
+ oneScreenUp: oneScreenUp,
+ oneScreenDown: oneScreenDown,
+ oneScreenLeft: oneScreenLeft,
+ oneScreenRight: oneScreenRight,
+ fitFunction: fitFunction,
+ isThisPointVisible: isThisPointVisible,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize,
+ finalize: finalize
+ }
- let canvasBrowserResizedEventSubscriptionId
- let timeMachinesMap
- let syncWithDesignerLoop
+ let canvasBrowserResizedEventSubscriptionId
+ let timeMachinesMap
+ let syncWithDesignerLoop
- const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
+ const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
- initialSetup()
-
- let isInitialized = false
-
- return thisObject
-
- function reset () {
- finalize()
initialSetup()
- isInitialized = false
- initialize()
- }
- function initialSetup () {
- thisObject.timeMachines = []
- thisObject.visible = true
- timeMachinesMap = new Map()
- syncWithDesignerLoop = 0
- thisObject.inViewport = new Map()
+ let isInitialized = false
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
+ return thisObject
- thisObject.container.isDraggeable = false
- thisObject.container.isWheelable = false
- }
-
- function finalize () {
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- let timeMachine = thisObject.timeMachines[i]
- timeMachine.finalize()
+ function reset() {
+ finalize()
+ initialSetup()
+ isInitialized = false
+ initialize()
}
- thisObject.inViewport = undefined
- thisObject.timeMachines = undefined
- timeMachinesMap = undefined
+ function initialSetup() {
+ thisObject.timeMachines = []
+ thisObject.visible = true
+ timeMachinesMap = new Map()
+ syncWithDesignerLoop = 0
+ thisObject.inViewport = new Map()
- thisObject.container.eventHandler.stopListening(canvasBrowserResizedEventSubscriptionId)
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
- thisObject.container.finalize()
- thisObject.container = undefined
-
- if (thisObject.viewport !== undefined) {
- thisObject.viewport.finalize()
- thisObject.viewport = undefined
+ thisObject.container.isDraggeable = false
+ thisObject.container.isWheelable = false
}
- thisObject.payload = undefined
- }
-
- function initialize () {
- if (isInitialized === true) { return }
- if (canvas.designSpace === undefined) { return }
- if (canvas.designSpace.workspace === undefined) { return }
-
- let rootNodes = canvas.designSpace.workspace.workspaceNode.rootNodes
- for (let i = 0; i < rootNodes.length; i++) {
- let rootNode = rootNodes[i]
- if (rootNode !== null) {
- if (rootNode.type === 'Charting Space') {
- thisObject.payload = rootNode.payload
+ function finalize() {
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ let timeMachine = thisObject.timeMachines[i]
+ timeMachine.finalize()
}
- }
+
+ thisObject.inViewport = undefined
+ thisObject.timeMachines = undefined
+ timeMachinesMap = undefined
+
+ thisObject.container.eventHandler.stopListening(canvasBrowserResizedEventSubscriptionId)
+
+ thisObject.container.finalize()
+ thisObject.container = undefined
+
+ if (thisObject.viewport !== undefined) {
+ thisObject.viewport.finalize()
+ thisObject.viewport = undefined
+ }
+
+ thisObject.payload = undefined
}
- if (thisObject.payload === undefined) {
- // if (ERROR_LOG === true) { logger.write('[WARN] initialize -> There must exist a Charting Space at the Design Space in order to enable Charts. PLease create one and refreash your browser. ') }
- return
- }
+ function initialize() {
+ if (isInitialized === true) { return }
+ if (canvas.designSpace === undefined) { return }
+ if (canvas.designSpace.workspace === undefined) { return }
- thisObject.viewport = newViewport()
- if (thisObject.payload.node.viewport === undefined) {
- if (ERROR_LOG === true) { logger.write('[WARN] initialize -> There must exist a Viewport node attached to the Charting Space node in order for the Viewport save its properties. ') }
- return
- } else {
- thisObject.viewport.payload = thisObject.payload.node.viewport.payload
- }
+ let rootNodes = canvas.designSpace.workspace.workspaceNode.rootNodes
+ for (let i = 0; i < rootNodes.length; i++) {
+ let rootNode = rootNodes[i]
+ if (rootNode !== null) {
+ if (rootNode.type === 'Charting Space') {
+ thisObject.payload = rootNode.payload
+ }
+ }
+ }
- thisObject.viewport.initialize()
+ if (thisObject.payload === undefined) {
+ // if (ERROR_LOG === true) { logger.write('[WARN] initialize -> There must exist a Charting Space at the Design Space in order to enable Charts. PLease create one and refreash your browser. ') }
+ return
+ }
- canvasBrowserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize)
-
- isInitialized = true
- }
-
- function getContainer (point, purpose) {
- if (thisObject.visible !== true) { return }
- if (thisObject.viewport === undefined) { return }
- if (thisObject.viewport.isThisPointInViewport(point) === false) { return }
-
- let container
-
- /* This first step is not actually to get the container but to allow things to be turned off in case there is a switch of focus from one time machine to another */
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- container = thisObject.timeMachines[i].container
- if (purpose === GET_CONTAINER_PURPOSE.MOUSE_OVER) {
- container.eventHandler.raiseEvent('onMouseNotOver')
- }
- }
-
- /*
- Now we see which is the inner most container that has it.
- In this case we will ask all the time machines even if one of them already returned a matching container.
- This will help the others know they are not on ofcus
- */
- let containerFound
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- container = thisObject.timeMachines[i].getContainer(point, purpose)
- if (container !== undefined) {
- if (purpose !== undefined) {
- if (containerFound === undefined) {
- containerFound = container
- }
+ thisObject.viewport = newViewport()
+ if (thisObject.payload.node.viewport === undefined) {
+ if (ERROR_LOG === true) { logger.write('[WARN] initialize -> There must exist a Viewport node attached to the Charting Space node in order for the Viewport save its properties. ') }
+ return
} else {
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- if (containerFound === undefined) {
- containerFound = container
- }
- }
+ thisObject.viewport.payload = thisObject.payload.node.viewport.payload
}
- }
- }
- if (containerFound !== undefined) {
- containerFound.space = 'Charting Space'
- return containerFound
+
+ thisObject.viewport.initialize()
+
+ canvasBrowserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize)
+
+ isInitialized = true
}
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- thisObject.container.space = 'Charting Space'
- return thisObject.container
- } else {
- return undefined
- }
- }
+ function getContainer(point, purpose) {
+ if (thisObject.visible !== true) { return }
+ if (thisObject.viewport === undefined) { return }
+ if (thisObject.viewport.isThisPointInViewport(point) === false) { return }
- function resize () {
- thisObject.viewport.resize()
- thisObject.container.frame.width = browserCanvas.width
- thisObject.container.frame.height = COCKPIT_SPACE_POSITION
- }
+ let container
- function oneScreenUp () {
- if (thisObject.visible === false) { return }
- let displaceVector = {
- x: 0,
- y: browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
- }
-
- canvas.chartingSpace.viewport.displace(displaceVector)
- }
-
- function oneScreenDown () {
- if (thisObject.visible === false) { return }
- let displaceVector = {
- x: 0,
- y: -browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
- }
-
- canvas.chartingSpace.viewport.displace(displaceVector)
- }
-
- function oneScreenLeft () {
- if (thisObject.visible === false) { return }
- let displaceVector = {
- x: browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
- y: 0
- }
-
- canvas.chartingSpace.viewport.displace(displaceVector, true)
- }
-
- function oneScreenRight () {
- if (thisObject.visible === false) { return }
- let displaceVector = {
- x: -browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
- y: 0
- }
-
- canvas.chartingSpace.viewport.displace(displaceVector, true)
- }
-
- function fitFunction (point, fullVisible) {
- /* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */
-
- let returnPoint = {
- x: point.x,
- y: point.y
- }
-
- if (point.x > browserCanvas.width) {
- returnPoint.x = browserCanvas.width
- }
-
- if (point.x < 0) {
- returnPoint.x = 0
- }
-
- if (fullVisible === true) {
- if (point.y > COCKPIT_SPACE_POSITION) {
- returnPoint.y = COCKPIT_SPACE_POSITION
- }
- } else {
- if (point.y > COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT / 2) {
- returnPoint.y = COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT / 2
- }
- }
-
- if (point.y < TOP_SPACE_HEIGHT) {
- returnPoint.y = TOP_SPACE_HEIGHT
- }
-
- return returnPoint
- }
-
- function isThisPointVisible (point) {
- if (point.x > browserCanvas.width) {
- return false
- }
-
- if (point.x < 0) {
- return false
- }
-
- if (point.y > COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT / 2) {
- return false
- }
-
- if (point.y < 0) {
- return false
- }
-
- return true
- }
-
- function physics () {
- initialize()
- thisObjectPhysics()
- if (thisObject.visible !== true) { return }
- if (thisObject.viewport !== undefined) {
- thisObject.viewport.physics()
- }
- childrenPhysics()
- syncWithDesigner()
- }
-
- function onKeyPressed (event) {
- if (thisObject.visible !== true) { return }
- for (let j = 0; j < thisObject.timeMachines.length; j++) {
- let timeMachine = thisObject.timeMachines[j]
- if (timeMachine.onFocus === true) {
- timeMachine.onKeyPressed(event)
- }
- }
- }
-
- function syncWithDesigner () {
- if (thisObject.payload === undefined) { return }
- if (thisObject.payload.node === undefined) { return }
- syncWithDesignerLoop = syncWithDesignerLoop + 0.00000000001
-
- if (thisObject.payload.node.dashboards !== undefined) {
- for (let i = 0; i < thisObject.payload.node.dashboards.length; i++) {
- let dashboard = thisObject.payload.node.dashboards[i]
- if (dashboard.timeMachines !== undefined) {
- for (let j = 0; j < dashboard.timeMachines.length; j++) {
- let node = dashboard.timeMachines[j]
- let timeMachine = timeMachinesMap.get(node.id)
- if (timeMachine === undefined) {
- /* The time machine node is new, thus we need to initialize a new timeMachine */
- initializeTimeMachine(node, syncWithDesignerLoop)
- } else {
- /* The time machine already exists, we tag it as existing at the current loop. */
- timeMachine.syncWithDesignerLoop = syncWithDesignerLoop
+ /* This first step is not actually to get the container but to allow things to be turned off in case there is a switch of focus from one time machine to another */
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ container = thisObject.timeMachines[i].container
+ if (purpose === GET_CONTAINER_PURPOSE.MOUSE_OVER) {
+ container.eventHandler.raiseEvent('onMouseNotOver')
}
- }
}
- }
+
+ /*
+ Now we see which is the inner most container that has it.
+ In this case we will ask all the time machines even if one of them already returned a matching container.
+ This will help the others know they are not on ofcus
+ */
+ let containerFound
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ container = thisObject.timeMachines[i].getContainer(point, purpose)
+ if (container !== undefined) {
+ if (purpose !== undefined) {
+ if (containerFound === undefined) {
+ containerFound = container
+ }
+ } else {
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ if (containerFound === undefined) {
+ containerFound = container
+ }
+ }
+ }
+ }
+ }
+ if (containerFound !== undefined) {
+ containerFound.space = 'Charting Space'
+ return containerFound
+ }
+
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ thisObject.container.space = 'Charting Space'
+ return thisObject.container
+ } else {
+ return undefined
+ }
}
- /* We check all the timeMachines we have to see if we need to remove any of them */
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- let timeMachine = thisObject.timeMachines[i]
- if (timeMachine.syncWithDesignerLoop < syncWithDesignerLoop) {
- /* Must be removed */
- timeMachine.finalize()
- timeMachinesMap.delete(timeMachine.nodeId)
- thisObject.timeMachines.splice(i, 1)
- /* We remove one at the time */
- return
- }
+ function resize() {
+ thisObject.viewport.resize()
+ thisObject.container.frame.width = browserCanvas.width
+ thisObject.container.frame.height = COCKPIT_SPACE_POSITION
}
- function initializeTimeMachine (node, syncWithDesignerLoop) {
- if (node.payload === undefined) { return } // not ready to consider this Time Machine
- if (node.payload.uiObject === undefined) { return }
+ function oneScreenUp() {
+ if (thisObject.visible === false) { return }
+ let displaceVector = {
+ x: 0,
+ y: browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
+ }
- let timeMachine = newTimeMachine()
- timeMachine.syncWithDesignerLoop = syncWithDesignerLoop
- timeMachine.payload = node.payload
- timeMachine.nodeId = node.id
+ canvas.chartingSpace.viewport.displace(displaceVector)
+ }
- timeMachinesMap.set(node.id, timeMachine)
- timeMachine.payload.uiObject.setValue('Loading...')
+ function oneScreenDown() {
+ if (thisObject.visible === false) { return }
+ let displaceVector = {
+ x: 0,
+ y: -browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
+ }
- /* Setting up the new time machine. */
- timeMachine.container.frame.position.x = browserCanvas.width / 2 - browserCanvas.width / TIME_MACHINE_WIDTH / 2
- timeMachine.container.frame.position.y = browserCanvas.height / 2 - (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT / 2
- timeMachine.initialize(onTimeMachineInitialized)
+ canvas.chartingSpace.viewport.displace(displaceVector)
+ }
+
+ function oneScreenLeft() {
+ if (thisObject.visible === false) { return }
+ let displaceVector = {
+ x: browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
+ y: 0
+ }
+
+ canvas.chartingSpace.viewport.displace(displaceVector, true)
+ }
+
+ function oneScreenRight() {
+ if (thisObject.visible === false) { return }
+ let displaceVector = {
+ x: -browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
+ y: 0
+ }
+
+ canvas.chartingSpace.viewport.displace(displaceVector, true)
+ }
+
+ function fitFunction(point, fullVisible) {
+ /* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */
+
+ let returnPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ if (point.x > browserCanvas.width) {
+ returnPoint.x = browserCanvas.width
+ }
+
+ if (point.x < 0) {
+ returnPoint.x = 0
+ }
+
+ if (fullVisible === true) {
+ if (point.y > COCKPIT_SPACE_POSITION) {
+ returnPoint.y = COCKPIT_SPACE_POSITION
+ }
+ } else {
+ if (point.y > COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT / 2) {
+ returnPoint.y = COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT / 2
+ }
+ }
+
+ if (point.y < TOP_SPACE_HEIGHT) {
+ returnPoint.y = TOP_SPACE_HEIGHT
+ }
+
+ return returnPoint
+ }
+
+ function isThisPointVisible(point) {
+ if (point.x > browserCanvas.width) {
+ return false
+ }
+
+ if (point.x < 0) {
+ return false
+ }
+
+ if (point.y > COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT / 2) {
+ return false
+ }
+
+ if (point.y < 0) {
+ return false
+ }
+
+ return true
+ }
+
+ function physics() {
+ initialize()
+ thisObjectPhysics()
+ if (thisObject.visible !== true) { return }
+ if (thisObject.viewport !== undefined) {
+ thisObject.viewport.physics()
+ }
+ childrenPhysics()
+ syncWithDesigner()
+ }
+
+ function onKeyPressed(event) {
+ if (thisObject.visible !== true) { return }
+ for (let j = 0; j < thisObject.timeMachines.length; j++) {
+ let timeMachine = thisObject.timeMachines[j]
+ if (timeMachine.onFocus === true) {
+ timeMachine.onKeyPressed(event)
+ }
+ }
+ }
+
+ function syncWithDesigner() {
+ if (thisObject.payload === undefined) { return }
+ if (thisObject.payload.node === undefined) { return }
+ syncWithDesignerLoop = syncWithDesignerLoop + 0.00000000001
+
+ if (thisObject.payload.node.dashboards !== undefined) {
+ for (let i = 0; i < thisObject.payload.node.dashboards.length; i++) {
+ let dashboard = thisObject.payload.node.dashboards[i]
+ if (dashboard.timeMachines !== undefined) {
+ for (let j = 0; j < dashboard.timeMachines.length; j++) {
+ let node = dashboard.timeMachines[j]
+ let timeMachine = timeMachinesMap.get(node.id)
+ if (timeMachine === undefined) {
+ /* The time machine node is new, thus we need to initialize a new timeMachine */
+ initializeTimeMachine(node, syncWithDesignerLoop)
+ } else {
+ /* The time machine already exists, we tag it as existing at the current loop. */
+ timeMachine.syncWithDesignerLoop = syncWithDesignerLoop
+ }
+ }
+ }
+ }
+ }
+
+ /* We check all the timeMachines we have to see if we need to remove any of them */
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ let timeMachine = thisObject.timeMachines[i]
+ if (timeMachine.syncWithDesignerLoop < syncWithDesignerLoop) {
+ /* Must be removed */
+ timeMachine.finalize()
+ timeMachinesMap.delete(timeMachine.nodeId)
+ thisObject.timeMachines.splice(i, 1)
+ /* We remove one at the time */
+ return
+ }
+ }
+
+ function initializeTimeMachine(node, syncWithDesignerLoop) {
+ if (node.payload === undefined) { return } // not ready to consider this Time Machine
+ if (node.payload.uiObject === undefined) { return }
+
+ let timeMachine = newTimeMachine()
+ timeMachine.syncWithDesignerLoop = syncWithDesignerLoop
+ timeMachine.payload = node.payload
+ timeMachine.nodeId = node.id
+
+ timeMachinesMap.set(node.id, timeMachine)
+ timeMachine.payload.uiObject.setValue('Loading...')
+
+ /* Setting up the new time machine. */
+ timeMachine.container.frame.position.x = browserCanvas.width / 2 - browserCanvas.width / TIME_MACHINE_WIDTH / 2
+ timeMachine.container.frame.position.y = browserCanvas.height / 2 - (browserCanvas.height - TOP_SPACE_HEIGHT - COCKPIT_SPACE_HEIGHT) / TIME_MACHINE_HEIGHT / 2
+ timeMachine.initialize(onTimeMachineInitialized)
+
+ function onTimeMachineInitialized() {
+ thisObject.timeMachines.push(timeMachine)
+ timeMachine.payload.uiObject.setValue('')
+ if (canvas.chartingSpace.viewport !== undefined) {
+ canvas.chartingSpace.viewport.raiseEvents() // These events will impacts on objects just initialized.
+ }
+ }
+ }
+ }
+
+ function thisObjectPhysics() {
+ thisObject.container.frame.height = COCKPIT_SPACE_POSITION
+
+ 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
+ }
+ }
- function onTimeMachineInitialized () {
- thisObject.timeMachines.push(timeMachine)
- timeMachine.payload.uiObject.setValue('')
if (canvas.chartingSpace.viewport !== undefined) {
- canvas.chartingSpace.viewport.raiseEvents() // These events will impacts on objects just initialized.
+ canvas.chartingSpace.viewport.resize()
}
- }
- }
- }
-
- function thisObjectPhysics () {
- thisObject.container.frame.height = COCKPIT_SPACE_POSITION
-
- 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) {
- canvas.chartingSpace.viewport.resize()
- }
- }
+ function childrenPhysics() {
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ let timeMachine = thisObject.timeMachines[i]
+ if (timeMachine.payload.node === undefined) {
+ continue
+ }
- function childrenPhysics () {
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- let timeMachine = thisObject.timeMachines[i]
- if (timeMachine.payload.node === undefined) {
- continue
- }
-
- if (timeMachine.container.frame.isInViewPort()) {
- thisObject.inViewport.set(timeMachine.payload.node.id, timeMachine)
- } else {
- thisObject.inViewport.delete(timeMachine.payload.node.id)
- }
- timeMachine.physics()
- }
- }
-
- function drawBackground () {
- if (thisObject.visible === false) { return }
- drawSpaceBackground()
-
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- let timeMachine = thisObject.timeMachines[thisObject.timeMachines.length - i - 1]
- timeMachine.drawBackground()
- }
- }
-
- function draw () {
- if (canWeDraw === false) { return }
- if (thisObject.visible === false) { return }
- drawBackground()
-
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- let timeMachine = thisObject.timeMachines[thisObject.timeMachines.length - i - 1]
- timeMachine.draw()
+ if (timeMachine.container.frame.isInViewPort()) {
+ thisObject.inViewport.set(timeMachine.payload.node.id, timeMachine)
+ } else {
+ thisObject.inViewport.delete(timeMachine.payload.node.id)
+ }
+ timeMachine.physics()
+ }
}
- drawForeground()
- }
+ function drawBackground() {
+ if (thisObject.visible === false) { return }
+ drawSpaceBackground()
- function drawForeground () {
- for (let i = 0; i < thisObject.timeMachines.length; i++) {
- let timeMachine = thisObject.timeMachines[thisObject.timeMachines.length - i - 1]
- timeMachine.drawForeground()
- }
- }
-
- function drawSpaceBackground () {
- let opacity = '1'
- let fromPoint = {
- x: 0,
- y: 0
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ let timeMachine = thisObject.timeMachines[thisObject.timeMachines.length - i - 1]
+ timeMachine.drawBackground()
+ }
}
- let toPoint = {
- x: browserCanvas.width,
- y: COCKPIT_SPACE_POSITION
+ function draw() {
+ if (canWeDraw === false) { return }
+ if (thisObject.visible === false) { return }
+ drawBackground()
+
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ let timeMachine = thisObject.timeMachines[thisObject.timeMachines.length - i - 1]
+ timeMachine.draw()
+ }
+
+ drawForeground()
}
- browserCanvasContext.beginPath()
- browserCanvasContext.rect(fromPoint.x, fromPoint.y, toPoint.x - fromPoint.x, toPoint.y - fromPoint.y)
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ')'
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
- }
+ function drawForeground() {
+ for (let i = 0; i < thisObject.timeMachines.length; i++) {
+ let timeMachine = thisObject.timeMachines[thisObject.timeMachines.length - i - 1]
+ timeMachine.drawForeground()
+ }
+ }
+
+ function drawSpaceBackground() {
+ let opacity = '1'
+ let fromPoint = {
+ x: 0,
+ y: 0
+ }
+
+ let toPoint = {
+ x: browserCanvas.width,
+ y: COCKPIT_SPACE_POSITION
+ }
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.rect(fromPoint.x, fromPoint.y, toPoint.x - fromPoint.x, toPoint.y - fromPoint.y)
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ')'
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
+ }
}
diff --git a/CanvasApp/Spaces/CockpitSpace.js b/CanvasApp/Spaces/CockpitSpace.js
index af67991f7..efb6c4213 100644
--- a/CanvasApp/Spaces/CockpitSpace.js
+++ b/CanvasApp/Spaces/CockpitSpace.js
@@ -1,370 +1,370 @@
- function newCockpitSpace () {
- const MODULE_NAME = 'CockpitSpace'
- const STATUS_TYPES = {
- ALL_GOOD: 1,
- WARNING: 2
- }
- let thisObject = {
- container: undefined,
- status: 'BOTTOM',
- fullscreen: undefined,
- statusTypes: STATUS_TYPES,
- setStatus: setStatus,
- toTop: toTop,
- toBottom: toBottom,
- toMiddle: toMiddle,
- moveUp: moveUp,
- moveDown: moveDown,
- draw: draw,
- physics: physics,
- getContainer: getContainer,
- finalize: finalize,
- initialize: initialize,
- initializePosition: initializePosition
- }
+function newCockpitSpace() {
+ const MODULE_NAME = 'CockpitSpace'
+ const STATUS_TYPES = {
+ ALL_GOOD: 1,
+ WARNING: 2
+ }
+ let thisObject = {
+ container: undefined,
+ status: 'BOTTOM',
+ fullscreen: undefined,
+ statusTypes: STATUS_TYPES,
+ setStatus: setStatus,
+ toTop: toTop,
+ toBottom: toBottom,
+ toMiddle: toMiddle,
+ moveUp: moveUp,
+ moveDown: moveDown,
+ draw: draw,
+ physics: physics,
+ getContainer: getContainer,
+ finalize: finalize,
+ initialize: initialize,
+ initializePosition: initializePosition
+ }
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = false
- thisObject.container.detectMouseOver = true
- thisObject.container.isDraggeable = true
- thisObject.container.notDraggingOnX = true
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = false
+ thisObject.container.detectMouseOver = true
+ thisObject.container.isDraggeable = true
+ thisObject.container.notDraggingOnX = true
- controlsMap = new Map()
- resize()
+ controlsMap = new Map()
+ resize()
- let selfMouseClickEventSubscriptionId
- let canvasBrowserResizedEventSubscriptionId
+ let selfMouseClickEventSubscriptionId
+ let canvasBrowserResizedEventSubscriptionId
- let statusCounter = 0
- let statusText
- let statusType
- let isInitilized = false
+ let statusCounter = 0
+ let statusText
+ let statusType
+ let isInitilized = false
- return thisObject
+ return thisObject
- function finalize () {
- thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
- thisObject.container.eventHandler.stopListening(canvasBrowserResizedEventSubscriptionId)
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId)
+ thisObject.container.eventHandler.stopListening(canvasBrowserResizedEventSubscriptionId)
- thisObject.container.finalize()
- thisObject.container = undefined
- thisObject.fullscreen = undefined
- }
+ thisObject.container.finalize()
+ thisObject.container = undefined
+ thisObject.fullscreen = undefined
+ }
- function initialize () {
- canvasBrowserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize)
- selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
+ function initialize() {
+ canvasBrowserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize)
+ selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
- thisObject.fullscreen = newFullScreen()
- thisObject.fullscreen.container.connectToParent(thisObject.container)
- thisObject.fullscreen.initialize()
- }
+ thisObject.fullscreen = newFullScreen()
+ thisObject.fullscreen.container.connectToParent(thisObject.container)
+ thisObject.fullscreen.initialize()
+ }
- function initializePosition () {
- thisObject.container.frame.position.x = 0
+ function initializePosition() {
+ thisObject.container.frame.position.x = 0
- let INITIAL_POSITION
- if (canvas.designSpace.workspace.enabled === true) {
- let localStorage = window.localStorage.getItem(MODULE_NAME)
- if (localStorage !== null) {
- storage = JSON.parse(localStorage)
- thisObject.container.frame.position.y = storage.spacePosition
- } else {
- INITIAL_POSITION = 55
- thisObject.container.frame.position.y = browserCanvas.height * INITIAL_POSITION / 100 - COCKPIT_SPACE_HEIGHT
- }
- } else {
- INITIAL_POSITION = 100
- thisObject.container.frame.position.y = browserCanvas.height * INITIAL_POSITION / 100 - COCKPIT_SPACE_HEIGHT
- }
- isInitilized = true
- }
+ let INITIAL_POSITION
+ if (canvas.designSpace.workspace.enabled === true) {
+ let localStorage = window.localStorage.getItem(MODULE_NAME)
+ if (localStorage !== null) {
+ storage = JSON.parse(localStorage)
+ thisObject.container.frame.position.y = storage.spacePosition
+ } else {
+ INITIAL_POSITION = 55
+ thisObject.container.frame.position.y = browserCanvas.height * INITIAL_POSITION / 100 - COCKPIT_SPACE_HEIGHT
+ }
+ } else {
+ INITIAL_POSITION = 100
+ thisObject.container.frame.position.y = browserCanvas.height * INITIAL_POSITION / 100 - COCKPIT_SPACE_HEIGHT
+ }
+ isInitilized = true
+ }
- function onMouseClick (event) {
+ function onMouseClick(event) {
- }
+ }
- function setStatus (text, counter, type) {
- statusCounter = counter
- statusText = text
- statusType = type
- }
+ function setStatus(text, counter, type) {
+ statusCounter = counter
+ statusText = text
+ statusType = type
+ }
- function resize () {
- thisObject.container.frame.width = browserCanvas.width
- thisObject.container.frame.height = COCKPIT_SPACE_HEIGHT
+ function resize() {
+ thisObject.container.frame.width = browserCanvas.width
+ thisObject.container.frame.height = COCKPIT_SPACE_HEIGHT
- switch (thisObject.status) {
- case 'BOTTOM': {
- thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
- break
- }
- case 'TOP': {
- thisObject.container.frame.position.y = TOP_SPACE_HEIGHT
- break
- }
- }
- }
+ switch (thisObject.status) {
+ case 'BOTTOM': {
+ thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
+ break
+ }
+ case 'TOP': {
+ thisObject.container.frame.position.y = TOP_SPACE_HEIGHT
+ break
+ }
+ }
+ }
- function toTop () {
- thisObject.container.frame.position.y = COCKPIT_SPACE_HEIGHT
- }
+ function toTop() {
+ thisObject.container.frame.position.y = COCKPIT_SPACE_HEIGHT
+ }
- function toBottom () {
- thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
- }
+ function toBottom() {
+ thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
+ }
- function toMiddle () {
- thisObject.container.frame.position.y = browserCanvas.height / 2 - COCKPIT_SPACE_HEIGHT
- }
+ function toMiddle() {
+ thisObject.container.frame.position.y = browserCanvas.height / 2 - COCKPIT_SPACE_HEIGHT
+ }
- function moveUp () {
- thisObject.container.frame.position.y = thisObject.container.frame.position.y - COCKPIT_SPACE_HEIGHT * 2
- if (thisObject.container.frame.position.y < 0) {
- thisObject.container.frame.position.y = 0
- }
- }
+ function moveUp() {
+ thisObject.container.frame.position.y = thisObject.container.frame.position.y - COCKPIT_SPACE_HEIGHT * 2
+ if (thisObject.container.frame.position.y < 0) {
+ thisObject.container.frame.position.y = 0
+ }
+ }
- function moveDown () {
- thisObject.container.frame.position.y = thisObject.container.frame.position.y + COCKPIT_SPACE_HEIGHT * 2
- if (thisObject.container.frame.position.y > browserCanvas.height - COCKPIT_SPACE_HEIGHT) {
- thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
- }
- }
+ function moveDown() {
+ thisObject.container.frame.position.y = thisObject.container.frame.position.y + COCKPIT_SPACE_HEIGHT * 2
+ if (thisObject.container.frame.position.y > browserCanvas.height - COCKPIT_SPACE_HEIGHT) {
+ thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
+ }
+ }
- function statusPhysics () {
- statusCounter--
- if (statusCounter < 0) {
- statusCounter = 0
- statusText = undefined,
- statusType = undefined
- }
- }
+ function statusPhysics() {
+ statusCounter--
+ if (statusCounter < 0) {
+ statusCounter = 0
+ statusText = undefined,
+ statusType = undefined
+ }
+ }
- function physics () {
- thisObjectPhysics()
- childrenPhysics()
- statusPhysics()
- }
+ function physics() {
+ thisObjectPhysics()
+ childrenPhysics()
+ statusPhysics()
+ }
- function childrenPhysics () {
- thisObject.fullscreen.physics()
- }
- function thisObjectPhysics () {
- if (isInitilized === false) { return }
- /* Check the limits */
+ function childrenPhysics() {
+ thisObject.fullscreen.physics()
+ }
+ function thisObjectPhysics() {
+ if (isInitilized === false) { return }
+ /* Check the limits */
- thisObject.status = 'MIDDLE'
+ thisObject.status = 'MIDDLE'
- if (canvas.designSpace.workspace.enabled === true) {
- thisObject.container.isDraggeable = true
- } else {
- thisObject.container.isDraggeable = false
- }
+ if (canvas.designSpace.workspace.enabled === true) {
+ thisObject.container.isDraggeable = true
+ } else {
+ thisObject.container.isDraggeable = false
+ }
- if (thisObject.container.frame.position.y > browserCanvas.height * 99.5 / 100 - COCKPIT_SPACE_HEIGHT) {
- thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
- thisObject.status = 'BOTTOM'
- canvas.designSpace.makeInvisible()
- canvas.floatingSpace.makeInvisible()
- } else {
- canvas.designSpace.makeVisible()
- canvas.floatingSpace.makeVisible()
- }
+ if (thisObject.container.frame.position.y > browserCanvas.height * 99.5 / 100 - COCKPIT_SPACE_HEIGHT) {
+ thisObject.container.frame.position.y = browserCanvas.height - COCKPIT_SPACE_HEIGHT
+ thisObject.status = 'BOTTOM'
+ canvas.designSpace.makeInvisible()
+ canvas.floatingSpace.makeInvisible()
+ } else {
+ canvas.designSpace.makeVisible()
+ canvas.floatingSpace.makeVisible()
+ }
- if (thisObject.container.frame.position.y < browserCanvas.height * 0.5 / 100 + TOP_SPACE_HEIGHT) {
- thisObject.container.frame.position.y = TOP_SPACE_HEIGHT
- thisObject.status = 'TOP'
- canvas.panelsSpace.visible = false
- } else {
- canvas.panelsSpace.visible = true
- }
+ if (thisObject.container.frame.position.y < browserCanvas.height * 0.5 / 100 + TOP_SPACE_HEIGHT) {
+ thisObject.container.frame.position.y = TOP_SPACE_HEIGHT
+ thisObject.status = 'TOP'
+ canvas.panelsSpace.visible = false
+ } else {
+ canvas.panelsSpace.visible = true
+ }
- COCKPIT_SPACE_POSITION = thisObject.container.frame.position.y
- let storage = {
- spacePosition: COCKPIT_SPACE_POSITION
- }
- window.localStorage.setItem(MODULE_NAME, JSON.stringify(storage))
- if (canvas.chartingSpace.viewport !== undefined) {
- canvas.chartingSpace.viewport.resize()
- }
- }
+ COCKPIT_SPACE_POSITION = thisObject.container.frame.position.y
+ let storage = {
+ spacePosition: COCKPIT_SPACE_POSITION
+ }
+ window.localStorage.setItem(MODULE_NAME, JSON.stringify(storage))
+ if (canvas.chartingSpace.viewport !== undefined) {
+ canvas.chartingSpace.viewport.resize()
+ }
+ }
- function getContainer (point) {
- let container
+ function getContainer(point) {
+ let container
- // container = thisObject.fullscreen.getContainer(point)
- // if (container !== undefined) { return container }
+ // container = thisObject.fullscreen.getContainer(point)
+ // if (container !== undefined) { return container }
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- thisObject.container.space = 'Cockpit Space'
- return thisObject.container
- } else {
- return undefined
- }
- }
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ thisObject.container.space = 'Cockpit Space'
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
- function draw () {
- if (canWeDraw === false) { return }
- thisObject.container.frame.draw(false, false)
+ function draw() {
+ if (canWeDraw === false) { return }
+ thisObject.container.frame.draw(false, false)
- drawBackground()
+ drawBackground()
- // thisObject.fullscreen.draw()
- }
+ // thisObject.fullscreen.draw()
+ }
- function drawBackground () {
- let opacity = 1
+ function drawBackground() {
+ let opacity = 1
- let zeroPoint = {
- x: 0,
- y: 0
- }
+ let zeroPoint = {
+ x: 0,
+ y: 0
+ }
- const RED_LINE_HIGHT = 2
+ const RED_LINE_HIGHT = 2
- zeroPoint = thisObject.container.frame.frameThisPoint(zeroPoint)
+ zeroPoint = thisObject.container.frame.frameThisPoint(zeroPoint)
- let barColor = UI_COLOR.DARK_TURQUOISE // default
- let textColor
+ let barColor = UI_COLOR.DARK_TURQUOISE // default
+ let textColor
- if (statusType !== undefined) {
- switch (statusType) {
- case STATUS_TYPES.ALL_GOOD:
- {
- barColor = UI_COLOR.PATINATED_TURQUOISE
- textColor = UI_COLOR.WHITE
- break
- }
- case STATUS_TYPES.WARNING:
- {
- barColor = UI_COLOR.RED
- textColor = UI_COLOR.TITANIUM_YELLOW
- break
- }
- }
- }
+ if (statusType !== undefined) {
+ switch (statusType) {
+ case STATUS_TYPES.ALL_GOOD:
+ {
+ barColor = UI_COLOR.PATINATED_TURQUOISE
+ textColor = UI_COLOR.WHITE
+ break
+ }
+ case STATUS_TYPES.WARNING:
+ {
+ barColor = UI_COLOR.RED
+ textColor = UI_COLOR.TITANIUM_YELLOW
+ break
+ }
+ }
+ }
- browserCanvasContext.beginPath()
- browserCanvasContext.rect(zeroPoint.x, zeroPoint.y, thisObject.container.frame.width, thisObject.container.frame.height)
- browserCanvasContext.fillStyle = 'rgba(' + barColor + ', ' + opacity + ')'
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
+ browserCanvasContext.beginPath()
+ browserCanvasContext.rect(zeroPoint.x, zeroPoint.y, thisObject.container.frame.width, thisObject.container.frame.height)
+ browserCanvasContext.fillStyle = 'rgba(' + barColor + ', ' + opacity + ')'
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
- browserCanvasContext.beginPath()
- browserCanvasContext.rect(zeroPoint.x, zeroPoint.y, thisObject.container.frame.width, RED_LINE_HIGHT)
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ')'
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
+ browserCanvasContext.beginPath()
+ browserCanvasContext.rect(zeroPoint.x, zeroPoint.y, thisObject.container.frame.width, RED_LINE_HIGHT)
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ')'
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
- browserCanvasContext.beginPath()
- browserCanvasContext.rect(zeroPoint.x, zeroPoint.y - RED_LINE_HIGHT + thisObject.container.frame.height, thisObject.container.frame.width, RED_LINE_HIGHT)
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ')'
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
+ browserCanvasContext.beginPath()
+ browserCanvasContext.rect(zeroPoint.x, zeroPoint.y - RED_LINE_HIGHT + thisObject.container.frame.height, thisObject.container.frame.width, RED_LINE_HIGHT)
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ')'
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
- if (statusText !== undefined) {
- let position = {
- x: thisObject.container.frame.width / 2,
- y: thisObject.container.frame.height / 2 + 5
- }
- printLabel(statusText, position.x, position.y, 1, 15, textColor, true, thisObject.container)
- }
+ if (statusText !== undefined) {
+ let position = {
+ x: thisObject.container.frame.width / 2,
+ y: thisObject.container.frame.height / 2 + 5
+ }
+ printLabel(statusText, position.x, position.y, 1, 15, textColor, true, thisObject.container)
+ }
- if (canvas.designSpace !== undefined) {
- if (canvas.designSpace.workspace.enabled === true && statusText === undefined) {
- arrow()
- }
- }
- }
+ if (canvas.designSpace !== undefined) {
+ if (canvas.designSpace.workspace.enabled === true && statusText === undefined) {
+ arrow()
+ }
+ }
+ }
- function arrow () {
- const X_OFFSET = thisObject.container.frame.width / 2
- const Y_OFFSET = thisObject.container.frame.height / 2
- const HEIGHT = 6
- const WIDTH = 18
- const LINE_WIDTH = 3
- const OPACITY = 1
- let DISTANCE_BETWEEN_ARROWS = 0
- let ARROW_1_DIRECTION = 0
- let ARROW_2_DIRECTION = 0
+ function arrow() {
+ const X_OFFSET = thisObject.container.frame.width / 2
+ const Y_OFFSET = thisObject.container.frame.height / 2
+ const HEIGHT = 6
+ const WIDTH = 18
+ const LINE_WIDTH = 3
+ const OPACITY = 1
+ let DISTANCE_BETWEEN_ARROWS = 0
+ let ARROW_1_DIRECTION = 0
+ let ARROW_2_DIRECTION = 0
- switch (thisObject.status) {
+ switch (thisObject.status) {
- case ('TOP'): {
- ARROW_1_DIRECTION = -1
- ARROW_2_DIRECTION = -1
- DISTANCE_BETWEEN_ARROWS = 6
- break
- }
- case ('MIDDLE'): {
- ARROW_1_DIRECTION = 1
- ARROW_2_DIRECTION = -1
- DISTANCE_BETWEEN_ARROWS = 9
- break
- }
- case ('BOTTOM'): {
- ARROW_1_DIRECTION = 1
- ARROW_2_DIRECTION = 1
- DISTANCE_BETWEEN_ARROWS = 6
- break
- }
- }
+ case ('TOP'): {
+ ARROW_1_DIRECTION = -1
+ ARROW_2_DIRECTION = -1
+ DISTANCE_BETWEEN_ARROWS = 6
+ break
+ }
+ case ('MIDDLE'): {
+ ARROW_1_DIRECTION = 1
+ ARROW_2_DIRECTION = -1
+ DISTANCE_BETWEEN_ARROWS = 9
+ break
+ }
+ case ('BOTTOM'): {
+ ARROW_1_DIRECTION = 1
+ ARROW_2_DIRECTION = 1
+ DISTANCE_BETWEEN_ARROWS = 6
+ break
+ }
+ }
- point1 = {
- x: X_OFFSET - WIDTH / 2,
- y: Y_OFFSET + HEIGHT / 2 * ARROW_1_DIRECTION - DISTANCE_BETWEEN_ARROWS / 2
- }
+ point1 = {
+ x: X_OFFSET - WIDTH / 2,
+ y: Y_OFFSET + HEIGHT / 2 * ARROW_1_DIRECTION - DISTANCE_BETWEEN_ARROWS / 2
+ }
- point2 = {
- x: X_OFFSET,
- y: Y_OFFSET - HEIGHT / 2 * ARROW_1_DIRECTION - DISTANCE_BETWEEN_ARROWS / 2
- }
+ point2 = {
+ x: X_OFFSET,
+ y: Y_OFFSET - HEIGHT / 2 * ARROW_1_DIRECTION - DISTANCE_BETWEEN_ARROWS / 2
+ }
- point3 = {
- x: X_OFFSET + WIDTH / 2,
- y: Y_OFFSET + HEIGHT / 2 * ARROW_1_DIRECTION - DISTANCE_BETWEEN_ARROWS / 2
- }
+ point3 = {
+ x: X_OFFSET + WIDTH / 2,
+ y: Y_OFFSET + HEIGHT / 2 * ARROW_1_DIRECTION - DISTANCE_BETWEEN_ARROWS / 2
+ }
- point1 = thisObject.container.frame.frameThisPoint(point1)
- point2 = thisObject.container.frame.frameThisPoint(point2)
- point3 = thisObject.container.frame.frameThisPoint(point3)
+ point1 = thisObject.container.frame.frameThisPoint(point1)
+ point2 = thisObject.container.frame.frameThisPoint(point2)
+ point3 = thisObject.container.frame.frameThisPoint(point3)
- point4 = {
- x: X_OFFSET - WIDTH / 2,
- y: Y_OFFSET + HEIGHT / 2 * ARROW_2_DIRECTION + DISTANCE_BETWEEN_ARROWS / 2
- }
+ point4 = {
+ x: X_OFFSET - WIDTH / 2,
+ y: Y_OFFSET + HEIGHT / 2 * ARROW_2_DIRECTION + DISTANCE_BETWEEN_ARROWS / 2
+ }
- point5 = {
- x: X_OFFSET,
- y: Y_OFFSET - HEIGHT / 2 * ARROW_2_DIRECTION + DISTANCE_BETWEEN_ARROWS / 2
- }
+ point5 = {
+ x: X_OFFSET,
+ y: Y_OFFSET - HEIGHT / 2 * ARROW_2_DIRECTION + DISTANCE_BETWEEN_ARROWS / 2
+ }
- point6 = {
- x: X_OFFSET + WIDTH / 2,
- y: Y_OFFSET + HEIGHT / 2 * ARROW_2_DIRECTION + DISTANCE_BETWEEN_ARROWS / 2
- }
+ point6 = {
+ x: X_OFFSET + WIDTH / 2,
+ y: Y_OFFSET + HEIGHT / 2 * ARROW_2_DIRECTION + DISTANCE_BETWEEN_ARROWS / 2
+ }
- point4 = thisObject.container.frame.frameThisPoint(point4)
- point5 = thisObject.container.frame.frameThisPoint(point5)
- point6 = thisObject.container.frame.frameThisPoint(point6)
+ point4 = thisObject.container.frame.frameThisPoint(point4)
+ point5 = thisObject.container.frame.frameThisPoint(point5)
+ point6 = thisObject.container.frame.frameThisPoint(point6)
- browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.beginPath()
+ browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.moveTo(point4.x, point4.y)
- browserCanvasContext.lineTo(point5.x, point5.y)
- browserCanvasContext.lineTo(point6.x, point6.y)
+ browserCanvasContext.moveTo(point4.x, point4.y)
+ browserCanvasContext.lineTo(point5.x, point5.y)
+ browserCanvasContext.lineTo(point6.x, point6.y)
- browserCanvasContext.lineWidth = LINE_WIDTH
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
- browserCanvasContext.stroke()
- }
- }
+ browserCanvasContext.lineWidth = LINE_WIDTH
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + OPACITY + ')'
+ browserCanvasContext.stroke()
+ }
+}
diff --git a/CanvasApp/Spaces/DesignSpace.js b/CanvasApp/Spaces/DesignSpace.js
index 4940727b6..b67ffa44b 100644
--- a/CanvasApp/Spaces/DesignSpace.js
+++ b/CanvasApp/Spaces/DesignSpace.js
@@ -1,351 +1,351 @@
-function newDesignSpace () {
- const MODULE_NAME = 'Designe Space'
- let thisObject = {
- sidePanel: undefined,
- container: undefined,
- iconCollection: undefined,
- iconByUiObjectType: undefined,
- workspace: undefined,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- makeVisible: makeVisible,
- makeInvisible: makeInvisible,
- initialize: initialize
- }
-
- let container = newContainer()
- container.initialize()
- thisObject.container = container
-
- container.isDraggeable = false
-
- thisObject.iconCollection = new Map()
- thisObject.iconByUiObjectType = new Map()
-
- return thisObject
-
- function initialize () {
- loadIconCollection()
- buildIconByUiObjectTypeMap()
-
- thisObject.workspace = newWorkspace()
- thisObject.workspace.initialize()
- }
-
- function buildIconByUiObjectTypeMap () {
- /* Take types-icons relationships defined at the schema */
- for (let i = 0; i < APP_SCHEMA_ARRAY.length; i++) {
- let nodeDefinition = APP_SCHEMA_ARRAY[i]
- let iconName = nodeDefinition.icon
- if (iconName !== undefined) {
- let icon = thisObject.iconCollection.get(iconName)
- thisObject.iconByUiObjectType.set(nodeDefinition.type, icon)
- }
- }
- }
-
- function loadIconCollection () {
- const iconsNames = [
- 'analysis',
- 'analysis-1',
- 'approve',
- 'attach',
- 'attractive',
- 'pyramid',
- 'brainstorming',
- 'broken-link',
- 'chat',
- 'chronometer',
- 'compass',
- 'competition',
- 'content',
- 'design-tool',
- 'grid',
- 'headphones',
- 'html',
- 'image',
- 'layout',
- 'loading',
- 'login',
- 'pantone',
- 'paper-plane',
- 'photo-camera',
- 'piggy-bank',
- 'pipette',
- 'pixel',
- 'placeholder',
- 'planning',
- 'promotion',
- 'pyramid',
- 'quality',
- 'responsive',
- 'schedule',
- 'search',
- 'security',
- 'settings',
- 'sitemap',
- 'startup',
- 'support',
- 'tap',
- 'menu-fix-pinned',
- 'menu-fix-unpinned',
- 'targeting',
- 'task',
- 'testing',
- 'text',
- 'timeline',
- 'tools',
- 'delete',
- 'upload',
- 'vector',
- 'video-player',
- 'menu-mobility-freeze',
- 'menu-mobility-unfreeze',
- 'menu-tree-minus',
- 'menu-tree-plus',
- 'menu-backup',
- 'menu-share',
- 'stop',
- 'stage-open',
- 'stage-close',
- 'stage-trigger',
- 'stage-trigger-trigger-on',
- 'stage-trigger-trigger-off',
- 'stage-trigger-take-position',
- 'menu-tensor-fixed-angles',
- 'menu-tensor-free-angles',
- 'stage-open-position-size',
- 'stage-open-take-profit',
- 'stage-open-postion-rate',
- 'session-live-trading',
- 'session-paper-trading',
- 'session-backtesting',
- 'session-forward-testing',
- 'network',
- 'network-node',
- 'bot-trading',
- 'layer-manager',
- 'process',
- 'bot-indicator',
- 'bot-sensor',
- 'time-period',
- 'data-mine',
- 'procedure-loop',
- 'calculations-procedure',
- 'data-building-procedure',
- 'procedure-initialization',
- 'process-definition',
- 'output-dataset',
- 'data-dependency',
- 'product-definition',
- 'plotter-module',
- 'status-dependency',
- 'record-property',
- 'record-definition',
- 'plotter',
- 'plotter-panel',
- 'dataset-definition',
- 'status-report',
- 'execution-finished-event',
- 'process-dependencies',
- 'process-output',
- 'social-bot',
- 'execution-started-event',
- 'shapes',
- 'chart-point',
- 'style',
- 'chart-points',
- 'shapes-polygon-vertex',
- 'shapes-polygon-border',
- 'shapes-polygon-body',
- 'chart-point-formula',
- 'style-condition',
- 'shapes-polygon',
- 'data-entry',
- 'data-formula',
- 'clone',
- 'exchange-account-asset',
- 'exchange-account-key',
- 'user-keys',
- 'user-assets',
- 'asset',
- 'exchange-accounts',
- 'user-account',
- 'market',
- 'exchange-assets',
- 'crypto-exchanges',
- 'crypto-exchange',
- 'exchange-markets',
- 'charting-space',
- 'time-line-chart',
- 'time-frame-scale',
- 'time-scale',
- 'rate-scale',
- 'time-machine',
- 'data-product',
- 'single-market-data',
- 'data-storage',
- 'dataset',
- 'viewport',
- 'bitfinex',
- 'binance',
- 'kucoin',
- 'bittrex',
- 'kraken',
- 'poloniex',
- 'upbit',
- 'monero',
- 'tether',
- 'tron',
- 'stellar',
- 'qtum',
- 'neo',
- 'litecoin',
- 'ethereum-classic',
- 'ethereum',
- 'eos',
- 'dash',
- 'cardano',
- 'bitcoin-cash',
- 'bitcoin',
- 'binance-coin',
- 'trend',
- 'oscillator',
- 'moving-average',
- 'histogram',
- 'band',
- 'volume',
- 'candles',
- 'bitmex',
- 'liquid',
- 'hitbtc',
- 'us-dollar',
- 'distance-to-parent-200',
- 'distance-to-parent-150',
- 'distance-to-parent-100',
- 'distance-to-parent-050',
- 'distance-to-parent-025',
- 'distance-to-parent-000',
- 'angle-to-parent-360',
- 'angle-to-parent-180',
- 'angle-to-parent-090',
- 'angle-to-parent-045',
- 'angle-to-parent-000',
- 'data-mining',
- 'initial-definition',
- 'next-phase-event',
- 'testing-environment',
- 'production-environment',
- 'task-manager',
- 'session-based-data',
- 'session-independent-data',
- 'session-reference',
- 'dashboard',
- 'toggle-auto-scale-manual',
- 'toggle-auto-scale-auto-min-max',
- 'toggle-auto-scale-auto-max',
- 'toggle-auto-scale-auto-min',
- 'toggle-panel-off',
- 'toggle-auto-time-scale-auto-min',
- 'toggle-auto-time-scale-auto-max',
- 'toggle-auto-time-scale-auto-min-max',
- 'toggle-auto-time-scale-manual',
- 'mouse-pointer',
- 'mouse-left-click',
- 'mouse-right-click',
- 'mouse-wheel-up',
- 'mouse-wheel-down',
- 'mouse-wheel-click',
- 'key-alt',
- 'key-shift',
- 'key-ctrl',
- 'hand-drag',
- 'key-down',
- 'key-left',
- 'key-right',
- 'key-up',
- 'master-script',
- 'scripts-library',
- 'super-action',
- 'super-scripts',
- 'template-script',
- 'template-structure',
- 'template-target',
- 'delink',
- 'detach',
- 'help',
- 'key-a',
- 'key-m',
- 'key-r',
- 'arrangement-horizontal-top',
- 'arrangement-convex',
- 'arrangement-horizontal-bottom',
- 'arrangement-vertical-right',
- 'arrangement-vertical-left',
- 'arrangement-concave',
- 'move-to-phase-event',
- 'open-execution',
- 'move-order',
- 'market-order',
- 'limit-order',
- 'execution-algorithm',
- 'cancel-order'
- ]
-
- for (let i = 0; i < iconsNames.length; i++) {
- let name = iconsNames[i]
- loadImage(name)
+function newDesignSpace() {
+ const MODULE_NAME = 'Designe Space'
+ let thisObject = {
+ sidePanel: undefined,
+ container: undefined,
+ iconCollection: undefined,
+ iconByUiObjectType: undefined,
+ workspace: undefined,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ makeVisible: makeVisible,
+ makeInvisible: makeInvisible,
+ initialize: initialize
}
- function loadImage (name) {
- const PATH = 'Images/Icons/style-01/'
- let image = new Image()
- image.onload = onImageLoad
- image.fileName = name
+ let container = newContainer()
+ container.initialize()
+ thisObject.container = container
- function onImageLoad () {
- image.canDrawIcon = true
- }
- image.src = window.canvasApp.urlPrefix + PATH + name + '.png'
- thisObject.iconCollection.set(name, image)
- }
- }
+ container.isDraggeable = false
- function physics () {
- thisObject.workspace.physics()
- }
+ thisObject.iconCollection = new Map()
+ thisObject.iconByUiObjectType = new Map()
- function makeVisible () {
- visible = true
- }
+ return thisObject
- function makeInvisible () {
- visible = false
- }
+ function initialize() {
+ loadIconCollection()
+ buildIconByUiObjectTypeMap()
- function getContainer (point) {
- let container
-
- if (thisObject.sidePanel !== undefined) {
- container = thisObject.sidePanel.getContainer(point)
- if (container !== undefined) {
- container.space = 'Design Space'
- return container
- }
+ thisObject.workspace = newWorkspace()
+ thisObject.workspace.initialize()
}
- return
- }
+ function buildIconByUiObjectTypeMap() {
+ /* Take types-icons relationships defined at the schema */
+ for (let i = 0; i < APP_SCHEMA_ARRAY.length; i++) {
+ let nodeDefinition = APP_SCHEMA_ARRAY[i]
+ let iconName = nodeDefinition.icon
+ if (iconName !== undefined) {
+ let icon = thisObject.iconCollection.get(iconName)
+ thisObject.iconByUiObjectType.set(nodeDefinition.type, icon)
+ }
+ }
+ }
- function draw () {
- if (canWeDraw === false) { return }
- if (thisObject.sidePanel !== undefined) {
- thisObject.sidePanel.draw()
+ function loadIconCollection() {
+ const iconsNames = [
+ 'analysis',
+ 'analysis-1',
+ 'approve',
+ 'attach',
+ 'attractive',
+ 'pyramid',
+ 'brainstorming',
+ 'broken-link',
+ 'chat',
+ 'chronometer',
+ 'compass',
+ 'competition',
+ 'content',
+ 'design-tool',
+ 'grid',
+ 'headphones',
+ 'html',
+ 'image',
+ 'layout',
+ 'loading',
+ 'login',
+ 'pantone',
+ 'paper-plane',
+ 'photo-camera',
+ 'piggy-bank',
+ 'pipette',
+ 'pixel',
+ 'placeholder',
+ 'planning',
+ 'promotion',
+ 'pyramid',
+ 'quality',
+ 'responsive',
+ 'schedule',
+ 'search',
+ 'security',
+ 'settings',
+ 'sitemap',
+ 'startup',
+ 'support',
+ 'tap',
+ 'menu-fix-pinned',
+ 'menu-fix-unpinned',
+ 'targeting',
+ 'task',
+ 'testing',
+ 'text',
+ 'timeline',
+ 'tools',
+ 'delete',
+ 'upload',
+ 'vector',
+ 'video-player',
+ 'menu-mobility-freeze',
+ 'menu-mobility-unfreeze',
+ 'menu-tree-minus',
+ 'menu-tree-plus',
+ 'menu-backup',
+ 'menu-share',
+ 'stop',
+ 'stage-open',
+ 'stage-close',
+ 'stage-trigger',
+ 'stage-trigger-trigger-on',
+ 'stage-trigger-trigger-off',
+ 'stage-trigger-take-position',
+ 'menu-tensor-fixed-angles',
+ 'menu-tensor-free-angles',
+ 'stage-open-position-size',
+ 'stage-open-take-profit',
+ 'stage-open-postion-rate',
+ 'session-live-trading',
+ 'session-paper-trading',
+ 'session-backtesting',
+ 'session-forward-testing',
+ 'network',
+ 'network-node',
+ 'bot-trading',
+ 'layer-manager',
+ 'process',
+ 'bot-indicator',
+ 'bot-sensor',
+ 'time-period',
+ 'data-mine',
+ 'procedure-loop',
+ 'calculations-procedure',
+ 'data-building-procedure',
+ 'procedure-initialization',
+ 'process-definition',
+ 'output-dataset',
+ 'data-dependency',
+ 'product-definition',
+ 'plotter-module',
+ 'status-dependency',
+ 'record-property',
+ 'record-definition',
+ 'plotter',
+ 'plotter-panel',
+ 'dataset-definition',
+ 'status-report',
+ 'execution-finished-event',
+ 'process-dependencies',
+ 'process-output',
+ 'social-bot',
+ 'execution-started-event',
+ 'shapes',
+ 'chart-point',
+ 'style',
+ 'chart-points',
+ 'shapes-polygon-vertex',
+ 'shapes-polygon-border',
+ 'shapes-polygon-body',
+ 'chart-point-formula',
+ 'style-condition',
+ 'shapes-polygon',
+ 'data-entry',
+ 'data-formula',
+ 'clone',
+ 'exchange-account-asset',
+ 'exchange-account-key',
+ 'user-keys',
+ 'user-assets',
+ 'asset',
+ 'exchange-accounts',
+ 'user-account',
+ 'market',
+ 'exchange-assets',
+ 'crypto-exchanges',
+ 'crypto-exchange',
+ 'exchange-markets',
+ 'charting-space',
+ 'time-line-chart',
+ 'time-frame-scale',
+ 'time-scale',
+ 'rate-scale',
+ 'time-machine',
+ 'data-product',
+ 'single-market-data',
+ 'data-storage',
+ 'dataset',
+ 'viewport',
+ 'bitfinex',
+ 'binance',
+ 'kucoin',
+ 'bittrex',
+ 'kraken',
+ 'poloniex',
+ 'upbit',
+ 'monero',
+ 'tether',
+ 'tron',
+ 'stellar',
+ 'qtum',
+ 'neo',
+ 'litecoin',
+ 'ethereum-classic',
+ 'ethereum',
+ 'eos',
+ 'dash',
+ 'cardano',
+ 'bitcoin-cash',
+ 'bitcoin',
+ 'binance-coin',
+ 'trend',
+ 'oscillator',
+ 'moving-average',
+ 'histogram',
+ 'band',
+ 'volume',
+ 'candles',
+ 'bitmex',
+ 'liquid',
+ 'hitbtc',
+ 'us-dollar',
+ 'distance-to-parent-200',
+ 'distance-to-parent-150',
+ 'distance-to-parent-100',
+ 'distance-to-parent-050',
+ 'distance-to-parent-025',
+ 'distance-to-parent-000',
+ 'angle-to-parent-360',
+ 'angle-to-parent-180',
+ 'angle-to-parent-090',
+ 'angle-to-parent-045',
+ 'angle-to-parent-000',
+ 'data-mining',
+ 'initial-definition',
+ 'next-phase-event',
+ 'testing-environment',
+ 'production-environment',
+ 'task-manager',
+ 'session-based-data',
+ 'session-independent-data',
+ 'session-reference',
+ 'dashboard',
+ 'toggle-auto-scale-manual',
+ 'toggle-auto-scale-auto-min-max',
+ 'toggle-auto-scale-auto-max',
+ 'toggle-auto-scale-auto-min',
+ 'toggle-panel-off',
+ 'toggle-auto-time-scale-auto-min',
+ 'toggle-auto-time-scale-auto-max',
+ 'toggle-auto-time-scale-auto-min-max',
+ 'toggle-auto-time-scale-manual',
+ 'mouse-pointer',
+ 'mouse-left-click',
+ 'mouse-right-click',
+ 'mouse-wheel-up',
+ 'mouse-wheel-down',
+ 'mouse-wheel-click',
+ 'key-alt',
+ 'key-shift',
+ 'key-ctrl',
+ 'hand-drag',
+ 'key-down',
+ 'key-left',
+ 'key-right',
+ 'key-up',
+ 'master-script',
+ 'scripts-library',
+ 'super-action',
+ 'super-scripts',
+ 'template-script',
+ 'template-structure',
+ 'template-target',
+ 'delink',
+ 'detach',
+ 'help',
+ 'key-a',
+ 'key-m',
+ 'key-r',
+ 'arrangement-horizontal-top',
+ 'arrangement-convex',
+ 'arrangement-horizontal-bottom',
+ 'arrangement-vertical-right',
+ 'arrangement-vertical-left',
+ 'arrangement-concave',
+ 'move-to-phase-event',
+ 'open-execution',
+ 'move-order',
+ 'market-order',
+ 'limit-order',
+ 'execution-algorithm',
+ 'cancel-order'
+ ]
+
+ for (let i = 0; i < iconsNames.length; i++) {
+ let name = iconsNames[i]
+ loadImage(name)
+ }
+
+ function loadImage(name) {
+ const PATH = 'Images/Icons/style-01/'
+ let image = new Image()
+ image.onload = onImageLoad
+ image.fileName = name
+
+ function onImageLoad() {
+ image.canDrawIcon = true
+ }
+ image.src = window.canvasApp.urlPrefix + PATH + name + '.png'
+ thisObject.iconCollection.set(name, image)
+ }
}
- if (thisObject.workspace !== undefined) {
- thisObject.workspace.draw()
+
+ function physics() {
+ thisObject.workspace.physics()
+ }
+
+ function makeVisible() {
+ visible = true
+ }
+
+ function makeInvisible() {
+ visible = false
+ }
+
+ function getContainer(point) {
+ let container
+
+ if (thisObject.sidePanel !== undefined) {
+ container = thisObject.sidePanel.getContainer(point)
+ if (container !== undefined) {
+ container.space = 'Design Space'
+ return container
+ }
+ }
+
+ return
+ }
+
+ function draw() {
+ if (canWeDraw === false) { return }
+ if (thisObject.sidePanel !== undefined) {
+ thisObject.sidePanel.draw()
+ }
+ if (thisObject.workspace !== undefined) {
+ thisObject.workspace.draw()
+ }
}
- }
}
diff --git a/CanvasApp/Spaces/FloatingSpace.js b/CanvasApp/Spaces/FloatingSpace.js
index cb94ebc2d..90234b1a4 100644
--- a/CanvasApp/Spaces/FloatingSpace.js
+++ b/CanvasApp/Spaces/FloatingSpace.js
@@ -1,433 +1,433 @@
-function newFloatingSpace () {
- const MODULE_NAME = 'Floating Space'
- const ERROR_LOG = true
- /*
- The Floating Space is the place where floating elements like floatingObjects, live and are rendered.
- This space has its own physics which helps with the animation of these objects and also preventing them to overlap.
- */
+function newFloatingSpace() {
+ const MODULE_NAME = 'Floating Space'
+ const ERROR_LOG = true
+ /*
+ The Floating Space is the place where floating elements like floatingObjects, live and are rendered.
+ This space has its own physics which helps with the animation of these objects and also preventing them to overlap.
+ */
- let thisObject = {
- floatingLayer: undefined, // This is the array of floatingObjects being displayed
- uiObjectConstructor: undefined,
- container: undefined,
- inMapMode: false,
- drawReferenceLines: false,
- drawChainLines: true,
- toggleDrawChainLines: toggleDrawChainLines,
- toggleDrawReferenceLines: toggleDrawReferenceLines,
- toggleMapMode: toggleMapMode,
- enterMapMode: enterMapMode,
- exitMapMode: exitMapMode,
- transformPointToMap: transformPointToMap,
- transformRadiusToMap: transformRadiusToMap,
- transformImagesizeToMap: transformImagesizeToMap,
- oneScreenUp: oneScreenUp,
- oneScreenDown: oneScreenDown,
- oneScreenLeft: oneScreenLeft,
- oneScreenRight: oneScreenRight,
- positionAtNode: positionAtNode,
- fitIntoVisibleArea: fitIntoVisibleArea,
- isThisPointVisible: isThisPointVisible,
- isItFar: isItFar,
- makeVisible: makeVisible,
- makeInvisible: makeInvisible,
- draw: draw,
- physics: physics,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize(MODULE_NAME)
- thisObject.container.isClickeable = false
- thisObject.container.isDraggeable = true
- thisObject.container.isWheelable = true
- thisObject.container.detectMouseOver = true
- thisObject.container.isClickeable = false
- thisObject.container.frame.radius = 0
-
- let devicePixelRatio = window.devicePixelRatio
- const SPACE_SIZE = 50000
-
- thisObject.container.frame.width = SPACE_SIZE
- thisObject.container.frame.height = SPACE_SIZE
- thisObject.container.frame.position.x = browserCanvas.width / 2 - thisObject.container.frame.width / 2
- thisObject.container.frame.position.y = browserCanvas.height / 2 - thisObject.container.frame.height / 2
-
- let visible = false
- let floatingObjetOnFocus
-
- const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
- let onDragStartedEventSubscriptionId
- let spaceFocusAquiredEventSubscriptionId
-
- return thisObject
-
- function finalize () {
- thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
- canvas.floatingSpace.container.eventHandler.stopListening(spaceFocusAquiredEventSubscriptionId)
-
- thisObject.floatingLayer.finalize()
- thisObject.uiObjectConstructor.finalize()
- thisObject.container.finalize()
-
- thisObject.floatingLayer = undefined
- thisObject.uiObjectConstructor = undefined
- thisObject.container = undefined
-
- floatingObjetOnFocus = undefined
- }
-
- function initialize (callBackFunction) {
- thisObject.floatingLayer = newFloatingLayer()
- thisObject.floatingLayer.initialize()
-
- thisObject.uiObjectConstructor = newUiObjectConstructor()
- thisObject.uiObjectConstructor.initialize(thisObject.floatingLayer)
-
- onDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
- spaceFocusAquiredEventSubscriptionId = canvas.floatingSpace.container.eventHandler.listenToEvent('onFocusAquired', someoneAquiredFocus)
- }
-
- function someoneAquiredFocus (floatingObject) {
- if (floatingObject === undefined || floatingObject.container === undefined) {
- return
+ let thisObject = {
+ floatingLayer: undefined, // This is the array of floatingObjects being displayed
+ uiObjectConstructor: undefined,
+ container: undefined,
+ inMapMode: false,
+ drawReferenceLines: false,
+ drawChainLines: true,
+ toggleDrawChainLines: toggleDrawChainLines,
+ toggleDrawReferenceLines: toggleDrawReferenceLines,
+ toggleMapMode: toggleMapMode,
+ enterMapMode: enterMapMode,
+ exitMapMode: exitMapMode,
+ transformPointToMap: transformPointToMap,
+ transformRadiusToMap: transformRadiusToMap,
+ transformImagesizeToMap: transformImagesizeToMap,
+ oneScreenUp: oneScreenUp,
+ oneScreenDown: oneScreenDown,
+ oneScreenLeft: oneScreenLeft,
+ oneScreenRight: oneScreenRight,
+ positionAtNode: positionAtNode,
+ fitIntoVisibleArea: fitIntoVisibleArea,
+ isThisPointVisible: isThisPointVisible,
+ isItFar: isItFar,
+ makeVisible: makeVisible,
+ makeInvisible: makeInvisible,
+ draw: draw,
+ physics: physics,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- floatingObjetOnFocus = floatingObject
- }
- function toggleDrawReferenceLines () {
- if (thisObject.drawReferenceLines === true) {
- thisObject.drawReferenceLines = false
- } else {
- thisObject.drawReferenceLines = true
+ thisObject.container = newContainer()
+ thisObject.container.initialize(MODULE_NAME)
+ thisObject.container.isClickeable = false
+ thisObject.container.isDraggeable = true
+ thisObject.container.isWheelable = true
+ thisObject.container.detectMouseOver = true
+ thisObject.container.isClickeable = false
+ thisObject.container.frame.radius = 0
+
+ let devicePixelRatio = window.devicePixelRatio
+ const SPACE_SIZE = 50000
+
+ thisObject.container.frame.width = SPACE_SIZE
+ thisObject.container.frame.height = SPACE_SIZE
+ thisObject.container.frame.position.x = browserCanvas.width / 2 - thisObject.container.frame.width / 2
+ thisObject.container.frame.position.y = browserCanvas.height / 2 - thisObject.container.frame.height / 2
+
+ let visible = false
+ let floatingObjetOnFocus
+
+ const PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT = 25
+ let onDragStartedEventSubscriptionId
+ let spaceFocusAquiredEventSubscriptionId
+
+ return thisObject
+
+ function finalize() {
+ thisObject.container.eventHandler.stopListening(onDragStartedEventSubscriptionId)
+ canvas.floatingSpace.container.eventHandler.stopListening(spaceFocusAquiredEventSubscriptionId)
+
+ thisObject.floatingLayer.finalize()
+ thisObject.uiObjectConstructor.finalize()
+ thisObject.container.finalize()
+
+ thisObject.floatingLayer = undefined
+ thisObject.uiObjectConstructor = undefined
+ thisObject.container = undefined
+
+ floatingObjetOnFocus = undefined
}
- }
- function toggleDrawChainLines () {
- if (thisObject.drawChainLines === true) {
- thisObject.drawChainLines = false
- } else {
- thisObject.drawChainLines = true
+ function initialize(callBackFunction) {
+ thisObject.floatingLayer = newFloatingLayer()
+ thisObject.floatingLayer.initialize()
+
+ thisObject.uiObjectConstructor = newUiObjectConstructor()
+ thisObject.uiObjectConstructor.initialize(thisObject.floatingLayer)
+
+ onDragStartedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDragStarted', onDragStarted)
+ spaceFocusAquiredEventSubscriptionId = canvas.floatingSpace.container.eventHandler.listenToEvent('onFocusAquired', someoneAquiredFocus)
}
- }
- function transformPointToMap (point) {
- let returnPoint = {
- x: point.x - thisObject.container.frame.position.x,
- y: point.y - thisObject.container.frame.position.y
- }
- returnPoint.x = returnPoint.x / SPACE_SIZE * browserCanvas.width
- returnPoint.y = returnPoint.y / SPACE_SIZE * browserCanvas.height
- return returnPoint
- }
-
- function transformRadiusToMap (radius) {
- const RADIUS_REDUCTION_FACTOR = 2
- return radius / RADIUS_REDUCTION_FACTOR
- }
-
- function transformImagesizeToMap (imageSize) {
- const IMAGE_REDUCTION_FACTOR = 3
- return imageSize / IMAGE_REDUCTION_FACTOR
- }
-
- function enterMapMode () {
- thisObject.inMapMode = true
- }
-
- function exitMapMode () {
- thisObject.inMapMode = false
- }
-
- function toggleMapMode () {
- if (thisObject.inMapMode === false) {
- enterMapMode()
- } else {
- exitMapMode()
- }
- }
-
- function onDragStarted (event) {
- if (thisObject.inMapMode === false) {
- if (event.buttons !== 2) { return }
- event.candelDragging = true
- enterMapMode()
- } else {
- if (event.buttons !== 1) {
- event.candelDragging = true
- return
- }
-
- let mousePosition = {
- x: event.x,
- y: event.y
- }
-
- let mouseAtSpace = {
- x: mousePosition.x / browserCanvas.width * SPACE_SIZE,
- y: mousePosition.y / browserCanvas.height * SPACE_SIZE
- }
- /* Let's see if we can snap to some of the root nodes that are isHierarchyHead */
- let snapCandidateNodes = canvas.designSpace.workspace.getHierarchyHeads()
- for (let i = 0; i < snapCandidateNodes.length; i++) {
- let node = snapCandidateNodes[i]
- let nodePosition = {
- x: node.payload.floatingObject.container.frame.position.x,
- y: node.payload.floatingObject.container.frame.position.y
+ function someoneAquiredFocus(floatingObject) {
+ if (floatingObject === undefined || floatingObject.container === undefined) {
+ return
}
- // nodePosition = node.payload.floatingObject.container.frame.frameThisPoint(nodePosition)
+ floatingObjetOnFocus = floatingObject
+ }
- let distance = Math.sqrt(Math.pow(mouseAtSpace.x - nodePosition.x, 2) + Math.pow(mouseAtSpace.y - nodePosition.y, 2))
- const SNAP_THREASHOLD = 1000
- if (distance < SNAP_THREASHOLD) {
- mousePosition.x = nodePosition.x / SPACE_SIZE * browserCanvas.width
- mousePosition.y = nodePosition.y / SPACE_SIZE * browserCanvas.height
+ function toggleDrawReferenceLines() {
+ if (thisObject.drawReferenceLines === true) {
+ thisObject.drawReferenceLines = false
+ } else {
+ thisObject.drawReferenceLines = true
}
- }
-
- /* Movign the Floating Space to where the mouse is. */
- thisObject.container.frame.position.x = -mousePosition.x / browserCanvas.width * SPACE_SIZE + browserCanvas.width / 2
- thisObject.container.frame.position.y = -mousePosition.y / browserCanvas.height * SPACE_SIZE + browserCanvas.height / 2
-
- exitMapMode()
- }
- }
-
- function isItFar (payload, dontCheckParent) {
- /* If for any reason the paylaod is undefined we return false */
- if (payload === undefined) { return false }
- if (thisObject.inMapMode === true) { return false }
-
- let radarFactor = 2 // How big is the margin
-
- /* If the chain parent is not far, they we dont consither this far. */
- if (dontCheckParent !== true) {
- if (payload.chainParent !== undefined) {
- if (isItFar(payload.chainParent.payload, true) === false) { return false }
- }
}
- /* Exceptions that are never considered far. */
- if (
- payload.node.type === 'Trading System' ||
- payload.node.type === 'Network' ||
- payload.node.type === 'Crypto Ecosystem' ||
- payload.node.type === 'Charting Space' ||
- payload.node.type === 'Data Mine' ||
- payload.node.type === 'Super Scripts'
- ) {
- return false
+ function toggleDrawChainLines() {
+ if (thisObject.drawChainLines === true) {
+ thisObject.drawChainLines = false
+ } else {
+ thisObject.drawChainLines = true
+ }
}
- /* Another exception are the ones who have reference parents */
- if (payload.referenceParent !== undefined) { return false }
-
- /* Here we will check the position of a floatingobject to see if it is outside the screen, with a margin of one screen around. */
- let point = thisObject.container.frame.frameThisPoint(payload.position)
-
- if (point.x > browserCanvas.width + browserCanvas.width * radarFactor) {
- return true
+ function transformPointToMap(point) {
+ let returnPoint = {
+ x: point.x - thisObject.container.frame.position.x,
+ y: point.y - thisObject.container.frame.position.y
+ }
+ returnPoint.x = returnPoint.x / SPACE_SIZE * browserCanvas.width
+ returnPoint.y = returnPoint.y / SPACE_SIZE * browserCanvas.height
+ return returnPoint
}
- if (point.x < 0 - browserCanvas.width * radarFactor) {
- return true
+ function transformRadiusToMap(radius) {
+ const RADIUS_REDUCTION_FACTOR = 2
+ return radius / RADIUS_REDUCTION_FACTOR
}
- let bottom = COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT
- let heightDiff = browserCanvas.height - bottom
- if (point.y < bottom - heightDiff * radarFactor) {
- return true
+ function transformImagesizeToMap(imageSize) {
+ const IMAGE_REDUCTION_FACTOR = 3
+ return imageSize / IMAGE_REDUCTION_FACTOR
}
- if (point.y > browserCanvas.height + heightDiff * radarFactor) {
- return true
- }
- return false
- }
-
- function fitIntoVisibleArea (point) {
- /* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */
-
- let returnPoint = {
- x: point.x,
- y: point.y
+ function enterMapMode() {
+ thisObject.inMapMode = true
}
- if (point.x > browserCanvas.width) {
- returnPoint.x = browserCanvas.width
+ function exitMapMode() {
+ thisObject.inMapMode = false
}
- if (point.x < 0) {
- returnPoint.x = 0
+ function toggleMapMode() {
+ if (thisObject.inMapMode === false) {
+ enterMapMode()
+ } else {
+ exitMapMode()
+ }
}
- if (point.y < COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT) {
- returnPoint.y = COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT
+ function onDragStarted(event) {
+ if (thisObject.inMapMode === false) {
+ if (event.buttons !== 2) { return }
+ event.candelDragging = true
+ enterMapMode()
+ } else {
+ if (event.buttons !== 1) {
+ event.candelDragging = true
+ return
+ }
+
+ let mousePosition = {
+ x: event.x,
+ y: event.y
+ }
+
+ let mouseAtSpace = {
+ x: mousePosition.x / browserCanvas.width * SPACE_SIZE,
+ y: mousePosition.y / browserCanvas.height * SPACE_SIZE
+ }
+ /* Let's see if we can snap to some of the root nodes that are isHierarchyHead */
+ let snapCandidateNodes = canvas.designSpace.workspace.getHierarchyHeads()
+ for (let i = 0; i < snapCandidateNodes.length; i++) {
+ let node = snapCandidateNodes[i]
+ let nodePosition = {
+ x: node.payload.floatingObject.container.frame.position.x,
+ y: node.payload.floatingObject.container.frame.position.y
+ }
+ // nodePosition = node.payload.floatingObject.container.frame.frameThisPoint(nodePosition)
+
+ let distance = Math.sqrt(Math.pow(mouseAtSpace.x - nodePosition.x, 2) + Math.pow(mouseAtSpace.y - nodePosition.y, 2))
+ const SNAP_THREASHOLD = 1000
+ if (distance < SNAP_THREASHOLD) {
+ mousePosition.x = nodePosition.x / SPACE_SIZE * browserCanvas.width
+ mousePosition.y = nodePosition.y / SPACE_SIZE * browserCanvas.height
+ }
+ }
+
+ /* Movign the Floating Space to where the mouse is. */
+ thisObject.container.frame.position.x = -mousePosition.x / browserCanvas.width * SPACE_SIZE + browserCanvas.width / 2
+ thisObject.container.frame.position.y = -mousePosition.y / browserCanvas.height * SPACE_SIZE + browserCanvas.height / 2
+
+ exitMapMode()
+ }
}
- if (point.y > browserCanvas.height) {
- returnPoint.y = browserCanvas.height
+ function isItFar(payload, dontCheckParent) {
+ /* If for any reason the paylaod is undefined we return false */
+ if (payload === undefined) { return false }
+ if (thisObject.inMapMode === true) { return false }
+
+ let radarFactor = 2 // How big is the margin
+
+ /* If the chain parent is not far, they we dont consither this far. */
+ if (dontCheckParent !== true) {
+ if (payload.chainParent !== undefined) {
+ if (isItFar(payload.chainParent.payload, true) === false) { return false }
+ }
+ }
+
+ /* Exceptions that are never considered far. */
+ if (
+ payload.node.type === 'Trading System' ||
+ payload.node.type === 'Network' ||
+ payload.node.type === 'Crypto Ecosystem' ||
+ payload.node.type === 'Charting Space' ||
+ payload.node.type === 'Data Mine' ||
+ payload.node.type === 'Super Scripts'
+ ) {
+ return false
+ }
+
+ /* Another exception are the ones who have reference parents */
+ if (payload.referenceParent !== undefined) { return false }
+
+ /* Here we will check the position of a floatingobject to see if it is outside the screen, with a margin of one screen around. */
+ let point = thisObject.container.frame.frameThisPoint(payload.position)
+
+ if (point.x > browserCanvas.width + browserCanvas.width * radarFactor) {
+ return true
+ }
+
+ if (point.x < 0 - browserCanvas.width * radarFactor) {
+ return true
+ }
+
+ let bottom = COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT
+ let heightDiff = browserCanvas.height - bottom
+ if (point.y < bottom - heightDiff * radarFactor) {
+ return true
+ }
+
+ if (point.y > browserCanvas.height + heightDiff * radarFactor) {
+ return true
+ }
+ return false
}
- return returnPoint
- }
+ function fitIntoVisibleArea(point) {
+ /* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */
- function oneScreenUp () {
- if (visible === false) { return }
- let displaceVector = {
- x: 0,
- y: browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
+ let returnPoint = {
+ x: point.x,
+ y: point.y
+ }
+
+ if (point.x > browserCanvas.width) {
+ returnPoint.x = browserCanvas.width
+ }
+
+ if (point.x < 0) {
+ returnPoint.x = 0
+ }
+
+ if (point.y < COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT) {
+ returnPoint.y = COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT
+ }
+
+ if (point.y > browserCanvas.height) {
+ returnPoint.y = browserCanvas.height
+ }
+
+ return returnPoint
}
- thisObject.container.displace(displaceVector)
- return displaceVector
- }
+ function oneScreenUp() {
+ if (visible === false) { return }
+ let displaceVector = {
+ x: 0,
+ y: browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
+ }
- function oneScreenDown () {
- if (visible === false) { return }
- let displaceVector = {
- x: 0,
- y: -browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
+ thisObject.container.displace(displaceVector)
+ return displaceVector
}
- thisObject.container.displace(displaceVector)
- return displaceVector
- }
+ function oneScreenDown() {
+ if (visible === false) { return }
+ let displaceVector = {
+ x: 0,
+ y: -browserCanvas.height * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100
+ }
- function oneScreenLeft () {
- if (visible === false) { return }
- let displaceVector = {
- x: browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
- y: 0
+ thisObject.container.displace(displaceVector)
+ return displaceVector
}
- thisObject.container.displace(displaceVector)
- return displaceVector
- }
+ function oneScreenLeft() {
+ if (visible === false) { return }
+ let displaceVector = {
+ x: browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
+ y: 0
+ }
- function oneScreenRight () {
- if (visible === false) { return }
- let displaceVector = {
- x: -browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
- y: 0
+ thisObject.container.displace(displaceVector)
+ return displaceVector
}
- thisObject.container.displace(displaceVector)
- return displaceVector
- }
+ function oneScreenRight() {
+ if (visible === false) { return }
+ let displaceVector = {
+ x: -browserCanvas.width * PERCENTAGE_OF_SCREEN_FOR_DISPLACEMENT / 100,
+ y: 0
+ }
- function positionAtNode (node) {
- let position = thisObject.container.frame.frameThisPoint(node.payload.position)
-
- let displaceVector = {
- x: browserCanvas.width / 2 - position.x,
- y: (COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT) + (browserCanvas.height - (COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT)) / 2 - position.y
+ thisObject.container.displace(displaceVector)
+ return displaceVector
}
- thisObject.container.displace(displaceVector)
- }
+ function positionAtNode(node) {
+ let position = thisObject.container.frame.frameThisPoint(node.payload.position)
- function isThisPointVisible (point) {
- if (point.x > browserCanvas.width) {
- return false
+ let displaceVector = {
+ x: browserCanvas.width / 2 - position.x,
+ y: (COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT) + (browserCanvas.height - (COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT)) / 2 - position.y
+ }
+
+ thisObject.container.displace(displaceVector)
}
- if (point.x < 0) {
- return false
+ function isThisPointVisible(point) {
+ if (point.x > browserCanvas.width) {
+ return false
+ }
+
+ if (point.x < 0) {
+ return false
+ }
+
+ if (point.y < COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT) {
+ return false
+ }
+
+ if (point.y > browserCanvas.height) {
+ return false
+ }
+
+ return true
}
- if (point.y < COCKPIT_SPACE_POSITION + COCKPIT_SPACE_HEIGHT) {
- return false
+ function makeVisible() {
+ visible = true
}
- if (point.y > browserCanvas.height) {
- return false
+ function makeInvisible() {
+ visible = false
}
- return true
- }
+ function getContainer(point) {
+ if (visible === false) { return }
- function makeVisible () {
- visible = true
- }
+ let container
- function makeInvisible () {
- visible = false
- }
+ if (floatingObjetOnFocus !== undefined) {
+ container = floatingObjetOnFocus.getContainer(point)
+ if (container !== undefined) {
+ container.space = 'Floating Space'
+ return container
+ }
+ }
- function getContainer (point) {
- if (visible === false) { return }
+ container = thisObject.floatingLayer.getContainer(point)
+ if (container !== undefined) {
+ container.space = 'Floating Space'
+ return container
+ }
- let container
-
- if (floatingObjetOnFocus !== undefined) {
- container = floatingObjetOnFocus.getContainer(point)
- if (container !== undefined) {
- container.space = 'Floating Space'
- return container
- }
+ if (visible === true) {
+ thisObject.container.space = 'Floating Space'
+ return thisObject.container
+ }
}
- container = thisObject.floatingLayer.getContainer(point)
- if (container !== undefined) {
- container.space = 'Floating Space'
- return container
+ function physics() {
+ if (visible === false) { return }
+ browserZoomPhysics()
+ positionContraintsPhysics()
+ thisObject.floatingLayer.physics()
}
- if (visible === true) {
- thisObject.container.space = 'Floating Space'
- return thisObject.container
+ function positionContraintsPhysics() {
+ if (thisObject.container.frame.position.x > 0) {
+ thisObject.container.frame.position.x = 0
+ }
+ if (thisObject.container.frame.position.y > 0) {
+ thisObject.container.frame.position.y = 0
+ }
+ if (thisObject.container.frame.position.x + thisObject.container.frame.width < browserCanvas.width) {
+ thisObject.container.frame.position.x = browserCanvas.width - thisObject.container.frame.width
+ }
+ if (thisObject.container.frame.position.y + thisObject.container.frame.height < browserCanvas.height) {
+ thisObject.container.frame.position.y = browserCanvas.height - thisObject.container.frame.height
+ }
}
- }
- function physics () {
- if (visible === false) { return }
- browserZoomPhysics()
- positionContraintsPhysics()
- thisObject.floatingLayer.physics()
- }
+ function browserZoomPhysics() {
+ if (devicePixelRatio !== window.devicePixelRatio) {
+ devicePixelRatio = window.devicePixelRatio
- function positionContraintsPhysics () {
- if (thisObject.container.frame.position.x > 0) {
- thisObject.container.frame.position.x = 0
+ thisObject.container.frame.position.x = browserCanvas.width / 2 - thisObject.container.frame.width / 2
+ thisObject.container.frame.position.y = browserCanvas.height / 2 - thisObject.container.frame.height / 2
+ }
}
- if (thisObject.container.frame.position.y > 0) {
- thisObject.container.frame.position.y = 0
+
+ function draw() {
+ if (canWeDraw === false) { return }
+ if (visible === false) { return }
+ drawBackground()
+ thisObject.floatingLayer.draw()
}
- if (thisObject.container.frame.position.x + thisObject.container.frame.width < browserCanvas.width) {
- thisObject.container.frame.position.x = browserCanvas.width - thisObject.container.frame.width
+
+ function drawBackground() {
+ browserCanvasContext.beginPath()
+
+ browserCanvasContext.rect(thisObject.container.frame.position.x, thisObject.container.frame.position.y, thisObject.container.frame.width, thisObject.container.frame.height)
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 1)'
+
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
}
- if (thisObject.container.frame.position.y + thisObject.container.frame.height < browserCanvas.height) {
- thisObject.container.frame.position.y = browserCanvas.height - thisObject.container.frame.height
- }
- }
-
- function browserZoomPhysics () {
- if (devicePixelRatio !== window.devicePixelRatio) {
- devicePixelRatio = window.devicePixelRatio
-
- thisObject.container.frame.position.x = browserCanvas.width / 2 - thisObject.container.frame.width / 2
- thisObject.container.frame.position.y = browserCanvas.height / 2 - thisObject.container.frame.height / 2
- }
- }
-
- function draw () {
- if (canWeDraw === false) { return }
- if (visible === false) { return }
- drawBackground()
- thisObject.floatingLayer.draw()
- }
-
- function drawBackground () {
- browserCanvasContext.beginPath()
-
- browserCanvasContext.rect(thisObject.container.frame.position.x, thisObject.container.frame.position.y, thisObject.container.frame.width, thisObject.container.frame.height)
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 1)'
-
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
- }
}
diff --git a/CanvasApp/Spaces/PanelsSpace.js b/CanvasApp/Spaces/PanelsSpace.js
index a634fa26e..ecfcfdfa6 100644
--- a/CanvasApp/Spaces/PanelsSpace.js
+++ b/CanvasApp/Spaces/PanelsSpace.js
@@ -1,379 +1,379 @@
- /*
+/*
The Panel Space y the place wehre all panels live, no matter who create them.
*/
-function newPanelsSpace () {
- let thisObject = {
- visible: true,
- container: undefined,
- unHide: unHide,
- hide: hide,
- createNewPanel: createNewPanel,
- destroyPanel: destroyPanel,
- getPanel: getPanel,
- physics: physics,
- draw: draw,
- panels: [],
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize
- }
+function newPanelsSpace() {
+ let thisObject = {
+ visible: true,
+ container: undefined,
+ unHide: unHide,
+ hide: hide,
+ createNewPanel: createNewPanel,
+ destroyPanel: destroyPanel,
+ getPanel: getPanel,
+ physics: physics,
+ draw: draw,
+ panels: [],
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize
+ }
- let container = newContainer()
- container.initialize()
- thisObject.container = container
- thisObject.container.isDraggeable = false
+ let container = newContainer()
+ container.initialize()
+ thisObject.container = container
+ thisObject.container.isDraggeable = false
- container.frame.containerName = 'Panels Space'
+ container.frame.containerName = 'Panels Space'
- return thisObject
+ return thisObject
- function initialize () {
+ function initialize() {
/* The space does not create any Panels for itself, it just sits and waits others need panels. */
- }
-
- function createNewPanel (pType, pParameters, pOwner, pSession) {
- let panel
-
- switch (pType) {
-
- case 'Layers Panel':
- {
- panel = newLayersPanel()
- panel.fitFunction = canvas.chartingSpace.fitFunction
- panel.container.isVisibleFunction = canvas.chartingSpace.isThisPointVisible
- panel.type = 'Layers Panel'
- break
- }
- case 'Plotter Panel':
- {
- if (pParameters.panelNode.config.isLegacy !== true) {
- panel = newPlotterPanel()
- panel.fitFunction = canvas.chartingSpace.fitFunction
- panel.container.isVisibleFunction = canvas.chartingSpace.isThisPointVisible
- panel.session = pSession
- panel.initialize(pParameters.panelNode)
- } else {
- panel = getNewPlotterPanel(pParameters.dataMine, pParameters.plotterCodeName, pParameters.moduleCodeName, pParameters.panelNode.config.codeName)
- panel.fitFunction = canvas.chartingSpace.fitFunction
- panel.container.isVisibleFunction = canvas.chartingSpace.isThisPointVisible
- panel.session = pSession
- panel.initialize()
- }
- panel.type = 'Plotter Panel'
- break
- }
}
- panel.owner = pOwner
- thisObject.panels.push(panel)
+ function createNewPanel(pType, pParameters, pOwner, pSession) {
+ let panel
- panel.handle = newUniqueId()
+ switch (pType) {
- return panel.handle
- }
-
- function unHide (owner, type) {
- for (let i = 0; i < thisObject.panels.length; i++) {
- let panel = thisObject.panels[i]
- if (panel.owner === owner && panel.type === type) {
- panel.isHidden = false
- }
- }
- }
-
- function hide (owner, type) {
- for (let i = 0; i < thisObject.panels.length; i++) {
- let panel = thisObject.panels[i]
- if (panel.owner === owner && panel.type === type) {
- panel.isHidden = true
- }
- }
- }
-
- function destroyPanel (pPanelHandle) {
- for (let i = 0; i < thisObject.panels.length; i++) {
- let panel = thisObject.panels[i]
-
- if (panel.handle === pPanelHandle) {
- if (panel.finalize !== undefined) {
- panel.finalize()
+ case 'Layers Panel':
+ {
+ panel = newLayersPanel()
+ panel.fitFunction = canvas.chartingSpace.fitFunction
+ panel.container.isVisibleFunction = canvas.chartingSpace.isThisPointVisible
+ panel.type = 'Layers Panel'
+ break
+ }
+ case 'Plotter Panel':
+ {
+ if (pParameters.panelNode.config.isLegacy !== true) {
+ panel = newPlotterPanel()
+ panel.fitFunction = canvas.chartingSpace.fitFunction
+ panel.container.isVisibleFunction = canvas.chartingSpace.isThisPointVisible
+ panel.session = pSession
+ panel.initialize(pParameters.panelNode)
+ } else {
+ panel = getNewPlotterPanel(pParameters.dataMine, pParameters.plotterCodeName, pParameters.moduleCodeName, pParameters.panelNode.config.codeName)
+ panel.fitFunction = canvas.chartingSpace.fitFunction
+ panel.container.isVisibleFunction = canvas.chartingSpace.isThisPointVisible
+ panel.session = pSession
+ panel.initialize()
+ }
+ panel.type = 'Plotter Panel'
+ break
+ }
}
- thisObject.panels.splice(i, 1) // Delete item from array.
- return
- }
+ panel.owner = pOwner
+ thisObject.panels.push(panel)
+
+ panel.handle = newUniqueId()
+
+ return panel.handle
}
- }
- function getPanel (pPanelHandle) {
- for (let i = 0; i < thisObject.panels.length; i++) {
- let panel = thisObject.panels[i]
-
- if (panel.handle === pPanelHandle) {
- return panel
- }
- }
- }
-
- function physics () {
- if (thisObject.visible !== true) { return }
-
- childrenPhysics()
- positioningPhysics()
- }
-
- function childrenPhysics () {
- if (thisObject.panels !== undefined) {
- for (let i = 0; i < thisObject.panels.length; i++) {
- let panel = thisObject.panels[i]
- let owner = canvas.chartingSpace.inViewport.get(panel.owner)
- if (owner !== undefined) {
- if (panel.physics !== undefined) {
- panel.physics()
- }
- }
- }
- }
- }
-
- function positioningPhysics () {
- if (thisObject.panels !== undefined) {
- for (let i = 0; i < thisObject.panels.length; i++) {
- let panel = thisObject.panels[i]
- if (panel.isVisible === false || panel.isHidden === true) { continue }
- /* setting the speed of the panel */
- if (panel.container.speed === undefined) {
- panel.container.speed = {
- x: 2,
- y: 2
- }
- }
-
- /* Trying to move the panel and see if it is possible */
- let centerPoint = {
- x: panel.container.frame.position.x,
- y: panel.container.frame.position.y
- }
- centerPoint.x = centerPoint.x + panel.container.frame.width / 2
- centerPoint.y = centerPoint.y + panel.container.frame.height / 2
-
- /* Lets see which quadrant the panel is at */
- let verticalLine = (canvas.chartingSpace.viewport.visibleArea.topRight.x - canvas.chartingSpace.viewport.visibleArea.topLeft.x) / 2 + canvas.chartingSpace.viewport.visibleArea.topLeft.x
- let horizontalLine = (canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topRight.y) / 2 + canvas.chartingSpace.viewport.visibleArea.topRight.y
-
- if (panel.upDownButton !== undefined) {
- if (panel.upDownButton.status === 'up') {
- if (panel.leftRightButton !== undefined) {
- if (panel.leftRightButton.status === 'left') {
- panel.gravitatesTowards = 'topLeft'
- } else {
- panel.gravitatesTowards = 'topRight'
- }
- } else {
- if (centerPoint.x < verticalLine) {
- panel.gravitatesTowards = 'topLeft'
- } else {
- panel.gravitatesTowards = 'topRight'
- }
+ function unHide(owner, type) {
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ let panel = thisObject.panels[i]
+ if (panel.owner === owner && panel.type === type) {
+ panel.isHidden = false
}
- } else {
- if (panel.leftRightButton !== undefined) {
- if (panel.leftRightButton.status === 'left') {
- panel.gravitatesTowards = 'bottomLeft'
- } else {
- panel.gravitatesTowards = 'bottomRight'
- }
- } else {
- if (centerPoint.x < verticalLine) {
- panel.gravitatesTowards = 'bottomLeft'
- } else {
- panel.gravitatesTowards = 'bottomRight'
- }
- }
- }
- } else {
- if (centerPoint.x < verticalLine && centerPoint.y < horizontalLine) {
- panel.gravitatesTowards = 'topLeft'
- }
- if (centerPoint.x >= verticalLine && centerPoint.y < horizontalLine) {
- panel.gravitatesTowards = 'topRight'
- }
- if (centerPoint.x < verticalLine && centerPoint.y >= horizontalLine) {
- panel.gravitatesTowards = 'bottomLeft'
- }
- if (centerPoint.x >= verticalLine && centerPoint.y >= horizontalLine) {
- panel.gravitatesTowards = 'bottomRight'
- }
}
-
- /* According to the quadrant we push the panels to the sides */
- if (panel.gravitatesTowards === 'topLeft' || panel.gravitatesTowards === 'bottomLeft') {
- panel.container.frame.position.x = panel.container.frame.position.x - panel.container.speed.x
- if (panel.leftRightButton !== undefined) {
- if (panel.leftRightButton.status === 'left' || panel.leftRightButton.status === 'right') { // we avoid pushing other panels while in transition
- }
- }
- isOverlapping(i, panel.container)
- if (panel.container.frame.position.x < 0) {
- panel.container.frame.position.x = 0
- }
- } else {
- panel.container.frame.position.x = panel.container.frame.position.x + panel.container.speed.x
- isOverlapping(i, panel.container)
- if (panel.container.frame.position.x + panel.container.frame.width > browserCanvas.width) {
- panel.container.frame.position.x = browserCanvas.width - panel.container.frame.width
- }
- }
- if (panel.container.frame.height <= canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topRight.y) {
- if (panel.gravitatesTowards === 'topLeft' || panel.gravitatesTowards === 'topRight') {
- panel.container.frame.position.y = panel.container.frame.position.y - panel.container.speed.y
- isOverlapping(i, panel.container)
- if (panel.container.frame.position.y < canvas.chartingSpace.viewport.visibleArea.topLeft.y) {
- panel.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.topLeft.y
- }
- } else {
- panel.container.frame.position.y = panel.container.frame.position.y + panel.container.speed.y
- isOverlapping(i, panel.container)
- if (panel.container.frame.position.y + panel.container.frame.height > canvas.chartingSpace.viewport.visibleArea.bottomRight.y) {
- panel.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - panel.container.frame.height
- }
- }
- }
- }
}
- function isOverlapping (currentIndex, currentContainer) {
- let corner1 = {
- x: currentContainer.frame.position.x,
- y: currentContainer.frame.position.y
- }
- let corner2 = {
- x: currentContainer.frame.position.x + currentContainer.frame.width,
- y: currentContainer.frame.position.y
- }
- let corner3 = {
- x: currentContainer.frame.position.x + currentContainer.frame.width,
- y: currentContainer.frame.position.y + currentContainer.frame.height
- }
- let corner4 = {
- x: currentContainer.frame.position.x,
- y: currentContainer.frame.position.y + currentContainer.frame.height
- }
-
- for (let i = 0; i < currentIndex; i++) {
- let panel = thisObject.panels[i]
- if (panel.leftRightButton !== undefined) {
- if (panel.leftRightButton.status !== 'left' && panel.leftRightButton.status !== 'right') { // we avoid pushing other panels while in transition
- continue
- }
+ function hide(owner, type) {
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ let panel = thisObject.panels[i]
+ if (panel.owner === owner && panel.type === type) {
+ panel.isHidden = true
+ }
}
- if (panel.isVisible === true && panel.isHidden === false) {
- if (isThisPointInsideThisFrame(corner1, panel.container.frame) === true) {
- pushOut(currentContainer, panel.container, panel.gravitatesTowards)
- }
- if (isThisPointInsideThisFrame(corner2, panel.container.frame) === true) {
- pushOut(currentContainer, panel.container, panel.gravitatesTowards)
- }
- if (isThisPointInsideThisFrame(corner3, panel.container.frame) === true) {
- pushOut(currentContainer, panel.container, panel.gravitatesTowards)
- }
- if (isThisPointInsideThisFrame(corner4, panel.container.frame) === true) {
- pushOut(currentContainer, panel.container, panel.gravitatesTowards)
- }
- }
- }
-
- function pushOut (currentContainer, controlContainer, corner) {
- switch (corner) {
- case 'topLeft': {
- currentContainer.frame.position.x = controlContainer.frame.position.x + controlContainer.frame.width
- break
- }
- case 'topRight': {
- currentContainer.frame.position.x = controlContainer.frame.position.x - currentContainer.frame.width
- break
- }
- case 'bottomLeft': {
- currentContainer.frame.position.x = controlContainer.frame.position.x + controlContainer.frame.width
- break
- }
- case 'bottomRight': {
- currentContainer.frame.position.x = controlContainer.frame.position.x - currentContainer.frame.width
- break
- }
- }
- }
-
- function isThisPointInsideThisFrame (point, frame) {
- let corner1 = {
- x: frame.position.x,
- y: frame.position.y
- }
- let corner2 = {
- x: frame.position.x + frame.width,
- y: frame.position.y
- }
- let corner3 = {
- x: frame.position.x + frame.width,
- y: frame.position.y + frame.height
- }
- let corner4 = {
- x: frame.position.x,
- y: frame.position.y + frame.height
- }
- if (point.x >= corner1.x && point.y >= corner1.y && point.x <= corner3.x && point.y <= corner3.y) {
- return true
- } else {
- return false
- }
- }
- return false
}
- }
- function draw () {
- if (canWeDraw === false) { return }
- if (thisObject.visible !== true) { return }
+ function destroyPanel(pPanelHandle) {
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ let panel = thisObject.panels[i]
- thisObject.container.frame.draw(false, false)
+ if (panel.handle === pPanelHandle) {
+ if (panel.finalize !== undefined) {
+ panel.finalize()
+ }
- for (let i = 0; i < thisObject.panels.length; i++) {
- let panel = thisObject.panels[i]
- let owner = canvas.chartingSpace.inViewport.get(panel.owner)
- if (owner !== undefined) {
- if (panel.isVisible === true && panel.isHidden === false) {
- panel.draw()
+ thisObject.panels.splice(i, 1) // Delete item from array.
+ return
+ }
}
- }
}
- }
- function getContainer (point, purpose) {
- if (thisObject.visible !== true) { return }
+ function getPanel(pPanelHandle) {
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ let panel = thisObject.panels[i]
- let container
- /*
- We search for the container of panels in the oposite direction than we do it for drawing them,
- so panels overlapping others are picked firt although they are drawn last.
- */
- for (let i = thisObject.panels.length - 1; i >= 0; i--) {
- let panel = thisObject.panels[i]
- let owner = canvas.chartingSpace.inViewport.get(panel.owner)
- if (owner !== undefined) {
- if (panel.isVisible === true && panel.isHidden === false) {
- container = panel.getContainer(point, purpose)
+ if (panel.handle === pPanelHandle) {
+ return panel
+ }
}
- }
- if (container !== undefined) {
- container.space = 'Panels Space'
- return container
- }
}
- // thisObject.container.space = 'Panels Space'
- // return thisObject.container
- }
+
+ function physics() {
+ if (thisObject.visible !== true) { return }
+
+ childrenPhysics()
+ positioningPhysics()
+ }
+
+ function childrenPhysics() {
+ if (thisObject.panels !== undefined) {
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ let panel = thisObject.panels[i]
+ let owner = canvas.chartingSpace.inViewport.get(panel.owner)
+ if (owner !== undefined) {
+ if (panel.physics !== undefined) {
+ panel.physics()
+ }
+ }
+ }
+ }
+ }
+
+ function positioningPhysics() {
+ if (thisObject.panels !== undefined) {
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ let panel = thisObject.panels[i]
+ if (panel.isVisible === false || panel.isHidden === true) { continue }
+ /* setting the speed of the panel */
+ if (panel.container.speed === undefined) {
+ panel.container.speed = {
+ x: 2,
+ y: 2
+ }
+ }
+
+ /* Trying to move the panel and see if it is possible */
+ let centerPoint = {
+ x: panel.container.frame.position.x,
+ y: panel.container.frame.position.y
+ }
+ centerPoint.x = centerPoint.x + panel.container.frame.width / 2
+ centerPoint.y = centerPoint.y + panel.container.frame.height / 2
+
+ /* Lets see which quadrant the panel is at */
+ let verticalLine = (canvas.chartingSpace.viewport.visibleArea.topRight.x - canvas.chartingSpace.viewport.visibleArea.topLeft.x) / 2 + canvas.chartingSpace.viewport.visibleArea.topLeft.x
+ let horizontalLine = (canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topRight.y) / 2 + canvas.chartingSpace.viewport.visibleArea.topRight.y
+
+ if (panel.upDownButton !== undefined) {
+ if (panel.upDownButton.status === 'up') {
+ if (panel.leftRightButton !== undefined) {
+ if (panel.leftRightButton.status === 'left') {
+ panel.gravitatesTowards = 'topLeft'
+ } else {
+ panel.gravitatesTowards = 'topRight'
+ }
+ } else {
+ if (centerPoint.x < verticalLine) {
+ panel.gravitatesTowards = 'topLeft'
+ } else {
+ panel.gravitatesTowards = 'topRight'
+ }
+ }
+ } else {
+ if (panel.leftRightButton !== undefined) {
+ if (panel.leftRightButton.status === 'left') {
+ panel.gravitatesTowards = 'bottomLeft'
+ } else {
+ panel.gravitatesTowards = 'bottomRight'
+ }
+ } else {
+ if (centerPoint.x < verticalLine) {
+ panel.gravitatesTowards = 'bottomLeft'
+ } else {
+ panel.gravitatesTowards = 'bottomRight'
+ }
+ }
+ }
+ } else {
+ if (centerPoint.x < verticalLine && centerPoint.y < horizontalLine) {
+ panel.gravitatesTowards = 'topLeft'
+ }
+ if (centerPoint.x >= verticalLine && centerPoint.y < horizontalLine) {
+ panel.gravitatesTowards = 'topRight'
+ }
+ if (centerPoint.x < verticalLine && centerPoint.y >= horizontalLine) {
+ panel.gravitatesTowards = 'bottomLeft'
+ }
+ if (centerPoint.x >= verticalLine && centerPoint.y >= horizontalLine) {
+ panel.gravitatesTowards = 'bottomRight'
+ }
+ }
+
+ /* According to the quadrant we push the panels to the sides */
+ if (panel.gravitatesTowards === 'topLeft' || panel.gravitatesTowards === 'bottomLeft') {
+ panel.container.frame.position.x = panel.container.frame.position.x - panel.container.speed.x
+ if (panel.leftRightButton !== undefined) {
+ if (panel.leftRightButton.status === 'left' || panel.leftRightButton.status === 'right') { // we avoid pushing other panels while in transition
+ }
+ }
+ isOverlapping(i, panel.container)
+ if (panel.container.frame.position.x < 0) {
+ panel.container.frame.position.x = 0
+ }
+ } else {
+ panel.container.frame.position.x = panel.container.frame.position.x + panel.container.speed.x
+ isOverlapping(i, panel.container)
+ if (panel.container.frame.position.x + panel.container.frame.width > browserCanvas.width) {
+ panel.container.frame.position.x = browserCanvas.width - panel.container.frame.width
+ }
+ }
+ if (panel.container.frame.height <= canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topRight.y) {
+ if (panel.gravitatesTowards === 'topLeft' || panel.gravitatesTowards === 'topRight') {
+ panel.container.frame.position.y = panel.container.frame.position.y - panel.container.speed.y
+ isOverlapping(i, panel.container)
+ if (panel.container.frame.position.y < canvas.chartingSpace.viewport.visibleArea.topLeft.y) {
+ panel.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.topLeft.y
+ }
+ } else {
+ panel.container.frame.position.y = panel.container.frame.position.y + panel.container.speed.y
+ isOverlapping(i, panel.container)
+ if (panel.container.frame.position.y + panel.container.frame.height > canvas.chartingSpace.viewport.visibleArea.bottomRight.y) {
+ panel.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - panel.container.frame.height
+ }
+ }
+ }
+ }
+ }
+
+ function isOverlapping(currentIndex, currentContainer) {
+ let corner1 = {
+ x: currentContainer.frame.position.x,
+ y: currentContainer.frame.position.y
+ }
+ let corner2 = {
+ x: currentContainer.frame.position.x + currentContainer.frame.width,
+ y: currentContainer.frame.position.y
+ }
+ let corner3 = {
+ x: currentContainer.frame.position.x + currentContainer.frame.width,
+ y: currentContainer.frame.position.y + currentContainer.frame.height
+ }
+ let corner4 = {
+ x: currentContainer.frame.position.x,
+ y: currentContainer.frame.position.y + currentContainer.frame.height
+ }
+
+ for (let i = 0; i < currentIndex; i++) {
+ let panel = thisObject.panels[i]
+ if (panel.leftRightButton !== undefined) {
+ if (panel.leftRightButton.status !== 'left' && panel.leftRightButton.status !== 'right') { // we avoid pushing other panels while in transition
+ continue
+ }
+ }
+ if (panel.isVisible === true && panel.isHidden === false) {
+ if (isThisPointInsideThisFrame(corner1, panel.container.frame) === true) {
+ pushOut(currentContainer, panel.container, panel.gravitatesTowards)
+ }
+ if (isThisPointInsideThisFrame(corner2, panel.container.frame) === true) {
+ pushOut(currentContainer, panel.container, panel.gravitatesTowards)
+ }
+ if (isThisPointInsideThisFrame(corner3, panel.container.frame) === true) {
+ pushOut(currentContainer, panel.container, panel.gravitatesTowards)
+ }
+ if (isThisPointInsideThisFrame(corner4, panel.container.frame) === true) {
+ pushOut(currentContainer, panel.container, panel.gravitatesTowards)
+ }
+ }
+ }
+
+ function pushOut(currentContainer, controlContainer, corner) {
+ switch (corner) {
+ case 'topLeft': {
+ currentContainer.frame.position.x = controlContainer.frame.position.x + controlContainer.frame.width
+ break
+ }
+ case 'topRight': {
+ currentContainer.frame.position.x = controlContainer.frame.position.x - currentContainer.frame.width
+ break
+ }
+ case 'bottomLeft': {
+ currentContainer.frame.position.x = controlContainer.frame.position.x + controlContainer.frame.width
+ break
+ }
+ case 'bottomRight': {
+ currentContainer.frame.position.x = controlContainer.frame.position.x - currentContainer.frame.width
+ break
+ }
+ }
+ }
+
+ function isThisPointInsideThisFrame(point, frame) {
+ let corner1 = {
+ x: frame.position.x,
+ y: frame.position.y
+ }
+ let corner2 = {
+ x: frame.position.x + frame.width,
+ y: frame.position.y
+ }
+ let corner3 = {
+ x: frame.position.x + frame.width,
+ y: frame.position.y + frame.height
+ }
+ let corner4 = {
+ x: frame.position.x,
+ y: frame.position.y + frame.height
+ }
+ if (point.x >= corner1.x && point.y >= corner1.y && point.x <= corner3.x && point.y <= corner3.y) {
+ return true
+ } else {
+ return false
+ }
+ }
+ return false
+ }
+ }
+
+ function draw() {
+ if (canWeDraw === false) { return }
+ if (thisObject.visible !== true) { return }
+
+ thisObject.container.frame.draw(false, false)
+
+ for (let i = 0; i < thisObject.panels.length; i++) {
+ let panel = thisObject.panels[i]
+ let owner = canvas.chartingSpace.inViewport.get(panel.owner)
+ if (owner !== undefined) {
+ if (panel.isVisible === true && panel.isHidden === false) {
+ panel.draw()
+ }
+ }
+ }
+ }
+
+ function getContainer(point, purpose) {
+ if (thisObject.visible !== true) { return }
+
+ let container
+ /*
+ We search for the container of panels in the oposite direction than we do it for drawing them,
+ so panels overlapping others are picked firt although they are drawn last.
+ */
+ for (let i = thisObject.panels.length - 1; i >= 0; i--) {
+ let panel = thisObject.panels[i]
+ let owner = canvas.chartingSpace.inViewport.get(panel.owner)
+ if (owner !== undefined) {
+ if (panel.isVisible === true && panel.isHidden === false) {
+ container = panel.getContainer(point, purpose)
+ }
+ }
+ if (container !== undefined) {
+ container.space = 'Panels Space'
+ return container
+ }
+ }
+ // thisObject.container.space = 'Panels Space'
+ // return thisObject.container
+ }
}
diff --git a/CanvasApp/Spaces/SideSpace.js b/CanvasApp/Spaces/SideSpace.js
index a950c9b7c..145edec11 100644
--- a/CanvasApp/Spaces/SideSpace.js
+++ b/CanvasApp/Spaces/SideSpace.js
@@ -1,168 +1,168 @@
-function newSideSpace () {
- const MODULE_NAME = 'Side Space'
- let thisObject = {
- sidePanelTab: undefined,
- container: undefined,
- physics: physics,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize,
- finalize: finalize
- }
-
- let isInitialized = false
-
- thisObject.container = newContainer()
- thisObject.container.name = MODULE_NAME
- thisObject.container.initialize()
- thisObject.container.isClickeable = true
- thisObject.container.isDraggeable = false
- thisObject.container.detectMouseOver = true
- thisObject.container.status = 'hidden'
-
- let listView
-
- resize()
-
- let openingEventSubscriptionId
- let closedEventSubscriptionId
- let browserResizedEventSubscriptionId
- return thisObject
-
- function initialize () {
- thisObject.sidePanelTab = newSidePanelTab()
- thisObject.sidePanelTab.container.connectToParent(thisObject.container, false, false)
- thisObject.sidePanelTab.initialize()
-
- browserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize)
-
- initializeListView()
- isInitialized = true
- }
-
- function finalize () {
- canvas.eventHandler.stopListening(browserResizedEventSubscriptionId)
- thisObject.sidePanelTab.container.eventHandler.stopListening(openingEventSubscriptionId)
- thisObject.sidePanelTab.container.eventHandler.stopListening(closedEventSubscriptionId)
- }
-
- function initializeListView () {
- listView = newListView()
- listView.initialize()
- listView.container.connectToParent(thisObject.container, false, false)
- openingEventSubscriptionId = thisObject.sidePanelTab.container.eventHandler.listenToEvent('opening', listView.turnOn)
- closedEventSubscriptionId = thisObject.sidePanelTab.container.eventHandler.listenToEvent('closed', listView.turnOff)
- }
-
- function resize () {
- thisObject.container.frame.width = SIDE_PANEL_WIDTH
- thisObject.container.frame.height = browserCanvas.height // - TOP_SPACE_HEIGHT
- thisObject.container.frame.position.x = -SIDE_PANEL_WIDTH
- thisObject.container.frame.position.y = 0 // TOP_SPACE_HEIGHT
-
- if (listView !== undefined) {
- listView.resize()
+function newSideSpace() {
+ const MODULE_NAME = 'Side Space'
+ let thisObject = {
+ sidePanelTab: undefined,
+ container: undefined,
+ physics: physics,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize,
+ finalize: finalize
}
- if (thisObject.sidePanelTab !== undefined) {
- thisObject.sidePanelTab.resize()
- }
- }
+ let isInitialized = false
- function getContainer (point, purpose) {
- let container
+ thisObject.container = newContainer()
+ thisObject.container.name = MODULE_NAME
+ thisObject.container.initialize()
+ thisObject.container.isClickeable = true
+ thisObject.container.isDraggeable = false
+ thisObject.container.detectMouseOver = true
+ thisObject.container.status = 'hidden'
- container = thisObject.sidePanelTab.getContainer(point, purpose)
- if (container !== undefined) { return container }
+ let listView
- container = listView.getContainer(point, purpose)
- if (container !== undefined) { return container }
+ resize()
- if (thisObject.container.frame.isThisPointHere(point, true) === true) {
- return thisObject.container
- } else {
- return undefined
- }
- }
+ let openingEventSubscriptionId
+ let closedEventSubscriptionId
+ let browserResizedEventSubscriptionId
+ return thisObject
- function physics () {
- thisObject.sidePanelTab.physics()
- listView.physics()
- }
+ function initialize() {
+ thisObject.sidePanelTab = newSidePanelTab()
+ thisObject.sidePanelTab.container.connectToParent(thisObject.container, false, false)
+ thisObject.sidePanelTab.initialize()
- function draw () {
- if (canWeDraw === false) { return }
- if (isInitialized === false) { return }
- borders()
- thisObject.sidePanelTab.draw()
- listView.draw()
- }
+ browserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize)
- function borders () {
- let point1
- let point2
- let point3
- let point4
-
- point1 = {
- x: 0,
- y: 0
+ initializeListView()
+ isInitialized = true
}
- point2 = {
- x: thisObject.container.frame.width,
- y: 0
+ function finalize() {
+ canvas.eventHandler.stopListening(browserResizedEventSubscriptionId)
+ thisObject.sidePanelTab.container.eventHandler.stopListening(openingEventSubscriptionId)
+ thisObject.sidePanelTab.container.eventHandler.stopListening(closedEventSubscriptionId)
}
- point3 = {
- x: thisObject.container.frame.width,
- y: thisObject.container.frame.height
+ function initializeListView() {
+ listView = newListView()
+ listView.initialize()
+ listView.container.connectToParent(thisObject.container, false, false)
+ openingEventSubscriptionId = thisObject.sidePanelTab.container.eventHandler.listenToEvent('opening', listView.turnOn)
+ closedEventSubscriptionId = thisObject.sidePanelTab.container.eventHandler.listenToEvent('closed', listView.turnOff)
}
- point4 = {
- x: 0,
- y: thisObject.container.frame.height
+ function resize() {
+ thisObject.container.frame.width = SIDE_PANEL_WIDTH
+ thisObject.container.frame.height = browserCanvas.height // - TOP_SPACE_HEIGHT
+ thisObject.container.frame.position.x = -SIDE_PANEL_WIDTH
+ thisObject.container.frame.position.y = 0 // TOP_SPACE_HEIGHT
+
+ if (listView !== undefined) {
+ listView.resize()
+ }
+
+ if (thisObject.sidePanelTab !== undefined) {
+ thisObject.sidePanelTab.resize()
+ }
}
- point1 = thisObject.container.frame.frameThisPoint(point1)
- point2 = thisObject.container.frame.frameThisPoint(point2)
- point3 = thisObject.container.frame.frameThisPoint(point3)
- point4 = thisObject.container.frame.frameThisPoint(point4)
+ function getContainer(point, purpose) {
+ let container
- browserCanvasContext.setLineDash([0, 0])
- browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point1.x, point1.y)
- browserCanvasContext.lineTo(point2.x, point2.y)
- browserCanvasContext.lineTo(point3.x, point3.y)
- browserCanvasContext.lineTo(point4.x, point4.y)
- browserCanvasContext.lineTo(point1.x, point1.y)
- browserCanvasContext.closePath()
+ container = thisObject.sidePanelTab.getContainer(point, purpose)
+ if (container !== undefined) { return container }
- let opacity = 1
+ container = listView.getContainer(point, purpose)
+ if (container !== undefined) { return container }
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + opacity + ''
- browserCanvasContext.fill()
+ if (thisObject.container.frame.isThisPointHere(point, true) === true) {
+ return thisObject.container
+ } else {
+ return undefined
+ }
+ }
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + opacity + ''
- browserCanvasContext.lineWidth = 0.3
- browserCanvasContext.stroke()
+ function physics() {
+ thisObject.sidePanelTab.physics()
+ listView.physics()
+ }
- /* Shadow */
+ function draw() {
+ if (canWeDraw === false) { return }
+ if (isInitialized === false) { return }
+ borders()
+ thisObject.sidePanelTab.draw()
+ listView.draw()
+ }
- if (thisObject.container.status !== 'hidden') {
- for (let i = 0; i <= 30; i++) {
- opacity = 1 - (i / 300) - 0.95
+ function borders() {
+ let point1
+ let point2
+ let point3
+ let point4
+
+ point1 = {
+ x: 0,
+ y: 0
+ }
+
+ point2 = {
+ x: thisObject.container.frame.width,
+ y: 0
+ }
+
+ point3 = {
+ x: thisObject.container.frame.width,
+ y: thisObject.container.frame.height
+ }
+
+ point4 = {
+ x: 0,
+ y: thisObject.container.frame.height
+ }
+
+ point1 = thisObject.container.frame.frameThisPoint(point1)
+ point2 = thisObject.container.frame.frameThisPoint(point2)
+ point3 = thisObject.container.frame.frameThisPoint(point3)
+ point4 = thisObject.container.frame.frameThisPoint(point4)
browserCanvasContext.setLineDash([0, 0])
browserCanvasContext.beginPath()
- browserCanvasContext.moveTo(point2.x + i, point2.y)
- browserCanvasContext.lineTo(point3.x + i, point3.y)
+ browserCanvasContext.moveTo(point1.x, point1.y)
+ browserCanvasContext.lineTo(point2.x, point2.y)
+ browserCanvasContext.lineTo(point3.x, point3.y)
+ browserCanvasContext.lineTo(point4.x, point4.y)
+ browserCanvasContext.lineTo(point1.x, point1.y)
browserCanvasContext.closePath()
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + opacity + ''
- browserCanvasContext.lineWidth = 1
+ let opacity = 1
+
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + opacity + ''
+ browserCanvasContext.fill()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.GREY + ', ' + opacity + ''
+ browserCanvasContext.lineWidth = 0.3
browserCanvasContext.stroke()
- }
+
+ /* Shadow */
+
+ if (thisObject.container.status !== 'hidden') {
+ for (let i = 0; i <= 30; i++) {
+ opacity = 1 - (i / 300) - 0.95
+
+ browserCanvasContext.setLineDash([0, 0])
+ browserCanvasContext.beginPath()
+ browserCanvasContext.moveTo(point2.x + i, point2.y)
+ browserCanvasContext.lineTo(point3.x + i, point3.y)
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + opacity + ''
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.stroke()
+ }
+ }
}
- }
}
diff --git a/CanvasApp/Spaces/TopSpace.js b/CanvasApp/Spaces/TopSpace.js
index c88dd2960..1e511a780 100644
--- a/CanvasApp/Spaces/TopSpace.js
+++ b/CanvasApp/Spaces/TopSpace.js
@@ -1,109 +1,109 @@
-function newTopSpace () {
- let thisObject = {
- container: undefined,
- draw: draw,
- getContainer: getContainer,
- initialize: initialize
- }
-
- thisObject.container = newContainer()
- thisObject.container.initialize()
-
- resize()
-
- thisObject.container.isDraggeable = false
- let backgroundImage
- let logoImage
- return thisObject
-
- function initialize () {
- canvas.eventHandler.listenToEvent('Browser Resized', resize)
-
- backgroundImage = new Image()
- logoImage = new Image()
-
- loadImage('superalgos-header-background', backgroundImage)
- loadImage('superalgos-logo-for-color-background', logoImage)
-
- function loadImage (name, image) {
- const PATH = 'Images/'
-
- image.onload = onImageLoad
- image.fileName = name
-
- function onImageLoad () {
- image.canDraw = true
- }
- image.src = window.canvasApp.urlPrefix + PATH + name + '.png'
+function newTopSpace() {
+ let thisObject = {
+ container: undefined,
+ draw: draw,
+ getContainer: getContainer,
+ initialize: initialize
}
- }
- function resize () {
- thisObject.container.frame.width = browserCanvas.width
- thisObject.container.frame.height = TOP_SPACE_HEIGHT
+ thisObject.container = newContainer()
+ thisObject.container.initialize()
- thisObject.container.frame.position.x = 0
- try {
- thisObject.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y
- } catch (e) { }
- }
+ resize()
- function getContainer (point) {
+ thisObject.container.isDraggeable = false
+ let backgroundImage
+ let logoImage
+ return thisObject
- }
+ function initialize() {
+ canvas.eventHandler.listenToEvent('Browser Resized', resize)
- function draw () {
- if (canWeDraw === false) { return }
- thisObject.container.frame.draw(false, false)
+ backgroundImage = new Image()
+ logoImage = new Image()
- drawBackground()
- return
- }
+ loadImage('superalgos-header-background', backgroundImage)
+ loadImage('superalgos-logo-for-color-background', logoImage)
- function drawBackground () {
- /* Solid Color */
- let opacity = 1
- browserCanvasContext.beginPath()
- browserCanvasContext.rect(0, 0, thisObject.container.frame.width, thisObject.container.frame.height)
- if (ARE_WE_RECORDING_A_VIDEO === true) {
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', ' + opacity + ')'
- } else {
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ')'
+ function loadImage(name, image) {
+ const PATH = 'Images/'
+
+ image.onload = onImageLoad
+ image.fileName = name
+
+ function onImageLoad() {
+ image.canDraw = true
+ }
+ image.src = window.canvasApp.urlPrefix + PATH + name + '.png'
+ }
}
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
- /* Background Image */
- if (backgroundImage !== undefined) {
- if (backgroundImage.canDraw === true) {
- let imagePosition = {
- x: 0,
- y: 0
+ function resize() {
+ thisObject.container.frame.width = browserCanvas.width
+ thisObject.container.frame.height = TOP_SPACE_HEIGHT
+
+ thisObject.container.frame.position.x = 0
+ try {
+ thisObject.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y
+ } catch (e) { }
+ }
+
+ function getContainer(point) {
+
+ }
+
+ function draw() {
+ if (canWeDraw === false) { return }
+ thisObject.container.frame.draw(false, false)
+
+ drawBackground()
+ return
+ }
+
+ function drawBackground() {
+ /* Solid Color */
+ let opacity = 1
+ browserCanvasContext.beginPath()
+ browserCanvasContext.rect(0, 0, thisObject.container.frame.width, thisObject.container.frame.height)
+ if (ARE_WE_RECORDING_A_VIDEO === true) {
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', ' + opacity + ')'
+ } else {
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.RUSTED_RED + ', ' + opacity + ')'
+ }
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
+
+ /* Background Image */
+ if (backgroundImage !== undefined) {
+ if (backgroundImage.canDraw === true) {
+ let imagePosition = {
+ x: 0,
+ y: 0
+ }
+
+ browserCanvasContext.drawImage(
+ backgroundImage, imagePosition.x,
+ imagePosition.y,
+ browserCanvas.width,
+ TOP_SPACE_HEIGHT - 2)
+ }
}
- browserCanvasContext.drawImage(
- backgroundImage, imagePosition.x,
- imagePosition.y,
- browserCanvas.width,
- TOP_SPACE_HEIGHT - 2)
- }
- }
+ /* Logo Image */
+ if (logoImage !== undefined) {
+ if (logoImage.canDraw === true) {
+ let imagePosition = {
+ x: 10,
+ y: 0
+ }
- /* Logo Image */
- if (logoImage !== undefined) {
- if (logoImage.canDraw === true) {
- let imagePosition = {
- x: 10,
- y: 0
+ browserCanvasContext.drawImage(
+ logoImage, imagePosition.x,
+ imagePosition.y,
+ 150,
+ TOP_SPACE_HEIGHT - 2)
+ }
}
-
- browserCanvasContext.drawImage(
- logoImage, imagePosition.x,
- imagePosition.y,
- 150,
- TOP_SPACE_HEIGHT - 2)
- }
}
- }
}
diff --git a/CanvasApp/SplashScreen.js b/CanvasApp/SplashScreen.js
index 6e7dfa436..ca8662ced 100644
--- a/CanvasApp/SplashScreen.js
+++ b/CanvasApp/SplashScreen.js
@@ -1,160 +1,160 @@
- /*
+/*
The Splash Screen is to show some 'loading...' controls while the app is being loaded on the background. After the loading is complete the Splash Screens dissapears for good.
*/
-function newSplashScreen () {
- let thisObject = {
- container: undefined,
- draw: draw,
- timeMachines: [],
- getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
- initialize: initialize
- }
-
- let container = newContainer()
- container.initialize()
- thisObject.container = container
-
- resize()
-
- container.frame.containerName = 'Splash Screen'
-
- container.frame.position.x = 0
- container.frame.position.y = 0
-
- container.isDraggeable = false
-
- let fadeOutCounter = 0
- let opacity = 1
-
- let logo
- let canDrawLogo = false
- let isInitialized = false
- let splashScreenNeeded = true
-
- return thisObject
-
- function initialize () {
- logo = new Image()
- logo.onload = onImageLoad
-
- function onImageLoad () {
- canDrawLogo = true
- }
- logo.src = window.canvasApp.urlPrefix + 'Images/superalgos-logo.png'
- canvas.eventHandler.listenToEvent('Browser Resized', resize)
-
- isInitialized = true
- }
-
- function resize () {
- thisObject.container.frame.width = browserCanvas.width
- thisObject.container.frame.height = browserCanvas.height
- }
-
- function draw () {
- if (isInitialized === false) { return }
- if (splashScreenNeeded === false) {
- stepsInitializationCounter = 100
- canDrawLogo = false
-
- fadeOutCounter++
-
- if (fadeOutCounter > 2) {
- return
- }
- opacity = opacity - 1
+function newSplashScreen() {
+ let thisObject = {
+ container: undefined,
+ draw: draw,
+ timeMachines: [],
+ getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
+ initialize: initialize
}
- thisObject.container.frame.draw(false, false)
+ let container = newContainer()
+ container.initialize()
+ thisObject.container = container
+
+ resize()
+
+ container.frame.containerName = 'Splash Screen'
+
+ container.frame.position.x = 0
+ container.frame.position.y = 0
+
+ container.isDraggeable = false
+
+ let fadeOutCounter = 0
+ let opacity = 1
+
+ let logo
+ let canDrawLogo = false
+ let isInitialized = false
+ let splashScreenNeeded = true
+
+ return thisObject
+
+ function initialize() {
+ logo = new Image()
+ logo.onload = onImageLoad
+
+ function onImageLoad() {
+ canDrawLogo = true
+ }
+ logo.src = window.canvasApp.urlPrefix + 'Images/superalgos-logo.png'
+ canvas.eventHandler.listenToEvent('Browser Resized', resize)
+
+ isInitialized = true
+ }
+
+ function resize() {
+ thisObject.container.frame.width = browserCanvas.width
+ thisObject.container.frame.height = browserCanvas.height
+ }
+
+ function draw() {
+ if (isInitialized === false) { return }
+ if (splashScreenNeeded === false) {
+ stepsInitializationCounter = 100
+ canDrawLogo = false
+
+ fadeOutCounter++
+
+ if (fadeOutCounter > 2) {
+ return
+ }
+ opacity = opacity - 1
+ }
+
+ thisObject.container.frame.draw(false, false)
/* Set the background. */
- browserCanvasContext.beginPath()
- browserCanvasContext.rect(0, 0, thisObject.container.frame.width, thisObject.container.frame.height)
- browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ')'
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
+ browserCanvasContext.beginPath()
+ browserCanvasContext.rect(0, 0, thisObject.container.frame.width, thisObject.container.frame.height)
+ browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', ' + opacity + ')'
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
- if (canDrawLogo === false) { return }
+ if (canDrawLogo === false) { return }
/* First the AA Logo. */
- let imageHeight = 192 / 2
- let imageWidth = 720 / 2
- let yDisplacement = -60
- let xDisplacement = -60
+ let imageHeight = 192 / 2
+ let imageWidth = 720 / 2
+ let yDisplacement = -60
+ let xDisplacement = -60
- let imagePoint = {
- x: thisObject.container.frame.width * 1 / 2 - imageWidth / 2 + xDisplacement,
- y: thisObject.container.frame.height * 1 / 2 - imageHeight / 2 + yDisplacement
- }
+ let imagePoint = {
+ x: thisObject.container.frame.width * 1 / 2 - imageWidth / 2 + xDisplacement,
+ y: thisObject.container.frame.height * 1 / 2 - imageHeight / 2 + yDisplacement
+ }
- imagePoint = thisObject.container.frame.frameThisPoint(imagePoint)
+ imagePoint = thisObject.container.frame.frameThisPoint(imagePoint)
- browserCanvasContext.drawImage(logo, imagePoint.x, imagePoint.y, imageWidth, imageHeight)
+ browserCanvasContext.drawImage(logo, imagePoint.x, imagePoint.y, imageWidth, imageHeight)
/* Second the % of Advance. */
- let label = '' + Math.trunc(stepsInitializationCounter) + ' %'
- stepsInitializationCounter = stepsInitializationCounter + 5.0
+ let label = '' + Math.trunc(stepsInitializationCounter) + ' %'
+ stepsInitializationCounter = stepsInitializationCounter + 5.0
- if (stepsInitializationCounter > 99) {
- splashScreenNeeded = false
- canWeDraw = true
- stepsInitializationCounter = 99
- }
+ if (stepsInitializationCounter > 99) {
+ splashScreenNeeded = false
+ canWeDraw = true
+ stepsInitializationCounter = 99
+ }
- let fontSize = 15
+ let fontSize = 15
- let labelPoint = {
- x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 22,
- y: thisObject.container.frame.height / 2 + fontSize / 2 + fontSize * 0.1 + 90 + yDisplacement
- }
+ let labelPoint = {
+ x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 22,
+ y: thisObject.container.frame.height / 2 + fontSize / 2 + fontSize * 0.1 + 90 + yDisplacement
+ }
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(0, 0, 0, ' + opacity + ')'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(0, 0, 0, ' + opacity + ')'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
- let title
- let titlePoint
+ let title
+ let titlePoint
/* Algo Bots Competitions Sub Title */
- fontSize = 35
+ fontSize = 35
- title = 'Beta 6'
+ title = 'Beta 6'
- titlePoint = {
- x: thisObject.container.frame.width / 2 - title.length / 2 * fontSize * FONT_ASPECT_RATIO - 20,
- y: thisObject.container.frame.height / 2 + 70 + yDisplacement
+ titlePoint = {
+ x: thisObject.container.frame.width / 2 - title.length / 2 * fontSize * FONT_ASPECT_RATIO - 20,
+ y: thisObject.container.frame.height / 2 + 70 + yDisplacement
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.font = 'Saira Condensed'
+ browserCanvasContext.fillStyle = 'rgba(0, 0, 0, ' + opacity + ')'
+ browserCanvasContext.fillText(title, titlePoint.x, titlePoint.y)
}
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.font = 'Saira Condensed'
- browserCanvasContext.fillStyle = 'rgba(0, 0, 0, ' + opacity + ')'
- browserCanvasContext.fillText(title, titlePoint.x, titlePoint.y)
- }
-
- function getContainer (point) {
- var container
+ function getContainer(point) {
+ var container
/* First we check if this point is inside this space. */
- if (thisObject.container.frame.isThisPointHere(point) === true) {
+ if (thisObject.container.frame.isThisPointHere(point) === true) {
/* Now we see which is the inner most container that has it */
// add validation of inner most containers here.
/* The point does not belong to any inner container, so we return the current container. */
- return thisObject.container
- } else {
+ return thisObject.container
+ } else {
/* This point does not belong to this space. */
- return undefined
+ return undefined
+ }
}
- }
}
diff --git a/CanvasApp/Utilities.js b/CanvasApp/Utilities.js
index 4a434bba8..11eeb5a37 100644
--- a/CanvasApp/Utilities.js
+++ b/CanvasApp/Utilities.js
@@ -1,90 +1,90 @@
-function getNodeDefinition (node) {
- let key = node.type
- return APP_SCHEMA_MAP.get(key)
+function getNodeDefinition(node) {
+ let key = node.type
+ return APP_SCHEMA_MAP.get(key)
}
-function dynamicDecimals (value, minDecimals) {
- if (minDecimals === undefined) {
- minDecimals = 0
- }
- let decimals = 2
- if (value < 1) { decimals = 4 }
- if (Math.abs(Math.trunc(value * 100)) < 1) { decimals = 6 }
- if (Math.abs(Math.trunc(value * 10000)) < 1) { decimals = 8 }
- if (Math.abs(Math.trunc(value * 1000000)) < 1) { decimals = 10 }
- if (Math.abs(Math.trunc(value * 100000000)) < 1) { decimals = 12 }
- if (Math.abs(Math.trunc(value * 10000000000)) < 1) { value = 0; decimals = 0 }
- if (Math.trunc(value) === value) { decimals = minDecimals }
- let returnValue = Number(value).toFixed(decimals)
- return returnValue
-}
-
-function convertTimeFrameToName (pTimeFrame) {
- for (let i = 0; i < dailyFilePeriods.length; i++) {
- let period = dailyFilePeriods[i]
- if (period[0] === pTimeFrame) {
- return period[1]
+function dynamicDecimals(value, minDecimals) {
+ if (minDecimals === undefined) {
+ minDecimals = 0
}
- }
+ let decimals = 2
+ if (value < 1) { decimals = 4 }
+ if (Math.abs(Math.trunc(value * 100)) < 1) { decimals = 6 }
+ if (Math.abs(Math.trunc(value * 10000)) < 1) { decimals = 8 }
+ if (Math.abs(Math.trunc(value * 1000000)) < 1) { decimals = 10 }
+ if (Math.abs(Math.trunc(value * 100000000)) < 1) { decimals = 12 }
+ if (Math.abs(Math.trunc(value * 10000000000)) < 1) { value = 0; decimals = 0 }
+ if (Math.trunc(value) === value) { decimals = minDecimals }
+ let returnValue = Number(value).toFixed(decimals)
+ return returnValue
+}
- for (let i = 0; i < marketFilesPeriods.length; i++) {
- let period = marketFilesPeriods[i]
- if (period[0] === pTimeFrame) {
- return period[1]
+function convertTimeFrameToName(pTimeFrame) {
+ for (let i = 0; i < dailyFilePeriods.length; i++) {
+ let period = dailyFilePeriods[i]
+ if (period[0] === pTimeFrame) {
+ return period[1]
+ }
}
- }
-}
-function nextPorwerOf10 (number) {
- for (let i = -10; i <= 10; i++) {
- if (number < Math.pow(10, i)) {
- return Math.pow(10, i)
+ for (let i = 0; i < marketFilesPeriods.length; i++) {
+ let period = marketFilesPeriods[i]
+ if (period[0] === pTimeFrame) {
+ return period[1]
+ }
}
- }
}
-function pad (str, max) {
- str = str.toString()
- return str.length < max ? pad('0' + str, max) : str
+function nextPorwerOf10(number) {
+ for (let i = -10; i <= 10; i++) {
+ if (number < Math.pow(10, i)) {
+ return Math.pow(10, i)
+ }
+ }
}
-function moveToUserPosition (container, currentDate, currentRate, coordinateSystem, ignoreX, ignoreY, mousePosition, fitFunction) {
- let targetPoint = {
- x: currentDate.valueOf(),
- y: currentRate
- }
-
- /* Put this point in the coordinate system of the canvas.chartingSpace.viewport */
- targetPoint = coordinateSystem.transformThisPoint(targetPoint)
- targetPoint = transformThisPoint(targetPoint, container)
-
- let displaceVector
-
- let targetNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(targetPoint)
- let mouseNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mousePosition)
-
- displaceVector = {
- x: mouseNoZoom.x - targetNoZoom.x,
- y: mouseNoZoom.y - targetNoZoom.y
- }
-
- if (ignoreX) { displaceVector.x = 0 }
- if (ignoreY) { displaceVector.y = 0 }
-
- container.displace(displaceVector)
+function pad(str, max) {
+ str = str.toString()
+ return str.length < max ? pad('0' + str, max) : str
}
-function removeTime (datetime) {
- if (datetime === undefined) { return }
+function moveToUserPosition(container, currentDate, currentRate, coordinateSystem, ignoreX, ignoreY, mousePosition, fitFunction) {
+ let targetPoint = {
+ x: currentDate.valueOf(),
+ y: currentRate
+ }
- let dateOnly = new Date(Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS) * ONE_DAY_IN_MILISECONDS)
+ /* Put this point in the coordinate system of the canvas.chartingSpace.viewport */
+ targetPoint = coordinateSystem.transformThisPoint(targetPoint)
+ targetPoint = transformThisPoint(targetPoint, container)
- return dateOnly
+ let displaceVector
+
+ let targetNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(targetPoint)
+ let mouseNoZoom = canvas.chartingSpace.viewport.unTransformThisPoint(mousePosition)
+
+ displaceVector = {
+ x: mouseNoZoom.x - targetNoZoom.x,
+ y: mouseNoZoom.y - targetNoZoom.y
+ }
+
+ if (ignoreX) { displaceVector.x = 0 }
+ if (ignoreY) { displaceVector.y = 0 }
+
+ container.displace(displaceVector)
}
-function newUniqueId () {
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
- var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8)
- return v.toString(16)
- })
+function removeTime(datetime) {
+ if (datetime === undefined) { return }
+
+ let dateOnly = new Date(Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS) * ONE_DAY_IN_MILISECONDS)
+
+ return dateOnly
+}
+
+function newUniqueId() {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+ var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8)
+ return v.toString(16)
+ })
}
diff --git a/CanvasApp/Utilities/CoordinateTransformations.js b/CanvasApp/Utilities/CoordinateTransformations.js
index 9f3f9444d..845210a9c 100644
--- a/CanvasApp/Utilities/CoordinateTransformations.js
+++ b/CanvasApp/Utilities/CoordinateTransformations.js
@@ -1,18 +1,18 @@
-function transformThisPoint (point, container) {
+function transformThisPoint(point, container) {
/* We make the point relative to the current frame */
- point = container.frame.frameThisPoint(point)
+ point = container.frame.frameThisPoint(point)
/* We pass this point through the canvas.chartingSpace.viewport lends, meaning we apply the canvas.chartingSpace.viewport zoom and displacement. */
- point = canvas.chartingSpace.viewport.transformThisPoint(point)
+ point = canvas.chartingSpace.viewport.transformThisPoint(point)
- return point
+ return point
}
-function unTransformThisPoint (point, container) {
- point = canvas.chartingSpace.viewport.unTransformThisPoint(point)
- point = container.frame.unframeThisPoint(point)
+function unTransformThisPoint(point, container) {
+ point = canvas.chartingSpace.viewport.unTransformThisPoint(point)
+ point = container.frame.unframeThisPoint(point)
- return point
+ return point
}
diff --git a/CanvasApp/Utilities/DateRateTransformations.js b/CanvasApp/Utilities/DateRateTransformations.js
index 196c99ecc..4829787ed 100644
--- a/CanvasApp/Utilities/DateRateTransformations.js
+++ b/CanvasApp/Utilities/DateRateTransformations.js
@@ -1,53 +1,53 @@
-function getDateFromPointAtBrowserCanvas (point, container, coordinateSystem) {
- point = unTransformThisPoint(point, container)
- point = coordinateSystem.unInverseTransform(point, container.frame.height)
+function getDateFromPointAtBrowserCanvas(point, container, coordinateSystem) {
+ point = unTransformThisPoint(point, container)
+ point = coordinateSystem.unInverseTransform(point, container.frame.height)
- let date = new Date(point.x)
+ let date = new Date(point.x)
- return date
+ return date
}
-function getDateFromPointAtChartsSpace (point, container, coordinateSystem) {
- point = container.frame.unframeThisPoint(point)
- point = coordinateSystem.unInverseTransform(point, container.frame.height)
+function getDateFromPointAtChartsSpace(point, container, coordinateSystem) {
+ point = container.frame.unframeThisPoint(point)
+ point = coordinateSystem.unInverseTransform(point, container.frame.height)
- let date = new Date(point.x)
+ let date = new Date(point.x)
- return date
+ return date
}
-function getDateFromPointAtContainer (point, container, coordinateSystem) {
- point = coordinateSystem.unInverseTransform(point, container.frame.height)
+function getDateFromPointAtContainer(point, container, coordinateSystem) {
+ point = coordinateSystem.unInverseTransform(point, container.frame.height)
- let date = new Date(point.x)
+ let date = new Date(point.x)
- return date
+ return date
}
-function getRateFromPointAtBrowserCanvas (point, container, coordinateSystem) {
- point = unTransformThisPoint(point, container)
- point = coordinateSystem.unInverseTransform(point, container.frame.height)
+function getRateFromPointAtBrowserCanvas(point, container, coordinateSystem) {
+ point = unTransformThisPoint(point, container)
+ point = coordinateSystem.unInverseTransform(point, container.frame.height)
- return point.y
+ return point.y
}
-function getRateFromPointAtChartingSpace (point, container, coordinateSystem) {
- point = container.frame.unframeThisPoint(point)
- point = coordinateSystem.unInverseTransform(point, container.frame.height)
+function getRateFromPointAtChartingSpace(point, container, coordinateSystem) {
+ point = container.frame.unframeThisPoint(point)
+ point = coordinateSystem.unInverseTransform(point, container.frame.height)
- return point.y
+ return point.y
}
-function getRateFromPointAtContainer (point, container, coordinateSystem) {
- point = coordinateSystem.unInverseTransform(point, container.frame.height)
+function getRateFromPointAtContainer(point, container, coordinateSystem) {
+ point = coordinateSystem.unInverseTransform(point, container.frame.height)
- return point.y
+ return point.y
}
-function getMilisecondsFromPoint (point, container, coordinateSystem) {
- point = unTransformThisPoint(point, container)
- point = coordinateSystem.unInverseTransform(point, container.frame.height)
+function getMilisecondsFromPoint(point, container, coordinateSystem) {
+ point = unTransformThisPoint(point, container)
+ point = coordinateSystem.unInverseTransform(point, container.frame.height)
- return point.x
+ return point.x
}
diff --git a/CanvasApp/Utilities/Download.js b/CanvasApp/Utilities/Download.js
index 39e8e3884..b6007dac2 100644
--- a/CanvasApp/Utilities/Download.js
+++ b/CanvasApp/Utilities/Download.js
@@ -1,58 +1,58 @@
-function downloadText (filename, text) {
- let element = document.createElement('a')
- element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text))
- element.setAttribute('download', filename)
- element.style.display = 'none'
- document.body.appendChild(element)
- element.click()
- document.body.removeChild(element)
+function downloadText(filename, text) {
+ let element = document.createElement('a')
+ element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text))
+ element.setAttribute('download', filename)
+ element.style.display = 'none'
+ document.body.appendChild(element)
+ element.click()
+ document.body.removeChild(element)
}
-function downloadCanvas (filename, canvasToUse) {
- let data = canvasToUse.toDataURL('image/png', 1)
- /* Change MIME type to trick the browser to downlaod the file instead of displaying it */
- data = data.replace(/^data:image\/[^;]*/, 'data:application/octet-stream')
+function downloadCanvas(filename, canvasToUse) {
+ let data = canvasToUse.toDataURL('image/png', 1)
+ /* Change MIME type to trick the browser to downlaod the file instead of displaying it */
+ data = data.replace(/^data:image\/[^;]*/, 'data:application/octet-stream')
- /* In addition to 's "download" attribute, you can define HTTP-style headers */
- data = data.replace(/^data:application\/octet-stream/, 'data:application/octet-stream;headers=Content-Disposition%3A%20attachment%3B%20filename=' + filename + '.png')
+ /* In addition to 's "download" attribute, you can define HTTP-style headers */
+ data = data.replace(/^data:application\/octet-stream/, 'data:application/octet-stream;headers=Content-Disposition%3A%20attachment%3B%20filename=' + filename + '.png')
- let element = document.createElement('a')
- element.setAttribute('href', data)
- element.setAttribute('download', filename + '.PNG')
- element.style.display = 'none'
- document.body.appendChild(element)
- element.click()
- document.body.removeChild(element)
+ let element = document.createElement('a')
+ element.setAttribute('href', data)
+ element.setAttribute('download', filename + '.PNG')
+ element.style.display = 'none'
+ document.body.appendChild(element)
+ element.click()
+ document.body.removeChild(element)
};
-function downloadPanorama (filename) {
- let INITIAL_WIDTH = 800
- let FINAL_WIDTH = browserCanvas.width - INITIAL_WIDTH
+function downloadPanorama(filename) {
+ let INITIAL_WIDTH = 800
+ let FINAL_WIDTH = browserCanvas.width - INITIAL_WIDTH
- if (ARE_WE_RECORDING_A_MARKET_PANORAMA === false) {
- /* We start recording the panorame. */
- ARE_WE_RECORDING_A_MARKET_PANORAMA = true
- marketPanoramaCanvas = document.createElement('canvas')
- marketPanoramaCanvas.width = INITIAL_WIDTH * 50
- marketPanoramaCanvas.height = browserCanvas.height
- marketPanoramaCanvas.getContext('2d').drawImage(browserCanvas, 0, 0, INITIAL_WIDTH, browserCanvas.height, 0, 0, INITIAL_WIDTH, browserCanvas.height)
- CURRENT_PANORAMA_POSITION = INITIAL_WIDTH
- } else {
- /* We stop recording and download the resulting image. */
- ARE_WE_RECORDING_A_MARKET_PANORAMA = false
- marketPanoramaCanvas.getContext('2d').drawImage(browserCanvas, browserCanvas.width - FINAL_WIDTH, 0, FINAL_WIDTH, browserCanvas.height, CURRENT_PANORAMA_POSITION, 0, FINAL_WIDTH, browserCanvas.height)
- let finalResultCanvas = document.createElement('canvas')
- finalResultCanvas.width = CURRENT_PANORAMA_POSITION + FINAL_WIDTH
- finalResultCanvas.height = browserCanvas.height
- finalResultCanvas.getContext('2d').drawImage(marketPanoramaCanvas, 0, 0, finalResultCanvas.width, browserCanvas.height, 0, 0, finalResultCanvas.width, browserCanvas.height)
- downloadCanvas(filename, finalResultCanvas)
- marketPanoramaCanvas = undefined
- }
+ if (ARE_WE_RECORDING_A_MARKET_PANORAMA === false) {
+ /* We start recording the panorame. */
+ ARE_WE_RECORDING_A_MARKET_PANORAMA = true
+ marketPanoramaCanvas = document.createElement('canvas')
+ marketPanoramaCanvas.width = INITIAL_WIDTH * 50
+ marketPanoramaCanvas.height = browserCanvas.height
+ marketPanoramaCanvas.getContext('2d').drawImage(browserCanvas, 0, 0, INITIAL_WIDTH, browserCanvas.height, 0, 0, INITIAL_WIDTH, browserCanvas.height)
+ CURRENT_PANORAMA_POSITION = INITIAL_WIDTH
+ } else {
+ /* We stop recording and download the resulting image. */
+ ARE_WE_RECORDING_A_MARKET_PANORAMA = false
+ marketPanoramaCanvas.getContext('2d').drawImage(browserCanvas, browserCanvas.width - FINAL_WIDTH, 0, FINAL_WIDTH, browserCanvas.height, CURRENT_PANORAMA_POSITION, 0, FINAL_WIDTH, browserCanvas.height)
+ let finalResultCanvas = document.createElement('canvas')
+ finalResultCanvas.width = CURRENT_PANORAMA_POSITION + FINAL_WIDTH
+ finalResultCanvas.height = browserCanvas.height
+ finalResultCanvas.getContext('2d').drawImage(marketPanoramaCanvas, 0, 0, finalResultCanvas.width, browserCanvas.height, 0, 0, finalResultCanvas.width, browserCanvas.height)
+ downloadCanvas(filename, finalResultCanvas)
+ marketPanoramaCanvas = undefined
+ }
}
-function addToMarketPanorama () {
- let SECTION_WIDTH = 80 * 2
- let INITIAL_POSITION = 800 - SECTION_WIDTH
- marketPanoramaCanvas.getContext('2d').drawImage(browserCanvas, INITIAL_POSITION, 0, SECTION_WIDTH, browserCanvas.height, CURRENT_PANORAMA_POSITION, 0, SECTION_WIDTH, browserCanvas.height)
- CURRENT_PANORAMA_POSITION = CURRENT_PANORAMA_POSITION + SECTION_WIDTH
+function addToMarketPanorama() {
+ let SECTION_WIDTH = 80 * 2
+ let INITIAL_POSITION = 800 - SECTION_WIDTH
+ marketPanoramaCanvas.getContext('2d').drawImage(browserCanvas, INITIAL_POSITION, 0, SECTION_WIDTH, browserCanvas.height, CURRENT_PANORAMA_POSITION, 0, SECTION_WIDTH, browserCanvas.height)
+ CURRENT_PANORAMA_POSITION = CURRENT_PANORAMA_POSITION + SECTION_WIDTH
}
diff --git a/CanvasApp/Utilities/DrawPrint.js b/CanvasApp/Utilities/DrawPrint.js
index 4e38f2a0c..37dad6bb4 100644
--- a/CanvasApp/Utilities/DrawPrint.js
+++ b/CanvasApp/Utilities/DrawPrint.js
@@ -1,221 +1,221 @@
-function roundedCornersBackground (params) {
- if (params.xOffset === undefined) { params.xOffset = 0 }
- borderPoint1 = {
- x: params.cornerRadius + params.xOffset,
- y: params.cornerRadius
- }
-
- borderPoint2 = {
- x: params.container.frame.width - params.cornerRadius,
- y: params.cornerRadius
- }
-
- borderPoint3 = {
- x: params.container.frame.width - params.cornerRadius,
- y: params.container.frame.height - params.cornerRadius
- }
-
- borderPoint4 = {
- x: params.cornerRadius + params.xOffset,
- y: params.container.frame.height - params.cornerRadius
- }
-
- /* Now the transformations. */
-
- if (params.coordinateSystem !== undefined) { // For instance Candles would use this
- borderPoint1 = params.coordinateSystem.transformThisPoint(borderPoint1)
- borderPoint2 = params.coordinateSystem.transformThisPoint(borderPoint2)
- borderPoint3 = params.coordinateSystem.transformThisPoint(borderPoint3)
- borderPoint4 = params.coordinateSystem.transformThisPoint(borderPoint4)
- } else {
- if (params.outsideViewPort === true) { // If the element is not affected by zoom
- borderPoint1 = transformThisPoint(borderPoint1, params.container)
- borderPoint2 = transformThisPoint(borderPoint2, params.container)
- borderPoint3 = transformThisPoint(borderPoint3, params.container)
- borderPoint4 = transformThisPoint(borderPoint4, params.container)
- } else { // For instance Panels use this
- borderPoint1 = params.container.frame.frameThisPoint(borderPoint1)
- borderPoint2 = params.container.frame.frameThisPoint(borderPoint2)
- borderPoint3 = params.container.frame.frameThisPoint(borderPoint3)
- borderPoint4 = params.container.frame.frameThisPoint(borderPoint4)
+function roundedCornersBackground(params) {
+ if (params.xOffset === undefined) { params.xOffset = 0 }
+ borderPoint1 = {
+ x: params.cornerRadius + params.xOffset,
+ y: params.cornerRadius
}
- }
- if (params.fitFunction !== undefined) {
- borderPoint1 = params.fitFunction(borderPoint1)
- borderPoint2 = params.fitFunction(borderPoint2)
- borderPoint3 = params.fitFunction(borderPoint3)
- borderPoint4 = params.fitFunction(borderPoint4)
- }
+ borderPoint2 = {
+ x: params.container.frame.width - params.cornerRadius,
+ y: params.cornerRadius
+ }
- browserCanvasContext.setLineDash([0, 0])
+ borderPoint3 = {
+ x: params.container.frame.width - params.cornerRadius,
+ y: params.container.frame.height - params.cornerRadius
+ }
- /* Shadow */
+ borderPoint4 = {
+ x: params.cornerRadius + params.xOffset,
+ y: params.container.frame.height - params.cornerRadius
+ }
- if (params.castShadow === true) {
- let SHADOW_OFFSET = 2
+ /* Now the transformations. */
+
+ if (params.coordinateSystem !== undefined) { // For instance Candles would use this
+ borderPoint1 = params.coordinateSystem.transformThisPoint(borderPoint1)
+ borderPoint2 = params.coordinateSystem.transformThisPoint(borderPoint2)
+ borderPoint3 = params.coordinateSystem.transformThisPoint(borderPoint3)
+ borderPoint4 = params.coordinateSystem.transformThisPoint(borderPoint4)
+ } else {
+ if (params.outsideViewPort === true) { // If the element is not affected by zoom
+ borderPoint1 = transformThisPoint(borderPoint1, params.container)
+ borderPoint2 = transformThisPoint(borderPoint2, params.container)
+ borderPoint3 = transformThisPoint(borderPoint3, params.container)
+ borderPoint4 = transformThisPoint(borderPoint4, params.container)
+ } else { // For instance Panels use this
+ borderPoint1 = params.container.frame.frameThisPoint(borderPoint1)
+ borderPoint2 = params.container.frame.frameThisPoint(borderPoint2)
+ borderPoint3 = params.container.frame.frameThisPoint(borderPoint3)
+ borderPoint4 = params.container.frame.frameThisPoint(borderPoint4)
+ }
+ }
+
+ if (params.fitFunction !== undefined) {
+ borderPoint1 = params.fitFunction(borderPoint1)
+ borderPoint2 = params.fitFunction(borderPoint2)
+ borderPoint3 = params.fitFunction(borderPoint3)
+ borderPoint4 = params.fitFunction(borderPoint4)
+ }
+
+ browserCanvasContext.setLineDash([0, 0])
+
+ /* Shadow */
+
+ if (params.castShadow === true) {
+ let SHADOW_OFFSET = 2
+
+ browserCanvasContext.beginPath()
+
+ browserCanvasContext.arc(borderPoint1.x + SHADOW_OFFSET, borderPoint1.y + SHADOW_OFFSET, params.cornerRadius, 1.0 * Math.PI, 1.5 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint2.x + SHADOW_OFFSET, borderPoint2.y - params.cornerRadius + SHADOW_OFFSET)
+ browserCanvasContext.arc(borderPoint2.x + SHADOW_OFFSET, borderPoint2.y + SHADOW_OFFSET, params.cornerRadius, 1.5 * Math.PI, 2.0 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint3.x + params.cornerRadius + SHADOW_OFFSET, borderPoint3.y + SHADOW_OFFSET)
+ browserCanvasContext.arc(borderPoint3.x + SHADOW_OFFSET, borderPoint3.y + SHADOW_OFFSET, params.cornerRadius, 0 * Math.PI, 0.5 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint4.x + SHADOW_OFFSET, borderPoint4.y + params.cornerRadius + SHADOW_OFFSET)
+ browserCanvasContext.arc(borderPoint4.x + SHADOW_OFFSET, borderPoint4.y + SHADOW_OFFSET, params.cornerRadius, 0.5 * Math.PI, 1.0 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint1.x - params.cornerRadius + SHADOW_OFFSET, borderPoint1.y + SHADOW_OFFSET)
+
+ browserCanvasContext.closePath()
+
+ browserCanvasContext.lineWidth = 10
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + 0.01 + ')'
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.lineWidth = 5
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + 0.01 + ')'
+ browserCanvasContext.stroke()
+
+ browserCanvasContext.lineWidth = 1
+ browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + 0.15 + ')'
+ browserCanvasContext.stroke()
+ }
+
+ /* Background */
browserCanvasContext.beginPath()
- browserCanvasContext.arc(borderPoint1.x + SHADOW_OFFSET, borderPoint1.y + SHADOW_OFFSET, params.cornerRadius, 1.0 * Math.PI, 1.5 * Math.PI)
- browserCanvasContext.lineTo(borderPoint2.x + SHADOW_OFFSET, borderPoint2.y - params.cornerRadius + SHADOW_OFFSET)
- browserCanvasContext.arc(borderPoint2.x + SHADOW_OFFSET, borderPoint2.y + SHADOW_OFFSET, params.cornerRadius, 1.5 * Math.PI, 2.0 * Math.PI)
- browserCanvasContext.lineTo(borderPoint3.x + params.cornerRadius + SHADOW_OFFSET, borderPoint3.y + SHADOW_OFFSET)
- browserCanvasContext.arc(borderPoint3.x + SHADOW_OFFSET, borderPoint3.y + SHADOW_OFFSET, params.cornerRadius, 0 * Math.PI, 0.5 * Math.PI)
- browserCanvasContext.lineTo(borderPoint4.x + SHADOW_OFFSET, borderPoint4.y + params.cornerRadius + SHADOW_OFFSET)
- browserCanvasContext.arc(borderPoint4.x + SHADOW_OFFSET, borderPoint4.y + SHADOW_OFFSET, params.cornerRadius, 0.5 * Math.PI, 1.0 * Math.PI)
- browserCanvasContext.lineTo(borderPoint1.x - params.cornerRadius + SHADOW_OFFSET, borderPoint1.y + SHADOW_OFFSET)
+ browserCanvasContext.arc(borderPoint1.x, borderPoint1.y, params.cornerRadius, 1.0 * Math.PI, 1.5 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint2.x, borderPoint2.y - params.cornerRadius)
+ browserCanvasContext.arc(borderPoint2.x, borderPoint2.y, params.cornerRadius, 1.5 * Math.PI, 2.0 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint3.x + params.cornerRadius, borderPoint3.y)
+ browserCanvasContext.arc(borderPoint3.x, borderPoint3.y, params.cornerRadius, 0 * Math.PI, 0.5 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint4.x, borderPoint4.y + params.cornerRadius)
+ browserCanvasContext.arc(borderPoint4.x, borderPoint4.y, params.cornerRadius, 0.5 * Math.PI, 1.0 * Math.PI)
+ browserCanvasContext.lineTo(borderPoint1.x - params.cornerRadius, borderPoint1.y)
browserCanvasContext.closePath()
- browserCanvasContext.lineWidth = 10
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + 0.01 + ')'
+ browserCanvasContext.fillStyle = 'rgba(' + params.backgroundColor + ', ' + params.opacity + ')'
+
+ browserCanvasContext.fill()
+
+ browserCanvasContext.lineWidth = params.lineWidth
+ browserCanvasContext.strokeStyle = 'rgba(' + params.borderColor + ', ' + params.opacity + ')'
browserCanvasContext.stroke()
-
- browserCanvasContext.lineWidth = 5
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + 0.01 + ')'
- browserCanvasContext.stroke()
-
- browserCanvasContext.lineWidth = 1
- browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.BLACK + ', ' + 0.15 + ')'
- browserCanvasContext.stroke()
- }
-
- /* Background */
-
- browserCanvasContext.beginPath()
-
- browserCanvasContext.arc(borderPoint1.x, borderPoint1.y, params.cornerRadius, 1.0 * Math.PI, 1.5 * Math.PI)
- browserCanvasContext.lineTo(borderPoint2.x, borderPoint2.y - params.cornerRadius)
- browserCanvasContext.arc(borderPoint2.x, borderPoint2.y, params.cornerRadius, 1.5 * Math.PI, 2.0 * Math.PI)
- browserCanvasContext.lineTo(borderPoint3.x + params.cornerRadius, borderPoint3.y)
- browserCanvasContext.arc(borderPoint3.x, borderPoint3.y, params.cornerRadius, 0 * Math.PI, 0.5 * Math.PI)
- browserCanvasContext.lineTo(borderPoint4.x, borderPoint4.y + params.cornerRadius)
- browserCanvasContext.arc(borderPoint4.x, borderPoint4.y, params.cornerRadius, 0.5 * Math.PI, 1.0 * Math.PI)
- browserCanvasContext.lineTo(borderPoint1.x - params.cornerRadius, borderPoint1.y)
-
- browserCanvasContext.closePath()
-
- browserCanvasContext.fillStyle = 'rgba(' + params.backgroundColor + ', ' + params.opacity + ')'
-
- browserCanvasContext.fill()
-
- browserCanvasContext.lineWidth = params.lineWidth
- browserCanvasContext.strokeStyle = 'rgba(' + params.borderColor + ', ' + params.opacity + ')'
- browserCanvasContext.stroke()
}
-function drawLabel (label, xFactor, yFactor, xOffset, yOffset, fontSize, container, fontColor, noFrameX, noFrameY, opacity) {
- if (label === undefined) { return }
- if (fontColor === undefined) { fontColor = UI_COLOR.WHITE }
- let fontOffset = label.length * fontSize * FONT_ASPECT_RATIO + 10
- if (opacity === undefined) { opacity = 1 }
+function drawLabel(label, xFactor, yFactor, xOffset, yOffset, fontSize, container, fontColor, noFrameX, noFrameY, opacity) {
+ if (label === undefined) { return }
+ if (fontColor === undefined) { fontColor = UI_COLOR.WHITE }
+ let fontOffset = label.length * fontSize * FONT_ASPECT_RATIO + 10
+ if (opacity === undefined) { opacity = 1 }
- let labelPoint = {
- x: container.frame.width * xFactor + xOffset - fontOffset / 2,
- y: container.frame.height * yFactor + yOffset
- }
-
- labelPoint = container.frame.frameThisPoint(labelPoint)
-
- if (noFrameX !== undefined) {
- labelPoint.x = noFrameX + xOffset
- }
-
- if (noFrameY !== undefined) {
- labelPoint.y = noFrameY + yOffset
- }
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- browserCanvasContext.fillStyle = 'rgba(' + fontColor + ', ' + opacity + ')'
-
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
-}
-
-function drawIcon (icon, xFactor, yFactor, xOffset, yOffset, imageSize, container) {
- if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- let imagePosition = {
- x: container.frame.width * xFactor + xOffset - imageSize / 2,
- y: container.frame.height * yFactor + yOffset - imageSize / 2
- }
-
- imagePosition = container.frame.frameThisPoint(imagePosition)
-
- browserCanvasContext.drawImage(
- icon, imagePosition.x,
- imagePosition.y,
- imageSize,
- imageSize)
+ let labelPoint = {
+ x: container.frame.width * xFactor + xOffset - fontOffset / 2,
+ y: container.frame.height * yFactor + yOffset
}
- }
-}
-function drawContainerBackground (container, color, opacity, fitFunction) {
- let fromPoint = {
- x: 0,
- y: 0
- }
-
- let toPoint = {
- x: container.frame.width,
- y: container.frame.height
- }
-
- fromPoint = transformThisPoint(fromPoint, container)
- toPoint = transformThisPoint(toPoint, container)
-
- fromPoint = fitFunction(fromPoint)
- toPoint = fitFunction(toPoint)
-
- browserCanvasContext.beginPath()
- browserCanvasContext.rect(fromPoint.x, fromPoint.y, toPoint.x - fromPoint.x, toPoint.y - fromPoint.y)
- browserCanvasContext.fillStyle = 'rgba(' + color + ', ' + opacity + ')'
- browserCanvasContext.closePath()
- browserCanvasContext.fill()
-}
-
-function printLabel (labelToPrint, x, y, opacity, fontSize, color, center, container, fitFunction, noDecimals, fixedDecimals) {
- if (labelToPrint === undefined) { return }
- let labelPoint
- if (color === undefined) { color = UI_COLOR.DARK }
- if (fontSize === undefined) { fontSize = 10 };
-
- browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
- let label = labelToPrint
- if (isNaN(label) === false && label !== '') {
- if (fixedDecimals !== true) {
- label = dynamicDecimals(labelToPrint)
- }
- label = label.toLocaleString()
- if (noDecimals === true) {
- label = Math.trunc(label)
- }
- }
-
- let xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO
-
- if (center === true) {
- labelPoint = {
- x: x - xOffset,
- y: y
- }
- } else {
- labelPoint = {
- x: x,
- y: y
- }
- }
-
- if (container !== undefined) {
labelPoint = container.frame.frameThisPoint(labelPoint)
- }
- if (fitFunction !== undefined) {
- labelPoint = fitFunction(labelPoint)
- }
+ if (noFrameX !== undefined) {
+ labelPoint.x = noFrameX + xOffset
+ }
- browserCanvasContext.fillStyle = 'rgba(' + color + ', ' + opacity + ')'
- browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+ if (noFrameY !== undefined) {
+ labelPoint.y = noFrameY + yOffset
+ }
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ browserCanvasContext.fillStyle = 'rgba(' + fontColor + ', ' + opacity + ')'
+
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
+}
+
+function drawIcon(icon, xFactor, yFactor, xOffset, yOffset, imageSize, container) {
+ if (icon !== undefined) {
+ if (icon.canDrawIcon === true) {
+ let imagePosition = {
+ x: container.frame.width * xFactor + xOffset - imageSize / 2,
+ y: container.frame.height * yFactor + yOffset - imageSize / 2
+ }
+
+ imagePosition = container.frame.frameThisPoint(imagePosition)
+
+ browserCanvasContext.drawImage(
+ icon, imagePosition.x,
+ imagePosition.y,
+ imageSize,
+ imageSize)
+ }
+ }
+}
+
+function drawContainerBackground(container, color, opacity, fitFunction) {
+ let fromPoint = {
+ x: 0,
+ y: 0
+ }
+
+ let toPoint = {
+ x: container.frame.width,
+ y: container.frame.height
+ }
+
+ fromPoint = transformThisPoint(fromPoint, container)
+ toPoint = transformThisPoint(toPoint, container)
+
+ fromPoint = fitFunction(fromPoint)
+ toPoint = fitFunction(toPoint)
+
+ browserCanvasContext.beginPath()
+ browserCanvasContext.rect(fromPoint.x, fromPoint.y, toPoint.x - fromPoint.x, toPoint.y - fromPoint.y)
+ browserCanvasContext.fillStyle = 'rgba(' + color + ', ' + opacity + ')'
+ browserCanvasContext.closePath()
+ browserCanvasContext.fill()
+}
+
+function printLabel(labelToPrint, x, y, opacity, fontSize, color, center, container, fitFunction, noDecimals, fixedDecimals) {
+ if (labelToPrint === undefined) { return }
+ let labelPoint
+ if (color === undefined) { color = UI_COLOR.DARK }
+ if (fontSize === undefined) { fontSize = 10 };
+
+ browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
+ let label = labelToPrint
+ if (isNaN(label) === false && label !== '') {
+ if (fixedDecimals !== true) {
+ label = dynamicDecimals(labelToPrint)
+ }
+ label = label.toLocaleString()
+ if (noDecimals === true) {
+ label = Math.trunc(label)
+ }
+ }
+
+ let xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO
+
+ if (center === true) {
+ labelPoint = {
+ x: x - xOffset,
+ y: y
+ }
+ } else {
+ labelPoint = {
+ x: x,
+ y: y
+ }
+ }
+
+ if (container !== undefined) {
+ labelPoint = container.frame.frameThisPoint(labelPoint)
+ }
+
+ if (fitFunction !== undefined) {
+ labelPoint = fitFunction(labelPoint)
+ }
+
+ browserCanvasContext.fillStyle = 'rgba(' + color + ', ' + opacity + ')'
+ browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
diff --git a/CanvasApp/Utilities/HiriarchyMap.js b/CanvasApp/Utilities/HiriarchyMap.js
index e27ec1614..6b37803b6 100644
--- a/CanvasApp/Utilities/HiriarchyMap.js
+++ b/CanvasApp/Utilities/HiriarchyMap.js
@@ -2,46 +2,46 @@
This function scans a node hiriatchy recursively and creates a Map by Id of all the nodes of it.
*/
-function getHiriarchyMap (rootNode) {
- let hiriatchyMap = new Map()
- evalNode(rootNode)
- return hiriatchyMap
+function getHiriarchyMap(rootNode) {
+ let hiriatchyMap = new Map()
+ evalNode(rootNode)
+ return hiriatchyMap
- function evalNode (node) {
- if (node === undefined) { return }
+ function evalNode(node) {
+ if (node === undefined) { return }
- hiriatchyMap.set(node.id, node)
+ hiriatchyMap.set(node.id, node)
- /* Now we go down through all this node children */
- let nodeDefinition = APP_SCHEMA_MAP.get(node.type)
- if (nodeDefinition === undefined) { return }
+ /* Now we go down through all this node children */
+ let nodeDefinition = APP_SCHEMA_MAP.get(node.type)
+ if (nodeDefinition === undefined) { return }
- if (nodeDefinition.properties !== undefined) {
- let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
- for (let i = 0; i < nodeDefinition.properties.length; i++) {
- let property = nodeDefinition.properties[i]
+ if (nodeDefinition.properties !== undefined) {
+ let previousPropertyName // Since there are cases where there are many properties with the same name,because they can hold nodes of different types but only one at the time, we have to avoind counting each property of those as individual children.
+ for (let i = 0; i < nodeDefinition.properties.length; i++) {
+ let property = nodeDefinition.properties[i]
- switch (property.type) {
- case 'node': {
- if (property.name !== previousPropertyName) {
- if (node[property.name] !== undefined) {
- evalNode(node[property.name])
- }
- previousPropertyName = property.name
+ switch (property.type) {
+ case 'node': {
+ if (property.name !== previousPropertyName) {
+ if (node[property.name] !== undefined) {
+ evalNode(node[property.name])
+ }
+ previousPropertyName = property.name
+ }
+ break
+ }
+ case 'array': {
+ if (node[property.name] !== undefined) {
+ let nodePropertyArray = node[property.name]
+ for (let m = 0; m < nodePropertyArray.length; m++) {
+ evalNode(nodePropertyArray[m])
+ }
+ }
+ break
+ }
+ }
}
- break
- }
- case 'array': {
- if (node[property.name] !== undefined) {
- let nodePropertyArray = node[property.name]
- for (let m = 0; m < nodePropertyArray.length; m++) {
- evalNode(nodePropertyArray[m])
- }
- }
- break
- }
}
- }
}
- }
}
diff --git a/CanvasApp/Utilities/LoadSaveFrame.js b/CanvasApp/Utilities/LoadSaveFrame.js
index 5bda8c98b..67fecfbb0 100644
--- a/CanvasApp/Utilities/LoadSaveFrame.js
+++ b/CanvasApp/Utilities/LoadSaveFrame.js
@@ -1,24 +1,24 @@
-function saveFrame (payload, frame) {
- payload.frame = {
- position: {
- x: frame.position.x,
- y: frame.position.y
- },
- width: frame.width,
- height: frame.height,
- radius: frame.radius
- }
+function saveFrame(payload, frame) {
+ payload.frame = {
+ position: {
+ x: frame.position.x,
+ y: frame.position.y
+ },
+ width: frame.width,
+ height: frame.height,
+ radius: frame.radius
+ }
}
-function loadFrame (payload, frame) {
- if (payload.node.savedPayload !== undefined) {
- if (payload.node.savedPayload.frame !== undefined) {
- frame.position.x = payload.node.savedPayload.frame.position.x
- frame.position.y = payload.node.savedPayload.frame.position.y
- frame.width = payload.node.savedPayload.frame.width
- frame.height = payload.node.savedPayload.frame.height
- frame.radius = payload.node.savedPayload.frame.radius
- payload.node.savedPayload.frame = undefined
+function loadFrame(payload, frame) {
+ if (payload.node.savedPayload !== undefined) {
+ if (payload.node.savedPayload.frame !== undefined) {
+ frame.position.x = payload.node.savedPayload.frame.position.x
+ frame.position.y = payload.node.savedPayload.frame.position.y
+ frame.width = payload.node.savedPayload.frame.width
+ frame.height = payload.node.savedPayload.frame.height
+ frame.radius = payload.node.savedPayload.frame.radius
+ payload.node.savedPayload.frame = undefined
+ }
}
- }
}
diff --git a/CanvasApp/Utilities/NodeConfig.js b/CanvasApp/Utilities/NodeConfig.js
index 482e1ae3e..f33cc2754 100644
--- a/CanvasApp/Utilities/NodeConfig.js
+++ b/CanvasApp/Utilities/NodeConfig.js
@@ -1,18 +1,18 @@
-function savePropertyAtNodeConfig (payload, propertyName, value) {
- try {
- let config = JSON.parse(payload.node.config)
- config[propertyName] = value
- payload.node.config = JSON.stringify(config, null, 4)
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
+function savePropertyAtNodeConfig(payload, propertyName, value) {
+ try {
+ let config = JSON.parse(payload.node.config)
+ config[propertyName] = value
+ payload.node.config = JSON.stringify(config, null, 4)
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
}
-function loadPropertyFromNodeConfig (payload, propertyName) {
- try {
- let config = JSON.parse(payload.node.config)
- return config[propertyName]
- } catch (err) {
- // we ignore errors here since most likely they will be parsing errors.
- }
+function loadPropertyFromNodeConfig(payload, propertyName) {
+ try {
+ let config = JSON.parse(payload.node.config)
+ return config[propertyName]
+ } catch (err) {
+ // we ignore errors here since most likely they will be parsing errors.
+ }
}
diff --git a/CanvasApp/VideoRecorder.js b/CanvasApp/VideoRecorder.js
index f222a8358..551db0ef7 100644
--- a/CanvasApp/VideoRecorder.js
+++ b/CanvasApp/VideoRecorder.js
@@ -1,218 +1,218 @@
-function newVideoRecorder () {
- let thisObject = {
- recordCanvas: recordCanvas,
- physics: physics
- }
- let lastAction
- let wheelAnimationCounter = 0
- let lastWheelPointerIcon
- return thisObject
-
- function physics () {
- wheelAnimationCounter--
- if (wheelAnimationCounter < 0) {
- wheelAnimationCounter = 0
+function newVideoRecorder() {
+ let thisObject = {
+ recordCanvas: recordCanvas,
+ physics: physics
}
- }
+ let lastAction
+ let wheelAnimationCounter = 0
+ let lastWheelPointerIcon
+ return thisObject
- function recordCanvas () {
- {
- const DISTANCE_BETWEEN_ICONS = 35
- const ICON_SIZES = 50
-
- let mousePointerIcon = canvas.designSpace.iconCollection.get('mouse-pointer')
- let draggingIcon = canvas.designSpace.iconCollection.get('hand-drag')
-
- let leftClickIcon = canvas.designSpace.iconCollection.get('mouse-left-click')
- let rightClickIcon = canvas.designSpace.iconCollection.get('mouse-right-click')
- let wheelClickIcon = canvas.designSpace.iconCollection.get('mouse-wheel-click')
-
- let imagePosition
- let buttonPressedIcon
-
- if (canvas.mouse.action === 'key down' && lastAction === 'dragging') {
- canvas.mouse.action = 'dragging'
- }
- switch (canvas.mouse.action) {
- case 'moving': {
- pointerIcon = mousePointerIcon
- break
+ function physics() {
+ wheelAnimationCounter--
+ if (wheelAnimationCounter < 0) {
+ wheelAnimationCounter = 0
+ }
+ }
+
+ function recordCanvas() {
+ {
+ const DISTANCE_BETWEEN_ICONS = 35
+ const ICON_SIZES = 50
+
+ let mousePointerIcon = canvas.designSpace.iconCollection.get('mouse-pointer')
+ let draggingIcon = canvas.designSpace.iconCollection.get('hand-drag')
+
+ let leftClickIcon = canvas.designSpace.iconCollection.get('mouse-left-click')
+ let rightClickIcon = canvas.designSpace.iconCollection.get('mouse-right-click')
+ let wheelClickIcon = canvas.designSpace.iconCollection.get('mouse-wheel-click')
+
+ let imagePosition
+ let buttonPressedIcon
+
+ if (canvas.mouse.action === 'key down' && lastAction === 'dragging') {
+ canvas.mouse.action = 'dragging'
+ }
+ switch (canvas.mouse.action) {
+ case 'moving': {
+ pointerIcon = mousePointerIcon
+ break
+ }
+ case 'dragging': {
+ pointerIcon = draggingIcon
+ break
+ }
+ case 'wheel': {
+ wheelAnimationCounter = 25
+ if (canvas.mouse.event.delta > 0) {
+ pointerIcon = canvas.designSpace.iconCollection.get('mouse-wheel-up')
+ lastWheelPointerIcon = pointerIcon
+ } else {
+ pointerIcon = canvas.designSpace.iconCollection.get('mouse-wheel-down')
+ lastWheelPointerIcon = pointerIcon
+ }
+
+ break
+ }
+ case 'key down': {
+ if (wheelAnimationCounter > 0) {
+ pointerIcon = lastWheelPointerIcon
+ } else {
+ pointerIcon = mousePointerIcon
+ }
+ let key = canvas.mouse.event.key
+ if (key === undefined) { break }
+ switch (key.toLowerCase()) {
+ case 'Escape':
+ {
+ pointerIcon = canvas.designSpace.iconCollection.get('key-m')
+ break
+ }
+ case 'm':
+ {
+ pointerIcon = canvas.designSpace.iconCollection.get('key-m')
+ break
+ }
+ case 'a':
+ {
+ pointerIcon = canvas.designSpace.iconCollection.get('key-a')
+ break
+ }
+ case 'r':
+ {
+ pointerIcon = canvas.designSpace.iconCollection.get('key-r')
+ break
+ }
+ case 'c':
+ {
+ pointerIcon = canvas.designSpace.iconCollection.get('key-r')
+ break
+ }
+ }
+ break
+ }
+ case 'key up': {
+ pointerIcon = mousePointerIcon
+ break
+ }
+ }
+
+ lastAction = canvas.mouse.action
+
+ imagePosition = {
+ x: canvas.mouse.position.x,
+ y: canvas.mouse.position.y
+ }
+ drawMousePointer(pointerIcon, imagePosition, ICON_SIZES)
+
+ switch (canvas.mouse.event.buttons) {
+ case 0: {
+ buttonPressedIcon = undefined
+ break
+ }
+ case 1: {
+ buttonPressedIcon = leftClickIcon
+ break
+ }
+ case 2: {
+ buttonPressedIcon = rightClickIcon
+ break
+ }
+ case 3: {
+ buttonPressedIcon = undefined
+ break
+ }
+ case 4: {
+ buttonPressedIcon = wheelClickIcon
+ break
+ }
+ }
+
+ let firstRow = DISTANCE_BETWEEN_ICONS * 1 + ICON_SIZES * 1
+ let secondRow = DISTANCE_BETWEEN_ICONS * 1 + ICON_SIZES * 2
+ let icon
+
+ imagePosition = {
+ x: canvas.mouse.position.x + DISTANCE_BETWEEN_ICONS * 2,
+ y: canvas.mouse.position.y
+ }
+ drawMousePointer(buttonPressedIcon, imagePosition, ICON_SIZES)
+
+ if (canvas.mouse.event.shiftKey === true) {
+ icon = canvas.designSpace.iconCollection.get('key-shift')
+ imagePosition = {
+ x: canvas.mouse.position.x - DISTANCE_BETWEEN_ICONS * 3,
+ y: canvas.mouse.position.y + firstRow
+ }
+ drawMousePointer(icon, imagePosition, ICON_SIZES)
+ }
+
+ if (canvas.mouse.event.ctrlKey === true || canvas.mouse.event.metaKey === true) {
+ icon = canvas.designSpace.iconCollection.get('key-ctrl')
+ imagePosition = {
+ x: canvas.mouse.position.x - DISTANCE_BETWEEN_ICONS * 3,
+ y: canvas.mouse.position.y + secondRow
+ }
+ drawMousePointer(icon, imagePosition, ICON_SIZES)
+ }
+
+ if (canvas.mouse.event.altKey === true) {
+ icon = canvas.designSpace.iconCollection.get('key-alt')
+ imagePosition = {
+ x: canvas.mouse.position.x + DISTANCE_BETWEEN_ICONS * 3 + ICON_SIZES * 0,
+ y: canvas.mouse.position.y + secondRow
+ }
+ drawMousePointer(icon, imagePosition, ICON_SIZES)
+ }
+
+ if (canvas.mouse.event.code === 'ArrowUp') {
+ icon = canvas.designSpace.iconCollection.get('key-up')
+ imagePosition = {
+ x: canvas.mouse.position.x - 0,
+ y: canvas.mouse.position.y + firstRow
+ }
+ drawMousePointer(icon, imagePosition, ICON_SIZES)
+ }
+
+ if (canvas.mouse.event.code === 'ArrowDown') {
+ icon = canvas.designSpace.iconCollection.get('key-down')
+ imagePosition = {
+ x: canvas.mouse.position.x - 0,
+ y: canvas.mouse.position.y + secondRow
+ }
+ drawMousePointer(icon, imagePosition, ICON_SIZES)
+ }
+
+ if (canvas.mouse.event.code === 'ArrowLeft') {
+ icon = canvas.designSpace.iconCollection.get('key-left')
+ imagePosition = {
+ x: canvas.mouse.position.x - DISTANCE_BETWEEN_ICONS * 0 - ICON_SIZES * 1,
+ y: canvas.mouse.position.y + secondRow
+ }
+ drawMousePointer(icon, imagePosition, ICON_SIZES)
+ }
+
+ if (canvas.mouse.event.code === 'ArrowRight') {
+ icon = canvas.designSpace.iconCollection.get('key-right')
+ imagePosition = {
+ x: canvas.mouse.position.x + DISTANCE_BETWEEN_ICONS * 0 + ICON_SIZES * 1,
+ y: canvas.mouse.position.y + secondRow
+ }
+ drawMousePointer(icon, imagePosition, ICON_SIZES)
+ }
+
+ function drawMousePointer(icon, imagePosition, imageSize) {
+ if (icon !== undefined) {
+ if (icon.canDrawIcon === true) {
+ browserCanvasContext.drawImage(
+ icon, imagePosition.x,
+ imagePosition.y,
+ imageSize,
+ imageSize)
+ }
+ }
+ }
+ mediaRecorder.capture(browserCanvas)
}
- case 'dragging': {
- pointerIcon = draggingIcon
- break
- }
- case 'wheel': {
- wheelAnimationCounter = 25
- if (canvas.mouse.event.delta > 0) {
- pointerIcon = canvas.designSpace.iconCollection.get('mouse-wheel-up')
- lastWheelPointerIcon = pointerIcon
- } else {
- pointerIcon = canvas.designSpace.iconCollection.get('mouse-wheel-down')
- lastWheelPointerIcon = pointerIcon
- }
-
- break
- }
- case 'key down': {
- if (wheelAnimationCounter > 0) {
- pointerIcon = lastWheelPointerIcon
- } else {
- pointerIcon = mousePointerIcon
- }
- let key = canvas.mouse.event.key
- if (key === undefined) { break }
- switch (key.toLowerCase()) {
- case 'Escape':
- {
- pointerIcon = canvas.designSpace.iconCollection.get('key-m')
- break
- }
- case 'm':
- {
- pointerIcon = canvas.designSpace.iconCollection.get('key-m')
- break
- }
- case 'a':
- {
- pointerIcon = canvas.designSpace.iconCollection.get('key-a')
- break
- }
- case 'r':
- {
- pointerIcon = canvas.designSpace.iconCollection.get('key-r')
- break
- }
- case 'c':
- {
- pointerIcon = canvas.designSpace.iconCollection.get('key-r')
- break
- }
- }
- break
- }
- case 'key up': {
- pointerIcon = mousePointerIcon
- break
- }
- }
-
- lastAction = canvas.mouse.action
-
- imagePosition = {
- x: canvas.mouse.position.x,
- y: canvas.mouse.position.y
- }
- drawMousePointer(pointerIcon, imagePosition, ICON_SIZES)
-
- switch (canvas.mouse.event.buttons) {
- case 0: {
- buttonPressedIcon = undefined
- break
- }
- case 1: {
- buttonPressedIcon = leftClickIcon
- break
- }
- case 2: {
- buttonPressedIcon = rightClickIcon
- break
- }
- case 3: {
- buttonPressedIcon = undefined
- break
- }
- case 4: {
- buttonPressedIcon = wheelClickIcon
- break
- }
- }
-
- let firstRow = DISTANCE_BETWEEN_ICONS * 1 + ICON_SIZES * 1
- let secondRow = DISTANCE_BETWEEN_ICONS * 1 + ICON_SIZES * 2
- let icon
-
- imagePosition = {
- x: canvas.mouse.position.x + DISTANCE_BETWEEN_ICONS * 2,
- y: canvas.mouse.position.y
- }
- drawMousePointer(buttonPressedIcon, imagePosition, ICON_SIZES)
-
- if (canvas.mouse.event.shiftKey === true) {
- icon = canvas.designSpace.iconCollection.get('key-shift')
- imagePosition = {
- x: canvas.mouse.position.x - DISTANCE_BETWEEN_ICONS * 3,
- y: canvas.mouse.position.y + firstRow
- }
- drawMousePointer(icon, imagePosition, ICON_SIZES)
- }
-
- if (canvas.mouse.event.ctrlKey === true || canvas.mouse.event.metaKey === true) {
- icon = canvas.designSpace.iconCollection.get('key-ctrl')
- imagePosition = {
- x: canvas.mouse.position.x - DISTANCE_BETWEEN_ICONS * 3,
- y: canvas.mouse.position.y + secondRow
- }
- drawMousePointer(icon, imagePosition, ICON_SIZES)
- }
-
- if (canvas.mouse.event.altKey === true) {
- icon = canvas.designSpace.iconCollection.get('key-alt')
- imagePosition = {
- x: canvas.mouse.position.x + DISTANCE_BETWEEN_ICONS * 3 + ICON_SIZES * 0,
- y: canvas.mouse.position.y + secondRow
- }
- drawMousePointer(icon, imagePosition, ICON_SIZES)
- }
-
- if (canvas.mouse.event.code === 'ArrowUp') {
- icon = canvas.designSpace.iconCollection.get('key-up')
- imagePosition = {
- x: canvas.mouse.position.x - 0,
- y: canvas.mouse.position.y + firstRow
- }
- drawMousePointer(icon, imagePosition, ICON_SIZES)
- }
-
- if (canvas.mouse.event.code === 'ArrowDown') {
- icon = canvas.designSpace.iconCollection.get('key-down')
- imagePosition = {
- x: canvas.mouse.position.x - 0,
- y: canvas.mouse.position.y + secondRow
- }
- drawMousePointer(icon, imagePosition, ICON_SIZES)
- }
-
- if (canvas.mouse.event.code === 'ArrowLeft') {
- icon = canvas.designSpace.iconCollection.get('key-left')
- imagePosition = {
- x: canvas.mouse.position.x - DISTANCE_BETWEEN_ICONS * 0 - ICON_SIZES * 1,
- y: canvas.mouse.position.y + secondRow
- }
- drawMousePointer(icon, imagePosition, ICON_SIZES)
- }
-
- if (canvas.mouse.event.code === 'ArrowRight') {
- icon = canvas.designSpace.iconCollection.get('key-right')
- imagePosition = {
- x: canvas.mouse.position.x + DISTANCE_BETWEEN_ICONS * 0 + ICON_SIZES * 1,
- y: canvas.mouse.position.y + secondRow
- }
- drawMousePointer(icon, imagePosition, ICON_SIZES)
- }
-
- function drawMousePointer (icon, imagePosition, imageSize) {
- if (icon !== undefined) {
- if (icon.canDrawIcon === true) {
- browserCanvasContext.drawImage(
- icon, imagePosition.x,
- imagePosition.y,
- imageSize,
- imageSize)
- }
- }
- }
- mediaRecorder.capture(browserCanvas)
}
- }
}
diff --git a/CanvasApp/WebDebugLog.js b/CanvasApp/WebDebugLog.js
index 6a758304e..2a6bc1af1 100644
--- a/CanvasApp/WebDebugLog.js
+++ b/CanvasApp/WebDebugLog.js
@@ -1,21 +1,21 @@
- function newWebDebugLog () {
- try {
- let thisObject = {
- write: write,
- fileName: 'undefined'
- }
+function newWebDebugLog() {
+ try {
+ let thisObject = {
+ write: write,
+ fileName: 'undefined'
+ }
- return thisObject
+ return thisObject
- function write (pText) {
- console.log(spacePad(thisObject.fileName, 50) + ' : ' + pText)
+ function write(pText) {
+ console.log(spacePad(thisObject.fileName, 50) + ' : ' + pText)
- function spacePad (str, max) {
- str = str.toString()
- return str.length < max ? spacePad(' ' + str, max) : str
- }
- }
- } catch (err) {
- console.log(spacePad(MODULE_NAME, 50) + ' : ' + '[ERROR] WebDebugLog --> err = ' + err.stack)
- }
- }
+ function spacePad(str, max) {
+ str = str.toString()
+ return str.length < max ? spacePad(' ' + str, max) : str
+ }
+ }
+ } catch (err) {
+ console.log(spacePad(MODULE_NAME, 50) + ' : ' + '[ERROR] WebDebugLog --> err = ' + err.stack)
+ }
+}
diff --git a/Data-Mines/Masters-Trading.json b/Data-Mines/Masters-Trading.json
index 5a2e1a47e..dbd509eb6 100644
--- a/Data-Mines/Masters-Trading.json
+++ b/Data-Mines/Masters-Trading.json
@@ -1 +1 @@
-{"type":"Data Mine","name":"Masters-Trading","config":"{ \n\"codeName\": \"Masters-Trading\"\n}","sensorBots":[],"indicatorBots":[],"tradingBots":[{"type":"Trading Bot","name":"Low Frequency","config":"{\n\"codeName\": \"Low-Frequency\"\n}","processes":[{"type":"Process Definition","name":"Trading","config":"{\n \"codeName\": \"Trading\",\n \"liveTradingWaitTime\": 0,\n \"paperTradingWaitTime\": 0,\n \"fordwardTestingWaitTime\": 0,\n \"backtestingWaitTime\": 0,\n \"sessionRunWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"framework\": {\n \"name\": \"Low-Frequency-Trading-Process\"\n }\n }","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Episode Counters","id":"6fc3054e-5034-4fc7-bddf-02360e0a6acf","savedPayload":{"position":{"x":17450.068251326462,"y":15841.551559017382},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"db063d7b-db05-4bf6-941f-999e1ccb38fc"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Counters","id":"c3c2240f-514b-40de-825f-674037117d0b","savedPayload":{"position":{"x":17408.574644476477,"y":15727.325552793509},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"0764aaaf-d970-4f23-9df8-55fe5b7dd273"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Statistics","id":"1dfdfc0d-842f-4e63-a591-256ac8a06b0f","savedPayload":{"position":{"x":17373.12088415627,"y":15611.394883926749},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Statistics","id":"39360c55-5ba8-413b-b0bd-cac3789ebf5f","savedPayload":{"position":{"x":17343.701241214498,"y":15493.846491633021},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"91953362-8751-4440-a898-21245cd47c15"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Candle","id":"ba614415-6e4f-4979-97a5-34c72a59e67c","savedPayload":{"position":{"x":17320.378252589224,"y":15374.95820021913},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Candle","id":"1a2e3461-33e6-45b1-bcc1-c56a8c5d275c","savedPayload":{"position":{"x":17303.209229100234,"y":15255.03551122105},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Balance","id":"567e4dc9-4deb-41e4-9ac9-dde943fb91ba","savedPayload":{"position":{"x":17292.23789362744,"y":15134.392617857315},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"acddff59-b51b-4b45-b58f-71d4077755ee"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Balance","id":"e94b9bb3-9f0c-4550-94e1-09de444780a8","savedPayload":{"position":{"x":17287.49247877813,"y":15013.347651781945},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"213b8fe8-f772-41ea-a3f5-97867be555f7"}}},{"type":"Output Dataset","name":"Multi-Period-Market Distance To Event","id":"a30e7306-7be9-41b6-a465-558fdfe2a903","savedPayload":{"position":{"x":17288.98513586243,"y":14892.41686293203},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"0ef6aa1d-3345-40f8-bc4f-4d2e2ff199ff"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Distance To Event","id":"3080f872-54a7-40c4-b056-983947cc24bd","savedPayload":{"position":{"x":17296.711661379682,"y":14771.529799613685},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"c291211b-4012-4440-a302-8e15412b0990"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Strategy","id":"55861598-6cfa-45c8-b0ed-f40e9dbe7f3b","savedPayload":{"position":{"x":17310.65134253611,"y":14651.200479355804},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"7b4550d3-69d1-41ac-bad3-e2283f798bb8"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Strategy","id":"924a8293-24d8-4718-aa5e-f27f98b45908","savedPayload":{"position":{"x":17330.76710361171,"y":14531.748785417456},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"49d55660-71e9-4c5a-8b1a-198934844e4a"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Position","id":"b8ea1360-a746-4aaf-b38d-ab14178db127","savedPayload":{"position":{"x":17357.00552521386,"y":14413.491425771617},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"7506dd91-ad9d-4aad-bb1a-604bc5d3fe8d"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Position","id":"3a37475b-ed55-4040-a555-f383ad74b6f5","savedPayload":{"position":{"x":17389.296974859448,"y":14296.74191306432},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"06678152-1082-4f00-9275-22ffde715469"}}},{"type":"Output Dataset","name":"Multi-Period-Market Last Position","id":"68eff2b5-a456-4cb8-9410-4b0596bbed92","savedPayload":{"position":{"x":17427.555783524644,"y":14181.809777350525},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"485671ff-0d50-4c08-958c-93e657cd238f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Last Position","id":"bbe43faf-1f61-4dab-8ac4-3d6642c5ab35","savedPayload":{"position":{"x":17471.680467984806,"y":14068.999745380686},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"a909df42-6192-4bbd-9f38-e8800149aaa1"}}},{"type":"Output Dataset","name":"Multi-Period-Market Previous Balance","id":"da332a96-6079-4fe4-985c-5cfeb58f8ba7","savedPayload":{"position":{"x":17521.55399687285,"y":13958.610928842461},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"7e78025f-e284-4ca1-9351-bc5699491e4f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Previous Balance","id":"9ad3e9d5-8cbf-42b1-9a37-7a99d6852d65","savedPayload":{"position":{"x":17577.044099021365,"y":13850.93602796892},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2aa4b10e-4d73-4391-b820-950038505045"}}},{"type":"Output Dataset","name":"Multi-Period-Market Previous Candle","id":"a30b2f86-2716-4fa0-97d0-14a7cceb4f65","savedPayload":{"position":{"x":17638.003612871635,"y":13746.260552977767},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"34de89b0-406c-4132-b308-053bc1d90a38"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Previous Candle","id":"c6630458-0815-4e74-827d-c26a68c5a84b","savedPayload":{"position":{"x":17704.27087578961,"y":13644.862065243033},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"d1533eeb-1c10-4a6b-97ea-d619441946e4"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Highlights","id":"9b1ddcd4-a04e-4257-b34b-aac7e820ec6b","savedPayload":{"position":{"x":17775.670152114362,"y":13547.009440024773},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"6e0f951c-25e7-4b92-85da-8be04d424bd0"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Highlights","id":"7d17f2a1-17a7-4f1f-a4c4-f1b5e0d1144b","savedPayload":{"position":{"x":17852.01209871445,"y":13452.962152570055},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"fa53ecfb-a558-4810-b6f8-1f9c6c8bfc5b"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Values","id":"5840f961-7985-418b-aa2e-e4ac553de822","savedPayload":{"position":{"x":17933.094266759956,"y":13362.969589379396},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"9c4ec2f8-f4a8-45b9-aba3-b093a7b8f86a"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Values","id":"fb246bbf-cd71-410f-b67d-f7dbb8adb01b","savedPayload":{"position":{"x":18018.701638341565,"y":13277.27038639732},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"b3d3fe62-e714-4cb9-a78d-55bc0add1d7c"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Errors","id":"4d1ea5e9-aa39-4307-9de2-7d1d472d3b2e","savedPayload":{"position":{"x":18108.60719648822,"y":13196.091795836133},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"2ef33675-fc52-49fd-a8ef-bc5da1711dd1"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Errors","id":"60e560bc-5220-4a91-96ee-234deccfb890","savedPayload":{"position":{"x":18202.572527054464,"y":13119.649083280814},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2d0dd4c2-4f4c-4d8c-b9a5-9ca62f186369"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Status","id":"7318b132-939f-4fdd-bd7f-37a8a9cf4442","savedPayload":{"position":{"x":18300.348450869507,"y":13048.14495665293},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"2b83dc93-dc14-44d9-8f8c-889f39a952da"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Status","id":"e0941495-2d77-4f69-9630-21435fe0bb59","savedPayload":{"position":{"x":18401.675684463207,"y":12981.769028534318},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"0f8dcda3-1eab-439d-956c-c6eb9b1c481f"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Progress","id":"56858f59-372c-48b4-8325-9293e3a1aeef","savedPayload":{"position":{"x":18506.285527610748,"y":12920.697313268014},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"77735fc0-9ce6-4dec-a3ad-8075a22eda40"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Progress","id":"a0780dd7-5b09-4889-98a9-508550b34794","savedPayload":{"position":{"x":18613.90057586763,"y":12865.09176016574},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2fde11bd-4515-4a4e-9dc0-f6869dd3a04e"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Running","id":"e5bc8cf9-9370-4f5b-90dc-a95be0b6b877","savedPayload":{"position":{"x":18724.235456200706,"y":12815.0998240585},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"c7b45884-6cdf-43f7-a1e5-c5325effd207"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Running","id":"5916c406-b53f-4112-959f-259327764ce3","savedPayload":{"position":{"x":18836.997583759286,"y":12770.854074330126},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"a21cbc62-e6d8-4286-b0ff-430071d46700"}}},{"type":"Output Dataset","name":"Multi-Period-Market Strategies","id":"888c619e-3402-4450-ac04-f21690784f76","savedPayload":{"position":{"x":18951.887937772706,"y":12732.47184347314},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"03d1a187-b188-4ad7-b99e-6e4f6c6f0278"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Strategies","id":"898b3121-33f8-4bbc-88fd-3adaaa7e4dfd","savedPayload":{"position":{"x":19068.601854508175,"y":12700.054916102066},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"58a5a046-53a1-43a7-bb76-0c29d94ef579"}}},{"type":"Output Dataset","name":"Multi-Period-Market Positions","id":"8a4cc094-2a6d-46b1-bdd3-a84fcf59e949","savedPayload":{"position":{"x":19186.829835174864,"y":12673.68925925129},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"55df9376-2806-429d-b43d-b96700787f74"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Positions","id":"6e9eff26-ae5d-46f3-9c95-c0df02fcf626","savedPayload":{"position":{"x":19306.25836661786,"y":12653.4447946727},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"fd62b468-93fa-44e0-941f-fff7ea4b04ea"}}},{"type":"Output Dataset","name":"Multi-Period-Market Stop Loss","id":"7b66ec68-cbea-4b0f-8ea4-967f2c20eaef","savedPayload":{"position":{"x":19426.57075261033,"y":12639.37521373204},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"0ea22a69-e7cb-4fcf-b7ae-4b7233b196c4"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Stop Loss","id":"0ea322e0-49b0-4464-bfef-577b9229b21c","savedPayload":{"position":{"x":19547.447953524843,"y":12631.517835382998},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"75b13383-2771-4f58-b2c4-ffadad2e9519"}}},{"type":"Output Dataset","name":"Multi-Period-Market Take Profit","id":"61b513ab-8308-4ca1-b43b-4eaf9a5460a0","savedPayload":{"position":{"x":19668.37322754854,"y":12629.89342882628},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3cd59aa1-0590-43b6-9fb7-c85276ac132e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Take Profit","id":"aca07882-8dc1-4a36-9bab-207feb0a8156","savedPayload":{"position":{"x":19789.41649614333,"y":12634.506610845157},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"916d5610-87ae-47e7-9067-9a406141e3df"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Announcements","id":"cf996d5d-8bc6-40c1-a236-b1cb44e03683","savedPayload":{"position":{"x":19910.062996598277,"y":12645.34490603952},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"9e29a710-30c0-4faa-b71a-f4ee109673a2"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Announcements","id":"0f14a501-fb5d-4cc3-a1e4-cf222033b38e","savedPayload":{"position":{"x":20029.991792671528,"y":12662.379634289566},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"b7e24195-a9d0-45e7-9dba-447db8000feb"}}},{"type":"Output Dataset","name":"Multi-Period-Market Last Strategy","id":"cf14f3cd-76ca-4071-8935-5d8b51f0727a","savedPayload":{"position":{"x":20148.884768645727,"y":12685.565649762912},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"a2e7b5d2-8556-4c58-b2f6-a9c27c939e94"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Last Strategy","id":"016f5453-95db-4f4c-a6ca-ea640706ad30","savedPayload":{"position":{"x":20266.426627606837,"y":12714.841496383935},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"76ff2401-1d4f-4dda-87f6-5e0b7af3eab2"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Buy Orders","id":"cede531c-2537-41c1-88e0-0966ef55918d","savedPayload":{"position":{"x":20382.30566853795,"y":12750.129573081727},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"45609efb-0edc-4aa9-bc12-f5b4ca6dc5bf"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Buy Orders","id":"87eb188c-fb75-4b71-b586-76df2562bdbd","savedPayload":{"position":{"x":20496.214604473727,"y":12791.336340800579},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"5eed53d0-a3e7-4082-b7f1-cb321b3d306b"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Sell Orders","id":"9749984c-d822-444c-ba73-0afe496701ba","savedPayload":{"position":{"x":20607.851376932686,"y":12838.352572565283},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"6112bd4d-07cb-41db-98c4-e286d172b5c0"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Sell Orders","id":"fa7851cd-960a-4fee-8555-098d7c0f7bf1","savedPayload":{"position":{"x":20716.919958947004,"y":12891.053646754892},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"07cd5668-5e0f-4385-9c02-72eebc99344a"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Buy Orders","id":"b4c63226-bf40-4ce9-a10f-c24557653931","savedPayload":{"position":{"x":20823.13114359145,"y":12949.299883764048},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"b82fb0f9-74c1-42e6-961c-a696214ef079"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Buy Orders","id":"c145f3a1-5e3b-4fd7-990e-301afd556ed5","savedPayload":{"position":{"x":20926.20331600415,"y":13012.936926582708},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2e03f52e-0cd2-46b4-9c10-0b8516ef9c71"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Sell Orders","id":"5caac63a-79fe-41f8-b8e9-c7bb37266e36","savedPayload":{"position":{"x":21025.86320767975,"y":13081.796166731898},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"356495a9-b063-495d-b06d-5281c7c0007e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Sell Orders","id":"4bd13f7d-defe-45de-89c2-d9585d136a66","savedPayload":{"position":{"x":21121.846633087946,"y":13155.695219131434},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"934ab813-127e-4bbf-aa71-09b3cdadc0d0"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Buy Orders","id":"8e7de106-fb91-4870-9dd7-abd95612334a","savedPayload":{"position":{"x":21213.899211250402,"y":13234.438454452464},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"a2ea8001-2143-4055-b1d3-525d95fa8e6f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Buy Orders","id":"a411c8b0-d77b-47aa-afb2-a87ed5af45a9","savedPayload":{"position":{"x":21301.77708080396,"y":13317.817609519618},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"557357c6-f814-4bf9-9426-82fc5e22c028"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Sell Orders","id":"ae79cdc6-d3ba-4d35-9576-3a1d9423f463","savedPayload":{"position":{"x":21384.590944493164,"y":13404.934525864779},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"917cfdae-b736-4ed5-ad8e-d572c49ea489"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Sell Orders","id":"9368bd45-ac63-4516-a847-3a95dc05a4be","savedPayload":{"position":{"x":21463.8136836629,"y":13497.19854180655},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"3c878a50-6d76-412b-95d7-f2e546960293"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Buy Orders","id":"0e8787f5-280a-4b8c-a44a-547eae004be4","savedPayload":{"position":{"x":21539.033843080848,"y":13594.58645171344},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"df8cfaa4-a4d4-4bc1-9fa2-4f8e91e45a87"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Buy Orders","id":"efea7ba6-b9a7-4f84-bcb2-836e4b7eb67e","savedPayload":{"position":{"x":21607.082998953836,"y":13693.147942095473},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"12652573-9506-4d3e-82bb-64b1bb9e7ce0"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Sell Orders","id":"beb0297b-e178-4a0d-8054-ab171021024a","savedPayload":{"position":{"x":21670.866058778232,"y":13796.233014650197},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"f645108f-4648-497f-b361-0be5b84c233a"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Sell Orders","id":"559f0101-1ef2-43d1-a0cc-6e1df75edec4","savedPayload":{"position":{"x":21729.410392091602,"y":13902.735386102204},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"e98191d1-5b13-42eb-bd52-31e3c6830188"}}}],"id":"8a70c5a8-40b8-4a49-a77f-e02efce9556e","savedPayload":{"position":{"x":19639.12824066453,"y":14981.687173508728},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":3,"distanceToParent":4,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Low Frequency Trading","config":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"e7fd528f-46bb-4a13-a11f-b6994236e3e7","savedPayload":{"position":{"x":17809.60651084167,"y":15999.191155263683},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"a8577e6c-9afc-4c9e-87ef-ee38531de864"}}},{"type":"Status Dependency","name":"Candles Volumes Multi-Period-Market","config":"{\n\"mainUtility\": \"Market Ending Point\"\n}","id":"0517c2f1-627f-44e2-b58d-6d3f72d6c931","savedPayload":{"position":{"x":17805.015670463275,"y":15881.675430240237},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"a0a61ba9-91cb-4ec7-92fe-134ff079de2d"}}},{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\"mainUtility\": \"Market Starting Point\"}","id":"0b6d7ced-ccef-4a98-909c-443125480c10","savedPayload":{"position":{"x":17807.69757919285,"y":15764.898811662715},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e"}}}],"dataDependencies":[{"type":"Data Dependency","name":"Bollinger Bands Multi-Period-Market","id":"e63b5078-9328-4a8f-b5d6-afe2aa4978ae","savedPayload":{"position":{"x":17817.581028218345,"y":15648.300112805127},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"f5b2a7d8-fc32-44a3-a002-9b0fc30a9719"}}},{"type":"Data Dependency","name":"Percentage Bandwidth Multi-Period-Market","id":"f2e34e16-a766-49e7-be23-4500ffecee77","savedPayload":{"position":{"x":17834.62307851244,"y":15532.565092640696},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"207e9481-0730-4304-a938-cfe223d70856"}}},{"type":"Data Dependency","name":"Bollinger Channels Market","id":"b59f31af-76f5-486b-b0f2-25a0811b5093","savedPayload":{"position":{"x":17858.763290083698,"y":15418.113479994203},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Market","id":"22c1f2c6-3838-4657-add8-2e01d7056917"}}},{"type":"Data Dependency","name":"Bollinger Sub-Channels Market","id":"ffe42686-a327-4968-a2f7-82e94675bef1","savedPayload":{"position":{"x":17889.899245449113,"y":15305.371459819195},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Market","id":"f8d44a4d-3771-4a71-97ca-dc604ff565d3"}}},{"type":"Data Dependency","name":"Candles Multi-Period-Market","id":"ee3e4fec-1586-4ce0-8f21-8c547f1d5c17","savedPayload":{"position":{"x":17927.91503228644,"y":15194.76479856646},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"2b03494a-67d6-47f1-89b6-53fc4c9116a8"}}},{"type":"Data Dependency","name":"Bollinger Bands Multi-Period-Daily","id":"8c0263f6-33bc-4e10-9820-c4041bba8d98","savedPayload":{"position":{"x":17972.670000016667,"y":15086.712909575823},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"506104fa-e99a-4a46-930e-176bce311aff"}}},{"type":"Data Dependency","name":"Percentage Bandwidth Multi-Period-Daily","id":"604dc772-1946-486d-a4a6-2fe06aa3cd32","savedPayload":{"position":{"x":18023.990663260385,"y":14981.619316504293},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"e60d62dd-87f7-4f2d-ac21-3ac5c30a50ea"}}},{"type":"Data Dependency","name":"Bollinger Channels Daily","id":"01d998bf-2242-4874-83b5-ecfd963b9a41","savedPayload":{"position":{"x":18081.68442341935,"y":14879.890686789326},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Daily","id":"96b4e65b-e6db-44a0-80a5-ceb9d68a09ec"}}},{"type":"Data Dependency","name":"Bollinger Sub-Channels Daily","id":"f29fb726-3488-46d3-9afe-eed525075df3","savedPayload":{"position":{"x":18145.527810724234,"y":14781.902181070356},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Daily","id":"ca71e765-0f66-4b18-b500-847b9d16169b"}}},{"type":"Data Dependency","name":"Candles Multi-Period-Daily","id":"6ec46e2f-d0f5-468d-b2bb-9f6151fc59b5","savedPayload":{"position":{"x":18215.286324268534,"y":14688.037170504567},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"678a567c-f08d-49b9-813b-4e54fd6afadb"}}},{"type":"Data Dependency","name":"Volumes Multi-Period-Market","id":"92f9fc38-99ec-4046-9fe5-02099bea5e17","savedPayload":{"position":{"x":18290.6870400883,"y":14598.640017775022},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"9bf0483c-4825-4a46-9cf4-1b5262579fc1"}}},{"type":"Data Dependency","name":"Volumes Multi-Period-Daily","id":"83245c23-556c-4f73-baf0-a09dcb55d338","savedPayload":{"position":{"x":18371.44826962373,"y":14514.054228156165},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2e683057-f911-4105-bc77-16f2706d1915"}}},{"type":"Data Dependency","name":"Candles Channels Multi-Period-Market","id":"9b4950e5-8bec-4fc0-90a2-078bc1aa0262","savedPayload":{"position":{"x":18457.265507314976,"y":14434.602791293502},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"df7d1cd7-95b0-499c-b51a-772c3fb8a2b0"}}},{"type":"Data Dependency","name":"Candles Channels Multi-Period-Daily","id":"d81c37d1-286f-44c9-97cb-9111be0603f5","savedPayload":{"position":{"x":18547.811993422252,"y":14360.5893555312},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"07734f1c-e2e7-4a35-8567-6a996c68883e"}}},{"type":"Data Dependency","name":"Candles Channels Objects Multi-Period-Market","id":"e6ca827c-6d70-4c22-ad69-b29b94444578","savedPayload":{"position":{"x":18642.73990711171,"y":14292.282310072856},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"566b9df4-da86-4b4f-a3f4-ef8a76443714"}}},{"type":"Data Dependency","name":"Candles Channels Objects Multi-Period-Daily","id":"a55fd633-ffa6-4888-a3ea-2b6fa4895b67","savedPayload":{"position":{"x":18741.698194703014,"y":14229.955591244665},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"8a7d224b-7571-4e1a-8b8f-8a35aa25dc63"}}},{"type":"Data Dependency","name":"Popular SMAs Multi-Period-Market","id":"75b9a638-6a42-4730-8aa3-151fdb2e3c97","savedPayload":{"position":{"x":18844.30037684593,"y":14173.834620151925},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3b21f9d7-2cbc-4c23-80c8-cc5e5b06a22c"}}},{"type":"Data Dependency","name":"Popular SMAs Multi-Period-Daily","id":"19c94d5d-9790-4f37-8fdc-3bd91d237c14","savedPayload":{"position":{"x":18950.164019483193,"y":14124.138152587615},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2c338fe0-385f-45ab-b210-b98ef013228d"}}},{"type":"Data Dependency","name":"Base7 SMAs Multi-Period-Market","id":"8dd779a7-13e3-4bd7-8134-d8f3e2b69ab7","savedPayload":{"position":{"x":19058.885631178386,"y":14081.054211329121},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"78a6ef37-4df8-4ac8-83a0-c9a732467c59"}}},{"type":"Data Dependency","name":"Base7 SMAs Multi-Period-Daily","id":"68c2d0db-1766-45b8-9d38-42745f99275f","savedPayload":{"position":{"x":19170.054023679866,"y":14044.745319145468},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f155e2ed-7082-4021-a4ff-a6f3cfd5683d"}}},{"type":"Data Dependency","name":"Base11 SMAs Multi-Period-Market","id":"7f832c99-ad47-4606-80bc-7cd71eaf9a58","savedPayload":{"position":{"x":19283.24653660857,"y":14015.347563018106},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"af9b9cef-2a74-486f-b79e-047d68669a1f"}}},{"type":"Data Dependency","name":"Base11 SMAs Multi-Period-Daily","id":"48ab1481-9447-495e-b0b8-8ce79dc89307","savedPayload":{"position":{"x":19398.033790684898,"y":13992.972976086485},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"de5cfa30-edbf-4d5b-8d7f-facfb69a0f3e"}}},{"type":"Data Dependency","name":"Popular EMAs Multi-Period-Market","id":"61daf85b-f311-47c9-afd7-adc553beb154","savedPayload":{"position":{"x":19513.982755351088,"y":13977.708187501354},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"ea1af06a-2584-43f0-aecf-ec8ad9169e9c"}}},{"type":"Data Dependency","name":"Popular EMAs Multi-Period-Daily","id":"51339945-99cb-458b-9289-2b328acdc8d0","savedPayload":{"position":{"x":19630.64947355191,"y":13969.614712786937},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"e7f5899c-fc4c-412d-a8db-77c1bef8ed21"}}},{"type":"Data Dependency","name":"Base7 EMAs Multi-Period-Market","id":"ce7bcd93-d47a-4628-a996-14505d5a8594","savedPayload":{"position":{"x":19747.293837511883,"y":13968.7112843051},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"4e36a5a5-7a03-43a9-b3e0-0c5763c29199"}}},{"type":"Data Dependency","name":"Base7 EMAs Multi-Period-Daily","id":"5cb84538-2e4c-4868-8903-a30702628bee","savedPayload":{"position":{"x":19864.06525187253,"y":13975.013321544944},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"15ccbcff-318d-46db-93f2-d649b57fd52a"}}},{"type":"Data Dependency","name":"Base11 EMAs Multi-Period-Market","id":"bde24159-44de-4864-b526-69158fab21aa","savedPayload":{"position":{"x":19980.234611322503,"y":13988.494340728084},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"5586aa74-2ecb-4b71-83ea-d621aa400660"}}},{"type":"Data Dependency","name":"Base11 EMAs Multi-Period-Daily","id":"bad61638-d7d0-469b-ba4b-d09e708392f0","savedPayload":{"position":{"x":20095.355460260518,"y":14009.097458993385},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"0198fa3f-98e3-4c57-a4a4-a7a8e27905d3"}}},{"type":"Data Dependency","name":"RSI14 Multi-Period-Daily","id":"30b21270-85a4-40b4-bd6a-397f0f0076a4","savedPayload":{"position":{"x":20208.984647795955,"y":14036.747125685284},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f1556d09-f134-4678-83fb-04002d1dcd34"}}},{"type":"Data Dependency","name":"RSI14 Multi-Period-Market","id":"68540e2b-d05b-420a-a7c2-f77cb9d061b8","savedPayload":{"position":{"x":20320.699793411335,"y":14071.34498805082},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"5ec62760-e144-4496-98ab-0415a4b315ec"}}},{"type":"Data Dependency","name":"Base6 SMAs Multi-Period-Market","id":"2bd8871d-4267-4afc-b89f-144ee28f1925","savedPayload":{"position":{"x":20430.073063300977,"y":14112.748781085029},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"c0862b3d-d35a-4d3e-8d80-258b8a01c37c"}}},{"type":"Data Dependency","name":"Base6 SMAs Multi-Period-Daily","id":"7c5f7fbd-dbce-4d71-b518-8aabae589d37","savedPayload":{"position":{"x":20536.689590417544,"y":14160.812614209619},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f5050eb2-0a99-464e-b5e2-2d8f40453e9a"}}},{"type":"Data Dependency","name":"Base5 SMAs Muti-Period-Market","id":"b7c02c69-f96e-4254-86dd-f42be1d7d085","savedPayload":{"position":{"x":20640.14378045625,"y":14215.344501325528},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Muti-Period-Market","id":"a5d28568-fb58-469a-9820-b9f0e8eab705"}}},{"type":"Data Dependency","name":"Base5 SMAs Multi-Period-Daily","id":"28a71823-717e-451c-86e4-451d2abdcca0","savedPayload":{"position":{"x":20740.047398431725,"y":14276.146776863297},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"01f32aa3-55e9-4f8c-80c7-997b52073274"}}},{"type":"Data Dependency","name":"MACD 122609 Multi-Period-Market","id":"cbeb7069-9a02-464e-9f0c-67e528a14019","savedPayload":{"position":{"x":20836.01755671951,"y":14342.981461561392},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"01d43ed0-2a80-4eca-bee6-db2fe40470fc"}}},{"type":"Data Dependency","name":"MACD 122609 Multi-Period-Daily","id":"2b78c197-5800-478e-8f63-4c51ca35391a","savedPayload":{"position":{"x":20927.69351471674,"y":14415.599253367553},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"dd5d3067-ff7b-4353-ba4f-c030bd3da796"}}},{"type":"Data Dependency","name":"MACD 031016 Multi-Period-Market","id":"05130e8e-faa2-48d6-a1d7-fb6184470351","savedPayload":{"position":{"x":21014.72023494026,"y":14493.721846093633},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"19b1d791-d2ea-4f25-a6e1-fe0a64450745"}}},{"type":"Data Dependency","name":"MACD 031016 Multi-Period-Daily","id":"3e09332d-5266-4520-a793-085e1adeeee5","savedPayload":{"position":{"x":21096.77680780715,"y":14577.053505279142},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"ec2611a6-699b-45a5-beec-679dd4b7734a"}}},{"type":"Data Dependency","name":"MACD 081709 Multi-Period-Market","id":"a1769cc9-85aa-4e02-aa24-2aa1aeb6e673","savedPayload":{"position":{"x":21173.54790227127,"y":14665.282473949534},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"c390cbd3-0ba0-4507-8614-42c88f4ce7e6"}}},{"type":"Data Dependency","name":"MACD 081709 Multi-Period-Daily","id":"2744637c-cdc4-4dae-82df-04bd9a9b664f","savedPayload":{"position":{"x":21244.74227560235,"y":14758.072720908136},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"29e18539-f188-4d29-9531-25cd3ee8f282"}}},{"type":"Data Dependency","name":"MACD 245209 Multi-Period-Market","id":"9414cc05-86f2-4601-9049-591f80fd9510","savedPayload":{"position":{"x":21310.092329410265,"y":14855.069034691165},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"89254c6c-9be2-4037-b063-467edc660d10"}}},{"type":"Data Dependency","name":"MACD 245209 Multi-Period-Daily","id":"fd5e05cc-3c34-44d1-817c-4fd74eae7618","savedPayload":{"position":{"x":21369.347694188004,"y":14955.912311781316},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"8a9dde13-e4b8-40f3-80bc-ea51050b2f08"}}},{"type":"Data Dependency","name":"External Signals Single File","id":"4b1cc9b6-d243-4aa0-b784-7860f7af4cf3","savedPayload":{"position":{"x":21422.27943508304,"y":15060.221132916242},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Single File","id":"c52d1012-5e3b-41a0-b5af-84098b0594bf"}}},{"type":"Data Dependency","name":"Resistances Multi-Period-Market","id":"ec47fa78-79a8-4e6b-866b-355cef2d6fc4","savedPayload":{"position":{"x":21468.69756292535,"y":15167.601854260722},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"44e905fc-719f-453b-a567-fd5e3bfcae91"}}},{"type":"Data Dependency","name":"Resistances Multi-Period-Daily","id":"1be0946e-4940-4d6d-9c07-7bd19b6b7f3c","savedPayload":{"position":{"x":21508.42560461595,"y":15277.668819732304},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f4530d48-3239-4ab0-8c4d-d611cd55fde3"}}},{"type":"Data Dependency","name":"Supports Multi-Period-Market","id":"b8ea23ab-4fc1-4cc8-85ff-f6c60dd4cb51","savedPayload":{"position":{"x":21541.317095035778,"y":15390.062321896718},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"4a1bd251-76ed-4530-8723-08e41d50f12d"}}},{"type":"Data Dependency","name":"Supports Multi-Period-Daily","id":"f4991669-5947-4b7b-a25b-aa28c4a000e7","savedPayload":{"position":{"x":21567.343801654748,"y":15504.764296138286},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"deaaf4ec-9352-40b6-af9a-8541a73a5e13"}}}],"id":"5175cccd-58ed-40d8-8e0d-1a234d7460eb","savedPayload":{"position":{"x":20101.0669768849,"y":14034.10476679153},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":3,"distanceToParent":5,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":""}}},"statusReport":{"type":"Status Report","name":"New Status Report","id":"a8577e6c-9afc-4c9e-87ef-ee38531de864","savedPayload":{"position":{"x":20765.038872275112,"y":15565.302895263007},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"","id":"a47d063a-c7b9-40d9-8d77-26cead472b6c","savedPayload":{"position":{"x":21164.160192725034,"y":15658.346633359854},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"dd185847-d39a-4501-8863-f906716b5f79","savedPayload":{"position":{"x":21525.596708395296,"y":15851.538017380288},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a8c8d761-96e5-4a86-9285-6c3881d61442","savedPayload":{"position":{"x":20611.282204513624,"y":17127.423073515496},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":""}}}],"products":[{"type":"Product Definition","name":"Episode Counters","config":"{\n \"codeName\": \"Episode-Counters\",\n \"singularVariableName\": \"episodeCounter\",\n \"pluralVariableName\": \"episodeCounters\",\n \"nodePath\": \"tradingEngine.episode.episodeCounters\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"db063d7b-db05-4bf6-941f-999e1ccb38fc","savedPayload":{"position":{"x":20610.21817407383,"y":16381.831181285403},"targetPosition":{"x":20764.105414789028,"y":17152.84556063395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0764aaaf-d970-4f23-9df8-55fe5b7dd273","savedPayload":{"position":{"x":20916.93988782024,"y":16381.662535160334},"targetPosition":{"x":20764.105414789028,"y":17152.84556063395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"546573ec-8fd0-4bf2-8cfa-d9b42e9687d1","savedPayload":{"position":{"x":20736.003454862723,"y":15865.69698846926},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"e0540aa0-c559-41c4-906e-68f2e18e1e72","savedPayload":{"position":{"x":20980.786410427852,"y":15744.988963866082},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{\n \"codeName\": \"periods\",\n \"isString\": false\n}","id":"b4b3b148-7425-40ba-98ef-bda43655264a","savedPayload":{"position":{"x":21251.712276716826,"y":15715.27497063253},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategies","config":"{\n \"codeName\": \"strategies\",\n \"isString\": false\n}","id":"49e5d0cf-d508-4359-be84-d44791651d09","savedPayload":{"position":{"x":21516.713134581005,"y":15780.07794161074},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Positions","config":"{\n \"codeName\": \"positions\",\n \"isString\": false\n}","id":"d5e21283-d484-4c39-9079-b3b659f6c8eb","savedPayload":{"position":{"x":21743.524910127573,"y":15931.532716808419},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Orders","config":"{\n \"codeName\": \"orders\",\n \"isString\": false\n}","id":"50a846fb-32f3-4bc7-b9ff-aaea463d1472","savedPayload":{"position":{"x":21904.696008487714,"y":16151.08307297697},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hits","config":"{\n \"codeName\": \"hits\",\n \"isString\": false\n}","id":"d6c69a51-46f1-4416-986a-fe037d329e59","savedPayload":{"position":{"x":21985.96070430569,"y":16417.8937729054},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fails","config":"{\n \"codeName\": \"fails\",\n \"isString\": false\n}","id":"a50da830-2844-4965-b920-25c8d221c029","savedPayload":{"position":{"x":21963.438409291033,"y":16684.88309699204},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"6e46b65d-0e6f-4666-a4c7-e9bc9e3d1c43","savedPayload":{"position":{"x":21200.542970090333,"y":16499.267328795824},"targetPosition":{"x":20764.105414789028,"y":17152.84556063395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"574cfd2f-a269-452d-9a90-dd6921ebc49d","savedPayload":{"position":{"x":20764.322177254293,"y":17152.725906446376},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Episode Counters","id":"5e478e3f-e432-4364-8f2c-2f3b2849848b"}}},{"type":"Product Definition","name":"Episode Statistics","config":"{\n \"codeName\": \"Episode-Statistics\",\n \"singularVariableName\": \"episodeStatistics\",\n \"pluralVariableName\": \"episodeStatistics\",\n \"nodePath\": \"tradingEngine.episode.episodeStatistics\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f","savedPayload":{"position":{"x":20835.28306865707,"y":16407.801760920007},"targetPosition":{"x":20913.000712553854,"y":17190.201859064317},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"91953362-8751-4440-a898-21245cd47c15","savedPayload":{"position":{"x":21140.553559000844,"y":16437.68934861752},"targetPosition":{"x":20913.000712553854,"y":17190.201859064317},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"8a268555-b786-4756-9e5c-7a190c3ae37e","savedPayload":{"position":{"x":20968.791446477233,"y":15933.151788817757},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"ef14e964-9f33-4b53-bf44-bd81c386319d","savedPayload":{"position":{"x":21169.772203234992,"y":15834.763924897374},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false\n}","id":"360e05d7-340f-4975-93f2-b15835e975d2","savedPayload":{"position":{"x":21390.19994900245,"y":15797.011876237026},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hit Ratio","config":"{\n \"codeName\": \"hitRatio\",\n \"isString\": false\n}","id":"86673116-3204-4510-b076-131571ea631d","savedPayload":{"position":{"x":21611.984829251945,"y":15822.849806461934},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{\n \"codeName\": \"days\",\n \"isString\": false,\n \"decimals\": 2\n}","id":"72167f7d-b29e-4f27-a68c-4a3fa3d7c321","savedPayload":{"position":{"x":21817.78528251811,"y":15910.155412007112},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{\n \"codeName\": \"ROI\",\n \"isString\": false,\n \"decimals\": 2\n}","id":"2e89519e-eab5-4656-ade5-3a18eb1cf07f","savedPayload":{"position":{"x":21990.618322565133,"y":16051.719578103439},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Anualized Rate Of Return","config":"{ \n\"codeName\": \"anualizedRateOfReturn\",\n\"isString\": false,\n\"isCalculated\": false,\n \"decimals\": 2\n}","id":"9177857b-5e67-4e42-a874-b0e1633ad45d","savedPayload":{"position":{"x":22116.836088827087,"y":16236.084863363907},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"8356215e-6e31-45d0-bd78-ba080d2258de","savedPayload":{"position":{"x":22185.303699398526,"y":16450.287991169684},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"59b47d20-5679-4889-8c1f-7853aa68f4a0","savedPayload":{"position":{"x":22191.51427491864,"y":16672.680369555772},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"df7dbe99-16e8-42ad-9c8b-5acdf3b63f05","savedPayload":{"position":{"x":22134.538282042544,"y":16888.670011016024},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"c0f124f4-1e7d-4d06-94fd-b547257b4061","savedPayload":{"position":{"x":21411.17394303341,"y":16582.464963322014},"targetPosition":{"x":20913.000712553854,"y":17190.201859064317},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"400c7f49-37da-41fb-b83d-879960aa74ff","savedPayload":{"position":{"x":20913.28359850571,"y":17190.074246163687},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Episode Statistics","id":"6ce18a43-2e6a-452e-a72d-1c56a58d3f81"}}},{"type":"Product Definition","name":"Current Candle","config":"{\n \"codeName\": \"Current-Candle\",\n \"singularVariableName\": \"currentCandle\",\n \"pluralVariableName\": \"currentCandles\",\n \"nodePath\": \"tradingEngine.current.candle\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e","savedPayload":{"position":{"x":21057.182018950927,"y":16455.73941281685},"targetPosition":{"x":21057.97253067345,"y":17242.071992663343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9","savedPayload":{"position":{"x":21357.930922462525,"y":16515.31314398561},"targetPosition":{"x":21057.97253067345,"y":17242.071992663343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9ffe3183-b249-41b6-8e57-56b5d5023376","savedPayload":{"position":{"x":21292.74607925211,"y":15948.165638128643},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"b7b61cc0-b94d-40cb-abe1-047463675f5b","savedPayload":{"position":{"x":21593.370600764338,"y":15888.31242864485},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open","config":"{\n \"codeName\": \"open\",\n \"isString\": false\n}","id":"f93f3ac6-8420-401c-9921-2229d02f5832","savedPayload":{"position":{"x":21893.72311854087,"y":15947.96379085217},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close","config":"{\n \"codeName\": \"close\",\n \"isString\": false\n}","id":"86935367-3d64-4ad2-8171-be1368ca0a8d","savedPayload":{"position":{"x":22148.657203035793,"y":16117.745078044867},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Min","config":"{\n \"codeName\": \"min\",\n \"isString\": false\n}","id":"e5bad869-4386-48a6-b434-36253eaf7f48","savedPayload":{"position":{"x":22298.23935366627,"y":16401.252143764792},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Max","config":"{\n \"codeName\": \"max\",\n \"isString\": false\n}","id":"9c960e9d-7d1f-440b-9e5a-76e81f5a8e29","savedPayload":{"position":{"x":22378.95492396516,"y":16673.829836759967},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"67d251d5-a236-42e7-8b34-4a5276e64d25","savedPayload":{"position":{"x":22319.67736139288,"y":16974.06028815051},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d52a6d09-8b78-49db-a525-48a82991fcbc","savedPayload":{"position":{"x":21593.072669703386,"y":16673.86063760848},"targetPosition":{"x":21057.97253067345,"y":17242.071992663343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"b9a58113-cf27-4d57-9810-87a2cc158804","savedPayload":{"position":{"x":21058.262441444196,"y":17241.95848766772},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Candle","id":"31789d43-d608-4eeb-a3ff-338a99074045"}}},{"type":"Product Definition","name":"Current Balance","config":"{\n \"codeName\": \"Current-Balance\",\n \"singularVariableName\": \"currentBalance\",\n \"pluralVariableName\": \"currentBalance\",\n \"nodePath\": \"tradingEngine.current.balance\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"acddff59-b51b-4b45-b58f-71d4077755ee","savedPayload":{"position":{"x":21273.477947404674,"y":16525.327734366492},"targetPosition":{"x":21197.22892798974,"y":17307.917800370382},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"213b8fe8-f772-41ea-a3f5-97867be555f7","savedPayload":{"position":{"x":21566.87694293676,"y":16614.16543619203},"targetPosition":{"x":21197.22892798974,"y":17307.917800370382},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"c9e3558a-d9e9-4466-97fb-c0e9ec3752c1","savedPayload":{"position":{"x":21759.68548383434,"y":16025.397685038859},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"bfb43790-48a8-4437-a191-9f4c396504fb","savedPayload":{"position":{"x":22229.322343697786,"y":16147.446572005958},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Base Asset","config":"{\n \"codeName\": \"baseAsset\",\n \"isString\": false\n}","id":"7658d8bf-a4e0-490e-a3ae-df3bef72e491","savedPayload":{"position":{"x":22533.73690365352,"y":16525.156003340602},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Quoted Asset","config":"{\n \"codeName\": \"quotedAsset\",\n \"isString\": false\n}","id":"1f5cf49c-7040-4cee-b525-83810013a4fb","savedPayload":{"position":{"x":22566.14248874673,"y":17007.84846238948},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"0755daf6-8847-48c4-9013-394ddb96a89b","savedPayload":{"position":{"x":21806.45339218636,"y":16810.1911201281},"targetPosition":{"x":21197.22892798974,"y":17307.917800370382},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"a9a53d82-133b-4417-b639-f9a56d338233","savedPayload":{"position":{"x":21197.51097503346,"y":17307.821852651745},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Balance","id":"e5d9e3e1-d1f4-4493-b452-33fe49c81228"}}},{"type":"Product Definition","name":"Distance To Event","config":"{\n \"codeName\": \"Distance-To-Event\",\n \"singularVariableName\": \"distanceToEvent\",\n \"pluralVariableName\": \"distanceToEvents\",\n \"nodePath\": \"tradingEngine.current.distanceToEvent\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0ef6aa1d-3345-40f8-bc4f-4d2e2ff199ff","savedPayload":{"position":{"x":21482.226154928598,"y":16615.981625446308},"targetPosition":{"x":21329.4855347349,"y":17387.12429119341},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"c291211b-4012-4440-a302-8e15412b0990","savedPayload":{"position":{"x":21765.839478845173,"y":16733.364777419207},"targetPosition":{"x":21329.4855347349,"y":17387.12429119341},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"0235ad32-fd46-41eb-b875-ae81f3ce48c5","savedPayload":{"position":{"x":21730.434627931554,"y":16206.749379772767},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9d6c01fa-af2b-4d51-9aa4-f169c53e63b3","savedPayload":{"position":{"x":21931.76260012312,"y":16166.697790802335},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger On","config":"{ \n\"codeName\": \"triggerOn\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7e17fb3f-495f-49c5-9b41-6869155b99fc","savedPayload":{"position":{"x":22136.144790599436,"y":16180.130558590503},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger Off","config":"{ \n\"codeName\": \"triggerOff\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"9de32719-925a-4796-b562-379323cb4d82","savedPayload":{"position":{"x":22330.360723442514,"y":16246.073078523621},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Position","config":"{ \n\"codeName\": \"takePosition\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"e4276497-b218-4b18-b089-70fcc5806fa3","savedPayload":{"position":{"x":22500.89148871633,"y":16360.02751027867},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Position","config":"{ \n\"codeName\": \"closePosition\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"4793082b-ddc8-4246-bb0e-c7f6340da600","savedPayload":{"position":{"x":22636.1176704875,"y":16514.230341275303},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Next Phase","config":"{ \n\"codeName\": \"nextPhase\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"0ada00bc-9398-47a0-9659-63b0838b81d7","savedPayload":{"position":{"x":22726.82820698963,"y":16698.174007375197},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Move To Phase","config":"{ \n\"codeName\": \"moveToPhase\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"9020e64b-d301-49f6-bc6c-cb8086730b19","savedPayload":{"position":{"x":22766.84177863087,"y":16899.32618710327},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Create Order","config":"{ \n\"codeName\": \"createOrder\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"906c1925-caab-4db6-8fec-06845a13fd0a","savedPayload":{"position":{"x":22753.427226823314,"y":17103.674484578103},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Cancel Order","config":"{ \n\"codeName\": \"cancelOrder\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"e864d723-5ad5-4bbd-ad7b-0f975d480ee3","savedPayload":{"position":{"x":22687.48636634825,"y":17297.89647705398},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Order","config":"{ \n\"codeName\": \"closeOrder\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f5be374b-36e6-484c-bd78-6e126e3020fb","savedPayload":{"position":{"x":22573.408785919077,"y":17468.525315487823},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"0c3c5d0b-6072-4e57-bff9-9823e0f79b5b","savedPayload":{"position":{"x":21982.98005942234,"y":16950.635577302848},"targetPosition":{"x":21329.4855347349,"y":17387.12429119341},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"8ea88d6c-7d7f-4152-b781-ea108df52c63","savedPayload":{"position":{"x":21329.646498662747,"y":17387.022440548113},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Distance To Event","id":"56eb7de2-0281-404a-bd4d-34ac113e2325"}}},{"type":"Product Definition","name":"Current Strategy","config":"{\n \"codeName\": \"Current-Strategy\",\n \"singularVariableName\": \"currentStrategy\",\n \"pluralVariableName\": \"currentStrategy\",\n \"nodePath\": \"tradingEngine.current.strategy\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"7b4550d3-69d1-41ac-bad3-e2283f798bb8","savedPayload":{"position":{"x":21680.94044039326,"y":16726.36348064086},"targetPosition":{"x":21453.1773811676,"y":17478.901049195178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"49d55660-71e9-4c5a-8b1a-198934844e4a","savedPayload":{"position":{"x":21951.638536162838,"y":16870.978590267317},"targetPosition":{"x":21453.1773811676,"y":17478.901049195178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"3808ed7c-4ae4-4ad8-8ea8-237ee2f8cc8c","savedPayload":{"position":{"x":21909.518354893786,"y":16359.096860253336},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"c8b93e25-fe0e-450a-bcc7-262a06936372","savedPayload":{"position":{"x":22051.517677162898,"y":16328.277065587841},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"702327c6-5dfe-4ab0-bce1-750637a4b863","savedPayload":{"position":{"x":22196.37057056072,"y":16324.08544354176},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"a152bb71-b294-48e7-bf9c-9be7510c8461","savedPayload":{"position":{"x":22339.686328235442,"y":16346.618456193144},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategy Name","config":"{ \n\"codeName\": \"strategyName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"35b9d166-f366-4601-a472-5e8d74be8f82","savedPayload":{"position":{"x":22476.411729222138,"y":16395.09905795914},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"dcdb4018-97ea-4bb8-9e55-5efa00ab8404","savedPayload":{"position":{"x":22601.897401725797,"y":16467.874631828054},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger Stage Status","config":"{ \n\"codeName\": \"triggerStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"183aafec-56a9-4030-b263-1a2e577e6526","savedPayload":{"position":{"x":22711.87293540881,"y":16562.46682735058},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Status","config":"{ \n\"codeName\": \"openStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5c44c941-d0b5-4127-9dc5-ed241f4eebc4","savedPayload":{"position":{"x":22802.594543185274,"y":16675.654773947565},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Manage Stage Status","config":"{ \n\"codeName\": \"manageStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"94b91317-36d0-47d8-8ce7-64272803caab","savedPayload":{"position":{"x":22870.97339838765,"y":16803.584426789257},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Status","config":"{ \n\"codeName\": \"closeStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a47fa5e2-5325-4419-86ef-d1244c8d1da9","savedPayload":{"position":{"x":22914.68111589003,"y":16941.89975281833},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"c2ac38c8-3bc5-4359-8f92-510263b841d1","savedPayload":{"position":{"x":22932.229095623457,"y":17085.8911064268},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"1ae37227-35b8-4abc-a42b-aa0c42fa9fc2","savedPayload":{"position":{"x":22923.018672667222,"y":17230.457686769307},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"288b5fed-0d4b-4b85-9cb5-802c2ff30ca7","savedPayload":{"position":{"x":22887.36206221733,"y":17371.066220416236},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"3802817a-f022-4762-9ff4-412d42f22316","savedPayload":{"position":{"x":22826.46743706523,"y":17502.735126608914},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"97832d1b-40b4-4fc3-9e52-ec3beacf164e","savedPayload":{"position":{"x":22742.38686111381,"y":17620.99168389778},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.strategy.strategyCounters\"\n}","id":"d219dca7-ae8f-422d-a90a-f86b617a76e2","savedPayload":{"position":{"x":22637.832868279304,"y":17721.8926479207},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a4bce1f3-c9cc-470d-b271-1190684aff6f","savedPayload":{"position":{"x":22146.551553907804,"y":17108.538418425713},"targetPosition":{"x":21453.1773811676,"y":17478.901049195178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"895d8a04-ef45-41a7-909a-ba31013ffb90","savedPayload":{"position":{"x":21453.3870819375,"y":17478.795478669545},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Strategy","id":"a3c31000-1b82-4fe9-ae56-6d5893582b16"}}},{"type":"Product Definition","name":"Last Strategy","config":"{\n \"codeName\": \"Last-Strategy\",\n \"singularVariableName\": \"lastStrategy\",\n \"pluralVariableName\": \"lastStrategy\",\n \"nodePath\": \"tradingEngine.last.strategy\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a2e7b5d2-8556-4c58-b2f6-a9c27c939e94","savedPayload":{"position":{"x":21867.4776821387,"y":16855.834263677196},"targetPosition":{"x":21567.31702416418,"y":17582.35418486395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"76ff2401-1d4f-4dda-87f6-5e0b7af3eab2","savedPayload":{"position":{"x":22122.675840986925,"y":17026.37139698594},"targetPosition":{"x":21567.31702416418,"y":17582.35418486395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"02e1c6bb-e984-4104-98c8-dbcba98ab660","savedPayload":{"position":{"x":22131.018446748407,"y":16512.819275764403},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"0fbc8383-f53b-42c2-ac1a-060f6bc80c5c","savedPayload":{"position":{"x":22275.42031136242,"y":16496.298462319024},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"5785bb06-20d0-4683-b5d3-3cce32ddf13f","savedPayload":{"position":{"x":22419.855360761772,"y":16506.34089756342},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"cca74655-a684-4b14-a70b-63a95f520418","savedPayload":{"position":{"x":22560.236991680402,"y":16542.80404317063},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategy Name","config":"{ \n\"codeName\": \"strategyName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"10192034-747b-49ed-ba2b-a645da326297","savedPayload":{"position":{"x":22691.51449970536,"y":16604.440138233305},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"5cc8df5d-637c-4059-88ca-b30193db45cd","savedPayload":{"position":{"x":22809.2274868391,"y":16689.13813848435},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger Stage Status","config":"{ \n\"codeName\": \"triggerStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a198b378-5db3-48ac-87c6-001cf2436cba","savedPayload":{"position":{"x":22909.36666025064,"y":16794.028728661713},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Status","config":"{ \n\"codeName\": \"openStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5d86e42b-515c-49de-b551-f9c417224459","savedPayload":{"position":{"x":22988.530870393646,"y":16915.522479629064},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Manage Stage Status","config":"{ \n\"codeName\": \"manageStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"88646d32-0ccf-47c8-bdc6-b65810acba2d","savedPayload":{"position":{"x":23044.019944843367,"y":17049.496055436164},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Status","config":"{ \n\"codeName\": \"closeStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"85fc50a0-7173-456a-95cc-44402fea6af5","savedPayload":{"position":{"x":23073.95189318231,"y":17191.38587163465},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e44d0b8d-1bd1-457b-b3ec-efafe83135e2","savedPayload":{"position":{"x":23077.298799171538,"y":17336.045949588268},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"c1181965-30d7-455c-84f8-b59a10b17292","savedPayload":{"position":{"x":23053.94900543769,"y":17479.16462496729},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f233bd2e-9c8a-415c-b348-890e2b8c835b","savedPayload":{"position":{"x":23004.695555540704,"y":17615.55604320322},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"09b0f818-5159-433b-8eae-f0209351e6b3","savedPayload":{"position":{"x":22931.200403049163,"y":17740.584485085954},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"8cfbc9c3-071f-43d0-b245-4c0278f975c0","savedPayload":{"position":{"x":22835.943566779,"y":17850.00495711049},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.strategy.strategyCounters\"\n}","id":"bb8b605d-bf3a-4408-a147-f316bdee7df7","savedPayload":{"position":{"x":22721.90398106936,"y":17940.202288937093},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"325b09da-1fc2-43bc-a59d-381c30a4ba1d","savedPayload":{"position":{"x":22293.497230896344,"y":17281.8755565129},"targetPosition":{"x":21567.31702416418,"y":17582.35418486395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"0625f524-2b97-4b4d-8a90-590ffc62ecd3","savedPayload":{"position":{"x":21567.538132906047,"y":17582.256393659754},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Last Strategy","id":"028aaa23-630c-4aa6-a168-6b2a128b1a83"}}},{"type":"Product Definition","name":"Current Position","config":"{\n \"codeName\": \"Current-Position\",\n \"singularVariableName\": \"currentPosition\",\n \"pluralVariableName\": \"currentPosition\",\n \"nodePath\": \"tradingEngine.current.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"7506dd91-ad9d-4aad-bb1a-604bc5d3fe8d","savedPayload":{"position":{"x":22040.267503266125,"y":17002.814360997},"targetPosition":{"x":21670.602547949547,"y":17696.530705321857},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"06678152-1082-4f00-9275-22ffde715469","savedPayload":{"position":{"x":22277.441667426247,"y":17197.255324471014},"targetPosition":{"x":21670.602547949547,"y":17696.530705321857},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"6e9bd403-9341-4573-9509-39592db0f4ae","savedPayload":{"position":{"x":22264.00287143656,"y":16698.227042658516},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"e9f969f0-20f4-4d61-870b-2997e715c706","savedPayload":{"position":{"x":22350.53675586669,"y":16684.565445940425},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"c9761b5c-3714-4253-9906-873e8933e698","savedPayload":{"position":{"x":22435.541864945135,"y":16680.990811373227},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"e0d6465b-de24-4ce2-9cc3-b7e3e563d4d7","savedPayload":{"position":{"x":22519.157299830764,"y":16686.691591865183},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f03c45fb-c2ca-4294-abce-650cf8656471","savedPayload":{"position":{"x":22601.069081831778,"y":16701.144630627994},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f1b6b7c1-d1ec-4ce6-a814-5e3fc4998262","savedPayload":{"position":{"x":22680.692553686295,"y":16724.080365552494},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Orders Size","config":"{ \n\"codeName\": \"openStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"b36dae4c-477c-4295-9e8c-d7ac06a669cd","savedPayload":{"position":{"x":22757.31351310633,"y":16755.20665611268},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Filled Size","config":"{ \n\"codeName\": \"openStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"40975420-ba2c-48cc-856d-a1c6e32dc29a","savedPayload":{"position":{"x":22830.192312508494,"y":16794.13586518061},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Orders Size","config":"{ \n\"codeName\": \"closeStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f88f3faa-dbf2-4a57-8217-e7fde7fc6a97","savedPayload":{"position":{"x":22898.54920212873,"y":16840.476304570162},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Filled Size","config":"{ \n\"codeName\": \"closeStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"3f0ded9a-ec78-487f-bfd4-588d1b244a84","savedPayload":{"position":{"x":22961.68726499863,"y":16893.681062165982},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"1b892131-86ea-4264-bfae-3eae52374803","savedPayload":{"position":{"x":23018.88423693278,"y":16953.21073490057},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f7d48869-1ac5-4e6c-9f73-52112cf5a9c8","savedPayload":{"position":{"x":23069.554903634817,"y":17018.38048050087},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"08064bc3-d662-46d7-a9ac-da517de9f0f3","savedPayload":{"position":{"x":23113.13258840505,"y":17088.48965164737},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"07748c3d-c020-4734-b505-38ceeb96ddc2","savedPayload":{"position":{"x":23149.132275754735,"y":17162.77339703203},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5f987e27-560f-485d-b832-46025f14f446","savedPayload":{"position":{"x":23177.174533544505,"y":17240.41150705034},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionCounters\"\n}","id":"c00c9780-7a99-40fe-8563-9ef38089edae","savedPayload":{"position":{"x":23196.928062974806,"y":17320.55886701572},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"3c081ea4-6bcb-4ba2-8e3e-2f572b428003","savedPayload":{"position":{"x":23208.21806452902,"y":17402.330398968243},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"d6e98d71-15ee-4e22-b18c-b154b1ecec52","savedPayload":{"position":{"x":23210.836714495308,"y":17484.83164447438},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{ \n\"codeName\": \"ROI\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"9705d87a-bc3a-473e-b205-4eefcbbeeb21","savedPayload":{"position":{"x":23204.803334802335,"y":17567.145185851008},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hit Fail","config":"{ \n\"codeName\": \"hitFail\",\n\"isString\": true,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\"\n}","id":"14d4fbc8-7b1b-4b27-a9ed-c4c5601116d8","savedPayload":{"position":{"x":23190.191425112025,"y":17648.37105550223},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"90759217-f2a3-4203-8249-35c703108863","savedPayload":{"position":{"x":23167.178613184242,"y":17727.626035250327},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"905584a9-29a2-4e59-be9d-7859ada74e43","savedPayload":{"position":{"x":23136.006951452102,"y":17804.040686784396},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"a85c3f00-4b38-430d-a911-b404de9c2ce3","savedPayload":{"position":{"x":23097.01434061574,"y":17876.775698122663},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss","config":"{\n \"codeName\": \"stopLoss\",\n \"isString\": false\n}","id":"9aadbadf-d791-4407-bb2e-39f1160ec4a3","savedPayload":{"position":{"x":23050.632390725743,"y":17945.036401330417},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Stage","config":"{\n \"codeName\": \"stopLossStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"6e0a86e9-90b1-486f-9dbb-275c5fcdd446","savedPayload":{"position":{"x":22997.363202709093,"y":18008.069129352865},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"stopLossPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"b6736f8c-0a25-4f37-b8a6-e89d9e1da23f","savedPayload":{"position":{"x":22937.806802527546,"y":18065.200332239692},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit","config":"{\n \"codeName\": \"takeProfit\",\n \"isString\": false\n}","id":"17af9724-48c7-46f7-8338-bfe189768f8b","savedPayload":{"position":{"x":22872.591268587777,"y":18115.77400802617},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit Stage","config":"{\n \"codeName\": \"takeProfitStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"f1e44667-8b58-417e-a6b7-41935bb37f7f","savedPayload":{"position":{"x":22802.460989112737,"y":18159.281079468325},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"takeProfitPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"be62b154-fcd4-4e9f-8dc7-dc8b6f0861d4","savedPayload":{"position":{"x":22707.855058088495,"y":18202.03061433486},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a35249e0-a2dc-43b0-bb8c-ebd6265e13c2","savedPayload":{"position":{"x":22422.618672990677,"y":17468.86288222258},"targetPosition":{"x":21670.602547949547,"y":17696.530705321857},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"832ecada-8da3-4ba6-b6e9-be34dd5f7ce9","savedPayload":{"position":{"x":21670.99923332494,"y":17696.408467747027},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Position","id":"0d2212c7-07bb-4c41-94fb-00844415ba5e"}}},{"type":"Product Definition","name":"Last Position","config":"{\n \"codeName\": \"Last-Position\",\n \"singularVariableName\": \"lastPosition\",\n \"pluralVariableName\": \"lastPosition\",\n \"nodePath\": \"tradingEngine.last.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"485671ff-0d50-4c08-958c-93e657cd238f","savedPayload":{"position":{"x":22198.44539170496,"y":17166.12494176518},"targetPosition":{"x":21762.36312002314,"y":17820.236149127704},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a909df42-6192-4bbd-9f38-e8800149aaa1","savedPayload":{"position":{"x":22415.46455227597,"y":17382.93020381221},"targetPosition":{"x":21762.36312002314,"y":17820.236149127704},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"a616f774-00d3-475e-b0b6-631a93777573","savedPayload":{"position":{"x":22450.987417558463,"y":16884.706094065226},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"2e577616-21a7-4199-a64f-d90386edc6ec","savedPayload":{"position":{"x":22538.447889526153,"y":16879.515924606156},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9993ddd9-d4f8-4eef-91db-45eb57c04d8e","savedPayload":{"position":{"x":22623.38571326345,"y":16884.34684049592},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"dd7f3f5d-3f52-4256-b7e1-c2d94aa85795","savedPayload":{"position":{"x":22706.042192006684,"y":16898.197541887013},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"04c30c87-9bca-4e8e-b1a1-ef3f43e285a0","savedPayload":{"position":{"x":22786.14128188494,"y":16920.613973110052},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"373f6f5b-ce4b-403f-b92e-11dc556a3591","savedPayload":{"position":{"x":22863.13370672779,"y":16951.242578832134},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Orders Size","config":"{ \n\"codeName\": \"openStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"277c30dd-86c6-42a3-a300-c12638f76b0b","savedPayload":{"position":{"x":22936.342950587474,"y":16989.716448932453},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Filled Size","config":"{ \n\"codeName\": \"openStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"75f08f49-cf5e-469e-8062-e2920fa82997","savedPayload":{"position":{"x":23005.051385759452,"y":17035.607122606812},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Orders Size","config":"{ \n\"codeName\": \"closeStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"42fbea49-8604-4a55-aa95-a86a722ddfb3","savedPayload":{"position":{"x":23068.548165541175,"y":17088.412943140225},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Filled Size","config":"{ \n\"codeName\": \"closeStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"e685a10b-4cad-4a04-bbf1-74e6ecce1e74","savedPayload":{"position":{"x":23126.15826163939,"y":17147.55787308223},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e7f50ea4-ebd4-448f-bd18-54fc2d7e2e7b","savedPayload":{"position":{"x":23177.26049308717,"y":17212.396036161826},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"d9ff5483-8800-49f7-8d9f-9e8e48f8b795","savedPayload":{"position":{"x":23221.299765760832,"y":17282.21841165996},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f0e01315-185f-4092-9b13-0f529a794336","savedPayload":{"position":{"x":23257.79584438494,"y":17356.260727606168},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a41e9fac-16b2-4b08-b9e8-b494359f1737","savedPayload":{"position":{"x":23286.349948351806,"y":17433.712036166533},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e6137e7e-940e-44b9-937f-4c6a89709af4","savedPayload":{"position":{"x":23306.649773751484,"y":17513.723772864243},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionCounters\"\n}","id":"3976c01c-c92d-47b1-965d-4e4d7678a59a","savedPayload":{"position":{"x":23318.473226998165,"y":17595.419180111865},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n \"decimals\": 2\n}","id":"81ca02e5-e287-407f-9101-891748e4eacc","savedPayload":{"position":{"x":23321.659639453374,"y":17677.901418441914},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n\"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n \"decimals\": 2\n}","id":"14559572-40c1-4cc7-b20b-5b7189bc1ece","savedPayload":{"position":{"x":23316.17720814917,"y":17760.25390016213},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{ \n\"codeName\": \"ROI\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n \"decimals\": 2\n}","id":"70ab7683-aa08-49d6-86cd-17a527f9ae77","savedPayload":{"position":{"x":23302.129042923443,"y":17841.58107224677},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hit Fail","config":"{ \n\"codeName\": \"hitFail\",\n\"isString\": true,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\"\n}","id":"d1f5644b-c52d-4bbe-a8ec-e6d1d09d50a8","savedPayload":{"position":{"x":23279.653663477,"y":17920.991654110367},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"5a796662-dd46-4e75-8d5b-192ec323901e","savedPayload":{"position":{"x":23249.002591671837,"y":17997.618120417326},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"373f4395-e367-4089-ad1c-6bcefb4a1d40","savedPayload":{"position":{"x":23210.50910561027,"y":18070.620417624956},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"337bc66f-9deb-4e01-b4a8-24cac360726f","savedPayload":{"position":{"x":23164.595167170508,"y":18139.19887885872},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss","config":"{\n \"codeName\": \"stopLoss\",\n \"isString\": false\n}","id":"4c576425-680e-46ae-8a5d-a8548e256ec1","savedPayload":{"position":{"x":23111.7630239789,"y":18202.601313738134},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Stage","config":"{\n \"codeName\": \"stopLossStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.last.position.stopLoss\"\n}","id":"13e0df5d-450c-425a-9fde-2e1248012548","savedPayload":{"position":{"x":23052.59261997463,"y":18260.13384577472},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"stopLossPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.last.position.stopLoss\"\n}","id":"7865ef71-3d83-4b6c-9275-fd3199183464","savedPayload":{"position":{"x":22987.730677126005,"y":18311.163722651745},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit","config":"{\n \"codeName\": \"takeProfit\",\n \"isString\": false\n}","id":"32bd62c3-8eab-40cd-9830-32952105a924","savedPayload":{"position":{"x":22917.89080330577,"y":18355.135914722083},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit Stage","config":"{\n \"codeName\": \"takeProfitStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.last.position.takeProfit\"\n}","id":"c7455fce-ac8e-4182-ba13-22df021007a8","savedPayload":{"position":{"x":22843.839469765124,"y":18391.573509062793},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"takeProfitPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.last.position.takeProfit\"\n}","id":"fadb0e4d-25bf-4359-9e9f-3aa83fdcf214","savedPayload":{"position":{"x":22745.68112312015,"y":18424.813202431247},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"731e7326-c591-4d9f-a9d7-1c7abd42156f","savedPayload":{"position":{"x":22533.321412498663,"y":17667.190613368002},"targetPosition":{"x":21762.36312002314,"y":17820.236149127704},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"477cd6d5-862a-44d0-9313-786a4e63a602","savedPayload":{"position":{"x":21762.77354255197,"y":17820.152188985132},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Last Position","id":"08c88b9c-70f1-49ff-aa16-21f2bc1c0ba1"}}},{"type":"Product Definition","name":"Previous Balance","config":"{\n \"codeName\": \"Previous-Balance\",\n \"singularVariableName\": \"previousBalance\",\n \"pluralVariableName\": \"previousBalance\",\n \"nodePath\": \"tradingEngine.previous.balance\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"7e78025f-e284-4ca1-9351-bc5699491e4f","savedPayload":{"position":{"x":22340.304463090375,"y":17344.46283175102},"targetPosition":{"x":21841.886678547377,"y":17952.305064362765},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2aa4b10e-4d73-4391-b820-950038505045","savedPayload":{"position":{"x":22535.03121699445,"y":17581.645545044925},"targetPosition":{"x":21841.886678547377,"y":17952.305064362765},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"86aaed8a-b830-4417-ba6d-9cf9b98b31f3","savedPayload":{"position":{"x":23021.25160659101,"y":17197.956055942628},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"ce8d7ef3-9ca2-4565-a132-09fc49fa27ae","savedPayload":{"position":{"x":23343.656415203408,"y":17560.844964123906},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Base Asset","config":"{\n \"codeName\": \"baseAsset\",\n \"isString\": false\n}","id":"f4ea9bc8-f9fc-4998-b345-5f13972197b2","savedPayload":{"position":{"x":23391.222253608008,"y":18043.59828551502},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Quoted Asset","config":"{\n \"codeName\": \"quotedAsset\",\n \"isString\": false\n}","id":"512ffd5f-2760-402f-a584-04760a1b0dea","savedPayload":{"position":{"x":23145.795143225798,"y":18462.351864894812},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"108ee474-20f5-498f-aa5f-a0e56d3567f7","savedPayload":{"position":{"x":22624.145783160133,"y":17875.51417278459},"targetPosition":{"x":21841.886678547377,"y":17952.305064362765},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"cb56a148-6bbb-4dac-9506-7b6503c98a53","savedPayload":{"position":{"x":21841.977019574413,"y":17952.295749970446},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Previous Balance","id":"77dc9564-5ed0-4ce9-9e45-d23e396d336f"}}},{"type":"Product Definition","name":"Market Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders\", \n \"singularVariableName\": \"marketBuyOrder\", \n \"pluralVariableName\": \"marketBuyOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a2ea8001-2143-4055-b1d3-525d95fa8e6f","savedPayload":{"position":{"x":22462.80800775292,"y":17535.169925266324},"targetPosition":{"x":21907.53994973232,"y":18091.564238111518},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"557357c6-f814-4bf9-9426-82fc5e22c028","savedPayload":{"position":{"x":22633.388054813215,"y":17790.237904366404},"targetPosition":{"x":21907.53994973232,"y":18091.564238111518},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"1f788bde-d5cc-4556-9cb3-f6ad2a085870","savedPayload":{"position":{"x":22799.47647572358,"y":17312.73887210429},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"cbe57e07-e492-45ef-be26-6e5ace5cc49d","savedPayload":{"position":{"x":22905.22526229177,"y":17334.676886950307},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"0eef5d2a-489b-402b-a1bc-bbf6105bc226","savedPayload":{"position":{"x":23006.49198616727,"y":17370.63054965501},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"76a37b2a-ff68-425c-95ae-9da13d4f11e3","savedPayload":{"position":{"x":23101.809751457753,"y":17420.00769801173},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"81aa9c0a-b729-471f-8b3f-046d83779376","savedPayload":{"position":{"x":23189.482908956983,"y":17481.891456090812},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"48215010-5717-4f29-aa92-edc16d881270","savedPayload":{"position":{"x":23267.90246467202,"y":17555.12819032762},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7cb827e9-8294-4990-826c-8f2421ce4542","savedPayload":{"position":{"x":23335.610855495954,"y":17638.35588131103},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"588b02df-d269-4fac-a942-0e148bef8573","savedPayload":{"position":{"x":23391.354797449458,"y":17730.023954783985},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f44959e8-ba4e-41f2-a349-7003d00ef570","savedPayload":{"position":{"x":23434.09528252291,"y":17828.426820134595},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"43c9c172-0930-4a94-86c4-6de1b82604d3","savedPayload":{"position":{"x":23463.03784982736,"y":17931.73316793798},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e637160d-ab4a-4d36-8324-994615efa900","savedPayload":{"position":{"x":23477.642618663784,"y":18038.016852507826},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b9cf9af0-758e-46c8-ad34-0afb01aa1658","savedPayload":{"position":{"x":23477.64168098251,"y":18144.999340696828},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderCounters\"\n}","id":"69f674b7-9532-406e-bda9-6a128a9b3e8b","savedPayload":{"position":{"x":23463.031738176407,"y":18251.277767404135},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"2180ac7e-b09a-404f-86cd-3e0d0eb0635f","savedPayload":{"position":{"x":23434.085396370516,"y":18354.580741904163},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"5f50a6c7-0123-4f45-802c-897b7f1d9186","savedPayload":{"position":{"x":23391.344502566884,"y":18452.978966733197},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"81cb024b-b64e-4f2c-be9d-c343fc27b08e","savedPayload":{"position":{"x":23335.600303524305,"y":18544.641375883577},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"06982b1c-a048-4789-96d0-ffee927cc551","savedPayload":{"position":{"x":23267.890499836423,"y":18627.85682886832},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"ff92e722-7f93-4935-ab39-5fe5d901d275","savedPayload":{"position":{"x":23189.475337022137,"y":18701.07929324306},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"7ed49f47-7cf0-4c04-8ec7-c42b77bbc496","savedPayload":{"position":{"x":23101.80417807712,"y":18762.938970792507},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"9033bc32-f754-4d94-87a6-4c16cd8ca7d7","savedPayload":{"position":{"x":23006.49156482047,"y":18812.28919844504},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"1524688a-c64c-434c-84ea-79e57f7e37bc","savedPayload":{"position":{"x":22905.24103964037,"y":18848.207434998145},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"200c3a3d-f082-4cb0-86b1-ba12429f6c0e","savedPayload":{"position":{"x":22799.442266553437,"y":18870.029891515514},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"2b743c15-4ca6-46e9-a96e-b0a62b42de60","savedPayload":{"position":{"x":22693.562860069218,"y":18091.554559431253},"targetPosition":{"x":21907.53994973232,"y":18091.564238111518},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"7c769317-2639-4460-8b88-9dc92f7b0585","savedPayload":{"position":{"x":21907.846797859784,"y":18091.56648669903},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Buy Orders","id":"50d624c9-9a6e-4d57-a147-29d5c004b3f2"}}},{"type":"Product Definition","name":"Market Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders\", \n \"singularVariableName\": \"marketSellOrder\", \n \"pluralVariableName\": \"marketSellOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"917cfdae-b736-4ed5-ad8e-d572c49ea489","savedPayload":{"position":{"x":22566.581952106775,"y":17737.306724454334},"targetPosition":{"x":21959.44271421669,"y":18236.577539934493},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"3c878a50-6d76-412b-95d7-f2e546960293","savedPayload":{"position":{"x":22711.28331336196,"y":18007.847492481527},"targetPosition":{"x":21959.44271421669,"y":18236.577539934493},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"7dd0d738-2116-4010-a9d5-19624a9bc097","savedPayload":{"position":{"x":22923.245352512386,"y":17548.923203313905},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"5843c701-ba88-42c1-97c2-215cb97b309c","savedPayload":{"position":{"x":23026.29632556757,"y":17581.219254606214},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"f3f77a4c-acf5-4026-aa2a-9b34e231a9d5","savedPayload":{"position":{"x":23123.55107201442,"y":17626.92753130917},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"cc0b04e1-acd8-413b-8366-e620d55a22be","savedPayload":{"position":{"x":23213.565188535522,"y":17685.409476904955},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"89bb217d-a5ce-4197-b33b-4b251e3ec5c9","savedPayload":{"position":{"x":23294.753046993104,"y":17755.583400181436},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"3a6b6603-5de8-47a1-b2cb-e2078397aca1","savedPayload":{"position":{"x":23365.610285734427,"y":17836.15472326569},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"3510116c-09e6-4758-baa9-09f976105f32","savedPayload":{"position":{"x":23424.838010502277,"y":17925.618648225878},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a0d62501-1822-4d56-afce-b5eee40212f7","savedPayload":{"position":{"x":23471.328061934655,"y":18022.31088876791},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"9f72bb4a-779d-453f-a7b2-bf240eec29fa","savedPayload":{"position":{"x":23504.215886528786,"y":18124.428207608955},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"7b91a979-7175-49aa-a83b-faa1d7c22bf3","savedPayload":{"position":{"x":23522.891249590768,"y":18230.07815914197},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b47e5776-92ed-468e-8040-16a655a9a92b","savedPayload":{"position":{"x":23527.01230396765,"y":18336.973170339454},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"178e1183-6b29-4a8b-b2a2-3e817bf56c0b","savedPayload":{"position":{"x":23516.497054808937,"y":18443.73812602662},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderCounters\"\n}","id":"16eb66bd-cbd5-4272-83bd-7aa5cbf79965","savedPayload":{"position":{"x":23491.541401097522,"y":18548.075451817665},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"3b37c095-0ab7-4102-a757-eccda2f06aa5","savedPayload":{"position":{"x":23452.61464369424,"y":18648.04193565059},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"4694fc1a-8031-4b21-8002-fb2259b98221","savedPayload":{"position":{"x":23400.43475411289,"y":18741.775175882052},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"a7a086da-8ba6-4283-9f8c-7ca3894a3844","savedPayload":{"position":{"x":23335.977902121842,"y":18827.526775218375},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"972a2ef4-0e93-46d1-b202-4f957bf83968","savedPayload":{"position":{"x":23260.440409154267,"y":18903.705296685643},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"3fdfa893-f3ff-4595-bfd1-e9e191a2f7de","savedPayload":{"position":{"x":23175.22815032847,"y":18968.888648200053},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"fd90ed73-a52a-41b0-988e-f85896e4e119","savedPayload":{"position":{"x":23081.914733809404,"y":19021.852714600107},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"2320eff7-cd11-46a6-8f2b-7c6c6bd9afa2","savedPayload":{"position":{"x":22982.222601105932,"y":19061.615996566008},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"cbcd69c4-f332-4615-a1aa-ff5a63c2f63a","savedPayload":{"position":{"x":22877.939913332775,"y":19087.43518209016},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"67d569c5-929d-4f9a-a7a2-1a31aecab027","savedPayload":{"position":{"x":22770.502027796636,"y":19098.779703596854},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"e2626cbd-29b0-4582-a408-4720feb8123d","savedPayload":{"position":{"x":22741.442294351935,"y":18313.724105942925},"targetPosition":{"x":21959.44271421669,"y":18236.577539934493},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"9cc7645a-54fe-40d6-9896-9278167011fb","savedPayload":{"position":{"x":21959.7484745496,"y":18236.62311547056},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Sell Orders","id":"4f84a1a5-f9cd-4b9d-9d91-661ba912e2ca"}}},{"type":"Product Definition","name":"Limit Buy Orders","config":"{ \n \"codeName\": \"Limit-Buy-Orders\", \n \"singularVariableName\": \"limitBuyOrder\", \n \"pluralVariableName\": \"limitBuyOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"df8cfaa4-a4d4-4bc1-9fa2-4f8e91e45a87","savedPayload":{"position":{"x":22650.054189434988,"y":17948.722491105946},"targetPosition":{"x":21996.860148376323,"y":18385.98181437228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"12652573-9506-4d3e-82bb-64b1bb9e7ce0","savedPayload":{"position":{"x":22767.470418539764,"y":18231.969074016008},"targetPosition":{"x":21996.860148376323,"y":18385.98181437228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"b0dc1303-0b65-4328-b885-f33d4ef395a6","savedPayload":{"position":{"x":23023.496047806082,"y":17795.91238627135},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"451e4e45-854c-4b9f-ac75-ddfe076fb6d8","savedPayload":{"position":{"x":23122.82540523234,"y":17838.215244683477},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"fa7958e6-31e1-4216-b3bf-f341cae3ad92","savedPayload":{"position":{"x":23215.126454720954,"y":17893.233300603595},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"f3230b63-049f-457a-abc1-9117d8443337","savedPayload":{"position":{"x":23298.978704656907,"y":17960.25915764779},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"544aae22-e5cf-41d2-912e-f19699a7f65a","savedPayload":{"position":{"x":23372.894255021165,"y":18038.06505267607},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7cccabcc-97ae-4e46-86b4-70c8b6ab73c5","savedPayload":{"position":{"x":23435.515702358614,"y":18125.183804926186},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"753014da-bd0e-460e-8262-2c5c00053610","savedPayload":{"position":{"x":23485.691646529438,"y":18220.020258800123},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"3f94ee88-bb65-4f46-9cef-c3468b2e5831","savedPayload":{"position":{"x":23522.481955597214,"y":18320.807223417887},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"fbe17bbd-1af9-4b97-be44-f267039077e5","savedPayload":{"position":{"x":23545.196500605376,"y":18425.66117414831},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"593c0354-1f6a-4ec1-879b-13f95de9d66d","savedPayload":{"position":{"x":23553.433107345176,"y":18532.632320044537},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"7a473c6b-849a-46f7-befa-661675c6b6a7","savedPayload":{"position":{"x":23547.030350325258,"y":18639.420416024037},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"7e05bfad-d3ba-4170-bb97-b02911c65b81","savedPayload":{"position":{"x":23526.10449852552,"y":18744.628365977278},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderCounters\"\n}","id":"e86cdc19-1330-4dbd-b0d9-6300bb84b504","savedPayload":{"position":{"x":23491.04569457313,"y":18846.016485333068},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"0975187c-acd1-4c90-9c2e-ad2f10453d0c","savedPayload":{"position":{"x":23442.50114518308,"y":18941.690008771504},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"dc8ff39f-2ebf-4097-a324-69714556e67e","savedPayload":{"position":{"x":23381.385199761615,"y":19029.843319454943},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"f39e7cb9-55cd-434a-9ef1-aaa1aec8fcfa","savedPayload":{"position":{"x":23308.847969564697,"y":19108.86552360332},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"dde11b27-9158-4627-a924-44c51f7d16fd","savedPayload":{"position":{"x":23226.20627620361,"y":19177.28041742948},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"e9f153ec-763f-45ce-ab8e-9095762a8b5c","savedPayload":{"position":{"x":23135.017864773752,"y":19233.775985191915},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"45ca3d8c-ba98-4ff9-8825-d515ad54d235","savedPayload":{"position":{"x":23036.963542445304,"y":19277.340584936377},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"7becceb8-d380-4e4e-b5ce-70b63b32445f","savedPayload":{"position":{"x":22933.859945933888,"y":19307.14226387487},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"4deb6a9d-3914-4a70-b2f5-992a09504eec","savedPayload":{"position":{"x":22827.537448977786,"y":19322.60942306547},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"3213e0e6-5b5f-4e9a-b67e-33f596bad152","savedPayload":{"position":{"x":22719.81100894819,"y":19323.353885069864},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d3c594aa-6573-44f7-b93e-2bd2b0d4134e","savedPayload":{"position":{"x":22767.56633846995,"y":18539.269846787156},"targetPosition":{"x":21996.860148376323,"y":18385.98181437228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"4c827ee0-a29b-4b65-8438-03e2ea98b410","savedPayload":{"position":{"x":21997.182192732776,"y":18386.06863908954},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Buy Orders","id":"17ec46bd-e5c0-48d5-a3b6-e108cc835f17"}}},{"type":"Product Definition","name":"Limit Sell Orders","config":"{ \n \"codeName\": \"Limit-Sell-Orders\", \n \"singularVariableName\": \"limitSellOrder\", \n \"pluralVariableName\": \"limitSellOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"f645108f-4648-497f-b361-0be5b84c233a","savedPayload":{"position":{"x":22712.352603609088,"y":18167.028790758803},"targetPosition":{"x":22019.4748685572,"y":18538.346600263896},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"e98191d1-5b13-42eb-bd52-31e3c6830188","savedPayload":{"position":{"x":22801.615982509895,"y":18460.649743455666},"targetPosition":{"x":22019.4748685572,"y":18538.346600263896},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"5d3f01ca-9d2b-4446-906c-0f9dfcf8016f","savedPayload":{"position":{"x":23098.970763590212,"y":18052.153803092413},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"ef7f6f85-9aac-4eb1-935e-84c03beb5ae0","savedPayload":{"position":{"x":23193.84559016366,"y":18103.789327016635},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"68c5cf4d-ee84-4d53-be73-923d6ec0c070","savedPayload":{"position":{"x":23280.31007292391,"y":18167.593216238878},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"f551a912-c93a-49a5-8ec6-b23845504195","savedPayload":{"position":{"x":23357.191195411207,"y":18242.515607309706},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"5ca3123d-351b-4b1b-9bdd-2be83cb30d4b","savedPayload":{"position":{"x":23423.12655462289,"y":18327.186317197724},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a4d2dcb3-66b5-4689-9ff5-6e79ca264c3a","savedPayload":{"position":{"x":23476.907917968783,"y":18420.034537858555},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"8af29013-dc77-42f5-a65a-703ef24782ac","savedPayload":{"position":{"x":23517.5416517523,"y":18519.335519701483},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"74cfaaa3-4241-4585-bb78-afe6ab4fad13","savedPayload":{"position":{"x":23544.276746116328,"y":18623.24149504987},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e79e457e-0f39-4444-b196-e2ab8e9d51b3","savedPayload":{"position":{"x":23556.614940063922,"y":18729.817362548023},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"26467972-56e9-445c-84cc-043cf332e7cf","savedPayload":{"position":{"x":23554.32654811575,"y":18836.780251784072},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"259e069d-8c48-4b18-b3be-876eb376edfd","savedPayload":{"position":{"x":23537.45671581392,"y":18942.724470563724},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"ab79d27c-63b2-4b9c-986c-69551d4acda6","savedPayload":{"position":{"x":23506.319525391547,"y":19045.385974436507},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderCounters\"\n}","id":"df8ad782-de40-443e-9c25-0c9fd06c0ddd","savedPayload":{"position":{"x":23461.49272867842,"y":19142.847857159777},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"4a1dc949-315f-4cff-8ae5-111195dd8565","savedPayload":{"position":{"x":23403.814296425753,"y":19233.29650155639},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"2adf7743-fa8c-484c-b2b2-16c144f2aa8c","savedPayload":{"position":{"x":23334.35570752959,"y":19315.045598311764},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"1243e887-177d-42fc-990c-1a0eec7868ca","savedPayload":{"position":{"x":23254.411583725694,"y":19386.5724233219},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"5e199034-7c71-4265-afda-940024e14870","savedPayload":{"position":{"x":23165.467186452926,"y":19446.541688606154},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"fd5472c9-a36f-4281-891d-57380ca2ef6c","savedPayload":{"position":{"x":23069.179344935492,"y":19493.8357977934},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"87559a66-ff26-4cfb-b9db-baa312369ee1","savedPayload":{"position":{"x":22967.33160184239,"y":19527.570464620814},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"84f5a086-9b8d-4296-bba1-bccfc56fb263","savedPayload":{"position":{"x":22861.8025672143,"y":19547.111569052366},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"8bf3e674-bbc9-4ff6-bcba-c9487d5215a3","savedPayload":{"position":{"x":22754.788268110948,"y":19552.0736208747},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"1d59f7dc-e3c9-4456-8980-3fded2a58f1a","savedPayload":{"position":{"x":22647.221861109687,"y":19542.231164282763},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"38241371-e97c-4eb5-989e-26605c078620","savedPayload":{"position":{"x":22771.568002234162,"y":18766.63044010965},"targetPosition":{"x":22019.4748685572,"y":18538.346600263896},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"2c753cd8-36d8-466c-bd80-1ebfa8e314dc","savedPayload":{"position":{"x":22019.78743974257,"y":18538.463794307896},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Sell Orders","id":"1ec8da3f-8749-430d-8ad9-35fffc0d61ec"}}},{"type":"Product Definition","name":"Previous Candle","config":"{\n \"codeName\": \"Previous-Candle\",\n \"singularVariableName\": \"previousCandle\",\n \"pluralVariableName\": \"previousCandles\",\n \"nodePath\": \"tradingEngine.previous.candle\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"34de89b0-406c-4132-b308-053bc1d90a38","savedPayload":{"position":{"x":22753.31229330402,"y":18391.019869330314},"targetPosition":{"x":22027.2127016594,"y":18692.22991208055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"d1533eeb-1c10-4a6b-97ea-d619441946e4","savedPayload":{"position":{"x":22813.29513249138,"y":18692.04300334928},"targetPosition":{"x":22027.2127016594,"y":18692.22991208055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"0dd31575-41d7-46be-9ddc-b99faa63be51","savedPayload":{"position":{"x":23308.724663900804,"y":18437.599124956818},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"d5995df9-321a-4ebd-9904-cc138f604548","savedPayload":{"position":{"x":23479.005402623756,"y":18692.510774535225},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open","config":"{\n \"codeName\": \"open\",\n \"isString\": false\n}","id":"2d274b55-5419-4003-b562-366b5224887c","savedPayload":{"position":{"x":23538.783309465776,"y":18993.01633732719},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close","config":"{\n \"codeName\": \"close\",\n \"isString\": false\n}","id":"52ef21ec-9a2c-40d4-bf93-16efbc90eb09","savedPayload":{"position":{"x":23479.005310832086,"y":19293.41286975378},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Min","config":"{\n \"codeName\": \"min\",\n \"isString\": false\n}","id":"6ecac487-5839-4378-89c7-3b7fbf70562e","savedPayload":{"position":{"x":23308.7605564346,"y":19548.225969753777},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Max","config":"{\n \"codeName\": \"max\",\n \"isString\": false\n}","id":"185b37ee-53e7-4148-8104-77ee9cb28ee8","savedPayload":{"position":{"x":23053.981039507325,"y":19718.470570535563},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"8f971956-9ebc-45ac-b369-2eceb6bcc521","savedPayload":{"position":{"x":22753.406584775257,"y":19778.175132422497},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"09d22e28-1bbd-462d-a7d2-66c17869f442","savedPayload":{"position":{"x":22753.345787397826,"y":18993.015543666716},"targetPosition":{"x":22027.2127016594,"y":18692.22991208055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"6635f207-1048-48be-8bf2-8328ebafa782","savedPayload":{"position":{"x":22027.346517684706,"y":18692.2552950763},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Previous Candle","id":"076dcee2-2923-4455-8697-263649515a3b"}}},{"type":"Product Definition","name":"Trading System Highlights","config":"{\n \"codeName\": \"Trading-System-Highlights\",\n \"singularVariableName\": \"tradingSystemHighlight\",\n \"pluralVariableName\": \"tradingSystemHighlights\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"6e0f951c-25e7-4b92-85da-8be04d424bd0","savedPayload":{"position":{"x":22771.86727453686,"y":18617.4091447452},"targetPosition":{"x":22019.70988949565,"y":18845.902585453165},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"fa53ecfb-a558-4810-b6f8-1f9c6c8bfc5b","savedPayload":{"position":{"x":22802.05148403451,"y":18922.66307319812},"targetPosition":{"x":22019.70988949565,"y":18845.902585453165},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9fefb3c2-2293-4ffa-8db8-9430dd662bcf","savedPayload":{"position":{"x":23464.43074166981,"y":18988.496421096494},"targetPosition":{"x":22712.88773828317,"y":19216.3696160829},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"431d65d9-1f6d-4e73-8655-cbf36854d3cf","savedPayload":{"position":{"x":23405.51795958285,"y":19586.392433201883},"targetPosition":{"x":22712.88773828317,"y":19216.3696160829},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Highlights","config":"{\n \"codeName\": \"highlights\",\n \"isString\": false\n}","id":"6355df8f-6845-4652-8ebc-90468c526949","savedPayload":{"position":{"x":22941.022178773277,"y":19967.641548742118},"targetPosition":{"x":22712.88773828317,"y":19216.3696160829},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"af6916b9-83d1-478b-ac92-35ea4f9b8a46","savedPayload":{"position":{"x":22712.88773828317,"y":19216.3696160829},"targetPosition":{"x":22019.70988949565,"y":18845.902585453165},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"319f660a-78be-4cf4-8052-877837cad806","savedPayload":{"position":{"x":22019.786446662296,"y":18846.01973786281},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Highlights","id":"d979c9f0-530a-41d3-a357-b57a3e4f2201"}}},{"type":"Product Definition","name":"Trading System Values","config":"{\n \"codeName\": \"Trading-System-Values\",\n \"singularVariableName\": \"tradingSystemValue\",\n \"pluralVariableName\": \"tradingSystemValues\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"9c4ec2f8-f4a8-45b9-aba3-b093a7b8f86a","savedPayload":{"position":{"x":22768.06463317007,"y":18844.589969606553},"targetPosition":{"x":21997.112484726138,"y":18998.268703916943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"b3d3fe62-e714-4cb9-a78d-55bc0add1d7c","savedPayload":{"position":{"x":22768.17539619483,"y":19151.30848795424},"targetPosition":{"x":21997.112484726138,"y":18998.268703916943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"956e9238-3cd9-4258-9295-77d3ad473508","savedPayload":{"position":{"x":23420.926950168105,"y":19281.780097090053},"targetPosition":{"x":22650.634923447473,"y":19434.878581956862},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"dbb03ed7-1d1f-4105-b559-eac7b4d8d4d9","savedPayload":{"position":{"x":23303.68065752109,"y":19871.00407068703},"targetPosition":{"x":22650.634923447473,"y":19434.878581956862},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Values","config":"{\n \"codeName\": \"values\",\n \"isString\": false\n}","id":"2349e00c-f032-432b-8c9a-07c1606574e8","savedPayload":{"position":{"x":22804.20190944071,"y":20204.750536147407},"targetPosition":{"x":22650.634923447473,"y":19434.878581956862},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a65db5f6-3b75-435d-8155-2e2c7af39279","savedPayload":{"position":{"x":22650.634923447473,"y":19434.878581956862},"targetPosition":{"x":21997.112484726138,"y":18998.268703916943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"c90c009b-588d-45d4-aff1-05e375181dfa","savedPayload":{"position":{"x":21997.180265637075,"y":18998.414494403452},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Values","id":"476925ed-e2ac-443d-82f3-501b64ca6c87"}}},{"type":"Product Definition","name":"Trading System Errors","config":"{\n \"codeName\": \"Trading-System-Errors\",\n \"singularVariableName\": \"tradingSystemError\",\n \"pluralVariableName\": \"tradingSystemErrors\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2ef33675-fc52-49fd-a8ef-bc5da1711dd1","savedPayload":{"position":{"x":22742.019351719897,"y":19070.341083215888},"targetPosition":{"x":21959.697242746886,"y":19147.701162110185},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2d0dd4c2-4f4c-4d8c-b9a5-9ca62f186369","savedPayload":{"position":{"x":22712.04565897299,"y":19375.542136015443},"targetPosition":{"x":21959.697242746886,"y":19147.701162110185},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"49f8debb-5e74-467d-be5a-4d0cb9695709","savedPayload":{"position":{"x":23348.95587510403,"y":19569.318032413423},"targetPosition":{"x":22567.324048044513,"y":19646.1698717062},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"1129b6b6-a686-4f24-b37f-f2a503586a19","savedPayload":{"position":{"x":23174.535685194285,"y":20144.21112921656},"targetPosition":{"x":22567.324048044513,"y":19646.1698717062},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Errors","config":"{\n \"codeName\": \"errors\",\n \"isString\": false\n}","id":"e994737a-9a14-40f0-8ad0-a151c799a094","savedPayload":{"position":{"x":22643.14113485898,"y":20470.07456238336},"targetPosition":{"x":22567.324048044513,"y":19646.1698717062},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"cbcd5cb4-66b1-4535-9592-0164a480b7f7","savedPayload":{"position":{"x":22567.324048044513,"y":19646.1698717062},"targetPosition":{"x":21959.697242746886,"y":19147.701162110185},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"1d9c570d-77c7-40ac-a61e-c5a57a411de8","savedPayload":{"position":{"x":21959.745539897565,"y":19147.859996768973},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Errors","id":"64684730-d049-4d3c-8013-b48c5438417e"}}},{"type":"Product Definition","name":"Trading System Status","config":"{\n \"codeName\": \"Trading-System-Status\",\n \"singularVariableName\": \"tradingSystemState\",\n \"pluralVariableName\": \"tradingSystemStatus\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2b83dc93-dc14-44d9-8f8c-889f39a952da","savedPayload":{"position":{"x":22693.954637358514,"y":19292.334838193103},"targetPosition":{"x":21907.7827420404,"y":19292.71239934262},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0f8dcda3-1eab-439d-956c-c6eb9b1c481f","savedPayload":{"position":{"x":22634.224341119232,"y":19593.14017292083},"targetPosition":{"x":21907.7827420404,"y":19292.71239934262},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"214b03c2-5fc3-4157-bcfd-4796b0565d98","savedPayload":{"position":{"x":23249.158408571988,"y":19848.163806056742},"targetPosition":{"x":22463.70748656824,"y":19848.1674433746},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"78c4b87a-592d-49ca-9c8c-f5d0dae8d7ba","savedPayload":{"position":{"x":23019.305737200604,"y":20403.318702883975},"targetPosition":{"x":22463.70748656824,"y":19848.1674433746},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{\n \"codeName\": \"status\",\n \"isString\": false\n}","id":"fdb4b903-20ff-4a67-a03f-f02e67b5d81b","savedPayload":{"position":{"x":22463.71156513114,"y":20633.444395955914},"targetPosition":{"x":22463.70748656824,"y":19848.1674433746},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"04b0fd4c-df6f-40df-9567-60a735d126e6","savedPayload":{"position":{"x":22463.70748656824,"y":19848.1674433746},"targetPosition":{"x":21907.7827420404,"y":19292.71239934262},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"eed48c80-35c5-49fa-b12d-18e7280ffb8f","savedPayload":{"position":{"x":21907.842745681683,"y":19292.91666836401},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Status","id":"0437448d-8740-496b-8fce-d3804be81a2b"}}},{"type":"Product Definition","name":"Trading System Progress","config":"{\n \"codeName\": \"Trading-System-Progress\",\n \"singularVariableName\": \"tradingSystemProgress\",\n \"pluralVariableName\": \"tradingSystemProgresses\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"77735fc0-9ce6-4dec-a3ad-8075a22eda40","savedPayload":{"position":{"x":22624.402935459013,"y":19508.249831127316},"targetPosition":{"x":21841.919940047454,"y":19431.977077639505},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2fde11bd-4515-4a4e-9dc0-f6869dd3a04e","savedPayload":{"position":{"x":22535.56001837024,"y":19801.906231063138},"targetPosition":{"x":21841.919940047454,"y":19431.977077639505},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"076e6f4d-1b05-42e1-abc6-c50c935ef056","savedPayload":{"position":{"x":23137.09577024774,"y":20096.479239283995},"targetPosition":{"x":22355.475034198163,"y":20019.55802245936},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"280a33ea-29cc-41ab-9ffc-31c38a8e8d60","savedPayload":{"position":{"x":22854.19826829732,"y":20626.731485165095},"targetPosition":{"x":22355.475034198163,"y":20019.55802245936},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Progress","config":"{\n \"codeName\": \"progress\",\n \"isString\": false\n}","id":"5964f3e5-82af-47de-9492-19c634d4f5ad","savedPayload":{"position":{"x":22278.79789356957,"y":20801.384698960228},"targetPosition":{"x":22355.475034198163,"y":20019.55802245936},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"218da162-dd8c-4f77-9150-3d2eee6e6e0d","savedPayload":{"position":{"x":22355.475034198163,"y":20019.55802245936},"targetPosition":{"x":21841.919940047454,"y":19431.977077639505},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"04c8606b-5e59-4e7d-b3ac-387bfffcd300","savedPayload":{"position":{"x":21841.971671542407,"y":19432.187487397736},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Progress","id":"99aecc8d-2bc4-4748-b642-78888c2d35eb"}}},{"type":"Product Definition","name":"Trading System Running","config":"{\n \"codeName\": \"Trading-System-Running\",\n \"singularVariableName\": \"tradingSystemRun\",\n \"pluralVariableName\": \"tradingSystemRunning\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"c7b45884-6cdf-43f7-a1e5-c5325effd207","savedPayload":{"position":{"x":22533.929085895037,"y":19716.7835949624},"targetPosition":{"x":21762.693490734957,"y":19564.096472064244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a21cbc62-e6d8-4286-b0ff-430071d46700","savedPayload":{"position":{"x":22416.555767328,"y":20000.18832950335},"targetPosition":{"x":21762.693490734957,"y":19564.096472064244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"42cccc8c-a020-4cb2-8a40-4d3dacc86597","savedPayload":{"position":{"x":22968.36265037563,"y":20372.95838556599},"targetPosition":{"x":22197.300441361687,"y":20220.488505046877},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"7fc1205e-ad17-40d0-bb05-21e8d1842b7c","savedPayload":{"position":{"x":22640.712071969145,"y":20882.51633453806},"targetPosition":{"x":22197.300441361687,"y":20220.488505046877},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Running","config":"{\n \"codeName\": \"running\",\n \"isString\": false\n}","id":"7c7cb8f0-6d6d-4761-b51c-70ee77c05811","savedPayload":{"position":{"x":22044.759248546026,"y":20990.307499023165},"targetPosition":{"x":22197.300441361687,"y":20220.488505046877},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"f2bf57f0-e966-4b75-a95f-ba206c266dae","savedPayload":{"position":{"x":22197.300441361687,"y":20220.488505046877},"targetPosition":{"x":21762.693490734957,"y":19564.096472064244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"17236f59-6ef2-4cc3-913c-1ff6db052236","savedPayload":{"position":{"x":21762.766608887046,"y":19564.33117195913},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Running","id":"ac1e8218-af24-491f-a552-736d83d68c01"}}},{"type":"Product Definition","name":"Trading System Announcements","config":"{\n \"codeName\": \"Trading-System-Announcements\",\n \"singularVariableName\": \"tradingSystemAnnouncement\",\n \"pluralVariableName\": \"tradingSystemAnnouncements\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"9e29a710-30c0-4faa-b71a-f4ee109673a2","savedPayload":{"position":{"x":22423.776751788955,"y":19915.1985277889},"targetPosition":{"x":21670.89728385563,"y":19687.81556955808},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"b7e24195-a9d0-45e7-9dba-447db8000feb","savedPayload":{"position":{"x":22316.684198242416,"y":20208.180426900213},"targetPosition":{"x":21670.89728385563,"y":19687.81556955808},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"0487c17a-d445-4d37-b186-dc0e79e0dae7","savedPayload":{"position":{"x":22770.799376634204,"y":20578.93234216998},"targetPosition":{"x":22018.60654828455,"y":20351.18883566868},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"cb847e27-30fe-43af-9b5f-19de453cc5f7","savedPayload":{"position":{"x":22383.37307096624,"y":21045.495233409976},"targetPosition":{"x":22018.60654828455,"y":20351.18883566868},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Announcements","config":"{\n \"codeName\": \"announcements\",\n \"isString\": false\n}","id":"b3aaeae8-ed67-4830-a49c-13baada2bc11","savedPayload":{"position":{"x":21790.729630020647,"y":21102.50143727394},"targetPosition":{"x":22018.60654828455,"y":20351.18883566868},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"73ef953c-001b-474e-9221-23375777f3f3","savedPayload":{"position":{"x":22018.60654828455,"y":20351.18883566868},"targetPosition":{"x":21670.89728385563,"y":19687.81556955808},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"4a6f828a-9671-431e-8257-fc920943581e","savedPayload":{"position":{"x":21670.990233032902,"y":19688.07507064008},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Announcements","id":"0a3b8bea-749a-48ce-8b53-e4a731555b98"}}},{"type":"Product Definition","name":"Strategies","config":"{\n \"codeName\": \"Strategy-Objects\",\n \"singularVariableName\": \"strategyObject\",\n \"pluralVariableName\": \"strategyObjects\",\n \"nodePath\": \"tradingEngine.current.strategy\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"03d1a187-b188-4ad7-b99e-6e4f6c6f0278","savedPayload":{"position":{"x":22293.805727017087,"y":20102.61208678465},"targetPosition":{"x":21567.301735905665,"y":19802.133994427048},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"58a5a046-53a1-43a7-bb76-0c29d94ef579","savedPayload":{"position":{"x":22123.357732616558,"y":20357.84138298602},"targetPosition":{"x":21567.301735905665,"y":19802.133994427048},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"ffa3b94b-d147-42eb-943e-4e1661c0b8c4","savedPayload":{"position":{"x":22644.926784469288,"y":20410.170779343465},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"95273be5-fbf1-42a5-87c3-29f5ecbaafa1","savedPayload":{"position":{"x":22650.653158500463,"y":20599.506413948766},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"19988cef-f604-49a9-91f5-f8b1c93b0302","savedPayload":{"position":{"x":22610.87789523641,"y":20784.786295849157},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"8e1f47f3-3a81-45ed-892e-ea3e21d544c6","savedPayload":{"position":{"x":22527.934931590316,"y":20955.139411179927},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategy Name","config":"{ \n\"codeName\": \"strategyName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"2bb2239e-adc4-4ad1-9c82-64e03c7c60f3","savedPayload":{"position":{"x":22406.594202639797,"y":21100.70631696949},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"85886ed3-2cbb-4386-b661-d7103a1c63bb","savedPayload":{"position":{"x":22253.978089209482,"y":21212.9988073334},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"78491f8d-a68a-4918-ab38-cc9fa8eff27e","savedPayload":{"position":{"x":22078.92518196151,"y":21285.50281829107},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"46f41431-bf06-4d5e-93b5-1b64dafb8d6a","savedPayload":{"position":{"x":21891.60411432143,"y":21314.014665397113},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"b9c2814b-3d92-406b-88ab-78c71e635bd2","savedPayload":{"position":{"x":21703.095275313066,"y":21296.866964501296},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b78b86e0-a571-4f94-b837-b237c2043c3c","savedPayload":{"position":{"x":21523.9788257967,"y":21235.04895263676},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f99d1259-33b6-4c61-9332-5b751c1b2439","savedPayload":{"position":{"x":21364.851818647472,"y":21132.152332784142},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.strategy.strategyCounters\"\n}","id":"9d920c3c-3693-465f-a5e9-e8ea5dcdfd55","savedPayload":{"position":{"x":21234.91831944495,"y":20994.062993467272},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"b0192e6c-445b-4b55-b344-b273b268897b","savedPayload":{"position":{"x":21867.950533224182,"y":20528.473197801697},"targetPosition":{"x":21567.301735905665,"y":19802.133994427048},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"21db6fce-8450-4b07-9015-d81a339fd030","savedPayload":{"position":{"x":21567.526236312904,"y":19802.22740507133},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Strategy Objects","id":"d54a124c-6029-41a6-9bbd-bb3fe8b1a318"}}},{"type":"Product Definition","name":"Positions","config":"{\n \"codeName\": \"Position-Objects\",\n \"singularVariableName\": \"positionObject\",\n \"pluralVariableName\": \"positionObjects\",\n \"nodePath\": \"tradingEngine.current.position\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"55df9376-2806-429d-b43d-b96700787f74","savedPayload":{"position":{"x":22146.792637820374,"y":20275.359719691205},"targetPosition":{"x":21453.275264091157,"y":19905.463533915612},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"fd62b468-93fa-44e0-941f-fff7ea4b04ea","savedPayload":{"position":{"x":21952.21707037163,"y":20512.5720649252},"targetPosition":{"x":21453.275264091157,"y":19905.463533915612},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"a8700d50-9286-4b62-a141-abd506386983","savedPayload":{"position":{"x":22460.09507137613,"y":20555.827535728495},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"6ce2fa31-04d9-4541-a793-569b668e6201","savedPayload":{"position":{"x":22466.1177282718,"y":20685.652933924306},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"0f5cf2f4-3c5b-4607-8635-c7310906b95c","savedPayload":{"position":{"x":22450.731929412945,"y":20814.64488468235},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"ba8a1af9-323f-4acb-a438-a61f232b4033","savedPayload":{"position":{"x":22414.326553798524,"y":20939.267548736352},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"1f5f73d9-d0bc-40d2-92f7-e6e2413ee1bb","savedPayload":{"position":{"x":22357.90879235521,"y":21056.184761651704},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"0d7f793d-074f-444f-8fd7-7c07be749d1d","savedPayload":{"position":{"x":22283.028083060806,"y":21162.209400990007},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"85df8c0c-7d11-44c2-a7a9-928d4ac0ad06","savedPayload":{"position":{"x":22191.716945512402,"y":21254.465112307058},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"9c8b786e-23f6-4bf9-bf83-6fd03b494a66","savedPayload":{"position":{"x":22086.46325342142,"y":21330.42962475281},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"b0719341-cda1-4503-bed5-f4e98d7e07db","savedPayload":{"position":{"x":21970.14856741662,"y":21388.030497396267},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a052f724-c517-4032-85f7-96d3a29ba9ce","savedPayload":{"position":{"x":21845.944970755943,"y":21425.708560297713},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a4dfa19d-51b8-4151-91e5-6031059f09f1","savedPayload":{"position":{"x":21717.227634692095,"y":21442.428712440058},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionCounters\"\n}","id":"5309d28b-041a-4622-ade5-9349c19787da","savedPayload":{"position":{"x":21587.818701386215,"y":21437.730147802577},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"81bececa-73dc-42aa-b01c-a205044b3940","savedPayload":{"position":{"x":21460.65273519534,"y":21411.747025935376},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"9dde3ed5-9981-4d14-93d7-c8fd463f58af","savedPayload":{"position":{"x":21339.490723165327,"y":21365.179097421358},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{ \n\"codeName\": \"ROI\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"0ae5a8c4-c070-47e3-9409-242ea498b512","savedPayload":{"position":{"x":21227.637856904043,"y":21299.29915170699},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"0853d6cc-4429-431e-82f0-e4d958f095ea","savedPayload":{"position":{"x":21128.146826030163,"y":21215.88965329909},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"925756d5-4662-44ac-bfa6-a326c5e61b23","savedPayload":{"position":{"x":21043.71745661304,"y":21117.176289939594},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"3d22802e-0b11-47e4-8c98-7c9830f166fb","savedPayload":{"position":{"x":20976.535095481304,"y":21005.52843977203},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"823244e2-6d28-4e3a-96ea-42f6a7981bca","savedPayload":{"position":{"x":21680.856380190802,"y":20657.52446977286},"targetPosition":{"x":21453.275264091157,"y":19905.463533915612},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"1eabba24-cbd4-4cbf-95e0-c5135349d41d","savedPayload":{"position":{"x":21453.370776843432,"y":19905.688731975395},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Position Objects","id":"8854b5f8-8407-4a0d-9099-5456a8e4cced"}}},{"type":"Product Definition","name":"Stop Loss","config":"{\n \"codeName\": \"Stop-Loss\",\n \"singularVariableName\": \"stopLoss\",\n \"pluralVariableName\": \"stopLosses\",\n \"nodePath\": \"tradingEngine.current.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0ea22a69-e7cb-4fcf-b7ae-4b7233b196c4","savedPayload":{"position":{"x":21983.190380420212,"y":20433.9111005707},"targetPosition":{"x":21329.579097539874,"y":19997.424674199196},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"75b13383-2771-4f58-b2c4-ffadad2e9519","savedPayload":{"position":{"x":21766.06726064187,"y":20650.98523419164},"targetPosition":{"x":21329.579097539874,"y":19997.424674199196},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"048960a1-1de4-4492-b214-37bfc59d661b","savedPayload":{"position":{"x":22275.950775853988,"y":22480.24905321751},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"f44a0a9b-3abb-4323-be28-c14a677d2d5f","savedPayload":{"position":{"x":21742.797795273364,"y":22930.443266206752},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss","config":"{\n \"codeName\": \"stopLoss\",\n \"isString\": false\n}","id":"1152e12b-354a-49cf-bfe1-dbb54a5471bf","savedPayload":{"position":{"x":21067.12465118543,"y":23104.74309638155},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Stage","config":"{\n \"codeName\": \"stopLossStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"11b06d00-8e9e-4526-b0d9-c9553f536b4b","savedPayload":{"position":{"x":20383.063076079325,"y":22968.613702283277},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"stopLossPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"2dc164a2-1df6-40d4-861d-15b0cbc6c627","savedPayload":{"position":{"x":19825.52120105671,"y":22549.035727951796},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Positions","config":"{ \n \"codeName\": \"positions\",\n \"isString\": false,\n \"isCalculated\": false,\n \"nodePath\": \"tradingEngine.episode.episodeCounters\"\n}","id":"2ad62b6e-523d-4689-b05f-45393425e588","savedPayload":{"position":{"x":19505.249100498037,"y":21929.097038944237},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"04d49dc8-b542-4700-8d07-99323b0f1f62","savedPayload":{"position":{"x":21023.32714457117,"y":21537.610322917026},"targetPosition":{"x":21329.579097539874,"y":19997.424674199196},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"c18bdc82-216a-4b1d-8850-5c3c9dc2000b","savedPayload":{"position":{"x":21329.62269701077,"y":19997.462550083463},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Stop Loss","id":"9b8e4fc2-b62a-4d47-ac5f-08818e463da2"}}},{"type":"Product Definition","name":"Take Profit","config":"{\n \"codeName\": \"Take-Profit\",\n \"singularVariableName\": \"takeProfit\",\n \"pluralVariableName\": \"takeProfits\",\n \"nodePath\": \"tradingEngine.current.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"3cd59aa1-0590-43b6-9fb7-c85276ac132e","savedPayload":{"position":{"x":21805.092933473148,"y":20575.10067211493},"targetPosition":{"x":21197.45818871328,"y":20076.62174682822},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"916d5610-87ae-47e7-9067-9a406141e3df","savedPayload":{"position":{"x":21567.788090719845,"y":20769.819120381995},"targetPosition":{"x":21197.45818871328,"y":20076.62174682822},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"New Record Property","config":"{ \n \"codeName\": \"\",\n \"isString\": false,\n \"isCalculated\": false\n}","id":"446b1f2c-905f-4125-b9d9-8e155c6f3da7","savedPayload":{"position":{"x":21953.56077057534,"y":22573.951857682987},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"3f8411d3-5a4f-4243-9f6f-d61cc4a28fb5","savedPayload":{"position":{"x":21480.630543773434,"y":22962.077339750453},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"437e1ec6-c754-46bb-9942-e05eb056629c","savedPayload":{"position":{"x":20895.1828141344,"y":23139.672950806984},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit","config":"{\n \"codeName\": \"takeProfit\",\n \"isString\": false\n}","id":"81208625-05fb-4e89-bb88-ff16df25bdb7","savedPayload":{"position":{"x":20286.65287096951,"y":23079.712192890176},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit Stage","config":"{\n \"codeName\": \"takeProfitStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"9bce9325-8c54-424f-98b9-e991ca328c24","savedPayload":{"position":{"x":19747.110536307708,"y":22791.32721302271},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"takeProfitPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"4ccb1152-df42-41ef-b8db-da8ee01c6f09","savedPayload":{"position":{"x":19358.995654220387,"y":22318.417508778235},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Positions","config":"{ \n \"codeName\": \"positions\",\n \"isString\": false,\n \"isCalculated\": false,\n \"nodePath\": \"tradingEngine.episode.episodeCounters\"\n}","id":"0aebfdb4-5f80-4456-8ca1-e41814cade91","savedPayload":{"position":{"x":19181.40045937521,"y":21732.97536074709},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fe08bafa-9d05-4c76-9448-0d21bd36346c","savedPayload":{"position":{"x":20741.669528206243,"y":21579.42362253289},"targetPosition":{"x":21197.45818871328,"y":20076.62174682822},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"2542c7d0-fa26-4b52-a59a-a3630e52eb89","savedPayload":{"position":{"x":21197.47108294106,"y":20076.665347351467},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Take Profit","id":"78a2df79-8912-44d7-a8c7-4b6a0a7235c2"}}},{"type":"Product Definition","name":"Market Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders-Objects\", \n \"singularVariableName\": \"marketBuyOrdersObject\", \n \"pluralVariableName\": \"marketBuyOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"45609efb-0edc-4aa9-bc12-f5b4ca6dc5bf","savedPayload":{"position":{"x":21614.507069828647,"y":20697.4152654597},"targetPosition":{"x":21058.153248892246,"y":20142.206500409226},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"5eed53d0-a3e7-4082-b7f1-cb321b3d306b","savedPayload":{"position":{"x":21359.426841544966,"y":20868.008977922862},"targetPosition":{"x":21058.153248892246,"y":20142.206500409226},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"2b09fe55-b85c-4242-bae1-85a671b006ad","savedPayload":{"position":{"x":21836.76592237674,"y":21033.988262542527},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"9fdc2c26-3835-4917-b12b-5f1b0bef5a05","savedPayload":{"position":{"x":21814.823343427797,"y":21139.739881706926},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"f889b073-b78f-4345-bca7-c1943b6f5ee3","savedPayload":{"position":{"x":21778.86836261155,"y":21241.002005596125},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"2cf8c3ee-79ae-49bb-882b-992379f41fd9","savedPayload":{"position":{"x":21729.490261224182,"y":21336.32155472146},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"94e5c88c-2317-4bd1-86e6-f578db5e882f","savedPayload":{"position":{"x":21667.604393831272,"y":21423.992207721367},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7b9b53d5-d93a-4301-a0e6-ce8322da8fce","savedPayload":{"position":{"x":21594.367978998074,"y":21502.40967840811},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"96a9eb2f-30ff-4b89-aec7-17be046782ad","savedPayload":{"position":{"x":21511.13969874717,"y":21570.120999175415},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5906d64e-d90e-4dae-a2bb-c806e3d5d21d","savedPayload":{"position":{"x":21419.470929844392,"y":21625.86245618204},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"294ae361-a9f7-404a-a6dd-3dc25d8c6c27","savedPayload":{"position":{"x":21321.06501109147,"y":21668.603398537467},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e837a938-5448-4987-bdf0-d28de65d33fb","savedPayload":{"position":{"x":21217.759857271994,"y":21697.547379383606},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"4424a014-cc5f-494e-be78-0b49f960045b","savedPayload":{"position":{"x":21111.474997132187,"y":21712.154091014},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"137a18b5-33a3-433e-b85b-c8fbe03cbe69","savedPayload":{"position":{"x":21004.49166622087,"y":21712.14802295722},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderCounters\"\n}","id":"35ca0a49-129b-49e2-864a-3c43ed3bf38b","savedPayload":{"position":{"x":20898.213888094146,"y":21697.539455188013},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"0d7601cb-ee34-4775-9ad6-a2acf4b054d1","savedPayload":{"position":{"x":20794.910913032807,"y":21668.587524684026},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"4b0020d5-4d5b-4747-aa28-baf6e28f67d9","savedPayload":{"position":{"x":20696.512391448246,"y":21625.842230265018},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"7a0f2659-94df-4640-a553-4486a19dd3be","savedPayload":{"position":{"x":20604.847217054525,"y":21570.09493527891},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"1fe58bb5-6e1d-45b7-8180-da3159a624a7","savedPayload":{"position":{"x":20521.630006140582,"y":21502.376577190054},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"eedcf7ad-6668-4b14-8f07-7ee44998c47a","savedPayload":{"position":{"x":20448.40186685034,"y":21423.95098290329},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"46b407ab-5799-4ea6-946b-d857abb76183","savedPayload":{"position":{"x":20386.537178593346,"y":21336.27068176748},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"c2fcb23d-4a6d-457a-8d38-03a46786fedc","savedPayload":{"position":{"x":20337.181480378782,"y":21240.94662660399},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"ca02a2ed-731a-4df8-9f76-fe8d60b7ad8e","savedPayload":{"position":{"x":20301.255986413136,"y":21139.679863068748},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"ac187d63-a2cc-487c-8e81-03c786749d9c","savedPayload":{"position":{"x":20279.421635205937,"y":21033.862259940604},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d79b050c-2805-4b39-bcd3-1678628f8d1c","savedPayload":{"position":{"x":21058.030639395492,"y":20928.109117914355},"targetPosition":{"x":21058.153248892246,"y":20142.206500409226},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"db256083-9aa2-48e1-8fd6-3425a5085302","savedPayload":{"position":{"x":21058.18693614761,"y":20142.533787995624},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Buy Orders","id":"e00fe7d4-894d-4483-a73a-3cd77943ea80"}}},{"type":"Product Definition","name":"Market Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders-Objects\", \n \"singularVariableName\": \"marketSellOrdersObject\", \n \"pluralVariableName\": \"marketSellOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"6112bd4d-07cb-41db-98c4-e286d172b5c0","savedPayload":{"position":{"x":21412.222328348424,"y":20801.250683761362},"targetPosition":{"x":20913.097831330386,"y":20194.12514611379},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"07cd5668-5e0f-4385-9c02-72eebc99344a","savedPayload":{"position":{"x":21141.777284805674,"y":20945.902086076945},"targetPosition":{"x":20913.097831330386,"y":20194.12514611379},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"0ba08ecb-3542-4acd-abbe-7059306ed669","savedPayload":{"position":{"x":21600.530109169165,"y":21157.834988480725},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"0ae49e68-38d8-4356-bde3-c648a29177a7","savedPayload":{"position":{"x":21568.21747648051,"y":21260.869766843218},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"b7057c53-6d99-44ca-9eff-4dd21ebe2116","savedPayload":{"position":{"x":21522.508701356168,"y":21358.11701349974},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"01b26cba-240f-451e-8533-2e090a3103fd","savedPayload":{"position":{"x":21464.032951113106,"y":21448.138885100518},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"052e9ef4-da9f-4198-b13f-7a2e0c60b906","savedPayload":{"position":{"x":21393.8487907054,"y":21529.322552736652},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a6e9d3dc-20e3-4cf3-94f4-79f3723b4d34","savedPayload":{"position":{"x":21313.28028446951,"y":21600.183125654155},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7a1bd071-8ba4-4013-9f96-d951fbe4d0f3","savedPayload":{"position":{"x":21223.817457653193,"y":21659.409646628807},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b38cf81f-59f2-4508-9fbc-e82b1ad38d65","savedPayload":{"position":{"x":21127.12490921679,"y":21705.900390360766},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"0132786e-0a9a-4096-a6a5-57f03485d0b1","savedPayload":{"position":{"x":21025.004929649614,"y":21738.78786508604},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"d1cb7813-1e5a-43f2-af35-f82a9ee47a0b","savedPayload":{"position":{"x":20919.363414092055,"y":21757.467611346416},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"8ab09d9d-7c5a-45d4-ad6a-8a4292c1b137","savedPayload":{"position":{"x":20812.459853584496,"y":21761.578301603582},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b1d35b5f-2d9f-4ba0-b4bc-cc12c74104e8","savedPayload":{"position":{"x":20705.698684478088,"y":21751.06076451004},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderCounters\"\n}","id":"b1dbf0d5-39bb-4c1a-ac6d-d1d647e82d54","savedPayload":{"position":{"x":20601.361242733947,"y":21726.101302878193},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"8635df32-bd11-4fe5-a54d-491f69c06327","savedPayload":{"position":{"x":20501.394865578124,"y":21687.16634475206},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"8b25c33c-8f96-4a6e-8180-43027d0fc396","savedPayload":{"position":{"x":20407.660062459483,"y":21634.98396069281},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"8a9b6dc6-ec65-4933-907f-75e45119ddb2","savedPayload":{"position":{"x":20321.90240403687,"y":21570.51876411575},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"86f2f21b-b725-4045-8791-5625d62b8d40","savedPayload":{"position":{"x":20245.72563650521,"y":21494.970911420944},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"2ffc6fc2-9e28-4ef6-9047-a2bd2b618bd3","savedPayload":{"position":{"x":20180.53745900928,"y":21409.744173749546},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"e5c5802a-d778-40e5-9039-4067a6a56e4f","savedPayload":{"position":{"x":20127.5646951763,"y":21316.4233699729},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"7fccf0bc-d0a4-48d9-b4ac-c467bc74ef0f","savedPayload":{"position":{"x":20087.792734668124,"y":21216.717536040105},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"2149cdc5-19f8-4e11-9d5c-e6c062998223","savedPayload":{"position":{"x":20061.967529392216,"y":21112.418782398283},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"df8e190a-1138-4ffa-baef-6a560ba51739","savedPayload":{"position":{"x":20050.613148686472,"y":21004.960148780567},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"8b01d5ae-7d6f-4c08-9f05-2f8edb699fd6","savedPayload":{"position":{"x":20835.80227970248,"y":20976.055872544523},"targetPosition":{"x":20913.097831330386,"y":20194.12514611379},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"1958f79b-5c6c-4874-9154-98c314822ed7","savedPayload":{"position":{"x":20913.105259593776,"y":20194.43466687847},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Sell Orders","id":"a9811005-1b7d-45bb-8003-0e60caab5f09"}}},{"type":"Product Definition","name":"Limit Buy Orders","config":"{ \n \"codeName\": \"Limit-Buy-Orders-Objects\", \n \"singularVariableName\": \"limitBuyOrdersObject\", \n \"pluralVariableName\": \"limitBuyOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"b82fb0f9-74c1-42e6-961c-a696214ef079","savedPayload":{"position":{"x":21200.839251513848,"y":20884.691629889},"targetPosition":{"x":20763.641969935117,"y":20231.567498668817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2e03f52e-0cd2-46b4-9c10-0b8516ef9c71","savedPayload":{"position":{"x":20917.469703643408,"y":21002.132528429454},"targetPosition":{"x":20763.641969935117,"y":20231.567498668817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"890f7170-f42d-43d8-a084-b9b88ea212cc","savedPayload":{"position":{"x":21353.313521019285,"y":21258.042234475386},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"3e6e8e40-2e6c-4bd4-b709-effa25749403","savedPayload":{"position":{"x":21311.02756365796,"y":21357.3748830743},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"280a9209-b9cd-4cb7-b0b7-3dfe2f472140","savedPayload":{"position":{"x":21256.015099503515,"y":21449.702333755296},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"254561e5-52c3-4669-920e-4fe5370653c4","savedPayload":{"position":{"x":21188.99266122631,"y":21533.556279922745},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"8ef21836-adad-4918-9816-fbb3c9dd1fc5","savedPayload":{"position":{"x":21111.194197493067,"y":21607.45293274165},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"4d6fd5f1-a95b-4ec1-a49c-6c057190d354","savedPayload":{"position":{"x":21024.077203915695,"y":21670.092543731615},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"558830b2-1030-4c71-9079-cc88b78d3010","savedPayload":{"position":{"x":20929.237380702518,"y":21720.245652554117},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"12402a8e-c9d4-4adb-94c3-22f526d72d14","savedPayload":{"position":{"x":20828.44695117276,"y":21757.051250686076},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"8cc955fb-62ec-40b9-963b-275956de04d9","savedPayload":{"position":{"x":20723.606018755607,"y":21779.773932234162},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"63af17a0-e994-4b5f-b853-207bf27c496c","savedPayload":{"position":{"x":20616.63204572951,"y":21787.992532590128},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"0af4f067-ac3d-4ee7-ba1d-d9c22ae2f46f","savedPayload":{"position":{"x":20509.84563408315,"y":21781.585613479845},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f8cb0422-95bb-4c53-a5f6-7e02819021c0","savedPayload":{"position":{"x":20404.638654851326,"y":21760.64482835106},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderCounters\"\n}","id":"d16faba6-3464-4536-9c93-afbe6e0d4262","savedPayload":{"position":{"x":20303.251118673586,"y":21725.58743806796},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"368ffab0-db17-4136-ba1b-aef1f8fb60d8","savedPayload":{"position":{"x":20207.585228298823,"y":21677.033232773116},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"75fd2c91-2bfe-428c-9ff6-7d28d566a96d","savedPayload":{"position":{"x":20119.402054174385,"y":21615.927603108186},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"832887dd-da08-4b8b-8916-b7f855c9dc5c","savedPayload":{"position":{"x":20040.38529079861,"y":21543.354630351285},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"3ee96ca2-b7d1-4207-ac60-abd742b2310b","savedPayload":{"position":{"x":19971.96868434573,"y":21460.7115726367},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"5d621574-54fd-4279-8c47-7bb9710bcc90","savedPayload":{"position":{"x":19915.468093592004,"y":21369.495852860662},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"0bddc747-8300-4b15-8a7a-134ff133d2ec","savedPayload":{"position":{"x":19871.8793391836,"y":21271.438392551558},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"4564e44d-dbd5-4d97-8433-fc1dd877bd2f","savedPayload":{"position":{"x":19842.07989534779,"y":21168.322922203082},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"dc313012-cb3e-4087-9ae1-af1125a074e3","savedPayload":{"position":{"x":19826.599291112554,"y":21061.9942716538},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"ba489aaa-0872-4e7f-bad0-a7c43b0da4b5","savedPayload":{"position":{"x":19825.838389411456,"y":20954.24659372261},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"aaad0279-43dd-46fc-b099-40cba6c3b6a8","savedPayload":{"position":{"x":20610.083008422942,"y":21002.151720287846},"targetPosition":{"x":20763.641969935117,"y":20231.567498668817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"5deceb32-c7ab-4560-818a-0f0b9d6632fb","savedPayload":{"position":{"x":20763.565842308075,"y":20231.88600377003},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Buy Orders","id":"7e3120c7-a0c9-483c-ada9-8c53deb10f33"}}},{"type":"Product Definition","name":"Limit Sell Orders","config":"{ \n \"codeName\": \"Limit-Sell-Orders-Objects\", \n \"singularVariableName\": \"limitSellOrdersObject\", \n \"pluralVariableName\": \"limitSellOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"356495a9-b063-495d-b06d-5281c7c0007e","savedPayload":{"position":{"x":20982.05610069265,"y":20947.007584844283},"targetPosition":{"x":20611.025142419625,"y":20254.164466381346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"934ab813-127e-4bbf-aa71-09b3cdadc0d0","savedPayload":{"position":{"x":20688.60921093513,"y":21036.1120306579},"targetPosition":{"x":20611.025142419625,"y":20254.164466381346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"5c8236b1-b257-44f4-98bd-a158b67aad16","savedPayload":{"position":{"x":21097.281422097258,"y":21333.526663432756},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"16140fc9-d4ae-43c2-ba47-f676b79a9775","savedPayload":{"position":{"x":21045.48131464206,"y":21428.264907903613},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"2d871d0f-e668-4e9d-9fcf-439f37cd082f","savedPayload":{"position":{"x":20981.686008224002,"y":21514.73061959754},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"fc6f8fe4-b752-448a-9ece-8497abf2901c","savedPayload":{"position":{"x":20906.75763743163,"y":21591.616046435083},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"3502765f-2f50-44c6-b85c-64d7f72f5592","savedPayload":{"position":{"x":20822.094950913084,"y":21657.556183556688},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"608ebfd0-4294-4e24-8111-a8f695072ca0","savedPayload":{"position":{"x":20729.24637676777,"y":21711.330694732038},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"8148805b-acd7-4dc6-948a-fb7e9f5f87a0","savedPayload":{"position":{"x":20629.953927871444,"y":21751.961133558623},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"c49c3510-e24b-418f-9334-760c5da57ccf","savedPayload":{"position":{"x":20526.052839790318,"y":21778.69767492796},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"04b96ab3-eb13-4039-a385-8e5c4377daa4","savedPayload":{"position":{"x":20419.477481846243,"y":21791.032334390085},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"6ec27702-5283-4fbf-b6a7-92663a6e9e9b","savedPayload":{"position":{"x":20312.52700297634,"y":21788.73346960129},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"6a4285a4-c9d5-4d5b-a218-da8e19ca5970","savedPayload":{"position":{"x":20206.58698984659,"y":21771.85699410282},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e3e35a81-c5b2-4768-ab16-99b42ef83358","savedPayload":{"position":{"x":20103.927545387436,"y":21740.722862687348},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderCounters\"\n}","id":"815780d8-f647-42cc-9a40-aa99caa350c7","savedPayload":{"position":{"x":20006.467929115104,"y":21695.87780136533},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"2d1ec15a-0af3-46b9-b12d-da625bf83a5c","savedPayload":{"position":{"x":19916.008204065976,"y":21638.201572562637},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"d824c424-4324-46b1-87b9-182cc9f0d054","savedPayload":{"position":{"x":19834.262439425744,"y":21568.730921462113},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"09c85bf9-9311-4235-98d5-af35467b0876","savedPayload":{"position":{"x":19762.7260211635,"y":21488.76993908179},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"b1389f84-b934-4ecb-88b0-a6a029ad54f1","savedPayload":{"position":{"x":19702.74888349722,"y":21399.816048163433},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"d722bfd4-eb08-4dfc-8cc9-f706f93df80e","savedPayload":{"position":{"x":19655.451003102255,"y":21303.50536821594},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"d05fe7d4-d772-4ad4-9890-a3aa342fc5f6","savedPayload":{"position":{"x":19621.70613982937,"y":21201.63948159744},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"d4b14139-33ad-4da1-942c-ce8df0d3efa9","savedPayload":{"position":{"x":19602.137356199248,"y":21096.097171858364},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"9ade3c97-f409-4c23-b66f-b6670100e039","savedPayload":{"position":{"x":19597.162228735677,"y":20989.06098507168},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"780e674d-64fc-401a-ad5d-1012645f512e","savedPayload":{"position":{"x":19606.99345909001,"y":20881.46623426629},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"7dc5d5fc-ff33-4652-bc9c-fad0566a3d9f","savedPayload":{"position":{"x":20382.743400873325,"y":21006.03662641907},"targetPosition":{"x":20611.025142419625,"y":20254.164466381346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"2a1d405b-2fbe-4ed4-a76a-d2c7be59d20e","savedPayload":{"position":{"x":20610.902227655013,"y":20254.47995487155},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Sell Orders","id":"fb243322-ec2a-4f03-bb77-e97e4699d1c6"}}}],"id":"8c7f3687-b5ae-4a45-bda1-751cb2c55995","savedPayload":{"position":{"x":20457.557715057636,"y":18692.25561365076},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"j"}}}],"plotters":[{"type":"Plotter","name":"Trading Engine","config":"{ \n\"codeName\": \"Trading-Engine\"\n}","modules":[{"type":"Plotter Module","name":"Episode Counters","config":"{ \n\"codeName\": \"Episode-Counters\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"11308192-1761-4746-8567-50f5d50eee37","savedPayload":{"position":{"x":20117.413327324673,"y":19042.96907559157},"targetPosition":{"x":19943.094964341282,"y":19102.393226423435},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"5e478e3f-e432-4364-8f2c-2f3b2849848b","savedPayload":{"position":{"x":19943.094964341282,"y":19102.393226423435},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Episode Statistics","config":"{ \n\"codeName\": \"Episode-Statistics\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"a22754c1-aa31-4bef-8d7f-4b0df8b2c6e5","savedPayload":{"position":{"x":20159.316034004718,"y":19219.602639324537},"targetPosition":{"x":19976.242734774878,"y":19243.490434068044},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"6ce18a43-2e6a-452e-a72d-1c56a58d3f81","savedPayload":{"position":{"x":19976.242734774878,"y":19243.490434068044},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Candle","config":"{ \n\"codeName\": \"Current-Candle\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"db2a5867-c3c9-40ae-86f2-19845ca4bffe","savedPayload":{"position":{"x":20165.635339080774,"y":19399.779647528572},"targetPosition":{"x":19981.129700404676,"y":19387.62686013658},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"31789d43-d608-4eeb-a3ff-338a99074045","savedPayload":{"position":{"x":19981.129700404676,"y":19387.62686013658},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Balance","config":"{ \n\"codeName\": \"Current-Balance\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"27e334d8-0ec2-4047-a961-af4c5fcf8d32","savedPayload":{"position":{"x":20136.399932217766,"y":19577.979259706364},"targetPosition":{"x":19957.710855540852,"y":19530.030950804015},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"e5d9e3e1-d1f4-4493-b452-33fe49c81228","savedPayload":{"position":{"x":19957.710855540852,"y":19530.030950804015},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Distance To Event","config":"{ \n\"codeName\": \"Distance-To-Event\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"dc45b078-aeee-40bf-8f6d-f8b12a57494f","savedPayload":{"position":{"x":20072.863649683677,"y":19747.02520755632},"targetPosition":{"x":19906.925165874487,"y":19665.10212229388},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"56eb7de2-0281-404a-bd4d-34ac113e2325","savedPayload":{"position":{"x":19906.925165874487,"y":19665.10212229388},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Strategy","config":"{ \n\"codeName\": \"Current-Strategy\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"97c36937-1cdc-42ce-b886-ca8220b14025","savedPayload":{"position":{"x":19977.528752302187,"y":19900.39661364476},"targetPosition":{"x":19830.750753563283,"y":19787.63884692262},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"a3c31000-1b82-4fe9-ae56-6d5893582b16","savedPayload":{"position":{"x":19830.750753563283,"y":19787.63884692262},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Last Strategy","config":"{ \n\"codeName\": \"Last-Strategy\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"c242da84-b00b-4900-ad95-b25a57ef9603","savedPayload":{"position":{"x":19854.08285607968,"y":20032.218151755325},"targetPosition":{"x":19732.12275012374,"y":19892.955186851497},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"028aaa23-630c-4aa6-a168-6b2a128b1a83","savedPayload":{"position":{"x":19732.12275012374,"y":19892.955186851497},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Position","config":"{ \n\"codeName\": \"Current-Position\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"daf7ee4e-434b-48df-af3b-b17489fe6a12","savedPayload":{"position":{"x":19707.27550477091,"y":20137.41306575237},"targetPosition":{"x":19614.83495385916,"y":19977.000168047274},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"0d2212c7-07bb-4c41-94fb-00844415ba5e","savedPayload":{"position":{"x":19614.83495385916,"y":19977.000168047274},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Last Position","config":"{ \n\"codeName\": \"Last-Position\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"c4473b0f-99f8-4129-b8ee-1f6a988e9440","savedPayload":{"position":{"x":19542.750365121017,"y":20211.93675417748},"targetPosition":{"x":19483.396007865846,"y":20036.54505232772},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"08c88b9c-70f1-49ff-aa16-21f2bc1c0ba1","savedPayload":{"position":{"x":19483.396007865846,"y":20036.54505232772},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Previous Balance","config":"{ \n\"codeName\": \"Previous-Balance\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"0305adcc-b68f-4795-bb16-01dd962823b1","savedPayload":{"position":{"x":19366.829387963182,"y":20252.91416964335},"targetPosition":{"x":19342.856887766855,"y":20069.29256206347},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"77dc9564-5ed0-4ce9-9e45-d23e396d336f","savedPayload":{"position":{"x":19342.856887766855,"y":20069.29256206347},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Previous Candle","config":"{ \n\"codeName\": \"Previous-Candle\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"559cabae-7e0e-4ff8-b1dd-8f822421fe6e","savedPayload":{"position":{"x":19186.66955947213,"y":20258.77145143252},"targetPosition":{"x":19198.81463109356,"y":20073.989887543394},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"076dcee2-2923-4455-8697-263649515a3b","savedPayload":{"position":{"x":19198.81463109356,"y":20073.989887543394},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Market Buy Orders","config":"{ \n\"codeName\": \"Market-Buy-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"8ed02a94-4fce-4314-ab0a-6642e85bdca3","savedPayload":{"position":{"x":19008.418174102226,"y":20229.256256054803},"targetPosition":{"x":19056.419740901674,"y":20050.43689811562},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"50d624c9-9a6e-4d57-a147-29d5c004b3f2","savedPayload":{"position":{"x":19056.419740901674,"y":20050.43689811562},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Market Sell Orders","config":"{ \n\"codeName\": \"Market-Sell-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"15dc7163-1703-4cad-9253-d48d7bb01800","savedPayload":{"position":{"x":18839.205067486902,"y":20165.563321135065},"targetPosition":{"x":18921.294276055974,"y":19999.50993576347},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"4f84a1a5-f9cd-4b9d-9d91-661ba912e2ca","savedPayload":{"position":{"x":18921.294276055974,"y":19999.50993576347},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Buy Orders","config":"{ \n\"codeName\": \"Limit-Buy-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"b89ff555-961b-4190-b874-4968e26db1b4","savedPayload":{"position":{"x":18685.51521080523,"y":20069.89639413747},"targetPosition":{"x":18798.60101336079,"y":19923.118019543184},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"17ec46bd-e5c0-48d5-a3b6-e108cc835f17","savedPayload":{"position":{"x":18798.60101336079,"y":19923.118019543184},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Sell Orders","config":"{ \n\"codeName\": \"Limit-Sell-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"fe4a4590-f68f-454e-84ba-96ae9cef3b70","savedPayload":{"position":{"x":18552.955629649456,"y":19945.209582219977},"targetPosition":{"x":18692.728636381424,"y":19823.727445061555},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"1ec8da3f-8749-430d-8ad9-35fffc0d61ec","savedPayload":{"position":{"x":18692.728636381424,"y":19823.727445061555},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"ebb03c87-e87e-4f4b-8763-361854776287","savedPayload":{"position":{"x":19247.024060080726,"y":19339.615075747224},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Trading System","config":"{ \n\"codeName\": \"\"\n}","modules":[{"type":"Plotter Module","name":"Highlights","config":"{ \n\"codeName\": \"Highlights\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesHighlights":{"type":"Nodes Highlights","name":"New Nodes Highlights","config":"{ \n\"nodePath\": \"\"\n}","id":"fa39a76d-1b97-41a2-ab18-f33c2f31fded","savedPayload":{"position":{"x":19391.364068327923,"y":20449.697609772305},"targetPosition":{"x":18954.90673398596,"y":19880.565958426927},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d979c9f0-530a-41d3-a357-b57a3e4f2201","savedPayload":{"position":{"x":18954.90673398596,"y":19880.565958426927},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Values","config":"{ \n\"codeName\": \"Values\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesValues":{"type":"Nodes Values","name":"New Nodes Values","config":"{ \n\"nodePath\": \"\"\n}","id":"f42e5006-d8ec-437a-8906-53d7ce68b79c","savedPayload":{"position":{"x":18885.076490181396,"y":20699.26786411799},"targetPosition":{"x":18700.175580395793,"y":20006.65283798813},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"476925ed-e2ac-443d-82f3-501b64ca6c87","savedPayload":{"position":{"x":18700.175580395793,"y":20006.65283798813},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Errors","config":"{ \n\"codeName\": \"Errors\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesErrors":{"type":"Nodes Errors","name":"New Nodes Errors","config":"{ \n\"nodePath\": \"\"\n}","id":"c814ea79-0fa6-44bb-a636-d46d7b3720c4","savedPayload":{"position":{"x":18327.896362351243,"y":20736.5310144487},"targetPosition":{"x":18421.673794104307,"y":20026.062364550588},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"64684730-d049-4d3c-8013-b48c5438417e","savedPayload":{"position":{"x":18421.673794104307,"y":20026.062364550588},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Status","config":"{ \n\"codeName\": \"Status\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesStatus":{"type":"Nodes Status","name":"New Nodes Status","config":"{ \n\"nodePath\": \"\"\n}","id":"2b1290d8-41ff-48a3-a11b-45f1228e2a84","savedPayload":{"position":{"x":17798.749434564117,"y":20556.28807947405},"targetPosition":{"x":18157.218034068752,"y":19935.832510132077},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0437448d-8740-496b-8fce-d3804be81a2b","savedPayload":{"position":{"x":18157.218034068752,"y":19935.832510132077},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Progress","config":"{ \n\"codeName\": \"Progress\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesProgress":{"type":"Nodes Progress","name":"New Nodes Progress","config":"{ \n\"nodePath\": \"\"\n}","id":"00c9d7bc-295f-48b6-81a0-71b6bc0b6299","savedPayload":{"position":{"x":17378.388830820622,"y":20187.21876732149},"targetPosition":{"x":17946.954914160462,"y":19751.168069817762},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"99aecc8d-2bc4-4748-b642-78888c2d35eb","savedPayload":{"position":{"x":17946.954914160462,"y":19751.168069817762},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Running","config":"{ \n\"codeName\": \"Running\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesRunning":{"type":"Nodes Running","name":"New Nodes Running","config":"{ \n\"nodePath\": \"\"\n}","id":"3ef03483-8d69-452c-9f56-984574b79e32","savedPayload":{"position":{"x":17131.138670423687,"y":19685.258921388722},"targetPosition":{"x":17823.318601536146,"y":19500.044175509316},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"ac1e8218-af24-491f-a552-736d83d68c01","savedPayload":{"position":{"x":17823.318601536146,"y":19500.044175509316},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Announcements","config":"{ \n\"codeName\": \"Announcements\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesAnnouncements":{"type":"Nodes Announcements","name":"New Nodes Announcements","id":"197785fc-72c7-46ef-83bf-a095b01cbfec","savedPayload":{"position":{"x":17094.65425416798,"y":19127.142892395404},"targetPosition":{"x":17805.126727891166,"y":19220.731369590514},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0a3b8bea-749a-48ce-8b53-e4a731555b98","savedPayload":{"position":{"x":17805.126727891166,"y":19220.731369590514},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"34f9d374-f4ae-4abf-96e3-978c6b8a879a","savedPayload":{"position":{"x":18516.41196526161,"y":19314.69061560807},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Trading Strategy","config":"{ \n\"codeName\": \"\"\n}","modules":[{"type":"Plotter Module","name":"Strategy Objects","config":"{ \n \"codeName\": \"Strategy-Objects\", \n \"icon\": \"trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin Bottom","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = 0","id":"458c8a52-4191-4fa5-b4f7-a0eb2edfcdc8","savedPayload":{"position":{"x":18081.218371402276,"y":20001.580752358284},"targetPosition":{"x":17931.563435711592,"y":19930.58721017884},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"a464e820-57a7-4233-b23b-e802fc9b3a33","savedPayload":{"position":{"x":17931.563435711592,"y":19930.58721017884},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Begin Top","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.beginRate","id":"3abb7e03-f8f3-4956-9729-756e7974c5a0","savedPayload":{"position":{"x":17993.046157419085,"y":20130.559346072285},"targetPosition":{"x":17872.711490303922,"y":20016.448690745277},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"d2e900e2-444c-4268-b07a-fc41811c82d8","savedPayload":{"position":{"x":17872.711490303922,"y":20016.448690745277},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End Bottom","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = 0","id":"5ef24a29-2154-4304-ae0d-e046db069042","savedPayload":{"position":{"x":17869.44146040387,"y":20225.579034662645},"targetPosition":{"x":17790.442480402246,"y":20079.693833387522},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"e960d99e-f263-4ee8-9801-9b97f534bd5e","savedPayload":{"position":{"x":17790.442480402246,"y":20079.693833387522},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End Top","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.endRate","id":"6d7f55b1-11df-4598-bab9-32a02ae6fa33","savedPayload":{"position":{"x":17721.94089882444,"y":20277.425122906654},"targetPosition":{"x":17692.261414838344,"y":20114.344153004684},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"3a8be5c7-aff5-4283-bd17-dadd6dddda4d","savedPayload":{"position":{"x":17692.261414838344,"y":20114.344153004684},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"87bdc7ca-4228-48a3-ab2d-4eba01abfa2e","savedPayload":{"position":{"x":17632.92038471467,"y":19789.02761515228},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"Closed Base","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.status === 'Closed'","id":"3d4e39c7-4178-4557-95b9-0bb94a15135c","savedPayload":{"position":{"x":17332.36226190298,"y":18789.641782890405},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"83329324-581e-42e2-948e-7d06a3d9066c","savedPayload":{"position":{"x":17156.111726092997,"y":19440.732424868653},"targetPosition":{"x":17074.19643993036,"y":19123.08535880395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"4a04b54a-70b9-4e92-a474-d6ef03a97f26","savedPayload":{"position":{"x":17074.19643993036,"y":19123.08535880395},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin Bottom","id":"b3a7f670-c86e-4382-93ee-bb6dbabfd159","savedPayload":{"position":{"x":16711.41105360419,"y":18982.555240704925},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},{"type":"Polygon Vertex","name":"End Bottom","id":"0e17c75c-09f4-49ae-8e6a-55fdfd89f428","savedPayload":{"position":{"x":16726.47933994653,"y":18557.2927957767},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}}],"id":"9ae59a68-71fd-4ec8-9a70-da743f33baee","savedPayload":{"position":{"x":17401.947238063913,"y":19904.246645030144},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Open Base","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.status === 'Open'","id":"5eb17be1-910b-4da5-959b-e7cf21dfa896","savedPayload":{"position":{"x":17812.54277702138,"y":17057.035277485065},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [3,3]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [3,3]\n }\n}","id":"f790de9e-e87a-4f2a-86d5-c8f69d4b9525","savedPayload":{"position":{"x":17365.31479265209,"y":16654.441096923805},"targetPosition":{"x":17653.586095898576,"y":16715.752832401842},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"a4e077b1-7bc7-4d90-b796-b4e808985b89","savedPayload":{"position":{"x":17653.586095898576,"y":16715.752832401842},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin Bottom","id":"b158074f-5013-4899-b61b-232eb519370c","savedPayload":{"position":{"x":17936.694607590034,"y":16460.312219109783},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},{"type":"Polygon Vertex","name":"End Bottom","id":"365ee7e7-0529-4acc-a77f-d596c195399f","savedPayload":{"position":{"x":18220.72519850297,"y":16671.570064640404},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}}],"id":"504f327c-a08d-4c3d-8e77-850299cc30ed","savedPayload":{"position":{"x":17144.846015276304,"y":19921.227520967637},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Left Line","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n }\n}","id":"e2422730-fb47-4014-a707-8c346d6bc327","savedPayload":{"position":{"x":17807.04504548531,"y":16232.834910001038},"targetPosition":{"x":18035.93056916737,"y":16418.28883576163},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"bbd7ee22-fb16-4b59-9e0c-04018e9dd3fa","savedPayload":{"position":{"x":18035.93056916737,"y":16418.28883576163},"targetPosition":{"x":18303.404061869947,"y":16635.01330635403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin Bottom","id":"a3a9eca0-36f3-4058-b8d7-872ce77209cd","savedPayload":{"position":{"x":18267.574764341214,"y":16292.601081330555},"targetPosition":{"x":18303.404061869947,"y":16635.01330635403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},{"type":"Polygon Vertex","name":"Begin Top","id":"d480fdc6-89e5-4547-a2ae-17ff5e4fc917","savedPayload":{"position":{"x":18520.177733318913,"y":16367.245199319585},"targetPosition":{"x":18303.404061869947,"y":16635.01330635403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Top","id":"d2e900e2-444c-4268-b07a-fc41811c82d8"}}}],"id":"f9500afd-e0f4-45d3-9647-45ec778554e8","savedPayload":{"position":{"x":16900.541819530816,"y":19838.233822537903},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Right Line","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n }\n}","id":"03ebe379-fb32-47fc-bfd6-b9ccc73bfd16","savedPayload":{"position":{"x":17927.729125501923,"y":16194.543051624189},"targetPosition":{"x":18135.47403976817,"y":16402.465560757602},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"054fcea5-2f72-4439-be45-c289a3bdab14","savedPayload":{"position":{"x":18135.47403976817,"y":16402.465560757602},"targetPosition":{"x":18364.911411834917,"y":16632.123065111024},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"End Bottom","id":"a0b737cf-ec7b-4026-870c-cebec148464f","savedPayload":{"position":{"x":18364.909622223353,"y":16306.440321548187},"targetPosition":{"x":18364.911411834917,"y":16632.123065111024},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}},{"type":"Polygon Vertex","name":"End Top","id":"fceb54ef-473e-4062-9407-ec64e9040504","savedPayload":{"position":{"x":18595.47451362469,"y":16401.51878224143},"targetPosition":{"x":18364.911411834917,"y":16632.123065111024},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Top","id":"3a8be5c7-aff5-4283-bd17-dadd6dddda4d"}}}],"id":"354102dd-fd58-4f84-8e90-0d891defa0c8","savedPayload":{"position":{"x":16706.53159437666,"y":19668.11292575698},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"quality\",\n\"size\": 15\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 0\n }","id":"64c0d038-c401-4317-84fd-b73e1b210d00","savedPayload":{"position":{"x":16272.932628973,"y":19522.158636785425},"targetPosition":{"x":16592.423437142214,"y":19436.6186819141},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},"id":"01f6ebd3-e14f-4434-a0fb-1d8167122ce3","savedPayload":{"position":{"x":16592.423437142214,"y":19436.6186819141},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"quality\",\n\"size\": 15\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 0\n }","id":"56f86edf-c2cc-491b-8cea-4bae0f03ebfd","savedPayload":{"position":{"x":16247.721965816118,"y":19136.205590263624},"targetPosition":{"x":16575.673764671476,"y":19179.2839476076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}},"id":"df6a3044-b207-4564-8c28-8d64c679ee9a","savedPayload":{"position":{"x":16575.673764671476,"y":19179.2839476076},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"b02b7fee-30b0-41f0-ae06-a073c57289d9","savedPayload":{"position":{"x":17231.16806640037,"y":19265.607641994055},"targetPosition":{"x":17561.159682915157,"y":18694.09863434512},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Strategy Object","config":"{ \n\"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"b037ec89-e05b-432c-9b61-da05bda134cc","savedPayload":{"position":{"x":16736.42481032476,"y":18159.9516671533},"targetPosition":{"x":16901.552923584517,"y":18147.630196993425},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"0316c81d-7b05-42cb-876e-19d25eb1896a","savedPayload":{"position":{"x":16901.552923584517,"y":18147.630196993425},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"ed7a2560-35b9-4142-bd68-77347bf66b89","savedPayload":{"position":{"x":16769.002681606882,"y":17941.58265161991},"targetPosition":{"x":16923.190296585854,"y":18001.98905585155},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"5d9060d4-50fb-4cda-8037-85f7ffae5c27","savedPayload":{"position":{"x":16923.190296585854,"y":18001.98905585155},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.strategyName","id":"925d79c1-efdd-4555-baba-72e686294057","savedPayload":{"position":{"x":16893.42950227033,"y":17758.90578958544},"targetPosition":{"x":17006.185694373435,"y":17880.36784312982},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"1a4951ef-23ae-4228-8479-a0fe687c2d82","savedPayload":{"position":{"x":17006.185694373435,"y":17880.36784312982},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Triggered By Situation","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"24317532-e6bf-4827-9196-e052fe28bcb3","savedPayload":{"position":{"x":17085.122419865744,"y":17648.08202711934},"targetPosition":{"x":17133.911879741754,"y":17806.633308672193},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"6c79326f-b90c-4155-8f61-8ee2322b9b09","savedPayload":{"position":{"x":17133.911879741754,"y":17806.633308672193},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"2a35de7b-ad59-439b-aa6c-0668ffd92816","savedPayload":{"position":{"x":17305.079079795796,"y":17631.798112078526},"targetPosition":{"x":17280.477570342897,"y":17795.72497386978},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"6a34a5de-3b89-4f07-a947-5b94c8926dc1","savedPayload":{"position":{"x":17280.477570342897,"y":17795.72497386978},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"33bd5e59-f2bf-4b5c-bd74-6975e07b3056","savedPayload":{"position":{"x":17511.118154224798,"y":17712.917372895157},"targetPosition":{"x":17417.76863662494,"y":17849.69086106077},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"a0c5053d-5b1e-4f7e-8edb-58baaaa8a45a","savedPayload":{"position":{"x":17417.76863662494,"y":17849.69086106077},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"b256b76c-3834-4d62-aa56-f42cce9f47e9","savedPayload":{"position":{"x":17231.20872385997,"y":18122.725313946168},"targetPosition":{"x":17561.159682915157,"y":18694.09863434512},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d54a124c-6029-41a6-9bbd-bb3fe8b1a318","savedPayload":{"position":{"x":17459.085481559683,"y":18699.078066507154},"targetPosition":{"x":18171.730905078774,"y":18699.077892608217},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"62890699-eabf-4ea8-8ca0-cac07cc06dea","savedPayload":{"position":{"x":18171.730905078774,"y":18699.077892608217},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Trading Position","config":"{ \n \"codeName\": \"\"\n}","modules":[{"type":"Plotter Module","name":"Position Objects","config":"{ \n \"codeName\": \"Position-Objects\", \n \"icon\": \"trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Left Begin Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.beginRate","id":"b00ea4d5-f3d0-40cf-b65e-7845415b9126","savedPayload":{"position":{"x":17743.50811562693,"y":17552.530622918286},"targetPosition":{"x":17805.23648184782,"y":17413.603588059334},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"407ce9a9-7029-46be-a2cc-7f5469f13079","savedPayload":{"position":{"x":17805.23648184782,"y":17413.603588059334},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Right Begin Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.beginRate","id":"594bc655-cbf0-4e81-8fcc-b0f001e71fc4","savedPayload":{"position":{"x":17559.812811051106,"y":17404.255856766173},"targetPosition":{"x":17682.929058287675,"y":17314.779916112333},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"3b122c9b-56d5-4cb6-86ba-12d1919aeeba","savedPayload":{"position":{"x":17682.929058287675,"y":17314.779916112333},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Right End Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.endRate","id":"ef80ea85-cfba-4fa6-9646-3688f54f33ba","savedPayload":{"position":{"x":17471.19138675442,"y":17194.69143255407},"targetPosition":{"x":17626.75845169068,"y":17168.19886074358},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"eb3dd27b-831c-47ae-8a19-1b01626add98","savedPayload":{"position":{"x":17626.75845169068,"y":17168.19886074358},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Left Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"cdc9f3f0-3bca-4c9c-901f-1371aad3dcfe","savedPayload":{"position":{"x":17512.304665703115,"y":16951.495779974663},"targetPosition":{"x":17651.23772812136,"y":17013.176475755023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"b61fa42b-45d1-416b-b06b-734d33223a80","savedPayload":{"position":{"x":17651.23772812136,"y":17013.176475755023},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Right Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"c450be56-8c02-4039-9b4a-8e0bde52fcc6","savedPayload":{"position":{"x":17660.705750514484,"y":16768.20122353827},"targetPosition":{"x":17750.10806652973,"y":16891.087536519743},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"467129cb-1aa4-4639-ab0f-74d14146f721","savedPayload":{"position":{"x":17750.10806652973,"y":16891.087536519743},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"774f0a60-aa67-408f-9768-8a24f5b9c033","savedPayload":{"position":{"x":17928.299965145343,"y":17136.367795817783},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"Profit Triangle","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.ROI > 0","id":"09130c24-6a0d-4cff-9ad6-b1604e0958db","savedPayload":{"position":{"x":17508.212794348914,"y":17100.412058590595},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBody":{"type":"Polygon Body","name":"New Polygon Body","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"9c174ed4-ecb1-4ab9-8baf-af590e699f63","savedPayload":{"position":{"x":16806.84198075209,"y":16949.617455331252},"targetPosition":{"x":17405.769112934646,"y":16859.537179671042},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"5afd2ce2-aa5c-45fc-9812-cd2269ef83e7","savedPayload":{"position":{"x":17405.769112934646,"y":16859.537179671042},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.PATINATED_TURQUOISE\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"b0ad97ca-daf8-49a7-b592-6a3b3384140f","savedPayload":{"position":{"x":16847.460539786953,"y":16412.67214155363},"targetPosition":{"x":17426.209971051427,"y":16591.124423880334},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"4ed86298-5484-4d9d-9d58-ef75d71bc219","savedPayload":{"position":{"x":17426.209971051427,"y":16591.124423880334},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Left Begin Rate","id":"3421959f-9a3a-4822-a6cf-eed20fdcbc87","savedPayload":{"position":{"x":17560.98977953688,"y":16357.646260805954},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Left Begin Rate","id":"407ce9a9-7029-46be-a2cc-7f5469f13079"}}},{"type":"Polygon Vertex","name":"Right Begin Rate","id":"98bb0b7d-76aa-4a56-a49c-e7764f22d45e","savedPayload":{"position":{"x":17803.003404904543,"y":16189.49794108436},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right Begin Rate","id":"3b122c9b-56d5-4cb6-86ba-12d1919aeeba"}}},{"type":"Polygon Vertex","name":"Right End Rate","id":"f3f4e892-faf4-446c-99c6-b02b6605b45e","savedPayload":{"position":{"x":18050.30430237246,"y":16165.731050672892},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right End Rate","id":"eb3dd27b-831c-47ae-8a19-1b01626add98"}}}],"id":"eef83f44-b389-47bd-9f24-0401224383ad","savedPayload":{"position":{"x":18005.26702883684,"y":16769.757808755086},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Loss Triangle","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.ROI <= 0","id":"992e9a1d-1f15-4771-aee9-9a7a9cd87190","savedPayload":{"position":{"x":17678.410099788194,"y":16500.579215735932},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBody":{"type":"Polygon Body","name":"New Polygon Body","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"a2e70810-31b6-4e72-aefa-e9f97b486321","savedPayload":{"position":{"x":17189.605296380054,"y":15977.013124190677},"targetPosition":{"x":17727.116731287002,"y":16256.057727628699},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"69de7ba1-c408-465f-b0dd-11e5e1838b04","savedPayload":{"position":{"x":17727.116731287002,"y":16256.057727628699},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RUSTED_RED\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"81d435e8-942b-414c-a289-8e3c4d13af00","savedPayload":{"position":{"x":17557.317296137055,"y":15549.257237837566},"targetPosition":{"x":17920.528405997975,"y":16033.873934022049},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"b5bd2f82-5b84-4edd-86c5-c93a52863cda","savedPayload":{"position":{"x":17920.528405997975,"y":16033.873934022049},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Left Begin Rate","id":"c607b5e9-c344-4255-ab3c-5b9d10fba687","savedPayload":{"position":{"x":18166.740156822572,"y":15924.313606025213},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Left Begin Rate","id":"407ce9a9-7029-46be-a2cc-7f5469f13079"}}},{"type":"Polygon Vertex","name":"Right Begin Rate","id":"64709527-68e2-4b4e-a3e0-36c09f6d3d47","savedPayload":{"position":{"x":18436.356758448062,"y":15932.34894658229},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right Begin Rate","id":"3b122c9b-56d5-4cb6-86ba-12d1919aeeba"}}},{"type":"Polygon Vertex","name":"Right End Rate","id":"3d4f8600-db77-4d5a-b611-ed4362f9c57c","savedPayload":{"position":{"x":18675.296351777983,"y":16056.68726293789},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right End Rate","id":"eb3dd27b-831c-47ae-8a19-1b01626add98"}}}],"id":"d209356a-e336-4246-ad54-0f8260af21f5","savedPayload":{"position":{"x":18283.817663488924,"y":16518.84364245915},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 2,\n \"lineDash\": [3,3]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 3,\n \"lineDash\": [3,3]\n }\n}","id":"bc128809-8c93-4f5d-9de9-4e0b28c1132e","savedPayload":{"position":{"x":17996.798727082783,"y":15463.5617234319},"targetPosition":{"x":18326.500935290005,"y":15971.57768560358},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"cbd2cb8e-ca62-4b68-9bca-11ad55e50fb1","savedPayload":{"position":{"x":18326.500935290005,"y":15971.57768560358},"targetPosition":{"x":18656.297749163605,"y":16479.606906468733},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Left Rate","id":"e1fc573d-a98e-4801-af1f-08f56d98a78a","savedPayload":{"position":{"x":18782.196907195565,"y":15886.940584070182},"targetPosition":{"x":18656.297749163605,"y":16479.606906468733},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Left Rate","id":"b61fa42b-45d1-416b-b06b-734d33223a80"}}},{"type":"Polygon Vertex","name":"Right Rate","id":"72aece06-d0ac-4068-8310-7037f0ba4943","savedPayload":{"position":{"x":19163.973820423496,"y":16149.803684642702},"targetPosition":{"x":18656.297749163605,"y":16479.606906468733},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right Rate","id":"467129cb-1aa4-4639-ab0f-74d14146f721"}}}],"id":"543ebae2-5624-49ad-a00f-df63335e92a9","savedPayload":{"position":{"x":18656.297749163605,"y":16479.606906468733},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[],"texts":[],"id":"d99cb56a-d182-4672-9e89-54bb809eff30","savedPayload":{"position":{"x":17111.46667970463,"y":18071.533352459584},"targetPosition":{"x":17812.58072854168,"y":17883.69594637972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Position Object","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"482e894d-68a1-499f-b55e-97827c1df506","savedPayload":{"position":{"x":16344.55127035604,"y":17538.86264416792},"targetPosition":{"x":16578.03234600345,"y":17397.519384424242},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"5a612794-8d2e-4689-82ce-f6bdcba13755","savedPayload":{"position":{"x":16578.03234600345,"y":17397.519384424242},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"d1f7c811-2a35-44a0-8908-2076f59ab2ad","savedPayload":{"position":{"x":16263.226725107257,"y":17358.71082279012},"targetPosition":{"x":16523.893400509034,"y":17277.482487705278},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"32444aa5-bc40-4905-97e7-f795118fc229","savedPayload":{"position":{"x":16523.893400509034,"y":17277.482487705278},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"8ae3f86b-d0f8-4851-a477-02d0960fb4e5","savedPayload":{"position":{"x":16227.485201328978,"y":17164.50744548454},"targetPosition":{"x":16500.10335815215,"y":17148.117164896397},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"8fd749c8-cdc1-4a20-8901-d22fdd70612d","savedPayload":{"position":{"x":16500.10335815215,"y":17148.117164896397},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"d6677f18-96af-4d73-aadc-034d146b9422","savedPayload":{"position":{"x":16239.325116034515,"y":16968.04723729689},"targetPosition":{"x":16507.997410219734,"y":17017.170607516975},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"1972711b-2740-49d7-8323-f24ffa3751b5","savedPayload":{"position":{"x":16507.997410219734,"y":17017.170607516975},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"b97f9930-22b1-4e18-9d12-f2adc9de796d","savedPayload":{"position":{"x":16298.020283950911,"y":16779.626047091817},"targetPosition":{"x":16547.10571076544,"y":16891.649102700107},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"08193c38-6100-40cf-84e9-533cd29ca463","savedPayload":{"position":{"x":16547.10571076544,"y":16891.649102700107},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Enter Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.beginRate","id":"c7d06e13-042f-4e12-8093-b9f27dc8e655","savedPayload":{"position":{"x":16400.11070878058,"y":16610.73689319927},"targetPosition":{"x":16615.104606978544,"y":16779.164378755246},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"67fb7b91-c601-48dd-9d79-5188dc43a921","savedPayload":{"position":{"x":16615.104606978544,"y":16779.164378755246},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Exit Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.endRate","id":"4f114564-7657-4037-9f5e-43e2fcfb75a5","savedPayload":{"position":{"x":16539.658420718075,"y":16471.22905155678},"targetPosition":{"x":16708.059399446844,"y":16686.247293617755},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"a0921f86-e8f0-40d9-99ee-0a316dd6ad67","savedPayload":{"position":{"x":16708.059399446844,"y":16686.247293617755},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"48b097fa-bc1f-4cd9-bcf4-284bd77c5055","savedPayload":{"position":{"x":16708.56239326696,"y":16369.140054796615},"targetPosition":{"x":16820.56907229024,"y":16618.242580647875},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"5e243e8e-1909-4a9d-a605-984e530846c3","savedPayload":{"position":{"x":16820.56907229024,"y":16618.242580647875},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"0cea2f32-e0b8-4011-8389-eb24536ec638","savedPayload":{"position":{"x":16896.921171893748,"y":16310.486788681716},"targetPosition":{"x":16946.0188712005,"y":16579.17595283503},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"b98c147d-3f4d-41d6-b821-df00d7eeab29","savedPayload":{"position":{"x":16946.0188712005,"y":16579.17595283503},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"95d9e4b7-2951-4dac-b0e6-c9cdb77cd0b9","savedPayload":{"position":{"x":17093.342140783232,"y":16298.635442369521},"targetPosition":{"x":17076.954776665025,"y":16571.272834480347},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"298d34c8-3b72-4c1f-92bd-b3e2c2f3e73e","savedPayload":{"position":{"x":17076.954776665025,"y":16571.272834480347},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"ROI","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.ROI + ' %'","id":"fa6fe36b-a358-41c8-a08b-163d9f616418","savedPayload":{"position":{"x":17287.503964595555,"y":16334.331726254826},"targetPosition":{"x":17206.295529306804,"y":16595.027813167075},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"3717a1ab-38b7-40be-a2bf-b9645f8304d1","savedPayload":{"position":{"x":17206.295529306804,"y":16595.027813167075},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Profit Loss","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.profitLoss","id":"e1e8520b-a586-4471-8ee5-757a50f66937","savedPayload":{"position":{"x":17467.68104069268,"y":16415.65576929408},"targetPosition":{"x":17326.355719794105,"y":16649.163905507714},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"bed68193-cced-4a58-88d2-6a9a29a48a09","savedPayload":{"position":{"x":17326.355719794105,"y":16649.163905507714},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"3d274e02-8896-4311-a0c8-9041b6507090","savedPayload":{"position":{"x":17044.077904364167,"y":17115.227723975244},"targetPosition":{"x":17812.58072854168,"y":17883.69594637972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":4,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"a"}}}],"id":"8854b5f8-8407-4a0d-9099-5456a8e4cced","savedPayload":{"position":{"x":17812.5068361944,"y":17883.64016286816},"targetPosition":{"x":18515.28409408331,"y":18071.836287948023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Stop Loss","config":"{ \n \"codeName\": \"Module-Name\", \n \"icon\": \"histogram|band|moving-average|oscillator|trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.stopLoss","id":"eeef1100-0dcc-4367-99f1-b23a5e98b2ff","savedPayload":{"position":{"x":16842.671623828264,"y":17740.23018646569},"targetPosition":{"x":16861.448121478243,"y":17561.59385043039},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7d0349ba-640b-43f2-b500-d62c06fecd81","savedPayload":{"position":{"x":16861.448121478243,"y":17561.59385043039},"targetPosition":{"x":16880.190544956877,"y":17383.058599947264},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.stopLoss","id":"79f690f8-360a-49a8-9df0-bc42d1975099","savedPayload":{"position":{"x":16589.517962810092,"y":17172.400657616126},"targetPosition":{"x":16734.930578396874,"y":17277.776650077023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a4c015cf-419c-44f6-9816-6828e5fbc3c3","savedPayload":{"position":{"x":16734.930578396874,"y":17277.776650077023},"targetPosition":{"x":16880.190544956877,"y":17383.058599947264},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fdf923e9-1d23-41c0-9210-38d35313c4ab","savedPayload":{"position":{"x":16880.190544956877,"y":17383.058599947264},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.stopLoss > 0","id":"b8677c90-5e19-402b-b494-d2cce015c167","savedPayload":{"position":{"x":16300.010038191633,"y":17422.013101737135},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.5,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.8,\n \"lineWidth\": 3,\n \"lineDash\": [0,0]\n }\n}","id":"1eee2eba-1af0-4cc0-ad50-22ac23a10dac","savedPayload":{"position":{"x":15406.610604335867,"y":17091.877487433383},"targetPosition":{"x":16119.773760377167,"y":17017.027143998228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"83ae727f-2dc3-4153-9b7f-2bee0748e134","savedPayload":{"position":{"x":16119.773760377167,"y":17017.027143998228},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"ac7ed016-4516-4ebc-a902-95e97ace1f55","savedPayload":{"position":{"x":16211.932016036772,"y":16583.65969878302},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"7d0349ba-640b-43f2-b500-d62c06fecd81"}}},{"type":"Polygon Vertex","name":"End","id":"6f873316-c57a-48b4-80c7-362f823d37b4","savedPayload":{"position":{"x":16541.25795070935,"y":16287.020235152382},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"a4c015cf-419c-44f6-9816-6828e5fbc3c3"}}}],"id":"9d351f29-6a3e-4c2b-b008-ebe1414d2aa8","savedPayload":{"position":{"x":16833.019272168123,"y":16942.190492049853},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"placeholder\", \n\"size\": 15\n}","imageCondition":{"type":"Image Condition","name":"New Image Condition","code":"(record.positions !== record.previous.positions && record.stopLossPhase >= 0 ) || \n(record.stopLossPhase !== record.previous.stopLossPhase && record.stopLossPhase >= 0 ) ","id":"ef8dedb9-454b-423b-94e7-1a522047aa12","savedPayload":{"position":{"x":16713.418943468772,"y":16447.04163221855},"targetPosition":{"x":17054.858926148445,"y":16557.968929744457},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"860a9f6e-cc9d-46fb-83d6-fb908e12a30f","savedPayload":{"position":{"x":16980.085427109345,"y":16206.76485512808},"targetPosition":{"x":17054.858926148445,"y":16557.968929744457},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"7d0349ba-640b-43f2-b500-d62c06fecd81"}}},"id":"d4a99750-dd06-453f-a126-ac48c25372ab","savedPayload":{"position":{"x":17054.858926148445,"y":16557.968929744457},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[{"type":"Text","name":"New Text","config":"{ \n\"codeName\": \"\", \n\"fontSize\": 10\n}","textCondition":{"type":"Text Condition","name":"New Text Condition","code":"(record.positions !== record.previous.positions && record.stopLossPhase >= 0 ) || \n(record.stopLossPhase !== record.previous.stopLossPhase && record.stopLossPhase >= 0 ) ","id":"8e0eb7c3-171a-4fc3-a3e4-3c67bb772343","savedPayload":{"position":{"x":17149.473362706292,"y":16197.920239878069},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"textPosition":{"type":"Text Position","name":"New Text Position","config":"{ \n\"offsetX\": -3,\n \"offsetY\": -15\n }","id":"817671c1-fd3f-43ff-9670-9c3bcb94b8fb","savedPayload":{"position":{"x":17314.31860774061,"y":16049.40651653333},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"7d0349ba-640b-43f2-b500-d62c06fecd81"}}},"textFormula":{"type":"Text Formula","name":"New Text Formula","code":"record.stopLossPhase","id":"ccafd036-b292-48b1-847e-6735a3eb8253","savedPayload":{"position":{"x":17534.833041404472,"y":16026.22723709306},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"textStyle":{"type":"Text Style","name":"New Text Style","config":"{\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.5,\n \"fontSize\": 10\n}","id":"42f9061a-9d2a-4d3f-9f7a-c47c9e6e0601","savedPayload":{"position":{"x":17727.050321102848,"y":16137.258453898201},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"7e69ccc1-a9f7-4a64-aeaa-344eb46f63f7","savedPayload":{"position":{"x":17460.28925510178,"y":16377.50853732651},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"41dd1d86-998c-46d7-a37e-1a1508fd8b51","savedPayload":{"position":{"x":17535.18262748896,"y":17091.416855311403},"targetPosition":{"x":18156.157040042133,"y":17449.895554588373},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Stop Loss Panel","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Position #","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.positions","id":"fdaab5ea-7f88-4b52-9b80-725f069907d9","savedPayload":{"position":{"x":19649.47370714368,"y":16652.494912974747},"targetPosition":{"x":19664.92994619471,"y":16803.775422333543},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"96d6bda9-5520-4690-8230-26ade54edcf1","savedPayload":{"position":{"x":19664.92994619471,"y":16803.775422333543},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Stop Loss","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.stopLoss","id":"1a5679d8-426b-4789-ac5b-c8d9c3a18fd8","savedPayload":{"position":{"x":20016.9086483935,"y":16584.234375668966},"targetPosition":{"x":19865.816218203458,"y":16846.029452773946},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f590d585-66dd-47b9-99e8-38d081a1d1a0","savedPayload":{"position":{"x":19865.816218203458,"y":16846.029452773946},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Stop Loss Phase","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.stopLossPhase","id":"9067e496-6c73-4ada-b403-6a097667f8a2","savedPayload":{"position":{"x":20142.2942465611,"y":16937.706493503778},"targetPosition":{"x":20003.30586732554,"y":16999.4685764315},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"e78ebe16-bfdc-4814-b334-5aad14fbf307","savedPayload":{"position":{"x":20003.30586732554,"y":16999.4685764315},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Stop Loss Stage","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.stopLossStage","id":"1eb68ffb-5a03-4b8f-a53f-0f120d52fa20","savedPayload":{"position":{"x":20173.5478441854,"y":17235.847522829},"targetPosition":{"x":20025.483673926177,"y":17204.352612369985},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"d84a629b-9ff1-4f24-aa41-55c18746cc10","savedPayload":{"position":{"x":20025.483673926177,"y":17204.352612369985},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"1b6d3bd0-e594-4b09-9f1c-021177676d84","savedPayload":{"position":{"x":18156.84519405295,"y":16729.432709689627},"targetPosition":{"x":18156.157040042133,"y":17449.895554588373},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"9b8e4fc2-b62a-4d47-ac5f-08818e463da2","savedPayload":{"position":{"x":18151.550931007023,"y":17441.76597060283},"targetPosition":{"x":18515.28409408331,"y":18071.836287948023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Take Profit","config":"{ \n \"codeName\": \"Module-Name\", \n \"icon\": \"histogram|band|moving-average|oscillator|trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.takeProfit","id":"4e73522f-8830-4026-8aa9-aa20558e6bb0","savedPayload":{"position":{"x":19415.49387898067,"y":16720.025835359218},"targetPosition":{"x":19565.429129047734,"y":16743.827061564545},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"9baaa58e-af64-4348-9320-fad9823153a9","savedPayload":{"position":{"x":19565.429129047734,"y":16743.827061564545},"targetPosition":{"x":19715.2034702125,"y":16767.59453243179},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.takeProfit","id":"f7740d4c-0742-4f8b-8ad3-b7fec1e92066","savedPayload":{"position":{"x":19905.77941449536,"y":16531.508612113714},"targetPosition":{"x":19810.429532919767,"y":16649.641367063516},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"bcbd8777-10f8-46a6-ba09-4d635570057d","savedPayload":{"position":{"x":19810.429532919767,"y":16649.641367063516},"targetPosition":{"x":19715.2034702125,"y":16767.59453243179},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fc2dda29-1eb7-4f6f-8527-2e54ba32bb8b","savedPayload":{"position":{"x":19715.2034702125,"y":16767.59453243179},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.takeProfit > 0","id":"b96a45dc-f0db-4c23-8f66-081302ea7bbf","savedPayload":{"position":{"x":20511.466304648693,"y":16643.34461130715},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.5,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.8,\n \"lineWidth\": 3,\n \"lineDash\": [0,0]\n }\n}","id":"5033856c-d71d-4608-a6f2-347ef82d8591","savedPayload":{"position":{"x":20026.415230713515,"y":15538.253488453214},"targetPosition":{"x":20057.92178029763,"y":16143.136733666997},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"1e3604e1-777b-4344-a47a-d3fefa10014b","savedPayload":{"position":{"x":20057.92178029763,"y":16143.136733666997},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"74cef8d6-de4c-464d-8c00-97a88227f626","savedPayload":{"position":{"x":20419.211757524103,"y":16240.084287568208},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"9baaa58e-af64-4348-9320-fad9823153a9"}}},{"type":"Polygon Vertex","name":"End","id":"e3c98070-e46c-4d6d-9079-2b9d556722cc","savedPayload":{"position":{"x":20654.98218018517,"y":16530.877841245107},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"bcbd8777-10f8-46a6-ba09-4d635570057d"}}}],"id":"a0b598d2-cdb6-4ce7-96c5-ef3317ae1768","savedPayload":{"position":{"x":20089.21096362513,"y":16747.251112400245},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"placeholder\", \n\"size\": 15\n}","imageCondition":{"type":"Image Condition","name":"New Image Condition","code":"(record.positions !== record.previous.positions && record.takeProfitPhase >= 0 ) || \n(record.takeProfitPhase !== record.previous.takeProfitPhase && record.takeProfitPhase >= 0 ) ","id":"a404c20d-5c4d-4505-81f0-263987496ba0","savedPayload":{"position":{"x":20512.20938711901,"y":16668.018452495136},"targetPosition":{"x":20403.512265858364,"y":16951.357870928146},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"c1ed6b36-4dd8-4ff5-ae66-6c6878b4edc1","savedPayload":{"position":{"x":20703.198573515907,"y":16903.615110005092},"targetPosition":{"x":20403.512265858364,"y":16951.357870928146},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"9baaa58e-af64-4348-9320-fad9823153a9"}}},"id":"0da5f29a-4847-460d-b982-68b8d5cc7fe5","savedPayload":{"position":{"x":20403.512265858364,"y":16951.357870928146},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[{"type":"Text","name":"New Text","config":"{ \n\"codeName\": \"\", \n\"fontSize\": 10\n}","textCondition":{"type":"Text Condition","name":"New Text Condition","code":"(record.positions !== record.previous.positions && record.takeProfitPhase >= 0 ) || \n(record.takeProfitPhase !== record.previous.takeProfitPhase && record.takeProfitPhase >= 0 ) ","id":"81c4f7bc-db04-4c61-a8e8-5a4a6308dda0","savedPayload":{"position":{"x":20703.245794640465,"y":17047.033493203206},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"textPosition":{"type":"Text Position","name":"New Text Position","config":"{ \n\"offsetX\": -3,\n \"offsetY\": -15\n }","id":"5833e42f-c848-4271-9e20-f48d5a98929a","savedPayload":{"position":{"x":20821.352886089888,"y":17192.68085475197},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"9baaa58e-af64-4348-9320-fad9823153a9"}}},"textFormula":{"type":"Text Formula","name":"New Text Formula","code":"record.takeProfitPhase","id":"00f3fb76-f50d-4879-b1d2-49c51824aef9","savedPayload":{"position":{"x":20831.184890390687,"y":17379.752666526765},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"textStyle":{"type":"Text Style","name":"New Text Style","config":"{\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.5,\n \"fontSize\": 10\n}","id":"e4d1b248-ee99-42e0-9c77-18b9792b6631","savedPayload":{"position":{"x":20729.001095906126,"y":17537.001955971362},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"f26f4f43-95e1-406d-94e8-7c818e363777","savedPayload":{"position":{"x":20537.92810576854,"y":17301.399044121554},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"95465ef6-b26a-4ca3-817c-26b50e9ef8e0","savedPayload":{"position":{"x":19932.270540929123,"y":17333.180224227115},"targetPosition":{"x":19602.42862857182,"y":17841.350260979136},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Take Profit Panel","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Position #","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.positions","id":"c3aae579-7115-4e4c-bd43-829dea52a70f","savedPayload":{"position":{"x":20493.415203086817,"y":17519.82532581814},"targetPosition":{"x":20398.001422792637,"y":17637.514766308912},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"57d30bfc-893d-4e50-9cda-ee544fdae1e1","savedPayload":{"position":{"x":20398.001422792637,"y":17637.514766308912},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Take Profit","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.takeProfit","id":"64f4a076-de71-444a-a543-f62da7701e6f","savedPayload":{"position":{"x":20793.59376844515,"y":17716.512716110563},"targetPosition":{"x":20500.382585806416,"y":17794.725585927186},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"321eb006-13d4-4f66-aeab-f6fd2aa4758b","savedPayload":{"position":{"x":20500.382585806416,"y":17794.725585927186},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Take Profit Phase","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.takeProfitPhase","id":"0e3f0594-6a97-4e2e-a261-84be8b4ef02c","savedPayload":{"position":{"x":20632.3147274449,"y":18036.17669590365},"targetPosition":{"x":20490.477115362995,"y":17981.740036370767},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"eccb236b-4d20-4df2-9810-543bfbb3fc25","savedPayload":{"position":{"x":20490.477115362995,"y":17981.740036370767},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Take Profit Stage","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.takeProfitStage","id":"4ed86294-eeef-476c-a723-e469189a3f03","savedPayload":{"position":{"x":20454.963348189536,"y":18254.910990604796},"targetPosition":{"x":20372.332315474712,"y":18127.49391019403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"2a6d62db-bf02-4319-86bf-27e52fad0423","savedPayload":{"position":{"x":20372.332315474712,"y":18127.49391019403},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"33aa2293-7958-4cc3-bb41-fc97c17ccd67","savedPayload":{"position":{"x":20207.32141798083,"y":17873.033867520408},"targetPosition":{"x":19602.42862857182,"y":17841.350260979136},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"78a2df79-8912-44d7-a8c7-4b6a0a7235c2","savedPayload":{"position":{"x":18703.415273635386,"y":17369.056734620204},"targetPosition":{"x":18515.28409408331,"y":18071.836287948023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"cd6f9452-2cce-424d-8059-e3b312f627c4","savedPayload":{"position":{"x":18515.28409408331,"y":18071.836287948023},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Exchange Orders","config":"{ \n \"codeName\": \"Exchange-Orders\"\n}","modules":[{"type":"Plotter Module","name":"Market Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"bc2c1fb7-af45-4444-b883-7523eb94bcc0","savedPayload":{"position":{"x":18440.010197369746,"y":18315.673531983128},"targetPosition":{"x":18278.78037160947,"y":17952.316211547997},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5d2c59a6-72ce-4f42-8d14-62e4a7d11d73","savedPayload":{"position":{"x":18278.78037160947,"y":17952.316211547997},"targetPosition":{"x":18117.604269900297,"y":17589.249761269108},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"76027de9-5f42-494b-be42-7b24e7663fb4","savedPayload":{"position":{"x":17649.74527982425,"y":18232.596969099643},"targetPosition":{"x":17883.647782487562,"y":17910.908140283667},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0e224c82-a863-4953-8e38-42ff372df6cd","savedPayload":{"position":{"x":17883.647782487562,"y":17910.908140283667},"targetPosition":{"x":18117.604269900297,"y":17589.249761269108},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"c8f9bc68-22a9-47a7-8b54-f8e1ee93760a","savedPayload":{"position":{"x":18117.604269900297,"y":17589.249761269108},"targetPosition":{"x":18159.25181942883,"y":17193.906899228587},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"a307230c-ee14-4b3a-8430-5993da0e1b7e","savedPayload":{"position":{"x":17144.86869150668,"y":17652.671477763666},"targetPosition":{"x":17454.039991142112,"y":17402.50459278434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"2c437c94-96f4-4b5b-9241-45636f73356e","savedPayload":{"position":{"x":17454.039991142112,"y":17402.50459278434},"targetPosition":{"x":17763.28722723131,"y":17152.317510279827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"7d4ca25c-5454-4d6a-8ead-a4ecee6709b8","savedPayload":{"position":{"x":17367.542610641038,"y":17110.774367223716},"targetPosition":{"x":17763.28722723131,"y":17152.317510279827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"5d2c59a6-72ce-4f42-8d14-62e4a7d11d73"}}},{"type":"Polygon Vertex","name":"End","id":"cefe7159-5b2f-4036-9aad-1d72358cbf81","savedPayload":{"position":{"x":17512.880846274402,"y":16843.13185902001},"targetPosition":{"x":17763.28722723131,"y":17152.317510279827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"0e224c82-a863-4953-8e38-42ff372df6cd"}}}],"id":"6217d021-ea5b-4b20-b093-758a2d2fb5d4","savedPayload":{"position":{"x":17763.28722723131,"y":17152.317510279827},"targetPosition":{"x":18159.25181942883,"y":17193.906899228587},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"market-order\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"48799848-30ad-4ef3-914e-45c3299168da","savedPayload":{"position":{"x":18220.928150308875,"y":16599.908712777175},"targetPosition":{"x":18200.4890453258,"y":16798.046780247023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"5d2c59a6-72ce-4f42-8d14-62e4a7d11d73"}}},"id":"c988d815-94cf-48e3-9447-2e81b97271b2","savedPayload":{"position":{"x":18200.4890453258,"y":16798.046780247023},"targetPosition":{"x":18159.25181942883,"y":17193.906899228587},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"486a0f30-691f-4c40-a18e-a1b0ac336ac1","savedPayload":{"position":{"x":18159.25181942883,"y":17193.906899228587},"targetPosition":{"x":18948.961479998656,"y":17276.86251661238},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Market Buy Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"6c10223a-aec1-485d-a731-2122a2485359","savedPayload":{"position":{"x":18783.141325577137,"y":16509.538560666882},"targetPosition":{"x":18914.41877571862,"y":16659.54503161315},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"6edbd7e7-a5ef-4ec0-ae1d-41c6a7cec5e1","savedPayload":{"position":{"x":18914.41877571862,"y":16659.54503161315},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"706b3e18-b354-4b2d-ad94-8a1e06aa3d6a","savedPayload":{"position":{"x":18801.938070469558,"y":16253.401215336313},"targetPosition":{"x":18990.671861414667,"y":16603.95216847281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"312fc9a8-af5d-428b-b1b9-9207bf4def4d","savedPayload":{"position":{"x":18990.671861414667,"y":16603.95216847281},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"d304ece3-18dc-4e5a-bc0e-1249258b184e","savedPayload":{"position":{"x":18968.82226032012,"y":16185.662863746667},"targetPosition":{"x":19074.679904108307,"y":16569.48156712685},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"8313aeb6-6167-45ca-a3ca-4dc22b7fa33a","savedPayload":{"position":{"x":19074.679904108307,"y":16569.48156712685},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"6823da7b-b937-44ec-a748-6544810c5e4d","savedPayload":{"position":{"x":19146.059230944255,"y":16157.138309028162},"targetPosition":{"x":19163.79741436621,"y":16554.944636293047},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"bdc187a2-01a2-4d5e-a3b6-e03a3aa83337","savedPayload":{"position":{"x":19163.79741436621,"y":16554.944636293047},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"df586a2e-5e92-4719-b43a-b66e92d54cfb","savedPayload":{"position":{"x":19324.593262908165,"y":16169.038135250714},"targetPosition":{"x":19253.632735275824,"y":16560.858844045848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"8c832572-6989-49fe-af66-337113d833bd","savedPayload":{"position":{"x":19253.632735275824,"y":16560.858844045848},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"ccaa9e2b-3d64-40fc-85e3-db8852ffe835","savedPayload":{"position":{"x":19496.153546415142,"y":16220.456397190967},"targetPosition":{"x":19339.759646546278,"y":16586.628646084635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"008d9794-b703-4e95-90a5-4be6541257b5","savedPayload":{"position":{"x":19339.759646546278,"y":16586.628646084635},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"cb7fe638-c8c1-4017-91c5-332f2a42d411","savedPayload":{"position":{"x":19651.883887717984,"y":16308.780685172373},"targetPosition":{"x":19417.90303766755,"y":16630.940519830892},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"233fcc31-94fb-4a83-8010-a47b06aa0175","savedPayload":{"position":{"x":19417.90303766755,"y":16630.940519830892},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"b205501c-00a5-42a5-bfb1-e1d766474e9b","savedPayload":{"position":{"x":19784.02636211265,"y":16429.52933407454},"targetPosition":{"x":19484.203320342564,"y":16691.5124198605},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"ef885584-c0ad-42ab-af01-1507c16da1c1","savedPayload":{"position":{"x":19484.203320342564,"y":16691.5124198605},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"14e3004b-320d-4791-aa6e-3f0d872ec7ec","savedPayload":{"position":{"x":19885.97450484608,"y":16576.64410295631},"targetPosition":{"x":19535.35564391014,"y":16765.30937068897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0d50ad49-9842-4e0e-86fd-12c026ada170","savedPayload":{"position":{"x":19535.35564391014,"y":16765.30937068897},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"8a56fba9-5ffc-4adf-8d6e-021fd4e5a43c","savedPayload":{"position":{"x":19952.638026080527,"y":16742.743481819143},"targetPosition":{"x":19568.809227936134,"y":16848.63320352723},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d6c7e18a-79da-4aed-8fae-298e604e05d0","savedPayload":{"position":{"x":19568.809227936134,"y":16848.63320352723},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"17dd754a-3ce8-470e-8351-0367bbc0eed2","savedPayload":{"position":{"x":19980.672859572293,"y":16919.50009617156},"targetPosition":{"x":19582.90047919128,"y":16937.311714734573},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a5c23ae8-7ff3-46a8-8f7f-c1ef46580415","savedPayload":{"position":{"x":19582.90047919128,"y":16937.311714734573},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"43a37c5e-0519-4920-9c61-1c8e7ee35308","savedPayload":{"position":{"x":19968.586492220402,"y":17097.721391559066},"targetPosition":{"x":19576.820286617793,"y":17026.885079106778},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"64741d06-09d2-497f-ab50-f1a0d1eba4bd","savedPayload":{"position":{"x":19576.820286617793,"y":17026.885079106778},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"d7dd0006-3d9f-49c8-984a-07b9d5f0dc48","savedPayload":{"position":{"x":19911.14073972588,"y":17278.67741172922},"targetPosition":{"x":19545.03963639315,"y":17122.705948316907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d411dc1c-83d7-4d2d-948e-c90f9e29121b","savedPayload":{"position":{"x":19545.03963639315,"y":17122.705948316907},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"12929733-5964-4948-877b-b1edda37162a","savedPayload":{"position":{"x":19182.324014173064,"y":16955.24321665635},"targetPosition":{"x":18948.961479998656,"y":17276.86251661238},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"e00fe7d4-894d-4483-a73a-3cd77943ea80","savedPayload":{"position":{"x":18949.091378017827,"y":17276.111636656784},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Market Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"df7ab0aa-4814-411b-a2f6-9594f67c7b41","savedPayload":{"position":{"x":18416.10033964062,"y":17766.67011168099},"targetPosition":{"x":18498.953957112702,"y":17378.023154985764},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"788a8d38-a7f8-4e9f-aa91-0d73d83967ba","savedPayload":{"position":{"x":18498.953957112702,"y":17378.023154985764},"targetPosition":{"x":18581.744366086998,"y":16989.196366677166},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"464d3c72-0056-48b0-b044-9131f136797f","savedPayload":{"position":{"x":17824.955995036587,"y":17234.5889128649},"targetPosition":{"x":18203.35723841807,"y":17111.806103185343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5c7415c1-6a1d-4838-8587-6883c11724b4","savedPayload":{"position":{"x":18203.35723841807,"y":17111.806103185343},"targetPosition":{"x":18581.744366086998,"y":16989.196366677166},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"2e23d19b-466f-485b-b61d-ded90fa7b221","savedPayload":{"position":{"x":18581.744366086998,"y":16989.196366677166},"targetPosition":{"x":18847.985121184993,"y":16693.8908742562},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"fc7ced4a-bcf0-4c18-9e3b-959e7cac59f6","savedPayload":{"position":{"x":17757.51588029412,"y":16468.554748296723},"targetPosition":{"x":18154.821535546558,"y":16448.034071050406},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"10637dce-3cba-4c02-9561-da3ec43bdf0c","savedPayload":{"position":{"x":18154.821535546558,"y":16448.034071050406},"targetPosition":{"x":18552.166406316264,"y":16427.563643544898},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"210399d5-7817-4136-b2bf-59bc5b5c4eb6","savedPayload":{"position":{"x":18256.50808267463,"y":16161.223423711643},"targetPosition":{"x":18552.166406316264,"y":16427.563643544898},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"788a8d38-a7f8-4e9f-aa91-0d73d83967ba"}}},{"type":"Polygon Vertex","name":"End","id":"912ac4dc-6acb-4097-84e9-cf3d72060597","savedPayload":{"position":{"x":18531.343835488216,"y":16030.228593085923},"targetPosition":{"x":18552.166406316264,"y":16427.563643544898},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"5c7415c1-6a1d-4838-8587-6883c11724b4"}}}],"id":"5b8dcb5c-6b20-4edf-aae5-1c526cdca536","savedPayload":{"position":{"x":18552.166406316264,"y":16427.563643544898},"targetPosition":{"x":18847.985121184993,"y":16693.8908742562},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"template-target\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": -10\n }","id":"5321e00c-41b9-42a6-8e9a-e84067288a6a","savedPayload":{"position":{"x":19247.139121626424,"y":16249.869880913142},"targetPosition":{"x":19114.002774655382,"y":16398.03924935751},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"788a8d38-a7f8-4e9f-aa91-0d73d83967ba"}}},"id":"8ad2d152-57e7-4db6-b810-44bb870c46e2","savedPayload":{"position":{"x":19114.002774655382,"y":16398.03924935751},"targetPosition":{"x":18847.985121184993,"y":16693.8908742562},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"c24bfe41-ef93-4f0a-8c96-843536c85a2f","savedPayload":{"position":{"x":18847.985121184993,"y":16693.8908742562},"targetPosition":{"x":19437.909086266394,"y":17225.12113366464},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Market Sell Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"10079f5d-a713-48f1-9fa4-9a39df035ebd","savedPayload":{"position":{"x":19754.887932664187,"y":16507.023081235093},"targetPosition":{"x":19772.82017246318,"y":16705.465612929882},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"d1a51691-e741-402b-be76-229c27906a79","savedPayload":{"position":{"x":19772.82017246318,"y":16705.465612929882},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"3570f79d-6c3b-484f-b49a-86e44e05f7d0","savedPayload":{"position":{"x":19920.224592973293,"y":16310.789231672052},"targetPosition":{"x":19867.215274776794,"y":16705.366914918584},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7b17e1a2-4305-4b95-aaf1-00fd30502b68","savedPayload":{"position":{"x":19867.215274776794,"y":16705.366914918584},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"209c4655-8c35-4a02-8614-4ad0d2fd08cd","savedPayload":{"position":{"x":20095.048167515255,"y":16354.245409124293},"targetPosition":{"x":19955.424818615054,"y":16726.92979964175},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"81d14ecd-1649-4f2a-ab17-4228fc4ab198","savedPayload":{"position":{"x":19955.424818615054,"y":16726.92979964175},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"5819372f-29a7-455f-b7f1-9eb2ed9511e3","savedPayload":{"position":{"x":20255.179306277973,"y":16435.38753491841},"targetPosition":{"x":20035.988816092893,"y":16767.660256417916},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a2fe7ba5-6897-4208-84d9-91219ccc1761","savedPayload":{"position":{"x":20035.988816092893,"y":16767.660256417916},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"07bbf251-5e4d-4c01-95d8-fc034dd6c5aa","savedPayload":{"position":{"x":20392.946608109036,"y":16549.96569217833},"targetPosition":{"x":20105.264199107532,"y":16825.169196611976},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d4a00ff8-7115-4d3b-94b4-763c67ad67c6","savedPayload":{"position":{"x":20105.264199107532,"y":16825.169196611976},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"b79bb67e-d336-4d83-8246-91022e26270b","savedPayload":{"position":{"x":20501.532549068696,"y":16692.321267807878},"targetPosition":{"x":20159.79467934139,"y":16896.65021843019},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"59af816d-ca55-406a-9888-93232f408389","savedPayload":{"position":{"x":20159.79467934139,"y":16896.65021843019},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"9aa99e17-73be-4a99-940a-783eab7c20a5","savedPayload":{"position":{"x":20575.69402599018,"y":16855.2804421938},"targetPosition":{"x":20197.080321108824,"y":16978.407792032376},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7638f603-1ccd-45a0-b47f-ebf5f1b9b955","savedPayload":{"position":{"x":20197.080321108824,"y":16978.407792032376},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"ac4786f0-503a-460f-902b-6411cc2ae0d8","savedPayload":{"position":{"x":20611.52463144191,"y":17030.63297034157},"targetPosition":{"x":20215.049734361917,"y":17066.40205119344},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2d8825b1-5297-471b-8bd9-985c320293de","savedPayload":{"position":{"x":20215.049734361917,"y":17066.40205119344},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"d90d2c54-711a-4e4c-8978-35707c4739a2","savedPayload":{"position":{"x":20607.60012697259,"y":17209.398554578678},"targetPosition":{"x":20213.016733309843,"y":17156.17187569327},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"56d55a4c-f9cc-49ac-bede-46a16a153816","savedPayload":{"position":{"x":20213.016733309843,"y":17156.17187569327},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"8c94c40d-f6ce-4dae-a021-8c135f6d1717","savedPayload":{"position":{"x":20563.88247443461,"y":17382.94467056126},"targetPosition":{"x":20191.04074999999,"y":17243.217208586553},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2b866c75-bbdd-48c4-a01d-9c41e293bfcc","savedPayload":{"position":{"x":20191.04074999999,"y":17243.217208586553},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"e65731f4-f3ba-482f-b5d2-32b81b7c985f","savedPayload":{"position":{"x":20482.6606146546,"y":17542.26736643583},"targetPosition":{"x":20150.20799839948,"y":17323.153338820626},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"17bd2601-9f0b-4154-af99-d43ece82634a","savedPayload":{"position":{"x":20150.20799839948,"y":17323.153338820626},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"279db641-1837-4e2e-8315-c3d8b8ead3bd","savedPayload":{"position":{"x":20367.89757055834,"y":17679.640583728557},"targetPosition":{"x":20092.70905432908,"y":17392.09973018059},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a87712d5-bc3e-4ba0-8a29-3c702e136d2c","savedPayload":{"position":{"x":20092.70905432908,"y":17392.09973018059},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"f8285da8-bae9-4041-b621-18c91a8e531d","savedPayload":{"position":{"x":20215.044122043484,"y":17792.270819594596},"targetPosition":{"x":20010.633195096325,"y":17450.95010606899},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3d89cd6b-0afb-470e-b60a-a626f35476ff","savedPayload":{"position":{"x":20010.633195096325,"y":17450.95010606899},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d3447547-3afd-4e00-a222-53a35cfeecd5","savedPayload":{"position":{"x":19815.713459062536,"y":17102.26439191507},"targetPosition":{"x":19437.909086266394,"y":17225.12113366464},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a9811005-1b7d-45bb-8003-0e60caab5f09","savedPayload":{"position":{"x":19438.307813163843,"y":17224.62262455821},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"94f80738-6b21-4e8d-8bdf-aa8ef6f8ad4f","savedPayload":{"position":{"x":18718.610777044116,"y":17307.768826372787},"targetPosition":{"x":19014.62087124595,"y":17041.999147361876},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"491e71de-b648-48aa-b493-67ed00359e73","savedPayload":{"position":{"x":19014.62087124595,"y":17041.999147361876},"targetPosition":{"x":19310.194058291483,"y":16776.523983157487},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"57bd54ae-96c8-4d10-bd6d-adf3d705e47e","savedPayload":{"position":{"x":18553.531652887305,"y":16530.69986439463},"targetPosition":{"x":18931.85120480123,"y":16653.56089394305},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"38fccc9b-d822-4598-a156-95c734ec3d6b","savedPayload":{"position":{"x":18931.85120480123,"y":16653.56089394305},"targetPosition":{"x":19310.194058291483,"y":16776.523983157487},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"8901df44-b813-47f3-8ded-4e1f6c68ae8b","savedPayload":{"position":{"x":19310.194058291483,"y":16776.523983157487},"targetPosition":{"x":19699.189542123262,"y":16694.245891682036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"fa856a62-67b2-45b5-a186-a6538b220858","savedPayload":{"position":{"x":18949.554694846647,"y":15871.435140271547},"targetPosition":{"x":19283.021251814815,"y":16088.102505884965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"bb28a0e6-1cb3-4138-95f0-069745242288","savedPayload":{"position":{"x":19283.021251814815,"y":16088.102505884965},"targetPosition":{"x":19616.570962531052,"y":16304.81501412356},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"c4de49da-cd9d-4687-b08b-93f8bba1d454","savedPayload":{"position":{"x":19534.031490976013,"y":15915.533422175922},"targetPosition":{"x":19616.570962531052,"y":16304.81501412356},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"491e71de-b648-48aa-b493-67ed00359e73"}}},{"type":"Polygon Vertex","name":"End","id":"7b269f5c-62d2-4f58-a010-71f1179a3312","savedPayload":{"position":{"x":19833.1471500435,"y":15971.095488754892},"targetPosition":{"x":19616.570962531052,"y":16304.81501412356},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"38fccc9b-d822-4598-a156-95c734ec3d6b"}}}],"id":"7be8ba85-07e7-4800-8988-ce76d2105b73","savedPayload":{"position":{"x":19616.570962531052,"y":16304.81501412356},"targetPosition":{"x":19699.189542123262,"y":16694.245891682036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"help\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"324aa438-7134-4918-b13e-082f3b3078dc","savedPayload":{"position":{"x":20283.1425515481,"y":16569.881754202175},"targetPosition":{"x":20088.428446470483,"y":16611.39030315388},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"491e71de-b648-48aa-b493-67ed00359e73"}}},"id":"89fe166c-e48e-4a0c-b357-149ffa17f2c2","savedPayload":{"position":{"x":20088.428446470483,"y":16611.39030315388},"targetPosition":{"x":19699.189542123262,"y":16694.245891682036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"3ea3861e-f37d-4d78-a45e-9b5fa738aefd","savedPayload":{"position":{"x":19699.189542123262,"y":16694.245891682036},"targetPosition":{"x":19864.068127132065,"y":17470.844315324215},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Limit Buy Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"a6b34df8-eb5f-4900-b6f6-d03e3b290159","savedPayload":{"position":{"x":20542.244039689427,"y":17075.803399332224},"targetPosition":{"x":20440.357147055944,"y":17247.041367963815},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"54f4544e-01f3-467c-ae2b-4768f3727c13","savedPayload":{"position":{"x":20440.357147055944,"y":17247.041367963815},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"72fc83f7-a4cd-4d34-9993-0a60ac61186a","savedPayload":{"position":{"x":20791.779320884918,"y":17014.560966144574},"targetPosition":{"x":20516.70878409209,"y":17302.426097037416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"bc719c08-2115-4a24-aa8d-c70d5befc876","savedPayload":{"position":{"x":20516.70878409209,"y":17302.426097037416},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"37588681-b070-4776-8ab4-9c290bf6d0b6","savedPayload":{"position":{"x":20907.603927036627,"y":17152.33171703652},"targetPosition":{"x":20575.43051295733,"y":17371.65414614221},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"27afb52d-a2c7-416e-b2d9-0d233bb4e209","savedPayload":{"position":{"x":20575.43051295733,"y":17371.65414614221},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"3b216246-bcca-42c6-8370-a1b5676595ba","savedPayload":{"position":{"x":20989.646638211983,"y":17312.169167319822},"targetPosition":{"x":20616.7540111582,"y":17451.912665051826},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3c50bf44-9722-4573-a38f-ddcfee10fb29","savedPayload":{"position":{"x":20616.7540111582,"y":17451.912665051826},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"7094d5cb-d538-45c3-b9e7-75c7c8ec5116","savedPayload":{"position":{"x":21033.743528573854,"y":17485.782494653296},"targetPosition":{"x":20639.125355177217,"y":17539.140401786764},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"75f4fa88-48ad-4448-ae12-42d3168ca3e8","savedPayload":{"position":{"x":20639.125355177217,"y":17539.140401786764},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"65bd507e-8d58-4ed0-9fba-8f7f1fda664b","savedPayload":{"position":{"x":21037.699065377332,"y":17664.526018891436},"targetPosition":{"x":20641.09701916488,"y":17629.009698943322},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0f0014a6-3487-4e6c-8db2-784d5ac939dc","savedPayload":{"position":{"x":20641.09701916488,"y":17629.009698943322},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"88e45b0d-e67c-4031-9ff3-cfe08f9969f0","savedPayload":{"position":{"x":21001.93852722521,"y":17840.06223809468},"targetPosition":{"x":20623.2055910622,"y":17717.051966632273},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"48157935-fa37-4606-81de-7c2c7a0dab18","savedPayload":{"position":{"x":20623.2055910622,"y":17717.051966632273},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"3ab8f2dc-6837-4497-bfa0-9d9020c073d2","savedPayload":{"position":{"x":20927.83733446385,"y":18003.000669639627},"targetPosition":{"x":20586.053900310693,"y":17798.805661445134},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2bf1ef41-7989-4f62-afda-d1f3b513e119","savedPayload":{"position":{"x":20586.053900310693,"y":17798.805661445134},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"a3bc8eb8-2ae4-4c4a-b8ab-c52b96d12389","savedPayload":{"position":{"x":20819.488361070147,"y":18145.308406382603},"targetPosition":{"x":20531.64488816365,"y":17870.219782867523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"137c331a-8dce-4a7c-baaa-8ec3873425fc","savedPayload":{"position":{"x":20531.64488816365,"y":17870.219782867523},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"51d867f0-87fa-42fe-ae34-60a63cc86136","savedPayload":{"position":{"x":20682.026393150543,"y":18259.94866747256},"targetPosition":{"x":20462.726854753862,"y":17927.75106143375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"4aadb6f6-a5fc-49dc-ad45-49d19d1a635c","savedPayload":{"position":{"x":20462.726854753862,"y":17927.75106143375},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"95fb3723-fba0-478a-811d-27f3def52da3","savedPayload":{"position":{"x":20522.594005374274,"y":18341.223650201864},"targetPosition":{"x":20382.76209065659,"y":17968.58629383827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"42acb4bb-4128-4f8b-9e1a-375ddf9e5c3e","savedPayload":{"position":{"x":20382.76209065659,"y":17968.58629383827},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"257e5a1c-1f34-47e1-a2e8-87ef608e20f9","savedPayload":{"position":{"x":20349.055542474198,"y":18384.929925776516},"targetPosition":{"x":20295.702931585016,"y":17990.556215057324},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3a9aa85d-2fd9-46d3-9027-60b93952f7d5","savedPayload":{"position":{"x":20295.702931585016,"y":17990.556215057324},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"4a3930e7-71b4-4de2-91a9-c0e8fe4378cd","savedPayload":{"position":{"x":20159.134802686174,"y":18386.404734655618},"targetPosition":{"x":20194.702171846195,"y":17990.037977645177},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f940899b-39cd-4bcb-afa1-bc21b5d50b57","savedPayload":{"position":{"x":20194.702171846195,"y":17990.037977645177},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"c77b69de-126b-4692-8fdb-56af9ce42bec","savedPayload":{"position":{"x":20241.95675880811,"y":17593.233401843718},"targetPosition":{"x":19864.068127132065,"y":17470.844315324215},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"7e3120c7-a0c9-483c-ada9-8c53deb10f33","savedPayload":{"position":{"x":19864.492129018414,"y":17470.63669359887},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"27343f26-0264-4d51-ae7d-3c4427915e34","savedPayload":{"position":{"x":19233.36296118093,"y":17114.990741841684},"targetPosition":{"x":19629.02655758904,"y":17073.998238842873},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"c0ca6e4d-6ea1-4447-ae1f-1bfc57c28085","savedPayload":{"position":{"x":19629.02655758904,"y":17073.998238842873},"targetPosition":{"x":20024.211663825638,"y":17033.159382997943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"525642e3-7dfc-432c-a507-5e5994671011","savedPayload":{"position":{"x":19556.857437302366,"y":16389.398930737367},"targetPosition":{"x":19790.48232938914,"y":16711.207830105854},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"fdde4047-6006-445f-ace9-c012a540f1da","savedPayload":{"position":{"x":19790.48232938914,"y":16711.207830105854},"targetPosition":{"x":20024.211663825638,"y":17033.159382997943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"b0a9f9dd-26a1-4ff5-9252-daea0ac9cd25","savedPayload":{"position":{"x":20024.211663825638,"y":17033.159382997943},"targetPosition":{"x":20387.28096717611,"y":17194.931095401393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"f13fe451-7e76-4042-9ae1-27ad7b60ae18","savedPayload":{"position":{"x":20264.49225530566,"y":16088.522899427171},"targetPosition":{"x":20406.78233024334,"y":16459.786930407},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"36736231-2578-42ec-a55e-88cee105c391","savedPayload":{"position":{"x":20406.78233024334,"y":16459.786930407},"targetPosition":{"x":20549.20485226298,"y":16831.256412244817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"958f0760-0b28-4ca4-a180-018db39e05e1","savedPayload":{"position":{"x":20710.93183438131,"y":16467.774375265748},"targetPosition":{"x":20549.20485226298,"y":16831.256412244817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"c0ca6e4d-6ea1-4447-ae1f-1bfc57c28085"}}},{"type":"Polygon Vertex","name":"End","id":"3b5d9862-762b-4320-80e2-239f7fba8bfd","savedPayload":{"position":{"x":20920.78219265595,"y":16688.751249301196},"targetPosition":{"x":20549.20485226298,"y":16831.256412244817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"fdde4047-6006-445f-ace9-c012a540f1da"}}}],"id":"ecc7aa98-a1ca-4bd0-94d3-a346bd031314","savedPayload":{"position":{"x":20549.20485226298,"y":16831.256412244817},"targetPosition":{"x":20387.28096717611,"y":17194.931095401393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"dash\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": -10\n }","id":"b8e35c45-7eaa-4963-895e-07a2be300d0c","savedPayload":{"position":{"x":20932.87323962831,"y":17437.362888863667},"targetPosition":{"x":20750.912467524868,"y":17356.573288977313},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"c0ca6e4d-6ea1-4447-ae1f-1bfc57c28085"}}},"id":"d2e74abb-8a91-4fc7-a639-8674a49dd713","savedPayload":{"position":{"x":20750.912467524868,"y":17356.573288977313},"targetPosition":{"x":20387.28096717611,"y":17194.931095401393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"7de2e3be-733d-41a4-9bed-c06f71c2f55a","savedPayload":{"position":{"x":20387.28096717611,"y":17194.931095401393},"targetPosition":{"x":20064.427431560114,"y":17920.179416251263},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Limit Sell Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"9470a248-8d25-4e69-8188-31631b338f40","savedPayload":{"position":{"x":20837.48324534772,"y":17975.81186947458},"targetPosition":{"x":20656.011578802958,"y":18059.011566467427},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"55da37dd-29b1-4d4e-8563-d9075777cb23","savedPayload":{"position":{"x":20656.011578802958,"y":18059.011566467427},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"f9806071-b507-4382-bf5b-cd3e8ce03c79","savedPayload":{"position":{"x":21091.963928114725,"y":18108.41837585634},"targetPosition":{"x":20698.69273923903,"y":18177.32760383407},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"8ccfca08-c6d4-457f-b49e-b76b9ea02b0a","savedPayload":{"position":{"x":20698.69273923903,"y":18177.32760383407},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"0cd1b214-5980-4200-8896-903830c520fe","savedPayload":{"position":{"x":21095.3292009353,"y":18281.506615649057},"targetPosition":{"x":20697.859082198866,"y":18263.20043681344},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"64993251-8554-400b-8e00-9f9ff7636d03","savedPayload":{"position":{"x":20697.859082198866,"y":18263.20043681344},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"b5c8308d-6c94-4e86-b2c1-9d2195fe6bf4","savedPayload":{"position":{"x":21067.423810141627,"y":18455.831523036308},"targetPosition":{"x":20683.322851983175,"y":18349.829664008645},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3cea1f9f-e12d-4fc7-98a3-963d470af36b","savedPayload":{"position":{"x":20683.322851983175,"y":18349.829664008645},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"dde51a18-352c-4e74-8e1a-6f0c2f7cd431","savedPayload":{"position":{"x":21001.914709725563,"y":18621.57043529477},"targetPosition":{"x":20651.118832991346,"y":18432.87866195875},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7f777a5e-e5f9-4910-9c85-4123fb716c8a","savedPayload":{"position":{"x":20651.118832991346,"y":18432.87866195875},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"4b4fcada-996d-47c9-a5a9-bcc69b9522a8","savedPayload":{"position":{"x":20898.70576096475,"y":18766.81998747293},"targetPosition":{"x":20598.67588797691,"y":18504.998005695033},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2d1cd1de-aa70-4afa-a02f-6ee95f26592b","savedPayload":{"position":{"x":20598.67588797691,"y":18504.998005695033},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"57b439ef-6c45-4729-91ad-2f6a249e04b8","savedPayload":{"position":{"x":20769.830802591398,"y":18888.578227237987},"targetPosition":{"x":20535.74681863763,"y":18566.83608864393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d13d02cb-5cac-48cb-9472-fd716e1a02bd","savedPayload":{"position":{"x":20535.74681863763,"y":18566.83608864393},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"c7667cdf-74fc-4e1f-90f7-1670004a1d1a","savedPayload":{"position":{"x":20607.938897987675,"y":18963.195484303993},"targetPosition":{"x":20450.808343222954,"y":18596.71595355224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"ab425dc9-c539-4adc-90e6-bfef03e71897","savedPayload":{"position":{"x":20450.808343222954,"y":18596.71595355224},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"f7a7cb7f-d63a-4446-b66d-04317f9b5d89","savedPayload":{"position":{"x":20440.862558950565,"y":19028.45914890388},"targetPosition":{"x":20369.474682965534,"y":18637.211480343853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"acd70922-cde3-481b-913a-25747b7caa93","savedPayload":{"position":{"x":20369.474682965534,"y":18637.211480343853},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"9d9b3ac7-9cfe-4ede-a6b1-7e5b3638bfd3","savedPayload":{"position":{"x":20262.17745479484,"y":19039.58936955458},"targetPosition":{"x":20279.532650123103,"y":18641.767068205263},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"cbff7535-8426-48d0-9caf-f7f62658bbf3","savedPayload":{"position":{"x":20279.532650123103,"y":18641.767068205263},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"f5dc0bd3-987a-4cb6-acd8-e44d103628bb","savedPayload":{"position":{"x":20085.272304141883,"y":19011.33557035203},"targetPosition":{"x":20190.73495483825,"y":18627.640182058312},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"cbddfd74-5150-4d86-9f24-8a6bba8b47d7","savedPayload":{"position":{"x":20190.73495483825,"y":18627.640182058312},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"b984d13d-80d0-4fc7-acdd-0bdaa3daa8fe","savedPayload":{"position":{"x":19919.034353417366,"y":18944.7123547612},"targetPosition":{"x":20107.379767239647,"y":18594.10415353865},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f4454162-f131-41d5-be37-b1ac3ca3615a","savedPayload":{"position":{"x":20107.379767239647,"y":18594.10415353865},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"0b645733-d948-47eb-9382-c35d498406c5","savedPayload":{"position":{"x":19764.32332607289,"y":18833.390057930817},"targetPosition":{"x":20025.734103700695,"y":18533.547542467106},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"078df67b-29cf-4ee4-962c-7934f570e075","savedPayload":{"position":{"x":20025.734103700695,"y":18533.547542467106},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d42f8da7-a8d0-4154-bf1f-7eeca102d9d7","savedPayload":{"position":{"x":20297.916897779334,"y":18241.41193503254},"targetPosition":{"x":20064.427431560114,"y":17920.179416251263},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fb243322-ec2a-4f03-bb77-e97e4699d1c6","savedPayload":{"position":{"x":20064.625299812844,"y":17920.066863345062},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"93c15cbf-185a-4b59-b55f-847f437bb841","savedPayload":{"position":{"x":19272.98362544747,"y":18003.618745805295},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"6a54eece-4582-4cda-a854-1cd805e00fed","savedPayload":{"position":{"x":18884.571706269082,"y":18699.127167364633},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}
\ No newline at end of file
+{"type":"Data Mine","name":"Masters-Trading","config":"{ \n\"codeName\": \"Masters-Trading\"\n}","sensorBots":[],"indicatorBots":[],"tradingBots":[{"type":"Trading Bot","name":"Low Frequency","config":"{\n\"codeName\": \"Low-Frequency\"\n}","processes":[{"type":"Process Definition","name":"Trading","config":"{\n \"codeName\": \"Trading\",\n \"liveTradingWaitTime\": 0,\n \"paperTradingWaitTime\": 0,\n \"fordwardTestingWaitTime\": 0,\n \"backtestingWaitTime\": 0,\n \"sessionRunWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"framework\": {\n \"name\": \"Low-Frequency-Trading-Process\"\n }\n }","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Episode Counters","id":"6fc3054e-5034-4fc7-bddf-02360e0a6acf","savedPayload":{"position":{"x":17450.068251326462,"y":15841.551559017382},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"db063d7b-db05-4bf6-941f-999e1ccb38fc"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Counters","id":"c3c2240f-514b-40de-825f-674037117d0b","savedPayload":{"position":{"x":17408.574644476477,"y":15727.325552793509},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"0764aaaf-d970-4f23-9df8-55fe5b7dd273"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Statistics","id":"1dfdfc0d-842f-4e63-a591-256ac8a06b0f","savedPayload":{"position":{"x":17373.12088415627,"y":15611.394883926749},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Statistics","id":"39360c55-5ba8-413b-b0bd-cac3789ebf5f","savedPayload":{"position":{"x":17343.701241214498,"y":15493.846491633021},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"91953362-8751-4440-a898-21245cd47c15"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Candle","id":"ba614415-6e4f-4979-97a5-34c72a59e67c","savedPayload":{"position":{"x":17320.378252589224,"y":15374.95820021913},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Candle","id":"1a2e3461-33e6-45b1-bcc1-c56a8c5d275c","savedPayload":{"position":{"x":17303.209229100234,"y":15255.03551122105},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Balance","id":"567e4dc9-4deb-41e4-9ac9-dde943fb91ba","savedPayload":{"position":{"x":17292.23789362744,"y":15134.392617857315},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"acddff59-b51b-4b45-b58f-71d4077755ee"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Balance","id":"e94b9bb3-9f0c-4550-94e1-09de444780a8","savedPayload":{"position":{"x":17287.49247877813,"y":15013.347651781945},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"213b8fe8-f772-41ea-a3f5-97867be555f7"}}},{"type":"Output Dataset","name":"Multi-Period-Market Distance To Event","id":"a30e7306-7be9-41b6-a465-558fdfe2a903","savedPayload":{"position":{"x":17288.98513586243,"y":14892.41686293203},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"0ef6aa1d-3345-40f8-bc4f-4d2e2ff199ff"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Distance To Event","id":"3080f872-54a7-40c4-b056-983947cc24bd","savedPayload":{"position":{"x":17296.711661379682,"y":14771.529799613685},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"c291211b-4012-4440-a302-8e15412b0990"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Strategy","id":"55861598-6cfa-45c8-b0ed-f40e9dbe7f3b","savedPayload":{"position":{"x":17310.65134253611,"y":14651.200479355804},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"7b4550d3-69d1-41ac-bad3-e2283f798bb8"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Strategy","id":"924a8293-24d8-4718-aa5e-f27f98b45908","savedPayload":{"position":{"x":17330.76710361171,"y":14531.748785417456},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"49d55660-71e9-4c5a-8b1a-198934844e4a"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Position","id":"b8ea1360-a746-4aaf-b38d-ab14178db127","savedPayload":{"position":{"x":17357.00552521386,"y":14413.491425771617},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"7506dd91-ad9d-4aad-bb1a-604bc5d3fe8d"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Position","id":"3a37475b-ed55-4040-a555-f383ad74b6f5","savedPayload":{"position":{"x":17389.296974859448,"y":14296.74191306432},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"06678152-1082-4f00-9275-22ffde715469"}}},{"type":"Output Dataset","name":"Multi-Period-Market Last Position","id":"68eff2b5-a456-4cb8-9410-4b0596bbed92","savedPayload":{"position":{"x":17427.555783524644,"y":14181.809777350525},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"485671ff-0d50-4c08-958c-93e657cd238f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Last Position","id":"bbe43faf-1f61-4dab-8ac4-3d6642c5ab35","savedPayload":{"position":{"x":17471.680467984806,"y":14068.999745380686},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"a909df42-6192-4bbd-9f38-e8800149aaa1"}}},{"type":"Output Dataset","name":"Multi-Period-Market Previous Balance","id":"da332a96-6079-4fe4-985c-5cfeb58f8ba7","savedPayload":{"position":{"x":17521.55399687285,"y":13958.610928842461},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"7e78025f-e284-4ca1-9351-bc5699491e4f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Previous Balance","id":"9ad3e9d5-8cbf-42b1-9a37-7a99d6852d65","savedPayload":{"position":{"x":17577.044099021365,"y":13850.93602796892},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2aa4b10e-4d73-4391-b820-950038505045"}}},{"type":"Output Dataset","name":"Multi-Period-Market Previous Candle","id":"a30b2f86-2716-4fa0-97d0-14a7cceb4f65","savedPayload":{"position":{"x":17638.003612871635,"y":13746.260552977767},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"34de89b0-406c-4132-b308-053bc1d90a38"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Previous Candle","id":"c6630458-0815-4e74-827d-c26a68c5a84b","savedPayload":{"position":{"x":17704.27087578961,"y":13644.862065243033},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"d1533eeb-1c10-4a6b-97ea-d619441946e4"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Highlights","id":"9b1ddcd4-a04e-4257-b34b-aac7e820ec6b","savedPayload":{"position":{"x":17775.670152114362,"y":13547.009440024773},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"6e0f951c-25e7-4b92-85da-8be04d424bd0"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Highlights","id":"7d17f2a1-17a7-4f1f-a4c4-f1b5e0d1144b","savedPayload":{"position":{"x":17852.01209871445,"y":13452.962152570055},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"fa53ecfb-a558-4810-b6f8-1f9c6c8bfc5b"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Values","id":"5840f961-7985-418b-aa2e-e4ac553de822","savedPayload":{"position":{"x":17933.094266759956,"y":13362.969589379396},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"9c4ec2f8-f4a8-45b9-aba3-b093a7b8f86a"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Values","id":"fb246bbf-cd71-410f-b67d-f7dbb8adb01b","savedPayload":{"position":{"x":18018.701638341565,"y":13277.27038639732},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"b3d3fe62-e714-4cb9-a78d-55bc0add1d7c"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Errors","id":"4d1ea5e9-aa39-4307-9de2-7d1d472d3b2e","savedPayload":{"position":{"x":18108.60719648822,"y":13196.091795836133},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"2ef33675-fc52-49fd-a8ef-bc5da1711dd1"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Errors","id":"60e560bc-5220-4a91-96ee-234deccfb890","savedPayload":{"position":{"x":18202.572527054464,"y":13119.649083280814},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2d0dd4c2-4f4c-4d8c-b9a5-9ca62f186369"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Status","id":"7318b132-939f-4fdd-bd7f-37a8a9cf4442","savedPayload":{"position":{"x":18300.348450869507,"y":13048.14495665293},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"2b83dc93-dc14-44d9-8f8c-889f39a952da"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Status","id":"e0941495-2d77-4f69-9630-21435fe0bb59","savedPayload":{"position":{"x":18401.675684463207,"y":12981.769028534318},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"0f8dcda3-1eab-439d-956c-c6eb9b1c481f"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Progress","id":"56858f59-372c-48b4-8325-9293e3a1aeef","savedPayload":{"position":{"x":18506.285527610748,"y":12920.697313268014},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"77735fc0-9ce6-4dec-a3ad-8075a22eda40"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Progress","id":"a0780dd7-5b09-4889-98a9-508550b34794","savedPayload":{"position":{"x":18613.90057586763,"y":12865.09176016574},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2fde11bd-4515-4a4e-9dc0-f6869dd3a04e"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Running","id":"e5bc8cf9-9370-4f5b-90dc-a95be0b6b877","savedPayload":{"position":{"x":18724.235456200706,"y":12815.0998240585},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"c7b45884-6cdf-43f7-a1e5-c5325effd207"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Running","id":"5916c406-b53f-4112-959f-259327764ce3","savedPayload":{"position":{"x":18836.997583759286,"y":12770.854074330126},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"a21cbc62-e6d8-4286-b0ff-430071d46700"}}},{"type":"Output Dataset","name":"Multi-Period-Market Strategies","id":"888c619e-3402-4450-ac04-f21690784f76","savedPayload":{"position":{"x":18951.887937772706,"y":12732.47184347314},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"03d1a187-b188-4ad7-b99e-6e4f6c6f0278"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Strategies","id":"898b3121-33f8-4bbc-88fd-3adaaa7e4dfd","savedPayload":{"position":{"x":19068.601854508175,"y":12700.054916102066},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"58a5a046-53a1-43a7-bb76-0c29d94ef579"}}},{"type":"Output Dataset","name":"Multi-Period-Market Positions","id":"8a4cc094-2a6d-46b1-bdd3-a84fcf59e949","savedPayload":{"position":{"x":19186.829835174864,"y":12673.68925925129},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"55df9376-2806-429d-b43d-b96700787f74"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Positions","id":"6e9eff26-ae5d-46f3-9c95-c0df02fcf626","savedPayload":{"position":{"x":19306.25836661786,"y":12653.4447946727},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"fd62b468-93fa-44e0-941f-fff7ea4b04ea"}}},{"type":"Output Dataset","name":"Multi-Period-Market Stop Loss","id":"7b66ec68-cbea-4b0f-8ea4-967f2c20eaef","savedPayload":{"position":{"x":19426.57075261033,"y":12639.37521373204},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"0ea22a69-e7cb-4fcf-b7ae-4b7233b196c4"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Stop Loss","id":"0ea322e0-49b0-4464-bfef-577b9229b21c","savedPayload":{"position":{"x":19547.447953524843,"y":12631.517835382998},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"75b13383-2771-4f58-b2c4-ffadad2e9519"}}},{"type":"Output Dataset","name":"Multi-Period-Market Take Profit","id":"61b513ab-8308-4ca1-b43b-4eaf9a5460a0","savedPayload":{"position":{"x":19668.37322754854,"y":12629.89342882628},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3cd59aa1-0590-43b6-9fb7-c85276ac132e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Take Profit","id":"aca07882-8dc1-4a36-9bab-207feb0a8156","savedPayload":{"position":{"x":19789.41649614333,"y":12634.506610845157},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"916d5610-87ae-47e7-9067-9a406141e3df"}}},{"type":"Output Dataset","name":"Multi-Period-Market Trading System Announcements","id":"cf996d5d-8bc6-40c1-a236-b1cb44e03683","savedPayload":{"position":{"x":19910.062996598277,"y":12645.34490603952},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"9e29a710-30c0-4faa-b71a-f4ee109673a2"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Trading System Announcements","id":"0f14a501-fb5d-4cc3-a1e4-cf222033b38e","savedPayload":{"position":{"x":20029.991792671528,"y":12662.379634289566},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"b7e24195-a9d0-45e7-9dba-447db8000feb"}}},{"type":"Output Dataset","name":"Multi-Period-Market Last Strategy","id":"cf14f3cd-76ca-4071-8935-5d8b51f0727a","savedPayload":{"position":{"x":20148.884768645727,"y":12685.565649762912},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"a2e7b5d2-8556-4c58-b2f6-a9c27c939e94"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Last Strategy","id":"016f5453-95db-4f4c-a6ca-ea640706ad30","savedPayload":{"position":{"x":20266.426627606837,"y":12714.841496383935},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"76ff2401-1d4f-4dda-87f6-5e0b7af3eab2"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Buy Orders","id":"cede531c-2537-41c1-88e0-0966ef55918d","savedPayload":{"position":{"x":20382.30566853795,"y":12750.129573081727},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"45609efb-0edc-4aa9-bc12-f5b4ca6dc5bf"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Buy Orders","id":"87eb188c-fb75-4b71-b586-76df2562bdbd","savedPayload":{"position":{"x":20496.214604473727,"y":12791.336340800579},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"5eed53d0-a3e7-4082-b7f1-cb321b3d306b"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Sell Orders","id":"9749984c-d822-444c-ba73-0afe496701ba","savedPayload":{"position":{"x":20607.851376932686,"y":12838.352572565283},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"6112bd4d-07cb-41db-98c4-e286d172b5c0"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Sell Orders","id":"fa7851cd-960a-4fee-8555-098d7c0f7bf1","savedPayload":{"position":{"x":20716.919958947004,"y":12891.053646754892},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"07cd5668-5e0f-4385-9c02-72eebc99344a"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Buy Orders","id":"b4c63226-bf40-4ce9-a10f-c24557653931","savedPayload":{"position":{"x":20823.13114359145,"y":12949.299883764048},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"b82fb0f9-74c1-42e6-961c-a696214ef079"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Buy Orders","id":"c145f3a1-5e3b-4fd7-990e-301afd556ed5","savedPayload":{"position":{"x":20926.20331600415,"y":13012.936926582708},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2e03f52e-0cd2-46b4-9c10-0b8516ef9c71"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Sell Orders","id":"5caac63a-79fe-41f8-b8e9-c7bb37266e36","savedPayload":{"position":{"x":21025.86320767975,"y":13081.796166731898},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"356495a9-b063-495d-b06d-5281c7c0007e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Sell Orders","id":"4bd13f7d-defe-45de-89c2-d9585d136a66","savedPayload":{"position":{"x":21121.846633087946,"y":13155.695219131434},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"934ab813-127e-4bbf-aa71-09b3cdadc0d0"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Buy Orders","id":"8e7de106-fb91-4870-9dd7-abd95612334a","savedPayload":{"position":{"x":21213.899211250402,"y":13234.438454452464},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"a2ea8001-2143-4055-b1d3-525d95fa8e6f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Buy Orders","id":"a411c8b0-d77b-47aa-afb2-a87ed5af45a9","savedPayload":{"position":{"x":21301.77708080396,"y":13317.817609519618},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"557357c6-f814-4bf9-9426-82fc5e22c028"}}},{"type":"Output Dataset","name":"Multi-Period-Market Market Sell Orders","id":"ae79cdc6-d3ba-4d35-9576-3a1d9423f463","savedPayload":{"position":{"x":21384.590944493164,"y":13404.934525864779},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"917cfdae-b736-4ed5-ad8e-d572c49ea489"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Market Sell Orders","id":"9368bd45-ac63-4516-a847-3a95dc05a4be","savedPayload":{"position":{"x":21463.8136836629,"y":13497.19854180655},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"3c878a50-6d76-412b-95d7-f2e546960293"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Buy Orders","id":"0e8787f5-280a-4b8c-a44a-547eae004be4","savedPayload":{"position":{"x":21539.033843080848,"y":13594.58645171344},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"df8cfaa4-a4d4-4bc1-9fa2-4f8e91e45a87"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Buy Orders","id":"efea7ba6-b9a7-4f84-bcb2-836e4b7eb67e","savedPayload":{"position":{"x":21607.082998953836,"y":13693.147942095473},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"12652573-9506-4d3e-82bb-64b1bb9e7ce0"}}},{"type":"Output Dataset","name":"Multi-Period-Market Limit Sell Orders","id":"beb0297b-e178-4a0d-8054-ab171021024a","savedPayload":{"position":{"x":21670.866058778232,"y":13796.233014650197},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"f645108f-4648-497f-b361-0be5b84c233a"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Limit Sell Orders","id":"559f0101-1ef2-43d1-a0cc-6e1df75edec4","savedPayload":{"position":{"x":21729.410392091602,"y":13902.735386102204},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"e98191d1-5b13-42eb-bd52-31e3c6830188"}}}],"id":"8a70c5a8-40b8-4a49-a77f-e02efce9556e","savedPayload":{"position":{"x":19639.12824066453,"y":14981.687173508728},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":3,"distanceToParent":4,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Low Frequency Trading","config":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"e7fd528f-46bb-4a13-a11f-b6994236e3e7","savedPayload":{"position":{"x":17809.60651084167,"y":15999.191155263683},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"a8577e6c-9afc-4c9e-87ef-ee38531de864"}}},{"type":"Status Dependency","name":"Candles Volumes Multi-Period-Market","config":"{\n\"mainUtility\": \"Market Ending Point\"\n}","id":"0517c2f1-627f-44e2-b58d-6d3f72d6c931","savedPayload":{"position":{"x":17805.015670463275,"y":15881.675430240237},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"a0a61ba9-91cb-4ec7-92fe-134ff079de2d"}}},{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\"mainUtility\": \"Market Starting Point\"}","id":"0b6d7ced-ccef-4a98-909c-443125480c10","savedPayload":{"position":{"x":17807.69757919285,"y":15764.898811662715},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e"}}}],"dataDependencies":[{"type":"Data Dependency","name":"Bollinger Bands Multi-Period-Market","id":"e63b5078-9328-4a8f-b5d6-afe2aa4978ae","savedPayload":{"position":{"x":17817.581028218345,"y":15648.300112805127},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"f5b2a7d8-fc32-44a3-a002-9b0fc30a9719"}}},{"type":"Data Dependency","name":"Percentage Bandwidth Multi-Period-Market","id":"f2e34e16-a766-49e7-be23-4500ffecee77","savedPayload":{"position":{"x":17834.62307851244,"y":15532.565092640696},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"207e9481-0730-4304-a938-cfe223d70856"}}},{"type":"Data Dependency","name":"Bollinger Channels Market","id":"b59f31af-76f5-486b-b0f2-25a0811b5093","savedPayload":{"position":{"x":17858.763290083698,"y":15418.113479994203},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Market","id":"22c1f2c6-3838-4657-add8-2e01d7056917"}}},{"type":"Data Dependency","name":"Bollinger Sub-Channels Market","id":"ffe42686-a327-4968-a2f7-82e94675bef1","savedPayload":{"position":{"x":17889.899245449113,"y":15305.371459819195},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Market","id":"f8d44a4d-3771-4a71-97ca-dc604ff565d3"}}},{"type":"Data Dependency","name":"Candles Multi-Period-Market","id":"ee3e4fec-1586-4ce0-8f21-8c547f1d5c17","savedPayload":{"position":{"x":17927.91503228644,"y":15194.76479856646},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"2b03494a-67d6-47f1-89b6-53fc4c9116a8"}}},{"type":"Data Dependency","name":"Bollinger Bands Multi-Period-Daily","id":"8c0263f6-33bc-4e10-9820-c4041bba8d98","savedPayload":{"position":{"x":17972.670000016667,"y":15086.712909575823},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"506104fa-e99a-4a46-930e-176bce311aff"}}},{"type":"Data Dependency","name":"Percentage Bandwidth Multi-Period-Daily","id":"604dc772-1946-486d-a4a6-2fe06aa3cd32","savedPayload":{"position":{"x":18023.990663260385,"y":14981.619316504293},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"e60d62dd-87f7-4f2d-ac21-3ac5c30a50ea"}}},{"type":"Data Dependency","name":"Bollinger Channels Daily","id":"01d998bf-2242-4874-83b5-ecfd963b9a41","savedPayload":{"position":{"x":18081.68442341935,"y":14879.890686789326},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Daily","id":"96b4e65b-e6db-44a0-80a5-ceb9d68a09ec"}}},{"type":"Data Dependency","name":"Bollinger Sub-Channels Daily","id":"f29fb726-3488-46d3-9afe-eed525075df3","savedPayload":{"position":{"x":18145.527810724234,"y":14781.902181070356},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Daily","id":"ca71e765-0f66-4b18-b500-847b9d16169b"}}},{"type":"Data Dependency","name":"Candles Multi-Period-Daily","id":"6ec46e2f-d0f5-468d-b2bb-9f6151fc59b5","savedPayload":{"position":{"x":18215.286324268534,"y":14688.037170504567},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"678a567c-f08d-49b9-813b-4e54fd6afadb"}}},{"type":"Data Dependency","name":"Volumes Multi-Period-Market","id":"92f9fc38-99ec-4046-9fe5-02099bea5e17","savedPayload":{"position":{"x":18290.6870400883,"y":14598.640017775022},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"9bf0483c-4825-4a46-9cf4-1b5262579fc1"}}},{"type":"Data Dependency","name":"Volumes Multi-Period-Daily","id":"83245c23-556c-4f73-baf0-a09dcb55d338","savedPayload":{"position":{"x":18371.44826962373,"y":14514.054228156165},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2e683057-f911-4105-bc77-16f2706d1915"}}},{"type":"Data Dependency","name":"Candles Channels Multi-Period-Market","id":"9b4950e5-8bec-4fc0-90a2-078bc1aa0262","savedPayload":{"position":{"x":18457.265507314976,"y":14434.602791293502},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"df7d1cd7-95b0-499c-b51a-772c3fb8a2b0"}}},{"type":"Data Dependency","name":"Candles Channels Multi-Period-Daily","id":"d81c37d1-286f-44c9-97cb-9111be0603f5","savedPayload":{"position":{"x":18547.811993422252,"y":14360.5893555312},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"07734f1c-e2e7-4a35-8567-6a996c68883e"}}},{"type":"Data Dependency","name":"Candles Channels Objects Multi-Period-Market","id":"e6ca827c-6d70-4c22-ad69-b29b94444578","savedPayload":{"position":{"x":18642.73990711171,"y":14292.282310072856},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"566b9df4-da86-4b4f-a3f4-ef8a76443714"}}},{"type":"Data Dependency","name":"Candles Channels Objects Multi-Period-Daily","id":"a55fd633-ffa6-4888-a3ea-2b6fa4895b67","savedPayload":{"position":{"x":18741.698194703014,"y":14229.955591244665},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"8a7d224b-7571-4e1a-8b8f-8a35aa25dc63"}}},{"type":"Data Dependency","name":"Popular SMAs Multi-Period-Market","id":"75b9a638-6a42-4730-8aa3-151fdb2e3c97","savedPayload":{"position":{"x":18844.30037684593,"y":14173.834620151925},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3b21f9d7-2cbc-4c23-80c8-cc5e5b06a22c"}}},{"type":"Data Dependency","name":"Popular SMAs Multi-Period-Daily","id":"19c94d5d-9790-4f37-8fdc-3bd91d237c14","savedPayload":{"position":{"x":18950.164019483193,"y":14124.138152587615},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"2c338fe0-385f-45ab-b210-b98ef013228d"}}},{"type":"Data Dependency","name":"Base7 SMAs Multi-Period-Market","id":"8dd779a7-13e3-4bd7-8134-d8f3e2b69ab7","savedPayload":{"position":{"x":19058.885631178386,"y":14081.054211329121},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"78a6ef37-4df8-4ac8-83a0-c9a732467c59"}}},{"type":"Data Dependency","name":"Base7 SMAs Multi-Period-Daily","id":"68c2d0db-1766-45b8-9d38-42745f99275f","savedPayload":{"position":{"x":19170.054023679866,"y":14044.745319145468},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f155e2ed-7082-4021-a4ff-a6f3cfd5683d"}}},{"type":"Data Dependency","name":"Base11 SMAs Multi-Period-Market","id":"7f832c99-ad47-4606-80bc-7cd71eaf9a58","savedPayload":{"position":{"x":19283.24653660857,"y":14015.347563018106},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"af9b9cef-2a74-486f-b79e-047d68669a1f"}}},{"type":"Data Dependency","name":"Base11 SMAs Multi-Period-Daily","id":"48ab1481-9447-495e-b0b8-8ce79dc89307","savedPayload":{"position":{"x":19398.033790684898,"y":13992.972976086485},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"de5cfa30-edbf-4d5b-8d7f-facfb69a0f3e"}}},{"type":"Data Dependency","name":"Popular EMAs Multi-Period-Market","id":"61daf85b-f311-47c9-afd7-adc553beb154","savedPayload":{"position":{"x":19513.982755351088,"y":13977.708187501354},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"ea1af06a-2584-43f0-aecf-ec8ad9169e9c"}}},{"type":"Data Dependency","name":"Popular EMAs Multi-Period-Daily","id":"51339945-99cb-458b-9289-2b328acdc8d0","savedPayload":{"position":{"x":19630.64947355191,"y":13969.614712786937},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"e7f5899c-fc4c-412d-a8db-77c1bef8ed21"}}},{"type":"Data Dependency","name":"Base7 EMAs Multi-Period-Market","id":"ce7bcd93-d47a-4628-a996-14505d5a8594","savedPayload":{"position":{"x":19747.293837511883,"y":13968.7112843051},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"4e36a5a5-7a03-43a9-b3e0-0c5763c29199"}}},{"type":"Data Dependency","name":"Base7 EMAs Multi-Period-Daily","id":"5cb84538-2e4c-4868-8903-a30702628bee","savedPayload":{"position":{"x":19864.06525187253,"y":13975.013321544944},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"15ccbcff-318d-46db-93f2-d649b57fd52a"}}},{"type":"Data Dependency","name":"Base11 EMAs Multi-Period-Market","id":"bde24159-44de-4864-b526-69158fab21aa","savedPayload":{"position":{"x":19980.234611322503,"y":13988.494340728084},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"5586aa74-2ecb-4b71-83ea-d621aa400660"}}},{"type":"Data Dependency","name":"Base11 EMAs Multi-Period-Daily","id":"bad61638-d7d0-469b-ba4b-d09e708392f0","savedPayload":{"position":{"x":20095.355460260518,"y":14009.097458993385},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"0198fa3f-98e3-4c57-a4a4-a7a8e27905d3"}}},{"type":"Data Dependency","name":"RSI14 Multi-Period-Daily","id":"30b21270-85a4-40b4-bd6a-397f0f0076a4","savedPayload":{"position":{"x":20208.984647795955,"y":14036.747125685284},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f1556d09-f134-4678-83fb-04002d1dcd34"}}},{"type":"Data Dependency","name":"RSI14 Multi-Period-Market","id":"68540e2b-d05b-420a-a7c2-f77cb9d061b8","savedPayload":{"position":{"x":20320.699793411335,"y":14071.34498805082},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"5ec62760-e144-4496-98ab-0415a4b315ec"}}},{"type":"Data Dependency","name":"Base6 SMAs Multi-Period-Market","id":"2bd8871d-4267-4afc-b89f-144ee28f1925","savedPayload":{"position":{"x":20430.073063300977,"y":14112.748781085029},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"c0862b3d-d35a-4d3e-8d80-258b8a01c37c"}}},{"type":"Data Dependency","name":"Base6 SMAs Multi-Period-Daily","id":"7c5f7fbd-dbce-4d71-b518-8aabae589d37","savedPayload":{"position":{"x":20536.689590417544,"y":14160.812614209619},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f5050eb2-0a99-464e-b5e2-2d8f40453e9a"}}},{"type":"Data Dependency","name":"Base5 SMAs Muti-Period-Market","id":"b7c02c69-f96e-4254-86dd-f42be1d7d085","savedPayload":{"position":{"x":20640.14378045625,"y":14215.344501325528},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Muti-Period-Market","id":"a5d28568-fb58-469a-9820-b9f0e8eab705"}}},{"type":"Data Dependency","name":"Base5 SMAs Multi-Period-Daily","id":"28a71823-717e-451c-86e4-451d2abdcca0","savedPayload":{"position":{"x":20740.047398431725,"y":14276.146776863297},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"01f32aa3-55e9-4f8c-80c7-997b52073274"}}},{"type":"Data Dependency","name":"MACD 122609 Multi-Period-Market","id":"cbeb7069-9a02-464e-9f0c-67e528a14019","savedPayload":{"position":{"x":20836.01755671951,"y":14342.981461561392},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"01d43ed0-2a80-4eca-bee6-db2fe40470fc"}}},{"type":"Data Dependency","name":"MACD 122609 Multi-Period-Daily","id":"2b78c197-5800-478e-8f63-4c51ca35391a","savedPayload":{"position":{"x":20927.69351471674,"y":14415.599253367553},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"dd5d3067-ff7b-4353-ba4f-c030bd3da796"}}},{"type":"Data Dependency","name":"MACD 031016 Multi-Period-Market","id":"05130e8e-faa2-48d6-a1d7-fb6184470351","savedPayload":{"position":{"x":21014.72023494026,"y":14493.721846093633},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"19b1d791-d2ea-4f25-a6e1-fe0a64450745"}}},{"type":"Data Dependency","name":"MACD 031016 Multi-Period-Daily","id":"3e09332d-5266-4520-a793-085e1adeeee5","savedPayload":{"position":{"x":21096.77680780715,"y":14577.053505279142},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"ec2611a6-699b-45a5-beec-679dd4b7734a"}}},{"type":"Data Dependency","name":"MACD 081709 Multi-Period-Market","id":"a1769cc9-85aa-4e02-aa24-2aa1aeb6e673","savedPayload":{"position":{"x":21173.54790227127,"y":14665.282473949534},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"c390cbd3-0ba0-4507-8614-42c88f4ce7e6"}}},{"type":"Data Dependency","name":"MACD 081709 Multi-Period-Daily","id":"2744637c-cdc4-4dae-82df-04bd9a9b664f","savedPayload":{"position":{"x":21244.74227560235,"y":14758.072720908136},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"29e18539-f188-4d29-9531-25cd3ee8f282"}}},{"type":"Data Dependency","name":"MACD 245209 Multi-Period-Market","id":"9414cc05-86f2-4601-9049-591f80fd9510","savedPayload":{"position":{"x":21310.092329410265,"y":14855.069034691165},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"89254c6c-9be2-4037-b063-467edc660d10"}}},{"type":"Data Dependency","name":"MACD 245209 Multi-Period-Daily","id":"fd5e05cc-3c34-44d1-817c-4fd74eae7618","savedPayload":{"position":{"x":21369.347694188004,"y":14955.912311781316},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"8a9dde13-e4b8-40f3-80bc-ea51050b2f08"}}},{"type":"Data Dependency","name":"External Signals Single File","id":"4b1cc9b6-d243-4aa0-b784-7860f7af4cf3","savedPayload":{"position":{"x":21422.27943508304,"y":15060.221132916242},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Single File","id":"c52d1012-5e3b-41a0-b5af-84098b0594bf"}}},{"type":"Data Dependency","name":"Resistances Multi-Period-Market","id":"ec47fa78-79a8-4e6b-866b-355cef2d6fc4","savedPayload":{"position":{"x":21468.69756292535,"y":15167.601854260722},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"44e905fc-719f-453b-a567-fd5e3bfcae91"}}},{"type":"Data Dependency","name":"Resistances Multi-Period-Daily","id":"1be0946e-4940-4d6d-9c07-7bd19b6b7f3c","savedPayload":{"position":{"x":21508.42560461595,"y":15277.668819732304},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"f4530d48-3239-4ab0-8c4d-d611cd55fde3"}}},{"type":"Data Dependency","name":"Supports Multi-Period-Market","id":"b8ea23ab-4fc1-4cc8-85ff-f6c60dd4cb51","savedPayload":{"position":{"x":21541.317095035778,"y":15390.062321896718},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"4a1bd251-76ed-4530-8723-08e41d50f12d"}}},{"type":"Data Dependency","name":"Supports Multi-Period-Daily","id":"f4991669-5947-4b7b-a25b-aa28c4a000e7","savedPayload":{"position":{"x":21567.343801654748,"y":15504.764296138286},"targetPosition":{"x":19703.575565663177,"y":15866.866637515972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"deaaf4ec-9352-40b6-af9a-8541a73a5e13"}}}],"id":"5175cccd-58ed-40d8-8e0d-1a234d7460eb","savedPayload":{"position":{"x":20101.0669768849,"y":14034.10476679153},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":3,"distanceToParent":5,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":""}}},"statusReport":{"type":"Status Report","name":"New Status Report","id":"a8577e6c-9afc-4c9e-87ef-ee38531de864","savedPayload":{"position":{"x":20765.038872275112,"y":15565.302895263007},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"","id":"a47d063a-c7b9-40d9-8d77-26cead472b6c","savedPayload":{"position":{"x":21164.160192725034,"y":15658.346633359854},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"dd185847-d39a-4501-8863-f906716b5f79","savedPayload":{"position":{"x":21525.596708395296,"y":15851.538017380288},"targetPosition":{"x":20611.289555607338,"y":17127.442926240594},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a8c8d761-96e5-4a86-9285-6c3881d61442","savedPayload":{"position":{"x":20611.282204513624,"y":17127.423073515496},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":""}}}],"products":[{"type":"Product Definition","name":"Episode Counters","config":"{\n \"codeName\": \"Episode-Counters\",\n \"singularVariableName\": \"episodeCounter\",\n \"pluralVariableName\": \"episodeCounters\",\n \"nodePath\": \"tradingEngine.episode.episodeCounters\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"db063d7b-db05-4bf6-941f-999e1ccb38fc","savedPayload":{"position":{"x":20610.21817407383,"y":16381.831181285403},"targetPosition":{"x":20764.105414789028,"y":17152.84556063395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0764aaaf-d970-4f23-9df8-55fe5b7dd273","savedPayload":{"position":{"x":20916.93988782024,"y":16381.662535160334},"targetPosition":{"x":20764.105414789028,"y":17152.84556063395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"546573ec-8fd0-4bf2-8cfa-d9b42e9687d1","savedPayload":{"position":{"x":20736.003454862723,"y":15865.69698846926},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"e0540aa0-c559-41c4-906e-68f2e18e1e72","savedPayload":{"position":{"x":20980.786410427852,"y":15744.988963866082},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{\n \"codeName\": \"periods\",\n \"isString\": false\n}","id":"b4b3b148-7425-40ba-98ef-bda43655264a","savedPayload":{"position":{"x":21251.712276716826,"y":15715.27497063253},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategies","config":"{\n \"codeName\": \"strategies\",\n \"isString\": false\n}","id":"49e5d0cf-d508-4359-be84-d44791651d09","savedPayload":{"position":{"x":21516.713134581005,"y":15780.07794161074},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Positions","config":"{\n \"codeName\": \"positions\",\n \"isString\": false\n}","id":"d5e21283-d484-4c39-9079-b3b659f6c8eb","savedPayload":{"position":{"x":21743.524910127573,"y":15931.532716808419},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Orders","config":"{\n \"codeName\": \"orders\",\n \"isString\": false\n}","id":"50a846fb-32f3-4bc7-b9ff-aaea463d1472","savedPayload":{"position":{"x":21904.696008487714,"y":16151.08307297697},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hits","config":"{\n \"codeName\": \"hits\",\n \"isString\": false\n}","id":"d6c69a51-46f1-4416-986a-fe037d329e59","savedPayload":{"position":{"x":21985.96070430569,"y":16417.8937729054},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fails","config":"{\n \"codeName\": \"fails\",\n \"isString\": false\n}","id":"a50da830-2844-4965-b920-25c8d221c029","savedPayload":{"position":{"x":21963.438409291033,"y":16684.88309699204},"targetPosition":{"x":21200.542970090333,"y":16499.267328795824},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"6e46b65d-0e6f-4666-a4c7-e9bc9e3d1c43","savedPayload":{"position":{"x":21200.542970090333,"y":16499.267328795824},"targetPosition":{"x":20764.105414789028,"y":17152.84556063395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"574cfd2f-a269-452d-9a90-dd6921ebc49d","savedPayload":{"position":{"x":20764.322177254293,"y":17152.725906446376},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Episode Counters","id":"5e478e3f-e432-4364-8f2c-2f3b2849848b"}}},{"type":"Product Definition","name":"Episode Statistics","config":"{\n \"codeName\": \"Episode-Statistics\",\n \"singularVariableName\": \"episodeStatistics\",\n \"pluralVariableName\": \"episodeStatistics\",\n \"nodePath\": \"tradingEngine.episode.episodeStatistics\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f","savedPayload":{"position":{"x":20835.28306865707,"y":16407.801760920007},"targetPosition":{"x":20913.000712553854,"y":17190.201859064317},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"91953362-8751-4440-a898-21245cd47c15","savedPayload":{"position":{"x":21140.553559000844,"y":16437.68934861752},"targetPosition":{"x":20913.000712553854,"y":17190.201859064317},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"8a268555-b786-4756-9e5c-7a190c3ae37e","savedPayload":{"position":{"x":20968.791446477233,"y":15933.151788817757},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"ef14e964-9f33-4b53-bf44-bd81c386319d","savedPayload":{"position":{"x":21169.772203234992,"y":15834.763924897374},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false\n}","id":"360e05d7-340f-4975-93f2-b15835e975d2","savedPayload":{"position":{"x":21390.19994900245,"y":15797.011876237026},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hit Ratio","config":"{\n \"codeName\": \"hitRatio\",\n \"isString\": false\n}","id":"86673116-3204-4510-b076-131571ea631d","savedPayload":{"position":{"x":21611.984829251945,"y":15822.849806461934},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{\n \"codeName\": \"days\",\n \"isString\": false,\n \"decimals\": 2\n}","id":"72167f7d-b29e-4f27-a68c-4a3fa3d7c321","savedPayload":{"position":{"x":21817.78528251811,"y":15910.155412007112},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{\n \"codeName\": \"ROI\",\n \"isString\": false,\n \"decimals\": 2\n}","id":"2e89519e-eab5-4656-ade5-3a18eb1cf07f","savedPayload":{"position":{"x":21990.618322565133,"y":16051.719578103439},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Anualized Rate Of Return","config":"{ \n\"codeName\": \"anualizedRateOfReturn\",\n\"isString\": false,\n\"isCalculated\": false,\n \"decimals\": 2\n}","id":"9177857b-5e67-4e42-a874-b0e1633ad45d","savedPayload":{"position":{"x":22116.836088827087,"y":16236.084863363907},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"8356215e-6e31-45d0-bd78-ba080d2258de","savedPayload":{"position":{"x":22185.303699398526,"y":16450.287991169684},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"59b47d20-5679-4889-8c1f-7853aa68f4a0","savedPayload":{"position":{"x":22191.51427491864,"y":16672.680369555772},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"df7dbe99-16e8-42ad-9c8b-5acdf3b63f05","savedPayload":{"position":{"x":22134.538282042544,"y":16888.670011016024},"targetPosition":{"x":21411.17394303341,"y":16582.464963322014},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"c0f124f4-1e7d-4d06-94fd-b547257b4061","savedPayload":{"position":{"x":21411.17394303341,"y":16582.464963322014},"targetPosition":{"x":20913.000712553854,"y":17190.201859064317},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"400c7f49-37da-41fb-b83d-879960aa74ff","savedPayload":{"position":{"x":20913.28359850571,"y":17190.074246163687},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Episode Statistics","id":"6ce18a43-2e6a-452e-a72d-1c56a58d3f81"}}},{"type":"Product Definition","name":"Current Candle","config":"{\n \"codeName\": \"Current-Candle\",\n \"singularVariableName\": \"currentCandle\",\n \"pluralVariableName\": \"currentCandles\",\n \"nodePath\": \"tradingEngine.current.candle\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e","savedPayload":{"position":{"x":21057.182018950927,"y":16455.73941281685},"targetPosition":{"x":21057.97253067345,"y":17242.071992663343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9","savedPayload":{"position":{"x":21357.930922462525,"y":16515.31314398561},"targetPosition":{"x":21057.97253067345,"y":17242.071992663343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9ffe3183-b249-41b6-8e57-56b5d5023376","savedPayload":{"position":{"x":21292.74607925211,"y":15948.165638128643},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"b7b61cc0-b94d-40cb-abe1-047463675f5b","savedPayload":{"position":{"x":21593.370600764338,"y":15888.31242864485},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open","config":"{\n \"codeName\": \"open\",\n \"isString\": false\n}","id":"f93f3ac6-8420-401c-9921-2229d02f5832","savedPayload":{"position":{"x":21893.72311854087,"y":15947.96379085217},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close","config":"{\n \"codeName\": \"close\",\n \"isString\": false\n}","id":"86935367-3d64-4ad2-8171-be1368ca0a8d","savedPayload":{"position":{"x":22148.657203035793,"y":16117.745078044867},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Min","config":"{\n \"codeName\": \"min\",\n \"isString\": false\n}","id":"e5bad869-4386-48a6-b434-36253eaf7f48","savedPayload":{"position":{"x":22298.23935366627,"y":16401.252143764792},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Max","config":"{\n \"codeName\": \"max\",\n \"isString\": false\n}","id":"9c960e9d-7d1f-440b-9e5a-76e81f5a8e29","savedPayload":{"position":{"x":22378.95492396516,"y":16673.829836759967},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"67d251d5-a236-42e7-8b34-4a5276e64d25","savedPayload":{"position":{"x":22319.67736139288,"y":16974.06028815051},"targetPosition":{"x":21593.072669703386,"y":16673.86063760848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d52a6d09-8b78-49db-a525-48a82991fcbc","savedPayload":{"position":{"x":21593.072669703386,"y":16673.86063760848},"targetPosition":{"x":21057.97253067345,"y":17242.071992663343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"b9a58113-cf27-4d57-9810-87a2cc158804","savedPayload":{"position":{"x":21058.262441444196,"y":17241.95848766772},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Candle","id":"31789d43-d608-4eeb-a3ff-338a99074045"}}},{"type":"Product Definition","name":"Current Balance","config":"{\n \"codeName\": \"Current-Balance\",\n \"singularVariableName\": \"currentBalance\",\n \"pluralVariableName\": \"currentBalance\",\n \"nodePath\": \"tradingEngine.current.balance\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"acddff59-b51b-4b45-b58f-71d4077755ee","savedPayload":{"position":{"x":21273.477947404674,"y":16525.327734366492},"targetPosition":{"x":21197.22892798974,"y":17307.917800370382},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"213b8fe8-f772-41ea-a3f5-97867be555f7","savedPayload":{"position":{"x":21566.87694293676,"y":16614.16543619203},"targetPosition":{"x":21197.22892798974,"y":17307.917800370382},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"c9e3558a-d9e9-4466-97fb-c0e9ec3752c1","savedPayload":{"position":{"x":21759.68548383434,"y":16025.397685038859},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"bfb43790-48a8-4437-a191-9f4c396504fb","savedPayload":{"position":{"x":22229.322343697786,"y":16147.446572005958},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Base Asset","config":"{\n \"codeName\": \"baseAsset\",\n \"isString\": false\n}","id":"7658d8bf-a4e0-490e-a3ae-df3bef72e491","savedPayload":{"position":{"x":22533.73690365352,"y":16525.156003340602},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Quoted Asset","config":"{\n \"codeName\": \"quotedAsset\",\n \"isString\": false\n}","id":"1f5cf49c-7040-4cee-b525-83810013a4fb","savedPayload":{"position":{"x":22566.14248874673,"y":17007.84846238948},"targetPosition":{"x":21806.45339218636,"y":16810.1911201281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"0755daf6-8847-48c4-9013-394ddb96a89b","savedPayload":{"position":{"x":21806.45339218636,"y":16810.1911201281},"targetPosition":{"x":21197.22892798974,"y":17307.917800370382},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"a9a53d82-133b-4417-b639-f9a56d338233","savedPayload":{"position":{"x":21197.51097503346,"y":17307.821852651745},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Balance","id":"e5d9e3e1-d1f4-4493-b452-33fe49c81228"}}},{"type":"Product Definition","name":"Distance To Event","config":"{\n \"codeName\": \"Distance-To-Event\",\n \"singularVariableName\": \"distanceToEvent\",\n \"pluralVariableName\": \"distanceToEvents\",\n \"nodePath\": \"tradingEngine.current.distanceToEvent\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0ef6aa1d-3345-40f8-bc4f-4d2e2ff199ff","savedPayload":{"position":{"x":21482.226154928598,"y":16615.981625446308},"targetPosition":{"x":21329.4855347349,"y":17387.12429119341},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"c291211b-4012-4440-a302-8e15412b0990","savedPayload":{"position":{"x":21765.839478845173,"y":16733.364777419207},"targetPosition":{"x":21329.4855347349,"y":17387.12429119341},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"0235ad32-fd46-41eb-b875-ae81f3ce48c5","savedPayload":{"position":{"x":21730.434627931554,"y":16206.749379772767},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9d6c01fa-af2b-4d51-9aa4-f169c53e63b3","savedPayload":{"position":{"x":21931.76260012312,"y":16166.697790802335},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger On","config":"{ \n\"codeName\": \"triggerOn\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7e17fb3f-495f-49c5-9b41-6869155b99fc","savedPayload":{"position":{"x":22136.144790599436,"y":16180.130558590503},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger Off","config":"{ \n\"codeName\": \"triggerOff\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"9de32719-925a-4796-b562-379323cb4d82","savedPayload":{"position":{"x":22330.360723442514,"y":16246.073078523621},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Position","config":"{ \n\"codeName\": \"takePosition\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"e4276497-b218-4b18-b089-70fcc5806fa3","savedPayload":{"position":{"x":22500.89148871633,"y":16360.02751027867},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Position","config":"{ \n\"codeName\": \"closePosition\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"4793082b-ddc8-4246-bb0e-c7f6340da600","savedPayload":{"position":{"x":22636.1176704875,"y":16514.230341275303},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Next Phase","config":"{ \n\"codeName\": \"nextPhase\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"0ada00bc-9398-47a0-9659-63b0838b81d7","savedPayload":{"position":{"x":22726.82820698963,"y":16698.174007375197},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Move To Phase","config":"{ \n\"codeName\": \"moveToPhase\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"9020e64b-d301-49f6-bc6c-cb8086730b19","savedPayload":{"position":{"x":22766.84177863087,"y":16899.32618710327},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Create Order","config":"{ \n\"codeName\": \"createOrder\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"906c1925-caab-4db6-8fec-06845a13fd0a","savedPayload":{"position":{"x":22753.427226823314,"y":17103.674484578103},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Cancel Order","config":"{ \n\"codeName\": \"cancelOrder\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"e864d723-5ad5-4bbd-ad7b-0f975d480ee3","savedPayload":{"position":{"x":22687.48636634825,"y":17297.89647705398},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Order","config":"{ \n\"codeName\": \"closeOrder\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f5be374b-36e6-484c-bd78-6e126e3020fb","savedPayload":{"position":{"x":22573.408785919077,"y":17468.525315487823},"targetPosition":{"x":21982.98005942234,"y":16950.635577302848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"0c3c5d0b-6072-4e57-bff9-9823e0f79b5b","savedPayload":{"position":{"x":21982.98005942234,"y":16950.635577302848},"targetPosition":{"x":21329.4855347349,"y":17387.12429119341},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"8ea88d6c-7d7f-4152-b781-ea108df52c63","savedPayload":{"position":{"x":21329.646498662747,"y":17387.022440548113},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Distance To Event","id":"56eb7de2-0281-404a-bd4d-34ac113e2325"}}},{"type":"Product Definition","name":"Current Strategy","config":"{\n \"codeName\": \"Current-Strategy\",\n \"singularVariableName\": \"currentStrategy\",\n \"pluralVariableName\": \"currentStrategy\",\n \"nodePath\": \"tradingEngine.current.strategy\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"7b4550d3-69d1-41ac-bad3-e2283f798bb8","savedPayload":{"position":{"x":21680.94044039326,"y":16726.36348064086},"targetPosition":{"x":21453.1773811676,"y":17478.901049195178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"49d55660-71e9-4c5a-8b1a-198934844e4a","savedPayload":{"position":{"x":21951.638536162838,"y":16870.978590267317},"targetPosition":{"x":21453.1773811676,"y":17478.901049195178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"3808ed7c-4ae4-4ad8-8ea8-237ee2f8cc8c","savedPayload":{"position":{"x":21909.518354893786,"y":16359.096860253336},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"c8b93e25-fe0e-450a-bcc7-262a06936372","savedPayload":{"position":{"x":22051.517677162898,"y":16328.277065587841},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"702327c6-5dfe-4ab0-bce1-750637a4b863","savedPayload":{"position":{"x":22196.37057056072,"y":16324.08544354176},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"a152bb71-b294-48e7-bf9c-9be7510c8461","savedPayload":{"position":{"x":22339.686328235442,"y":16346.618456193144},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategy Name","config":"{ \n\"codeName\": \"strategyName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"35b9d166-f366-4601-a472-5e8d74be8f82","savedPayload":{"position":{"x":22476.411729222138,"y":16395.09905795914},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"dcdb4018-97ea-4bb8-9e55-5efa00ab8404","savedPayload":{"position":{"x":22601.897401725797,"y":16467.874631828054},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger Stage Status","config":"{ \n\"codeName\": \"triggerStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"183aafec-56a9-4030-b263-1a2e577e6526","savedPayload":{"position":{"x":22711.87293540881,"y":16562.46682735058},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Status","config":"{ \n\"codeName\": \"openStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5c44c941-d0b5-4127-9dc5-ed241f4eebc4","savedPayload":{"position":{"x":22802.594543185274,"y":16675.654773947565},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Manage Stage Status","config":"{ \n\"codeName\": \"manageStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"94b91317-36d0-47d8-8ce7-64272803caab","savedPayload":{"position":{"x":22870.97339838765,"y":16803.584426789257},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Status","config":"{ \n\"codeName\": \"closeStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a47fa5e2-5325-4419-86ef-d1244c8d1da9","savedPayload":{"position":{"x":22914.68111589003,"y":16941.89975281833},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"c2ac38c8-3bc5-4359-8f92-510263b841d1","savedPayload":{"position":{"x":22932.229095623457,"y":17085.8911064268},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"1ae37227-35b8-4abc-a42b-aa0c42fa9fc2","savedPayload":{"position":{"x":22923.018672667222,"y":17230.457686769307},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"288b5fed-0d4b-4b85-9cb5-802c2ff30ca7","savedPayload":{"position":{"x":22887.36206221733,"y":17371.066220416236},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"3802817a-f022-4762-9ff4-412d42f22316","savedPayload":{"position":{"x":22826.46743706523,"y":17502.735126608914},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"97832d1b-40b4-4fc3-9e52-ec3beacf164e","savedPayload":{"position":{"x":22742.38686111381,"y":17620.99168389778},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.strategy.strategyCounters\"\n}","id":"d219dca7-ae8f-422d-a90a-f86b617a76e2","savedPayload":{"position":{"x":22637.832868279304,"y":17721.8926479207},"targetPosition":{"x":22146.551553907804,"y":17108.538418425713},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a4bce1f3-c9cc-470d-b271-1190684aff6f","savedPayload":{"position":{"x":22146.551553907804,"y":17108.538418425713},"targetPosition":{"x":21453.1773811676,"y":17478.901049195178},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"895d8a04-ef45-41a7-909a-ba31013ffb90","savedPayload":{"position":{"x":21453.3870819375,"y":17478.795478669545},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Strategy","id":"a3c31000-1b82-4fe9-ae56-6d5893582b16"}}},{"type":"Product Definition","name":"Last Strategy","config":"{\n \"codeName\": \"Last-Strategy\",\n \"singularVariableName\": \"lastStrategy\",\n \"pluralVariableName\": \"lastStrategy\",\n \"nodePath\": \"tradingEngine.last.strategy\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a2e7b5d2-8556-4c58-b2f6-a9c27c939e94","savedPayload":{"position":{"x":21867.4776821387,"y":16855.834263677196},"targetPosition":{"x":21567.31702416418,"y":17582.35418486395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"76ff2401-1d4f-4dda-87f6-5e0b7af3eab2","savedPayload":{"position":{"x":22122.675840986925,"y":17026.37139698594},"targetPosition":{"x":21567.31702416418,"y":17582.35418486395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"02e1c6bb-e984-4104-98c8-dbcba98ab660","savedPayload":{"position":{"x":22131.018446748407,"y":16512.819275764403},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"0fbc8383-f53b-42c2-ac1a-060f6bc80c5c","savedPayload":{"position":{"x":22275.42031136242,"y":16496.298462319024},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"5785bb06-20d0-4683-b5d3-3cce32ddf13f","savedPayload":{"position":{"x":22419.855360761772,"y":16506.34089756342},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"cca74655-a684-4b14-a70b-63a95f520418","savedPayload":{"position":{"x":22560.236991680402,"y":16542.80404317063},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategy Name","config":"{ \n\"codeName\": \"strategyName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"10192034-747b-49ed-ba2b-a645da326297","savedPayload":{"position":{"x":22691.51449970536,"y":16604.440138233305},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"5cc8df5d-637c-4059-88ca-b30193db45cd","savedPayload":{"position":{"x":22809.2274868391,"y":16689.13813848435},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Trigger Stage Status","config":"{ \n\"codeName\": \"triggerStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a198b378-5db3-48ac-87c6-001cf2436cba","savedPayload":{"position":{"x":22909.36666025064,"y":16794.028728661713},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Status","config":"{ \n\"codeName\": \"openStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5d86e42b-515c-49de-b551-f9c417224459","savedPayload":{"position":{"x":22988.530870393646,"y":16915.522479629064},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Manage Stage Status","config":"{ \n\"codeName\": \"manageStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"88646d32-0ccf-47c8-bdc6-b65810acba2d","savedPayload":{"position":{"x":23044.019944843367,"y":17049.496055436164},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Status","config":"{ \n\"codeName\": \"closeStageStatus\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"85fc50a0-7173-456a-95cc-44402fea6af5","savedPayload":{"position":{"x":23073.95189318231,"y":17191.38587163465},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e44d0b8d-1bd1-457b-b3ec-efafe83135e2","savedPayload":{"position":{"x":23077.298799171538,"y":17336.045949588268},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"c1181965-30d7-455c-84f8-b59a10b17292","savedPayload":{"position":{"x":23053.94900543769,"y":17479.16462496729},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f233bd2e-9c8a-415c-b348-890e2b8c835b","savedPayload":{"position":{"x":23004.695555540704,"y":17615.55604320322},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"09b0f818-5159-433b-8eae-f0209351e6b3","savedPayload":{"position":{"x":22931.200403049163,"y":17740.584485085954},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"8cfbc9c3-071f-43d0-b245-4c0278f975c0","savedPayload":{"position":{"x":22835.943566779,"y":17850.00495711049},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.strategy.strategyCounters\"\n}","id":"bb8b605d-bf3a-4408-a147-f316bdee7df7","savedPayload":{"position":{"x":22721.90398106936,"y":17940.202288937093},"targetPosition":{"x":22293.497230896344,"y":17281.8755565129},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"325b09da-1fc2-43bc-a59d-381c30a4ba1d","savedPayload":{"position":{"x":22293.497230896344,"y":17281.8755565129},"targetPosition":{"x":21567.31702416418,"y":17582.35418486395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"0625f524-2b97-4b4d-8a90-590ffc62ecd3","savedPayload":{"position":{"x":21567.538132906047,"y":17582.256393659754},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Last Strategy","id":"028aaa23-630c-4aa6-a168-6b2a128b1a83"}}},{"type":"Product Definition","name":"Current Position","config":"{\n \"codeName\": \"Current-Position\",\n \"singularVariableName\": \"currentPosition\",\n \"pluralVariableName\": \"currentPosition\",\n \"nodePath\": \"tradingEngine.current.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"7506dd91-ad9d-4aad-bb1a-604bc5d3fe8d","savedPayload":{"position":{"x":22040.267503266125,"y":17002.814360997},"targetPosition":{"x":21670.602547949547,"y":17696.530705321857},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"06678152-1082-4f00-9275-22ffde715469","savedPayload":{"position":{"x":22277.441667426247,"y":17197.255324471014},"targetPosition":{"x":21670.602547949547,"y":17696.530705321857},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"6e9bd403-9341-4573-9509-39592db0f4ae","savedPayload":{"position":{"x":22264.00287143656,"y":16698.227042658516},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"e9f969f0-20f4-4d61-870b-2997e715c706","savedPayload":{"position":{"x":22350.53675586669,"y":16684.565445940425},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"c9761b5c-3714-4253-9906-873e8933e698","savedPayload":{"position":{"x":22435.541864945135,"y":16680.990811373227},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"e0d6465b-de24-4ce2-9cc3-b7e3e563d4d7","savedPayload":{"position":{"x":22519.157299830764,"y":16686.691591865183},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f03c45fb-c2ca-4294-abce-650cf8656471","savedPayload":{"position":{"x":22601.069081831778,"y":16701.144630627994},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f1b6b7c1-d1ec-4ce6-a814-5e3fc4998262","savedPayload":{"position":{"x":22680.692553686295,"y":16724.080365552494},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Orders Size","config":"{ \n\"codeName\": \"openStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"b36dae4c-477c-4295-9e8c-d7ac06a669cd","savedPayload":{"position":{"x":22757.31351310633,"y":16755.20665611268},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Filled Size","config":"{ \n\"codeName\": \"openStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"40975420-ba2c-48cc-856d-a1c6e32dc29a","savedPayload":{"position":{"x":22830.192312508494,"y":16794.13586518061},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Orders Size","config":"{ \n\"codeName\": \"closeStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f88f3faa-dbf2-4a57-8217-e7fde7fc6a97","savedPayload":{"position":{"x":22898.54920212873,"y":16840.476304570162},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Filled Size","config":"{ \n\"codeName\": \"closeStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"3f0ded9a-ec78-487f-bfd4-588d1b244a84","savedPayload":{"position":{"x":22961.68726499863,"y":16893.681062165982},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"1b892131-86ea-4264-bfae-3eae52374803","savedPayload":{"position":{"x":23018.88423693278,"y":16953.21073490057},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f7d48869-1ac5-4e6c-9f73-52112cf5a9c8","savedPayload":{"position":{"x":23069.554903634817,"y":17018.38048050087},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"08064bc3-d662-46d7-a9ac-da517de9f0f3","savedPayload":{"position":{"x":23113.13258840505,"y":17088.48965164737},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"07748c3d-c020-4734-b505-38ceeb96ddc2","savedPayload":{"position":{"x":23149.132275754735,"y":17162.77339703203},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5f987e27-560f-485d-b832-46025f14f446","savedPayload":{"position":{"x":23177.174533544505,"y":17240.41150705034},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionCounters\"\n}","id":"c00c9780-7a99-40fe-8563-9ef38089edae","savedPayload":{"position":{"x":23196.928062974806,"y":17320.55886701572},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"3c081ea4-6bcb-4ba2-8e3e-2f572b428003","savedPayload":{"position":{"x":23208.21806452902,"y":17402.330398968243},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"d6e98d71-15ee-4e22-b18c-b154b1ecec52","savedPayload":{"position":{"x":23210.836714495308,"y":17484.83164447438},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{ \n\"codeName\": \"ROI\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"9705d87a-bc3a-473e-b205-4eefcbbeeb21","savedPayload":{"position":{"x":23204.803334802335,"y":17567.145185851008},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hit Fail","config":"{ \n\"codeName\": \"hitFail\",\n\"isString\": true,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\"\n}","id":"14d4fbc8-7b1b-4b27-a9ed-c4c5601116d8","savedPayload":{"position":{"x":23190.191425112025,"y":17648.37105550223},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"90759217-f2a3-4203-8249-35c703108863","savedPayload":{"position":{"x":23167.178613184242,"y":17727.626035250327},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"905584a9-29a2-4e59-be9d-7859ada74e43","savedPayload":{"position":{"x":23136.006951452102,"y":17804.040686784396},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"a85c3f00-4b38-430d-a911-b404de9c2ce3","savedPayload":{"position":{"x":23097.01434061574,"y":17876.775698122663},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss","config":"{\n \"codeName\": \"stopLoss\",\n \"isString\": false\n}","id":"9aadbadf-d791-4407-bb2e-39f1160ec4a3","savedPayload":{"position":{"x":23050.632390725743,"y":17945.036401330417},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Stage","config":"{\n \"codeName\": \"stopLossStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"6e0a86e9-90b1-486f-9dbb-275c5fcdd446","savedPayload":{"position":{"x":22997.363202709093,"y":18008.069129352865},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"stopLossPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"b6736f8c-0a25-4f37-b8a6-e89d9e1da23f","savedPayload":{"position":{"x":22937.806802527546,"y":18065.200332239692},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit","config":"{\n \"codeName\": \"takeProfit\",\n \"isString\": false\n}","id":"17af9724-48c7-46f7-8338-bfe189768f8b","savedPayload":{"position":{"x":22872.591268587777,"y":18115.77400802617},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit Stage","config":"{\n \"codeName\": \"takeProfitStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"f1e44667-8b58-417e-a6b7-41935bb37f7f","savedPayload":{"position":{"x":22802.460989112737,"y":18159.281079468325},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"takeProfitPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"be62b154-fcd4-4e9f-8dc7-dc8b6f0861d4","savedPayload":{"position":{"x":22707.855058088495,"y":18202.03061433486},"targetPosition":{"x":22422.618672990677,"y":17468.86288222258},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a35249e0-a2dc-43b0-bb8c-ebd6265e13c2","savedPayload":{"position":{"x":22422.618672990677,"y":17468.86288222258},"targetPosition":{"x":21670.602547949547,"y":17696.530705321857},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"832ecada-8da3-4ba6-b6e9-be34dd5f7ce9","savedPayload":{"position":{"x":21670.99923332494,"y":17696.408467747027},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Current Position","id":"0d2212c7-07bb-4c41-94fb-00844415ba5e"}}},{"type":"Product Definition","name":"Last Position","config":"{\n \"codeName\": \"Last-Position\",\n \"singularVariableName\": \"lastPosition\",\n \"pluralVariableName\": \"lastPosition\",\n \"nodePath\": \"tradingEngine.last.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"485671ff-0d50-4c08-958c-93e657cd238f","savedPayload":{"position":{"x":22198.44539170496,"y":17166.12494176518},"targetPosition":{"x":21762.36312002314,"y":17820.236149127704},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a909df42-6192-4bbd-9f38-e8800149aaa1","savedPayload":{"position":{"x":22415.46455227597,"y":17382.93020381221},"targetPosition":{"x":21762.36312002314,"y":17820.236149127704},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"a616f774-00d3-475e-b0b6-631a93777573","savedPayload":{"position":{"x":22450.987417558463,"y":16884.706094065226},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"2e577616-21a7-4199-a64f-d90386edc6ec","savedPayload":{"position":{"x":22538.447889526153,"y":16879.515924606156},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9993ddd9-d4f8-4eef-91db-45eb57c04d8e","savedPayload":{"position":{"x":22623.38571326345,"y":16884.34684049592},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"dd7f3f5d-3f52-4256-b7e1-c2d94aa85795","savedPayload":{"position":{"x":22706.042192006684,"y":16898.197541887013},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"04c30c87-9bca-4e8e-b1a1-ef3f43e285a0","savedPayload":{"position":{"x":22786.14128188494,"y":16920.613973110052},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"373f6f5b-ce4b-403f-b92e-11dc556a3591","savedPayload":{"position":{"x":22863.13370672779,"y":16951.242578832134},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Orders Size","config":"{ \n\"codeName\": \"openStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"277c30dd-86c6-42a3-a300-c12638f76b0b","savedPayload":{"position":{"x":22936.342950587474,"y":16989.716448932453},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open Stage Filled Size","config":"{ \n\"codeName\": \"openStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"75f08f49-cf5e-469e-8062-e2920fa82997","savedPayload":{"position":{"x":23005.051385759452,"y":17035.607122606812},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Orders Size","config":"{ \n\"codeName\": \"closeStageOrdersSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"42fbea49-8604-4a55-aa95-a86a722ddfb3","savedPayload":{"position":{"x":23068.548165541175,"y":17088.412943140225},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close Stage Filled Size","config":"{ \n\"codeName\": \"closeStageFilledSize\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"e685a10b-4cad-4a04-bbf1-74e6ecce1e74","savedPayload":{"position":{"x":23126.15826163939,"y":17147.55787308223},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e7f50ea4-ebd4-448f-bd18-54fc2d7e2e7b","savedPayload":{"position":{"x":23177.26049308717,"y":17212.396036161826},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"d9ff5483-8800-49f7-8d9f-9e8e48f8b795","savedPayload":{"position":{"x":23221.299765760832,"y":17282.21841165996},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"f0e01315-185f-4092-9b13-0f529a794336","savedPayload":{"position":{"x":23257.79584438494,"y":17356.260727606168},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a41e9fac-16b2-4b08-b9e8-b494359f1737","savedPayload":{"position":{"x":23286.349948351806,"y":17433.712036166533},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e6137e7e-940e-44b9-937f-4c6a89709af4","savedPayload":{"position":{"x":23306.649773751484,"y":17513.723772864243},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionCounters\"\n}","id":"3976c01c-c92d-47b1-965d-4e4d7678a59a","savedPayload":{"position":{"x":23318.473226998165,"y":17595.419180111865},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n \"decimals\": 2\n}","id":"81ca02e5-e287-407f-9101-891748e4eacc","savedPayload":{"position":{"x":23321.659639453374,"y":17677.901418441914},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n\"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n \"decimals\": 2\n}","id":"14559572-40c1-4cc7-b20b-5b7189bc1ece","savedPayload":{"position":{"x":23316.17720814917,"y":17760.25390016213},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{ \n\"codeName\": \"ROI\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n \"decimals\": 2\n}","id":"70ab7683-aa08-49d6-86cd-17a527f9ae77","savedPayload":{"position":{"x":23302.129042923443,"y":17841.58107224677},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Hit Fail","config":"{ \n\"codeName\": \"hitFail\",\n\"isString\": true,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\"\n}","id":"d1f5644b-c52d-4bbe-a8ec-e6d1d09d50a8","savedPayload":{"position":{"x":23279.653663477,"y":17920.991654110367},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"5a796662-dd46-4e75-8d5b-192ec323901e","savedPayload":{"position":{"x":23249.002591671837,"y":17997.618120417326},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"373f4395-e367-4089-ad1c-6bcefb4a1d40","savedPayload":{"position":{"x":23210.50910561027,"y":18070.620417624956},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.last.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"337bc66f-9deb-4e01-b4a8-24cac360726f","savedPayload":{"position":{"x":23164.595167170508,"y":18139.19887885872},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss","config":"{\n \"codeName\": \"stopLoss\",\n \"isString\": false\n}","id":"4c576425-680e-46ae-8a5d-a8548e256ec1","savedPayload":{"position":{"x":23111.7630239789,"y":18202.601313738134},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Stage","config":"{\n \"codeName\": \"stopLossStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.last.position.stopLoss\"\n}","id":"13e0df5d-450c-425a-9fde-2e1248012548","savedPayload":{"position":{"x":23052.59261997463,"y":18260.13384577472},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"stopLossPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.last.position.stopLoss\"\n}","id":"7865ef71-3d83-4b6c-9275-fd3199183464","savedPayload":{"position":{"x":22987.730677126005,"y":18311.163722651745},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit","config":"{\n \"codeName\": \"takeProfit\",\n \"isString\": false\n}","id":"32bd62c3-8eab-40cd-9830-32952105a924","savedPayload":{"position":{"x":22917.89080330577,"y":18355.135914722083},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit Stage","config":"{\n \"codeName\": \"takeProfitStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.last.position.takeProfit\"\n}","id":"c7455fce-ac8e-4182-ba13-22df021007a8","savedPayload":{"position":{"x":22843.839469765124,"y":18391.573509062793},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"takeProfitPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.last.position.takeProfit\"\n}","id":"fadb0e4d-25bf-4359-9e9f-3aa83fdcf214","savedPayload":{"position":{"x":22745.68112312015,"y":18424.813202431247},"targetPosition":{"x":22533.321412498663,"y":17667.190613368002},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"731e7326-c591-4d9f-a9d7-1c7abd42156f","savedPayload":{"position":{"x":22533.321412498663,"y":17667.190613368002},"targetPosition":{"x":21762.36312002314,"y":17820.236149127704},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"477cd6d5-862a-44d0-9313-786a4e63a602","savedPayload":{"position":{"x":21762.77354255197,"y":17820.152188985132},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Last Position","id":"08c88b9c-70f1-49ff-aa16-21f2bc1c0ba1"}}},{"type":"Product Definition","name":"Previous Balance","config":"{\n \"codeName\": \"Previous-Balance\",\n \"singularVariableName\": \"previousBalance\",\n \"pluralVariableName\": \"previousBalance\",\n \"nodePath\": \"tradingEngine.previous.balance\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"7e78025f-e284-4ca1-9351-bc5699491e4f","savedPayload":{"position":{"x":22340.304463090375,"y":17344.46283175102},"targetPosition":{"x":21841.886678547377,"y":17952.305064362765},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2aa4b10e-4d73-4391-b820-950038505045","savedPayload":{"position":{"x":22535.03121699445,"y":17581.645545044925},"targetPosition":{"x":21841.886678547377,"y":17952.305064362765},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"86aaed8a-b830-4417-ba6d-9cf9b98b31f3","savedPayload":{"position":{"x":23021.25160659101,"y":17197.956055942628},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"ce8d7ef3-9ca2-4565-a132-09fc49fa27ae","savedPayload":{"position":{"x":23343.656415203408,"y":17560.844964123906},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Base Asset","config":"{\n \"codeName\": \"baseAsset\",\n \"isString\": false\n}","id":"f4ea9bc8-f9fc-4998-b345-5f13972197b2","savedPayload":{"position":{"x":23391.222253608008,"y":18043.59828551502},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Quoted Asset","config":"{\n \"codeName\": \"quotedAsset\",\n \"isString\": false\n}","id":"512ffd5f-2760-402f-a584-04760a1b0dea","savedPayload":{"position":{"x":23145.795143225798,"y":18462.351864894812},"targetPosition":{"x":22624.145783160133,"y":17875.51417278459},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"108ee474-20f5-498f-aa5f-a0e56d3567f7","savedPayload":{"position":{"x":22624.145783160133,"y":17875.51417278459},"targetPosition":{"x":21841.886678547377,"y":17952.305064362765},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"cb56a148-6bbb-4dac-9506-7b6503c98a53","savedPayload":{"position":{"x":21841.977019574413,"y":17952.295749970446},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Previous Balance","id":"77dc9564-5ed0-4ce9-9e45-d23e396d336f"}}},{"type":"Product Definition","name":"Market Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders\", \n \"singularVariableName\": \"marketBuyOrder\", \n \"pluralVariableName\": \"marketBuyOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a2ea8001-2143-4055-b1d3-525d95fa8e6f","savedPayload":{"position":{"x":22462.80800775292,"y":17535.169925266324},"targetPosition":{"x":21907.53994973232,"y":18091.564238111518},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"557357c6-f814-4bf9-9426-82fc5e22c028","savedPayload":{"position":{"x":22633.388054813215,"y":17790.237904366404},"targetPosition":{"x":21907.53994973232,"y":18091.564238111518},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"1f788bde-d5cc-4556-9cb3-f6ad2a085870","savedPayload":{"position":{"x":22799.47647572358,"y":17312.73887210429},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"cbe57e07-e492-45ef-be26-6e5ace5cc49d","savedPayload":{"position":{"x":22905.22526229177,"y":17334.676886950307},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"0eef5d2a-489b-402b-a1bc-bbf6105bc226","savedPayload":{"position":{"x":23006.49198616727,"y":17370.63054965501},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"76a37b2a-ff68-425c-95ae-9da13d4f11e3","savedPayload":{"position":{"x":23101.809751457753,"y":17420.00769801173},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"81aa9c0a-b729-471f-8b3f-046d83779376","savedPayload":{"position":{"x":23189.482908956983,"y":17481.891456090812},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"48215010-5717-4f29-aa92-edc16d881270","savedPayload":{"position":{"x":23267.90246467202,"y":17555.12819032762},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7cb827e9-8294-4990-826c-8f2421ce4542","savedPayload":{"position":{"x":23335.610855495954,"y":17638.35588131103},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"588b02df-d269-4fac-a942-0e148bef8573","savedPayload":{"position":{"x":23391.354797449458,"y":17730.023954783985},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f44959e8-ba4e-41f2-a349-7003d00ef570","savedPayload":{"position":{"x":23434.09528252291,"y":17828.426820134595},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"43c9c172-0930-4a94-86c4-6de1b82604d3","savedPayload":{"position":{"x":23463.03784982736,"y":17931.73316793798},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e637160d-ab4a-4d36-8324-994615efa900","savedPayload":{"position":{"x":23477.642618663784,"y":18038.016852507826},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b9cf9af0-758e-46c8-ad34-0afb01aa1658","savedPayload":{"position":{"x":23477.64168098251,"y":18144.999340696828},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderCounters\"\n}","id":"69f674b7-9532-406e-bda9-6a128a9b3e8b","savedPayload":{"position":{"x":23463.031738176407,"y":18251.277767404135},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"2180ac7e-b09a-404f-86cd-3e0d0eb0635f","savedPayload":{"position":{"x":23434.085396370516,"y":18354.580741904163},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"5f50a6c7-0123-4f45-802c-897b7f1d9186","savedPayload":{"position":{"x":23391.344502566884,"y":18452.978966733197},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"81cb024b-b64e-4f2c-be9d-c343fc27b08e","savedPayload":{"position":{"x":23335.600303524305,"y":18544.641375883577},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"06982b1c-a048-4789-96d0-ffee927cc551","savedPayload":{"position":{"x":23267.890499836423,"y":18627.85682886832},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"ff92e722-7f93-4935-ab39-5fe5d901d275","savedPayload":{"position":{"x":23189.475337022137,"y":18701.07929324306},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"7ed49f47-7cf0-4c04-8ec7-c42b77bbc496","savedPayload":{"position":{"x":23101.80417807712,"y":18762.938970792507},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"9033bc32-f754-4d94-87a6-4c16cd8ca7d7","savedPayload":{"position":{"x":23006.49156482047,"y":18812.28919844504},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"1524688a-c64c-434c-84ea-79e57f7e37bc","savedPayload":{"position":{"x":22905.24103964037,"y":18848.207434998145},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"200c3a3d-f082-4cb0-86b1-ba12429f6c0e","savedPayload":{"position":{"x":22799.442266553437,"y":18870.029891515514},"targetPosition":{"x":22693.562860069218,"y":18091.554559431253},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"2b743c15-4ca6-46e9-a96e-b0a62b42de60","savedPayload":{"position":{"x":22693.562860069218,"y":18091.554559431253},"targetPosition":{"x":21907.53994973232,"y":18091.564238111518},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"7c769317-2639-4460-8b88-9dc92f7b0585","savedPayload":{"position":{"x":21907.846797859784,"y":18091.56648669903},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Buy Orders","id":"50d624c9-9a6e-4d57-a147-29d5c004b3f2"}}},{"type":"Product Definition","name":"Market Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders\", \n \"singularVariableName\": \"marketSellOrder\", \n \"pluralVariableName\": \"marketSellOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"917cfdae-b736-4ed5-ad8e-d572c49ea489","savedPayload":{"position":{"x":22566.581952106775,"y":17737.306724454334},"targetPosition":{"x":21959.44271421669,"y":18236.577539934493},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"3c878a50-6d76-412b-95d7-f2e546960293","savedPayload":{"position":{"x":22711.28331336196,"y":18007.847492481527},"targetPosition":{"x":21959.44271421669,"y":18236.577539934493},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"7dd0d738-2116-4010-a9d5-19624a9bc097","savedPayload":{"position":{"x":22923.245352512386,"y":17548.923203313905},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"5843c701-ba88-42c1-97c2-215cb97b309c","savedPayload":{"position":{"x":23026.29632556757,"y":17581.219254606214},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"f3f77a4c-acf5-4026-aa2a-9b34e231a9d5","savedPayload":{"position":{"x":23123.55107201442,"y":17626.92753130917},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"cc0b04e1-acd8-413b-8366-e620d55a22be","savedPayload":{"position":{"x":23213.565188535522,"y":17685.409476904955},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"89bb217d-a5ce-4197-b33b-4b251e3ec5c9","savedPayload":{"position":{"x":23294.753046993104,"y":17755.583400181436},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"3a6b6603-5de8-47a1-b2cb-e2078397aca1","savedPayload":{"position":{"x":23365.610285734427,"y":17836.15472326569},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"3510116c-09e6-4758-baa9-09f976105f32","savedPayload":{"position":{"x":23424.838010502277,"y":17925.618648225878},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a0d62501-1822-4d56-afce-b5eee40212f7","savedPayload":{"position":{"x":23471.328061934655,"y":18022.31088876791},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"9f72bb4a-779d-453f-a7b2-bf240eec29fa","savedPayload":{"position":{"x":23504.215886528786,"y":18124.428207608955},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"7b91a979-7175-49aa-a83b-faa1d7c22bf3","savedPayload":{"position":{"x":23522.891249590768,"y":18230.07815914197},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b47e5776-92ed-468e-8040-16a655a9a92b","savedPayload":{"position":{"x":23527.01230396765,"y":18336.973170339454},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"178e1183-6b29-4a8b-b2a2-3e817bf56c0b","savedPayload":{"position":{"x":23516.497054808937,"y":18443.73812602662},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderCounters\"\n}","id":"16eb66bd-cbd5-4272-83bd-7aa5cbf79965","savedPayload":{"position":{"x":23491.541401097522,"y":18548.075451817665},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"3b37c095-0ab7-4102-a757-eccda2f06aa5","savedPayload":{"position":{"x":23452.61464369424,"y":18648.04193565059},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"4694fc1a-8031-4b21-8002-fb2259b98221","savedPayload":{"position":{"x":23400.43475411289,"y":18741.775175882052},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"a7a086da-8ba6-4283-9f8c-7ca3894a3844","savedPayload":{"position":{"x":23335.977902121842,"y":18827.526775218375},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"972a2ef4-0e93-46d1-b202-4f957bf83968","savedPayload":{"position":{"x":23260.440409154267,"y":18903.705296685643},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"3fdfa893-f3ff-4595-bfd1-e9e191a2f7de","savedPayload":{"position":{"x":23175.22815032847,"y":18968.888648200053},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"fd90ed73-a52a-41b0-988e-f85896e4e119","savedPayload":{"position":{"x":23081.914733809404,"y":19021.852714600107},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"2320eff7-cd11-46a6-8f2b-7c6c6bd9afa2","savedPayload":{"position":{"x":22982.222601105932,"y":19061.615996566008},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"cbcd69c4-f332-4615-a1aa-ff5a63c2f63a","savedPayload":{"position":{"x":22877.939913332775,"y":19087.43518209016},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"67d569c5-929d-4f9a-a7a2-1a31aecab027","savedPayload":{"position":{"x":22770.502027796636,"y":19098.779703596854},"targetPosition":{"x":22741.442294351935,"y":18313.724105942925},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"e2626cbd-29b0-4582-a408-4720feb8123d","savedPayload":{"position":{"x":22741.442294351935,"y":18313.724105942925},"targetPosition":{"x":21959.44271421669,"y":18236.577539934493},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"9cc7645a-54fe-40d6-9896-9278167011fb","savedPayload":{"position":{"x":21959.7484745496,"y":18236.62311547056},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Sell Orders","id":"4f84a1a5-f9cd-4b9d-9d91-661ba912e2ca"}}},{"type":"Product Definition","name":"Limit Buy Orders","config":"{ \n \"codeName\": \"Limit-Buy-Orders\", \n \"singularVariableName\": \"limitBuyOrder\", \n \"pluralVariableName\": \"limitBuyOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"df8cfaa4-a4d4-4bc1-9fa2-4f8e91e45a87","savedPayload":{"position":{"x":22650.054189434988,"y":17948.722491105946},"targetPosition":{"x":21996.860148376323,"y":18385.98181437228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"12652573-9506-4d3e-82bb-64b1bb9e7ce0","savedPayload":{"position":{"x":22767.470418539764,"y":18231.969074016008},"targetPosition":{"x":21996.860148376323,"y":18385.98181437228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"b0dc1303-0b65-4328-b885-f33d4ef395a6","savedPayload":{"position":{"x":23023.496047806082,"y":17795.91238627135},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"451e4e45-854c-4b9f-ac75-ddfe076fb6d8","savedPayload":{"position":{"x":23122.82540523234,"y":17838.215244683477},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"fa7958e6-31e1-4216-b3bf-f341cae3ad92","savedPayload":{"position":{"x":23215.126454720954,"y":17893.233300603595},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"f3230b63-049f-457a-abc1-9117d8443337","savedPayload":{"position":{"x":23298.978704656907,"y":17960.25915764779},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"544aae22-e5cf-41d2-912e-f19699a7f65a","savedPayload":{"position":{"x":23372.894255021165,"y":18038.06505267607},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7cccabcc-97ae-4e46-86b4-70c8b6ab73c5","savedPayload":{"position":{"x":23435.515702358614,"y":18125.183804926186},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"753014da-bd0e-460e-8262-2c5c00053610","savedPayload":{"position":{"x":23485.691646529438,"y":18220.020258800123},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"3f94ee88-bb65-4f46-9cef-c3468b2e5831","savedPayload":{"position":{"x":23522.481955597214,"y":18320.807223417887},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"fbe17bbd-1af9-4b97-be44-f267039077e5","savedPayload":{"position":{"x":23545.196500605376,"y":18425.66117414831},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"593c0354-1f6a-4ec1-879b-13f95de9d66d","savedPayload":{"position":{"x":23553.433107345176,"y":18532.632320044537},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"7a473c6b-849a-46f7-befa-661675c6b6a7","savedPayload":{"position":{"x":23547.030350325258,"y":18639.420416024037},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"7e05bfad-d3ba-4170-bb97-b02911c65b81","savedPayload":{"position":{"x":23526.10449852552,"y":18744.628365977278},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderCounters\"\n}","id":"e86cdc19-1330-4dbd-b0d9-6300bb84b504","savedPayload":{"position":{"x":23491.04569457313,"y":18846.016485333068},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"0975187c-acd1-4c90-9c2e-ad2f10453d0c","savedPayload":{"position":{"x":23442.50114518308,"y":18941.690008771504},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"dc8ff39f-2ebf-4097-a324-69714556e67e","savedPayload":{"position":{"x":23381.385199761615,"y":19029.843319454943},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"f39e7cb9-55cd-434a-9ef1-aaa1aec8fcfa","savedPayload":{"position":{"x":23308.847969564697,"y":19108.86552360332},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"dde11b27-9158-4627-a924-44c51f7d16fd","savedPayload":{"position":{"x":23226.20627620361,"y":19177.28041742948},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"e9f153ec-763f-45ce-ab8e-9095762a8b5c","savedPayload":{"position":{"x":23135.017864773752,"y":19233.775985191915},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"45ca3d8c-ba98-4ff9-8825-d515ad54d235","savedPayload":{"position":{"x":23036.963542445304,"y":19277.340584936377},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"7becceb8-d380-4e4e-b5ce-70b63b32445f","savedPayload":{"position":{"x":22933.859945933888,"y":19307.14226387487},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"4deb6a9d-3914-4a70-b2f5-992a09504eec","savedPayload":{"position":{"x":22827.537448977786,"y":19322.60942306547},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"3213e0e6-5b5f-4e9a-b67e-33f596bad152","savedPayload":{"position":{"x":22719.81100894819,"y":19323.353885069864},"targetPosition":{"x":22767.56633846995,"y":18539.269846787156},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d3c594aa-6573-44f7-b93e-2bd2b0d4134e","savedPayload":{"position":{"x":22767.56633846995,"y":18539.269846787156},"targetPosition":{"x":21996.860148376323,"y":18385.98181437228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"4c827ee0-a29b-4b65-8438-03e2ea98b410","savedPayload":{"position":{"x":21997.182192732776,"y":18386.06863908954},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Buy Orders","id":"17ec46bd-e5c0-48d5-a3b6-e108cc835f17"}}},{"type":"Product Definition","name":"Limit Sell Orders","config":"{ \n \"codeName\": \"Limit-Sell-Orders\", \n \"singularVariableName\": \"limitSellOrder\", \n \"pluralVariableName\": \"limitSellOrders\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"f645108f-4648-497f-b361-0be5b84c233a","savedPayload":{"position":{"x":22712.352603609088,"y":18167.028790758803},"targetPosition":{"x":22019.4748685572,"y":18538.346600263896},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"e98191d1-5b13-42eb-bd52-31e3c6830188","savedPayload":{"position":{"x":22801.615982509895,"y":18460.649743455666},"targetPosition":{"x":22019.4748685572,"y":18538.346600263896},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"5d3f01ca-9d2b-4446-906c-0f9dfcf8016f","savedPayload":{"position":{"x":23098.970763590212,"y":18052.153803092413},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"ef7f6f85-9aac-4eb1-935e-84c03beb5ae0","savedPayload":{"position":{"x":23193.84559016366,"y":18103.789327016635},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"68c5cf4d-ee84-4d53-be73-923d6ec0c070","savedPayload":{"position":{"x":23280.31007292391,"y":18167.593216238878},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"f551a912-c93a-49a5-8ec6-b23845504195","savedPayload":{"position":{"x":23357.191195411207,"y":18242.515607309706},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"5ca3123d-351b-4b1b-9bdd-2be83cb30d4b","savedPayload":{"position":{"x":23423.12655462289,"y":18327.186317197724},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a4d2dcb3-66b5-4689-9ff5-6e79ca264c3a","savedPayload":{"position":{"x":23476.907917968783,"y":18420.034537858555},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"8af29013-dc77-42f5-a65a-703ef24782ac","savedPayload":{"position":{"x":23517.5416517523,"y":18519.335519701483},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"74cfaaa3-4241-4585-bb78-afe6ab4fad13","savedPayload":{"position":{"x":23544.276746116328,"y":18623.24149504987},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e79e457e-0f39-4444-b196-e2ab8e9d51b3","savedPayload":{"position":{"x":23556.614940063922,"y":18729.817362548023},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"26467972-56e9-445c-84cc-043cf332e7cf","savedPayload":{"position":{"x":23554.32654811575,"y":18836.780251784072},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"259e069d-8c48-4b18-b3be-876eb376edfd","savedPayload":{"position":{"x":23537.45671581392,"y":18942.724470563724},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"ab79d27c-63b2-4b9c-986c-69551d4acda6","savedPayload":{"position":{"x":23506.319525391547,"y":19045.385974436507},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderCounters\"\n}","id":"df8ad782-de40-443e-9c25-0c9fd06c0ddd","savedPayload":{"position":{"x":23461.49272867842,"y":19142.847857159777},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"4a1dc949-315f-4cff-8ae5-111195dd8565","savedPayload":{"position":{"x":23403.814296425753,"y":19233.29650155639},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"2adf7743-fa8c-484c-b2b2-16c144f2aa8c","savedPayload":{"position":{"x":23334.35570752959,"y":19315.045598311764},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"1243e887-177d-42fc-990c-1a0eec7868ca","savedPayload":{"position":{"x":23254.411583725694,"y":19386.5724233219},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"5e199034-7c71-4265-afda-940024e14870","savedPayload":{"position":{"x":23165.467186452926,"y":19446.541688606154},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"fd5472c9-a36f-4281-891d-57380ca2ef6c","savedPayload":{"position":{"x":23069.179344935492,"y":19493.8357977934},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"87559a66-ff26-4cfb-b9db-baa312369ee1","savedPayload":{"position":{"x":22967.33160184239,"y":19527.570464620814},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"84f5a086-9b8d-4296-bba1-bccfc56fb263","savedPayload":{"position":{"x":22861.8025672143,"y":19547.111569052366},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"8bf3e674-bbc9-4ff6-bcba-c9487d5215a3","savedPayload":{"position":{"x":22754.788268110948,"y":19552.0736208747},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"1d59f7dc-e3c9-4456-8980-3fded2a58f1a","savedPayload":{"position":{"x":22647.221861109687,"y":19542.231164282763},"targetPosition":{"x":22771.568002234162,"y":18766.63044010965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"38241371-e97c-4eb5-989e-26605c078620","savedPayload":{"position":{"x":22771.568002234162,"y":18766.63044010965},"targetPosition":{"x":22019.4748685572,"y":18538.346600263896},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"2c753cd8-36d8-466c-bd80-1ebfa8e314dc","savedPayload":{"position":{"x":22019.78743974257,"y":18538.463794307896},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Sell Orders","id":"1ec8da3f-8749-430d-8ad9-35fffc0d61ec"}}},{"type":"Product Definition","name":"Previous Candle","config":"{\n \"codeName\": \"Previous-Candle\",\n \"singularVariableName\": \"previousCandle\",\n \"pluralVariableName\": \"previousCandles\",\n \"nodePath\": \"tradingEngine.previous.candle\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"34de89b0-406c-4132-b308-053bc1d90a38","savedPayload":{"position":{"x":22753.31229330402,"y":18391.019869330314},"targetPosition":{"x":22027.2127016594,"y":18692.22991208055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"d1533eeb-1c10-4a6b-97ea-d619441946e4","savedPayload":{"position":{"x":22813.29513249138,"y":18692.04300334928},"targetPosition":{"x":22027.2127016594,"y":18692.22991208055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"0dd31575-41d7-46be-9ddc-b99faa63be51","savedPayload":{"position":{"x":23308.724663900804,"y":18437.599124956818},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"d5995df9-321a-4ebd-9904-cc138f604548","savedPayload":{"position":{"x":23479.005402623756,"y":18692.510774535225},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Open","config":"{\n \"codeName\": \"open\",\n \"isString\": false\n}","id":"2d274b55-5419-4003-b562-366b5224887c","savedPayload":{"position":{"x":23538.783309465776,"y":18993.01633732719},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Close","config":"{\n \"codeName\": \"close\",\n \"isString\": false\n}","id":"52ef21ec-9a2c-40d4-bf93-16efbc90eb09","savedPayload":{"position":{"x":23479.005310832086,"y":19293.41286975378},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Min","config":"{\n \"codeName\": \"min\",\n \"isString\": false\n}","id":"6ecac487-5839-4378-89c7-3b7fbf70562e","savedPayload":{"position":{"x":23308.7605564346,"y":19548.225969753777},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Max","config":"{\n \"codeName\": \"max\",\n \"isString\": false\n}","id":"185b37ee-53e7-4148-8104-77ee9cb28ee8","savedPayload":{"position":{"x":23053.981039507325,"y":19718.470570535563},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"8f971956-9ebc-45ac-b369-2eceb6bcc521","savedPayload":{"position":{"x":22753.406584775257,"y":19778.175132422497},"targetPosition":{"x":22753.345787397826,"y":18993.015543666716},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"09d22e28-1bbd-462d-a7d2-66c17869f442","savedPayload":{"position":{"x":22753.345787397826,"y":18993.015543666716},"targetPosition":{"x":22027.2127016594,"y":18692.22991208055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"6635f207-1048-48be-8bf2-8328ebafa782","savedPayload":{"position":{"x":22027.346517684706,"y":18692.2552950763},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Previous Candle","id":"076dcee2-2923-4455-8697-263649515a3b"}}},{"type":"Product Definition","name":"Trading System Highlights","config":"{\n \"codeName\": \"Trading-System-Highlights\",\n \"singularVariableName\": \"tradingSystemHighlight\",\n \"pluralVariableName\": \"tradingSystemHighlights\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"6e0f951c-25e7-4b92-85da-8be04d424bd0","savedPayload":{"position":{"x":22771.86727453686,"y":18617.4091447452},"targetPosition":{"x":22019.70988949565,"y":18845.902585453165},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"fa53ecfb-a558-4810-b6f8-1f9c6c8bfc5b","savedPayload":{"position":{"x":22802.05148403451,"y":18922.66307319812},"targetPosition":{"x":22019.70988949565,"y":18845.902585453165},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"9fefb3c2-2293-4ffa-8db8-9430dd662bcf","savedPayload":{"position":{"x":23464.43074166981,"y":18988.496421096494},"targetPosition":{"x":22712.88773828317,"y":19216.3696160829},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"431d65d9-1f6d-4e73-8655-cbf36854d3cf","savedPayload":{"position":{"x":23405.51795958285,"y":19586.392433201883},"targetPosition":{"x":22712.88773828317,"y":19216.3696160829},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Highlights","config":"{\n \"codeName\": \"highlights\",\n \"isString\": false\n}","id":"6355df8f-6845-4652-8ebc-90468c526949","savedPayload":{"position":{"x":22941.022178773277,"y":19967.641548742118},"targetPosition":{"x":22712.88773828317,"y":19216.3696160829},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"af6916b9-83d1-478b-ac92-35ea4f9b8a46","savedPayload":{"position":{"x":22712.88773828317,"y":19216.3696160829},"targetPosition":{"x":22019.70988949565,"y":18845.902585453165},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"319f660a-78be-4cf4-8052-877837cad806","savedPayload":{"position":{"x":22019.786446662296,"y":18846.01973786281},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Highlights","id":"d979c9f0-530a-41d3-a357-b57a3e4f2201"}}},{"type":"Product Definition","name":"Trading System Values","config":"{\n \"codeName\": \"Trading-System-Values\",\n \"singularVariableName\": \"tradingSystemValue\",\n \"pluralVariableName\": \"tradingSystemValues\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"9c4ec2f8-f4a8-45b9-aba3-b093a7b8f86a","savedPayload":{"position":{"x":22768.06463317007,"y":18844.589969606553},"targetPosition":{"x":21997.112484726138,"y":18998.268703916943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"b3d3fe62-e714-4cb9-a78d-55bc0add1d7c","savedPayload":{"position":{"x":22768.17539619483,"y":19151.30848795424},"targetPosition":{"x":21997.112484726138,"y":18998.268703916943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"956e9238-3cd9-4258-9295-77d3ad473508","savedPayload":{"position":{"x":23420.926950168105,"y":19281.780097090053},"targetPosition":{"x":22650.634923447473,"y":19434.878581956862},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"dbb03ed7-1d1f-4105-b559-eac7b4d8d4d9","savedPayload":{"position":{"x":23303.68065752109,"y":19871.00407068703},"targetPosition":{"x":22650.634923447473,"y":19434.878581956862},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Values","config":"{\n \"codeName\": \"values\",\n \"isString\": false\n}","id":"2349e00c-f032-432b-8c9a-07c1606574e8","savedPayload":{"position":{"x":22804.20190944071,"y":20204.750536147407},"targetPosition":{"x":22650.634923447473,"y":19434.878581956862},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a65db5f6-3b75-435d-8155-2e2c7af39279","savedPayload":{"position":{"x":22650.634923447473,"y":19434.878581956862},"targetPosition":{"x":21997.112484726138,"y":18998.268703916943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"c90c009b-588d-45d4-aff1-05e375181dfa","savedPayload":{"position":{"x":21997.180265637075,"y":18998.414494403452},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Values","id":"476925ed-e2ac-443d-82f3-501b64ca6c87"}}},{"type":"Product Definition","name":"Trading System Errors","config":"{\n \"codeName\": \"Trading-System-Errors\",\n \"singularVariableName\": \"tradingSystemError\",\n \"pluralVariableName\": \"tradingSystemErrors\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2ef33675-fc52-49fd-a8ef-bc5da1711dd1","savedPayload":{"position":{"x":22742.019351719897,"y":19070.341083215888},"targetPosition":{"x":21959.697242746886,"y":19147.701162110185},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2d0dd4c2-4f4c-4d8c-b9a5-9ca62f186369","savedPayload":{"position":{"x":22712.04565897299,"y":19375.542136015443},"targetPosition":{"x":21959.697242746886,"y":19147.701162110185},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"49f8debb-5e74-467d-be5a-4d0cb9695709","savedPayload":{"position":{"x":23348.95587510403,"y":19569.318032413423},"targetPosition":{"x":22567.324048044513,"y":19646.1698717062},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"1129b6b6-a686-4f24-b37f-f2a503586a19","savedPayload":{"position":{"x":23174.535685194285,"y":20144.21112921656},"targetPosition":{"x":22567.324048044513,"y":19646.1698717062},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Errors","config":"{\n \"codeName\": \"errors\",\n \"isString\": false\n}","id":"e994737a-9a14-40f0-8ad0-a151c799a094","savedPayload":{"position":{"x":22643.14113485898,"y":20470.07456238336},"targetPosition":{"x":22567.324048044513,"y":19646.1698717062},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"cbcd5cb4-66b1-4535-9592-0164a480b7f7","savedPayload":{"position":{"x":22567.324048044513,"y":19646.1698717062},"targetPosition":{"x":21959.697242746886,"y":19147.701162110185},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"1d9c570d-77c7-40ac-a61e-c5a57a411de8","savedPayload":{"position":{"x":21959.745539897565,"y":19147.859996768973},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Errors","id":"64684730-d049-4d3c-8013-b48c5438417e"}}},{"type":"Product Definition","name":"Trading System Status","config":"{\n \"codeName\": \"Trading-System-Status\",\n \"singularVariableName\": \"tradingSystemState\",\n \"pluralVariableName\": \"tradingSystemStatus\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2b83dc93-dc14-44d9-8f8c-889f39a952da","savedPayload":{"position":{"x":22693.954637358514,"y":19292.334838193103},"targetPosition":{"x":21907.7827420404,"y":19292.71239934262},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0f8dcda3-1eab-439d-956c-c6eb9b1c481f","savedPayload":{"position":{"x":22634.224341119232,"y":19593.14017292083},"targetPosition":{"x":21907.7827420404,"y":19292.71239934262},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"214b03c2-5fc3-4157-bcfd-4796b0565d98","savedPayload":{"position":{"x":23249.158408571988,"y":19848.163806056742},"targetPosition":{"x":22463.70748656824,"y":19848.1674433746},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"78c4b87a-592d-49ca-9c8c-f5d0dae8d7ba","savedPayload":{"position":{"x":23019.305737200604,"y":20403.318702883975},"targetPosition":{"x":22463.70748656824,"y":19848.1674433746},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{\n \"codeName\": \"status\",\n \"isString\": false\n}","id":"fdb4b903-20ff-4a67-a03f-f02e67b5d81b","savedPayload":{"position":{"x":22463.71156513114,"y":20633.444395955914},"targetPosition":{"x":22463.70748656824,"y":19848.1674433746},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"04b0fd4c-df6f-40df-9567-60a735d126e6","savedPayload":{"position":{"x":22463.70748656824,"y":19848.1674433746},"targetPosition":{"x":21907.7827420404,"y":19292.71239934262},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"eed48c80-35c5-49fa-b12d-18e7280ffb8f","savedPayload":{"position":{"x":21907.842745681683,"y":19292.91666836401},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Status","id":"0437448d-8740-496b-8fce-d3804be81a2b"}}},{"type":"Product Definition","name":"Trading System Progress","config":"{\n \"codeName\": \"Trading-System-Progress\",\n \"singularVariableName\": \"tradingSystemProgress\",\n \"pluralVariableName\": \"tradingSystemProgresses\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"77735fc0-9ce6-4dec-a3ad-8075a22eda40","savedPayload":{"position":{"x":22624.402935459013,"y":19508.249831127316},"targetPosition":{"x":21841.919940047454,"y":19431.977077639505},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2fde11bd-4515-4a4e-9dc0-f6869dd3a04e","savedPayload":{"position":{"x":22535.56001837024,"y":19801.906231063138},"targetPosition":{"x":21841.919940047454,"y":19431.977077639505},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"076e6f4d-1b05-42e1-abc6-c50c935ef056","savedPayload":{"position":{"x":23137.09577024774,"y":20096.479239283995},"targetPosition":{"x":22355.475034198163,"y":20019.55802245936},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"280a33ea-29cc-41ab-9ffc-31c38a8e8d60","savedPayload":{"position":{"x":22854.19826829732,"y":20626.731485165095},"targetPosition":{"x":22355.475034198163,"y":20019.55802245936},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Progress","config":"{\n \"codeName\": \"progress\",\n \"isString\": false\n}","id":"5964f3e5-82af-47de-9492-19c634d4f5ad","savedPayload":{"position":{"x":22278.79789356957,"y":20801.384698960228},"targetPosition":{"x":22355.475034198163,"y":20019.55802245936},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"218da162-dd8c-4f77-9150-3d2eee6e6e0d","savedPayload":{"position":{"x":22355.475034198163,"y":20019.55802245936},"targetPosition":{"x":21841.919940047454,"y":19431.977077639505},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"04c8606b-5e59-4e7d-b3ac-387bfffcd300","savedPayload":{"position":{"x":21841.971671542407,"y":19432.187487397736},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Progress","id":"99aecc8d-2bc4-4748-b642-78888c2d35eb"}}},{"type":"Product Definition","name":"Trading System Running","config":"{\n \"codeName\": \"Trading-System-Running\",\n \"singularVariableName\": \"tradingSystemRun\",\n \"pluralVariableName\": \"tradingSystemRunning\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"c7b45884-6cdf-43f7-a1e5-c5325effd207","savedPayload":{"position":{"x":22533.929085895037,"y":19716.7835949624},"targetPosition":{"x":21762.693490734957,"y":19564.096472064244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"a21cbc62-e6d8-4286-b0ff-430071d46700","savedPayload":{"position":{"x":22416.555767328,"y":20000.18832950335},"targetPosition":{"x":21762.693490734957,"y":19564.096472064244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"42cccc8c-a020-4cb2-8a40-4d3dacc86597","savedPayload":{"position":{"x":22968.36265037563,"y":20372.95838556599},"targetPosition":{"x":22197.300441361687,"y":20220.488505046877},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"7fc1205e-ad17-40d0-bb05-21e8d1842b7c","savedPayload":{"position":{"x":22640.712071969145,"y":20882.51633453806},"targetPosition":{"x":22197.300441361687,"y":20220.488505046877},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Running","config":"{\n \"codeName\": \"running\",\n \"isString\": false\n}","id":"7c7cb8f0-6d6d-4761-b51c-70ee77c05811","savedPayload":{"position":{"x":22044.759248546026,"y":20990.307499023165},"targetPosition":{"x":22197.300441361687,"y":20220.488505046877},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"f2bf57f0-e966-4b75-a95f-ba206c266dae","savedPayload":{"position":{"x":22197.300441361687,"y":20220.488505046877},"targetPosition":{"x":21762.693490734957,"y":19564.096472064244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"17236f59-6ef2-4cc3-913c-1ff6db052236","savedPayload":{"position":{"x":21762.766608887046,"y":19564.33117195913},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Running","id":"ac1e8218-af24-491f-a552-736d83d68c01"}}},{"type":"Product Definition","name":"Trading System Announcements","config":"{\n \"codeName\": \"Trading-System-Announcements\",\n \"singularVariableName\": \"tradingSystemAnnouncement\",\n \"pluralVariableName\": \"tradingSystemAnnouncements\",\n \"nodePath\": \"tradingSystem\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"9e29a710-30c0-4faa-b71a-f4ee109673a2","savedPayload":{"position":{"x":22423.776751788955,"y":19915.1985277889},"targetPosition":{"x":21670.89728385563,"y":19687.81556955808},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"b7e24195-a9d0-45e7-9dba-447db8000feb","savedPayload":{"position":{"x":22316.684198242416,"y":20208.180426900213},"targetPosition":{"x":21670.89728385563,"y":19687.81556955808},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"0487c17a-d445-4d37-b186-dc0e79e0dae7","savedPayload":{"position":{"x":22770.799376634204,"y":20578.93234216998},"targetPosition":{"x":22018.60654828455,"y":20351.18883566868},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"cb847e27-30fe-43af-9b5f-19de453cc5f7","savedPayload":{"position":{"x":22383.37307096624,"y":21045.495233409976},"targetPosition":{"x":22018.60654828455,"y":20351.18883566868},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Announcements","config":"{\n \"codeName\": \"announcements\",\n \"isString\": false\n}","id":"b3aaeae8-ed67-4830-a49c-13baada2bc11","savedPayload":{"position":{"x":21790.729630020647,"y":21102.50143727394},"targetPosition":{"x":22018.60654828455,"y":20351.18883566868},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"73ef953c-001b-474e-9221-23375777f3f3","savedPayload":{"position":{"x":22018.60654828455,"y":20351.18883566868},"targetPosition":{"x":21670.89728385563,"y":19687.81556955808},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"4a6f828a-9671-431e-8257-fc920943581e","savedPayload":{"position":{"x":21670.990233032902,"y":19688.07507064008},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Announcements","id":"0a3b8bea-749a-48ce-8b53-e4a731555b98"}}},{"type":"Product Definition","name":"Strategies","config":"{\n \"codeName\": \"Strategy-Objects\",\n \"singularVariableName\": \"strategyObject\",\n \"pluralVariableName\": \"strategyObjects\",\n \"nodePath\": \"tradingEngine.current.strategy\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"03d1a187-b188-4ad7-b99e-6e4f6c6f0278","savedPayload":{"position":{"x":22293.805727017087,"y":20102.61208678465},"targetPosition":{"x":21567.301735905665,"y":19802.133994427048},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"58a5a046-53a1-43a7-bb76-0c29d94ef579","savedPayload":{"position":{"x":22123.357732616558,"y":20357.84138298602},"targetPosition":{"x":21567.301735905665,"y":19802.133994427048},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"ffa3b94b-d147-42eb-943e-4e1661c0b8c4","savedPayload":{"position":{"x":22644.926784469288,"y":20410.170779343465},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"95273be5-fbf1-42a5-87c3-29f5ecbaafa1","savedPayload":{"position":{"x":22650.653158500463,"y":20599.506413948766},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"19988cef-f604-49a9-91f5-f8b1c93b0302","savedPayload":{"position":{"x":22610.87789523641,"y":20784.786295849157},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"8e1f47f3-3a81-45ed-892e-ea3e21d544c6","savedPayload":{"position":{"x":22527.934931590316,"y":20955.139411179927},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Strategy Name","config":"{ \n\"codeName\": \"strategyName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"2bb2239e-adc4-4ad1-9c82-64e03c7c60f3","savedPayload":{"position":{"x":22406.594202639797,"y":21100.70631696949},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Index","config":"{ \n\"codeName\": \"index\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"85886ed3-2cbb-4386-b661-d7103a1c63bb","savedPayload":{"position":{"x":22253.978089209482,"y":21212.9988073334},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"78491f8d-a68a-4918-ab38-cc9fa8eff27e","savedPayload":{"position":{"x":22078.92518196151,"y":21285.50281829107},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"46f41431-bf06-4d5e-93b5-1b64dafb8d6a","savedPayload":{"position":{"x":21891.60411432143,"y":21314.014665397113},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"b9c2814b-3d92-406b-88ab-78c71e635bd2","savedPayload":{"position":{"x":21703.095275313066,"y":21296.866964501296},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b78b86e0-a571-4f94-b837-b237c2043c3c","savedPayload":{"position":{"x":21523.9788257967,"y":21235.04895263676},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f99d1259-33b6-4c61-9332-5b751c1b2439","savedPayload":{"position":{"x":21364.851818647472,"y":21132.152332784142},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.strategy.strategyCounters\"\n}","id":"9d920c3c-3693-465f-a5e9-e8ea5dcdfd55","savedPayload":{"position":{"x":21234.91831944495,"y":20994.062993467272},"targetPosition":{"x":21867.950533224182,"y":20528.473197801697},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"b0192e6c-445b-4b55-b344-b273b268897b","savedPayload":{"position":{"x":21867.950533224182,"y":20528.473197801697},"targetPosition":{"x":21567.301735905665,"y":19802.133994427048},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"q"}}},"id":"21db6fce-8450-4b07-9015-d81a339fd030","savedPayload":{"position":{"x":21567.526236312904,"y":19802.22740507133},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Strategy Objects","id":"d54a124c-6029-41a6-9bbd-bb3fe8b1a318"}}},{"type":"Product Definition","name":"Positions","config":"{\n \"codeName\": \"Position-Objects\",\n \"singularVariableName\": \"positionObject\",\n \"pluralVariableName\": \"positionObjects\",\n \"nodePath\": \"tradingEngine.current.position\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"55df9376-2806-429d-b43d-b96700787f74","savedPayload":{"position":{"x":22146.792637820374,"y":20275.359719691205},"targetPosition":{"x":21453.275264091157,"y":19905.463533915612},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"fd62b468-93fa-44e0-941f-fff7ea4b04ea","savedPayload":{"position":{"x":21952.21707037163,"y":20512.5720649252},"targetPosition":{"x":21453.275264091157,"y":19905.463533915612},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"a8700d50-9286-4b62-a141-abd506386983","savedPayload":{"position":{"x":22460.09507137613,"y":20555.827535728495},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"6ce2fa31-04d9-4541-a793-569b668e6201","savedPayload":{"position":{"x":22466.1177282718,"y":20685.652933924306},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"0f5cf2f4-3c5b-4607-8635-c7310906b95c","savedPayload":{"position":{"x":22450.731929412945,"y":20814.64488468235},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"ba8a1af9-323f-4acb-a438-a61f232b4033","savedPayload":{"position":{"x":22414.326553798524,"y":20939.267548736352},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"1f5f73d9-d0bc-40d2-92f7-e6e2413ee1bb","savedPayload":{"position":{"x":22357.90879235521,"y":21056.184761651704},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"0d7f793d-074f-444f-8fd7-7c07be749d1d","savedPayload":{"position":{"x":22283.028083060806,"y":21162.209400990007},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"85df8c0c-7d11-44c2-a7a9-928d4ac0ad06","savedPayload":{"position":{"x":22191.716945512402,"y":21254.465112307058},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"9c8b786e-23f6-4bf9-bf83-6fd03b494a66","savedPayload":{"position":{"x":22086.46325342142,"y":21330.42962475281},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin Rate","config":"{ \n\"codeName\": \"beginRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"b0719341-cda1-4503-bed5-f4e98d7e07db","savedPayload":{"position":{"x":21970.14856741662,"y":21388.030497396267},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End Rate","config":"{ \n\"codeName\": \"endRate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a052f724-c517-4032-85f7-96d3a29ba9ce","savedPayload":{"position":{"x":21845.944970755943,"y":21425.708560297713},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"a4dfa19d-51b8-4151-91e5-6031059f09f1","savedPayload":{"position":{"x":21717.227634692095,"y":21442.428712440058},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionCounters\"\n}","id":"5309d28b-041a-4622-ade5-9349c19787da","savedPayload":{"position":{"x":21587.818701386215,"y":21437.730147802577},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Profit Loss","config":"{\n \"codeName\": \"profitLoss\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"81bececa-73dc-42aa-b01c-a205044b3940","savedPayload":{"position":{"x":21460.65273519534,"y":21411.747025935376},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"9dde3ed5-9981-4d14-93d7-c8fd463f58af","savedPayload":{"position":{"x":21339.490723165327,"y":21365.179097421358},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"ROI","config":"{ \n\"codeName\": \"ROI\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n \"decimals\": 2\n}","id":"0ae5a8c4-c070-47e3-9409-242ea498b512","savedPayload":{"position":{"x":21227.637856904043,"y":21299.29915170699},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"0853d6cc-4429-431e-82f0-e4d958f095ea","savedPayload":{"position":{"x":21128.146826030163,"y":21215.88965329909},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"925756d5-4662-44ac-bfa6-a326c5e61b23","savedPayload":{"position":{"x":21043.71745661304,"y":21117.176289939594},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.current.position.positionStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"3d22802e-0b11-47e4-8c98-7c9830f166fb","savedPayload":{"position":{"x":20976.535095481304,"y":21005.52843977203},"targetPosition":{"x":21680.856380190802,"y":20657.52446977286},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"823244e2-6d28-4e3a-96ea-42f6a7981bca","savedPayload":{"position":{"x":21680.856380190802,"y":20657.52446977286},"targetPosition":{"x":21453.275264091157,"y":19905.463533915612},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"1eabba24-cbd4-4cbf-95e0-c5135349d41d","savedPayload":{"position":{"x":21453.370776843432,"y":19905.688731975395},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Position Objects","id":"8854b5f8-8407-4a0d-9099-5456a8e4cced"}}},{"type":"Product Definition","name":"Stop Loss","config":"{\n \"codeName\": \"Stop-Loss\",\n \"singularVariableName\": \"stopLoss\",\n \"pluralVariableName\": \"stopLosses\",\n \"nodePath\": \"tradingEngine.current.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"0ea22a69-e7cb-4fcf-b7ae-4b7233b196c4","savedPayload":{"position":{"x":21983.190380420212,"y":20433.9111005707},"targetPosition":{"x":21329.579097539874,"y":19997.424674199196},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"75b13383-2771-4f58-b2c4-ffadad2e9519","savedPayload":{"position":{"x":21766.06726064187,"y":20650.98523419164},"targetPosition":{"x":21329.579097539874,"y":19997.424674199196},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"048960a1-1de4-4492-b214-37bfc59d661b","savedPayload":{"position":{"x":22275.950775853988,"y":22480.24905321751},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"f44a0a9b-3abb-4323-be28-c14a677d2d5f","savedPayload":{"position":{"x":21742.797795273364,"y":22930.443266206752},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss","config":"{\n \"codeName\": \"stopLoss\",\n \"isString\": false\n}","id":"1152e12b-354a-49cf-bfe1-dbb54a5471bf","savedPayload":{"position":{"x":21067.12465118543,"y":23104.74309638155},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Stage","config":"{\n \"codeName\": \"stopLossStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"11b06d00-8e9e-4526-b0d9-c9553f536b4b","savedPayload":{"position":{"x":20383.063076079325,"y":22968.613702283277},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"stopLossPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.stopLoss\"\n}","id":"2dc164a2-1df6-40d4-861d-15b0cbc6c627","savedPayload":{"position":{"x":19825.52120105671,"y":22549.035727951796},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Positions","config":"{ \n \"codeName\": \"positions\",\n \"isString\": false,\n \"isCalculated\": false,\n \"nodePath\": \"tradingEngine.episode.episodeCounters\"\n}","id":"2ad62b6e-523d-4689-b05f-45393425e588","savedPayload":{"position":{"x":19505.249100498037,"y":21929.097038944237},"targetPosition":{"x":21023.32714457117,"y":21537.610322917026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"04d49dc8-b542-4700-8d07-99323b0f1f62","savedPayload":{"position":{"x":21023.32714457117,"y":21537.610322917026},"targetPosition":{"x":21329.579097539874,"y":19997.424674199196},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"c18bdc82-216a-4b1d-8850-5c3c9dc2000b","savedPayload":{"position":{"x":21329.62269701077,"y":19997.462550083463},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Stop Loss","id":"9b8e4fc2-b62a-4d47-ac5f-08818e463da2"}}},{"type":"Product Definition","name":"Take Profit","config":"{\n \"codeName\": \"Take-Profit\",\n \"singularVariableName\": \"takeProfit\",\n \"pluralVariableName\": \"takeProfits\",\n \"nodePath\": \"tradingEngine.current.position\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"3cd59aa1-0590-43b6-9fb7-c85276ac132e","savedPayload":{"position":{"x":21805.092933473148,"y":20575.10067211493},"targetPosition":{"x":21197.45818871328,"y":20076.62174682822},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"916d5610-87ae-47e7-9067-9a406141e3df","savedPayload":{"position":{"x":21567.788090719845,"y":20769.819120381995},"targetPosition":{"x":21197.45818871328,"y":20076.62174682822},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"New Record Property","config":"{ \n \"codeName\": \"\",\n \"isString\": false,\n \"isCalculated\": false\n}","id":"446b1f2c-905f-4125-b9d9-8e155c6f3da7","savedPayload":{"position":{"x":21953.56077057534,"y":22573.951857682987},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"3f8411d3-5a4f-4243-9f6f-d61cc4a28fb5","savedPayload":{"position":{"x":21480.630543773434,"y":22962.077339750453},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.candle\"\n}","id":"437e1ec6-c754-46bb-9942-e05eb056629c","savedPayload":{"position":{"x":20895.1828141344,"y":23139.672950806984},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit","config":"{\n \"codeName\": \"takeProfit\",\n \"isString\": false\n}","id":"81208625-05fb-4e89-bb88-ff16df25bdb7","savedPayload":{"position":{"x":20286.65287096951,"y":23079.712192890176},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Take Profit Stage","config":"{\n \"codeName\": \"takeProfitStage\",\n \"isString\": true,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"9bce9325-8c54-424f-98b9-e991ca328c24","savedPayload":{"position":{"x":19747.110536307708,"y":22791.32721302271},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Stop Loss Phase","config":"{\n \"codeName\": \"takeProfitPhase\",\n \"isString\": false,\n \"nodePath\": \"tradingEngine.current.position.takeProfit\"\n}","id":"4ccb1152-df42-41ef-b8db-da8ee01c6f09","savedPayload":{"position":{"x":19358.995654220387,"y":22318.417508778235},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Positions","config":"{ \n \"codeName\": \"positions\",\n \"isString\": false,\n \"isCalculated\": false,\n \"nodePath\": \"tradingEngine.episode.episodeCounters\"\n}","id":"0aebfdb4-5f80-4456-8ca1-e41814cade91","savedPayload":{"position":{"x":19181.40045937521,"y":21732.97536074709},"targetPosition":{"x":20741.669528206243,"y":21579.42362253289},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fe08bafa-9d05-4c76-9448-0d21bd36346c","savedPayload":{"position":{"x":20741.669528206243,"y":21579.42362253289},"targetPosition":{"x":21197.45818871328,"y":20076.62174682822},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"2542c7d0-fa26-4b52-a59a-a3630e52eb89","savedPayload":{"position":{"x":21197.47108294106,"y":20076.665347351467},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Take Profit","id":"78a2df79-8912-44d7-a8c7-4b6a0a7235c2"}}},{"type":"Product Definition","name":"Market Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders-Objects\", \n \"singularVariableName\": \"marketBuyOrdersObject\", \n \"pluralVariableName\": \"marketBuyOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"45609efb-0edc-4aa9-bc12-f5b4ca6dc5bf","savedPayload":{"position":{"x":21614.507069828647,"y":20697.4152654597},"targetPosition":{"x":21058.153248892246,"y":20142.206500409226},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"5eed53d0-a3e7-4082-b7f1-cb321b3d306b","savedPayload":{"position":{"x":21359.426841544966,"y":20868.008977922862},"targetPosition":{"x":21058.153248892246,"y":20142.206500409226},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"2b09fe55-b85c-4242-bae1-85a671b006ad","savedPayload":{"position":{"x":21836.76592237674,"y":21033.988262542527},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"9fdc2c26-3835-4917-b12b-5f1b0bef5a05","savedPayload":{"position":{"x":21814.823343427797,"y":21139.739881706926},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"f889b073-b78f-4345-bca7-c1943b6f5ee3","savedPayload":{"position":{"x":21778.86836261155,"y":21241.002005596125},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"2cf8c3ee-79ae-49bb-882b-992379f41fd9","savedPayload":{"position":{"x":21729.490261224182,"y":21336.32155472146},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"94e5c88c-2317-4bd1-86e6-f578db5e882f","savedPayload":{"position":{"x":21667.604393831272,"y":21423.992207721367},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7b9b53d5-d93a-4301-a0e6-ce8322da8fce","savedPayload":{"position":{"x":21594.367978998074,"y":21502.40967840811},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"96a9eb2f-30ff-4b89-aec7-17be046782ad","savedPayload":{"position":{"x":21511.13969874717,"y":21570.120999175415},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"5906d64e-d90e-4dae-a2bb-c806e3d5d21d","savedPayload":{"position":{"x":21419.470929844392,"y":21625.86245618204},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"294ae361-a9f7-404a-a6dd-3dc25d8c6c27","savedPayload":{"position":{"x":21321.06501109147,"y":21668.603398537467},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e837a938-5448-4987-bdf0-d28de65d33fb","savedPayload":{"position":{"x":21217.759857271994,"y":21697.547379383606},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"4424a014-cc5f-494e-be78-0b49f960045b","savedPayload":{"position":{"x":21111.474997132187,"y":21712.154091014},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"137a18b5-33a3-433e-b85b-c8fbe03cbe69","savedPayload":{"position":{"x":21004.49166622087,"y":21712.14802295722},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderCounters\"\n}","id":"35ca0a49-129b-49e2-864a-3c43ed3bf38b","savedPayload":{"position":{"x":20898.213888094146,"y":21697.539455188013},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"0d7601cb-ee34-4775-9ad6-a2acf4b054d1","savedPayload":{"position":{"x":20794.910913032807,"y":21668.587524684026},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"4b0020d5-4d5b-4747-aa28-baf6e28f67d9","savedPayload":{"position":{"x":20696.512391448246,"y":21625.842230265018},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"7a0f2659-94df-4640-a553-4486a19dd3be","savedPayload":{"position":{"x":20604.847217054525,"y":21570.09493527891},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"1fe58bb5-6e1d-45b7-8180-da3159a624a7","savedPayload":{"position":{"x":20521.630006140582,"y":21502.376577190054},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\"\n}","id":"eedcf7ad-6668-4b14-8f07-7ee44998c47a","savedPayload":{"position":{"x":20448.40186685034,"y":21423.95098290329},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"46b407ab-5799-4ea6-946b-d857abb76183","savedPayload":{"position":{"x":20386.537178593346,"y":21336.27068176748},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"c2fcb23d-4a6d-457a-8d38-03a46786fedc","savedPayload":{"position":{"x":20337.181480378782,"y":21240.94662660399},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"ca02a2ed-731a-4df8-9f76-fe8d60b7ad8e","savedPayload":{"position":{"x":20301.255986413136,"y":21139.679863068748},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketBuyOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"ac187d63-a2cc-487c-8e81-03c786749d9c","savedPayload":{"position":{"x":20279.421635205937,"y":21033.862259940604},"targetPosition":{"x":21058.030639395492,"y":20928.109117914355},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d79b050c-2805-4b39-bcd3-1678628f8d1c","savedPayload":{"position":{"x":21058.030639395492,"y":20928.109117914355},"targetPosition":{"x":21058.153248892246,"y":20142.206500409226},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"db256083-9aa2-48e1-8fd6-3425a5085302","savedPayload":{"position":{"x":21058.18693614761,"y":20142.533787995624},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Buy Orders","id":"e00fe7d4-894d-4483-a73a-3cd77943ea80"}}},{"type":"Product Definition","name":"Market Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders-Objects\", \n \"singularVariableName\": \"marketSellOrdersObject\", \n \"pluralVariableName\": \"marketSellOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"6112bd4d-07cb-41db-98c4-e286d172b5c0","savedPayload":{"position":{"x":21412.222328348424,"y":20801.250683761362},"targetPosition":{"x":20913.097831330386,"y":20194.12514611379},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"07cd5668-5e0f-4385-9c02-72eebc99344a","savedPayload":{"position":{"x":21141.777284805674,"y":20945.902086076945},"targetPosition":{"x":20913.097831330386,"y":20194.12514611379},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"0ba08ecb-3542-4acd-abbe-7059306ed669","savedPayload":{"position":{"x":21600.530109169165,"y":21157.834988480725},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"0ae49e68-38d8-4356-bde3-c648a29177a7","savedPayload":{"position":{"x":21568.21747648051,"y":21260.869766843218},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"b7057c53-6d99-44ca-9eff-4dd21ebe2116","savedPayload":{"position":{"x":21522.508701356168,"y":21358.11701349974},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"01b26cba-240f-451e-8533-2e090a3103fd","savedPayload":{"position":{"x":21464.032951113106,"y":21448.138885100518},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"052e9ef4-da9f-4198-b13f-7a2e0c60b906","savedPayload":{"position":{"x":21393.8487907054,"y":21529.322552736652},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"a6e9d3dc-20e3-4cf3-94f4-79f3723b4d34","savedPayload":{"position":{"x":21313.28028446951,"y":21600.183125654155},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"7a1bd071-8ba4-4013-9f96-d951fbe4d0f3","savedPayload":{"position":{"x":21223.817457653193,"y":21659.409646628807},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b38cf81f-59f2-4508-9fbc-e82b1ad38d65","savedPayload":{"position":{"x":21127.12490921679,"y":21705.900390360766},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"0132786e-0a9a-4096-a6a5-57f03485d0b1","savedPayload":{"position":{"x":21025.004929649614,"y":21738.78786508604},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"d1cb7813-1e5a-43f2-af35-f82a9ee47a0b","savedPayload":{"position":{"x":20919.363414092055,"y":21757.467611346416},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"8ab09d9d-7c5a-45d4-ad6a-8a4292c1b137","savedPayload":{"position":{"x":20812.459853584496,"y":21761.578301603582},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"b1d35b5f-2d9f-4ba0-b4bc-cc12c74104e8","savedPayload":{"position":{"x":20705.698684478088,"y":21751.06076451004},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderCounters\"\n}","id":"b1dbf0d5-39bb-4c1a-ac6d-d1d647e82d54","savedPayload":{"position":{"x":20601.361242733947,"y":21726.101302878193},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"8635df32-bd11-4fe5-a54d-491f69c06327","savedPayload":{"position":{"x":20501.394865578124,"y":21687.16634475206},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"8b25c33c-8f96-4a6e-8180-43027d0fc396","savedPayload":{"position":{"x":20407.660062459483,"y":21634.98396069281},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"8a9b6dc6-ec65-4933-907f-75e45119ddb2","savedPayload":{"position":{"x":20321.90240403687,"y":21570.51876411575},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"86f2f21b-b725-4045-8791-5625d62b8d40","savedPayload":{"position":{"x":20245.72563650521,"y":21494.970911420944},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\"\n}","id":"2ffc6fc2-9e28-4ef6-9047-a2bd2b618bd3","savedPayload":{"position":{"x":20180.53745900928,"y":21409.744173749546},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"e5c5802a-d778-40e5-9039-4067a6a56e4f","savedPayload":{"position":{"x":20127.5646951763,"y":21316.4233699729},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"7fccf0bc-d0a4-48d9-b4ac-c467bc74ef0f","savedPayload":{"position":{"x":20087.792734668124,"y":21216.717536040105},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"2149cdc5-19f8-4e11-9d5c-e6c062998223","savedPayload":{"position":{"x":20061.967529392216,"y":21112.418782398283},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.marketSellOrders.marketOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"df8e190a-1138-4ffa-baef-6a560ba51739","savedPayload":{"position":{"x":20050.613148686472,"y":21004.960148780567},"targetPosition":{"x":20835.80227970248,"y":20976.055872544523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"8b01d5ae-7d6f-4c08-9f05-2f8edb699fd6","savedPayload":{"position":{"x":20835.80227970248,"y":20976.055872544523},"targetPosition":{"x":20913.097831330386,"y":20194.12514611379},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"1958f79b-5c6c-4874-9154-98c314822ed7","savedPayload":{"position":{"x":20913.105259593776,"y":20194.43466687847},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Market Sell Orders","id":"a9811005-1b7d-45bb-8003-0e60caab5f09"}}},{"type":"Product Definition","name":"Limit Buy Orders","config":"{ \n \"codeName\": \"Limit-Buy-Orders-Objects\", \n \"singularVariableName\": \"limitBuyOrdersObject\", \n \"pluralVariableName\": \"limitBuyOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"b82fb0f9-74c1-42e6-961c-a696214ef079","savedPayload":{"position":{"x":21200.839251513848,"y":20884.691629889},"targetPosition":{"x":20763.641969935117,"y":20231.567498668817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"2e03f52e-0cd2-46b4-9c10-0b8516ef9c71","savedPayload":{"position":{"x":20917.469703643408,"y":21002.132528429454},"targetPosition":{"x":20763.641969935117,"y":20231.567498668817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"890f7170-f42d-43d8-a084-b9b88ea212cc","savedPayload":{"position":{"x":21353.313521019285,"y":21258.042234475386},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"3e6e8e40-2e6c-4bd4-b709-effa25749403","savedPayload":{"position":{"x":21311.02756365796,"y":21357.3748830743},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"280a9209-b9cd-4cb7-b0b7-3dfe2f472140","savedPayload":{"position":{"x":21256.015099503515,"y":21449.702333755296},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"254561e5-52c3-4669-920e-4fe5370653c4","savedPayload":{"position":{"x":21188.99266122631,"y":21533.556279922745},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"8ef21836-adad-4918-9816-fbb3c9dd1fc5","savedPayload":{"position":{"x":21111.194197493067,"y":21607.45293274165},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"4d6fd5f1-a95b-4ec1-a49c-6c057190d354","savedPayload":{"position":{"x":21024.077203915695,"y":21670.092543731615},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"558830b2-1030-4c71-9079-cc88b78d3010","savedPayload":{"position":{"x":20929.237380702518,"y":21720.245652554117},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"12402a8e-c9d4-4adb-94c3-22f526d72d14","savedPayload":{"position":{"x":20828.44695117276,"y":21757.051250686076},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"8cc955fb-62ec-40b9-963b-275956de04d9","savedPayload":{"position":{"x":20723.606018755607,"y":21779.773932234162},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"63af17a0-e994-4b5f-b853-207bf27c496c","savedPayload":{"position":{"x":20616.63204572951,"y":21787.992532590128},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"0af4f067-ac3d-4ee7-ba1d-d9c22ae2f46f","savedPayload":{"position":{"x":20509.84563408315,"y":21781.585613479845},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"f8cb0422-95bb-4c53-a5f6-7e02819021c0","savedPayload":{"position":{"x":20404.638654851326,"y":21760.64482835106},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderCounters\"\n}","id":"d16faba6-3464-4536-9c93-afbe6e0d4262","savedPayload":{"position":{"x":20303.251118673586,"y":21725.58743806796},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"368ffab0-db17-4136-ba1b-aef1f8fb60d8","savedPayload":{"position":{"x":20207.585228298823,"y":21677.033232773116},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"75fd2c91-2bfe-428c-9ff6-7d28d566a96d","savedPayload":{"position":{"x":20119.402054174385,"y":21615.927603108186},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"832887dd-da08-4b8b-8916-b7f855c9dc5c","savedPayload":{"position":{"x":20040.38529079861,"y":21543.354630351285},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"3ee96ca2-b7d1-4207-ac60-abd742b2310b","savedPayload":{"position":{"x":19971.96868434573,"y":21460.7115726367},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\"\n}","id":"5d621574-54fd-4279-8c47-7bb9710bcc90","savedPayload":{"position":{"x":19915.468093592004,"y":21369.495852860662},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"0bddc747-8300-4b15-8a7a-134ff133d2ec","savedPayload":{"position":{"x":19871.8793391836,"y":21271.438392551558},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"4564e44d-dbd5-4d97-8433-fc1dd877bd2f","savedPayload":{"position":{"x":19842.07989534779,"y":21168.322922203082},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"dc313012-cb3e-4087-9ae1-af1125a074e3","savedPayload":{"position":{"x":19826.599291112554,"y":21061.9942716538},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitBuyOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"ba489aaa-0872-4e7f-bad0-a7c43b0da4b5","savedPayload":{"position":{"x":19825.838389411456,"y":20954.24659372261},"targetPosition":{"x":20610.083008422942,"y":21002.151720287846},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"aaad0279-43dd-46fc-b099-40cba6c3b6a8","savedPayload":{"position":{"x":20610.083008422942,"y":21002.151720287846},"targetPosition":{"x":20763.641969935117,"y":20231.567498668817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"5deceb32-c7ab-4560-818a-0f0b9d6632fb","savedPayload":{"position":{"x":20763.565842308075,"y":20231.88600377003},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Buy Orders","id":"7e3120c7-a0c9-483c-ada9-8c53deb10f33"}}},{"type":"Product Definition","name":"Limit Sell Orders","config":"{ \n \"codeName\": \"Limit-Sell-Orders-Objects\", \n \"singularVariableName\": \"limitSellOrdersObject\", \n \"pluralVariableName\": \"limitSellOrdersObjects\",\n \"nodePathType\": \"array\",\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders\",\n \"saveAsObjects\": true,\n \"propertyNameThatDefinesObject\": \"status\",\n \"propertyValueThatClosesObject\": \"Closed\",\n \"propertyValueThatPreventsSavingObject\": \"Not Open\"\n}","datasets":[{"type":"Dataset Definition","name":"Multi-Period-Market","config":"{\n \"codeName\": \"Multi-Period-Market\",\n \"type\": \"Market Files\",\n \"validTimeFrames\": [ \"24-hs\", \"12-hs\", \"08-hs\", \"06-hs\", \"04-hs\", \"03-hs\", \"02-hs\", \"01-hs\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period\",\n \"fileName\": \"Data.json\",\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"356495a9-b063-495d-b06d-5281c7c0007e","savedPayload":{"position":{"x":20982.05610069265,"y":20947.007584844283},"targetPosition":{"x":20611.025142419625,"y":20254.164466381346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},{"type":"Dataset Definition","name":"Multi-Period-Daily","config":"{\n \"codeName\": \"Multi-Period-Daily\",\n \"type\": \"Daily Files\",\n \"validTimeFrames\": [ \"45-min\", \"40-min\", \"30-min\", \"20-min\", \"15-min\", \"10-min\", \"05-min\", \"04-min\", \"03-min\", \"02-min\", \"01-min\" ],\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset/@Period/@Year/@Month/@Day\",\n \"fileName\": \"Data.json\",\n \"dataRange\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Data.Range.json\"\n },\n \"timeFrames\": {\n \"filePath\": \"@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Session/@Product/@Dataset\",\n \"fileName\": \"Time.Frames.json\"\n }\n }","id":"934ab813-127e-4bbf-aa71-09b3cdadc0d0","savedPayload":{"position":{"x":20688.60921093513,"y":21036.1120306579},"targetPosition":{"x":20611.025142419625,"y":20254.164466381346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"record":{"type":"Record Definition","name":"New Record Definition","properties":[{"type":"Record Property","name":"Exchange Id","config":"{\n \"codeName\": \"exchangeId\",\n \"isString\": true\n}","id":"5c8236b1-b257-44f4-98bd-a158b67aad16","savedPayload":{"position":{"x":21097.281422097258,"y":21333.526663432756},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Serial Number","config":"{\n \"codeName\": \"serialNumber\",\n \"isString\": false\n}","id":"16140fc9-d4ae-43c2-ba47-f676b79a9775","savedPayload":{"position":{"x":21045.48131464206,"y":21428.264907903613},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Identifier","config":"{\n \"codeName\": \"identifier\",\n \"isString\": true\n}","id":"2d871d0f-e668-4e9d-9fcf-439f37cd082f","savedPayload":{"position":{"x":20981.686008224002,"y":21514.73061959754},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Begin","config":"{\n \"codeName\": \"begin\",\n \"isString\": false\n}","id":"fc6f8fe4-b752-448a-9ece-8497abf2901c","savedPayload":{"position":{"x":20906.75763743163,"y":21591.616046435083},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"End","config":"{\n \"codeName\": \"end\",\n \"isString\": false\n}","id":"3502765f-2f50-44c6-b85c-64d7f72f5592","savedPayload":{"position":{"x":20822.094950913084,"y":21657.556183556688},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Rate","config":"{ \n\"codeName\": \"rate\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"608ebfd0-4294-4e24-8111-a8f695072ca0","savedPayload":{"position":{"x":20729.24637676777,"y":21711.330694732038},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size","config":"{ \n\"codeName\": \"size\",\n\"isString\": false,\n\"isCalculated\": false\n}","id":"8148805b-acd7-4dc6-948a-fb7e9f5f87a0","savedPayload":{"position":{"x":20629.953927871444,"y":21751.961133558623},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Exit Type","config":"{ \n\"codeName\": \"exitType\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"c49c3510-e24b-418f-9334-760c5da57ccf","savedPayload":{"position":{"x":20526.052839790318,"y":21778.69767492796},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Status","config":"{ \n\"codeName\": \"status\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"04b96ab3-eb13-4039-a385-8e5c4377daa4","savedPayload":{"position":{"x":20419.477481846243,"y":21791.032334390085},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Order Name","config":"{ \n\"codeName\": \"orderName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"6ec27702-5283-4fbf-b6a7-92663a6e9e9b","savedPayload":{"position":{"x":20312.52700297634,"y":21788.73346960129},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Situation Name","config":"{ \n\"codeName\": \"situationName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"6a4285a4-c9d5-4d5b-a218-da8e19ca5970","savedPayload":{"position":{"x":20206.58698984659,"y":21771.85699410282},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Algorithm Name","config":"{ \n\"codeName\": \"algorithmName\",\n\"isString\": true,\n\"isCalculated\": false\n}","id":"e3e35a81-c5b2-4768-ab16-99b42ef83358","savedPayload":{"position":{"x":20103.927545387436,"y":21740.722862687348},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Periods","config":"{ \n\"codeName\": \"periods\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderCounters\"\n}","id":"815780d8-f647-42cc-9a40-aa99caa350c7","savedPayload":{"position":{"x":20006.467929115104,"y":21695.87780136533},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Size Filled","config":"{\n \"codeName\": \"sizeFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"2d1ec15a-0af3-46b9-b12d-da625bf83a5c","savedPayload":{"position":{"x":19916.008204065976,"y":21638.201572562637},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Percentage Filled","config":"{\n \"codeName\": \"percentageFilled\",\n \"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"d824c424-4324-46b1-87b9-182cc9f0d054","savedPayload":{"position":{"x":19834.262439425744,"y":21568.730921462113},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Fees Paid","config":"{ \n\"codeName\": \"feesPaid\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"09c85bf9-9311-4235-98d5-af35467b0876","savedPayload":{"position":{"x":19762.7260211635,"y":21488.76993908179},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Amount Received","config":"{ \n\"codeName\": \"amountReceived\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"b1389f84-b934-4ecb-88b0-a6a029ad54f1","savedPayload":{"position":{"x":19702.74888349722,"y":21399.816048163433},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Actual Rate","config":"{ \n\"codeName\": \"actualRate\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\"\n}","id":"d722bfd4-eb08-4dfc-8cc9-f706f93df80e","savedPayload":{"position":{"x":19655.451003102255,"y":21303.50536821594},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"Days","config":"{ \n\"codeName\": \"days\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n \"decimals\": 2\n}","id":"d05fe7d4-d772-4ad4-9890-a3aa342fc5f6","savedPayload":{"position":{"x":19621.70613982937,"y":21201.63948159744},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 1","config":"{ \n\"codeName\": \"userDefinedStatistic1\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 0\n}","id":"d4b14139-33ad-4da1-942c-ce8df0d3efa9","savedPayload":{"position":{"x":19602.137356199248,"y":21096.097171858364},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 2","config":"{ \n\"codeName\": \"userDefinedStatistic2\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 1\n}","id":"9ade3c97-f409-4c23-b66f-b6670100e039","savedPayload":{"position":{"x":19597.162228735677,"y":20989.06098507168},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Record Property","name":"User Defined Statistic 3","config":"{ \n\"codeName\": \"userDefinedStatistic3\",\n\"isString\": false,\n\"isCalculated\": false,\n \"nodePath\": \"tradingEngine.exchangeOrders.limitSellOrders.limitOrders[index].orderStatistics\",\n\"childProperty\": \"userDefinedStatistics\",\n\"index\": 2\n}","id":"780e674d-64fc-401a-ad5d-1012645f512e","savedPayload":{"position":{"x":19606.99345909001,"y":20881.46623426629},"targetPosition":{"x":20382.743400873325,"y":21006.03662641907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"7dc5d5fc-ff33-4652-bc9c-fad0566a3d9f","savedPayload":{"position":{"x":20382.743400873325,"y":21006.03662641907},"targetPosition":{"x":20611.025142419625,"y":20254.164466381346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"s"}}},"id":"2a1d405b-2fbe-4ed4-a76a-d2c7be59d20e","savedPayload":{"position":{"x":20610.902227655013,"y":20254.47995487155},"targetPosition":{"x":20457.557715057636,"y":18692.25561365076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Plotter Module","name":"Limit Sell Orders","id":"fb243322-ec2a-4f03-bb77-e97e4699d1c6"}}}],"id":"8c7f3687-b5ae-4a45-bda1-751cb2c55995","savedPayload":{"position":{"x":20457.557715057636,"y":18692.25561365076},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"j"}}}],"plotters":[{"type":"Plotter","name":"Trading Engine","config":"{ \n\"codeName\": \"Trading-Engine\"\n}","modules":[{"type":"Plotter Module","name":"Episode Counters","config":"{ \n\"codeName\": \"Episode-Counters\"\n}","panels":[{"type":"Plotter Panel","name":"Episode Counters","config":"{ \n \"codeName\": \"Episode-Counters\"\n}","panelData":[{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"a603cdac-43fd-4ed9-bc66-12c708158f4c","savedPayload":{"position":{"x":19996.297169950823,"y":18511.18029444539},"targetPosition":{"x":20069.200634768105,"y":18681.761459412384},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"ed1e5a45-552b-4050-96b6-8f3b7e0e0e42","savedPayload":{"position":{"x":20069.200634768105,"y":18681.761459412384},"targetPosition":{"x":20149.215236460153,"y":18849.528709816364},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Strategies","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.strategies","id":"bd3377de-142c-4f1f-a9cd-1e3a92227fb9","savedPayload":{"position":{"x":20163.603027745394,"y":18474.125024327415},"targetPosition":{"x":20155.857691769357,"y":18659.262581533887},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3445841f-c443-47ed-ab69-af44aafbd805","savedPayload":{"position":{"x":20155.857691769357,"y":18659.262581533887},"targetPosition":{"x":20149.215236460153,"y":18849.528709816364},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Positions","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.positions","id":"a4e07f20-da19-4745-932b-021844ede19f","savedPayload":{"position":{"x":20327.074083435964,"y":18518.26199968458},"targetPosition":{"x":20240.310423257182,"y":18680.961114984686},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"960b035e-f799-4e83-81ab-4ce423d081d6","savedPayload":{"position":{"x":20240.310423257182,"y":18680.961114984686},"targetPosition":{"x":20149.215236460153,"y":18849.528709816364},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Orders","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orders","id":"bb28084c-0e1e-4c27-a488-7d8417fb7794","savedPayload":{"position":{"x":20451.538909897634,"y":18601.89295652842},"targetPosition":{"x":20305.83228947704,"y":18737.137341396006},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"4ba9c931-98ec-4390-a68e-7392b7e2c0e4","savedPayload":{"position":{"x":20305.83228947704,"y":18737.137341396006},"targetPosition":{"x":20149.215236460153,"y":18849.528709816364},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Hits","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.hits","id":"4a2c6bca-66d4-4f1f-a2c9-a034f879032d","savedPayload":{"position":{"x":20522.441297247,"y":18779.81655815262},"targetPosition":{"x":20341.23513669291,"y":18813.869813344507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"77748bc7-f305-46f7-a51d-4b07420f0174","savedPayload":{"position":{"x":20341.23513669291,"y":18813.869813344507},"targetPosition":{"x":20149.215236460153,"y":18849.528709816364},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fails","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.fails","id":"0b4b3713-a461-4a82-a014-496bf0a13a44","savedPayload":{"position":{"x":20503.547302064042,"y":18958.302365652642},"targetPosition":{"x":20318.420632123987,"y":18911.777034275823},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"8c96317c-9c59-4617-ac0d-80a4475b7044","savedPayload":{"position":{"x":20318.420632123987,"y":18911.777034275823},"targetPosition":{"x":20149.215236460153,"y":18849.528709816364},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"2a5783fe-af9a-443c-b4e7-32d8bdabff82","savedPayload":{"position":{"x":20149.215236460153,"y":18849.528709816364},"targetPosition":{"x":19942.754854691626,"y":19102.380181726123},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"recordValues":{"type":"Record Values","name":"New Record Values","id":"11308192-1761-4746-8567-50f5d50eee37","savedPayload":{"position":{"x":20241.054841699923,"y":19162.29173195084},"targetPosition":{"x":19942.754854691626,"y":19102.380181726123},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"5e478e3f-e432-4364-8f2c-2f3b2849848b","savedPayload":{"position":{"x":19943.732448690767,"y":19102.059113302454},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Episode Statistics","config":"{ \n\"codeName\": \"Episode-Statistics\"\n}","panels":[{"type":"Plotter Panel","name":"New Plotter Panel","config":"{ \n \"codeName\": \"Episode-Statistics\"\n}","panelData":[{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"8ccceec4-4b55-4002-82fc-5eb003680884","savedPayload":{"position":{"x":20188.760800639444,"y":18674.831591641872},"targetPosition":{"x":20212.34184232624,"y":18858.067708909966},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a656f547-17d4-48c8-8a30-110cb1cc8d54","savedPayload":{"position":{"x":20212.34184232624,"y":18858.067708909966},"targetPosition":{"x":20239.543665536414,"y":19040.91529614754},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Profit Loss","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.profitLoss","id":"2c744dce-e9bc-4b52-ae5a-88153818efe8","savedPayload":{"position":{"x":20363.2516433435,"y":18699.29911012539},"targetPosition":{"x":20309.42617652929,"y":18868.828511691125},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"dac1e943-73af-419a-89d3-cf7413d0410d","savedPayload":{"position":{"x":20309.42617652929,"y":18868.828511691125},"targetPosition":{"x":20239.543665536414,"y":19040.91529614754},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"ROI","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.ROI","id":"0262af09-67a3-4948-9f03-903b95f75754","savedPayload":{"position":{"x":20533.624617515306,"y":18815.21966631693},"targetPosition":{"x":20386.774099761155,"y":18927.439063377387},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"c5ddf4c7-c06c-48cb-b474-aa1049dda30f","savedPayload":{"position":{"x":20386.774099761155,"y":18927.439063377387},"targetPosition":{"x":20239.543665536414,"y":19040.91529614754},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Hit Ratio","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.hitRatio","id":"2e63251f-fa85-44c1-a977-6ea9b1289de4","savedPayload":{"position":{"x":20607.755046845614,"y":18992.26931740207},"targetPosition":{"x":20424.32099857442,"y":19016.729431278356},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f4dba581-f375-45b7-b3e9-8397b74c14f9","savedPayload":{"position":{"x":20424.32099857442,"y":19016.729431278356},"targetPosition":{"x":20239.543665536414,"y":19040.91529614754},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Anualized Rate Of Return","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.anualizedRateOfReturn","id":"3b65f366-e8c3-4298-9617-9d7cd121a0fc","savedPayload":{"position":{"x":20579.508117691126,"y":19186.079304469287},"targetPosition":{"x":20408.56049081312,"y":19116.20723735663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0ddc2941-7f32-43c4-a2ac-33933f7176ea","savedPayload":{"position":{"x":20408.56049081312,"y":19116.20723735663},"targetPosition":{"x":20239.543665536414,"y":19040.91529614754},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"6ea43033-418d-4d87-b640-02010679aa8b","savedPayload":{"position":{"x":20239.543665536414,"y":19040.91529614754},"targetPosition":{"x":19976.42430032689,"y":19242.932934285545},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"recordValues":{"type":"Record Values","name":"New Record Values","id":"a22754c1-aa31-4bef-8d7f-4b0df8b2c6e5","savedPayload":{"position":{"x":20259.005885565417,"y":19359.46670592368},"targetPosition":{"x":19976.42430032689,"y":19242.932934285545},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"6ce18a43-2e6a-452e-a72d-1c56a58d3f81","savedPayload":{"position":{"x":19976.751838043343,"y":19243.043864143285},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Candle","config":"{ \n\"codeName\": \"Current-Candle\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"db2a5867-c3c9-40ae-86f2-19845ca4bffe","savedPayload":{"position":{"x":20166.10217558153,"y":19398.759887888256},"targetPosition":{"x":19981.413845150284,"y":19387.20855851003},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"31789d43-d608-4eeb-a3ff-338a99074045","savedPayload":{"position":{"x":19981.413845150284,"y":19387.20855851003},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Balance","config":"{ \n\"codeName\": \"Current-Balance\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"27e334d8-0ec2-4047-a961-af4c5fcf8d32","savedPayload":{"position":{"x":20136.748535157825,"y":19577.332753394756},"targetPosition":{"x":19957.894474938537,"y":19529.71455468166},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"e5d9e3e1-d1f4-4493-b452-33fe49c81228","savedPayload":{"position":{"x":19957.894474938537,"y":19529.71455468166},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Distance To Event","config":"{ \n\"codeName\": \"Distance-To-Event\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"dc45b078-aeee-40bf-8f6d-f8b12a57494f","savedPayload":{"position":{"x":20073.1754706587,"y":19746.5560359389},"targetPosition":{"x":19907.068169704566,"y":19664.847816551854},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"56eb7de2-0281-404a-bd4d-34ac113e2325","savedPayload":{"position":{"x":19907.068169704566,"y":19664.847816551854},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Strategy","config":"{ \n\"codeName\": \"Current-Strategy\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"97c36937-1cdc-42ce-b886-ca8220b14025","savedPayload":{"position":{"x":19977.81749368052,"y":19900.06367515671},"targetPosition":{"x":19830.882493004425,"y":19787.447432294717},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"a3c31000-1b82-4fe9-ae56-6d5893582b16","savedPayload":{"position":{"x":19830.882493004425,"y":19787.447432294717},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Last Strategy","config":"{ \n\"codeName\": \"Last-Strategy\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"c242da84-b00b-4900-ad95-b25a57ef9603","savedPayload":{"position":{"x":19854.33573321413,"y":20031.975602459377},"targetPosition":{"x":19732.237332137614,"y":19892.80644979201},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"028aaa23-630c-4aa6-a168-6b2a128b1a83","savedPayload":{"position":{"x":19732.237332137614,"y":19892.80644979201},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Current Position","config":"{ \n\"codeName\": \"Current-Position\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"daf7ee4e-434b-48df-af3b-b17489fe6a12","savedPayload":{"position":{"x":19707.485427965876,"y":20137.23249808549},"targetPosition":{"x":19614.929047129997,"y":19976.877632148644},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"0d2212c7-07bb-4c41-94fb-00844415ba5e","savedPayload":{"position":{"x":19614.929047129997,"y":19976.877632148644},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Last Position","config":"{ \n\"codeName\": \"Last-Position\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"c4473b0f-99f8-4129-b8ee-1f6a988e9440","savedPayload":{"position":{"x":19542.92955657299,"y":20211.79135317365},"targetPosition":{"x":19483.483730833344,"y":20036.433462106546},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"08c88b9c-70f1-49ff-aa16-21f2bc1c0ba1","savedPayload":{"position":{"x":19483.483730833344,"y":20036.433462106546},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Previous Balance","config":"{ \n\"codeName\": \"Previous-Balance\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"0305adcc-b68f-4795-bb16-01dd962823b1","savedPayload":{"position":{"x":19366.984012877594,"y":20252.807783442113},"targetPosition":{"x":19342.939702058608,"y":20069.203623230467},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"77dc9564-5ed0-4ce9-9e45-d23e396d336f","savedPayload":{"position":{"x":19342.939702058608,"y":20069.203623230467},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Previous Candle","config":"{ \n\"codeName\": \"Previous-Candle\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"559cabae-7e0e-4ff8-b1dd-8f822421fe6e","savedPayload":{"position":{"x":19186.811865857748,"y":20258.68485918576},"targetPosition":{"x":19198.893862180343,"y":20073.908619460242},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"076dcee2-2923-4455-8697-263649515a3b","savedPayload":{"position":{"x":19198.893862180343,"y":20073.908619460242},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Market Buy Orders","config":"{ \n\"codeName\": \"Market-Buy-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"8ed02a94-4fce-4314-ab0a-6642e85bdca3","savedPayload":{"position":{"x":19008.532310238425,"y":20229.18061512515},"targetPosition":{"x":19056.48778523504,"y":20050.363005667128},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"50d624c9-9a6e-4d57-a147-29d5c004b3f2","savedPayload":{"position":{"x":19056.48778523504,"y":20050.363005667128},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Market Sell Orders","config":"{ \n\"codeName\": \"Market-Sell-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"15dc7163-1703-4cad-9253-d48d7bb01800","savedPayload":{"position":{"x":18839.390968147487,"y":20165.401848759684},"targetPosition":{"x":18921.379342175493,"y":19999.45857963893},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"4f84a1a5-f9cd-4b9d-9d91-661ba912e2ca","savedPayload":{"position":{"x":18921.379342175493,"y":19999.45857963893},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Buy Orders","config":"{ \n\"codeName\": \"Limit-Buy-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"b89ff555-961b-4190-b874-4968e26db1b4","savedPayload":{"position":{"x":18685.86872058916,"y":20069.714603461452},"targetPosition":{"x":18798.73302008727,"y":19923.106155262212},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"17ec46bd-e5c0-48d5-a3b6-e108cc835f17","savedPayload":{"position":{"x":18798.73302008727,"y":19923.106155262212},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Sell Orders","config":"{ \n\"codeName\": \"Limit-Sell-Orders\"\n}","panels":[],"recordValues":{"type":"Record Values","name":"New Record Values","id":"fe4a4590-f68f-454e-84ba-96ae9cef3b70","savedPayload":{"position":{"x":18553.65197553062,"y":19945.32103391406},"targetPosition":{"x":18693.02960808265,"y":19823.9300330762},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{}}},"id":"1ec8da3f-8749-430d-8ad9-35fffc0d61ec","savedPayload":{"position":{"x":18693.02960808265,"y":19823.9300330762},"targetPosition":{"x":19247.024060080726,"y":19339.615075747224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"ebb03c87-e87e-4f4b-8763-361854776287","savedPayload":{"position":{"x":19247.024060080726,"y":19339.615075747224},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Trading System","config":"{ \n\"codeName\": \"\"\n}","modules":[{"type":"Plotter Module","name":"Highlights","config":"{ \n\"codeName\": \"Highlights\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesHighlights":{"type":"Nodes Highlights","name":"New Nodes Highlights","config":"{ \n\"nodePath\": \"\"\n}","id":"fa39a76d-1b97-41a2-ab18-f33c2f31fded","savedPayload":{"position":{"x":19391.364068327923,"y":20449.697609772305},"targetPosition":{"x":18954.90673398596,"y":19880.565958426927},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d979c9f0-530a-41d3-a357-b57a3e4f2201","savedPayload":{"position":{"x":18954.90673398596,"y":19880.565958426927},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Values","config":"{ \n\"codeName\": \"Values\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesValues":{"type":"Nodes Values","name":"New Nodes Values","config":"{ \n\"nodePath\": \"\"\n}","id":"f42e5006-d8ec-437a-8906-53d7ce68b79c","savedPayload":{"position":{"x":18885.076490181396,"y":20699.26786411799},"targetPosition":{"x":18700.175580395793,"y":20006.65283798813},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"476925ed-e2ac-443d-82f3-501b64ca6c87","savedPayload":{"position":{"x":18700.175580395793,"y":20006.65283798813},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Errors","config":"{ \n\"codeName\": \"Errors\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesErrors":{"type":"Nodes Errors","name":"New Nodes Errors","config":"{ \n\"nodePath\": \"\"\n}","id":"c814ea79-0fa6-44bb-a636-d46d7b3720c4","savedPayload":{"position":{"x":18327.896362351243,"y":20736.5310144487},"targetPosition":{"x":18421.673794104307,"y":20026.062364550588},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"64684730-d049-4d3c-8013-b48c5438417e","savedPayload":{"position":{"x":18421.673794104307,"y":20026.062364550588},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Status","config":"{ \n\"codeName\": \"Status\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesStatus":{"type":"Nodes Status","name":"New Nodes Status","config":"{ \n\"nodePath\": \"\"\n}","id":"2b1290d8-41ff-48a3-a11b-45f1228e2a84","savedPayload":{"position":{"x":17798.749434564117,"y":20556.28807947405},"targetPosition":{"x":18157.218034068752,"y":19935.832510132077},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0437448d-8740-496b-8fce-d3804be81a2b","savedPayload":{"position":{"x":18157.218034068752,"y":19935.832510132077},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Progress","config":"{ \n\"codeName\": \"Progress\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesProgress":{"type":"Nodes Progress","name":"New Nodes Progress","config":"{ \n\"nodePath\": \"\"\n}","id":"00c9d7bc-295f-48b6-81a0-71b6bc0b6299","savedPayload":{"position":{"x":17378.388830820622,"y":20187.21876732149},"targetPosition":{"x":17946.954914160462,"y":19751.168069817762},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"99aecc8d-2bc4-4748-b642-78888c2d35eb","savedPayload":{"position":{"x":17946.954914160462,"y":19751.168069817762},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Running","config":"{ \n\"codeName\": \"Running\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesRunning":{"type":"Nodes Running","name":"New Nodes Running","config":"{ \n\"nodePath\": \"\"\n}","id":"3ef03483-8d69-452c-9f56-984574b79e32","savedPayload":{"position":{"x":17131.138670423687,"y":19685.258921388722},"targetPosition":{"x":17823.318601536146,"y":19500.044175509316},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"ac1e8218-af24-491f-a552-736d83d68c01","savedPayload":{"position":{"x":17823.318601536146,"y":19500.044175509316},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Announcements","config":"{ \n\"codeName\": \"Announcements\",\n\"connectTo\": \"Trading System\"\n}","panels":[],"nodesAnnouncements":{"type":"Nodes Announcements","name":"New Nodes Announcements","id":"197785fc-72c7-46ef-83bf-a095b01cbfec","savedPayload":{"position":{"x":17094.65425416798,"y":19127.142892395404},"targetPosition":{"x":17805.126727891166,"y":19220.731369590514},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0a3b8bea-749a-48ce-8b53-e4a731555b98","savedPayload":{"position":{"x":17805.126727891166,"y":19220.731369590514},"targetPosition":{"x":18516.41196526161,"y":19314.69061560807},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"34f9d374-f4ae-4abf-96e3-978c6b8a879a","savedPayload":{"position":{"x":18516.41196526161,"y":19314.69061560807},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Trading Strategy","config":"{ \n\"codeName\": \"\"\n}","modules":[{"type":"Plotter Module","name":"Strategy Objects","config":"{ \n \"codeName\": \"Strategy-Objects\", \n \"icon\": \"trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin Bottom","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = 0","id":"458c8a52-4191-4fa5-b4f7-a0eb2edfcdc8","savedPayload":{"position":{"x":18081.218371402276,"y":20001.580752358284},"targetPosition":{"x":17931.563435711592,"y":19930.58721017884},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"a464e820-57a7-4233-b23b-e802fc9b3a33","savedPayload":{"position":{"x":17931.563435711592,"y":19930.58721017884},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Begin Top","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.beginRate","id":"3abb7e03-f8f3-4956-9729-756e7974c5a0","savedPayload":{"position":{"x":17993.046157419085,"y":20130.559346072285},"targetPosition":{"x":17872.711490303922,"y":20016.448690745277},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"d2e900e2-444c-4268-b07a-fc41811c82d8","savedPayload":{"position":{"x":17872.711490303922,"y":20016.448690745277},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End Bottom","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = 0","id":"5ef24a29-2154-4304-ae0d-e046db069042","savedPayload":{"position":{"x":17869.44146040387,"y":20225.579034662645},"targetPosition":{"x":17790.442480402246,"y":20079.693833387522},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"e960d99e-f263-4ee8-9801-9b97f534bd5e","savedPayload":{"position":{"x":17790.442480402246,"y":20079.693833387522},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End Top","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.endRate","id":"6d7f55b1-11df-4598-bab9-32a02ae6fa33","savedPayload":{"position":{"x":17721.94089882444,"y":20277.425122906654},"targetPosition":{"x":17692.261414838344,"y":20114.344153004684},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"3a8be5c7-aff5-4283-bd17-dadd6dddda4d","savedPayload":{"position":{"x":17692.261414838344,"y":20114.344153004684},"targetPosition":{"x":17632.92038471467,"y":19789.02761515228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"87bdc7ca-4228-48a3-ab2d-4eba01abfa2e","savedPayload":{"position":{"x":17632.92038471467,"y":19789.02761515228},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"Closed Base","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.status === 'Closed'","id":"3d4e39c7-4178-4557-95b9-0bb94a15135c","savedPayload":{"position":{"x":17332.36226190298,"y":18789.641782890405},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"83329324-581e-42e2-948e-7d06a3d9066c","savedPayload":{"position":{"x":17156.111726092997,"y":19440.732424868653},"targetPosition":{"x":17074.19643993036,"y":19123.08535880395},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"4a04b54a-70b9-4e92-a474-d6ef03a97f26","savedPayload":{"position":{"x":17074.19643993036,"y":19123.08535880395},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin Bottom","id":"b3a7f670-c86e-4382-93ee-bb6dbabfd159","savedPayload":{"position":{"x":16711.41105360419,"y":18982.555240704925},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},{"type":"Polygon Vertex","name":"End Bottom","id":"0e17c75c-09f4-49ae-8e6a-55fdfd89f428","savedPayload":{"position":{"x":16726.47933994653,"y":18557.2927957767},"targetPosition":{"x":16992.217934769713,"y":18800.416177252475},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}}],"id":"9ae59a68-71fd-4ec8-9a70-da743f33baee","savedPayload":{"position":{"x":17401.947238063913,"y":19904.246645030144},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Open Base","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.status === 'Open'","id":"5eb17be1-910b-4da5-959b-e7cf21dfa896","savedPayload":{"position":{"x":17812.54277702138,"y":17057.035277485065},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [3,3]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [3,3]\n }\n}","id":"f790de9e-e87a-4f2a-86d5-c8f69d4b9525","savedPayload":{"position":{"x":17365.31479265209,"y":16654.441096923805},"targetPosition":{"x":17653.586095898576,"y":16715.752832401842},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"a4e077b1-7bc7-4d90-b796-b4e808985b89","savedPayload":{"position":{"x":17653.586095898576,"y":16715.752832401842},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin Bottom","id":"b158074f-5013-4899-b61b-232eb519370c","savedPayload":{"position":{"x":17936.694607590034,"y":16460.312219109783},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},{"type":"Polygon Vertex","name":"End Bottom","id":"365ee7e7-0529-4acc-a77f-d596c195399f","savedPayload":{"position":{"x":18220.72519850297,"y":16671.570064640404},"targetPosition":{"x":17970.789806009056,"y":16783.24912967012},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}}],"id":"504f327c-a08d-4c3d-8e77-850299cc30ed","savedPayload":{"position":{"x":17144.846015276304,"y":19921.227520967637},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Left Line","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n }\n}","id":"e2422730-fb47-4014-a707-8c346d6bc327","savedPayload":{"position":{"x":17807.04504548531,"y":16232.834910001038},"targetPosition":{"x":18035.93056916737,"y":16418.28883576163},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"bbd7ee22-fb16-4b59-9e0c-04018e9dd3fa","savedPayload":{"position":{"x":18035.93056916737,"y":16418.28883576163},"targetPosition":{"x":18303.404061869947,"y":16635.01330635403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin Bottom","id":"a3a9eca0-36f3-4058-b8d7-872ce77209cd","savedPayload":{"position":{"x":18267.574764341214,"y":16292.601081330555},"targetPosition":{"x":18303.404061869947,"y":16635.01330635403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},{"type":"Polygon Vertex","name":"Begin Top","id":"d480fdc6-89e5-4547-a2ae-17ff5e4fc917","savedPayload":{"position":{"x":18520.177733318913,"y":16367.245199319585},"targetPosition":{"x":18303.404061869947,"y":16635.01330635403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin Top","id":"d2e900e2-444c-4268-b07a-fc41811c82d8"}}}],"id":"f9500afd-e0f4-45d3-9647-45ec778554e8","savedPayload":{"position":{"x":16900.541819530816,"y":19838.233822537903},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Right Line","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [1,1]\n }\n}","id":"03ebe379-fb32-47fc-bfd6-b9ccc73bfd16","savedPayload":{"position":{"x":17927.729125501923,"y":16194.543051624189},"targetPosition":{"x":18135.47403976817,"y":16402.465560757602},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"054fcea5-2f72-4439-be45-c289a3bdab14","savedPayload":{"position":{"x":18135.47403976817,"y":16402.465560757602},"targetPosition":{"x":18364.911411834917,"y":16632.123065111024},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"End Bottom","id":"a0b737cf-ec7b-4026-870c-cebec148464f","savedPayload":{"position":{"x":18364.909622223353,"y":16306.440321548187},"targetPosition":{"x":18364.911411834917,"y":16632.123065111024},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}},{"type":"Polygon Vertex","name":"End Top","id":"fceb54ef-473e-4062-9407-ec64e9040504","savedPayload":{"position":{"x":18595.47451362469,"y":16401.51878224143},"targetPosition":{"x":18364.911411834917,"y":16632.123065111024},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End Top","id":"3a8be5c7-aff5-4283-bd17-dadd6dddda4d"}}}],"id":"354102dd-fd58-4f84-8e90-0d891defa0c8","savedPayload":{"position":{"x":16706.53159437666,"y":19668.11292575698},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"quality\",\n\"size\": 15\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 0\n }","id":"64c0d038-c401-4317-84fd-b73e1b210d00","savedPayload":{"position":{"x":16272.932628973,"y":19522.158636785425},"targetPosition":{"x":16592.423437142214,"y":19436.6186819141},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin Bottom","id":"a464e820-57a7-4233-b23b-e802fc9b3a33"}}},"id":"01f6ebd3-e14f-4434-a0fb-1d8167122ce3","savedPayload":{"position":{"x":16592.423437142214,"y":19436.6186819141},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"quality\",\n\"size\": 15\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 0\n }","id":"56f86edf-c2cc-491b-8cea-4bae0f03ebfd","savedPayload":{"position":{"x":16247.721965816118,"y":19136.205590263624},"targetPosition":{"x":16575.673764671476,"y":19179.2839476076},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"End Bottom","id":"e960d99e-f263-4ee8-9801-9b97f534bd5e"}}},"id":"df6a3044-b207-4564-8c28-8d64c679ee9a","savedPayload":{"position":{"x":16575.673764671476,"y":19179.2839476076},"targetPosition":{"x":17231.16806640037,"y":19265.607641994055},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"b02b7fee-30b0-41f0-ae06-a073c57289d9","savedPayload":{"position":{"x":17231.16806640037,"y":19265.607641994055},"targetPosition":{"x":17561.159682915157,"y":18694.09863434512},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Strategy Object","config":"{ \n\"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"b037ec89-e05b-432c-9b61-da05bda134cc","savedPayload":{"position":{"x":16736.42481032476,"y":18159.9516671533},"targetPosition":{"x":16901.552923584517,"y":18147.630196993425},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"0316c81d-7b05-42cb-876e-19d25eb1896a","savedPayload":{"position":{"x":16901.552923584517,"y":18147.630196993425},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"ed7a2560-35b9-4142-bd68-77347bf66b89","savedPayload":{"position":{"x":16769.002681606882,"y":17941.58265161991},"targetPosition":{"x":16923.190296585854,"y":18001.98905585155},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"5d9060d4-50fb-4cda-8037-85f7ffae5c27","savedPayload":{"position":{"x":16923.190296585854,"y":18001.98905585155},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.strategyName","id":"925d79c1-efdd-4555-baba-72e686294057","savedPayload":{"position":{"x":16893.42950227033,"y":17758.90578958544},"targetPosition":{"x":17006.185694373435,"y":17880.36784312982},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"1a4951ef-23ae-4228-8479-a0fe687c2d82","savedPayload":{"position":{"x":17006.185694373435,"y":17880.36784312982},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Triggered By Situation","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"24317532-e6bf-4827-9196-e052fe28bcb3","savedPayload":{"position":{"x":17085.122419865744,"y":17648.08202711934},"targetPosition":{"x":17133.911879741754,"y":17806.633308672193},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"6c79326f-b90c-4155-8f61-8ee2322b9b09","savedPayload":{"position":{"x":17133.911879741754,"y":17806.633308672193},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"2a35de7b-ad59-439b-aa6c-0668ffd92816","savedPayload":{"position":{"x":17305.079079795796,"y":17631.798112078526},"targetPosition":{"x":17280.477570342897,"y":17795.72497386978},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"6a34a5de-3b89-4f07-a947-5b94c8926dc1","savedPayload":{"position":{"x":17280.477570342897,"y":17795.72497386978},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"33bd5e59-f2bf-4b5c-bd74-6975e07b3056","savedPayload":{"position":{"x":17511.118154224798,"y":17712.917372895157},"targetPosition":{"x":17417.76863662494,"y":17849.69086106077},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"a0c5053d-5b1e-4f7e-8edb-58baaaa8a45a","savedPayload":{"position":{"x":17417.76863662494,"y":17849.69086106077},"targetPosition":{"x":17231.20872385997,"y":18122.725313946168},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"b256b76c-3834-4d62-aa56-f42cce9f47e9","savedPayload":{"position":{"x":17231.20872385997,"y":18122.725313946168},"targetPosition":{"x":17561.159682915157,"y":18694.09863434512},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d54a124c-6029-41a6-9bbd-bb3fe8b1a318","savedPayload":{"position":{"x":17459.085481559683,"y":18699.078066507154},"targetPosition":{"x":18171.730905078774,"y":18699.077892608217},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"62890699-eabf-4ea8-8ca0-cac07cc06dea","savedPayload":{"position":{"x":18171.730905078774,"y":18699.077892608217},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Trading Position","config":"{ \n \"codeName\": \"\"\n}","modules":[{"type":"Plotter Module","name":"Position Objects","config":"{ \n \"codeName\": \"Position-Objects\", \n \"icon\": \"trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Left Begin Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.beginRate","id":"b00ea4d5-f3d0-40cf-b65e-7845415b9126","savedPayload":{"position":{"x":17743.50811562693,"y":17552.530622918286},"targetPosition":{"x":17805.23648184782,"y":17413.603588059334},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"407ce9a9-7029-46be-a2cc-7f5469f13079","savedPayload":{"position":{"x":17805.23648184782,"y":17413.603588059334},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Right Begin Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.beginRate","id":"594bc655-cbf0-4e81-8fcc-b0f001e71fc4","savedPayload":{"position":{"x":17559.812811051106,"y":17404.255856766173},"targetPosition":{"x":17682.929058287675,"y":17314.779916112333},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"3b122c9b-56d5-4cb6-86ba-12d1919aeeba","savedPayload":{"position":{"x":17682.929058287675,"y":17314.779916112333},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Right End Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.endRate","id":"ef80ea85-cfba-4fa6-9646-3688f54f33ba","savedPayload":{"position":{"x":17471.19138675442,"y":17194.69143255407},"targetPosition":{"x":17626.75845169068,"y":17168.19886074358},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"eb3dd27b-831c-47ae-8a19-1b01626add98","savedPayload":{"position":{"x":17626.75845169068,"y":17168.19886074358},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Left Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"cdc9f3f0-3bca-4c9c-901f-1371aad3dcfe","savedPayload":{"position":{"x":17512.304665703115,"y":16951.495779974663},"targetPosition":{"x":17651.23772812136,"y":17013.176475755023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"b61fa42b-45d1-416b-b06b-734d33223a80","savedPayload":{"position":{"x":17651.23772812136,"y":17013.176475755023},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"Right Rate","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"c450be56-8c02-4039-9b4a-8e0bde52fcc6","savedPayload":{"position":{"x":17660.705750514484,"y":16768.20122353827},"targetPosition":{"x":17750.10806652973,"y":16891.087536519743},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"467129cb-1aa4-4639-ab0f-74d14146f721","savedPayload":{"position":{"x":17750.10806652973,"y":16891.087536519743},"targetPosition":{"x":17928.299965145343,"y":17136.367795817783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"774f0a60-aa67-408f-9768-8a24f5b9c033","savedPayload":{"position":{"x":17928.299965145343,"y":17136.367795817783},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"Profit Triangle","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.ROI > 0","id":"09130c24-6a0d-4cff-9ad6-b1604e0958db","savedPayload":{"position":{"x":17508.212794348914,"y":17100.412058590595},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBody":{"type":"Polygon Body","name":"New Polygon Body","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"9c174ed4-ecb1-4ab9-8baf-af590e699f63","savedPayload":{"position":{"x":16806.84198075209,"y":16949.617455331252},"targetPosition":{"x":17405.769112934646,"y":16859.537179671042},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"5afd2ce2-aa5c-45fc-9812-cd2269ef83e7","savedPayload":{"position":{"x":17405.769112934646,"y":16859.537179671042},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.PATINATED_TURQUOISE\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"b0ad97ca-daf8-49a7-b592-6a3b3384140f","savedPayload":{"position":{"x":16847.460539786953,"y":16412.67214155363},"targetPosition":{"x":17426.209971051427,"y":16591.124423880334},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"4ed86298-5484-4d9d-9d58-ef75d71bc219","savedPayload":{"position":{"x":17426.209971051427,"y":16591.124423880334},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Left Begin Rate","id":"3421959f-9a3a-4822-a6cf-eed20fdcbc87","savedPayload":{"position":{"x":17560.98977953688,"y":16357.646260805954},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Left Begin Rate","id":"407ce9a9-7029-46be-a2cc-7f5469f13079"}}},{"type":"Polygon Vertex","name":"Right Begin Rate","id":"98bb0b7d-76aa-4a56-a49c-e7764f22d45e","savedPayload":{"position":{"x":17803.003404904543,"y":16189.49794108436},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right Begin Rate","id":"3b122c9b-56d5-4cb6-86ba-12d1919aeeba"}}},{"type":"Polygon Vertex","name":"Right End Rate","id":"f3f4e892-faf4-446c-99c6-b02b6605b45e","savedPayload":{"position":{"x":18050.30430237246,"y":16165.731050672892},"targetPosition":{"x":18005.26702883684,"y":16769.757808755086},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right End Rate","id":"eb3dd27b-831c-47ae-8a19-1b01626add98"}}}],"id":"eef83f44-b389-47bd-9f24-0401224383ad","savedPayload":{"position":{"x":18005.26702883684,"y":16769.757808755086},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"Loss Triangle","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.ROI <= 0","id":"992e9a1d-1f15-4771-aee9-9a7a9cd87190","savedPayload":{"position":{"x":17678.410099788194,"y":16500.579215735932},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBody":{"type":"Polygon Body","name":"New Polygon Body","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"a2e70810-31b6-4e72-aefa-e9f97b486321","savedPayload":{"position":{"x":17189.605296380054,"y":15977.013124190677},"targetPosition":{"x":17727.116731287002,"y":16256.057727628699},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"69de7ba1-c408-465f-b0dd-11e5e1838b04","savedPayload":{"position":{"x":17727.116731287002,"y":16256.057727628699},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RUSTED_RED\",\n \"opacity\": 0.25,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"81d435e8-942b-414c-a289-8e3c4d13af00","savedPayload":{"position":{"x":17557.317296137055,"y":15549.257237837566},"targetPosition":{"x":17920.528405997975,"y":16033.873934022049},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"b5bd2f82-5b84-4edd-86c5-c93a52863cda","savedPayload":{"position":{"x":17920.528405997975,"y":16033.873934022049},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Left Begin Rate","id":"c607b5e9-c344-4255-ab3c-5b9d10fba687","savedPayload":{"position":{"x":18166.740156822572,"y":15924.313606025213},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Left Begin Rate","id":"407ce9a9-7029-46be-a2cc-7f5469f13079"}}},{"type":"Polygon Vertex","name":"Right Begin Rate","id":"64709527-68e2-4b4e-a3e0-36c09f6d3d47","savedPayload":{"position":{"x":18436.356758448062,"y":15932.34894658229},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right Begin Rate","id":"3b122c9b-56d5-4cb6-86ba-12d1919aeeba"}}},{"type":"Polygon Vertex","name":"Right End Rate","id":"3d4f8600-db77-4d5a-b611-ed4362f9c57c","savedPayload":{"position":{"x":18675.296351777983,"y":16056.68726293789},"targetPosition":{"x":18283.817663488924,"y":16518.84364245915},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right End Rate","id":"eb3dd27b-831c-47ae-8a19-1b01626add98"}}}],"id":"d209356a-e336-4246-ad54-0f8260af21f5","savedPayload":{"position":{"x":18283.817663488924,"y":16518.84364245915},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.25,\n \"lineWidth\": 2,\n \"lineDash\": [3,3]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.35,\n \"lineWidth\": 3,\n \"lineDash\": [3,3]\n }\n}","id":"bc128809-8c93-4f5d-9de9-4e0b28c1132e","savedPayload":{"position":{"x":17996.798727082783,"y":15463.5617234319},"targetPosition":{"x":18326.500935290005,"y":15971.57768560358},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"cbd2cb8e-ca62-4b68-9bca-11ad55e50fb1","savedPayload":{"position":{"x":18326.500935290005,"y":15971.57768560358},"targetPosition":{"x":18656.297749163605,"y":16479.606906468733},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Left Rate","id":"e1fc573d-a98e-4801-af1f-08f56d98a78a","savedPayload":{"position":{"x":18782.196907195565,"y":15886.940584070182},"targetPosition":{"x":18656.297749163605,"y":16479.606906468733},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Left Rate","id":"b61fa42b-45d1-416b-b06b-734d33223a80"}}},{"type":"Polygon Vertex","name":"Right Rate","id":"72aece06-d0ac-4068-8310-7037f0ba4943","savedPayload":{"position":{"x":19163.973820423496,"y":16149.803684642702},"targetPosition":{"x":18656.297749163605,"y":16479.606906468733},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Right Rate","id":"467129cb-1aa4-4639-ab0f-74d14146f721"}}}],"id":"543ebae2-5624-49ad-a00f-df63335e92a9","savedPayload":{"position":{"x":18656.297749163605,"y":16479.606906468733},"targetPosition":{"x":18530.310454773982,"y":17072.969825272663},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[],"texts":[],"id":"d99cb56a-d182-4672-9e89-54bb809eff30","savedPayload":{"position":{"x":17111.46667970463,"y":18071.533352459584},"targetPosition":{"x":17812.58072854168,"y":17883.69594637972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Position Object","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"482e894d-68a1-499f-b55e-97827c1df506","savedPayload":{"position":{"x":16344.55127035604,"y":17538.86264416792},"targetPosition":{"x":16578.03234600345,"y":17397.519384424242},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"5a612794-8d2e-4689-82ce-f6bdcba13755","savedPayload":{"position":{"x":16578.03234600345,"y":17397.519384424242},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"d1f7c811-2a35-44a0-8908-2076f59ab2ad","savedPayload":{"position":{"x":16263.226725107257,"y":17358.71082279012},"targetPosition":{"x":16523.893400509034,"y":17277.482487705278},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"32444aa5-bc40-4905-97e7-f795118fc229","savedPayload":{"position":{"x":16523.893400509034,"y":17277.482487705278},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"8ae3f86b-d0f8-4851-a477-02d0960fb4e5","savedPayload":{"position":{"x":16227.485201328978,"y":17164.50744548454},"targetPosition":{"x":16500.10335815215,"y":17148.117164896397},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"8fd749c8-cdc1-4a20-8901-d22fdd70612d","savedPayload":{"position":{"x":16500.10335815215,"y":17148.117164896397},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"d6677f18-96af-4d73-aadc-034d146b9422","savedPayload":{"position":{"x":16239.325116034515,"y":16968.04723729689},"targetPosition":{"x":16507.997410219734,"y":17017.170607516975},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"1972711b-2740-49d7-8323-f24ffa3751b5","savedPayload":{"position":{"x":16507.997410219734,"y":17017.170607516975},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"b97f9930-22b1-4e18-9d12-f2adc9de796d","savedPayload":{"position":{"x":16298.020283950911,"y":16779.626047091817},"targetPosition":{"x":16547.10571076544,"y":16891.649102700107},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"08193c38-6100-40cf-84e9-533cd29ca463","savedPayload":{"position":{"x":16547.10571076544,"y":16891.649102700107},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Enter Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.beginRate","id":"c7d06e13-042f-4e12-8093-b9f27dc8e655","savedPayload":{"position":{"x":16400.11070878058,"y":16610.73689319927},"targetPosition":{"x":16615.104606978544,"y":16779.164378755246},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"67fb7b91-c601-48dd-9d79-5188dc43a921","savedPayload":{"position":{"x":16615.104606978544,"y":16779.164378755246},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Position Exit Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.endRate","id":"4f114564-7657-4037-9f5e-43e2fcfb75a5","savedPayload":{"position":{"x":16539.658420718075,"y":16471.22905155678},"targetPosition":{"x":16708.059399446844,"y":16686.247293617755},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"a0921f86-e8f0-40d9-99ee-0a316dd6ad67","savedPayload":{"position":{"x":16708.059399446844,"y":16686.247293617755},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"48b097fa-bc1f-4cd9-bcf4-284bd77c5055","savedPayload":{"position":{"x":16708.56239326696,"y":16369.140054796615},"targetPosition":{"x":16820.56907229024,"y":16618.242580647875},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"5e243e8e-1909-4a9d-a605-984e530846c3","savedPayload":{"position":{"x":16820.56907229024,"y":16618.242580647875},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"0cea2f32-e0b8-4011-8389-eb24536ec638","savedPayload":{"position":{"x":16896.921171893748,"y":16310.486788681716},"targetPosition":{"x":16946.0188712005,"y":16579.17595283503},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"b98c147d-3f4d-41d6-b821-df00d7eeab29","savedPayload":{"position":{"x":16946.0188712005,"y":16579.17595283503},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"95d9e4b7-2951-4dac-b0e6-c9cdb77cd0b9","savedPayload":{"position":{"x":17093.342140783232,"y":16298.635442369521},"targetPosition":{"x":17076.954776665025,"y":16571.272834480347},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"298d34c8-3b72-4c1f-92bd-b3e2c2f3e73e","savedPayload":{"position":{"x":17076.954776665025,"y":16571.272834480347},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"ROI","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.ROI + ' %'","id":"fa6fe36b-a358-41c8-a08b-163d9f616418","savedPayload":{"position":{"x":17287.503964595555,"y":16334.331726254826},"targetPosition":{"x":17206.295529306804,"y":16595.027813167075},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"3717a1ab-38b7-40be-a2bf-b9645f8304d1","savedPayload":{"position":{"x":17206.295529306804,"y":16595.027813167075},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Profit Loss","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.profitLoss","id":"e1e8520b-a586-4471-8ee5-757a50f66937","savedPayload":{"position":{"x":17467.68104069268,"y":16415.65576929408},"targetPosition":{"x":17326.355719794105,"y":16649.163905507714},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"bed68193-cced-4a58-88d2-6a9a29a48a09","savedPayload":{"position":{"x":17326.355719794105,"y":16649.163905507714},"targetPosition":{"x":17044.077904364167,"y":17115.227723975244},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"3d274e02-8896-4311-a0c8-9041b6507090","savedPayload":{"position":{"x":17044.077904364167,"y":17115.227723975244},"targetPosition":{"x":17812.58072854168,"y":17883.69594637972},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":4,"arrangementStyle":0},"uiObject":{"isRunning":false,"shortcutKey":"a"}}}],"id":"8854b5f8-8407-4a0d-9099-5456a8e4cced","savedPayload":{"position":{"x":17812.5068361944,"y":17883.64016286816},"targetPosition":{"x":18515.28409408331,"y":18071.836287948023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Stop Loss","config":"{ \n \"codeName\": \"Module-Name\", \n \"icon\": \"histogram|band|moving-average|oscillator|trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.stopLoss","id":"eeef1100-0dcc-4367-99f1-b23a5e98b2ff","savedPayload":{"position":{"x":16842.671623828264,"y":17740.23018646569},"targetPosition":{"x":16861.448121478243,"y":17561.59385043039},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7d0349ba-640b-43f2-b500-d62c06fecd81","savedPayload":{"position":{"x":16861.448121478243,"y":17561.59385043039},"targetPosition":{"x":16880.190544956877,"y":17383.058599947264},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.stopLoss","id":"79f690f8-360a-49a8-9df0-bc42d1975099","savedPayload":{"position":{"x":16589.517962810092,"y":17172.400657616126},"targetPosition":{"x":16734.930578396874,"y":17277.776650077023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a4c015cf-419c-44f6-9816-6828e5fbc3c3","savedPayload":{"position":{"x":16734.930578396874,"y":17277.776650077023},"targetPosition":{"x":16880.190544956877,"y":17383.058599947264},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fdf923e9-1d23-41c0-9210-38d35313c4ab","savedPayload":{"position":{"x":16880.190544956877,"y":17383.058599947264},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.stopLoss > 0","id":"b8677c90-5e19-402b-b494-d2cce015c167","savedPayload":{"position":{"x":16300.010038191633,"y":17422.013101737135},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.5,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.8,\n \"lineWidth\": 3,\n \"lineDash\": [0,0]\n }\n}","id":"1eee2eba-1af0-4cc0-ad50-22ac23a10dac","savedPayload":{"position":{"x":15406.610604335867,"y":17091.877487433383},"targetPosition":{"x":16119.773760377167,"y":17017.027143998228},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"83ae727f-2dc3-4153-9b7f-2bee0748e134","savedPayload":{"position":{"x":16119.773760377167,"y":17017.027143998228},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"ac7ed016-4516-4ebc-a902-95e97ace1f55","savedPayload":{"position":{"x":16211.932016036772,"y":16583.65969878302},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"7d0349ba-640b-43f2-b500-d62c06fecd81"}}},{"type":"Polygon Vertex","name":"End","id":"6f873316-c57a-48b4-80c7-362f823d37b4","savedPayload":{"position":{"x":16541.25795070935,"y":16287.020235152382},"targetPosition":{"x":16833.019272168123,"y":16942.190492049853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"a4c015cf-419c-44f6-9816-6828e5fbc3c3"}}}],"id":"9d351f29-6a3e-4c2b-b008-ebe1414d2aa8","savedPayload":{"position":{"x":16833.019272168123,"y":16942.190492049853},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"placeholder\", \n\"size\": 15\n}","imageCondition":{"type":"Image Condition","name":"New Image Condition","code":"(record.positions !== record.previous.positions && record.stopLossPhase >= 0 ) || \n(record.stopLossPhase !== record.previous.stopLossPhase && record.stopLossPhase >= 0 ) ","id":"ef8dedb9-454b-423b-94e7-1a522047aa12","savedPayload":{"position":{"x":16713.418943468772,"y":16447.04163221855},"targetPosition":{"x":17054.858926148445,"y":16557.968929744457},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"860a9f6e-cc9d-46fb-83d6-fb908e12a30f","savedPayload":{"position":{"x":16980.085427109345,"y":16206.76485512808},"targetPosition":{"x":17054.858926148445,"y":16557.968929744457},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"7d0349ba-640b-43f2-b500-d62c06fecd81"}}},"id":"d4a99750-dd06-453f-a126-ac48c25372ab","savedPayload":{"position":{"x":17054.858926148445,"y":16557.968929744457},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[{"type":"Text","name":"New Text","config":"{ \n\"codeName\": \"\", \n\"fontSize\": 10\n}","textCondition":{"type":"Text Condition","name":"New Text Condition","code":"(record.positions !== record.previous.positions && record.stopLossPhase >= 0 ) || \n(record.stopLossPhase !== record.previous.stopLossPhase && record.stopLossPhase >= 0 ) ","id":"8e0eb7c3-171a-4fc3-a3e4-3c67bb772343","savedPayload":{"position":{"x":17149.473362706292,"y":16197.920239878069},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"textPosition":{"type":"Text Position","name":"New Text Position","config":"{ \n\"offsetX\": -3,\n \"offsetY\": -15\n }","id":"817671c1-fd3f-43ff-9670-9c3bcb94b8fb","savedPayload":{"position":{"x":17314.31860774061,"y":16049.40651653333},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"7d0349ba-640b-43f2-b500-d62c06fecd81"}}},"textFormula":{"type":"Text Formula","name":"New Text Formula","code":"record.stopLossPhase","id":"ccafd036-b292-48b1-847e-6735a3eb8253","savedPayload":{"position":{"x":17534.833041404472,"y":16026.22723709306},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"textStyle":{"type":"Text Style","name":"New Text Style","config":"{\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.5,\n \"fontSize\": 10\n}","id":"42f9061a-9d2a-4d3f-9f7a-c47c9e6e0601","savedPayload":{"position":{"x":17727.050321102848,"y":16137.258453898201},"targetPosition":{"x":17460.28925510178,"y":16377.50853732651},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"7e69ccc1-a9f7-4a64-aeaa-344eb46f63f7","savedPayload":{"position":{"x":17460.28925510178,"y":16377.50853732651},"targetPosition":{"x":17535.18262748896,"y":17091.416855311403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"41dd1d86-998c-46d7-a37e-1a1508fd8b51","savedPayload":{"position":{"x":17535.18262748896,"y":17091.416855311403},"targetPosition":{"x":18156.157040042133,"y":17449.895554588373},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Stop Loss Panel","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Position #","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.positions","id":"fdaab5ea-7f88-4b52-9b80-725f069907d9","savedPayload":{"position":{"x":19649.47370714368,"y":16652.494912974747},"targetPosition":{"x":19664.92994619471,"y":16803.775422333543},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"96d6bda9-5520-4690-8230-26ade54edcf1","savedPayload":{"position":{"x":19664.92994619471,"y":16803.775422333543},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Stop Loss","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.stopLoss","id":"1a5679d8-426b-4789-ac5b-c8d9c3a18fd8","savedPayload":{"position":{"x":20016.9086483935,"y":16584.234375668966},"targetPosition":{"x":19865.816218203458,"y":16846.029452773946},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f590d585-66dd-47b9-99e8-38d081a1d1a0","savedPayload":{"position":{"x":19865.816218203458,"y":16846.029452773946},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Stop Loss Phase","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.stopLossPhase","id":"9067e496-6c73-4ada-b403-6a097667f8a2","savedPayload":{"position":{"x":20142.2942465611,"y":16937.706493503778},"targetPosition":{"x":20003.30586732554,"y":16999.4685764315},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"e78ebe16-bfdc-4814-b334-5aad14fbf307","savedPayload":{"position":{"x":20003.30586732554,"y":16999.4685764315},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Stop Loss Stage","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.stopLossStage","id":"1eb68ffb-5a03-4b8f-a53f-0f120d52fa20","savedPayload":{"position":{"x":20173.5478441854,"y":17235.847522829},"targetPosition":{"x":20025.483673926177,"y":17204.352612369985},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"d84a629b-9ff1-4f24-aa41-55c18746cc10","savedPayload":{"position":{"x":20025.483673926177,"y":17204.352612369985},"targetPosition":{"x":19699.454012332506,"y":17134.667289498346},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"1b6d3bd0-e594-4b09-9f1c-021177676d84","savedPayload":{"position":{"x":18156.84519405295,"y":16729.432709689627},"targetPosition":{"x":18156.157040042133,"y":17449.895554588373},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"9b8e4fc2-b62a-4d47-ac5f-08818e463da2","savedPayload":{"position":{"x":18151.550931007023,"y":17441.76597060283},"targetPosition":{"x":18515.28409408331,"y":18071.836287948023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Take Profit","config":"{ \n \"codeName\": \"Module-Name\", \n \"icon\": \"histogram|band|moving-average|oscillator|trend\"\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.takeProfit","id":"4e73522f-8830-4026-8aa9-aa20558e6bb0","savedPayload":{"position":{"x":19415.49387898067,"y":16720.025835359218},"targetPosition":{"x":19565.429129047734,"y":16743.827061564545},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"9baaa58e-af64-4348-9320-fad9823153a9","savedPayload":{"position":{"x":19565.429129047734,"y":16743.827061564545},"targetPosition":{"x":19715.2034702125,"y":16767.59453243179},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.takeProfit","id":"f7740d4c-0742-4f8b-8ad3-b7fec1e92066","savedPayload":{"position":{"x":19905.77941449536,"y":16531.508612113714},"targetPosition":{"x":19810.429532919767,"y":16649.641367063516},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"bcbd8777-10f8-46a6-ba09-4d635570057d","savedPayload":{"position":{"x":19810.429532919767,"y":16649.641367063516},"targetPosition":{"x":19715.2034702125,"y":16767.59453243179},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fc2dda29-1eb7-4f6f-8527-2e54ba32bb8b","savedPayload":{"position":{"x":19715.2034702125,"y":16767.59453243179},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonCondition":{"type":"Polygon Condition","name":"New Polygon Condition","code":"record.takeProfit > 0","id":"b96a45dc-f0db-4c23-8f66-081302ea7bbf","savedPayload":{"position":{"x":20511.466304648693,"y":16643.34461130715},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.5,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.8,\n \"lineWidth\": 3,\n \"lineDash\": [0,0]\n }\n}","id":"5033856c-d71d-4608-a6f2-347ef82d8591","savedPayload":{"position":{"x":20026.415230713515,"y":15538.253488453214},"targetPosition":{"x":20057.92178029763,"y":16143.136733666997},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"1e3604e1-777b-4344-a47a-d3fefa10014b","savedPayload":{"position":{"x":20057.92178029763,"y":16143.136733666997},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"74cef8d6-de4c-464d-8c00-97a88227f626","savedPayload":{"position":{"x":20419.211757524103,"y":16240.084287568208},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"9baaa58e-af64-4348-9320-fad9823153a9"}}},{"type":"Polygon Vertex","name":"End","id":"e3c98070-e46c-4d6d-9079-2b9d556722cc","savedPayload":{"position":{"x":20654.98218018517,"y":16530.877841245107},"targetPosition":{"x":20089.25963366804,"y":16748.20989176435},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"bcbd8777-10f8-46a6-ba09-4d635570057d"}}}],"id":"a0b598d2-cdb6-4ce7-96c5-ef3317ae1768","savedPayload":{"position":{"x":20089.21096362513,"y":16747.251112400245},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"placeholder\", \n\"size\": 15\n}","imageCondition":{"type":"Image Condition","name":"New Image Condition","code":"(record.positions !== record.previous.positions && record.takeProfitPhase >= 0 ) || \n(record.takeProfitPhase !== record.previous.takeProfitPhase && record.takeProfitPhase >= 0 ) ","id":"a404c20d-5c4d-4505-81f0-263987496ba0","savedPayload":{"position":{"x":20512.20938711901,"y":16668.018452495136},"targetPosition":{"x":20403.512265858364,"y":16951.357870928146},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"c1ed6b36-4dd8-4ff5-ae66-6c6878b4edc1","savedPayload":{"position":{"x":20703.198573515907,"y":16903.615110005092},"targetPosition":{"x":20403.512265858364,"y":16951.357870928146},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"9baaa58e-af64-4348-9320-fad9823153a9"}}},"id":"0da5f29a-4847-460d-b982-68b8d5cc7fe5","savedPayload":{"position":{"x":20403.512265858364,"y":16951.357870928146},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[{"type":"Text","name":"New Text","config":"{ \n\"codeName\": \"\", \n\"fontSize\": 10\n}","textCondition":{"type":"Text Condition","name":"New Text Condition","code":"(record.positions !== record.previous.positions && record.takeProfitPhase >= 0 ) || \n(record.takeProfitPhase !== record.previous.takeProfitPhase && record.takeProfitPhase >= 0 ) ","id":"81c4f7bc-db04-4c61-a8e8-5a4a6308dda0","savedPayload":{"position":{"x":20703.245794640465,"y":17047.033493203206},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"textPosition":{"type":"Text Position","name":"New Text Position","config":"{ \n\"offsetX\": -3,\n \"offsetY\": -15\n }","id":"5833e42f-c848-4271-9e20-f48d5a98929a","savedPayload":{"position":{"x":20821.352886089888,"y":17192.68085475197},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"9baaa58e-af64-4348-9320-fad9823153a9"}}},"textFormula":{"type":"Text Formula","name":"New Text Formula","code":"record.takeProfitPhase","id":"00f3fb76-f50d-4879-b1d2-49c51824aef9","savedPayload":{"position":{"x":20831.184890390687,"y":17379.752666526765},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"textStyle":{"type":"Text Style","name":"New Text Style","config":"{\n \"paletteColor\": \"UI_COLOR.GREY\",\n \"opacity\": 0.5,\n \"fontSize\": 10\n}","id":"e4d1b248-ee99-42e0-9c77-18b9792b6631","savedPayload":{"position":{"x":20729.001095906126,"y":17537.001955971362},"targetPosition":{"x":20537.92810576854,"y":17301.399044121554},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"f26f4f43-95e1-406d-94e8-7c818e363777","savedPayload":{"position":{"x":20537.92810576854,"y":17301.399044121554},"targetPosition":{"x":19932.270540929123,"y":17333.180224227115},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"95465ef6-b26a-4ca3-817c-26b50e9ef8e0","savedPayload":{"position":{"x":19932.270540929123,"y":17333.180224227115},"targetPosition":{"x":19602.42862857182,"y":17841.350260979136},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Take Profit Panel","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Position #","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.positions","id":"c3aae579-7115-4e4c-bd43-829dea52a70f","savedPayload":{"position":{"x":20493.415203086817,"y":17519.82532581814},"targetPosition":{"x":20398.001422792637,"y":17637.514766308912},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"57d30bfc-893d-4e50-9cda-ee544fdae1e1","savedPayload":{"position":{"x":20398.001422792637,"y":17637.514766308912},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Take Profit","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.takeProfit","id":"64f4a076-de71-444a-a543-f62da7701e6f","savedPayload":{"position":{"x":20793.59376844515,"y":17716.512716110563},"targetPosition":{"x":20500.382585806416,"y":17794.725585927186},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"321eb006-13d4-4f66-aeab-f6fd2aa4758b","savedPayload":{"position":{"x":20500.382585806416,"y":17794.725585927186},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Take Profit Phase","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.takeProfitPhase","id":"0e3f0594-6a97-4e2e-a261-84be8b4ef02c","savedPayload":{"position":{"x":20632.3147274449,"y":18036.17669590365},"targetPosition":{"x":20490.477115362995,"y":17981.740036370767},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"eccb236b-4d20-4df2-9810-543bfbb3fc25","savedPayload":{"position":{"x":20490.477115362995,"y":17981.740036370767},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Take Profit Stage","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.takeProfitStage","id":"4ed86294-eeef-476c-a723-e469189a3f03","savedPayload":{"position":{"x":20454.963348189536,"y":18254.910990604796},"targetPosition":{"x":20372.332315474712,"y":18127.49391019403},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"2a6d62db-bf02-4319-86bf-27e52fad0423","savedPayload":{"position":{"x":20372.332315474712,"y":18127.49391019403},"targetPosition":{"x":20207.32141798083,"y":17873.033867520408},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"33aa2293-7958-4cc3-bb41-fc97c17ccd67","savedPayload":{"position":{"x":20207.32141798083,"y":17873.033867520408},"targetPosition":{"x":19602.42862857182,"y":17841.350260979136},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"78a2df79-8912-44d7-a8c7-4b6a0a7235c2","savedPayload":{"position":{"x":18703.415273635386,"y":17369.056734620204},"targetPosition":{"x":18515.28409408331,"y":18071.836287948023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"cd6f9452-2cce-424d-8059-e3b312f627c4","savedPayload":{"position":{"x":18515.28409408331,"y":18071.836287948023},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter","name":"Exchange Orders","config":"{ \n \"codeName\": \"Exchange-Orders\"\n}","modules":[{"type":"Plotter Module","name":"Market Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"bc2c1fb7-af45-4444-b883-7523eb94bcc0","savedPayload":{"position":{"x":18440.010197369746,"y":18315.673531983128},"targetPosition":{"x":18278.78037160947,"y":17952.316211547997},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5d2c59a6-72ce-4f42-8d14-62e4a7d11d73","savedPayload":{"position":{"x":18278.78037160947,"y":17952.316211547997},"targetPosition":{"x":18117.604269900297,"y":17589.249761269108},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"76027de9-5f42-494b-be42-7b24e7663fb4","savedPayload":{"position":{"x":17649.74527982425,"y":18232.596969099643},"targetPosition":{"x":17883.647782487562,"y":17910.908140283667},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0e224c82-a863-4953-8e38-42ff372df6cd","savedPayload":{"position":{"x":17883.647782487562,"y":17910.908140283667},"targetPosition":{"x":18117.604269900297,"y":17589.249761269108},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"c8f9bc68-22a9-47a7-8b54-f8e1ee93760a","savedPayload":{"position":{"x":18117.604269900297,"y":17589.249761269108},"targetPosition":{"x":18159.25181942883,"y":17193.906899228587},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"a307230c-ee14-4b3a-8430-5993da0e1b7e","savedPayload":{"position":{"x":17144.86869150668,"y":17652.671477763666},"targetPosition":{"x":17454.039991142112,"y":17402.50459278434},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"2c437c94-96f4-4b5b-9241-45636f73356e","savedPayload":{"position":{"x":17454.039991142112,"y":17402.50459278434},"targetPosition":{"x":17763.28722723131,"y":17152.317510279827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"7d4ca25c-5454-4d6a-8ead-a4ecee6709b8","savedPayload":{"position":{"x":17367.542610641038,"y":17110.774367223716},"targetPosition":{"x":17763.28722723131,"y":17152.317510279827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"5d2c59a6-72ce-4f42-8d14-62e4a7d11d73"}}},{"type":"Polygon Vertex","name":"End","id":"cefe7159-5b2f-4036-9aad-1d72358cbf81","savedPayload":{"position":{"x":17512.880846274402,"y":16843.13185902001},"targetPosition":{"x":17763.28722723131,"y":17152.317510279827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"0e224c82-a863-4953-8e38-42ff372df6cd"}}}],"id":"6217d021-ea5b-4b20-b093-758a2d2fb5d4","savedPayload":{"position":{"x":17763.28722723131,"y":17152.317510279827},"targetPosition":{"x":18159.25181942883,"y":17193.906899228587},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"market-order\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"48799848-30ad-4ef3-914e-45c3299168da","savedPayload":{"position":{"x":18220.928150308875,"y":16599.908712777175},"targetPosition":{"x":18200.4890453258,"y":16798.046780247023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"5d2c59a6-72ce-4f42-8d14-62e4a7d11d73"}}},"id":"c988d815-94cf-48e3-9447-2e81b97271b2","savedPayload":{"position":{"x":18200.4890453258,"y":16798.046780247023},"targetPosition":{"x":18159.25181942883,"y":17193.906899228587},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"486a0f30-691f-4c40-a18e-a1b0ac336ac1","savedPayload":{"position":{"x":18159.25181942883,"y":17193.906899228587},"targetPosition":{"x":18948.961479998656,"y":17276.86251661238},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Market Buy Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"6c10223a-aec1-485d-a731-2122a2485359","savedPayload":{"position":{"x":18783.141325577137,"y":16509.538560666882},"targetPosition":{"x":18914.41877571862,"y":16659.54503161315},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"6edbd7e7-a5ef-4ec0-ae1d-41c6a7cec5e1","savedPayload":{"position":{"x":18914.41877571862,"y":16659.54503161315},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"706b3e18-b354-4b2d-ad94-8a1e06aa3d6a","savedPayload":{"position":{"x":18801.938070469558,"y":16253.401215336313},"targetPosition":{"x":18990.671861414667,"y":16603.95216847281},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"312fc9a8-af5d-428b-b1b9-9207bf4def4d","savedPayload":{"position":{"x":18990.671861414667,"y":16603.95216847281},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"d304ece3-18dc-4e5a-bc0e-1249258b184e","savedPayload":{"position":{"x":18968.82226032012,"y":16185.662863746667},"targetPosition":{"x":19074.679904108307,"y":16569.48156712685},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"8313aeb6-6167-45ca-a3ca-4dc22b7fa33a","savedPayload":{"position":{"x":19074.679904108307,"y":16569.48156712685},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"6823da7b-b937-44ec-a748-6544810c5e4d","savedPayload":{"position":{"x":19146.059230944255,"y":16157.138309028162},"targetPosition":{"x":19163.79741436621,"y":16554.944636293047},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"bdc187a2-01a2-4d5e-a3b6-e03a3aa83337","savedPayload":{"position":{"x":19163.79741436621,"y":16554.944636293047},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"df586a2e-5e92-4719-b43a-b66e92d54cfb","savedPayload":{"position":{"x":19324.593262908165,"y":16169.038135250714},"targetPosition":{"x":19253.632735275824,"y":16560.858844045848},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"8c832572-6989-49fe-af66-337113d833bd","savedPayload":{"position":{"x":19253.632735275824,"y":16560.858844045848},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"ccaa9e2b-3d64-40fc-85e3-db8852ffe835","savedPayload":{"position":{"x":19496.153546415142,"y":16220.456397190967},"targetPosition":{"x":19339.759646546278,"y":16586.628646084635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"008d9794-b703-4e95-90a5-4be6541257b5","savedPayload":{"position":{"x":19339.759646546278,"y":16586.628646084635},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"cb7fe638-c8c1-4017-91c5-332f2a42d411","savedPayload":{"position":{"x":19651.883887717984,"y":16308.780685172373},"targetPosition":{"x":19417.90303766755,"y":16630.940519830892},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"233fcc31-94fb-4a83-8010-a47b06aa0175","savedPayload":{"position":{"x":19417.90303766755,"y":16630.940519830892},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"b205501c-00a5-42a5-bfb1-e1d766474e9b","savedPayload":{"position":{"x":19784.02636211265,"y":16429.52933407454},"targetPosition":{"x":19484.203320342564,"y":16691.5124198605},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"ef885584-c0ad-42ab-af01-1507c16da1c1","savedPayload":{"position":{"x":19484.203320342564,"y":16691.5124198605},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"14e3004b-320d-4791-aa6e-3f0d872ec7ec","savedPayload":{"position":{"x":19885.97450484608,"y":16576.64410295631},"targetPosition":{"x":19535.35564391014,"y":16765.30937068897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0d50ad49-9842-4e0e-86fd-12c026ada170","savedPayload":{"position":{"x":19535.35564391014,"y":16765.30937068897},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"8a56fba9-5ffc-4adf-8d6e-021fd4e5a43c","savedPayload":{"position":{"x":19952.638026080527,"y":16742.743481819143},"targetPosition":{"x":19568.809227936134,"y":16848.63320352723},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d6c7e18a-79da-4aed-8fae-298e604e05d0","savedPayload":{"position":{"x":19568.809227936134,"y":16848.63320352723},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"17dd754a-3ce8-470e-8351-0367bbc0eed2","savedPayload":{"position":{"x":19980.672859572293,"y":16919.50009617156},"targetPosition":{"x":19582.90047919128,"y":16937.311714734573},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a5c23ae8-7ff3-46a8-8f7f-c1ef46580415","savedPayload":{"position":{"x":19582.90047919128,"y":16937.311714734573},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"43a37c5e-0519-4920-9c61-1c8e7ee35308","savedPayload":{"position":{"x":19968.586492220402,"y":17097.721391559066},"targetPosition":{"x":19576.820286617793,"y":17026.885079106778},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"64741d06-09d2-497f-ab50-f1a0d1eba4bd","savedPayload":{"position":{"x":19576.820286617793,"y":17026.885079106778},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"d7dd0006-3d9f-49c8-984a-07b9d5f0dc48","savedPayload":{"position":{"x":19911.14073972588,"y":17278.67741172922},"targetPosition":{"x":19545.03963639315,"y":17122.705948316907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d411dc1c-83d7-4d2d-948e-c90f9e29121b","savedPayload":{"position":{"x":19545.03963639315,"y":17122.705948316907},"targetPosition":{"x":19182.324014173064,"y":16955.24321665635},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"12929733-5964-4948-877b-b1edda37162a","savedPayload":{"position":{"x":19182.324014173064,"y":16955.24321665635},"targetPosition":{"x":18948.961479998656,"y":17276.86251661238},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"e00fe7d4-894d-4483-a73a-3cd77943ea80","savedPayload":{"position":{"x":18949.091378017827,"y":17276.111636656784},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Market Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"df7ab0aa-4814-411b-a2f6-9594f67c7b41","savedPayload":{"position":{"x":18416.10033964062,"y":17766.67011168099},"targetPosition":{"x":18498.953957112702,"y":17378.023154985764},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"788a8d38-a7f8-4e9f-aa91-0d73d83967ba","savedPayload":{"position":{"x":18498.953957112702,"y":17378.023154985764},"targetPosition":{"x":18581.744366086998,"y":16989.196366677166},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"464d3c72-0056-48b0-b044-9131f136797f","savedPayload":{"position":{"x":17824.955995036587,"y":17234.5889128649},"targetPosition":{"x":18203.35723841807,"y":17111.806103185343},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5c7415c1-6a1d-4838-8587-6883c11724b4","savedPayload":{"position":{"x":18203.35723841807,"y":17111.806103185343},"targetPosition":{"x":18581.744366086998,"y":16989.196366677166},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"2e23d19b-466f-485b-b61d-ded90fa7b221","savedPayload":{"position":{"x":18581.744366086998,"y":16989.196366677166},"targetPosition":{"x":18847.985121184993,"y":16693.8908742562},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"fc7ced4a-bcf0-4c18-9e3b-959e7cac59f6","savedPayload":{"position":{"x":17757.51588029412,"y":16468.554748296723},"targetPosition":{"x":18154.821535546558,"y":16448.034071050406},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"10637dce-3cba-4c02-9561-da3ec43bdf0c","savedPayload":{"position":{"x":18154.821535546558,"y":16448.034071050406},"targetPosition":{"x":18552.166406316264,"y":16427.563643544898},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"210399d5-7817-4136-b2bf-59bc5b5c4eb6","savedPayload":{"position":{"x":18256.50808267463,"y":16161.223423711643},"targetPosition":{"x":18552.166406316264,"y":16427.563643544898},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"788a8d38-a7f8-4e9f-aa91-0d73d83967ba"}}},{"type":"Polygon Vertex","name":"End","id":"912ac4dc-6acb-4097-84e9-cf3d72060597","savedPayload":{"position":{"x":18531.343835488216,"y":16030.228593085923},"targetPosition":{"x":18552.166406316264,"y":16427.563643544898},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"5c7415c1-6a1d-4838-8587-6883c11724b4"}}}],"id":"5b8dcb5c-6b20-4edf-aae5-1c526cdca536","savedPayload":{"position":{"x":18552.166406316264,"y":16427.563643544898},"targetPosition":{"x":18847.985121184993,"y":16693.8908742562},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"template-target\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": -10\n }","id":"5321e00c-41b9-42a6-8e9a-e84067288a6a","savedPayload":{"position":{"x":19247.139121626424,"y":16249.869880913142},"targetPosition":{"x":19114.002774655382,"y":16398.03924935751},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"788a8d38-a7f8-4e9f-aa91-0d73d83967ba"}}},"id":"8ad2d152-57e7-4db6-b810-44bb870c46e2","savedPayload":{"position":{"x":19114.002774655382,"y":16398.03924935751},"targetPosition":{"x":18847.985121184993,"y":16693.8908742562},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"c24bfe41-ef93-4f0a-8c96-843536c85a2f","savedPayload":{"position":{"x":18847.985121184993,"y":16693.8908742562},"targetPosition":{"x":19437.909086266394,"y":17225.12113366464},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Market Sell Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"10079f5d-a713-48f1-9fa4-9a39df035ebd","savedPayload":{"position":{"x":19754.887932664187,"y":16507.023081235093},"targetPosition":{"x":19772.82017246318,"y":16705.465612929882},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"d1a51691-e741-402b-be76-229c27906a79","savedPayload":{"position":{"x":19772.82017246318,"y":16705.465612929882},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"3570f79d-6c3b-484f-b49a-86e44e05f7d0","savedPayload":{"position":{"x":19920.224592973293,"y":16310.789231672052},"targetPosition":{"x":19867.215274776794,"y":16705.366914918584},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7b17e1a2-4305-4b95-aaf1-00fd30502b68","savedPayload":{"position":{"x":19867.215274776794,"y":16705.366914918584},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"209c4655-8c35-4a02-8614-4ad0d2fd08cd","savedPayload":{"position":{"x":20095.048167515255,"y":16354.245409124293},"targetPosition":{"x":19955.424818615054,"y":16726.92979964175},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"81d14ecd-1649-4f2a-ab17-4228fc4ab198","savedPayload":{"position":{"x":19955.424818615054,"y":16726.92979964175},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"5819372f-29a7-455f-b7f1-9eb2ed9511e3","savedPayload":{"position":{"x":20255.179306277973,"y":16435.38753491841},"targetPosition":{"x":20035.988816092893,"y":16767.660256417916},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a2fe7ba5-6897-4208-84d9-91219ccc1761","savedPayload":{"position":{"x":20035.988816092893,"y":16767.660256417916},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"07bbf251-5e4d-4c01-95d8-fc034dd6c5aa","savedPayload":{"position":{"x":20392.946608109036,"y":16549.96569217833},"targetPosition":{"x":20105.264199107532,"y":16825.169196611976},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d4a00ff8-7115-4d3b-94b4-763c67ad67c6","savedPayload":{"position":{"x":20105.264199107532,"y":16825.169196611976},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"b79bb67e-d336-4d83-8246-91022e26270b","savedPayload":{"position":{"x":20501.532549068696,"y":16692.321267807878},"targetPosition":{"x":20159.79467934139,"y":16896.65021843019},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"59af816d-ca55-406a-9888-93232f408389","savedPayload":{"position":{"x":20159.79467934139,"y":16896.65021843019},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"9aa99e17-73be-4a99-940a-783eab7c20a5","savedPayload":{"position":{"x":20575.69402599018,"y":16855.2804421938},"targetPosition":{"x":20197.080321108824,"y":16978.407792032376},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7638f603-1ccd-45a0-b47f-ebf5f1b9b955","savedPayload":{"position":{"x":20197.080321108824,"y":16978.407792032376},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"ac4786f0-503a-460f-902b-6411cc2ae0d8","savedPayload":{"position":{"x":20611.52463144191,"y":17030.63297034157},"targetPosition":{"x":20215.049734361917,"y":17066.40205119344},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2d8825b1-5297-471b-8bd9-985c320293de","savedPayload":{"position":{"x":20215.049734361917,"y":17066.40205119344},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"d90d2c54-711a-4e4c-8978-35707c4739a2","savedPayload":{"position":{"x":20607.60012697259,"y":17209.398554578678},"targetPosition":{"x":20213.016733309843,"y":17156.17187569327},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"56d55a4c-f9cc-49ac-bede-46a16a153816","savedPayload":{"position":{"x":20213.016733309843,"y":17156.17187569327},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"8c94c40d-f6ce-4dae-a021-8c135f6d1717","savedPayload":{"position":{"x":20563.88247443461,"y":17382.94467056126},"targetPosition":{"x":20191.04074999999,"y":17243.217208586553},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2b866c75-bbdd-48c4-a01d-9c41e293bfcc","savedPayload":{"position":{"x":20191.04074999999,"y":17243.217208586553},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"e65731f4-f3ba-482f-b5d2-32b81b7c985f","savedPayload":{"position":{"x":20482.6606146546,"y":17542.26736643583},"targetPosition":{"x":20150.20799839948,"y":17323.153338820626},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"17bd2601-9f0b-4154-af99-d43ece82634a","savedPayload":{"position":{"x":20150.20799839948,"y":17323.153338820626},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"279db641-1837-4e2e-8315-c3d8b8ead3bd","savedPayload":{"position":{"x":20367.89757055834,"y":17679.640583728557},"targetPosition":{"x":20092.70905432908,"y":17392.09973018059},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"a87712d5-bc3e-4ba0-8a29-3c702e136d2c","savedPayload":{"position":{"x":20092.70905432908,"y":17392.09973018059},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"f8285da8-bae9-4041-b621-18c91a8e531d","savedPayload":{"position":{"x":20215.044122043484,"y":17792.270819594596},"targetPosition":{"x":20010.633195096325,"y":17450.95010606899},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3d89cd6b-0afb-470e-b60a-a626f35476ff","savedPayload":{"position":{"x":20010.633195096325,"y":17450.95010606899},"targetPosition":{"x":19815.713459062536,"y":17102.26439191507},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d3447547-3afd-4e00-a222-53a35cfeecd5","savedPayload":{"position":{"x":19815.713459062536,"y":17102.26439191507},"targetPosition":{"x":19437.909086266394,"y":17225.12113366464},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"a9811005-1b7d-45bb-8003-0e60caab5f09","savedPayload":{"position":{"x":19438.307813163843,"y":17224.62262455821},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Buy Orders","config":"{ \n \"codeName\": \"Market-Buy-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"94f80738-6b21-4e8d-8bdf-aa8ef6f8ad4f","savedPayload":{"position":{"x":18718.610777044116,"y":17307.768826372787},"targetPosition":{"x":19014.62087124595,"y":17041.999147361876},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"491e71de-b648-48aa-b493-67ed00359e73","savedPayload":{"position":{"x":19014.62087124595,"y":17041.999147361876},"targetPosition":{"x":19310.194058291483,"y":16776.523983157487},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"57bd54ae-96c8-4d10-bd6d-adf3d705e47e","savedPayload":{"position":{"x":18553.531652887305,"y":16530.69986439463},"targetPosition":{"x":18931.85120480123,"y":16653.56089394305},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"38fccc9b-d822-4598-a156-95c734ec3d6b","savedPayload":{"position":{"x":18931.85120480123,"y":16653.56089394305},"targetPosition":{"x":19310.194058291483,"y":16776.523983157487},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"8901df44-b813-47f3-8ded-4e1f6c68ae8b","savedPayload":{"position":{"x":19310.194058291483,"y":16776.523983157487},"targetPosition":{"x":19699.189542123262,"y":16694.245891682036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.GREEN\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"fa856a62-67b2-45b5-a186-a6538b220858","savedPayload":{"position":{"x":18949.554694846647,"y":15871.435140271547},"targetPosition":{"x":19283.021251814815,"y":16088.102505884965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"bb28a0e6-1cb3-4138-95f0-069745242288","savedPayload":{"position":{"x":19283.021251814815,"y":16088.102505884965},"targetPosition":{"x":19616.570962531052,"y":16304.81501412356},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"c4de49da-cd9d-4687-b08b-93f8bba1d454","savedPayload":{"position":{"x":19534.031490976013,"y":15915.533422175922},"targetPosition":{"x":19616.570962531052,"y":16304.81501412356},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"491e71de-b648-48aa-b493-67ed00359e73"}}},{"type":"Polygon Vertex","name":"End","id":"7b269f5c-62d2-4f58-a010-71f1179a3312","savedPayload":{"position":{"x":19833.1471500435,"y":15971.095488754892},"targetPosition":{"x":19616.570962531052,"y":16304.81501412356},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"38fccc9b-d822-4598-a156-95c734ec3d6b"}}}],"id":"7be8ba85-07e7-4800-8988-ce76d2105b73","savedPayload":{"position":{"x":19616.570962531052,"y":16304.81501412356},"targetPosition":{"x":19699.189542123262,"y":16694.245891682036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"help\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": 10\n }","id":"324aa438-7134-4918-b13e-082f3b3078dc","savedPayload":{"position":{"x":20283.1425515481,"y":16569.881754202175},"targetPosition":{"x":20088.428446470483,"y":16611.39030315388},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"491e71de-b648-48aa-b493-67ed00359e73"}}},"id":"89fe166c-e48e-4a0c-b357-149ffa17f2c2","savedPayload":{"position":{"x":20088.428446470483,"y":16611.39030315388},"targetPosition":{"x":19699.189542123262,"y":16694.245891682036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"3ea3861e-f37d-4d78-a45e-9b5fa738aefd","savedPayload":{"position":{"x":19699.189542123262,"y":16694.245891682036},"targetPosition":{"x":19864.068127132065,"y":17470.844315324215},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Limit Buy Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"a6b34df8-eb5f-4900-b6f6-d03e3b290159","savedPayload":{"position":{"x":20542.244039689427,"y":17075.803399332224},"targetPosition":{"x":20440.357147055944,"y":17247.041367963815},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"54f4544e-01f3-467c-ae2b-4768f3727c13","savedPayload":{"position":{"x":20440.357147055944,"y":17247.041367963815},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"72fc83f7-a4cd-4d34-9993-0a60ac61186a","savedPayload":{"position":{"x":20791.779320884918,"y":17014.560966144574},"targetPosition":{"x":20516.70878409209,"y":17302.426097037416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"bc719c08-2115-4a24-aa8d-c70d5befc876","savedPayload":{"position":{"x":20516.70878409209,"y":17302.426097037416},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"37588681-b070-4776-8ab4-9c290bf6d0b6","savedPayload":{"position":{"x":20907.603927036627,"y":17152.33171703652},"targetPosition":{"x":20575.43051295733,"y":17371.65414614221},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"27afb52d-a2c7-416e-b2d9-0d233bb4e209","savedPayload":{"position":{"x":20575.43051295733,"y":17371.65414614221},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"3b216246-bcca-42c6-8370-a1b5676595ba","savedPayload":{"position":{"x":20989.646638211983,"y":17312.169167319822},"targetPosition":{"x":20616.7540111582,"y":17451.912665051826},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3c50bf44-9722-4573-a38f-ddcfee10fb29","savedPayload":{"position":{"x":20616.7540111582,"y":17451.912665051826},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"7094d5cb-d538-45c3-b9e7-75c7c8ec5116","savedPayload":{"position":{"x":21033.743528573854,"y":17485.782494653296},"targetPosition":{"x":20639.125355177217,"y":17539.140401786764},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"75f4fa88-48ad-4448-ae12-42d3168ca3e8","savedPayload":{"position":{"x":20639.125355177217,"y":17539.140401786764},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"65bd507e-8d58-4ed0-9fba-8f7f1fda664b","savedPayload":{"position":{"x":21037.699065377332,"y":17664.526018891436},"targetPosition":{"x":20641.09701916488,"y":17629.009698943322},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"0f0014a6-3487-4e6c-8db2-784d5ac939dc","savedPayload":{"position":{"x":20641.09701916488,"y":17629.009698943322},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"88e45b0d-e67c-4031-9ff3-cfe08f9969f0","savedPayload":{"position":{"x":21001.93852722521,"y":17840.06223809468},"targetPosition":{"x":20623.2055910622,"y":17717.051966632273},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"48157935-fa37-4606-81de-7c2c7a0dab18","savedPayload":{"position":{"x":20623.2055910622,"y":17717.051966632273},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"3ab8f2dc-6837-4497-bfa0-9d9020c073d2","savedPayload":{"position":{"x":20927.83733446385,"y":18003.000669639627},"targetPosition":{"x":20586.053900310693,"y":17798.805661445134},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2bf1ef41-7989-4f62-afda-d1f3b513e119","savedPayload":{"position":{"x":20586.053900310693,"y":17798.805661445134},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"a3bc8eb8-2ae4-4c4a-b8ab-c52b96d12389","savedPayload":{"position":{"x":20819.488361070147,"y":18145.308406382603},"targetPosition":{"x":20531.64488816365,"y":17870.219782867523},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"137c331a-8dce-4a7c-baaa-8ec3873425fc","savedPayload":{"position":{"x":20531.64488816365,"y":17870.219782867523},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"51d867f0-87fa-42fe-ae34-60a63cc86136","savedPayload":{"position":{"x":20682.026393150543,"y":18259.94866747256},"targetPosition":{"x":20462.726854753862,"y":17927.75106143375},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"4aadb6f6-a5fc-49dc-ad45-49d19d1a635c","savedPayload":{"position":{"x":20462.726854753862,"y":17927.75106143375},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"95fb3723-fba0-478a-811d-27f3def52da3","savedPayload":{"position":{"x":20522.594005374274,"y":18341.223650201864},"targetPosition":{"x":20382.76209065659,"y":17968.58629383827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"42acb4bb-4128-4f8b-9e1a-375ddf9e5c3e","savedPayload":{"position":{"x":20382.76209065659,"y":17968.58629383827},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"257e5a1c-1f34-47e1-a2e8-87ef608e20f9","savedPayload":{"position":{"x":20349.055542474198,"y":18384.929925776516},"targetPosition":{"x":20295.702931585016,"y":17990.556215057324},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3a9aa85d-2fd9-46d3-9027-60b93952f7d5","savedPayload":{"position":{"x":20295.702931585016,"y":17990.556215057324},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"4a3930e7-71b4-4de2-91a9-c0e8fe4378cd","savedPayload":{"position":{"x":20159.134802686174,"y":18386.404734655618},"targetPosition":{"x":20194.702171846195,"y":17990.037977645177},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f940899b-39cd-4bcb-afa1-bc21b5d50b57","savedPayload":{"position":{"x":20194.702171846195,"y":17990.037977645177},"targetPosition":{"x":20241.95675880811,"y":17593.233401843718},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"c77b69de-126b-4692-8fdb-56af9ce42bec","savedPayload":{"position":{"x":20241.95675880811,"y":17593.233401843718},"targetPosition":{"x":19864.068127132065,"y":17470.844315324215},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"7e3120c7-a0c9-483c-ada9-8c53deb10f33","savedPayload":{"position":{"x":19864.492129018414,"y":17470.63669359887},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Plotter Module","name":"Limit Sell Orders","config":"{ \n \"codeName\": \"Market-Sell-Orders\", \n \"icon\": \"trend\",\n \"useRateAtMousePosition\": true\n}","shapes":{"type":"Shapes","name":"New Shapes","chartPoints":[{"type":"Chart Points","name":"New Chart Points","points":[{"type":"Point","name":"Begin","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.begin\ny = record.rate","id":"27343f26-0264-4d51-ae7d-3c4427915e34","savedPayload":{"position":{"x":19233.36296118093,"y":17114.990741841684},"targetPosition":{"x":19629.02655758904,"y":17073.998238842873},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"c0ca6e4d-6ea1-4447-ae1f-1bfc57c28085","savedPayload":{"position":{"x":19629.02655758904,"y":17073.998238842873},"targetPosition":{"x":20024.211663825638,"y":17033.159382997943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Point","name":"End","pointFormula":{"type":"Point Formula","name":"New Point Formula","code":"x = record.end\ny = record.rate","id":"525642e3-7dfc-432c-a507-5e5994671011","savedPayload":{"position":{"x":19556.857437302366,"y":16389.398930737367},"targetPosition":{"x":19790.48232938914,"y":16711.207830105854},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"fdde4047-6006-445f-ace9-c012a540f1da","savedPayload":{"position":{"x":19790.48232938914,"y":16711.207830105854},"targetPosition":{"x":20024.211663825638,"y":17033.159382997943},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"b0a9f9dd-26a1-4ff5-9252-daea0ac9cd25","savedPayload":{"position":{"x":20024.211663825638,"y":17033.159382997943},"targetPosition":{"x":20387.28096717611,"y":17194.931095401393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"polygons":[{"type":"Polygon","name":"New Polygon","polygonBorder":{"type":"Polygon Border","name":"New Polygon Border","style":{"type":"Style","name":"New Style","config":"{\n \"default\": {\n \"paletteColor\": \"UI_COLOR.RED\",\n \"opacity\": 0.5,\n \"lineWidth\": 0.2,\n \"lineDash\": [0,0]\n },\n \"atMousePosition\": {\n \"paletteColor\": \"UI_COLOR.TITANIUM_YELLOW\",\n \"opacity\": 0.8,\n \"lineWidth\": 1,\n \"lineDash\": [0,0]\n }\n}","id":"f13fe451-7e76-4042-9ae1-27ad7b60ae18","savedPayload":{"position":{"x":20264.49225530566,"y":16088.522899427171},"targetPosition":{"x":20406.78233024334,"y":16459.786930407},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"styleConditions":[],"id":"36736231-2578-42ec-a55e-88cee105c391","savedPayload":{"position":{"x":20406.78233024334,"y":16459.786930407},"targetPosition":{"x":20549.20485226298,"y":16831.256412244817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"polygonVertexes":[{"type":"Polygon Vertex","name":"Begin","id":"958f0760-0b28-4ca4-a180-018db39e05e1","savedPayload":{"position":{"x":20710.93183438131,"y":16467.774375265748},"targetPosition":{"x":20549.20485226298,"y":16831.256412244817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"Begin","id":"c0ca6e4d-6ea1-4447-ae1f-1bfc57c28085"}}},{"type":"Polygon Vertex","name":"End","id":"3b5d9862-762b-4320-80e2-239f7fba8bfd","savedPayload":{"position":{"x":20920.78219265595,"y":16688.751249301196},"targetPosition":{"x":20549.20485226298,"y":16831.256412244817},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Point","name":"End","id":"fdde4047-6006-445f-ace9-c012a540f1da"}}}],"id":"ecc7aa98-a1ca-4bd0-94d3-a346bd031314","savedPayload":{"position":{"x":20549.20485226298,"y":16831.256412244817},"targetPosition":{"x":20387.28096717611,"y":17194.931095401393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"images":[{"type":"Image","name":"New Image","config":"{ \n\"codeName\": \"dash\", \n\"size\": 10\n}","imagePosition":{"type":"Image Position","name":"New Image Position","config":"{ \n\"offsetX\": 0,\n \"offsetY\": -10\n }","id":"b8e35c45-7eaa-4963-895e-07a2be300d0c","savedPayload":{"position":{"x":20932.87323962831,"y":17437.362888863667},"targetPosition":{"x":20750.912467524868,"y":17356.573288977313},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Point","name":"Begin","id":"c0ca6e4d-6ea1-4447-ae1f-1bfc57c28085"}}},"id":"d2e74abb-8a91-4fc7-a639-8674a49dd713","savedPayload":{"position":{"x":20750.912467524868,"y":17356.573288977313},"targetPosition":{"x":20387.28096717611,"y":17194.931095401393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"texts":[],"id":"7de2e3be-733d-41a4-9bed-c06f71c2f55a","savedPayload":{"position":{"x":20387.28096717611,"y":17194.931095401393},"targetPosition":{"x":20064.427431560114,"y":17920.179416251263},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"panels":[{"type":"Plotter Panel","name":"Limit Sell Order","config":"{ \n \"codeName\": \"\"\n}","panelData":[{"type":"Panel Data","name":"Serial Number","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.serialNumber","id":"9470a248-8d25-4e69-8188-31631b338f40","savedPayload":{"position":{"x":20837.48324534772,"y":17975.81186947458},"targetPosition":{"x":20656.011578802958,"y":18059.011566467427},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"id":"55da37dd-29b1-4d4e-8563-d9075777cb23","savedPayload":{"position":{"x":20656.011578802958,"y":18059.011566467427},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.rate","id":"f9806071-b507-4382-bf5b-cd3e8ce03c79","savedPayload":{"position":{"x":21091.963928114725,"y":18108.41837585634},"targetPosition":{"x":20698.69273923903,"y":18177.32760383407},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"8ccfca08-c6d4-457f-b49e-b76b9ea02b0a","savedPayload":{"position":{"x":20698.69273923903,"y":18177.32760383407},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Size","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.size","id":"0cd1b214-5980-4200-8896-903830c520fe","savedPayload":{"position":{"x":21095.3292009353,"y":18281.506615649057},"targetPosition":{"x":20697.859082198866,"y":18263.20043681344},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"64993251-8554-400b-8e00-9f9ff7636d03","savedPayload":{"position":{"x":20697.859082198866,"y":18263.20043681344},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Status","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.status","id":"b5c8308d-6c94-4e86-b2c1-9d2195fe6bf4","savedPayload":{"position":{"x":21067.423810141627,"y":18455.831523036308},"targetPosition":{"x":20683.322851983175,"y":18349.829664008645},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"3cea1f9f-e12d-4fc7-98a3-963d470af36b","savedPayload":{"position":{"x":20683.322851983175,"y":18349.829664008645},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Exit Type","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.exitType","id":"dde51a18-352c-4e74-8e1a-6f0c2f7cd431","savedPayload":{"position":{"x":21001.914709725563,"y":18621.57043529477},"targetPosition":{"x":20651.118832991346,"y":18432.87866195875},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7f777a5e-e5f9-4910-9c85-4123fb716c8a","savedPayload":{"position":{"x":20651.118832991346,"y":18432.87866195875},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Order Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.orderName","id":"4b4fcada-996d-47c9-a5a9-bcc69b9522a8","savedPayload":{"position":{"x":20898.70576096475,"y":18766.81998747293},"targetPosition":{"x":20598.67588797691,"y":18504.998005695033},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"2d1cd1de-aa70-4afa-a02f-6ee95f26592b","savedPayload":{"position":{"x":20598.67588797691,"y":18504.998005695033},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Algorithm Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.algorithmName","id":"57b439ef-6c45-4729-91ad-2f6a249e04b8","savedPayload":{"position":{"x":20769.830802591398,"y":18888.578227237987},"targetPosition":{"x":20535.74681863763,"y":18566.83608864393},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"d13d02cb-5cac-48cb-9472-fd716e1a02bd","savedPayload":{"position":{"x":20535.74681863763,"y":18566.83608864393},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Situation Name","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.situationName","id":"c7667cdf-74fc-4e1f-90f7-1670004a1d1a","savedPayload":{"position":{"x":20607.938897987675,"y":18963.195484303993},"targetPosition":{"x":20450.808343222954,"y":18596.71595355224},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"ab425dc9-c539-4adc-90e6-bfef03e71897","savedPayload":{"position":{"x":20450.808343222954,"y":18596.71595355224},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Percentage Filled","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.percentageFilled","id":"f7a7cb7f-d63a-4446-b66d-04317f9b5d89","savedPayload":{"position":{"x":20440.862558950565,"y":19028.45914890388},"targetPosition":{"x":20369.474682965534,"y":18637.211480343853},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"acd70922-cde3-481b-913a-25747b7caa93","savedPayload":{"position":{"x":20369.474682965534,"y":18637.211480343853},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Actual Rate","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.actualRate","id":"9d9b3ac7-9cfe-4ede-a6b1-7e5b3638bfd3","savedPayload":{"position":{"x":20262.17745479484,"y":19039.58936955458},"targetPosition":{"x":20279.532650123103,"y":18641.767068205263},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"cbff7535-8426-48d0-9caf-f7f62658bbf3","savedPayload":{"position":{"x":20279.532650123103,"y":18641.767068205263},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Fees Paid","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.feesPaid","id":"f5dc0bd3-987a-4cb6-acd8-e44d103628bb","savedPayload":{"position":{"x":20085.272304141883,"y":19011.33557035203},"targetPosition":{"x":20190.73495483825,"y":18627.640182058312},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"cbddfd74-5150-4d86-9f24-8a6bba8b47d7","savedPayload":{"position":{"x":20190.73495483825,"y":18627.640182058312},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Periods","config":"{\n \"valueDecimals\": 0\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.periods","id":"b984d13d-80d0-4fc7-acdd-0bdaa3daa8fe","savedPayload":{"position":{"x":19919.034353417366,"y":18944.7123547612},"targetPosition":{"x":20107.379767239647,"y":18594.10415353865},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"f4454162-f131-41d5-be37-b1ac3ca3615a","savedPayload":{"position":{"x":20107.379767239647,"y":18594.10415353865},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Panel Data","name":"Days","config":"{\n \"valueDecimals\": 2\n}","dataFormula":{"type":"Data Formula","name":"New Data Formula","code":"record.days","id":"0b645733-d948-47eb-9382-c35d498406c5","savedPayload":{"position":{"x":19764.32332607289,"y":18833.390057930817},"targetPosition":{"x":20025.734103700695,"y":18533.547542467106},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"078df67b-29cf-4ee4-962c-7934f570e075","savedPayload":{"position":{"x":20025.734103700695,"y":18533.547542467106},"targetPosition":{"x":20297.916897779334,"y":18241.41193503254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"d42f8da7-a8d0-4154-bf1f-7eeca102d9d7","savedPayload":{"position":{"x":20297.916897779334,"y":18241.41193503254},"targetPosition":{"x":20064.427431560114,"y":17920.179416251263},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"fb243322-ec2a-4f03-bb77-e97e4699d1c6","savedPayload":{"position":{"x":20064.625299812844,"y":17920.066863345062},"targetPosition":{"x":19272.98362544747,"y":18003.618745805295},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"93c15cbf-185a-4b59-b55f-847f437bb841","savedPayload":{"position":{"x":19272.98362544747,"y":18003.618745805295},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"id":"6a54eece-4582-4cda-a854-1cd805e00fed","savedPayload":{"position":{"x":18884.571706269082,"y":18699.127167364633},"targetPosition":{"x":18884.571706269082,"y":18699.127167364633},"floatingObject":{"isPinned":true,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}
\ No newline at end of file