]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/standardTypes.dbt
Improved Bindings.getBinding(Class) caching for Datatype.class
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / standardTypes.dbt
1
2 type Limit = 
3     | Nolimit 
4     | Inclusive { value : Double } 
5     | Exclusive { value : Double } 
6     | InclusiveLong { value : Long } 
7     | ExclusiveLong { value : Long }
8
9 type Range = { lower : Limit, upper : Limit }
10
11 type Component = { name : String, type : DataType }
12 type DataTypeDefinition = { name : String, type : DataType }
13
14 type DataType =
15       | BooleanType  {}
16       | ByteType     { unit : Optional(String), range : Optional(Range) }
17       | IntegerType  { unit : Optional(String), range : Optional(Range) }
18       | LongType     { unit : Optional(String), range : Optional(Range) }
19       | FloatType    { unit : Optional(String), range : Optional(Range) }
20       | DoubleType   { unit : Optional(String), range : Optional(Range) }
21       | StringType   { pattern : Optional(String), mimeType : Optional(String), length : Optional(String) }
22       | RecordType   referable { referable : Boolean, components : Component[] }
23       | ArrayType    { componentType : DataType, length : Optional(Range) }
24       | MapType      { keyType : DataType, valueType : DataType }
25       | OptionalType { componentType : DataType }
26       | UnionType    UnionType
27       | VariantType  {}
28
29 type UnionType = { components : Component[] }
30
31 type UUID = { mostSigBits : Long, leastSigBits : Long }
32 type Void = {}
33 type URI = String
34 type LocalizedText = Map(String, String)
35
36 type Interface = {
37        methodDefinitions : Map(MethodTypeDefinition, {})
38      }
39 type InterfaceDefinition = {
40        name : String,
41        type : Interface
42      }
43 type MethodType = {
44        requestType : DataType,
45       responseType : DataType,
46        errorType : UnionType
47      }
48 type MethodTypeDefinition = {
49        name : String,
50        type : MethodType
51      }
52
53
54 type Handshake = | Version0
55 type Version0 = {
56        recvMsgLimit : Integer,
57        sendMsgLimit : Integer,
58        methods : MethodTypeDefinition[]
59      }
60 type Message = | RequestHeader RequestHeader 
61                | ResponseHeader ResponseHeader
62                | ExecutionError_ ExecutionError_
63                | Exception_ Exception_
64                | InvalidMethodError InvalidMethodError
65                | ResponseTooLarge ResponseTooLarge
66 type RequestHeader = {
67        requestId : Integer,
68        methodId : Integer
69      }
70 type ResponseHeader = {
71        requestId : Integer
72      }
73 type ExecutionError_ = {
74        requestId : Integer
75      }
76 type InvalidMethodError = {
77        requestId : Integer
78      }
79 type Exception_ = {
80        requestId : Integer,         
81        message : String
82      }
83 type ResponseTooLarge = {
84        requestId : Integer         
85      }
86
87 type AccessorReference = | ArrayIndexReference     { childReference : Optional(AccessorReference), index : Integer }
88                          | KeyReference            { childReference : Optional(AccessorReference), key : Variant }
89                          | OptionalValueReference  { childReference : Optional(AccessorReference) }
90                          | FieldIndexReference     { childReference : Optional(AccessorReference), index : Integer }
91                          | FieldNameReference      { childReference : Optional(AccessorReference), fieldName : String }
92                          | TagReference            { childReference : Optional(AccessorReference)  }
93                          | TagIndexReference       { childReference : Optional(AccessorReference), tag : Integer  }
94                          | TagNameReference        { childReference : Optional(AccessorReference), tag : String }
95                          | VariantValueReference   { childReference : Optional(AccessorReference) }
96                          | LabelReference          { childReference : Optional(AccessorReference), label : String }
97
98 type Event = | ArrayElementAdded     { reference : Optional( AccessorReference ), index : Integer, value : Optional( Variant ) }
99              | ArrayElementRemoved   { reference : Optional( AccessorReference ), index : Integer }
100              | MapEntryAdded         { reference : Optional( AccessorReference ), key : Variant, value : Optional( Variant ) }
101              | MapEntryRemoved       { reference : Optional( AccessorReference ), key : Variant }
102              | UnionValueAssigned    { reference : Optional( AccessorReference ), tag : Integer, newValue : Optional( Variant ) }
103              | OptionalValueAssigned { reference : Optional( AccessorReference ), newValue : Optional( Variant ) }
104              | OptionalValueRemoved  { reference : Optional( AccessorReference ) }
105              | ValueAssigned         { reference : Optional( AccessorReference ), newValue : Optional( Variant ) }
106              | InvalidatedEvent      { reference : Optional( AccessorReference ) }
107  
108 type ChangeSet = { events : Event[] }
109
110 type InterestSet = | BooleanInterestSet  { notification : Boolean, value : Boolean }
111                    | ByteInterestSet     { notification : Boolean, value : Boolean }
112                    | IntegerInterestSet  { notification : Boolean, value : Boolean }
113                    | LongInterestSet     { notification : Boolean, value : Boolean }
114                    | FloatInterestSet    { notification : Boolean, value : Boolean }
115                    | DoubleInterestSet   { notification : Boolean, value : Boolean }
116                    | StringInterestSet   { notification : Boolean, value : Boolean }
117                    | RecordInterestSet   { notification : Boolean, notifications : Boolean[], value : Boolean, values : Boolean[] }
118                    | ArrayInterestSet    { notification : Boolean, notifications : Integer[], value : Boolean, values : Integer[] }
119                    | MapInterestSet      { notification : Boolean, notifications : Variant[], value : Boolean, values : Variant[], componentInterest : InterestSet, componentInterests : Map( Variant, InterestSet ) }
120                    | OptionalInterestSet { notification : Boolean, value : Boolean, componentInterest : InterestSet }
121                    | UnionInterestSet    { notification : Boolean, value : Boolean, componentInterests : InterestSet[] }
122                    | VariantInterestSet  { notification : Boolean, value : Boolean, componentInterest : InterestSet, completeComponent : Boolean }
123
124 type Datasource = {
125         nodes : Map(Variant, Node)
126      }
127 type Node = {
128         id : Variant,
129         labels : LocalizedText,
130         children : Variant[],
131         value : Optional(Variant)
132      }
133
134 type Instant = { 
135          seconds : Long, 
136          nanoSeconds : Integer(range=[0..999999999])
137      }
138
139 type Duration = { 
140          seconds : Long, 
141          nanoSeconds : Integer(range=[0..999999999]) 
142      }
143
144 type LocalDate = { 
145          year : Integer, 
146          monthOfYear : Integer(range=[1..12]), 
147          dayOfMonth : Integer(range=[1..31]) 
148      }
149      
150 type LocalTime = { 
151          hourOfDay : Integer(range=[0..23]),
152          minuteOfHour : Integer(range=[0..59]),
153          secondOfMinute : Integer(range=[0..59]),
154          nanoOfSecond : Integer(range=[0..999999999])
155      }
156      
157 type LocalDateTime = {
158          year : Integer, 
159          monthOfYear : Integer(range=[1..12]), 
160          dayOfMonth : Integer(range=[1..31]), 
161          hourOfDay : Integer(range=[0..23]),
162          minuteOfHour : Integer(range=[0..59]),
163          secondOfMinute : Integer(range=[0..59]),
164          nanoOfSecond : Integer(range=[0..999999999])
165      }
166     
167 type ZonedDateTime = {
168          date : LocalDate,
169          time : LocalTime,
170          zone : TimeZone
171      }
172  
173 type TimeZone = { zoneId : String }
174
175 // A result of a data capturing session
176 type RecordingSession = {
177          // An optional Datasource URL
178          datasource : Optional( String ),
179  
180          // Events that occured in the data source during sampling, a map of Event Id to Event
181          events: Map( Integer, Event ),
182  
183          // A collection of events that are promoted to milestones, a map of Milestone Id to Event Id
184          milestones : Map( Integer, Integer ),
185          
186          // All records, a map of NodeId to Recording(T, V)
187          recordings : Map( Variant, Variant )
188      }
189       
190 type SubscriptionParameters = {
191         nodeId : Variant,
192         deadband : Optional( Variant ),
193         interval : Optional( Variant )
194       }
195
196 type SamplingConfiguration = {
197          // Capture events, if true events are captured
198          captureEvents : Boolean,
199          // Subscribed Variables
200          subscriptions : SubscriptionParameters[]
201       }
202       
203 type Event = {
204         // Session unique identifier
205         id : Integer,
206
207         // Timevalue, a number type e.g. Double(unit="s"), or a date type (See #Time_Types)
208         time : Variant,
209
210         // Title
211         title : Optional(String), 
212
213         // Message
214         message : String,
215  
216         // NodeId of the sender object, optional
217         source : Optional(Variant),
218
219         // Event Type: alarm, action, error, info, debug
220         type : String,
221  
222         // System Text, generated by the source system, eg. \94YD11D001 started\94
223         systemText : Optional(String), 
224
225         // Comments
226         comments : Comment[],
227
228         // Other Metadata
229         metadata : Map(String, String) 
230       }
231
232 type Comment = {
233         user : Optional(String),
234         message : String
235       }