@@ -12,7 +12,16 @@ function _getDuplicatedEmptyDFG(dfg::CloudGraphsDFG)::CloudGraphsDFG
12
12
length (_getLabelsFromCyphonQuery (dfg. neo4jInstance, " (node:$(dfg. userId) :$(dfg. robotId) :$(sessionId) )" )) == 0 && break
13
13
end
14
14
@debug " Unique+empty copy session name: $sessionId "
15
- return CloudGraphsDFG {typeof(dfg.solverParams)} (dfg. neo4jInstance. connection, dfg. userId, dfg. robotId, sessionId, dfg. encodePackedTypeFunc, dfg. getPackedTypeFunc, dfg. decodePackedTypeFunc, dfg. rebuildFactorMetadata!, solverParams= deepcopy (dfg. solverParams), description= " (Copy of) $(dfg. description) " )
15
+ return CloudGraphsDFG {typeof(dfg.solverParams)} (
16
+ dfg. neo4jInstance. connection,
17
+ dfg. userId,
18
+ dfg. robotId,
19
+ sessionId,
20
+ dfg. encodePackedTypeFunc,
21
+ dfg. getPackedTypeFunc,
22
+ dfg. decodePackedTypeFunc,
23
+ dfg. rebuildFactorMetadata!,
24
+ solverParams= deepcopy (dfg. solverParams))
16
25
end
17
26
18
27
# Accessors
@@ -170,6 +179,12 @@ function getVariable(dfg::CloudGraphsDFG, label::Union{Symbol, String})::DFGVari
170
179
171
180
props = getnodeproperties (dfg. neo4jInstance. graph, nodeId)
172
181
variable = unpackVariable (dfg, props)
182
+
183
+ # TODO - make this get PPE's in batch
184
+ for ppe in listPPE (dfg, label)
185
+ variable. ppeDict[ppe] = getPPE (dfg, label, ppe)
186
+ end
187
+ return variable
173
188
end
174
189
175
190
function getFactor (dfg:: CloudGraphsDFG , label:: Union{Symbol, String} ):: DFGFactor
@@ -212,13 +227,12 @@ function mergeUpdateVariableSolverData!(dfg::CloudGraphsDFG, sourceVariable::DFG
212
227
if ! exists (dfg, sourceVariable)
213
228
error (" Source variable '$(sourceVariable. label) ' doesn't exist in the graph." )
214
229
end
215
- var = getVariable (dfg, sourceVariable. label)
216
- newEsts = merge! (var. ppeDict, deepcopy (sourceVariable. ppeDict))
217
- newSolveData = merge! (var. solverDataDict, sourceVariable. solverDataDict)
218
- Neo4j. setnodeproperty (dfg. neo4jInstance. graph, var. _internalId, " ppeDict" ,
219
- JSON2. write (newEsts))
220
- Neo4j. setnodeproperty (dfg. neo4jInstance. graph, var. _internalId, " solverDataDict" ,
221
- JSON2. write (Dict (keys (newSolveData) .=> map (vnd -> packVariableNodeData (dfg, vnd), values (newSolveData)))))
230
+ for (k,v) in sourceVariable. ppeDict
231
+ updatePPE! (dfg, getLabel (sourceVariable), v, k)
232
+ end
233
+ for (k,v) in sourceVariable. solverDataDict
234
+ updateVariableSolverData! (dfg, getLabel (sourceVariable), v, k)
235
+ end
222
236
return sourceVariable
223
237
end
224
238
0 commit comments