X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FDPICalculator.fs;h=c1187ec80ea4df343057066c1ca24de8facd7ba6;hb=9343c4deb0bf88c58d9c92d465d8e99f64656875;hp=dbd7251e5f50e37f751a542249569019c756de1f;hpb=23466ba92c5595f6c0b9f97c86a221a4e5ffebe9;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaUI/DPICalculator.fs b/Parasitemia/ParasitemiaUI/DPICalculator.fs index dbd7251..c1187ec 100644 --- a/Parasitemia/ParasitemiaUI/DPICalculator.fs +++ b/Parasitemia/ParasitemiaUI/DPICalculator.fs @@ -1,4 +1,4 @@ -module ParasitemiaUI.DPICalculator +module ParasitemiaUI.PPICalculator open System open System.Windows @@ -8,35 +8,18 @@ open System.Windows.Shapes open System.Windows.Controls open System.Diagnostics -open ParasitemiaCore.UnitsOfMeasure open ParasitemiaCore.Types +open ParasitemiaCore.UnitsOfMeasure -type SensorSize = { - w: float - h: float - txt: string } with - override this.ToString () = - sprintf "%g mm × %g mm%s" this.w this.h (if this.txt = "" then "" else " (" + this.txt + ")") +open Types let showWindow (parent: Window) : int option = - let win = Views.DPICalculatorWindow() + let win = Views.PPICalculatorWindow() win.Root.Owner <- parent win.Root.Left <- parent.Left + parent.ActualWidth / 2. - win.Root.Width / 2. win.Root.Top <- parent.Top + parent.ActualHeight / 2. - win.Root.Height / 2. - let sensorSizes = [ - { w = 5.76; h = 4.29; txt = "1/2.5″" } - { w = 7.6; h = 5.7; txt = "1/1.7″" } - { w = 8.6; h = 6.6; txt = "2/3″" } - { w = 13.2; h = 8.8; txt = "1″" } - { w = 17.3; h = 13.; txt = "" } - { w = 20.7; h = 13.8; txt = "" } - { w = 22.2; h = 14.8; txt = "" } - { w = 23.6; h = 15.7; txt = "" } - { w = 28.7; h = 19.; txt = "" } - { w = 28.7; h = 19.; txt = "" } ] - - for size in sensorSizes do + for size in Utils.sensorSizes do win.cmbSensorSize.Items.Add(size) |> ignore win.cmbSensorSize.SelectedIndex <- 0