Skip to content

Commit 8d1c105

Browse files
authored
Merge pull request #782 from JuliaRobotics/21Q2/enh/printfactors
better factor printing
2 parents 856c0b3 + 900c142 commit 8d1c105

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/services/CustomPrinting.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,13 @@ function printFactor( io::IO, vert::DFGFactor;
105105
ioc = IOContext(io, :limit=>limit, :compact=>compact)
106106

107107
if short
108-
opmemt = (getSolverData(vert).fnc |> typeof).name
108+
opmemt = (getSolverData(vert).fnc |> typeof).name.name
109109
fct = getFactorType(vert)
110110
fctt = fct |> typeof
111-
printstyled(ioc, typeof(vert).name.name, "{",opmemt,"{",fctt.name.name,"...}}","\n", bold=true)
111+
printstyled(ioc, typeof(vert).name.name, "{",opmemt,"{",bold=true)
112+
printstyled(ioc, fctt.name.name,bold=true, color=:blue)
113+
printstyled(ioc, "...}}", bold=true)
114+
println(ioc)
112115
println(ioc, " timestamp: ", vert.timestamp)
113116
println(ioc, " nstime: ", vert.nstime)
114117
print(ioc, " label: ")
@@ -123,13 +126,15 @@ function printFactor( io::IO, vert::DFGFactor;
123126
println(ioc, fctt)
124127
# show(ioc, fctt)
125128
for f in setdiff(fieldnames(fctt), skipfields)
126-
printstyled(ioc, f,":\n", color=:magenta)
129+
printstyled(ioc, f,":", color=:magenta)
130+
println(ioc)
127131
show(ioc, getproperty(fct, f))
128132
println(ioc)
129133
end
130134
else
131135

132-
printstyled(ioc, summary(vert),"\n", bold=true, color=:blue)
136+
printstyled(ioc, summary(vert), bold=true, color=:blue)
137+
println(ioc)
133138

134139
:solver in skipfields && push!(skipfields, :solverData)
135140

@@ -138,7 +143,8 @@ function printFactor( io::IO, vert::DFGFactor;
138143
nf = nfields(vert)
139144

140145
for f in fields
141-
printstyled(ioc, f,":\n", color=:blue)
146+
printstyled(ioc, f,":", color=:blue)
147+
println(ioc)
142148
show(ioc, getproperty(vert, f))
143149
println(ioc)
144150
end

0 commit comments

Comments
 (0)