Status Report and Execution Finished Event Implementation part 1

This commit is contained in:
Luis Fernando Molina committed 2019-11-01 11:31:47 +01:00
1 parent 64b238af43
commit 4f9c4bd403
11 files changed
+273

No files matched your search

@@ -61,6 +61,16 @@ function newChainAttachDetach () {
completeDetachment(node, rootNodes)
return
}
case 'Status Report': {
node.payload.parentNode.calculations = undefined
completeDetachment(node, rootNodes)
return
}
case 'Execution Finished Event': {
node.payload.parentNode.calculations = undefined
completeDetachment(node, rootNodes)
return
}
case 'Calculations Procedure': {
node.payload.parentNode.calculations = undefined
completeDetachment(node, rootNodes)
@@ -557,6 +567,20 @@ function newChainAttachDetach () {
completeAttachment(node, rootNodes)
}
break
case 'Status Report': {
node.payload.parentNode = attachToNode
node.payload.chainParent = attachToNode
node.payload.parentNode.calculations = node
completeAttachment(node, rootNodes)
}
break
case 'Execution Finished Event': {
node.payload.parentNode = attachToNode
node.payload.chainParent = attachToNode
node.payload.parentNode.calculations = node
completeAttachment(node, rootNodes)
}
break
case 'Calculations Procedure': {
node.payload.parentNode = attachToNode
node.payload.chainParent = attachToNode
@@ -29,6 +29,12 @@ function newNodeChildren () {
case 'Process Definition': {
return countChildrenProcessDefinition(parentNode, childNode)
}
case 'Status Rerport': {
return countChildrenStatusRerport(parentNode, childNode)
}
case 'Execution Finished Event': {
return countChildrenExecutionFinishedEvent(parentNode, childNode)
}
case 'Calculations Procedure': {
return countChildrenCalculationsProcedure(parentNode, childNode)
}
@@ -428,6 +434,21 @@ function newNodeChildren () {
return response
}
function countChildrenStatusRerport (parentNode, childNode) {
let response = {
childrenCount: 0,
childIndex: undefined
}
return response
}
function countChildrenExecutionFinishedEvent (parentNode, childNode) {
let response = {
childrenCount: 0,
childIndex: undefined
}
return response
}
function countChildrenCalculationsProcedure (parentNode, childNode) {
let response = {
childrenCount: 0,
@@ -8,6 +8,8 @@ function newNodeDeleter () {
deleteIndicatorBot: deleteIndicatorBot,
deleteTradingBot: deleteTradingBot,
deleteProcessDefinition: deleteProcessDefinition,
deleteStatusReport: deleteStatusReport,
deleteExecutionFinishedEvent: deleteExecutionFinishedEvent,
deleteCalculationsProcedure: deleteCalculationsProcedure,
deleteDataBuildingProcedure: deleteDataBuildingProcedure,
deleteProcedureInitialization: deleteProcedureInitialization,
@@ -112,6 +114,14 @@ function newNodeDeleter () {
deleteProcessDefinition(rootNode, rootNodes)
break
}
case 'Status Report': {
deleteStatusReport(rootNode, rootNodes)
break
}
case 'Execution Finished Event': {
deleteExecutionFinishedEvent(rootNode, rootNodes)
break
}
case 'Calculations Procedure': {
deleteCalculationsProcedure(rootNode, rootNodes)
break
@@ -582,6 +592,30 @@ function newNodeDeleter () {
cleanNode(node)
}
function deleteStatusReport (node, rootNodes) {
let payload = node.payload
if (payload.parentNode !== undefined) {
payload.parentNode.statusReport = undefined
}
completeDeletion(node, rootNodes)
destroyUiObject(node)
cleanNode(node)
}
function deleteExecutionFinishedEvent (node, rootNodes) {
let payload = node.payload
if (payload.parentNode !== undefined) {
payload.parentNode.executionFinishedEvent = undefined
}
completeDeletion(node, rootNodes)
destroyUiObject(node)
cleanNode(node)
}
function deleteCalculationsProcedure (node, rootNodes) {
let payload = node.payload
@@ -856,6 +856,20 @@ function newOnFocus () {
return
}
}
case 'Status Report': {
if (node.payload.uiObject.isOnFocus === true) {
return node
} else {
return
}
}
case 'Execution Finished Event': {
if (node.payload.uiObject.isOnFocus === true) {
return node
} else {
return
}
}
case 'Calculations Procedure': {
let child
child = getNodeThatIsOnFocus(node.initialization)
@@ -1209,6 +1209,34 @@ function newProtocolNode () {
}
return object
}
case 'Status Report': {
let object = {
type: node.type,
subType: node.subType,
name: node.name
}
if (includeIds) {
object.id = node.id
}
if (includePayload) {
object.savedPayload = getSavedPayload(node, includeReferences)
}
return object
}
case 'Execution Finished Event': {
let object = {
type: node.type,
subType: node.subType,
name: node.name
}
if (includeIds) {
object.id = node.id
}
if (includePayload) {
object.savedPayload = getSavedPayload(node, includeReferences)
}
return object
}
case 'Calculations Procedure': {
let object = {
type: node.type,
@@ -840,6 +840,20 @@ function newShortcutKeys () {
return
}
}
case 'Status Report': {
if (node.payload.uiObject.shortcutKey === searchingKey) {
return node
} else {
return
}
}
case 'Execution Finished Procedure': {
if (node.payload.uiObject.shortcutKey === searchingKey) {
return node
} else {
return
}
}
case 'Calculations Procedure': {
let child
child = getNodeByShortcutKey(node.initialization, searchingKey)
@@ -7,6 +7,8 @@ function newUiObjectsFromNodes () {
addIndicatorBot: addIndicatorBot,
addTradingBot: addTradingBot,
addProcessDefinition: addProcessDefinition,
addStatusReport: addStatusReport,
addExecutionFinishedEvent: addExecutionFinishedEvent,
addCalculationsProcedure: addCalculationsProcedure,
addDataBuildingProcedure: addDataBuildingProcedure,
addProcedureInitialization: addProcedureInitialization,
@@ -765,6 +767,14 @@ function newUiObjectsFromNodes () {
}
return
}
case 'Status Report': {
createUiObject(node.type, node.name, node, parentNode, chainParent, node.type)
return
}
case 'Execution Finished Event': {
createUiObject(node.type, node.name, node, parentNode, chainParent, node.type)
return
}
case 'Calculations Procedure': {
createUiObject(node.type, node.name, node, parentNode, chainParent, node.type)
if (node.initialization !== undefined) {
@@ -995,6 +1005,28 @@ function newUiObjectsFromNodes () {
return object
}
function addStatusReport (node) {
if (node.statusReport === undefined) {
node.statusReport = {
type: 'Status Report',
name: 'New Status Report'
}
createUiObject(node.calculations.type, node.calculations.name, node.calculations, node, node)
}
return node.calculations
}
function addExecutionFinishedEvent (node) {
if (node.executionFinishedEvent === undefined) {
node.executionFinishedEvent = {
type: 'Execution Finished Event',
name: 'New Execution Finished Event'
}
createUiObject(node.calculations.type, node.calculations.name, node.calculations, node, node)
}
return node.calculations
}
function addCalculationsProcedure (node) {
if (node.calculations === undefined) {
node.calculations = {
+18
View File
@@ -341,6 +341,16 @@ function newWorkspace () {
functionLibraryUiObjectsFromNodes.addProcessDefinition(payload.node)
}
break
case 'Add Status Report':
{
functionLibraryUiObjectsFromNodes.addStatusReport(payload.node)
}
break
case 'Add Execution Finished Event':
{
functionLibraryUiObjectsFromNodes.addExecutionFinishedEvent(payload.node)
}
break
case 'Add Calculations Procedure':
{
functionLibraryUiObjectsFromNodes.addCalculationsProcedure(payload.node)
@@ -616,6 +626,14 @@ function newWorkspace () {
functionLibraryNodeDeleter.deleteProcessDefinition(payload.node, thisObject.workspaceNode.rootNodes)
break
}
case 'Delete Status Report': {
functionLibraryNodeDeleter.deleteStatusReport(payload.node, thisObject.workspaceNode.rootNodes)
break
}
case 'Delete Execution Finished Event': {
functionLibraryNodeDeleter.deleteExecutionFinishedEvent(payload.node, thisObject.workspaceNode.rootNodes)
break
}
case 'Delete Calculations Procedure': {
functionLibraryNodeDeleter.deleteCalculationsProcedure(payload.node, thisObject.workspaceNode.rootNodes)
break
+10
View File
@@ -228,6 +228,14 @@ function newUiObject () {
compatibleType = '->' + 'Sensor Bot' + '->' + 'Indicator Bot' + '->' + 'Trading Bot' + '->'
compatibleSubType = undefined
break
case 'Status Report':
compatibleType = '->' + 'Process Definition' + '->'
compatibleSubType = undefined
break
case 'Execution Finished Event':
compatibleType = '->' + 'Process Definition' + '->'
compatibleSubType = undefined
break
case 'Calculations Procedure':
compatibleType = '->' + 'Process Definition' + '->'
compatibleSubType = undefined
@@ -503,6 +511,8 @@ function newUiObject () {
let nearbyNode = floatingObject.payload.node
if (compatibleType.indexOf('->' + nearbyNode.type + '->') >= 0) {
/* Discard objects with busy coonection ports */
if (thisObject.payload.node.type === 'Status Report' && nearbyNode.statusReport !== undefined) { continue }
if (thisObject.payload.node.type === 'Execution Finished Event' && nearbyNode.executionFinishedEvent !== undefined) { continue }
if (thisObject.payload.node.type === 'Calculations Procedure' && nearbyNode.calculations !== undefined) { continue }
if (thisObject.payload.node.type === 'Data Building Procedure' && nearbyNode.dataBuilding !== undefined) { continue }
if (thisObject.payload.node.type === 'Procedure Initialization' && nearbyNode.initialization !== undefined) { continue }
+76
View File
@@ -764,6 +764,74 @@ function newUiObjectConstructor () {
)
break
}
case 'Status Report': {
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
{
action: 'Delete Status Report',
askConfirmation: true,
confirmationLabel: 'Confirm to Delete',
actionFunction: payload.onMenuItemClick,
label: 'Delete Status Report',
visible: true,
iconPathOn: 'delete',
iconPathOff: 'delete',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: -10
}
)
menuItemsInitialValues.push(
{
action: 'Share',
actionFunction: payload.onMenuItemClick,
label: 'Share',
visible: true,
iconPathOn: 'menu-share',
iconPathOff: 'menu-share',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 10
}
)
break
}
case 'Execution Finished Event': {
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
{
action: 'Delete Execution Finished Event',
askConfirmation: true,
confirmationLabel: 'Confirm to Delete',
actionFunction: payload.onMenuItemClick,
label: 'Delete Event',
visible: true,
iconPathOn: 'delete',
iconPathOff: 'delete',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: -10
}
)
menuItemsInitialValues.push(
{
action: 'Share',
actionFunction: payload.onMenuItemClick,
label: 'Share',
visible: true,
iconPathOn: 'menu-share',
iconPathOff: 'menu-share',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 10
}
)
break
}
case 'Calculations Procedure': {
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
@@ -4402,6 +4470,14 @@ function newUiObjectConstructor () {
level_0()
break
}
case 'Status Report': {
level_3()
break
}
case 'Execution Finished Event': {
level_3()
break
}
case 'Calculations Procedure': {
level_3()
break
+2
View File
@@ -95,6 +95,8 @@ function newDesignerSpace () {
['Indicator Bot', 'bot-indicator'],
['Trading Bot', 'bot-trading'],
['Process Definition', 'process-definition'],
['Status Report', 'text'],
['Execution Finished Event', 'pantone'],
['Calculations Procedure', 'calculations-procedure'],
['Data Building Procedure', 'data-building-procedure'],
['Procedure Initialization', 'procedure-initialization'],