2
2
# For all types that pack their type into their own structure (e.g. PPE)
3
3
const TYPEKEY = " _type"
4
4
5
+ function _packDataEntry (bde:: D ) where D <: AbstractBigDataEntry
6
+ JSON2. write (bde)
7
+
8
+ # Custom serialization
9
+ using JSON
10
+ import JSON. show_json
11
+ import JSON. Writer: StructuralContext, JSONContext, show_json
12
+ import JSON. Serializations: CommonSerialization, StandardSerialization
13
+ JSON. show_json (io:: JSONContext , serialization:: CommonSerialization , uuid:: UUID ) = print (io. io, " \" $uuid \" " )
14
+
15
+
5
16
# #==============================================================================
6
17
# # Variable Packing and unpacking
7
18
# #==============================================================================
@@ -18,7 +29,8 @@ function packVariable(dfg::G, v::DFGVariable)::Dict{String, Any} where G <: Abst
18
29
props[" softtype" ] = string (typeof (getSofttype (v)))
19
30
# props["bigData"] = JSON2.write(Dict(keys(v.dataDict) .=> map(bde -> JSON2.write(bde), values(v.dataDict))))
20
31
# props["bigDataElemType"] = JSON2.write(Dict(keys(v.dataDict) .=> map(bde -> typeof(bde), values(v.dataDict))))
21
- props[" dataEntry" ] = JSON2. write (Dict (keys (v. dataDict) .=> map (bde -> JSON2. write (bde), values (v. dataDict))))
32
+ props[" dataEntry" ] = JSON2. write (Dict (keys (v. dataDict) .=> map (bde -> JSON. json (bde), values (v. dataDict))))
33
+
22
34
props[" dataEntryType" ] = JSON2. write (Dict (keys (v. dataDict) .=> map (bde -> typeof (bde), values (v. dataDict))))
23
35
return props
24
36
end
@@ -76,7 +88,10 @@ function unpackVariable(dfg::G,
76
88
end
77
89
78
90
for (k,bdeInter) in dataIntermed
79
- fullVal = JSON2. read (bdeInter, getfield (DistributedFactorGraphs, dataElemTypes[k]))
91
+ @show label
92
+ @show bdeInter
93
+ interm = JSON. parse (bdeInter)
94
+ Unmarshal. unmarshal (getfield (DistributedFactorGraphs, dataElemTypes[k]), interm)
80
95
variable. dataDict[k] = fullVal
81
96
end
82
97
end
0 commit comments