Merge pull request #70 from AAMasters/develop

Bug Fixed deleting nodes
This commit is contained in:
benme authored and GitHub committed 2019-06-25 10:13:18 -03:00
commit 0b5d5934e8
3 files changed
+10 -2

No files matched your search

+2 -1
View File
@@ -125,12 +125,13 @@ function newRestartSimulation () {
}
function turnOffProductCards () {
let productCardsToTurnOff = ['Trading-Simulation', 'Simulation-Conditions', 'Simulation-Strategies', 'Simulation-Trades']
for (let i = 0; i < canvas.panelsSpace.panels.length; i++) {
let panel = canvas.panelsSpace.panels[i]
if (panel.name === 'Products Panel') {
for (j = 0; j < panel.productCards.length; j++) {
let productCard = panel.productCards[j]
if (productCard.product.relatedToTradingEngine === true && productCard.status !== PRODUCT_CARD_STATUS.OFF) {
if (productCard.product.codeName in (productCardsToTurnOff) && productCard.status !== PRODUCT_CARD_STATUS.OFF) {
productCard.turnOff()
productCardsToTurnOn.push(productCard)
}
+1 -1
View File
@@ -223,7 +223,7 @@ function newStrategyPartConstructor () {
{
action: 'Delete Parameters',
actionFunction: payload.onMenuItemClick,
label: 'Delete Trading System',
label: 'Delete Parameters',
visible: false,
iconPathOn: 'trash',
iconPathOff: 'trash',
@@ -44,6 +44,10 @@ function newNodeDeleter () {
deleteStrategy(node.strategies[0], rootNodes)
}
if (node.parameters !== undefined) {
deleteParameters(node.parameters, rootNodes)
}
completeDeletion(node, rootNodes)
destroyPart(node)
cleanNode(node)
@@ -121,6 +125,9 @@ function newNodeDeleter () {
if (node.takePosition !== undefined) {
deleteEvent(node.takePosition, rootNodes)
}
if (node.positionSize !== undefined) {
deletePositionSize(node.positionSize, rootNodes)
}
destroyPart(node)
cleanNode(node)
}