X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FState.fs;h=37da042f36c3cb9f0d9e872a43f68c4317589943;hb=HEAD;hp=129e6a6bae522b0e7d3af94893b9669ea8364254;hpb=d3f9cd7b16d25f49bd8d06394b0f1d4040809fbd;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaUI/State.fs b/Parasitemia/ParasitemiaUI/State.fs index 129e6a6..37da042 100644 --- a/Parasitemia/ParasitemiaUI/State.fs +++ b/Parasitemia/ParasitemiaUI/State.fs @@ -64,7 +64,8 @@ type State (defaultConfig : ParasitemiaCore.Config.Config) = /// /// If the image cannot be read member this.AddSourceImage (filePath : string) (defaultConfig : ParasitemiaCore.Config.Config) : SourceImage = - let srcImg = SourceImage (sourceImages.Count + 1, System.IO.FileInfo(filePath).Name, defaultConfig.Copy (), DateTime (0L), new Image (filePath), []) + let filename = System.IO.FileInfo(filePath).Name + let srcImg = SourceImage (sourceImages.Count + 1, filename, filename, defaultConfig.Copy (), DateTime (0L), FromFile filePath, []) sourceImages.Add srcImg if sourceImages.Count = 1 then this.CurrentImage <- Some sourceImages.[0] @@ -89,8 +90,8 @@ type State (defaultConfig : ParasitemiaCore.Config.Config) = srcImg.Name <- name alteredSinceLastSave <- true - member this.SetResult (imgNum : int) (result : ParasitemiaCore.Types.AnalysisResult) = - let sourceImage = sourceImages.Find (fun srcImg -> srcImg.Num = imgNum) + member this.SetResult (imgId : string) (result : ParasitemiaCore.Types.AnalysisResult) = + let sourceImage = sourceImages.Find (fun srcImg -> srcImg.RomanNum = imgId) let w = sourceImage.Img.Width let h = sourceImage.Img.Height