Luis Fernando Molina committed 2020-05-18 17:41:15 +02:00
1 parent 1326a9ae8c
commit 3cb16b4e62
3 files changed
+21 -15

No files matched your search

@@ -1,5 +1,7 @@
function newUiObjectsFromNodes () {
thisObject = {
runTasks: runTasks,
runSessions: runSessions,
recreateWorkspace: recreateWorkspace,
tryToConnectChildrenWithReferenceParents: tryToConnectChildrenWithReferenceParents,
createUiObjectFromNode: createUiObjectFromNode,
@@ -14,7 +16,7 @@ function newUiObjectsFromNodes () {
return thisObject
function recreateWorkspace (node, replacingCurrentWorkspace, callBackFunction) {
function recreateWorkspace (node, callBackFunction) {
mapOfNodes = new Map()
tasksToRun = []
sessionsToRun = []
@@ -135,17 +137,6 @@ function newUiObjectsFromNodes () {
tryToConnectChildrenWithReferenceParents()
if (replacingCurrentWorkspace === true) {
// We need to wait all tasks that were potentially running to stop
setTimeout(runTasks, 70000)
// We give a few seconds for the tasks to start
setTimeout(runSessions, 80000)
} else {
runTasks()
// We give a few seconds for the tasks to start
setTimeout(runSessions, 10000)
}
if (callBackFunction !== undefined) {
callBackFunction() // The recreation of the workspace is complete
}
+17 -2
View File
@@ -107,11 +107,12 @@ function newWorkspace () {
}
function recreateWorkspace () {
functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode, false, finishInitialization)
functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode, finishInitialization)
}
function finishInitialization () {
setupEventsServerClients()
runTasksAndSessions(false)
thisObject.enabled = true
canvas.cockpitSpace.initializePosition()
canvas.splashScreen.initialize()
@@ -122,6 +123,19 @@ function newWorkspace () {
}
}
function runTasksAndSessions (replacingCurrentWorkspace) {
if (replacingCurrentWorkspace === true) {
// We need to wait all tasks that were potentially running to stop
setTimeout(functionLibraryUiObjectsFromNodes.runTasks, 70000)
// We give a few seconds for the tasks to start
setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 80000)
} else {
functionLibraryUiObjectsFromNodes.runTasks()
// We give a few seconds for the tasks to start
setTimeout(functionLibraryUiObjectsFromNodes.runSessions, 10000)
}
}
function setupEventsServerClients () {
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
let rootNode = thisObject.workspaceNode.rootNodes[i]
@@ -244,8 +258,9 @@ function newWorkspace () {
workingAtTask++
break
case 4:
functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode, true)
functionLibraryUiObjectsFromNodes.recreateWorkspace(thisObject.workspaceNode)
setupEventsServerClients()
runTasksAndSessions(true)
workingAtTask++
break
case 5:
+1 -1
View File
@@ -154,7 +154,7 @@ function newPlotterPanel () {
if (panelData.code.valueDecimals !== undefined) {
if (value !== undefined) {
if (isNaN(value) === false) {
value = value.toFixed(panelData.code.valueDecimals)
value = dynamicDecimals(value, panelData.code.valueDecimals)
}
}
}