Merge pull request #279 from Superalgos/develop

Pre-Release Beta6 SP1
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2020-10-08 15:24:42 +02:00
commit b656806204
80 files changed
+877 -542

No files matched your search

+9 -9
View File
@@ -1,7 +1,7 @@
#PORT NUMBERS: If any of these ports are already in use by a different app, please pick a new number between 1 and 50000.
WEB_SERVER_PORT=34248
WEB_SOCKETS_SERVER_PORT=8081
WEB_SOCKETS_SERVER_PORT=18041
# TASK MANAGER VARIABLES:
@@ -14,13 +14,13 @@ INTER_PROCESS_FILES_PATH=./Inter-Process-Files
STORAGE_PATH=./Data-Storage
PLOTTERS_PATH=./Legacy-Code
DATA_MINES_PATH=./Includes/Data-Mines
TRADING_MINES_PATH=./Includes/Trading-Mines
TRADING_SYSTEMS_PATH=./Includes/Trading-Systems
SUPER_SCRIPTS_PATH=./Includes/Super-Scripts
TRADING_ENGINES_PATH=./Includes/Trading-Engines
TUTORIALS_PATH=./Includes/Tutorials
WORKSPACES_PATH=./Includes/Workspaces
DATA_MINES_PATH=./Plugins/Data-Mines
TRADING_MINES_PATH=./Plugins/Trading-Mines
TRADING_SYSTEMS_PATH=./Plugins/Trading-Systems
SUPER_SCRIPTS_PATH=./Plugins/Super-Scripts
TRADING_ENGINES_PATH=./Plugins/Trading-Engines
TUTORIALS_PATH=./Plugins/Tutorials
WORKSPACES_PATH=./Plugins/Workspaces
WRITE_LOGS_TO_FILES=true
BOTS_PATH=./Legacy-Code
@@ -41,6 +41,6 @@ PATH_TO_WEB_SERVER=./BackendServers/
APP_SCHEMA_PATH=./
DOC_SCHEMA_PATH=./
CONCEPT_SCHEMA_PATH=./
DEFAULT_WORKSPACE_PATH=./Includes/Workspaces
DEFAULT_WORKSPACE_PATH=./Plugins/Workspaces
MY_WORKSPACES_PATH=./My-Workspaces
PATH_TO_FONTS=./BackendServers/WebServer/Fonts
+197 -77
View File
@@ -1446,13 +1446,7 @@
"label": "Add Tutorial",
"relatedUiObject": "Tutorial",
"actionFunction": "payload.onMenuItemClick"
},
{
"action": "Add UI Object",
"label": "Add Includes",
"relatedUiObject": "Includes",
"actionFunction": "payload.onMenuItemClick"
}
}
],
"isTitleAllwaysVisible": true,
"addLeftIcons": false,
@@ -12437,6 +12431,113 @@
"propertyNameAtParent": "keys",
"isPersonalData": true
},
{
"type": "Design Space",
"menuItems": [
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "spaceStyle",
"label": "Add Space Style",
"relatedUiObject": "Space Style",
"actionFunction": "payload.onMenuItemClick"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "spaceSettings",
"label": "Add Space Settings",
"relatedUiObject": "Space Settings",
"actionFunction": "payload.onMenuItemClick"
}
],
"isHierarchyHead": true,
"addLeftIcons": true,
"level": 0,
"properties": [
{
"name": "spaceStyle",
"type": "node",
"childType": "Space Style",
"autoAdd": true
},
{
"name": "spaceSettings",
"type": "node",
"childType": "Space Settings",
"autoAdd": true
}
],
"icon": "bitcoin"
},
{
"type": "Space Style",
"level": 4,
"propertyNameAtParent": "spaceStyle",
"chainAttachesTo": {
"compatibleTypes": "->Charting Space->Design Space->"
},
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n\"backgroundColor\": \"UI_COLOR.BLACK\"\n}"
},
"menuItems": [
{
"action": "Configure",
"actionFunction": "uiObject.configEditor.activate",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"actionFunction": "payload.onMenuItemClick",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete"
}
],
"addLeftIcons": true,
"icon": "bitcoin"
},
{
"type": "Space Settings",
"level": 4,
"propertyNameAtParent": "spaceSettings",
"chainAttachesTo": {
"compatibleTypes": "->Charting Space->Design Space->"
},
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n\"distanceBetweenNodes\": 500\n}"
},
"menuItems": [
{
"action": "Configure",
"actionFunction": "uiObject.configEditor.activate",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"actionFunction": "payload.onMenuItemClick",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete"
}
],
"addLeftIcons": true,
"icon": "bitcoin"
},
{
"type": "Charting Space",
"menuItems": [
@@ -12448,6 +12549,22 @@
"relatedUiObject": "Viewport",
"actionFunction": "payload.onMenuItemClick"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "spaceStyle",
"label": "Add Space Style",
"relatedUiObject": "Space Style",
"actionFunction": "payload.onMenuItemClick"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "spaceSettings",
"label": "Add Space Settings",
"relatedUiObject": "Space Settings",
"actionFunction": "payload.onMenuItemClick"
},
{
"action": "Add UI Object",
"label": "Add Dashboard",
@@ -12474,6 +12591,18 @@
"childType": "Viewport",
"autoAdd": true
},
{
"name": "spaceStyle",
"type": "node",
"childType": "Space Style",
"autoAdd": true
},
{
"name": "spaceSettings",
"type": "node",
"childType": "Space Settings",
"autoAdd": true
},
{
"name": "dashboards",
"type": "array",
@@ -14283,74 +14412,65 @@
]
},
{
"type": "Includes",
"type": "Plugins",
"menuItems": [
{
"action": "Add Missing Children",
"label": "Add Missing Children",
"relatedUiObject": "Includes",
"actionFunction": "payload.onMenuItemClick"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"relatedUiObject": "Plugins",
"actionFunction": "payload.onMenuItemClick"
}
],
"isHierarchyHead": true,
"addLeftIcons": true,
"level": 0,
"propertyNameAtParent": "includes",
"propertyNameAtParent": "plugins",
"properties": [
{
"name": "includedDataMines",
"name": "pluginDataMines",
"type": "node",
"childType": "Included Data Mines",
"childType": "Plugin Data Mines",
"autoAdd": false
},
{
"name": "includedTradingMines",
"name": "pluginTradingMines",
"type": "node",
"childType": "Included Trading Mines",
"childType": "Plugin Trading Mines",
"autoAdd": false
},
{
"name": "includedTradingSystems",
"name": "pluginTradingSystems",
"type": "node",
"childType": "Included Trading Systems",
"childType": "Plugin Trading Systems",
"autoAdd": false
},
{
"name": "includedTradingEngines",
"name": "pluginTradingEngines",
"type": "node",
"childType": "Included Trading Engines",
"childType": "Plugin Trading Engines",
"autoAdd": false
},
{
"name": "includedSuperScripts",
"name": "pluginSuperScripts",
"type": "node",
"childType": "Included Super Scripts",
"childType": "Plugin Super Scripts",
"autoAdd": false
},
{
"name": "includedTutorials",
"name": "pluginTutorials",
"type": "node",
"childType": "Included Tutorials",
"childType": "Plugin Tutorials",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included Data Mines",
"type": "Plugin Data Mines",
"menuItems": [
{
"action": "Include Missing Data Mines",
"label": "Include Missing Data Mines",
"action": "Add Missing Data Mines",
"label": "Add Missing Data Mines",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
@@ -14369,23 +14489,23 @@
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "includedDataMines",
"propertyNameAtParent": "pluginDataMines",
"properties": [
{
"name": "includedFiles",
"name": "pluginFiles",
"type": "array",
"childType": "Included File",
"childType": "Plugin File",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included Trading Mines",
"type": "Plugin Trading Mines",
"menuItems": [
{
"action": "Include Missing Trading Mines",
"label": "Include Missing Trading Mines",
"action": "Add Missing Trading Mines",
"label": "Add Missing Trading Mines",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
@@ -14404,23 +14524,23 @@
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "includedTradingMines",
"propertyNameAtParent": "pluginTradingMines",
"properties": [
{
"name": "includedFiles",
"name": "pluginFiles",
"type": "array",
"childType": "Included File",
"childType": "Plugin File",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included Trading Systems",
"type": "Plugin Trading Systems",
"menuItems": [
{
"action": "Include Missing Trading Systems",
"label": "Include Missing Trading Systems",
"action": "Add Missing Trading Systems",
"label": "Add Missing Trading Systems",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
@@ -14439,23 +14559,23 @@
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "includedTradingSystems",
"propertyNameAtParent": "pluginTradingSystems",
"properties": [
{
"name": "includedFiles",
"name": "pluginFiles",
"type": "array",
"childType": "Included File",
"childType": "Plugin File",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included Trading Engines",
"type": "Plugin Trading Engines",
"menuItems": [
{
"action": "Include Missing Trading Engines",
"label": "Include Missing Trading Engines",
"action": "Add Missing Trading Engines",
"label": "Add Missing Trading Engines",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
@@ -14474,23 +14594,23 @@
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "includedTradingEngines",
"propertyNameAtParent": "pluginTradingEngines",
"properties": [
{
"name": "includedFiles",
"name": "pluginFiles",
"type": "array",
"childType": "Included File",
"childType": "Plugin File",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included Super Scripts",
"type": "Plugin Super Scripts",
"menuItems": [
{
"action": "Include Missing Super Scripts",
"label": "Include Missing Super Scripts",
"action": "Add Missing Super Scripts",
"label": "Add Missing Super Scripts",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
@@ -14509,23 +14629,23 @@
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "includedSuperScripts",
"propertyNameAtParent": "pluginSuperScripts",
"properties": [
{
"name": "includedFiles",
"name": "pluginFiles",
"type": "array",
"childType": "Included File",
"childType": "Plugin File",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included Tutorials",
"type": "Plugin Tutorials",
"menuItems": [
{
"action": "Include Missing Tutorials",
"label": "Include Missing Tutorials",
"action": "Add Missing Tutorials",
"label": "Add Missing Tutorials",
"askConfirmation": true,
"confirmationLabel": "Confirm to Proceed",
"workDoneLabel": "Done",
@@ -14544,27 +14664,27 @@
],
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "includedTutorials",
"propertyNameAtParent": "pluginTutorials",
"properties": [
{
"name": "includedFiles",
"name": "pluginFiles",
"type": "array",
"childType": "Included File",
"childType": "Plugin File",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included File",
"type": "Plugin File",
"menuItems": [
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "includedFilePosition",
"propertyToCheckFor": "pluginFilePosition",
"actionFunction": "payload.onMenuItemClick",
"label": "Add Included File Position",
"relatedUiObject": "Included File Position",
"label": "Add Plugin File Position",
"relatedUiObject": "Plugin File Position"
},
{
"action": "Delete UI Object",
@@ -14578,19 +14698,19 @@
],
"addLeftIcons": true,
"level": 2,
"propertyNameAtParent": "includedFiles",
"propertyNameAtParent": "pluginFiles",
"properties": [
{
"name": "includedFilePosition",
"name": "pluginFilePosition",
"type": "node",
"childType": "Included File Position",
"childType": "Plugin File Position",
"autoAdd": false
}
],
"icon": "bitcoin"
},
{
"type": "Included File Position",
"type": "Plugin File Position",
"menuItems": [
{
"action": "Delete UI Object",
@@ -14607,7 +14727,7 @@
],
"addLeftIcons": true,
"level": 3,
"propertyNameAtParent": "includedFilePosition",
"propertyNameAtParent": "pluginFilePosition",
"properties": [
],
"icon": "bitcoin"
@@ -14750,7 +14870,7 @@
"incompatibleTypes": "->Tutorial->Tutorial Topic->Tutorial Step->"
},
"chainAttachesTo": {
"compatibleTypes": "->Tutorial->"
"compatibleTypes": "->Tutorial->Tutorial Topic->"
},
"addLeftIcons": true,
"level": 1,
+1 -1
View File
@@ -8,6 +8,6 @@ WRITE_LOGS_TO_FILES=true
BOTS_PATH=../Legacy-Code
LOG_PATH=../Log-Files
WEB_SOCKETS_SERVER_PORT=8081
WEB_SOCKETS_SERVER_PORT=18041
WEB_SERVER_PORT=34248
WEB_SERVER_URL=localhost
+1 -1
View File
@@ -60,7 +60,7 @@ function newAppLoader() {
'DesignSpace/Workspace/FunctionLibraries/DataStorageFunctions.js',
'DesignSpace/Workspace/FunctionLibraries/ChartingSpaceFunctions.js',
'DesignSpace/Workspace/FunctionLibraries/TutorialFunctions.js',
'DesignSpace/Workspace/FunctionLibraries/IncludesFunctions.js',
'DesignSpace/Workspace/FunctionLibraries/PluginsFunctions.js',
'Utilities/CoordinateTransformations.js',
'Utilities/DateRateTransformations.js',
+5 -5
View File
@@ -454,7 +454,7 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
}
break
case 'IncludedFileNames':
case 'PluginFileNames':
{
const fs = require('fs')
let folder
@@ -534,8 +534,8 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
case 'ListWorkspaces':
{
let allWorkspaces = []
readIncludedWorkspaces()
function readIncludedWorkspaces() {
readPluginWorkspaces()
function readPluginWorkspaces() {
let dirPath = process.env.WORKSPACES_PATH
try {
let fs = require('fs')
@@ -549,7 +549,7 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
} else {
let updatedFileList = []
for (let i = 0; i < fileList.length; i++) {
let name = 'Included -> ' + fileList[i]
let name = 'Plugin -> ' + fileList[i]
updatedFileList.push(name)
}
allWorkspaces = allWorkspaces.concat(updatedFileList)
@@ -598,7 +598,7 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
}
break
case 'LoadIncludedWorkspace':
case 'LoadPluginWorkspace':
{
let fileName = unescape(requestParameters[2])
let filePath = process.env.WORKSPACES_PATH + '/' + fileName + '.json'
+1 -1
View File
@@ -115,7 +115,7 @@ function newAnimation() {
row = 0
for (const [key, timeConsumed] of performanceMap.entries()) {
row++
labelToPrint = key + ' ' + timeConsumed.toFixed(4)
let labelToPrint = key + ' ' + timeConsumed.toFixed(4)
printLabel(labelToPrint, 10, 100 + row * 30, 1, 20, UI_COLOR.RED)
let percentage = timeConsumed * 100 / totalTimeConsumed
labelToPrint = key + ' ' + percentage.toFixed(1) + '%'
+18 -17
View File
@@ -73,29 +73,30 @@ function newCanvas() {
thisObject.floatingSpace.finalize()
thisObject.shorcutNumbers = undefined
browserCanvas.removeEventListener('mousedown', onMouseDown, false)
browserCanvas.removeEventListener('mouseup', onMouseUp, false)
browserCanvas.removeEventListener('mousemove', onMouseMove, false)
browserCanvas.removeEventListener('click', onMouseClick, false)
browserCanvas.removeEventListener('mouseout', onMouseOut, false)
if (browserCanvas.removeEventListener) {
browserCanvas.removeEventListener('mousewheel', onMouseWheel, false)// IE9, Chrome, Safari, Opera
browserCanvas.removeEventListener('DOMMouseScroll', onMouseWheel, false) // Firefox
} else browserCanvas.detachEvent('onmousewheel', onMouseWheel) // IE 6/7/8
browserCanvas.removeEventListener('dragenter', onDragEnter, false)
browserCanvas.removeEventListener('dragleave', onDragLeave, false)
browserCanvas.removeEventListener('dragover', onDragOver, false)
browserCanvas.removeEventListener('drop', onDragDrop, false)
browserCanvas.removeEventListener('keydown', onKeyDown, false)
browserCanvas.removeEventListener('keyup', onKeyUp, false)
browserCanvas.removeEventListener('mousedown', onMouseDown, false)
browserCanvas.removeEventListener('mouseup', onMouseUp, false)
browserCanvas.removeEventListener('mousemove', onMouseMove, false)
browserCanvas.removeEventListener('click', onMouseClick, false)
browserCanvas.removeEventListener('mouseout', onMouseOut, false)
browserCanvas.removeEventListener('dragenter', onDragEnter, false)
browserCanvas.removeEventListener('dragleave', onDragLeave, false)
browserCanvas.removeEventListener('dragover', onDragOver, false)
browserCanvas.removeEventListener('drop', onDragDrop, false)
browserCanvas.removeEventListener('keydown', onKeyDown, false)
browserCanvas.removeEventListener('keyup', onKeyUp, false)
} else {
browserCanvas.detachEvent('onmousewheel', onMouseWheel) // IE 6/7/8
}
thisObject.splashScreen = undefined
lastContainerMouseOver = undefined
hisObject.mouse = undefined
thisObject.mouse = undefined
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) }
}
@@ -544,7 +545,7 @@ function newCanvas() {
} else {
/* After the warning, we allow the key to be re-assigned */
nodeUsingThisKey.payload.uiObject.shortcutKey = ''
nodeUsingThisKey === undefined
nodeUsingThisKey = undefined
nodeOnFocus.payload.uiObject.shortcutKey = event.key
nodeOnFocus.payload.uiObject.valueAtAngle = false
nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + event.key)
+1 -1
View File
@@ -163,7 +163,7 @@ function newPlottersManager() {
let host = layer.networkNode.config.host
let webPort = layer.networkNode.config.webPort
if (host === undefined) { host = 'localhost' }
if (host === undefined) { host = window.location.hostname }
if (webPort === undefined) { webPort = window.location.port }
let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(layer.networkNode.id)
+2 -2
View File
@@ -645,8 +645,8 @@ function newTimeMachine() {
}
function drawLabel() {
if (thisObject.payload.node === undefined) { return }
if (thisObject.payload === undefined) { return }
if (thisObject.payload.node === undefined) { return }
/* Draw Title Above the Container */
let position = {
x: 0,
@@ -688,7 +688,7 @@ function newTimeMachine() {
for (let j = 0; j < layers.length; j++) {
let layer = layers[j]
exchangeMarket = {
let exchangeMarket = {
exchangeName: layer.exchange.name,
marketName: layer.market,
exchangeIcon: layer.exchangeIcon,
@@ -331,7 +331,7 @@ function newCryptoEcosystemFunctions() {
Create everything inside the session references.
*/
for (let j = 0; j < marketTradingProducts.sessionReferences.length; j++) {
sessionReference = marketTradingProducts.sessionReferences[j]
let sessionReference = marketTradingProducts.sessionReferences[j]
menuClick(sessionReference, 'Add All Trading Mine Products', true)
menuClickOfNodeArray(sessionReference.tradingMineProducts, 'Add All Data Products', true)
sessionReference.payload.floatingObject.collapseToggle()
@@ -1,84 +0,0 @@
function newIncludesFunctions() {
thisObject = {
includeMissingDataMines: includeMissingDataMines,
includeMissingTradingMines: includeMissingTradingMines,
includeMissingTradingSystems: includeMissingTradingSystems,
includeMissingTradingEngines: includeMissingTradingEngines,
includeMissingSuperScripts: includeMissingSuperScripts,
includeMissingTutorials: includeMissingTutorials
}
return thisObject
function getIncludedFileNames(includeType, callBack) {
callServer(undefined, 'IncludedFileNames/' + includeType, onResponse)
function onResponse(err, data) {
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
console.log('Failed to Fetch Included ' + includeType + ' from the Backend')
return
}
let includedFileNames = JSON.parse(data)
callBack(includedFileNames)
}
}
function addIncludedFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes) {
for (let i = 0; i < fileNames.length; i++) {
let fileName = fileNames[i]
fileName = fileName.replace('.json', '')
if (isMissingChildrenByName(node, fileName) === true) {
let child = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Included File')
child.name = fileName
}
}
}
function includeMissingDataMines(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getIncludedFileNames('Data-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
addIncludedFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function includeMissingTradingMines(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getIncludedFileNames('Trading-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
addIncludedFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function includeMissingTradingSystems(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getIncludedFileNames('Trading-Systems', onNamesArrived)
function onNamesArrived(fileNames) {
addIncludedFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function includeMissingTradingEngines(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getIncludedFileNames('Trading-Engines', onNamesArrived)
function onNamesArrived(fileNames) {
addIncludedFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function includeMissingSuperScripts(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getIncludedFileNames('Super-Scripts', onNamesArrived)
function onNamesArrived(fileNames) {
addIncludedFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function includeMissingTutorials(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getIncludedFileNames('Tutorials', onNamesArrived)
function onNamesArrived(fileNames) {
addIncludedFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
}
@@ -119,8 +119,8 @@ function newNodeDeleter() {
}
function cleanNode(node) {
if (node.payload === undefined) { return }
if (node === undefined) { return }
if (node.payload === undefined) { return }
node.payload.targetPosition.x = undefined
node.payload.targetPosition.y = undefined
@@ -25,8 +25,7 @@ function newOnFocus() {
case 'node': {
if (property.name !== previousPropertyName) {
if (node[property.name] !== undefined) {
let child
child = getNodeThatIsOnFocus(node[property.name])
let child = getNodeThatIsOnFocus(node[property.name])
if (child !== undefined) {
return child
}
@@ -39,7 +38,7 @@ function newOnFocus() {
let nodePropertyArray = node[property.name]
if (nodePropertyArray !== undefined) {
for (let m = 0; m < nodePropertyArray.length; m++) {
child = getNodeThatIsOnFocus(nodePropertyArray[m])
let child = getNodeThatIsOnFocus(nodePropertyArray[m])
if (child !== undefined) {
return child
}
@@ -0,0 +1,84 @@
function newPluginsFunctions() {
thisObject = {
pluginMissingDataMines: pluginMissingDataMines,
pluginMissingTradingMines: pluginMissingTradingMines,
pluginMissingTradingSystems: pluginMissingTradingSystems,
pluginMissingTradingEngines: pluginMissingTradingEngines,
pluginMissingSuperScripts: pluginMissingSuperScripts,
pluginMissingTutorials: pluginMissingTutorials
}
return thisObject
function getPluginFileNames(pluginType, callBack) {
callServer(undefined, 'PluginFileNames/' + pluginType, onResponse)
function onResponse(err, data) {
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
console.log('Failed to Fetch Plugin ' + pluginType + ' from the Backend')
return
}
let pluginFileNames = JSON.parse(data)
callBack(pluginFileNames)
}
}
function addPluginFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes) {
for (let i = 0; i < fileNames.length; i++) {
let fileName = fileNames[i]
fileName = fileName.replace('.json', '')
if (isMissingChildrenByName(node, fileName) === true) {
let child = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Plugin File')
child.name = fileName
}
}
}
function pluginMissingDataMines(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getPluginFileNames('Data-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function pluginMissingTradingMines(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getPluginFileNames('Trading-Mines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function pluginMissingTradingSystems(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getPluginFileNames('Trading-Systems', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function pluginMissingTradingEngines(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getPluginFileNames('Trading-Engines', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function pluginMissingSuperScripts(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getPluginFileNames('Super-Scripts', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
function pluginMissingTutorials(node, rootNodes, functionLibraryUiObjectsFromNodes) {
getPluginFileNames('Tutorials', onNamesArrived)
function onNamesArrived(fileNames) {
addPluginFileIfNeeded(node, fileNames, functionLibraryUiObjectsFromNodes)
}
}
}
@@ -19,7 +19,7 @@ function newReferenceAttachDetach() {
}
function completeDetachment(node) {
if (node.payload !== undefined !== undefined) {
if (node.payload !== undefined) {
if (node.payload.referenceParent !== undefined) {
if (node.payload.referenceParent.payload !== undefined) {
if (node.payload.referenceParent.payload.uiObject !== undefined) {
@@ -24,8 +24,7 @@ function newShortcutKeys() {
case 'node': {
if (property.name !== previousPropertyName) {
if (node[property.name] !== undefined) {
let child
child = getNodeByShortcutKey(node[property.name], searchingKey)
let child = getNodeByShortcutKey(node[property.name], searchingKey)
if (child !== undefined) {
return child
}
@@ -38,7 +37,7 @@ function newShortcutKeys() {
let nodePropertyArray = node[property.name]
if (nodePropertyArray !== undefined) {
for (let m = 0; m < nodePropertyArray.length; m++) {
child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey)
let child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey)
if (child !== undefined) {
return child
}
@@ -601,7 +601,7 @@ function newTaskFunctions() {
for (let m = 0; m < rootNodes.length; m++) {
let rootNode = rootNodes[m]
if (rootNode.type === 'Trading Engine' && rootNode.isIncluded === true) {
if (rootNode.type === 'Trading Engine' && rootNode.isPlugin === true) {
let tradingEngine = rootNode
session.tradingEngineReference.payload.referenceParent = tradingEngine
session.tradingSystemReference.payload.referenceParent = tradingSystem
@@ -42,66 +42,66 @@ function newUiObjectsFromNodes() {
}
}
addIncludedNodes()
addPluginNodes()
function addIncludedNodes(includedNames) {
function addPluginNodes(pluginNames) {
let blobService = newFileStorage()
let totalIncluded = 0
let totalPlugin = 0
let totalRead = 0
for (let i = 0; i < node.rootNodes.length; i++) {
let rootNode = node.rootNodes[i]
if (rootNode.type === 'Includes') {
let includes = rootNode
if (includes.includedDataMines !== undefined) {
totalIncluded = totalIncluded + includes.includedDataMines.includedFiles.length
includeAllTheseFiles(includes.includedDataMines.includedFiles, 'Data-Mines')
if (rootNode.type === 'Plugins') {
let plugins = rootNode
if (plugins.pluginDataMines !== undefined) {
totalPlugin = totalPlugin + plugins.pluginDataMines.pluginFiles.length
pluginAllTheseFiles(plugins.pluginDataMines.pluginFiles, 'Data-Mines')
}
if (includes.includedTradingMines !== undefined) {
totalIncluded = totalIncluded + includes.includedTradingMines.includedFiles.length
includeAllTheseFiles(includes.includedTradingMines.includedFiles, 'Trading-Mines')
if (plugins.pluginTradingMines !== undefined) {
totalPlugin = totalPlugin + plugins.pluginTradingMines.pluginFiles.length
pluginAllTheseFiles(plugins.pluginTradingMines.pluginFiles, 'Trading-Mines')
}
if (includes.includedTradingSystems !== undefined) {
totalIncluded = totalIncluded + includes.includedTradingSystems.includedFiles.length
includeAllTheseFiles(includes.includedTradingSystems.includedFiles, 'Trading-Systems')
if (plugins.pluginTradingSystems !== undefined) {
totalPlugin = totalPlugin + plugins.pluginTradingSystems.pluginFiles.length
pluginAllTheseFiles(plugins.pluginTradingSystems.pluginFiles, 'Trading-Systems')
}
if (includes.includedTradingEngines !== undefined) {
totalIncluded = totalIncluded + includes.includedTradingEngines.includedFiles.length
includeAllTheseFiles(includes.includedTradingEngines.includedFiles, 'Trading-Engines')
if (plugins.pluginTradingEngines !== undefined) {
totalPlugin = totalPlugin + plugins.pluginTradingEngines.pluginFiles.length
pluginAllTheseFiles(plugins.pluginTradingEngines.pluginFiles, 'Trading-Engines')
}
if (includes.includedSuperScripts !== undefined) {
totalIncluded = totalIncluded + includes.includedSuperScripts.includedFiles.length
includeAllTheseFiles(includes.includedSuperScripts.includedFiles, 'Super-Scripts')
if (plugins.pluginSuperScripts !== undefined) {
totalPlugin = totalPlugin + plugins.pluginSuperScripts.pluginFiles.length
pluginAllTheseFiles(plugins.pluginSuperScripts.pluginFiles, 'Super-Scripts')
}
if (includes.includedTutorials !== undefined) {
totalIncluded = totalIncluded + includes.includedTutorials.includedFiles.length
includeAllTheseFiles(includes.includedTutorials.includedFiles, 'Tutorials')
if (plugins.pluginTutorials !== undefined) {
totalPlugin = totalPlugin + plugins.pluginTutorials.pluginFiles.length
pluginAllTheseFiles(plugins.pluginTutorials.pluginFiles, 'Tutorials')
}
}
}
/*
If there is no Includes node at the workspace, we load it anyways here.
If there is no Plugins node at the workspace, we load it anyways here.
*/
if (totalIncluded === 0) {
if (totalPlugin === 0) {
addUserDefinedNodes()
}
function includeAllTheseFiles(includedFiles, includedType) {
for (let i = 0; i < includedFiles.length; i++) {
let includedFile = includedFiles[i]
let name = includedFile.name
blobService.getFileFromHost(includedType + '/' + name + '.json', onFileReceived, true)
function pluginAllTheseFiles(pluginFiles, pluginType) {
for (let i = 0; i < pluginFiles.length; i++) {
let pluginFile = pluginFiles[i]
let name = pluginFile.name
blobService.getFileFromHost(pluginType + '/' + name + '.json', onFileReceived, true)
function onFileReceived(err, text, response) {
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
console.log('[WARN] Cannot load included ' + includedType + ' ' + name + '. The workspace will be loaded with this included file missing.')
console.log('[WARN] Cannot load plugin ' + pluginType + ' ' + name + '. The workspace will be loaded with this plugin file missing.')
} else {
let receivedNode = JSON.parse(text)
/*
If the workspace already contains a root node with the id of the head of the hirierchy
we are loading, we remove it because the included file has precedende.
we are loading, we remove it because the plugin file has precedende.
*/
for (let i = 0; i < node.rootNodes.length; i++) {
let rootNode = node.rootNodes[i]
@@ -110,12 +110,12 @@ function newUiObjectsFromNodes() {
break
}
}
receivedNode.isIncluded = true
receivedNode.isPlugin = true
if (includedFile.includedFilePosition !== undefined) {
if (pluginFile.pluginFilePosition !== undefined) {
let positionOffset = {
x: includedFile.includedFilePosition.savedPayload.position.x - receivedNode.savedPayload.position.x,
y: includedFile.includedFilePosition.savedPayload.position.y - receivedNode.savedPayload.position.y
x: pluginFile.pluginFilePosition.savedPayload.position.x - receivedNode.savedPayload.position.x,
y: pluginFile.pluginFilePosition.savedPayload.position.y - receivedNode.savedPayload.position.y
}
receivedNode.positionOffset = positionOffset
}
@@ -124,7 +124,7 @@ function newUiObjectsFromNodes() {
}
totalRead++
if (totalIncluded === totalRead) {
if (totalPlugin === totalRead) {
addUserDefinedNodes()
}
}
@@ -335,6 +335,7 @@ function newUiObjectsFromNodes() {
if (nodeDefinition === undefined) {
console.log('Cannot addUIOBject of ' + type + ' because that type it is not defined at the APP_SCHEMA.')
return
}
if (nodeDefinition.initialValues !== undefined) {
@@ -384,14 +385,12 @@ function newUiObjectsFromNodes() {
}
}
if (nodeDefinition !== undefined) {
if (nodeDefinition.initialValues !== undefined) {
if (nodeDefinition.initialValues.code !== undefined) {
object.code = nodeDefinition.initialValues.code
}
if (nodeDefinition.initialValues.config !== undefined) {
object.config = nodeDefinition.initialValues.config
}
if (nodeDefinition.initialValues !== undefined) {
if (nodeDefinition.initialValues.code !== undefined) {
object.code = nodeDefinition.initialValues.code
}
if (nodeDefinition.initialValues.config !== undefined) {
object.config = nodeDefinition.initialValues.config
}
}
+28 -17
View File
@@ -15,6 +15,7 @@ function newWorkspace() {
save: saveWorkspace,
getHierarchyHeads: getHierarchyHeads,
getHierarchyHeadsById: getHierarchyHeadsById,
getHierarchyHeadsByType: getHierarchyHeadsByType,
getNodeThatIsOnFocus: getNodeThatIsOnFocus,
getNodeByShortcutKey: getNodeByShortcutKey,
getNodeById: getNodeById,
@@ -70,7 +71,7 @@ function newWorkspace() {
let functionLibraryDataStorageFunctions = newDataStorageFunctions()
let functionLibraryChartingSpaceFunctions = newChartingSpaceFunctions()
let functionLibraryTutorialFunctions = newTutorialFunctions()
let functionLibraryIncludesFunctions = newIncludesFunctions()
let functionLibraryPluginsFunctions = newPluginsFunctions()
thisObject.nodeChildren = newNodeChildren()
@@ -316,7 +317,7 @@ function newWorkspace() {
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
let rootNode = thisObject.workspaceNode.rootNodes[i]
if (rootNode.isIncluded !== true) {
if (rootNode.isPlugin !== true) {
let node = functionLibraryProtocolNode.getProtocolNode(rootNode, removePersonalData, false, true, true, true)
stringifyReadyNodes.push(node)
}
@@ -404,12 +405,22 @@ function newWorkspace() {
}
}
function getHierarchyHeadsByType(nodeType) {
let hiriatchyHeads = getHierarchyHeads()
for (let i = 0; i < hiriatchyHeads.length; i++) {
let hiriatchyHead = hiriatchyHeads[i]
if (hiriatchyHead.type === nodeType) {
return hiriatchyHead
}
}
}
function replaceWorkspaceByLoadingOne(name) {
let webCommand
if (name.indexOf('Included -> ') >= 0) {
name = name.replace('Included -> ', '')
webCommand = 'LoadIncludedWorkspace'
if (name.indexOf('Plugin -> ') >= 0) {
name = name.replace('Plugin -> ', '')
webCommand = 'LoadPluginWorkspace'
} else {
webCommand = 'LoadWorkspace'
}
@@ -891,34 +902,34 @@ function newWorkspace() {
}
}
break
case 'Include Missing Data Mines':
case 'Add Missing Data Mines':
{
functionLibraryIncludesFunctions.includeMissingDataMines(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
functionLibraryPluginsFunctions.pluginMissingDataMines(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
}
break
case 'Include Missing Trading Mines':
case 'Add Missing Trading Mines':
{
functionLibraryIncludesFunctions.includeMissingTradingMines(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
functionLibraryPluginsFunctions.pluginMissingTradingMines(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
}
break
case 'Include Missing Trading Systems':
case 'Add Missing Trading Systems':
{
functionLibraryIncludesFunctions.includeMissingTradingSystems(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
functionLibraryPluginsFunctions.pluginMissingTradingSystems(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
}
break
case 'Include Missing Trading Engines':
case 'Add Missing Trading Engines':
{
functionLibraryIncludesFunctions.includeMissingTradingEngines(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
functionLibraryPluginsFunctions.pluginMissingTradingEngines(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
}
break
case 'Include Missing Super Scripts':
case 'Add Missing Super Scripts':
{
functionLibraryIncludesFunctions.includeMissingSuperScripts(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
functionLibraryPluginsFunctions.pluginMissingSuperScripts(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
}
break
case 'Include Missing Tutorials':
case 'Add Missing Tutorials':
{
functionLibraryIncludesFunctions.includeMissingTutorials(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
functionLibraryPluginsFunctions.pluginMissingTutorials(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
}
break
}
+1 -1
View File
@@ -189,7 +189,7 @@ function newCircularMenu() {
function onFocus() {
for (let i = 0; i < menuItems.length; i++) {
let menuItem = menuItems[i]
menuItem.targetRadius = menuItem.rawRadius * 1.5
menuItem.targetRadius = Math.trunc(menuItem.rawRadius * 1.5)
menuItem.isDeployed = true
}
thisObject.isDeployed = true
+34 -18
View File
@@ -59,7 +59,7 @@ function newCircularMenuItem() {
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.container.frame.width = 0
thisObject.container.frame.height = 40
thisObject.container.frame.height = 0
let isMouseOver = false
@@ -73,8 +73,6 @@ function newCircularMenuItem() {
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
@@ -113,11 +111,7 @@ function newCircularMenuItem() {
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
}
containerPhysics()
thisObject.nextAction = thisObject.action
}
@@ -155,7 +149,15 @@ function newCircularMenuItem() {
function physics() {
if (thisObject.dontShowAtFullscreen === true && AT_FULL_SCREEN_MODE === true) { return }
positionPhysics()
temporaryStatusPhysics()
disablePhysics()
iconPhysics()
backgroundColorPhysics()
containerPhysics()
}
function positionPhysics() {
let INCREASE_STEP = 2
if (Math.abs(thisObject.currentRadius - thisObject.targetRadius) >= INCREASE_STEP) {
@@ -189,6 +191,7 @@ function newCircularMenuItem() {
} else {
radiusGrowthFactor = 3.2
}
radiusGrowthFactor = radiusGrowthFactor * canvas.floatingSpace.settings.node.menuItem.radiusPercentage / 100
thisObject.container.frame.position.x =
thisObject.payload.floatingObject.targetRadius *
@@ -199,11 +202,11 @@ function newCircularMenuItem() {
thisObject.container.frame.position.y =
thisObject.payload.floatingObject.targetRadius *
radiusGrowthFactor / 7
* Math.sin(toRadians(thisObject.angle)) -
thisObject.container.frame.height / 2
temporaryStatusPhysics()
* Math.sin(toRadians(thisObject.angle))
- thisObject.container.frame.height / 2
}
function disablePhysics() {
/* 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) {
@@ -214,7 +217,20 @@ function newCircularMenuItem() {
thisObject.isEnabled = false
}
}
iconPhysics()
}
function containerPhysics() {
if (thisObject.type === 'Icon & Text') {
thisObject.container.frame.width = 220 * canvas.floatingSpace.settings.node.menuItem.widthPercentage / 100
} else {
thisObject.container.frame.width = 50 * canvas.floatingSpace.settings.node.menuItem.widthPercentage / 100
}
thisObject.container.frame.height = 40 * canvas.floatingSpace.settings.node.menuItem.heightPercentage / 100
}
function backgroundColorPhysics() {
defaultBackgroudColor = canvas.floatingSpace.style.node.menuItem.backgroundColor
}
function iconPhysics() {
@@ -408,7 +424,7 @@ function newCircularMenuItem() {
cornerRadius: 5,
lineWidth: 0.1,
container: thisObject.container,
borderColor: UI_COLOR.DARK,
borderColor: backgroundColor,
backgroundColor: backgroundColor,
castShadow: false,
xOffset: 60
@@ -438,9 +454,9 @@ function newCircularMenuItem() {
/* Menu Item */
let iconSize
if (isMouseOver === true) {
iconSize = thisObject.currentRadius + EXTRA_MOUSE_OVER_ICON_SIZE
iconSize = canvas.floatingSpace.style.node.menuItem.imageSize * 150 / 100
} else {
iconSize = thisObject.currentRadius
iconSize = canvas.floatingSpace.style.node.menuItem.imageSize
}
if (thisObject.icon === undefined) { return }
@@ -455,7 +471,7 @@ function newCircularMenuItem() {
}
let labelPoint
let fontSize = 15
let fontSize = canvas.floatingSpace.style.node.menuItem.fontSize
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
@@ -466,7 +482,7 @@ function newCircularMenuItem() {
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
browserCanvasContext.fillStyle = 'rgba(' + canvas.floatingSpace.style.node.menuItem.fontColor + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
}
+1 -1
View File
@@ -185,7 +185,7 @@ function newCodeEditor() {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
if (thisObject.currentRadius >= thisObject.targetRadius) {
labelPoint = {
x: iconPosition.x + thisObject.currentRadius + 10,
y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+1 -1
View File
@@ -190,7 +190,7 @@ function newConfigEditor() {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
if (thisObject.currentRadius >= thisObject.targetRadius) {
labelPoint = {
x: iconPosition.x + thisObject.currentRadius + 10,
y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+11 -3
View File
@@ -274,7 +274,8 @@ function newFloatingLayer() {
makeVisible()
makeInvisible()
visiblePhysics()
applyPhysics()
enginePhysics()
proximityPhysics()
function visiblePhysics() {
for (let i = 0; i < visibleFloatingObjects.length; i++) {
@@ -283,13 +284,21 @@ function newFloatingLayer() {
}
}
function applyPhysics() {
function proximityPhysics(){
for (let i = 0; i < visibleFloatingObjects.length; i++) {
proximityBetweenFloatingObjects(i)
}
}
function enginePhysics() {
/* 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
if (canvas.floatingSpace.settings.physics !== true) {return}
for (let i = 0; i < visibleFloatingObjects.length; i++) {
let floatingObject = visibleFloatingObjects[i]
if (floatingObject.isFrozen === true) { continue }
@@ -376,7 +385,6 @@ function newFloatingLayer() {
gravityForce(floatingObject, payload)
proximityBetweenFloatingObjects(i)
}
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] physics -> applyPhysics -> err= ' + err.stack) }
+25 -31
View File
@@ -29,6 +29,8 @@ function newFloatingObject() {
isParentCollapsed: false,
frozenManually: false,
collapsedManually: false,
typeStrokeStyle: undefined,
nameStrokeStyle: undefined,
forceFocus: forceFocus,
removeForceFocus: removeForceFocus,
setFocus: setFocus,
@@ -54,7 +56,6 @@ function newFloatingObject() {
initializeRadius: initializeRadius,
initializeImageSize: initializeImageSize,
initializeFontSize: initializeFontSize,
initializeHierarchyRing: initializeHierarchyRing,
initializeCurrentPosition: initializeCurrentPosition,
radomizeCurrentSpeed: radomizeCurrentSpeed,
drawBackground: drawBackground,
@@ -76,6 +77,8 @@ function newFloatingObject() {
thisObject.container.frame.radius = 0
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.typeStrokeStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
thisObject.nameStrokeStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
let selfMouseOverEventSubscriptionId
let selfMouseClickEventSubscriptionId
@@ -83,7 +86,7 @@ function newFloatingObject() {
let spaceFocusAquiredEventSubscriptionId
let lastParentAngle
let forcedFocusCounter = 0
return thisObject
function finalize() {
@@ -297,6 +300,20 @@ function newFloatingObject() {
}
positionContraintsPhysics()
focusPhysics()
syncStylePhysics()
}
function syncStylePhysics() {
if (thisObject.rawFontSize !== canvas.floatingSpace.style.node.fontSize) {
thisObject.rawFontSize = canvas.floatingSpace.style.node.fontSize
thisObject.targetFontSize = thisObject.rawFontSize * 1
}
if (thisObject.rawImageSize !== canvas.floatingSpace.style.node.imageSize) {
thisObject.rawImageSize = canvas.floatingSpace.style.node.imageSize
thisObject.targetImageSize = thisObject.rawImageSize * 1
}
thisObject.typeStrokeStyle = 'rgba(' + canvas.floatingSpace.style.node.type.fontColor + ', 1)'
thisObject.nameStrokeStyle = 'rgba(' + canvas.floatingSpace.style.node.name.fontColor + ', 1)'
}
function focusPhysics() {
@@ -322,7 +339,7 @@ function newFloatingObject() {
function positionContraintsPhysics() {
const MAX_DISTANCE_TO_PARENT = 5000
const MIN_DISTANCE_TO_PARENT = 100
const DEFAULT_NODE_TO_NODE_DISTANCE = 500
const DEFAULT_NODE_TO_NODE_DISTANCE = 500 * canvas.floatingSpace.settings.node.distancePercentage / 100
if (thisObject.angleToParent !== ANGLE_TO_PARENT.NOT_FIXED && thisObject.isOnFocus !== true) {
let parent = thisObject.payload.chainParent
@@ -549,23 +566,11 @@ function newFloatingObject() {
thisObject.currentFontSize = thisObject.targetFontSize
}
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
}
} else {
thisObject.currentHierarchyRing = thisObject.targetHierarchyRing
}
/* Floating object position in screen coordinates */
thisObject.payload.position.x = thisObject.container.frame.position.x
thisObject.payload.position.y = thisObject.container.frame.position.y
}
function onMouseOver(point) {
if (thisObject.isOnFocus === false) {
setFocus(point)
@@ -599,10 +604,10 @@ function newFloatingObject() {
}
function setFocus(point) {
thisObject.targetRadius = thisObject.rawRadius * 6.0
thisObject.targetRadius = thisObject.rawRadius * 6.0 * canvas.floatingSpace.settings.node.radiusPercentage / 100
thisObject.currentMass = thisObject.rawMass * canvas.floatingSpace.settings.node.massPercentage / 100
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)
@@ -618,10 +623,10 @@ function newFloatingObject() {
}
if (thisObject.payload === undefined) { return }
if (thisObject.isOnFocus === true) {
thisObject.targetRadius = thisObject.rawRadius * 1
thisObject.targetRadius = thisObject.rawRadius * 1 * canvas.floatingSpace.settings.node.radiusPercentage / 100
thisObject.currentMass = thisObject.rawMass * canvas.floatingSpace.settings.node.massPercentage / 100
thisObject.targetImageSize = thisObject.rawImageSize * 1
thisObject.targetFontSize = thisObject.rawFontSize * 1
thisObject.targetHierarchyRing = thisObject.rawHierarchyRing * 1
thisObject.payload.uiObject.container.eventHandler.raiseEvent('onNotFocus', thisObject.container)
@@ -703,7 +708,7 @@ function newFloatingObject() {
}
thisObject.rawRadius = radius
thisObject.targetRadius = radius
thisObject.targetRadius = radius * canvas.floatingSpace.settings.node.radiusPercentage / 100
thisObject.container.frame.radius = radius
thisObject.container.eventHandler.raiseEvent('Dimmensions Changed', event)
@@ -731,17 +736,6 @@ function newFloatingObject() {
thisObject.currentFontSize = size / 3
}
function initializeHierarchyRing(suggestedValue) {
let radius = suggestedValue
if (radius < 3) {
radius = 3
}
thisObject.rawHierarchyRing = radius
thisObject.targetHierarchyRing = radius
thisObject.currentHierarchyRing = radius
}
function initializeCurrentPosition(arroundPoint) {
let position = {}
+1 -1
View File
@@ -184,7 +184,7 @@ function newFormulaEditor() {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
if (thisObject.currentRadius >= thisObject.targetRadius) {
labelPoint = {
x: iconPosition.x + thisObject.currentRadius + 10,
y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
-4
View File
@@ -71,10 +71,6 @@ function newPicker() {
isMouseOver = false
}
function getSelected() {
return optionsList[selected]
}
function setSelected(pOptionsList, pCurrent, pParent, pSelected) {
if (pOptionsList !== undefined) {
optionsList = pOptionsList
+97 -57
View File
@@ -564,7 +564,6 @@ function newUiObject() {
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))
@@ -581,10 +580,8 @@ function newUiObject() {
let THRESHOLD = 1.15
if (previousDistanceToChainParent !== undefined) {
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node)
}
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node)
}
}
@@ -676,9 +673,10 @@ function newUiObject() {
function referenceDetachingPhysics() {
if (isDragging !== true) { return }
if (thisObject.payload === undefined) { return }
if (thisObject.payload.floatingObject.isFrozen === true) { return }
if (rightDragging === false) { return }
if (thisObject.payload === undefined) { return }
if (thisObject.payload.referenceParent === undefined) { return }
let distanceToReferenceParent = Math.sqrt(Math.pow(thisObject.payload.position.x - thisObject.payload.referenceParent.payload.position.x, 2) + Math.pow(thisObject.payload.position.y - thisObject.payload.referenceParent.payload.position.y, 2))
@@ -690,14 +688,11 @@ function newUiObject() {
previousDistanceToReferenceParent = distanceToReferenceParent
if (thisObject.isOnFocus !== true) { return }
if (thisObject.payload.referenceParent === undefined) { return }
let THRESHOLD = 1.15
if (previousDistanceToReferenceParent !== undefined) {
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.referenceDetachNode(thisObject.payload.node)
}
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.referenceDetachNode(thisObject.payload.node)
}
}
@@ -1522,6 +1517,7 @@ function newUiObject() {
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
if (radius > 6) {
@@ -1531,17 +1527,8 @@ function newUiObject() {
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 * 2 / 3 + 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) {
@@ -1550,8 +1537,28 @@ function newUiObject() {
}
}
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + radius * 2 / 3 + lineSeparator * 1 + 15
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 1
}
}
if (canvas.floatingSpace.inMapMode === true) {
labelPoint.y = position.y + 50 / 2 + lineSeparator * 1
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.nameStrokeStyle
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
}
@@ -1593,10 +1600,11 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius * 2.5
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize * 3 / 4
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
if (radius > 6) {
@@ -1612,9 +1620,16 @@ function newUiObject() {
fontSize = thisObject.payload.floatingObject.currentFontSize * 2 / 4
}
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + radius * 2 / 5 + fontSize * FONT_ASPECT_RATIO + 10
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + radius * 2 / 3 + lineSeparator * 5 + 15
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 5
}
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
@@ -1646,10 +1661,11 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius * 1.00
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize * 8 / 7
let fontSize = thisObject.payload.floatingObject.currentFontSize
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
if (radius > 6) {
@@ -1679,9 +1695,16 @@ function newUiObject() {
labelPoint.x = labelPoint.x + radius * 7 / 3 * Math.cos(toRadians(thisObject.payload.angle))
labelPoint.y = labelPoint.y + radius * 7 / 3 * Math.sin(toRadians(thisObject.payload.angle))
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + radius * 2 / 3 + lineSeparator * 3 + 15
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 3
}
}
}
@@ -1709,10 +1732,11 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius * 1.30
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4
let fontSize = thisObject.payload.floatingObject.currentFontSize
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
if (radius > 6) {
@@ -1720,20 +1744,26 @@ function newUiObject() {
label = Number(currentPercentage).toFixed(0) + '%'
if (label !== undefined) {
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
y: position.y + radius * 2 / 3 + lineSeparator * 4 + 15
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 4
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
}
@@ -1752,10 +1782,11 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius * 0.8
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4 / 2
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
if (radius > 6) {
@@ -1768,9 +1799,16 @@ function newUiObject() {
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
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + radius * 2 / 3 + lineSeparator * 2 + 15
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 2
}
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
@@ -1890,7 +1928,7 @@ function newUiObject() {
browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS - 2, 0, Math.PI * 2, true)
browserCanvasContext.closePath()
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 1)'
browserCanvasContext.fillStyle = 'rgba(' + canvas.floatingSpace.style.backgroundColor + ', 1)'
browserCanvasContext.fill()
@@ -1906,7 +1944,7 @@ function newUiObject() {
browserCanvasContext.beginPath()
browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
browserCanvasContext.closePath()
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 0.70)'
browserCanvasContext.fillStyle = 'rgba(' + canvas.floatingSpace.style.backgroundColor + ', 0.70)'
browserCanvasContext.fill()
/* Border when node is in focus */
if (
@@ -1937,7 +1975,7 @@ function newUiObject() {
/* Hierarchy Head Ring */
if (nodeDefinition.isHierarchyHead === true) {
VISIBLE_RADIUS = thisObject.payload.floatingObject.currentHierarchyRing * 2.6
VISIBLE_RADIUS = thisObject.payload.floatingObject.container.frame.radius
if (canvas.floatingSpace.inMapMode === true) {
VISIBLE_RADIUS = canvas.floatingSpace.transformRadiusToMap(VISIBLE_RADIUS)
}
@@ -1956,7 +1994,7 @@ function newUiObject() {
browserCanvasContext.closePath()
browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.LIGHT_GREY + ', ' + OPACITY + ')'
browserCanvasContext.lineWidth = 1
if (thisObject.payload.node.isIncluded === true) {
if (thisObject.payload.node.isPlugin === true) {
browserCanvasContext.setLineDash([0, 0])
} else {
browserCanvasContext.setLineDash([10, 20])
@@ -2135,15 +2173,17 @@ function newUiObject() {
let additionalImageSize = 0
if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 }
let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
if (nodeDefinition === undefined) { return }
if (canvas.floatingSpace.inMapMode === true) {
totalImageSize = canvas.floatingSpace.transformImagesizeToMap(totalImageSize)
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
if (nodeDefinition !== undefined) {
if (nodeDefinition.isHierarchyHead !== true) {
totalImageSize = totalImageSize / 4
}
if (nodeDefinition.isHierarchyHead === true) {
totalImageSize = 50
} else {
totalImageSize = canvas.floatingSpace.transformImagesizeToMap(totalImageSize)
}
}
}
if (thisObject.isShowing === true) {
totalImageSize = 50
@@ -490,7 +490,6 @@ function newUiObjectConstructor() {
const INITIAL_FONT_SIZE = 12 * 1.5
const INITIAL_RADIOUS = 70
const INITIAL_IMAGE_SIZE = 80 * 1.2
const INITIAL_HIERARCHY_RING = 20
switch (payload.node.type) {
case 'Workspace': {
@@ -538,7 +537,6 @@ function newUiObjectConstructor() {
floatingObject.initializeMass(500)
floatingObject.initializeRadius(INITIAL_RADIOUS)
floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE)
floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
@@ -550,7 +548,6 @@ function newUiObjectConstructor() {
floatingObject.initializeMass(600)
floatingObject.initializeRadius(INITIAL_RADIOUS)
floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE)
floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
@@ -566,7 +563,6 @@ function newUiObjectConstructor() {
floatingObject.initializeMass(300)
floatingObject.initializeRadius(INITIAL_RADIOUS - 2)
floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 10)
floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
@@ -582,7 +578,6 @@ function newUiObjectConstructor() {
floatingObject.initializeMass(150)
floatingObject.initializeRadius(INITIAL_RADIOUS - 4)
floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 20)
floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
@@ -598,7 +593,6 @@ function newUiObjectConstructor() {
floatingObject.initializeMass(75)
floatingObject.initializeRadius(INITIAL_RADIOUS - 6)
floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 30)
floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
@@ -614,7 +608,6 @@ function newUiObjectConstructor() {
floatingObject.initializeMass(50)
floatingObject.initializeRadius(INITIAL_RADIOUS - 8)
floatingObject.initializeHierarchyRing(INITIAL_HIERARCHY_RING)
floatingObject.initializeImageSize(INITIAL_IMAGE_SIZE - 40)
floatingObject.initializeFontSize(INITIAL_FONT_SIZE)
@@ -626,14 +619,11 @@ function newUiObjectConstructor() {
floatingObject.initializeMass(25)
floatingObject.initializeRadius(INITIAL_RADIOUS - 10)
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)'
}
function destroyUiObject(payload) {
+12 -20
View File
@@ -168,20 +168,6 @@ function newUiObjectTitle() {
}
break
}
case 'Use Reference Parent Parent Parent': {
let nodeToUse = thisObject.payload.node.payload.referenceParent
if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode
if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode.payload.parentNode
if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
thisObject.payload.title = thisObject.payload.title + separator + nodeToUse.payload.title
thisObject.payload.node.name = thisObject.payload.node.name + separator + nodeToUse.payload.node.name
}
}
}
break
}
default: {
if (titleReference.indexOf('Use Child @') === 0) {
let propertyName = titleReference.substring(titleReference.indexOf('@') + 1, titleReference.length)
@@ -207,8 +193,14 @@ function newUiObjectTitle() {
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
if (thisObject.isOnFocus === true) {
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
} else {
thisObject.container.frame.position.x = 0 - FRAME_WIDTH / 2
thisObject.container.frame.position.y = 0 - thisObject.payload.floatingObject.currentImageSize / 2 - FRAME_HEIGHT
}
thisObject.container.frame.width = FRAME_WIDTH
thisObject.container.frame.height = FRAME_HEIGHT
@@ -307,8 +299,8 @@ function newUiObjectTitle() {
cornerRadius: 3,
lineWidth: 0.1,
container: thisObject.container,
borderColor: UI_COLOR.BLACK,
backgroundColor: UI_COLOR.BLACK,
borderColor: canvas.floatingSpace.style.backgroundColor,
backgroundColor: canvas.floatingSpace.style.backgroundColor,
castShadow: false,
opacity: 0.25
}
@@ -325,7 +317,7 @@ function newUiObjectTitle() {
let label
if (radius > 6 && (thisObject.isOnFocus === true || thisObject.allwaysVisible === true || thisObject.isDefault === false)) {
browserCanvasContext.strokeStyle = thisObject.payload.floatingObject.labelStrokeStyle
browserCanvasContext.strokeStyle = thisObject.payload.floatingObject.typeStrokeStyle
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
@@ -355,7 +347,7 @@ function newUiObjectTitle() {
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.typeStrokeStyle
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
}
+2 -1
View File
@@ -296,9 +296,10 @@ function newLayer() {
function getIcon(node) {
let nodeDefinition = getNodeDefinition(node)
let iconName
let icon
if (nodeDefinition.alternativeIcons !== undefined) {
for (let i = 0; i < nodeDefinition.alternativeIcons.length; i++) {
alternativeIcon = nodeDefinition.alternativeIcons[i]
let alternativeIcon = nodeDefinition.alternativeIcons[i]
if (alternativeIcon.codeName === node.config.codeName) {
iconName = alternativeIcon.iconName
}
+1 -1
View File
@@ -381,7 +381,7 @@ function newLayersPanel() {
let found = removeFromLocalLayers(layerNode.id)
if (found !== true) {
layer = addLayer(layerNode)
let layer = addLayer(layerNode)
if (layer !== undefined) {
onLayerStatusChanged(layer)
}
+1 -1
View File
@@ -60,7 +60,7 @@ function newPanelsVisibleButton() {
function setPanelVisibility() {
for (let i = 0; i < thisObject.panels.length; i++) {
panel = canvas.panelsSpace.getPanel(thisObject.panels[i])
let panel = canvas.panelsSpace.getPanel(thisObject.panels[i])
panel.isVisible = thisObject.showPanels
}
}
+1 -1
View File
@@ -891,7 +891,7 @@ function newPlotter() {
}
}
if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMinYScale === true) {
if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMaxYScale === true) {
mustRecalculateDataPoints = true
} else {
mustRecalculateDataPoints = false
-1
View File
@@ -115,7 +115,6 @@ function newRecordValues() {
function applyValue(node, value, minDecimals) {
if (canvas.chartingSpace.visible !== true) { return }
if (node === undefined) { return }
if (node === undefined) { return }
if (node.payload === undefined) { return }
if (node.payload.uiObject === undefined) { return }
if (value === true) { value = 'true' }
+5
View File
@@ -176,6 +176,11 @@ function newRateScale() {
return
}
} else {
if (event.shiftKey === true) {
sensitivity = 20
} else {
sensitivity = 5
}
if (wheelDeltaDirection === 1) {
wheelDeltaCounter++
if (wheelDeltaCounter < sensitivity) {
+5
View File
@@ -261,6 +261,11 @@ function newTimeFrameScale() {
return
}
} else {
if (event.shiftKey === true) {
sensitivity = 20
} else {
sensitivity = 5
}
if (wheelDeltaDirection === 1) {
wheelDeltaCounter++
if (wheelDeltaCounter < sensitivity) {
+5
View File
@@ -127,6 +127,11 @@ function newTimeScale() {
return
}
} else {
if (event.shiftKey === true) {
sensitivity = 20
} else {
sensitivity = 5
}
if (wheelDeltaDirection === 1) {
wheelDeltaCounter++
if (wheelDeltaCounter < sensitivity) {
-2
View File
@@ -182,8 +182,6 @@ function newListView() {
function physics() {
if (isInitialized === false || thisObject.isVisible === false) { return }
if (isInitialized === false) { return }
if (thisObject.isVisible === false) { return }
childrenPhysics()
}
+136 -1
View File
@@ -14,6 +14,8 @@ function newFloatingSpace() {
inMapMode: false,
drawReferenceLines: false,
drawChainLines: true,
style: undefined,
settings: undefined,
toggleDrawChainLines: toggleDrawChainLines,
toggleDrawReferenceLines: toggleDrawReferenceLines,
toggleMapMode: toggleMapMode,
@@ -63,6 +65,42 @@ function newFloatingSpace() {
let onDragStartedEventSubscriptionId
let spaceFocusAquiredEventSubscriptionId
/* Default Style */
thisObject.style = {
backgroundColor: UI_COLOR.BLACK,
node: {
imageSize: 96,
fontSize: 18,
type: {
fontColor: UI_COLOR.WHITE
},
name: {
fontColor: UI_COLOR.WHITE
},
menuItem: {
backgroundColor: UI_COLOR.BLACK,
fontColor: UI_COLOR.WHITE,
fontSize: 15,
imageSize: 50
}
}
}
/* Default Settings */
thisObject.settings = {
node: {
distancePercentage: 100,
radiusPercentage: 100,
massPercentage: 100,
menuItem: {
widthPercentage: 100,
heightPercentage: 100,
radiusPercentage: 100
}
},
physics: true
}
return thisObject
function finalize() {
@@ -385,11 +423,108 @@ function newFloatingSpace() {
function physics() {
if (visible === false) { return }
syncStylePhysics()
syncSettingsPhysics()
browserZoomPhysics()
positionContraintsPhysics()
thisObject.floatingLayer.physics()
}
function syncStylePhysics() {
if (canvas.designSpace === undefined) { return }
if (canvas.designSpace.workspace === undefined) { return }
let designSpaceNode = canvas.designSpace.workspace.getHierarchyHeadsByType('Design Space')
if (designSpaceNode === undefined) { return }
if (designSpaceNode.spaceStyle === undefined) { return }
let configStyle
try {
configStyle = JSON.parse(designSpaceNode.spaceStyle.config)
} catch (err) {
if (thisObject.payload !== undefined) {
thisObject.payload.uiObject.setErrorMessage(err.message)
}
return
}
if (configStyle.backgroundColor !== undefined) {
thisObject.style.backgroundColor = eval(configStyle.backgroundColor)
}
if (configStyle.node !== undefined) {
if (configStyle.node.fontSize !== undefined) {
thisObject.style.node.fontSize = configStyle.node.fontSize
}
if (configStyle.node.imageSize !== undefined) {
thisObject.style.node.imageSize = configStyle.node.imageSize
}
if (configStyle.node.name !== undefined) {
if (configStyle.node.name.fontColor !== undefined) {
thisObject.style.node.name.fontColor = eval(configStyle.node.name.fontColor)
}
}
if (configStyle.node.type !== undefined) {
if (configStyle.node.type.fontColor !== undefined) {
thisObject.style.node.type.fontColor = eval(configStyle.node.type.fontColor)
}
}
if (configStyle.node.menuItem !== undefined) {
if (configStyle.node.menuItem.fontColor !== undefined) {
thisObject.style.node.menuItem.fontColor = eval(configStyle.node.menuItem.fontColor)
}
if (configStyle.node.menuItem.backgroundColor !== undefined) {
thisObject.style.node.menuItem.backgroundColor = eval(configStyle.node.menuItem.backgroundColor)
}
if (configStyle.node.menuItem.fontSize !== undefined) {
thisObject.style.node.menuItem.fontSize = configStyle.node.menuItem.fontSize
}
if (configStyle.node.menuItem.imageSize !== undefined) {
thisObject.style.node.menuItem.imageSize = configStyle.node.menuItem.imageSize
}
}
}
}
function syncSettingsPhysics() {
if (canvas.designSpace === undefined) { return }
if (canvas.designSpace.workspace === undefined) { return }
let designSpaceNode = canvas.designSpace.workspace.getHierarchyHeadsByType('Design Space')
if (designSpaceNode === undefined) { return }
if (designSpaceNode.spaceSettings === undefined) { return }
let configSettings
try {
configSettings = JSON.parse(designSpaceNode.spaceSettings.config)
} catch (err) {
if (thisObject.payload !== undefined) {
thisObject.payload.uiObject.setErrorMessage(err.message)
}
return
}
if (configSettings.node !== undefined) {
if (configSettings.node.distancePercentage !== undefined) {
thisObject.settings.node.distancePercentage = configSettings.node.distancePercentage
}
if (configSettings.node.radiusPercentage !== undefined) {
thisObject.settings.node.radiusPercentage = configSettings.node.radiusPercentage
}
if (configSettings.node.massPercentage !== undefined) {
thisObject.settings.node.massPercentage = configSettings.node.massPercentage
}
if (configSettings.node.menuItem !== undefined) {
if (configSettings.node.menuItem.widthPercentage !== undefined) {
thisObject.settings.node.menuItem.widthPercentage = configSettings.node.menuItem.widthPercentage
}
if (configSettings.node.menuItem.heightPercentage !== undefined) {
thisObject.settings.node.menuItem.heightPercentage = configSettings.node.menuItem.heightPercentage
}
if (configSettings.node.menuItem.radiusPercentage !== undefined) {
thisObject.settings.node.menuItem.radiusPercentage = configSettings.node.menuItem.radiusPercentage
}
}
}
if (configSettings.physics !== undefined) {
thisObject.settings.physics = configSettings.physics
}
}
function positionContraintsPhysics() {
if (thisObject.container.frame.position.x > 0) {
thisObject.container.frame.position.x = 0
@@ -425,7 +560,7 @@ function newFloatingSpace() {
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.fillStyle = 'rgba(' + thisObject.style.backgroundColor + ', 1)'
browserCanvasContext.closePath()
browserCanvasContext.fill()
+22 -28
View File
@@ -191,14 +191,6 @@ function newTutorialSpace() {
}
}
function checkViewportZoomAtCenter() {
if (currentNode === undefined) { return }
let config = JSON.parse(currentNode.config)
if (config.viewportZoomAtCenter !== undefined) {
canvas.chartingSpace.viewport.zoomAtCenter(config.viewportZoomAtCenter)
}
}
function checkPressButton() {
if (currentNode === undefined) { return }
let config = JSON.parse(currentNode.config)
@@ -965,35 +957,37 @@ function newTutorialSpace() {
function findNextNode(node) {
for (let i = 0; i < node.tutorialSteps.length; i++) {
if (node.tutorialSteps !== undefined) {
for (let i = 0; i < node.tutorialSteps.length; i++) {
let tutorialStep = node.tutorialSteps[i]
if (found === true) {
if (resumeModeActivated !== true) {
currentNode = tutorialStep
currentStatus = 'Playing Step'
advanced = true
navigationStack.push(currentNode)
findTutorialNode(currentNode)
return
} else {
let tutorial = {
status: undefined
}
loadTutorial(tutorialStep.payload, tutorial)
if (tutorial.status !== 'Done') {
let tutorialStep = node.tutorialSteps[i]
if (found === true) {
if (resumeModeActivated !== true) {
currentNode = tutorialStep
currentStatus = 'Playing Step'
advanced = true
navigationStack.push(currentNode)
findTutorialNode(currentNode)
return
} else {
let tutorial = {
status: undefined
}
loadTutorial(tutorialStep.payload, tutorial)
if (tutorial.status !== 'Done') {
currentNode = tutorialStep
currentStatus = 'Playing Step'
advanced = true
navigationStack.push(currentNode)
findTutorialNode(currentNode)
return
}
}
}
}
if (tutorialStep.id === currentNode.id) {
found = true
}
if (tutorialStep.id === currentNode.id) {
found = true
}
}
}
for (let i = 0; i < node.tutorialTopics.length; i++) {
+1 -1
View File
@@ -63,7 +63,7 @@ function newVideoRecorder() {
let key = canvas.mouse.event.key
if (key === undefined) { break }
switch (key.toLowerCase()) {
case 'Escape':
case 'escape':
{
pointerIcon = canvas.designSpace.iconCollection.get('key-m')
break
+2 -2
View File
@@ -150,7 +150,7 @@ function newDailyFiles() {
function createFileCursors() {
try {
/* Now we will get the daily files */
for (i = 0; i < dailyFilePeriods.length; i++) {
for (let i = 0; i < dailyFilePeriods.length; i++) {
let periodTime = dailyFilePeriods[i][0]
let periodName = dailyFilePeriods[i][1]
@@ -198,7 +198,7 @@ function newDailyFiles() {
function loadThemAll() {
try {
for (i = 0; i < dailyFilePeriods.length; i++) {
for (let i = 0; i < dailyFilePeriods.length; i++) {
let periodTime = dailyFilePeriods[i][0]
let periodName = dailyFilePeriods[i][1]
+1 -1
View File
@@ -139,7 +139,7 @@ function newFileCloud () {
let data
if (err && err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
if (err.code === 'BlobNotFound' | err.code === 'FileNotFound' | err.code === 'ParentNotFound' | err.code === 'The specified key does not exist.') {
if (err.code === 'BlobNotFound' || err.code === 'FileNotFound' || err.code === 'ParentNotFound' || err.code === 'The specified key does not exist.') {
let customErr = {
result: GLOBAL.CUSTOM_FAIL_RESPONSE.result,
message: 'File does not exist.'
-1
View File
@@ -1 +0,0 @@
{"type":"Data Mine","name":"Masters","config":"{\n\"codeName\": \"Masters\"\n}","sensorBots":[{"type":"Sensor Bot","name":"Exchange Raw Data","config":"{\n\"codeName\": \"Exchange-Raw-Data\",\n\"repo\": \"Exchange-Raw-Data-Sensor-Bot\"\n}","processes":[{"type":"Process Definition","name":"Historic-OHLCVs","config":"{\n \"codeName\": \"Historic-OHLCVs\",\n \"description\": \"Retrieves and saves historical maket data\",\n \"startMode\": {\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"outputDatasetFolders":[],"id":"dfe2556e-a765-4e38-9d30-7f91090c0069","savedPayload":{"position":{"x":19694.65896528582,"y":18079.80666168302},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"ea39c98b-18e2-44ce-9f7f-86a8a76a688a","savedPayload":{"position":{"x":20111.534021268813,"y":17814.56375630177},"targetPosition":{"x":19893.316491438505,"y":18150.31980838774},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e"}}}],"dataDependencies":[],"dataMineDataDependencies":[],"id":"5c7fae5a-6da6-4864-a167-f2f21d578c72","savedPayload":{"position":{"x":19893.316491438505,"y":18150.31980838774},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e","savedPayload":{"position":{"x":20031.71582860312,"y":18304.406526432995},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"","id":"957e7e3a-b167-40be-93b5-9ba4ceff56e5","savedPayload":{"position":{"x":20075.30856507894,"y":18506.680081128765},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"fe40a546-43ee-49df-908a-7e72f598f0cd","savedPayload":{"position":{"x":20019.51506449239,"y":18694.64493952324},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc","savedPayload":{"position":{"x":19674.617425695335,"y":18486.33639924593},"targetPosition":{"x":19278.707614323983,"y":18688.55263969416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"products":[{"type":"Product Definition","name":"Trades","config":"{\n\"codeName\": \"Trades\"\n}","datasets":[{"type":"Dataset Definition","name":"Trades","config":"{\n\"codeName\": \"Trades\"\n}","id":"fbb7c17e-a909-4fa2-b3c5-eb8ca86297c4","savedPayload":{"position":{"x":19939.732540593195,"y":18584.456194349146},"targetPosition":{"x":19741.31504137297,"y":18616.06022300575},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"id":"38dbb942-a15b-450b-a867-02a94030965f","savedPayload":{"position":{"x":19741.31504137297,"y":18616.06022300575},"targetPosition":{"x":19278.707614323983,"y":18688.55263969416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Product Definition","name":"Candles","config":"{\n\"codeName\": \"Candles\"\n}","datasets":[{"type":"Dataset Definition","name":"One-Min","config":"{\n\"codeName\": \"One-Min\"\n}","id":"1c3696e4-c28e-4744-9100-706d6dce0c3c","savedPayload":{"position":{"x":19935.702085675992,Line truncated
@@ -1 +0,0 @@
{"type":"Trading Engine","name":"Low-Frequency","current":{"type":"Current","name":"New Current","episode":{"type":"Episode","name":"New Episode","serialNumber":{"type":"Serial Number","name":"New Serial Number","config":"{\n\"initialValue\": 0\n}","id":"5eb83933-432a-4029-8a3e-e4d8d760dd27","savedPayload":{"position":{"x":32587.85548677459,"y":23591.123239421617},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"identifier":{"type":"Identifier","name":"New Identifier","config":"{\n\"initialValue\": \"\"\n}","id":"8ba7fe0c-c5df-408e-be8a-ebde90f2a50d","savedPayload":{"position":{"x":32686.3772416773,"y":23462.64113201446},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"begin":{"type":"Begin","name":"New Begin","config":"{\n\"initialValue\": 0\n}","id":"d7faf864-3fa8-4280-b7d3-a022338b0dfe","savedPayload":{"position":{"x":32805.61547866025,"y":23353.352855471876},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"end":{"type":"End","name":"New End","config":"{\n\"initialValue\": 0\n}","id":"f6722d05-77f9-4a68-ba69-38f56cdc7e91","savedPayload":{"position":{"x":32942.00107943419,"y":23266.45259364257},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"beginRate":{"type":"Begin Rate","name":"New Begin Rate","config":"{\n\"initialValue\": 0\n}","id":"613903ae-45e4-4eee-a178-d6ec049490ec","savedPayload":{"position":{"x":33091.39789177117,"y":23204.561954902598},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"endRate":{"type":"End Rate","name":"New End Rate","config":"{\n\"initialValue\": 0\n}","id":"b2bfb20d-64d5-4c98-b0cd-a466654c1e6a","savedPayload":{"position":{"x":33249.26866434818,"y":23169.555945271954},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"status":{"type":"Status","name":"New Status","config":"{\n\"initialValue\": \"Not Open\"\n}","id":"2615490b-e968-4607-a6e5-009c3ae78957","savedPayload":{"position":{"x":33410.61875317618,"y":23162.49582096675},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"exitType":{"type":"Exit Type","name":"New Exit Type","config":"{\n\"initialValue\": \"No Exit\"\n}","id":"6bcc264b-a189-4aca-8397-d3520bdf4078","savedPayload":{"position":{"x":33570.93584545368,"y":23183.594405110707},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"headOfTheMarket":{"type":"Head Of The Market","name":"New Head Of The Market","config":"{\n\"initialValue\": false\n}","id":"f7e00135-13b1-4265-95da-dd3a2c763b6f","savedPayload":{"position":{"x":33725.15083828583,"y":23232.208558658625},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"processDate":{"type":"Process Date","name":"New Process Date","config":"{\n\"initialValue\": 0\n}","id":"d9163f6e-0d50-4ddd-b13b-14f7b4124ec8","savedPayload":{"position":{"x":33868.576136870695,"y":23306.85833073421},"targetPosition":{"x":33370.252954726864,"y":24089.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"episodeBaseAsset":{"type":"Episode Base Asset","name":"New Episode Base Asset","balance":{"type":"Balance","name":"Base Asset","config":"{\n\"initialValue\": 0\n}","id":"72f6a6b6-f35b-4d80-b8ad-4a4ed55f2387","savedPayload":{"position":{"x":34087.36119018759,"y":22483.324533425865},"targetPosition":{"x":33996.29728736959,"y":23406.099671638818},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"beginBalance":{"type":"Begin Balance","name":"New Begin Balance","config":"{\n\"initialVLine truncated
-1
View File
@@ -1 +0,0 @@
{"type":"Workspace","name":"My Default Workspace","rootNodes":[{"type":"Network","name":"My Network","networkNodes":[{"type":"Network Node","name":"My Computer","config":"{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"8081\"\n}","dataMining":{"type":"Data Mining","name":"New Data Mining","exchangeDataTasks":[{"type":"Exchange Data Tasks","name":"Binance","marketDataTasks":[{"type":"Market Data Tasks","name":"Binance BTC/USDT","dataMineTasks":[{"type":"Data Mine Tasks","name":"Masters","taskManagers":[{"type":"Task Manager","name":"Masters","tasks":[{"type":"Task","name":"Exchange Raw Data","bot":{"type":"Sensor Bot Instance","name":"Exchange Raw Data","config":"{ \n\"startDate\": \"2020-01-01\"\n}","processes":[{"type":"Sensor Process Instance","name":"Exchange Raw Data Historic-OHLCVs","id":"d244c564-4e86-43c7-9796-dc3b6294ec8b","savedPayload":{"position":{"x":23350.72155964175,"y":27974.73694646384},"targetPosition":{"x":23796.134845502005,"y":28201.58542120731},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Historic-OHLCVs","id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc"}}}],"id":"343313ae-5705-484d-8bf8-aed25ba61cfa","savedPayload":{"position":{"x":23796.134845502005,"y":28201.58542120731},"targetPosition":{"x":24241.458369037155,"y":28428.234646351164},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"a8f38508-1cac-4ab1-815f-d338fc813377","savedPayload":{"position":{"x":24241.75852203732,"y":28428.208299607475},"targetPosition":{"x":24687.278008317153,"y":28654.76075777684},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Candles Volumes","bot":{"type":"Indicator Bot Instance","name":"Candles Volumes","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Market","id":"f0ef12ed-f0fd-4b88-8e15-27cf24265a5f","savedPayload":{"position":{"x":24006.72050468727,"y":27369.71288635874},"targetPosition":{"x":24378.211094165374,"y":27704.217502769996},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"9f683143-a33f-42c1-9fa8-c601f01ee4e1"}}},{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Daily","id":"7c8b312c-09bf-4c59-853f-1592391a9c57","savedPayload":{"position":{"x":24482.007917121682,"y":27215.198820322174},"targetPosition":{"x":24378.211094165374,"y":27704.217502769996},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","id":"980ceb1d-7be6-454f-90d9-01ba1fd4a65d"}}}],"id":"8d58e84b-d7ef-464f-8079-0ec0887e3da3","savedPayload":{"position":{"x":24378.211094165374,"y":27704.217502769996},"targetPosition":{"x":24532.587246191903,"y":28179.44371808849},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"bf29e3bd-9386-408b-9091-042da0c53e81","savedPayload":{"position":{"x":24532.888249874817,"y":28179.42182195281},"targetPosition":{"x":24687.278008317153,"y":28654.76075777684},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Resistances and Supports","bot":{"type":"Indicator Bot Instance","name":"Resistances and Supports","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Market","id":"a707814e-b81b-4102-9b5b-4e2fe969324f","savedPayload":{"position":{"x":25114.95430215858,"y":27265.22588761826},"targetPosition":{"x":25140.944779828777,"y":27764.465158604555},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"5d9b2729-43fb-4e7e-aa4f-b8477c424e51"}}},{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Daily","id":"c5395fbe-4b5a-4492-a7fb-e2d259905e27","savedPayload":{"position":{"x":25560.208138746566,"y":27492.2415577616},"targetPosition":{"x":25140.944779828777,"y":27764.465158604555},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distLine truncated
@@ -587,7 +587,7 @@
let fileContent = "";
for (i = 0; i < pBands.length; i++) {
for (let i = 0; i < pBands.length; i++) {
let band = pBands[i];
@@ -657,7 +657,7 @@
let fileContent = "";
for (i = 0; i < pPercentageBandwidths.length; i++) {
for (let i = 0; i < pPercentageBandwidths.length; i++) {
let pB = pPercentageBandwidths[i];
@@ -280,7 +280,7 @@
let fileContent = "";
for (i = 0; i < pBands.length; i++) {
for (let i = 0; i < pBands.length; i++) {
let band = pBands[i];
@@ -350,7 +350,7 @@
let fileContent = "";
for (i = 0; i < pPercentageBandwidths.length; i++) {
for (let i = 0; i < pPercentageBandwidths.length; i++) {
let pB = pPercentageBandwidths[i];
@@ -274,7 +274,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each
outputCandles = [];
outputVolumes = [];
for (n = 0; n < global.dailyFilePeriods.length; n++) {
for (let n = 0; n < global.dailyFilePeriods.length; n++) {
const emptyArray1 = [];
const emptyArray2 = [];
@@ -589,7 +589,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each
let fileRecordCounter = 0;
let fileContent = "";
for (i = 0; i < candles.length; i++) {
for (let i = 0; i < candles.length; i++) {
let candle = candles[i];
@@ -640,7 +640,7 @@ Read the candles and volumes from Exchange Raw Data and produce a file for each
let fileRecordCounter = 0;
let fileContent = "";
for (i = 0; i < volumes.length; i++) {
for (let i = 0; i < volumes.length; i++) {
let candle = volumes[i];
@@ -392,7 +392,7 @@
let outputCandles = [];
let outputVolumes = [];
for (n = 0; n < global.marketFilesPeriods.length; n++) {
for (let n = 0; n < global.marketFilesPeriods.length; n++) {
const emptyArray1 = [];
const emptyArray2 = [];
@@ -799,7 +799,7 @@
let fileRecordCounter = 0;
let fileContent = "";
for (i = 0; i < candles.length; i++) {
for (let i = 0; i < candles.length; i++) {
let candle = candles[i];
@@ -849,7 +849,7 @@
let fileRecordCounter = 0;
let fileContent = "";
for (i = 0; i < volumes.length; i++) {
for (let i = 0; i < volumes.length; i++) {
let candle = volumes[i];
File renamed without changes.
File renamed without changes.
+1
View File
@@ -0,0 +1 @@
{"type":"Data Mine","name":"Masters","config":"{\n\"codeName\": \"Masters\"\n}","sensorBots":[{"type":"Sensor Bot","name":"Exchange Raw Data","config":"{\n\"codeName\": \"Exchange-Raw-Data\",\n\"repo\": \"Exchange-Raw-Data-Sensor-Bot\"\n}","processes":[{"type":"Process Definition","name":"Historic-OHLCVs","config":"{\n \"codeName\": \"Historic-OHLCVs\",\n \"description\": \"Retrieves and saves historical maket data\",\n \"startMode\": {\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"outputDatasetFolders":[],"id":"dfe2556e-a765-4e38-9d30-7f91090c0069","savedPayload":{"position":{"x":19694.65896528582,"y":18079.80666168302},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"ea39c98b-18e2-44ce-9f7f-86a8a76a688a","savedPayload":{"position":{"x":20111.534021268813,"y":17814.56375630177},"targetPosition":{"x":19893.316491438505,"y":18150.31980838774},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e"}}}],"dataDependencies":[],"dataMineDataDependencies":[],"id":"5c7fae5a-6da6-4864-a167-f2f21d578c72","savedPayload":{"position":{"x":19893.316491438505,"y":18150.31980838774},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e","savedPayload":{"position":{"x":20031.71582860312,"y":18304.406526432995},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"","id":"957e7e3a-b167-40be-93b5-9ba4ceff56e5","savedPayload":{"position":{"x":20075.30856507894,"y":18506.680081128765},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"fe40a546-43ee-49df-908a-7e72f598f0cd","savedPayload":{"position":{"x":20019.51506449239,"y":18694.64493952324},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc","savedPayload":{"position":{"x":19674.617425695335,"y":18486.33639924593},"targetPosition":{"x":19278.707614323983,"y":18688.55263969416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"products":[{"type":"Product Definition","name":"Trades","config":"{\n\"codeName\": \"Trades\"\n}","datasets":[{"type":"Dataset Definition","name":"Trades","config":"{\n\"codeName\": \"Trades\"\n}","id":"fbb7c17e-a909-4fa2-b3c5-eb8ca86297c4","savedPayload":{"position":{"x":19939.732540593195,"y":18584.456194349146},"targetPosition":{"x":19741.31504137297,"y":18616.06022300575},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"id":"38dbb942-a15b-450b-a867-02a94030965f","savedPayload":{"position":{"x":19741.31504137297,"y":18616.06022300575},"targetPosition":{"x":19278.707614323983,"y":18688.55263969416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Product Definition","name":"Candles","config":"{\n\"codeName\": \"Candles\"\n}","datasets":[{"type":"Dataset Definition","name":"One-Min","config":"{\n\"codeName\": \"One-Min\"\n}","id":"1c3696e4-c28e-4744-9100-706d6dce0c3c","savedPayload":{"position":{"x":19935.702085675992,Line truncated
+1
View File
@@ -0,0 +1 @@
{"type":"Data Mine","name":"Masters","config":"{\n\"codeName\": \"Masters\"\n}","sensorBots":[{"type":"Sensor Bot","name":"Exchange Raw Data","config":"{\n\"codeName\": \"Exchange-Raw-Data\",\n\"repo\": \"Exchange-Raw-Data-Sensor-Bot\"\n}","processes":[{"type":"Process Definition","name":"Historic-OHLCVs","config":"{\n \"codeName\": \"Historic-OHLCVs\",\n \"description\": \"Retrieves and saves historical maket data\",\n \"startMode\": {\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"outputDatasetFolders":[],"id":"dfe2556e-a765-4e38-9d30-7f91090c0069","savedPayload":{"position":{"x":19694.65896528582,"y":18079.80666168302},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"ea39c98b-18e2-44ce-9f7f-86a8a76a688a","savedPayload":{"position":{"x":20111.534021268813,"y":17814.56375630177},"targetPosition":{"x":19893.316491438505,"y":18150.31980838774},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e"}}}],"dataDependencies":[],"dataMineDataDependencies":[],"id":"5c7fae5a-6da6-4864-a167-f2f21d578c72","savedPayload":{"position":{"x":19893.316491438505,"y":18150.31980838774},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","id":"181c7c34-7243-497a-9ddb-1b0067c6d66e","savedPayload":{"position":{"x":20031.71582860312,"y":18304.406526432995},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"","id":"957e7e3a-b167-40be-93b5-9ba4ceff56e5","savedPayload":{"position":{"x":20075.30856507894,"y":18506.680081128765},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"fe40a546-43ee-49df-908a-7e72f598f0cd","savedPayload":{"position":{"x":20019.51506449239,"y":18694.64493952324},"targetPosition":{"x":19674.617425695335,"y":18486.33639924593},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc","savedPayload":{"position":{"x":19674.617425695335,"y":18486.33639924593},"targetPosition":{"x":19278.707614323983,"y":18688.55263969416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}}],"products":[{"type":"Product Definition","name":"Trades","config":"{\n\"codeName\": \"Trades\"\n}","datasets":[{"type":"Dataset Definition","name":"Trades","config":"{\n\"codeName\": \"Trades\"\n}","id":"fbb7c17e-a909-4fa2-b3c5-eb8ca86297c4","savedPayload":{"position":{"x":19939.732540593195,"y":18584.456194349146},"targetPosition":{"x":19741.31504137297,"y":18616.06022300575},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}}],"id":"38dbb942-a15b-450b-a867-02a94030965f","savedPayload":{"position":{"x":19741.31504137297,"y":18616.06022300575},"targetPosition":{"x":19278.707614323983,"y":18688.55263969416},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Product Definition","name":"Candles","config":"{\n\"codeName\": \"Candles\"\n}","datasets":[{"type":"Dataset Definition","name":"One-Min","config":"{\n\"codeName\": \"One-Min\"\n}","id":"1c3696e4-c28e-4744-9100-706d6dce0c3c","savedPayload":{"position":{"x":19935.702085675992,Line truncated
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1 @@
{"type":"Trading Engine","name":"Low-Frequency","current":{"type":"Current","name":"New Current","episode":{"type":"Episode","name":"New Episode","serialNumber":{"type":"Serial Number","name":"New Serial Number","config":"{\n\"initialValue\": 0\n}","id":"5eb83933-432a-4029-8a3e-e4d8d760dd27","savedPayload":{"position":{"x":31114.85548677459,"y":23608.123239421617},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"identifier":{"type":"Identifier","name":"New Identifier","config":"{\n\"initialValue\": \"\"\n}","id":"8ba7fe0c-c5df-408e-be8a-ebde90f2a50d","savedPayload":{"position":{"x":31213.3772416773,"y":23479.64113201446},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"begin":{"type":"Begin","name":"New Begin","config":"{\n\"initialValue\": 0\n}","id":"d7faf864-3fa8-4280-b7d3-a022338b0dfe","savedPayload":{"position":{"x":31332.61547866025,"y":23370.352855471876},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"end":{"type":"End","name":"New End","config":"{\n\"initialValue\": 0\n}","id":"f6722d05-77f9-4a68-ba69-38f56cdc7e91","savedPayload":{"position":{"x":31469.001079434187,"y":23283.45259364257},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"beginRate":{"type":"Begin Rate","name":"New Begin Rate","config":"{\n\"initialValue\": 0\n}","id":"613903ae-45e4-4eee-a178-d6ec049490ec","savedPayload":{"position":{"x":31618.397891771172,"y":23221.561954902598},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"endRate":{"type":"End Rate","name":"New End Rate","config":"{\n\"initialValue\": 0\n}","id":"b2bfb20d-64d5-4c98-b0cd-a466654c1e6a","savedPayload":{"position":{"x":31776.26866434818,"y":23186.555945271954},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"status":{"type":"Status","name":"New Status","config":"{\n\"initialValue\": \"Not Open\"\n}","id":"2615490b-e968-4607-a6e5-009c3ae78957","savedPayload":{"position":{"x":31937.618753176183,"y":23179.49582096675},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"exitType":{"type":"Exit Type","name":"New Exit Type","config":"{\n\"initialValue\": \"No Exit\"\n}","id":"6bcc264b-a189-4aca-8397-d3520bdf4078","savedPayload":{"position":{"x":32097.935845453678,"y":23200.594405110707},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"headOfTheMarket":{"type":"Head Of The Market","name":"New Head Of The Market","config":"{\n\"initialValue\": false\n}","id":"f7e00135-13b1-4265-95da-dd3a2c763b6f","savedPayload":{"position":{"x":32252.15083828583,"y":23249.208558658625},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"processDate":{"type":"Process Date","name":"New Process Date","config":"{\n\"initialValue\": 0\n}","id":"d9163f6e-0d50-4ddd-b13b-14f7b4124ec8","savedPayload":{"position":{"x":32395.576136870695,"y":23323.85833073421},"targetPosition":{"x":31897.252954726864,"y":24106.230920316222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"episodeBaseAsset":{"type":"Episode Base Asset","name":"New Episode Base Asset","balance":{"type":"Balance","name":"Base Asset","config":"{\n\"initialValue\": 0\n}","id":"72f6a6b6-f35b-4d80-b8ad-4a4ed55f2387","savedPayload":{"position":{"x":32614.361190187592,"y":22500.324533425865},"targetPosition":{"x":32523.29728736959,"y":23423.099671638818},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"beginBalance":{"type":"Begin Balance","name":"New Begin Balance","config":"{\n\"iniLine truncated
File renamed without changes.
+1
View File
@@ -0,0 +1 @@
{"type":"Workspace","name":"My Default Workspace","rootNodes":[{"type":"Network","name":"My Network","networkNodes":[{"type":"Network Node","name":"My Computer","config":"{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}","dataMining":{"type":"Data Mining","name":"New Data Mining","exchangeDataTasks":[{"type":"Exchange Data Tasks","name":"Binance","marketDataTasks":[{"type":"Market Data Tasks","name":"Binance BTC/USDT","dataMineTasks":[{"type":"Data Mine Tasks","name":"Masters","taskManagers":[{"type":"Task Manager","name":"Masters","tasks":[{"type":"Task","name":"Exchange Raw Data","bot":{"type":"Sensor Bot Instance","name":"Exchange Raw Data","config":"{ \n\"startDate\": \"2020-01-01\"\n}","processes":[{"type":"Sensor Process Instance","name":"Exchange Raw Data Historic-OHLCVs","id":"d244c564-4e86-43c7-9796-dc3b6294ec8b","savedPayload":{"position":{"x":23993.925629940142,"y":29195.742554406977},"targetPosition":{"x":24261.227587196652,"y":29331.93970432884},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Historic-OHLCVs","id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc"}}}],"id":"343313ae-5705-484d-8bf8-aed25ba61cfa","savedPayload":{"position":{"x":24261.227587196652,"y":29331.93970432884},"targetPosition":{"x":24528.529544453162,"y":29468.136854250704},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"a8f38508-1cac-4ab1-815f-d338fc813377","savedPayload":{"position":{"x":24528.529544453162,"y":29468.136854250704},"targetPosition":{"x":24795.831501709672,"y":29604.334004172568},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Candles Volumes","bot":{"type":"Indicator Bot Instance","name":"Candles Volumes","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Market","id":"f0ef12ed-f0fd-4b88-8e15-27cf24265a5f","savedPayload":{"position":{"x":24387.47785744149,"y":28832.96091248782},"targetPosition":{"x":24610.421305084707,"y":29033.700094395477},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"9f683143-a33f-42c1-9fa8-c601f01ee4e1"}}},{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Daily","id":"7c8b312c-09bf-4c59-853f-1592391a9c57","savedPayload":{"position":{"x":24672.794812330034,"y":28740.255814175336},"targetPosition":{"x":24610.421305084707,"y":29033.700094395477},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","id":"980ceb1d-7be6-454f-90d9-01ba1fd4a65d"}}}],"id":"8d58e84b-d7ef-464f-8079-0ec0887e3da3","savedPayload":{"position":{"x":24610.421305084707,"y":29033.700094395477},"targetPosition":{"x":24703.12640339719,"y":29319.017049284023},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"bf29e3bd-9386-408b-9091-042da0c53e81","savedPayload":{"position":{"x":24703.12640339719,"y":29319.017049284023},"targetPosition":{"x":24795.831501709672,"y":29604.334004172568},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Resistances and Supports","bot":{"type":"Indicator Bot Instance","name":"Resistances and Supports","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Market","id":"a707814e-b81b-4102-9b5b-4e2fe969324f","savedPayload":{"position":{"x":25052.525014680516,"y":28770.141229233177},"targetPosition":{"x":25068.2258015534,"y":29069.730089659548},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"5d9b2729-43fb-4e7e-aa4f-b8477c424e51"}}},{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Daily","id":"c5395fbe-4b5a-4492-a7fb-e2d259905e27","savedPayload":{"position":{"x":25319.826971937026,"y":28906.33837915504},"targetPosition":{"x":25068.2258015534,"y":29069.730089659548},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,Line truncated
File renamed without changes.
+1 -1
View File
@@ -8,6 +8,6 @@ WRITE_LOGS_TO_FILES=true
BOTS_PATH=../Legacy-Code
LOG_PATH=../Log-Files
WEB_SOCKETS_SERVER_PORT=8081
WEB_SOCKETS_SERVER_PORT=18041
WEB_SERVER_PORT=34248
WEB_SERVER_URL=localhost
+4 -2
View File
@@ -24,8 +24,8 @@ exports.newDataSet = function newDataSet(BOT, logger) {
try {
thisObject.node = dataDependency.referenceParent;
logger.fileName = MODULE_NAME + "." + thisObject.node.type + "." + thisObject.node.name + "." + thisObject.node.id;
logger.fileName = MODULE_NAME
/* Some very basic validations that we have all the information needed. */
if (thisObject.node === undefined) {
logger.write(MODULE_NAME, "[ERROR] initialize -> Data Dependency without Reference Parent -> dataDependency = " + JSON.stringify(dataDependency));
@@ -33,6 +33,8 @@ exports.newDataSet = function newDataSet(BOT, logger) {
return
}
logger.fileName = MODULE_NAME + "." + thisObject.node.type + "." + thisObject.node.name + "." + thisObject.node.id;
if (thisObject.node.config.codeName === undefined) {
logger.write(MODULE_NAME, "[ERROR] initialize -> Dataset witn no codeName defined -> Product Dataset = " + JSON.stringify(thisObject.node));
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
+49 -35
View File
@@ -1,7 +1,7 @@
exports.newEventsServerClient = function newEventsServerClient(host, port) {
const MODULE = "Task Server "
const ERROR_LOG = true
const INFO_LOG = false
let thisObject = {
@@ -27,6 +27,8 @@
port = process.env.WEB_SOCKETS_SERVER_PORT
}
let messageCounter = 0
let commandCounter = 0
return thisObject
@@ -39,25 +41,32 @@
function setuptWebSockets(callBackFunction) {
try {
if (INFO_LOG === true) {
console.log('setuptWebSockets at ' + host + ':' + port)
}
WEB_SOCKETS_CLIENT = new WEB_SOCKET('ws://' + host + ':' + port )
WEB_SOCKETS_CLIENT.onerror = error => {
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> On connection error -> error = ' + JSON.stringify(error))
WEB_SOCKETS_CLIENT.onerror = err => {
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> On connection error -> error = ' + err.stack)
console.log('[ERROR] This could mean that the port '+ port +' is taken by some other app running at your system. To resolve this issue, please pick another port number and change it at the .ENV file inside the Superalgos folder AND at the .ENV file inside the TaskServer folder. After that run the app again. ')
}
WEB_SOCKETS_CLIENT.onopen = () => {
if (INFO_LOG === true) {
console.log('Websocket connection opened.')
}
if (callBackFunction !== undefined) {
callBackFunction()
try {
if (INFO_LOG === true) {
console.log('Websocket connection opened.')
}
if (callBackFunction !== undefined) {
callBackFunction()
}
} catch(err) {
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> onopen -> err = ' + err.stack)
}
}
WEB_SOCKETS_CLIENT.onmessage = e => {
try {
if (INFO_LOG === true) {
console.log('Websocket Message Received: ' + e.data)
console.log('Websocket Message Received: ' + e.data.substring(0, 1000))
}
let message = JSON.parse(e.data)
@@ -84,11 +93,11 @@
return
}
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> onmessage -> err = ' + err.stack) }
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> onmessage -> err = ' + err.stack)
}
}
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> err = ' + err.stack) }
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> err = ' + err.stack)
}
}
@@ -109,30 +118,35 @@
}
function sendCommand(command, responseCallBack, eventsCallBack) {
if (command.action === 'listenToEvent') {
let key
if (command.callerId) {
key = command.eventHandlerName + '-' + command.eventType + '-' + command.callerId
try {
if (command.action === 'listenToEvent') {
let key
if (command.callerId) {
key = command.eventHandlerName + '-' + command.eventType + '-' + command.callerId
} else {
key = command.eventHandlerName + '-' + command.eventType
}
let handler = {
eventHandlerName: command.eventHandlerName,
eventType: command.eventType,
callerId: command.callerId,
callBack: eventsCallBack
}
eventListeners.set(key, handler)
}
if (command.callerId && responseCallBack) {
responseWaiters.set(command.callerId, responseCallBack)
}
if (WEB_SOCKETS_CLIENT.readyState === 1) { // 1 means connected and ready.
WEB_SOCKETS_CLIENT.send("Task Server" + "|*|" + "|*|" + JSON.stringify(command))
} else {
key = command.eventHandlerName + '-' + command.eventType
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> sendCommand -> WebSocket message could not be sent because the connection was not ready. Message = ' + JSON.stringify(command))
}
let handler = {
eventHandlerName: command.eventHandlerName,
eventType: command.eventType,
callerId: command.callerId,
callBack: eventsCallBack
}
eventListeners.set(key, handler)
}
if (command.callerId && responseCallBack) {
responseWaiters.set(command.callerId, responseCallBack)
}
if (WEB_SOCKETS_CLIENT.readyState === 1) { // 1 means connected and ready.
WEB_SOCKETS_CLIENT.send("Task Server" + "|*|" + "|*|" + JSON.stringify(command))
} else {
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> sendCommand -> WebSocket message could not be sent because the connection was not ready. Message = ' + JSON.stringify(command))
} catch(err) {
console.log('[ERROR] Task Server -> Event Server Client -> sendCommand -> err = ' + err.stack)
}
}
+1 -1
View File
@@ -61,7 +61,7 @@
function onCommonsDownloaded(err, text) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.code || err.message);
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message);
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
@@ -186,7 +186,7 @@ exports.newTradingPosition = function newTradingPosition(bot, logger, tradingEng
const message = 'Target Size In Base Asset cannot be undefined. Fix this please.'
badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInBaseAsset.formula)
}
if (value === undefined) {
if (value === 0) {
const message = 'Target Size In Base Asset cannot be zero. Fix this please.'
badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInBaseAsset.formula)
}
@@ -222,7 +222,7 @@ exports.newTradingPosition = function newTradingPosition(bot, logger, tradingEng
const message = 'Target Size In Quoted Asset cannot be undefined. Fix this please.'
badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset.formula)
}
if (value === undefined) {
if (value === 0) {
const message = 'Target Size In Quoted Asset cannot be zero. Fix this please.'
badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset.formula)
}
@@ -244,8 +244,8 @@ exports.newTradingPosition = function newTradingPosition(bot, logger, tradingEng
/* Remember how the end user defined this stage. */
tradingEngineStageNode.stageDefinedIn.value = 'Quoted Asset'
} else {
const errorText = 'You need to specify a Formula for this.'
badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset.formula)
const message = 'You need to specify a Formula for this.'
badDefinitionUnhandledException(undefined, message, tradingSystemStageNode.initialTargets.targetSizeInQuotedAsset)
}
}
}
@@ -310,6 +310,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
if (error !== undefined) {
tradingSystem.errors.push([node.id, error])
logger.write(MODULE_NAME, '[INFO] evalFormula -> error = ' + error)
return
}
if (value !== undefined) {
@@ -323,7 +324,6 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
}
logger.write(MODULE_NAME, '[INFO] evalFormula -> value = ' + value)
logger.write(MODULE_NAME, '[INFO] evalFormula -> error = ' + error)
}
}
+3 -4
View File
@@ -67,7 +67,6 @@
function getContextVariables() {
try {
let thisReport;
let reportKey;
let statusReport;
/*
We look first for the bot who knows the begining of the market in order to get when the market starts.
@@ -89,7 +88,7 @@
thisReport = statusReport.file;
if (thisReport.beginingOfMarket === undefined) {
logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey)
logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> thisReport.beginingOfMarket === undefined ")
logger.write(MODULE_NAME, "[HINT] start -> getContextVariables -> It is too early too run this process since the trade history of the market is not there yet.")
let customOK = {
@@ -122,7 +121,7 @@
thisReport = statusReport.file;
if (thisReport.lastFile === undefined) {
logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> reportKey = " + reportKey)
logger.write(MODULE_NAME, "[WARN] start -> getContextVariables -> Undefined Last File. -> thisReport.lastFile === undefined")
let customOK = {
result: global.CUSTOM_OK_RESPONSE.result,
@@ -157,7 +156,7 @@
beginingOfMarket = new Date(thisReport.beginingOfMarket)
if (beginingOfMarket.valueOf() !== contextVariables.dateBeginOfMarket.valueOf()) { // Reset Mechanism for Begining of the Market
logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> Reset Mechanism for Begining of the Market Activated. -> reportKey = " + reportKey)
logger.write(MODULE_NAME, "[INFO] start -> getContextVariables -> Reset Mechanism for Begining of the Market Activated.")
beginingOfMarket = new Date(contextVariables.dateBeginOfMarket.valueOf())
startFromBegining()
+1 -1
View File
@@ -11,7 +11,7 @@
let thisObject = {
networkNode: undefined,
initialize, initialize,
initialize: initialize,
finalize: finalize,
start: start,
finish: finish
+2 -2
View File
@@ -86,7 +86,7 @@
let product = outputDataset.referenceParent.parentNode.config.codeName
let dataset = outputDataset.referenceParent.config.codeName
key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset
let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset
let event = {
lastFile: lastFile,
timeFrames: timeFrames
@@ -165,7 +165,7 @@
let product = outputDataset.referenceParent.parentNode.config.codeName
let dataset = outputDataset.referenceParent.config.codeName
key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset
let key = dataMine + "-" + botName + "-" + product + "-" + dataset + "-" + bot.exchange + "-" + bot.market.baseAsset + '/' + bot.market.quotedAsset
let event = {
lastFile: lastFile,
timeFrames: timeFrames
+1 -1
View File
@@ -63,7 +63,7 @@
function onCommonsDownloaded(err, text) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.code || err.message);
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message);
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
+1 -1
View File
@@ -322,7 +322,7 @@
/* Slippage */
if (bot.SESSION.parameters.slippage === undefined) { // if the Slippage is missing we create a default one.
bot.SESSION.parameters.timeRange = {
bot.SESSION.parameters.slippage = {
name: 'Missing Slippage',
type: 'Slippage',
config: {
-1
View File
@@ -251,7 +251,6 @@
global.unexpectedError = err.message
processStopped()
return
return;
}
default: {
logger.write(MODULE_NAME, "[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
+31 -18
View File
@@ -1,5 +1,4 @@
/* Callbacks default responses. */
global.DEFAULT_OK_RESPONSE = {
result: "Ok",
@@ -316,7 +315,9 @@ function finalizeLoggers() {
global.LOGGER_MAP.forEach(forEachLogger)
function forEachLogger(logger) {
logger.finalize()
if (logger !== undefined) {
logger.finalize()
}
}
}
@@ -375,12 +376,14 @@ global.EXIT_NODE_PROCESS = function exitProcess() {
/* Cleaning Before Exiting. */
clearInterval(global.HEARTBEAT_INTERVAL_HANDLER)
for (let i = 0; i < global.TASK_NODE.bot.processes.length; i++) {
let config = global.TASK_NODE.bot.processes[i].config
let process = global.TASK_NODE.bot.processes[i]
key = process.name + '-' + process.type + '-' + process.id
global.EVENT_SERVER_CLIENT.raiseEvent(key, 'Stopped') // Meaning Process Stopped
if (global.TASK_NODE !== undefined) {
for (let i = 0; i < global.TASK_NODE.bot.processes.length; i++) {
let config = global.TASK_NODE.bot.processes[i].config
let process = global.TASK_NODE.bot.processes[i]
let key = process.name + '-' + process.type + '-' + process.id
global.EVENT_SERVER_CLIENT.raiseEvent(key, 'Stopped') // Meaning Process Stopped
}
}
finalizeLoggers()
@@ -426,11 +429,15 @@ function preLoader() {
global.EVENT_SERVER_CLIENT.listenToEvent('Task Server - ' + taskId, 'Run Task', undefined, 'Task Server - ' + taskId, undefined, eventReceived)
global.EVENT_SERVER_CLIENT.raiseEvent('Task Manager - ' + taskId, 'Nodejs Process Ready for Task')
function eventReceived(message) {
global.APP_SCHEMA_ARRAY = JSON.parse(message.event.appSchema)
setUpAppSchema()
global.TASK_NODE = JSON.parse(message.event.taskDefinition)
global.TASK_NETWORK = JSON.parse(message.event.networkDefinition)
bootLoader()
try {
global.APP_SCHEMA_ARRAY = JSON.parse(message.event.appSchema)
setUpAppSchema()
global.TASK_NODE = JSON.parse(message.event.taskDefinition)
global.TASK_NETWORK = JSON.parse(message.event.networkDefinition)
bootLoader()
} catch(err) {
console.log('[ERROR] Task Server -> server -> preLoader -> eventReceived -> ' + err.stack)
}
}
} catch (err) {
console.log('[ERROR] Task Server -> server -> preLoader -> global.TASK_NODE -> ' + err.stack)
@@ -442,11 +449,16 @@ function preLoader() {
//console.log('[INFO] Task Server -> server -> preLoader -> Waiting for event to start debugging...')
global.EVENT_SERVER_CLIENT.listenToEvent('Task Server', 'Debug Task Started', undefined, 'Task Server', undefined, startDebugging)
function startDebugging(message) {
global.APP_SCHEMA_ARRAY = JSON.parse(message.event.appSchema)
setUpAppSchema()
global.TASK_NODE = JSON.parse(message.event.taskDefinition)
global.TASK_NETWORK = JSON.parse(message.event.networkDefinition)
bootLoader()
try {
global.APP_SCHEMA_ARRAY = JSON.parse(message.event.appSchema)
setUpAppSchema()
global.TASK_NODE = JSON.parse(message.event.taskDefinition)
global.TASK_NETWORK = JSON.parse(message.event.networkDefinition)
bootLoader()
} catch(err) {
console.log('[ERROR] Task Server -> server -> preLoader -> startDebugging -> ' + err.stack)
}
}
} catch (err) {
console.log('[ERROR] Task Server -> server -> preLoader -> global.TASK_NODE -> ' + err.stack)
@@ -502,6 +514,7 @@ function bootLoader() {
global.EVENT_SERVER_CLIENT.raiseEvent(key, 'Error', event)
}
for (let processIndex = 0; processIndex < global.TASK_NODE.bot.processes.length; processIndex++) {
let config = global.TASK_NODE.bot.processes[processIndex].config