Data Mining
This commit is contained in:
1 parent
17860ec9f9
commit
040b8a7f4f
5 files changed
+144
-13
No files matched your search
@@ -6,8 +6,11 @@ function newTaskFunctions() {
|
||||
stopAllTasks: stopAllTasks,
|
||||
runAllTaskManagers: runAllTaskManagers,
|
||||
stopAllTaskManagers: stopAllTaskManagers,
|
||||
runAllExchangeTasks: runAllExchangeTasks,
|
||||
stopAllExchangeTasks: stopAllExchangeTasks
|
||||
runAllExchangeDataTasks: runAllExchangeDataTasks,
|
||||
stopAllExchangeDataTasks: stopAllExchangeDataTasks,
|
||||
runAllExchangeTradingTasks: runAllExchangeTradingTasks,
|
||||
stopAllExchangeTradingTasks: stopAllExchangeTradingTasks,
|
||||
addMissingExchangeDataTasks: addMissingExchangeDataTasks
|
||||
}
|
||||
|
||||
return thisObject
|
||||
@@ -42,8 +45,8 @@ function newTaskFunctions() {
|
||||
'Output Dataset->Dataset Definition->Product Definition->' +
|
||||
'Process Dependencies->' +
|
||||
'Status Dependency->Status Report->Process Definition->' +
|
||||
'Data Mine Data Dependencies->Bot Data Dependencies->' +
|
||||
'Data Dependency Folder->Data Dependency Folder->Data Dependency Folder->Data Dependency Folder->Data Dependency Folder->' +
|
||||
'Data Mine Data Dependencies->Bot Data Dependencies->' +
|
||||
'Data Dependency Folder->Data Dependency Folder->Data Dependency Folder->Data Dependency Folder->Data Dependency Folder->' +
|
||||
'Data Dependency->Dataset Definition->Product Definition->' +
|
||||
'Record Definition->Record Property->Formula->' +
|
||||
'Data Building Procedure->' +
|
||||
@@ -56,7 +59,7 @@ function newTaskFunctions() {
|
||||
'Execution Finished Event->' +
|
||||
'Execution Started Event->Execution Finished Event->Process Definition->' +
|
||||
'Sensor Bot->' +
|
||||
'Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->' +
|
||||
'Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->' +
|
||||
'Indicator Bot->' +
|
||||
'Trading Bot->' +
|
||||
'Data Mine->'
|
||||
@@ -67,7 +70,7 @@ function newTaskFunctions() {
|
||||
'Data Storage->Session Independent Data->Exchange Data Products->' +
|
||||
'Single Market Data->' +
|
||||
'Data Mine Products->Bot Products->' +
|
||||
'Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->' +
|
||||
'Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->' +
|
||||
'Data Product->Product Definition->' +
|
||||
'Data Mining->Testing Environment->Production Environment->' +
|
||||
'Exchange Tasks->Crypto Exchange->' +
|
||||
@@ -215,7 +218,7 @@ function newTaskFunctions() {
|
||||
menu.internalClick('Stop All Tasks')
|
||||
}
|
||||
}
|
||||
function runAllExchangeTasks(parent, functionLibraryProtocolNode) {
|
||||
function runAllExchangeDataTasks(parent, functionLibraryProtocolNode) {
|
||||
for (let i = 0; i < parent.exchangeTasks.length; i++) {
|
||||
let node = parent.exchangeTasks[i]
|
||||
let menu = node.payload.uiObject.menu
|
||||
@@ -225,7 +228,7 @@ function newTaskFunctions() {
|
||||
}
|
||||
}
|
||||
|
||||
function stopAllExchangeTasks(parent, functionLibraryProtocolNode) {
|
||||
function stopAllExchangeDataTasks(parent, functionLibraryProtocolNode) {
|
||||
for (let i = 0; i < parent.exchangeTasks.length; i++) {
|
||||
let node = parent.exchangeTasks[i]
|
||||
let menu = node.payload.uiObject.menu
|
||||
@@ -234,4 +237,43 @@ function newTaskFunctions() {
|
||||
menu.internalClick('Stop All Task Managers')
|
||||
}
|
||||
}
|
||||
|
||||
function runAllExchangeTradingTasks(parent, functionLibraryProtocolNode) {
|
||||
for (let i = 0; i < parent.exchangeTasks.length; i++) {
|
||||
let node = parent.exchangeTasks[i]
|
||||
let menu = node.payload.uiObject.menu
|
||||
|
||||
menu.internalClick('Run All Task Managers')
|
||||
menu.internalClick('Run All Task Managers')
|
||||
}
|
||||
}
|
||||
|
||||
function stopAllExchangeTradingTasks(parent, functionLibraryProtocolNode) {
|
||||
for (let i = 0; i < parent.exchangeTasks.length; i++) {
|
||||
let node = parent.exchangeTasks[i]
|
||||
let menu = node.payload.uiObject.menu
|
||||
|
||||
menu.internalClick('Stop All Task Managers')
|
||||
menu.internalClick('Stop All Task Managers')
|
||||
}
|
||||
}
|
||||
|
||||
function addMissingExchangeDataTasks(node, rootNodes, functionLibraryUiObjectsFromNodes) {
|
||||
for (let i = 0; i < rootNodes.length; i++) {
|
||||
let rootNode = rootNodes[i]
|
||||
if (rootNode.type === 'Crypto Ecosystem') {
|
||||
cryptoEcosystem = rootNode
|
||||
for (let j = 0; j < cryptoEcosystem.cryptoExchanges.length; j++) {
|
||||
let cryptoExchanges = cryptoEcosystem.cryptoExchanges[j]
|
||||
for (let k=0; k < cryptoExchanges.exchanges.length; k++) {
|
||||
let cryptoExchange = cryptoExchanges.exchanges[j]
|
||||
if (isMissingChildren(node, cryptoExchange, true) === true) {
|
||||
let exchangeDataTasks = functionLibraryUiObjectsFromNodes.addUIObject(node, 'Exchange Data Tasks')
|
||||
exchangeDataTasks.payload.referenceParent = cryptoExchange
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,19 @@ function newUiObjectsFromNodes() {
|
||||
tasksToRun = []
|
||||
sessionsToRun = []
|
||||
|
||||
removeNullRootNodes()
|
||||
|
||||
function removeNullRootNodes() {
|
||||
for (let i = 0; i < node.rootNodes.length; i++) {
|
||||
let rootNode = node.rootNodes[i]
|
||||
if (rootNode === null) {
|
||||
node.rootNodes.splice(i, 1)
|
||||
removeNullRootNodes()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getIncludedNames()
|
||||
|
||||
function getIncludedNames() {
|
||||
|
||||
@@ -591,14 +591,29 @@ function newWorkspace() {
|
||||
functionLibraryTaskFunctions.stopAllTaskManagers(payload.node, functionLibraryProtocolNode)
|
||||
}
|
||||
break
|
||||
case 'Run All Exchange Tasks':
|
||||
case 'Run All Exchange Data Tasks':
|
||||
{
|
||||
functionLibraryTaskFunctions.runAllExchangeTasks(payload.node, functionLibraryProtocolNode)
|
||||
functionLibraryTaskFunctions.runAllExchangeDataTasks(payload.node, functionLibraryProtocolNode)
|
||||
}
|
||||
break
|
||||
case 'Stop All Exchange Tasks':
|
||||
case 'Stop All Exchange Data Tasks':
|
||||
{
|
||||
functionLibraryTaskFunctions.stopAllExchangeTasks(payload.node, functionLibraryProtocolNode)
|
||||
functionLibraryTaskFunctions.stopAllExchangeDataTasks(payload.node, functionLibraryProtocolNode)
|
||||
}
|
||||
break
|
||||
case 'Run All Exchange Trading Tasks':
|
||||
{
|
||||
functionLibraryTaskFunctions.runAllExchangeTradingTasks(payload.node, functionLibraryProtocolNode)
|
||||
}
|
||||
break
|
||||
case 'Stop All Exchange Trading Tasks':
|
||||
{
|
||||
functionLibraryTaskFunctions.stopAllExchangeTradingTasks(payload.node, functionLibraryProtocolNode)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Exchange Data Tasks':
|
||||
{
|
||||
functionLibraryTaskFunctions.addMissingExchangeDataTasks(payload.node, thisObject.workspaceNode.rootNodes, functionLibraryUiObjectsFromNodes)
|
||||
}
|
||||
break
|
||||
case 'Add Missing Crypto Exchanges':
|
||||
|
||||
@@ -299,7 +299,7 @@ function newCircularMenuItem() {
|
||||
|
||||
/* The first click ask for confirmation. */
|
||||
if (temporaryStatus === STATUS_NO_ACTION_TAKEN_YET) {
|
||||
setStatus(thisObject.confirmationLabel, UI_COLOR.GOLDEN_ORANGE, 20, STATUS_WAITING_CONFIRMATION)
|
||||
setStatus(thisObject.confirmationLabel, UI_COLOR.GOLDEN_ORANGE, 100, STATUS_WAITING_CONFIRMATION)
|
||||
return
|
||||
}
|
||||
/* A Click during confirmation executes the pre-defined action. */
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
function isMissingChildren(startingNode, checkNode, checkReferenceParent) {
|
||||
/*
|
||||
This functioin scan all the children of a node and returns true or false
|
||||
depending if the checkNode is a missing children.
|
||||
*/
|
||||
if (startingNode === undefined) { return }
|
||||
if (checkNode === undefined) { return }
|
||||
|
||||
let nodeDefinition = APP_SCHEMA_MAP.get(startingNode.type)
|
||||
if (nodeDefinition === undefined) { return }
|
||||
|
||||
/* We scan through this node children */
|
||||
if (nodeDefinition.properties !== undefined) {
|
||||
for (let i = 0; i < nodeDefinition.properties.length; i++) {
|
||||
let property = nodeDefinition.properties[i]
|
||||
|
||||
switch (property.type) {
|
||||
case 'node': {
|
||||
let child = startingNode[property.name]
|
||||
if (checkReferenceParent !== true) {
|
||||
if (child.id === checkNode.id) {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
if (child.payload !== undefined) {
|
||||
if (child.payload.referenceParent !== undefined) {
|
||||
if (child.payload.referenceParent.id === checkNode.id) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
let startingNodePropertyArray = startingNode[property.name]
|
||||
if (startingNodePropertyArray !== undefined) {
|
||||
for (let m = 0; m < startingNodePropertyArray.length; m++) {
|
||||
let arrayItem = startingNodePropertyArray[m]
|
||||
if (checkReferenceParent !== true) {
|
||||
if (arrayItem.id === checkNode.id) {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
if (arrayItem.payload !== undefined) {
|
||||
if (arrayItem.payload.referenceParent !== undefined) {
|
||||
if (arrayItem.payload.referenceParent.id === checkNode.id) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user