ADD|MODIFY Many Functionalities to portfolio-management to get us to step 4
This commit is contained in:
1 parent
67fccaae2d
commit
66f422bf68
33 files changed
+30600
-6909
No files matched your search
@@ -5,7 +5,8 @@ exports.newVisualScriptingUtilitiesNodeFunctions = function () {
|
||||
findNodeInNodeMesh: findNodeInNodeMesh,
|
||||
nodeMeshToPathArray: nodeMeshToPathArray,
|
||||
findNodeInNodeArray: findNodeInNodeArray,
|
||||
filterOutNodeWihtoutReferenceParentFromNodeArray: filterOutNodeWihtoutReferenceParentFromNodeArray
|
||||
filterOutNodeWihtoutReferenceParentFromNodeArray: filterOutNodeWihtoutReferenceParentFromNodeArray,
|
||||
getManagedSessions: getManagedSessions
|
||||
}
|
||||
|
||||
return thisObject
|
||||
@@ -51,6 +52,47 @@ exports.newVisualScriptingUtilitiesNodeFunctions = function () {
|
||||
}
|
||||
}
|
||||
|
||||
/* findManagedSessions(startingNode) :
|
||||
* recursively searches startingNode branches to documents managed sessions at ~/taskConstants.MANAGED_SESSIONS_MAP
|
||||
* Session Key naming convention: name + type + id
|
||||
*/
|
||||
function getManagedSessions(startingNode) {
|
||||
if (startingNode == undefined) { return ; }
|
||||
let schemaDocument = SA.projects.foundations.globals.schemas.APP_SCHEMA_MAP.get(startingNode.project + '-' + startingNode.type);
|
||||
|
||||
// Base Cases:
|
||||
if (schemaDocument == undefined) { return; }
|
||||
if (startingNode.type === 'Session Reference' &&
|
||||
startingNode.referenceParent != undefined) {
|
||||
let key = startingNode.referenceParent.name + '-' +
|
||||
startingNode.referenceParent.type + '-' + startingNode.referenceParent.id;
|
||||
let communicationModule = TS.projects.portfolioManagement.botModules.PMCommunicationModule_Portfolio.newPMCommunicationModule_Portfolio(key);
|
||||
TS.projects.foundations.globals.taskConstants.MANAGED_SESSIONS_MAP.set(key, communicationModule);
|
||||
return;
|
||||
}
|
||||
|
||||
if (schemaDocument.childrenNodesProperties == undefined) { return; }
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let child = schemaDocument.childrenNodesProperties[i];
|
||||
|
||||
switch (child.type) {
|
||||
case 'node':
|
||||
getManagedSessions(startingNode[child.name]);
|
||||
break;
|
||||
case 'array':
|
||||
let startingNodePropertyArray = startingNode[child.name];
|
||||
if (startingNodePropertyArray != undefined) {
|
||||
for (let j = 0; j < startingNodePropertyArray.length; j++) {
|
||||
getManagedSessions(startingNodePropertyArray[j]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function findNodeInNodeMesh (node, nodeType) {
|
||||
/*
|
||||
This function scans a node mesh for a certain node type and
|
||||
|
||||
@@ -43,19 +43,19 @@ function newVisualScriptingActionSwitch() {
|
||||
}
|
||||
|
||||
case 'Syncronize Tasks': {
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.syncronizeTasksFoundAtWorkspaceWithBackEnd()
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.synchronizeTasksFoundAtWorkspaceWithBackEnd()
|
||||
}
|
||||
break
|
||||
case 'Syncronize Trading Sessions': {
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.syncronizeTradingSessionsFoundAtWorkspaceWithBackEnd()
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.synchronizeTradingSessionsFoundAtWorkspaceWithBackEnd()
|
||||
}
|
||||
break
|
||||
case 'Syncronize Portfolio Sessions': {
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.syncronizePortfolioSessionsFoundAtWorkspaceWithBackEnd()
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.synchronizePortfolioSessionsFoundAtWorkspaceWithBackEnd()
|
||||
}
|
||||
break
|
||||
case 'Syncronize Learning Sessions': {
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd()
|
||||
UI.projects.visualScripting.functionLibraries.uiObjectsFromNodes.synchronizeLearningSessionsFoundAtWorkspaceWithBackEnd()
|
||||
}
|
||||
break
|
||||
case 'Play Tutorials': {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
|
||||
let thisObject = {
|
||||
syncronizeTasksFoundAtWorkspaceWithBackEnd: syncronizeTasksFoundAtWorkspaceWithBackEnd,
|
||||
syncronizeTradingSessionsFoundAtWorkspaceWithBackEnd: syncronizeTradingSessionsFoundAtWorkspaceWithBackEnd,
|
||||
syncronizePortfolioSessionsFoundAtWorkspaceWithBackEnd: syncronizePortfolioSessionsFoundAtWorkspaceWithBackEnd,
|
||||
syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd: syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd,
|
||||
synchronizeTasksFoundAtWorkspaceWithBackEnd: synchronizeTasksFoundAtWorkspaceWithBackEnd,
|
||||
synchronizeTradingSessionsFoundAtWorkspaceWithBackEnd: synchronizeTradingSessionsFoundAtWorkspaceWithBackEnd,
|
||||
synchronizePortfolioSessionsFoundAtWorkspaceWithBackEnd: synchronizePortfolioSessionsFoundAtWorkspaceWithBackEnd,
|
||||
synchronizeLearningSessionsFoundAtWorkspaceWithBackEnd: synchronizeLearningSessionsFoundAtWorkspaceWithBackEnd,
|
||||
playTutorials: playTutorials,
|
||||
recreateWorkspace: recreateWorkspace,
|
||||
getNodeById: getNodeById,
|
||||
@@ -277,34 +277,34 @@ function newVisualScritingFunctionLibraryUiObjectsFromNodes() {
|
||||
}
|
||||
}
|
||||
|
||||
function syncronizeTasksFoundAtWorkspaceWithBackEnd() {
|
||||
function synchronizeTasksFoundAtWorkspaceWithBackEnd() {
|
||||
for (let i = 0; i < tasksFoundAtWorkspace.length; i++) {
|
||||
let node = tasksFoundAtWorkspace[i]
|
||||
UI.projects.foundations.functionLibraries.taskFunctions.syncronizeTaskWithBackEnd(node)
|
||||
UI.projects.foundations.functionLibraries.taskFunctions.synchronizeTaskWithBackEnd(node)
|
||||
}
|
||||
tasksFoundAtWorkspace = undefined
|
||||
}
|
||||
|
||||
function syncronizeTradingSessionsFoundAtWorkspaceWithBackEnd() {
|
||||
function synchronizeTradingSessionsFoundAtWorkspaceWithBackEnd() {
|
||||
for (let i = 0; i < tradingSessionsFoundAtWorkspace.length; i++) {
|
||||
let node = tradingSessionsFoundAtWorkspace[i]
|
||||
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.syncronizeSessionWithBackEnd(node)
|
||||
UI.projects.algorithmicTrading.functionLibraries.tradingSessionFunctions.synchronizeSessionWithBackEnd(node)
|
||||
}
|
||||
tradingSessionsFoundAtWorkspace = undefined
|
||||
}
|
||||
|
||||
function syncronizePortfolioSessionsFoundAtWorkspaceWithBackEnd() {
|
||||
function synchronizePortfolioSessionsFoundAtWorkspaceWithBackEnd() {
|
||||
for (let i = 0; i < portfolioSessionsFoundAtWorkspace.length; i++) {
|
||||
let node = portfolioSessionsFoundAtWorkspace[i]
|
||||
UI.projects.portfolioManagement.functionLibraries.portfolioSessionFunctions.syncronizeSessionWithBackEnd(node)
|
||||
UI.projects.portfolioManagement.functionLibraries.portfolioSessionFunctions.synchronizeSessionWithBackEnd(node)
|
||||
}
|
||||
portfolioSessionsFoundAtWorkspace = undefined
|
||||
}
|
||||
|
||||
function syncronizeLearningSessionsFoundAtWorkspaceWithBackEnd() {
|
||||
function synchronizeLearningSessionsFoundAtWorkspaceWithBackEnd() {
|
||||
for (let i = 0; i < learningSessionsFoundAtWorkspace.length; i++) {
|
||||
let node = learningSessionsFoundAtWorkspace[i]
|
||||
UI.projects.machineLearning.functionLibraries.learningSessionFunctions.syncronizeSessionWithBackEnd(node)
|
||||
UI.projects.machineLearning.functionLibraries.learningSessionFunctions.synchronizeSessionWithBackEnd(node)
|
||||
}
|
||||
learningSessionsFoundAtWorkspace = undefined
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user