then
MessageBox.Show("No image selected", "Cannot start analysis", MessageBoxButton.OK, MessageBoxImage.Information) |> ignore
else
+ stackSourceImagesSelection.IsEnabled <- false
analysisPerformed <- false
butStart.IsEnabled <- false
butClose.Content <- "Abort"
+
async {
- let results =
+ let maybeResults =
ParasitemiaCore.Analysis.doMultipleAnalysis
imagesToProcess
- (Some (fun progress -> window.Root.Dispatcher.Invoke(fun () -> progressBar.Value <- float progress)))
+ (Some (fun progress -> window.Root.Dispatcher.Invoke(fun () -> progressBar.Value <- float progress); not analysisCancelled))
lock monitor (
fun() ->
- if not analysisCancelled
- then
+ match maybeResults with
+ | Some results ->
for id, cells in results do
state.SetResult (int id) cells
window.Root.Dispatcher.Invoke(fun () ->
+ stackSourceImagesSelection.IsEnabled <- true
butStart.IsEnabled <- true
butClose.Content <- "Close"
updateSourceImages ())
Logger.Log.User("All analyses terminated successfully")
atLeastOneAnalysisPerformed <- true
- analysisPerformed <- true)
+ analysisPerformed <- true
+ | None -> ())
} |> Async.Start
| _ -> ())