1da2dea3e13ef8341b9a5c518f4c737d2059eb55
[master-thesis.git] / Parasitemia / ParasitemiaUI / Types.fs
1 module ParasitemiaUI.Types
2
3 open System.Windows
4
5 open Newtonsoft.Json
6
7 open ParasitemiaCore.UnitsOfMeasure
8
9 type RBC =
10 {
11 num : int
12
13 [<JsonIgnore>]
14 mutable infected : bool
15
16 [<JsonIgnore>]
17 mutable setManually : bool
18
19 center : Point
20 size : Size
21 infectedArea : int
22 }
23
24 type PredefinedPPI =
25 {
26 ppi : int<ppi>
27 label : string
28 }
29 with
30 override this.ToString () =
31 sprintf "%s: %d" this.label this.ppi
32
33 type SensorSize =
34 {
35 w : float<mm>
36 h : float<mm>
37 label : string
38 }
39 with
40 override this.ToString () =
41 sprintf "%g mm × %g mm%s" this.w this.h (if this.label = "" then "" else " (" + this.label + ")")
42
43 let defaultPredefinedPPI =
44 [
45 { ppi = 230000<ppi>; label = "50×" }
46 { ppi = 460000<ppi>; label = "100×" }
47 ]
48
49 let defaultSensorSizes =
50 [
51 { w = 3.2<mm>; h = 2.4<mm>; label = "1/4″" }
52 { w = 4.8<mm>; h = 3.6<mm>; label = "1/3″" }
53 { w = 5.76<mm>; h = 4.29<mm>; label = "1/2.5″" }
54 { w = 6.4<mm>; h = 4.8<mm>; label = "1/2″" }
55 { w = 7.18<mm>; h = 5.32<mm>; label = "1/1.8″" }
56 { w = 7.6<mm>; h = 5.7<mm>; label = "1/1.7″" }
57 { w = 8.8<mm>; h = 6.6<mm>; label = "2/3″" }
58 { w = 13.2<mm>; h = 8.8<mm>; label = "1″" }
59 ]