projects
/
master-thesis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reduce a bit the thickness of selected RBC
[master-thesis.git]
/
Parasitemia
/
ParasitemiaUI
/
DPICalculator.fs
diff --git
a/Parasitemia/ParasitemiaUI/DPICalculator.fs
b/Parasitemia/ParasitemiaUI/DPICalculator.fs
index
c8d25c8
..
697bbef
100644
(file)
--- a/
Parasitemia/ParasitemiaUI/DPICalculator.fs
+++ b/
Parasitemia/ParasitemiaUI/DPICalculator.fs
@@
-2,25
+2,21
@@
open System
open System.Windows
open System
open System.Windows
-open System.Windows.Media
-open System.Windows.Markup
-open System.Windows.Shapes
-open System.Windows.Controls
-open System.Diagnostics
+open ParasitemiaUIControls
open ParasitemiaCore.Types
open ParasitemiaCore.UnitsOfMeasure
open Types
let showWindow (parent : Window) : int option =
open ParasitemiaCore.Types
open ParasitemiaCore.UnitsOfMeasure
open Types
let showWindow (parent : Window) : int option =
- let win =
Views.PPICalculatorWindow
()
+ let win =
PPICalculatorWindow
()
win.Owner <- parent
win.Left <- parent.Left + parent.ActualWidth / 2. - win.Width / 2.
win.Top <- parent.Top + parent.ActualHeight / 2. - win.Height / 2.
for size in Utils.sensorSizes do
win.Owner <- parent
win.Left <- parent.Left + parent.ActualWidth / 2. - win.Width / 2.
win.Top <- parent.Top + parent.ActualHeight / 2. - win.Height / 2.
for size in Utils.sensorSizes do
- win.cmbSensorSize.Items.Add(size) |> ignore
+ win.cmbSensorSize.Items.Add
(size) |> ignore
win.cmbSensorSize.SelectedIndex <- 0
let resolution (w_p : float<px>) (w_mm : float<mm>) (zoom : float) : float<ppi> =
win.cmbSensorSize.SelectedIndex <- 0
let resolution (w_p : float<px>) (w_mm : float<mm>) (zoom : float) : float<ppi> =
@@
-30,7
+26,7
@@
let showWindow (parent : Window) : int option =
let { w = w; h = h } = win.cmbSensorSize.SelectedValue :?> SensorSize
let ratio = h / w
let { w = w; h = h } = win.cmbSensorSize.SelectedValue :?> SensorSize
let ratio = h / w
- let parseDouble
txt errorMess = match Double.TryParse
(txt) with true, value -> Success value | _ -> Fail errorMess
+ let parseDouble
(txt : string) (errorMess : string) = match Double.TryParse
(txt) with true, value -> Success value | _ -> Fail errorMess
match
(result {
match
(result {
@@
-39,17
+35,17
@@
let showWindow (parent : Window) : int option =
let wPixel = 1.<px> * sqrt (sensorResolution * 1e6 / ratio)
return! Success (float <| resolution wPixel w zoom)
}) with
let wPixel = 1.<px> * sqrt (sensorResolution * 1e6 / ratio)
return! Success (float <| resolution wPixel w zoom)
}) with
- | Success res -> win.txtImageResolution.Text <-
(int (res / 1000.) * 1000).ToString()
+ | Success res -> win.txtImageResolution.Text <-
int (res / 1000.) * 1000 |> string
| Fail mess -> win.txtImageResolution.Text <- mess
| Fail mess -> win.txtImageResolution.Text <- mess
- win.butCancel.Click.AddHandler
(fun obj args -> win.DialogResult <- Nullable<bool>(false); win.Close
())
- win.butOK.Click.AddHandler
(fun obj args -> win.DialogResult <- Nullable<bool>(true); win.Close
())
+ win.butCancel.Click.AddHandler
(fun obj args -> win.DialogResult <- Nullable<bool> (false); win.Close
())
+ win.butOK.Click.AddHandler
(fun obj args -> win.DialogResult <- Nullable<bool> (true); win.Close
())
- win.cmbSensorSize.SelectionChanged.AddHandler(fun obj arg -> updateCurrentResolution ())
- win.txtSensorResolution.TextChanged.AddHandler(fun obj arg -> updateCurrentResolution ())
- win.txtZoom.TextChanged.AddHandler(fun obj arg -> updateCurrentResolution ())
+ win.cmbSensorSize.SelectionChanged.AddHandler
(fun obj arg -> updateCurrentResolution ())
+ win.txtSensorResolution.TextChanged.AddHandler
(fun obj arg -> updateCurrentResolution ())
+ win.txtZoom.TextChanged.AddHandler
(fun obj arg -> updateCurrentResolution ())
- let result = win.ShowDialog()
+ let result = win.ShowDialog
()
if result.HasValue && result.Value then
match Int32.TryParse win.txtImageResolution.Text with
| true, res -> Some res
if result.HasValue && result.Value then
match Int32.TryParse win.txtImageResolution.Text with
| true, res -> Some res