Refactoring from Running to Default
This commit is contained in:
1 parent
d19261e5de
commit
22c8c328fa
5 files changed
+17
-17
No files matched your search
@@ -18,11 +18,11 @@ function newStrategyPart () {
|
||||
partTitle: undefined,
|
||||
circularProgressBar: undefined,
|
||||
isExecuting: undefined,
|
||||
isRunning: undefined,
|
||||
run: run,
|
||||
isDefault: undefined,
|
||||
setAsDefault: setAsDefault,
|
||||
play: play,
|
||||
stop: stop,
|
||||
setRunningStatus: setRunningStatus,
|
||||
setDefaultStatus: setDefaultStatus,
|
||||
setNotRunningStatus: setNotRunningStatus,
|
||||
getReadyToAttach: getReadyToAttach,
|
||||
showAvailabilityToAttach: showAvailabilityToAttach,
|
||||
@@ -549,20 +549,20 @@ function newStrategyPart () {
|
||||
}
|
||||
}
|
||||
|
||||
function run () {
|
||||
setRunningStatus()
|
||||
function setAsDefault () {
|
||||
setDefaultStatus()
|
||||
canvas.cockpitSpace.restartSimulation.restart()
|
||||
}
|
||||
|
||||
function setRunningStatus () {
|
||||
function setDefaultStatus () {
|
||||
canvas.strategySpace.workspace.definition = thisObject.payload.node
|
||||
thisObject.isRunning = true
|
||||
thisObject.isDefault = true
|
||||
runningCounter = 30
|
||||
}
|
||||
|
||||
function setNotRunningStatus () {
|
||||
canvas.strategySpace.workspace.definition = undefined
|
||||
thisObject.isRunning = false
|
||||
thisObject.isDefault = false
|
||||
}
|
||||
|
||||
function iconPhysics () {
|
||||
@@ -939,7 +939,7 @@ function newStrategyPart () {
|
||||
|
||||
browserCanvasContext.fill()
|
||||
|
||||
if (thisObject.isRunning === true) {
|
||||
if (thisObject.isDefault === true) {
|
||||
VISIBLE_RADIUS = thisObject.container.frame.radius * 2
|
||||
let OPACITY = runningCounter / 30
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ function newStrategyPartConstructor () {
|
||||
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.setRunningStatus()
|
||||
if (payload.node.savedPayload.uiObject.isDefault === true) {
|
||||
strategyPart.setDefaultStatus()
|
||||
canvas.strategySpace.workspace.definition = payload.node
|
||||
}
|
||||
}
|
||||
@@ -217,9 +217,9 @@ function newStrategyPartConstructor () {
|
||||
addLeftIcons(menuItemsInitialValues, floatingObject)
|
||||
menuItemsInitialValues.push(
|
||||
{
|
||||
action: 'Run Definition',
|
||||
actionFunction: payload.uiObject.run,
|
||||
label: 'Run',
|
||||
action: 'Set as Default',
|
||||
actionFunction: payload.uiObject.setAsDefault,
|
||||
label: 'Set as Default',
|
||||
visible: false,
|
||||
iconPathOn: 'paper-plane',
|
||||
iconPathOff: 'paper-plane',
|
||||
|
||||
@@ -213,7 +213,7 @@ function newNodeDeleter () {
|
||||
if (counter <= 1) { return }
|
||||
}
|
||||
|
||||
if (node.payload.uiObject.isRunning === true) {
|
||||
if (node.payload.uiObject.isDefault === true) {
|
||||
node.payload.uiObject.setNotRunningStatus()
|
||||
}
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ function newStringifyNode () {
|
||||
isTensed: (node.payload.floatingObject.isTensed && node.payload.floatingObject.tensedManually)
|
||||
},
|
||||
uiObject: {
|
||||
isRunning: node.payload.uiObject.isRunning
|
||||
isDefault: node.payload.uiObject.isDefault
|
||||
}
|
||||
}
|
||||
return savedPayload
|
||||
|
||||
@@ -93,7 +93,7 @@ function newWorkspace () {
|
||||
thisObject.definition = canvas.strategySpace.strategizerGateway.strategizerData
|
||||
workspaceNode.rootNodes.push(thisObject.definition)
|
||||
functionLibraryPartsFromNodes.createPartFromNode(thisObject.definition, undefined, undefined)
|
||||
thisObject.definition.payload.uiObject.setRunningStatus()
|
||||
thisObject.definition.payload.uiObject.setDefaultStatus()
|
||||
thisObject.enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user