Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MRIBuilder.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
MRIBuilder.jl
Commits
b49e5d01
Unverified
Commit
b49e5d01
authored
6 months ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
Clean up printing for BuildingBlock
parent
79f509b1
No related branches found
No related tags found
1 merge request
!7
Add variables as properties
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/printing.jl
+17
-1
17 additions, 1 deletion
src/printing.jl
with
17 additions
and
1 deletion
src/printing.jl
+
17
−
1
View file @
b49e5d01
...
@@ -2,6 +2,7 @@ module Printing
...
@@ -2,6 +2,7 @@ module Printing
import
JuMP
:
value
,
AbstractJuMPScalar
import
JuMP
:
value
,
AbstractJuMPScalar
import
Printf
:
@sprintf
import
Printf
:
@sprintf
import
..
Variables
:
VariableType
,
variables
,
AbstractBlock
,
Variable
import
..
Variables
:
VariableType
,
variables
,
AbstractBlock
,
Variable
import
..
Containers
:
BuildingBlock
,
waveform
,
events
,
start_time
function
_robust_value
(
possible_number
::
VariableType
)
function
_robust_value
(
possible_number
::
VariableType
)
try
try
...
@@ -51,7 +52,22 @@ function show_block(io::IO, block::AbstractBlock, nspaces::Int64)
...
@@ -51,7 +52,22 @@ function show_block(io::IO, block::AbstractBlock, nspaces::Int64)
end
end
print
(
io
,
",
\n
"
)
print
(
io
,
",
\n
"
)
end
end
print
(
io
,
")"
)
print
(
io
,
repeat
(
' '
,
nspaces
),
")"
)
end
function
show_block
(
io
::
IO
,
block
::
BuildingBlock
,
nspaces
::
Int64
)
print
(
io
,
nameof
(
typeof
(
block
)),
"(
\n
"
)
control_points
=
waveform
(
block
)
print
(
io
,
repeat
(
' '
,
nspaces
+
2
),
"duration=
$
(variables.duration(block)),
\n
"
)
for
(
key
,
event
)
in
events
(
block
)
print
(
io
,
repeat
(
' '
,
nspaces
+
2
),
"t=
$
(start_time(block, key)): "
)
show_block
(
io
,
event
,
nspaces
+
2
)
print
(
io
,
",
\n
"
)
end
if
!
all
(
all
(
iszero
.
(
grad
))
for
(
_
,
grad
)
in
control_points
)
print
(
io
,
repeat
(
' '
,
npsaces
+
2
),
"waveform="
,
control_points
,
",
\n
"
)
end
print
(
io
,
repeat
(
' '
,
nspaces
),
")"
)
end
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment