Commit d40dac1e authored by Mart Lubbers's avatar Mart Lubbers

replace UI for instant tasks to NoChange

parent df85b918
Pipeline #29684 passed with stage
in 4 minutes and 34 seconds
...@@ -118,7 +118,7 @@ where ...@@ -118,7 +118,7 @@ where
eval DestroyEvent _ iworld = (DestroyedResult, iworld) eval DestroyEvent _ iworld = (DestroyedResult, iworld)
eval event {taskId,lastEval} iworld eval event {taskId,lastEval} iworld
= case iworldfun taskId iworld of = case iworldfun taskId iworld of
(Ok a,iworld) = (ValueResult (Value a True) (mkTaskEvalInfo lastEval) (mkUIIfReset event (ui UIEmpty)) (treturn a), iworld) (Ok a,iworld) = (ValueResult (Value a True) (mkTaskEvalInfo lastEval) NoChange (treturn a), iworld)
(Error e, iworld) = (ExceptionResult e, iworld) (Error e, iworld) = (ExceptionResult e, iworld)
nopTask :: Task a nopTask :: Task a
...@@ -126,4 +126,4 @@ nopTask = Task eval ...@@ -126,4 +126,4 @@ nopTask = Task eval
where where
eval DestroyEvent _ iworld = (DestroyedResult, iworld) eval DestroyEvent _ iworld = (DestroyedResult, iworld)
eval event {lastEval} iworld eval event {lastEval} iworld
= (ValueResult NoValue (mkTaskEvalInfo lastEval) (mkUIIfReset event (ui UIEmpty)) (Task eval), iworld) = (ValueResult NoValue (mkTaskEvalInfo lastEval) NoChange (Task eval), iworld)
...@@ -670,7 +670,7 @@ where ...@@ -670,7 +670,7 @@ where
= (ValueResult = (ValueResult
(Value () True) (Value () True)
(mkTaskEvalInfo lastEval) (mkTaskEvalInfo lastEval)
(mkUIIfReset event (ui UIEmpty)) NoChange
(treturn ()), iworld) (treturn ()), iworld)
//Mark the task as removed, and update the indices of the tasks afterwards //Mark the task as removed, and update the indices of the tasks afterwards
# taskListFilter = {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=True,includeAttributes=True,includeProgress=True} # taskListFilter = {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=True,includeAttributes=True,includeProgress=True}
...@@ -680,9 +680,9 @@ where ...@@ -680,9 +680,9 @@ where
| taskNo == 0 //(if the taskNo equals zero the instance is embedded) | taskNo == 0 //(if the taskNo equals zero the instance is embedded)
# (mbe,iworld) = deleteTaskInstance instanceNo iworld # (mbe,iworld) = deleteTaskInstance instanceNo iworld
| mbe =: (Error _) = (ExceptionResult (fromError mbe),iworld) | mbe =: (Error _) = (ExceptionResult (fromError mbe),iworld)
= (ValueResult (Value () True) {lastEvent=lastEval,removedTasks=[]} (mkUIIfReset event (ui UIEmpty)) (treturn ()), iworld) = (ValueResult (Value () True) {lastEvent=lastEval,removedTasks=[]} NoChange (treturn ()), iworld)
//Pass removal information up //Pass removal information up
= (ValueResult (Value () True) {lastEvent=lastEval,removedTasks=[(listId,removeId)]} (mkUIIfReset event (ui UIEmpty)) (treturn ()), iworld) = (ValueResult (Value () True) {lastEvent=lastEval,removedTasks=[(listId,removeId)]} NoChange (treturn ()), iworld)
//When a task is marked as removed, the index of the tasks after that are decreased //When a task is marked as removed, the index of the tasks after that are decreased
markAsRemoved removeId [] = [] markAsRemoved removeId [] = []
...@@ -703,14 +703,14 @@ where ...@@ -703,14 +703,14 @@ where
| listId == TaskId 0 0 | listId == TaskId 0 0
= case replaceTaskInstance instanceNo (parTask topLevelTaskList) iworld of = case replaceTaskInstance instanceNo (parTask topLevelTaskList) iworld of
(Ok (), iworld) (Ok (), iworld)
= (ValueResult (Value () True) (mkTaskEvalInfo lastEval) (mkUIIfReset event (ui UIEmpty)) (treturn ()), iworld) = (ValueResult (Value () True) (mkTaskEvalInfo lastEval) NoChange (treturn ()), iworld)
(Error e, iworld) (Error e, iworld)
= (ExceptionResult e,iworld) = (ExceptionResult e,iworld)
//If it is a detached task, replacee the detached instance, if it is embedded schedule the change in the parallel task state //If it is a detached task, replacee the detached instance, if it is embedded schedule the change in the parallel task state
| taskNo == 0 //(if the taskNo equals zero the instance is embedded) | taskNo == 0 //(if the taskNo equals zero the instance is embedded)
= case replaceTaskInstance instanceNo (parTask topLevelTaskList) iworld of = case replaceTaskInstance instanceNo (parTask topLevelTaskList) iworld of
(Ok (), iworld) (Ok (), iworld)
= (ValueResult (Value () True) (mkTaskEvalInfo lastEval) (mkUIIfReset event (ui UIEmpty)) (treturn ()), iworld) = (ValueResult (Value () True) (mkTaskEvalInfo lastEval) NoChange (treturn ()), iworld)
(Error e, iworld) (Error e, iworld)
= (ExceptionResult e,iworld) = (ExceptionResult e,iworld)
//Schedule the change in the parallel task state //Schedule the change in the parallel task state
...@@ -718,7 +718,7 @@ where ...@@ -718,7 +718,7 @@ where
# taskListFilter = {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=True,includeAttributes=True,includeProgress=True} # taskListFilter = {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=True,includeAttributes=True,includeProgress=True}
# (mbError,iworld) = modify (scheduleReplacement replaceId task) (sdsFocus (listId,taskListFilter) taskInstanceParallelTaskList) EmptyContext iworld # (mbError,iworld) = modify (scheduleReplacement replaceId task) (sdsFocus (listId,taskListFilter) taskInstanceParallelTaskList) EmptyContext iworld
| mbError =:(Error _) = (ExceptionResult (fromError mbError),iworld) | mbError =:(Error _) = (ExceptionResult (fromError mbError),iworld)
= (ValueResult (Value () True) (mkTaskEvalInfo lastEval) (mkUIIfReset event (ui UIEmpty)) (treturn ()), iworld) = (ValueResult (Value () True) (mkTaskEvalInfo lastEval) NoChange (treturn ()), iworld)
scheduleReplacement replaceId task [] = [] scheduleReplacement replaceId task [] = []
scheduleReplacement replaceId task [s=:{ParallelTaskState|taskId}:ss] scheduleReplacement replaceId task [s=:{ParallelTaskState|taskId}:ss]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment