@@ -91,7 +91,7 @@ VariableNodeData(variableType::InferenceVariable; kwargs...) = VariableNodeData{
91
91
92
92
"""
93
93
$(TYPEDEF)
94
- Packed VariabeNodeData structure for serializing DFGVariables.
94
+ Packed VariableNodeData structure for serializing DFGVariables.
95
95
96
96
---
97
97
Fields:
@@ -120,6 +120,17 @@ Base.@kwdef mutable struct PackedVariableNodeData
120
120
_version:: String = string (_getDFGVersion ())
121
121
end
122
122
123
+ function Base. propertynames (x:: PackedVariableNodeData , private:: Bool = false )
124
+ if private
125
+ return fieldnames (PackedVariableNodeData)
126
+ else
127
+ return (:vecval , :dimval , :vecbw , :dimbw , :BayesNetOutVertIDs ,
128
+ :dimIDs , :dims , :eliminated , :BayesNetVertID , :separator ,
129
+ :variableType , :initialized , :infoPerCoord , :ismargin , :dontmargin ,
130
+ :solveInProgress , :solvedCount , :solveKey , :_version )
131
+ end
132
+ end
133
+
123
134
StructTypes. StructType (:: Type{PackedVariableNodeData} ) = StructTypes. UnorderedStruct ()
124
135
StructTypes. idproperty (:: Type{PackedVariableNodeData} ) = :id
125
136
StructTypes. omitempties (:: Type{PackedVariableNodeData} ) = (:id ,)
@@ -155,6 +166,10 @@ Base.@kwdef struct MeanMaxPPE <: AbstractPointParametricEst
155
166
lastUpdatedTimestamp:: Union{ZonedDateTime, Nothing} = nothing
156
167
end
157
168
169
+ function Base. propertynames (x:: MeanMaxPPE , private:: Bool = false )
170
+ return (:solveKey , :suggested , :max , :mean , :_type , :_version )
171
+ end
172
+
158
173
StructTypes. StructType (:: Type{MeanMaxPPE} ) = StructTypes. UnorderedStruct ()
159
174
StructTypes. idproperty (:: Type{MeanMaxPPE} ) = :id
160
175
StructTypes. omitempties (:: Type{MeanMaxPPE} ) = (:id ,:createdTimestamp ,:lastUpdatedTimestamp )
@@ -179,19 +194,18 @@ getEstimateFields(::MeanMaxPPE) = [:suggested, :max, :mean]
179
194
180
195
# Packed Variable
181
196
Base. @kwdef struct PackedVariable
182
- # NOTE: This has to match the order of the JSON deserializer as we're using OrderedStructs.
183
- id:: Union{UUID, Nothing}
197
+ id:: Union{UUID, Nothing} = nothing
184
198
label:: Symbol
185
- tags:: Vector{Symbol}
186
- timestamp:: ZonedDateTime
187
- nstime:: Int
188
- ppes:: Vector{MeanMaxPPE}
189
- blobEntries:: Vector{BlobEntry}
199
+ tags:: Vector{Symbol} = Symbol[]
200
+ timestamp:: ZonedDateTime = now ( tz " UTC " )
201
+ nstime:: Int = 0
202
+ ppes:: Vector{MeanMaxPPE} = MeanMaxPPE[]
203
+ blobEntries:: Vector{BlobEntry} = BlobEntry[]
190
204
variableType:: String
191
- _version:: String
192
- metadata:: String
193
- solvable:: Int
194
- solverData:: Vector{PackedVariableNodeData}
205
+ _version:: String = string ( _getDFGVersion ())
206
+ metadata:: String = " e30= "
207
+ solvable:: Int = 1
208
+ solverData:: Vector{PackedVariableNodeData} = PackedVariableNodeData[]
195
209
end
196
210
197
211
StructTypes. StructType (:: Type{PackedVariable} ) = StructTypes. UnorderedStruct ()
@@ -344,6 +358,27 @@ Base.@kwdef struct DFGVariableSummary <: AbstractDFGVariable
344
358
dataDict:: Dict{Symbol, BlobEntry}
345
359
end
346
360
361
+ function DFGVariableSummary (
362
+ id,
363
+ label,
364
+ timestamp,
365
+ tags,
366
+ :: Nothing ,
367
+ variableTypeName,
368
+ :: Nothing ,
369
+ )
370
+ return DFGVariableSummary (
371
+ id,
372
+ label,
373
+ timestamp,
374
+ tags,
375
+ Dict {Symbol, MeanMaxPPE} (),
376
+ variableTypeName,
377
+ Dict {Symbol, BlobEntry} (),
378
+ )
379
+ end
380
+
381
+ StructTypes. names (:: Type{DFGVariableSummary} ) = ((:variableTypeName , :variableType ),)
347
382
348
383
# #------------------------------------------------------------------------------
349
384
# # SkeletonDFGVariable.jl
0 commit comments