Remove useless 'yield'
[master-thesis.git] / Parasitemia / ParasitemiaUI / Analysis.fs
index 4fa5290..9a6047e 100644 (file)
@@ -57,7 +57,7 @@ let showWindow (parent : Window) (state : State.State) : bool =
             let imageSourceSelection = Views.ImageSourceSelection (Tag = srcImg, Margin = Thickness 3.)
             imageSourceSelection.Tag <- srcImg
 
-            imageSourceSelection.txtImageNumber.Text <- string srcImg.Num
+            imageSourceSelection.txtImageNumber.Text <- string srcImg.RomanNum
             let height = srcImg.Img.Height * width / srcImg.Img.Width
             imageSourceSelection.imagePreview.Source <- BitmapSourceConvert.ToBitmapSource (srcImg.Img.Resize (width, height, Emgu.CV.CvEnum.Inter.Cubic))
             imageSourceSelection.chkSelection.IsChecked <- Nullable<bool> (srcImg.DateLastAnalysis.Ticks = 0L)
@@ -103,10 +103,10 @@ let showWindow (parent : Window) (state : State.State) : bool =
                     let isChecked = srcImgCtrl.chkSelection.IsChecked
                     match parseAndValidatePPI srcImgCtrl.txtResolution.Text with
                         | Some resolution ->
-                            yield Some (srcImg, isChecked.HasValue && isChecked.Value, { srcImg.Config.Parameters with resolution = resolution * 1.<ppi> })
+                            Some (srcImg, isChecked.HasValue && isChecked.Value, { srcImg.Config.Parameters with resolution = resolution * 1.<ppi> })
                         | None ->
                             MessageBox.Show (sprintf "No resolution defined for the image number %d" srcImg.Num, "No resolution defined", MessageBoxButton.OK, MessageBoxImage.Information) |> ignore
-                            yield None
+                            None
             } |> Seq.takeWhile (fun e -> e.IsSome) |> Seq.map (fun e -> e.Value) |> List.ofSeq
 
         if parameters.Count () <> sourceImagesControls.Count () then
@@ -125,7 +125,7 @@ let showWindow (parent : Window) (state : State.State) : bool =
                         for srcImg, selected, parameters in imagesParameters do
                             srcImg.Config.Parameters <- parameters // Save parameters.
                             if selected then
-                                yield string srcImg.Num, srcImg.Config, srcImg.Img
+                                string srcImg.RomanNum, srcImg.Config, srcImg.Img
                     ]
 
                 if imagesToProcess.IsEmpty then
@@ -134,6 +134,7 @@ let showWindow (parent : Window) (state : State.State) : bool =
                     win.stackSourceImagesSelection.IsEnabled <- false
                     analysisPerformed <- false
                     win.butStart.IsEnabled <- false
+                    win.textLog.Text <- ""
                     win.butClose.Content <- "Abort"
 
                     async {
@@ -147,7 +148,7 @@ let showWindow (parent : Window) (state : State.State) : bool =
                                 match maybeResults with
                                 | Some results ->
                                     for id, cells in results do
-                                        state.SetResult (int id) cells
+                                        state.SetResult id cells
                                     Logger.Log.Info "All analyses terminated successfully"
                                     atLeastOneAnalysisPerformed <- true
                                     analysisPerformed <- true