X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FGUI%2FState.fs;h=b35b3319fbdbc09807cacd6645da86c4f89ec322;hp=b5136c2269d93d3e74c16f0056b48d00e4d41882;hb=0af5da4bffad8333c8e57851e067218c0e21d7bb;hpb=da6b1ee15d0368ef9f2d9734b0d72996cbc227d8 diff --git a/Parasitemia/Parasitemia/GUI/State.fs b/Parasitemia/Parasitemia/GUI/State.fs index b5136c2..b35b331 100644 --- a/Parasitemia/Parasitemia/GUI/State.fs +++ b/Parasitemia/Parasitemia/GUI/State.fs @@ -1,16 +1,15 @@ -module State +module Parasitemia.GUI.State open System.Collections.Generic open Emgu.CV open Emgu.CV.Structure -type ImageSource = { - cells: List - img: Image } +open Types type State () = - let imagesSource = List() + let sourceImages = List() + let mutable currentImage = -1 member val FilePath: string = "" with get, set member val PatientID: string = "" with get, set @@ -23,12 +22,17 @@ type State () = let data = Pia.load this.FilePath this.PatientID <- data.patientID - member this.AddSourceImage (filePath: string) = - imagesSource.Add({ cells = List(); img = new Image(filePath) }) + member this.AddSourceImage (filePath: string) : SourceImage = + let srcImg = { num = sourceImages.Count + 1; rbcs = []; img = new Image(filePath) } + sourceImages.Add(srcImg) + if sourceImages.Count = 1 + then + currentImage <- 1 + srcImg - member x.ImagesSource : ImageSource seq = - imagesSource :> ImageSource seq + member x.SourceImages : SourceImage seq = + sourceImages :> SourceImage seq member this.Reset () = this.PatientID <- "" - imagesSource.Clear() \ No newline at end of file + sourceImages.Clear() \ No newline at end of file