X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FGUI.fs;h=a71aa96e068d0379a09ff3992bac29d6ad6baeef;hp=921654a953e66f9d784420394a53120aad58f9e0;hb=074d6b0377f51e868deb1c427891c722d0270deb;hpb=6c70577f0bcc17881c753f7a527d2ff4672bb6aa diff --git a/Parasitemia/ParasitemiaUI/GUI.fs b/Parasitemia/ParasitemiaUI/GUI.fs index 921654a..a71aa96 100644 --- a/Parasitemia/ParasitemiaUI/GUI.fs +++ b/Parasitemia/ParasitemiaUI/GUI.fs @@ -60,7 +60,10 @@ let run (defaultConfig: Config) (fileToOpen: string option) = let scrollRBC: ScrollViewer = ctrl "scrollRBC" let stackRBC: StackPanel = ctrl "stackRBC" + let imgLogos: Border = ctrl "imgLogos" + // Initializations. + let canvasCurrentImageColor = canvasCurrentImage.Background menuHightlightRBC.IsChecked <- displayHealthy // Utils. @@ -126,10 +129,12 @@ let run (defaultConfig: Config) (fileToOpen: string option) = sprintf "%.1f %% (%d / %d)" percent nb nbTotal let updateCurrentImageInformation () = + txtImageInformation1.Inlines.Clear() + txtImageInformation2.Inlines.Clear() + match state.CurrentImage with | Some srcImg -> let parasitemiaStr = percentText (state.ImageParasitemia srcImg) - txtImageInformation1.Inlines.Clear() txtImageInformation1.Inlines.Add(Documents.Run("Parasitemia: ", FontWeight = FontWeights.Bold)) txtImageInformation1.Inlines.Add(parasitemiaStr) txtImageInformation1.Inlines.Add(Documents.LineBreak()) @@ -137,7 +142,6 @@ let run (defaultConfig: Config) (fileToOpen: string option) = txtImageInformation1.Inlines.Add(Documents.Run("Last analysis: ", FontWeight = FontWeights.Bold)) txtImageInformation1.Inlines.Add(Documents.Run(if srcImg.dateLastAnalysis.Ticks = 0L then "" else srcImg.dateLastAnalysis.ToLocalTime().ToString())) - txtImageInformation2.Inlines.Clear() let alteredStr = percentText (state.ImageNbAltered srcImg) txtImageInformation2.Inlines.Add(Documents.Run("Number of erytrocytes manually altered: ", FontWeight = FontWeights.Bold)) txtImageInformation2.Inlines.Add(Documents.Run(alteredStr)) @@ -310,6 +314,8 @@ let run (defaultConfig: Config) (fileToOpen: string option) = let updateCurrentImage () = match state.CurrentImage with | Some srcImg -> + imgLogos.Visibility <- Visibility.Collapsed + // Highlight the preview. stackPreviews.Children |> Seq.cast @@ -321,11 +327,13 @@ let run (defaultConfig: Config) (fileToOpen: string option) = updateRBCFramesCurrent () updateRBCFramesPreview () - updateCurrentImageInformation () | None -> + imgLogos.Visibility <- Visibility.Visible stackRBC.Children.Clear() canvasCurrentImage.Children.Clear() - canvasCurrentImage.Background <- Brushes.Black + canvasCurrentImage.Background <- canvasCurrentImageColor + + updateCurrentImageInformation () let setCurrentImage (srcImg: SourceImage) = if state.CurrentImage.IsNone || state.CurrentImage.Value <> srcImg