Calling Restart Button from Run Menu Item done
This commit is contained in:
1 parent
07d2e6abbe
commit
efd529f696
4 files changed
+16
-4
No files matched your search
@@ -6,6 +6,7 @@ function newRestartSimulation () {
|
||||
visible: true,
|
||||
container: undefined,
|
||||
status: undefined,
|
||||
restart: restart,
|
||||
physics: physics,
|
||||
draw: draw,
|
||||
getContainer: getContainer,
|
||||
@@ -73,7 +74,11 @@ function newRestartSimulation () {
|
||||
isMouseOver = false
|
||||
}
|
||||
|
||||
async function onMouseClick (event) {
|
||||
function onMouseClick (event) {
|
||||
restart()
|
||||
}
|
||||
|
||||
async function restart () {
|
||||
let dateAtScreenCorner = new Date(window.localStorage.getItem('Date @ Screen Corner'))
|
||||
let currentTimePeriod = JSON.parse(window.localStorage.getItem('Current Time Period'))
|
||||
|
||||
|
||||
@@ -311,6 +311,7 @@ function newStrategyPart () {
|
||||
|
||||
function run () {
|
||||
canvas.strategySpace.workspace.tradingSystem = thisObject.payload.node
|
||||
canvas.cockpitSpace.restartSimulation.restart()
|
||||
thisObject.isRunning = true
|
||||
runningCounter = 30
|
||||
}
|
||||
@@ -668,4 +669,3 @@ function newStrategyPart () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ function newStrategyPartConstructor () {
|
||||
if (payload.node.savedPayload.floatingObject.isPinned === true) {
|
||||
floatingObject.pinToggle()
|
||||
}
|
||||
payload.node.savedPayload = undefined
|
||||
}
|
||||
|
||||
let strategyPart = newStrategyPart()
|
||||
@@ -55,6 +54,14 @@ function newStrategyPartConstructor () {
|
||||
strategyPart.initialize(payload, menuItemsInitialValues)
|
||||
strategyPart.container.connectToParent(floatingObject.container, false, false, true, true, false, false, true, true, true, true, true)
|
||||
|
||||
if (payload.node.savedPayload !== undefined) {
|
||||
if (payload.node.savedPayload.uiObject.isRunning === true) {
|
||||
strategyPart.isRunning = true
|
||||
canvas.strategySpace.workspace.tradingSystem = payload.node
|
||||
}
|
||||
}
|
||||
payload.node.savedPayload = undefined
|
||||
|
||||
setFloatingObjectBasicProperties(floatingObject, payload)
|
||||
|
||||
floatingLayer.addFloatingObject(floatingObject)
|
||||
|
||||
@@ -1094,7 +1094,7 @@ function newWorkspace () {
|
||||
isPinned: node.payload.floatingObject.isPinned
|
||||
},
|
||||
uiObject: {
|
||||
|
||||
isRunning: node.payload.uiObject.isRunning
|
||||
}
|
||||
}
|
||||
return savedPayload
|
||||
|
||||
Reference in new issue
Block a user