X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FAnalysis.fs;fp=Parasitemia%2FParasitemiaUI%2FAnalysis.fs;h=2ff0b1e31c1612430a6e7d2485639c3f1208ef9b;hp=5bb35008eb987d33242821858dad513b29cc5006;hb=85adb74195fe7145535d3d36263aec2f7879cd60;hpb=d3fdf4bce5aa39363998276346bca7445b0a351d diff --git a/Parasitemia/ParasitemiaUI/Analysis.fs b/Parasitemia/ParasitemiaUI/Analysis.fs index 5bb3500..2ff0b1e 100644 --- a/Parasitemia/ParasitemiaUI/Analysis.fs +++ b/Parasitemia/ParasitemiaUI/Analysis.fs @@ -128,17 +128,18 @@ let showWindow (parent: Window) (state: State.State) : bool = | Some results -> for id, cells in results do state.SetResult (int id) cells - - win.Root.Dispatcher.Invoke(fun () -> - win.stackSourceImagesSelection.IsEnabled <- true - win.butStart.IsEnabled <- true - win.butClose.Content <- "Close" - updateSourceImages ()) - Logger.Log.User("All analyses terminated successfully") atLeastOneAnalysisPerformed <- true analysisPerformed <- true - | None -> ()) + | None -> + Logger.Log.User("Analysis aborted") + + win.Root.Dispatcher.Invoke(fun () -> + win.progress.Value <- if maybeResults.IsSome then 100. else 0. + win.stackSourceImagesSelection.IsEnabled <- true + win.butStart.IsEnabled <- true + win.butClose.Content <- "Close" + updateSourceImages ())) } |> Async.Start | _ -> ()) @@ -151,5 +152,6 @@ let showWindow (parent: Window) (state: State.State) : bool = lock monitor (fun () -> if not analysisPerformed then + // To cancel the current analysis if one is running on the next call to the progress function. analysisCancelled <- true atLeastOneAnalysisPerformed)