Adding Formula Node to Announcement

This commit is contained in:
Luis Fernando Molina committed 2019-10-21 09:24:21 +02:00
1 parent f160f399e1
commit bc3d3983cc
8 files changed
+41 -5

No files matched your search

+1 -1
View File
@@ -389,7 +389,7 @@ function newStrategyPart () {
compatibleSubType = undefined
break
case 'Formula':
compatibleType = '->' + 'Position Size' + '->' + 'Position Rate' + '->' + 'Phase' + '->'
compatibleType = '->' + 'Position Size' + '->' + 'Position Rate' + '->' + 'Phase' + '->' + 'Announcement' + '->'
compatibleSubType = undefined
break
case 'Next Phase Event':
+17 -3
View File
@@ -508,6 +508,20 @@ function newStrategyPartConstructor () {
strategyPart.codeEditor.initialize()
strategyPart.codeEditor.container.connectToParent(strategyPart.container, false, false, true, true, false, false, false, false)
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
{
action: 'Add Formula',
actionFunction: payload.onMenuItemClick,
label: 'Add Formula',
visible: true,
relatedStrategyPart: 'Formula',
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: -60
}
)
addLeftIcons(menuItemsInitialValues, floatingObject)
menuItemsInitialValues.push(
{
action: 'Edit Announcement',
@@ -519,7 +533,7 @@ function newStrategyPartConstructor () {
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: -40,
angle: -20,
dontShowAtFullscreen: true
}
)
@@ -536,7 +550,7 @@ function newStrategyPartConstructor () {
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 0
angle: 20
}
)
menuItemsInitialValues.push(
@@ -550,7 +564,7 @@ function newStrategyPartConstructor () {
rawRadius: 8,
targetRadius: 0,
currentRadius: 0,
angle: 40
angle: 60
}
)
break
@@ -261,6 +261,12 @@ function newNodeChildren () {
childrenCount: 0,
childIndex: undefined
}
if (parentNode.formula !== undefined) {
response.childrenCount++
if (parentNode.formula.id === childNode.id) {
response.childIndex = response.childrenCount
}
}
return response
}
@@ -386,6 +386,9 @@ function newNodeDeleter () {
}
}
}
if (node.formula !== undefined) {
deleteFormula(node.formula, rootNodes)
}
completeDeletion(node, rootNodes)
destroyPart(node)
cleanNode(node)
@@ -483,6 +483,10 @@ function newOnFocus () {
}
}
case 'Announcement': {
child = getNodeThatIsOnFocus(node.formula)
if (child !== undefined) {
return child
}
if (node.payload.uiObject.isOnFocus === true) {
return node
} else {
@@ -426,6 +426,9 @@ function newPartsFromNodes () {
}
case 'Announcement': {
createPart('Announcement', node.name, node, parentNode, chainParent, 'Announcement')
if (node.formula !== undefined) {
createPartFromNode(node.formula, node, node)
}
return
}
case 'Layer Manager': {
@@ -677,7 +677,8 @@ function newProtocolNode () {
type: node.type,
subType: node.subType,
name: node.name,
code: node.code
code: node.code,
formula: getProtocolNode(node.formula, removePersonalData, parseCode, includeIds, includePayload)
}
if (includeIds) {
object.id = node.id
@@ -483,6 +483,11 @@ function newShortcutKeys () {
}
}
case 'Announcement': {
let child
child = getNodeByShortcutKey(node.formula, searchingKey)
if (child !== undefined) {
return child
}
if (node.payload.uiObject.shortcutKey === searchingKey) {
return node
} else {