Skip to content

Commit 674d9b6

Browse files
committed
improve DFGFactor show
1 parent b1a87c3 commit 674d9b6

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

src/entities/DFGFactor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mutable struct GenericFunctionNodeData{T<:Union{PackedInferenceType, FunctorInfe
3939
potentialused::Bool
4040
edgeIDs::Vector{Int}
4141
fnc::T
42-
multihypo::Vector{Float64} # likely to moved when GenericWrapParam is refactored
42+
multihypo::Vector{Float64} # FIXME likely to moved when GenericWrapParam is refactored #477
4343
certainhypo::Vector{Int}
4444
solveInProgress::Int
4545
end

src/services/CustomPrinting.jl

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,30 @@
44
# Base.show_default(io, v)
55
Base.show(io::IO, ::MIME"text/plain", v::DFGVariable) = show(IOContext(io, :limit=>true, :compact=>true), v)
66

7-
Base.show(io::IO, ::MIME"text/plain", f::DFGFactor) = show(IOContext(io, :limit=>true, :compact=>true), f)
7+
function Base.show(io::IO, ::MIME"text/plain", f::DFGFactor)
8+
# show(IOContext(io, :limit=>true, :compact=>true), f)
9+
fctt = getFactorType(f)
10+
println(io, "$(typeof(f))")
11+
println(io, " Name: $(f.label)")
12+
println(io, " VariableOrder: $(getVariableOrder(f))")
13+
println(io, " Multihypo: $(getSolverData(f).multihypo)") # FIXME #477
14+
println(io, " Nullhypo: TBD")
15+
println(io, " Type: $(typeof(fctt))")
16+
println(io, " Fields: $(fieldnames(typeof(fctt)))")
17+
show(IOContext(io, :limit=>true, :compact=>true), fctt)
18+
end
819

920
function Base.show(io::IO, ::MIME"text/plain", dfg::AbstractDFG)
1021
summary(io, dfg)
11-
println("\n UserId: ", dfg.userId)
12-
println(" RobotId: ", dfg.robotId)
13-
println(" SessionId: ", dfg.sessionId)
14-
println(" Description: ", dfg.description)
15-
println(" Nr variables: ", length(ls(dfg)))
16-
println(" Nr factors: ",length(lsf(dfg)))
17-
println(" User Data: ", keys(dfg.userData))
18-
println(" Robot Data: ", keys(dfg.robotData))
19-
println(" Session Data: ", keys(dfg.sessionData))
22+
println(io, "\n UserId: ", dfg.userId)
23+
println(io, " RobotId: ", dfg.robotId)
24+
println(io, " SessionId: ", dfg.sessionId)
25+
println(io, " Description: ", dfg.description)
26+
println(io, " Nr variables: ", length(ls(dfg)))
27+
println(io, " Nr factors: ",length(lsf(dfg)))
28+
println(io, " User Data: ", keys(dfg.userData))
29+
println(io, " Robot Data: ", keys(dfg.robotData))
30+
println(io, " Session Data: ", keys(dfg.sessionData))
2031
end
2132

2233

0 commit comments

Comments
 (0)