-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtreeDepiction.fsx
99 lines (60 loc) · 2.66 KB
/
treeDepiction.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//open System.IO
//open System.Collections.Generic
#r "nuget: DocumentFormat.OpenXml"
#r "nuget: FSharpAux"
#r "nuget: FsSpreadsheet.ExcelIO"
#r "nuget: FSharp.FGL.ArrayAdjacencyGraph"
open DocumentFormat.OpenXml
open FSharpAux
open FsSpreadsheet
open FSharp.FGL
open FSharp.FGL.ArrayAdjacencyGraph
#I @"src\ArcGraphModel\bin\Release\net6.0"
#r "ArcGraphModel.dll"
#load "terms.fsx"
open Terms
open FsSpreadsheet
open FsSpreadsheet.ExcelIO
open FsSpreadsheet.DSL
open ArcGraphModel
open ArcGraphModel
open System
open System.Collections
open System.Collections.Generic
type Protocol (version : CvParam, description : CvParam) =
inherit CvContainer(Terms.protocol,seq [version :> ICvBase;description])
member this.Version
with get() =
CvContainer.getSingleAs<CvParam> Protocol.VersionProperty this
|> CvParam.getValueAsString
and set(version : string) =
CvParam.fromValue Terms.version version
|> fun cvp -> CvContainer.setSingle Protocol.VersionProperty cvp this
static member VersionProperty = "Version"
//member this.GetVersion() =
// Dictionary.item "Version" this (*:?> CvParam*)
//member this.SetVersion() =
// Dictionary.item "Version" this
member this.GetDescription() = Dictionary.item "Description" this :?> CvParam
type Process (name : CvParam, protocol : Protocol) =
inherit CvContainer(Terms.processs,seq ["Name",name;"Protocol",protocol])
member this.Name = this.Get "Name" :?> CvParam
member this.Protocol = this.Get "Protocol" :?> Protocol
type Assay (measurementType : CvParam, processSequence : #seq<Process>) =
inherit CvContainer(Terms.assay,seq ["MeasurementType",measurementType;"ProcessSequence",CvSequence(processSequence)])
member this.MeasurementType = this.Get "MeasurementType" :?> CvParam
member this.ProcessSequence = this.Get "ProcessSequence" :?> CvSequence<Process>
let thisVersion = CvParam.fromValue (Terms.version, "0.1.0")
let thisDescription = CvParam.fromValue (Terms.description, "Stuff is done in this way.")
let thisName = CvParam.fromValue (Terms.identifyingName, "Stuff was done on that day xddd")
let thisMeasurementType = CvParam.fromValue (Terms.assayMeasurementType, "temporal")
let protocol = Protocol(thisVersion,thisDescription)
let processs = Process(thisName,protocol)
let assay = Assay(thisMeasurementType,[processs])
assay.ProcessSequence.[0].Protocol.Version
// Offene Fragen:
// CvParam<IConvertible> ist tödlich
// Wie geht man mit Sequenzen um?
// Als Rückgabewert CvParam oder nur Wert
// Typen enttypisieren
// Options oder nicht options als Rückgabewerte