Skip to content

Commit c8f9eb1

Browse files
committed
added: info2debugstr to force no truncation in @debug
1 parent 9b18425 commit c8f9eb1

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/controller/execute.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,7 @@ function optim_objective!(mpc::PredictiveController{NT}) where {NT<:Real}
531531
status
532532
)
533533
end
534-
@debug(
535-
"calling getinfo (use logger with show_limited=false if values are truncated)",
536-
getinfo(mpc)
537-
)
534+
@debug info2debugstr(getinfo(mpc))
538535
end
539536
if iserror(optim)
540537
mpc.ΔŨ .= ΔŨ0

src/estimator/mhe/execute.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,7 @@ function optim_objective!(estim::MovingHorizonEstimator{NT}) where NT<:Real
418418
status
419419
)
420420
end
421-
@debug(
422-
"calling getinfo (use logger with show_limited=false if values are truncated)",
423-
getinfo(estim)
424-
)
421+
@debug info2debugstr(getinfo(estim))
425422
end
426423
if iserror(optim)
427424
estim.Z̃ .= Z̃_0

src/general.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ function iserror(optim::JuMP.GenericModel)
2525
return any(errstatus->isequal(status, errstatus), ERROR_STATUSES)
2626
end
2727

28+
"Convert getinfo dictionary to a debug string (without any truncation)."
29+
function info2debugstr(info)
30+
mystr = "Content of getinfo dictionary:\n"
31+
for (key, value) in info
32+
mystr *= " :$key => $value\n"
33+
end
34+
return mystr
35+
end
36+
2837
"Evaluate the quadratic programming objective function `0.5x'*H*x + q'*x` at `x`."
2938
obj_quadprog(x, H, q) = 0.5*dot(x, H, x) + q'*x # dot(x, H, x) is faster than x'*H*x
3039

0 commit comments

Comments
 (0)