1
module ParasitemiaUI.Types
5 open System.Windows.Media
12 open ParasitemiaCore.UnitsOfMeasure
14 let healthyRBColor = Color.FromRgb(255uy, 255uy, 0uy) // Yellow-green.
15 let infectedRBColor = Color.FromRgb(255uy, 0uy, 40uy) // Red with a bit of blue.
21 mutable infected: bool
24 mutable setManually: bool
34 mutable config: ParasitemiaCore.Config.Config
35 mutable dateLastAnalysis: DateTime // UTC.
37 mutable rbcs: RBC list
39 mutable healthyRBCBrightness: float32
40 mutable infectedRBCBrightness: float32
} with
42 member this
.HealthyRBCColor: SolidColorBrush =
43 let mutable color = healthyRBColor * this
.healthyRBCBrightness
45 SolidColorBrush(color)
47 member this
.InfectedRBCColor: SolidColorBrush =
48 let mutable color = infectedRBColor * this
.infectedRBCBrightness
50 SolidColorBrush(color)
52 type PredefinedPPI = {
55 override this.ToString() =
56 sprintf
"%s: %d" this.label
this.ppi
62 override this.ToString () =
63 sprintf
"%g mm × %g mm%s" this.w
this.h
(if this.label
= "" then "" else " (" + this.label
+ ")")
65 let defaultPredefinedPPI = [
66 { ppi
= 230000<ppi
>; label
= "50×" }
67 { ppi
= 460000<ppi
>; label
= "100×" } ]
69 let defaultSensorSizes = [
70 { w
= 3.2<mm
>; h
= 2.4<mm
>; label
= "1/4″" }
71 { w
= 4.8<mm
>; h
= 3.6<mm
>; label
= "1/3″" }
72 { w
= 5.76<mm
>; h
= 4.29<mm
>; label
= "1/2.5″" }
73 { w
= 6.4<mm
>; h
= 4.8<mm
>; label
= "1/2″" }
74 { w
= 7.18<mm
>; h
= 5.32<mm
>; label
= "1/1.8″" }
75 { w
= 7.6<mm
>; h
= 5.7<mm
>; label
= "1/1.7″" }
76 { w
= 8.8<mm
>; h
= 6.6<mm
>; label
= "2/3″" }
77 { w
= 13.2<mm
>; h
= 8.8<mm
>; label
= "1″" } ]