Hi guys!
After my last post here, I decided to start building a wrapper to libncurses
since all that are available seem dead. Given the amazing meta programming capabilities, I managed to have a good set of functions wrapped very quickly.
Today, I tried to create a simple project to proof the concept: whether or not a TUI built in Julia is useful. I came up with the idea of using Base.@locals
to create a variable viewer for the sake of debugging.
The following code propagates the orbit of a satellite and converts a vector from an ECI to ECEF frame. At each iteration, I call the macro @showvars
that opens a TUI created with the wrapped Ncurses functions to show all the local variables. When I press F1
the viewer closes, then I can see all the variables in the next loop iteration:
using SatelliteToolbox
using ReferenceFrameRotations
import Base.show
include("varviewer.jl")
show(io::IO, ::MIME"text/plain", tle::TLE) = SatelliteToolbox.print_tle(io, tle, false)
function orbit_simulation()
tle = tle"""
SCD 1
1 22490U 93009B 18359.76217587 .00000186 00000-0 84512-6 0 9998
2 22490 24.9694 116.1709 0043211 90.3968 62.0083 14.44539396366163
"""[1]
orbp = init_orbit_propagator(Val{:sgp4}, tle)
for t = 1:1:100*60
o, r_teme, v_teme = propagate!(orbp, t)
D_PEF_TEME = rECItoECEF(TEME(), PEF(), o.t)
r_pef = D_PEF_TEME*r_teme
lat, lon, h = ECEFtoGeodetic(r_teme)
@showvars
end
nothing
end
Here is a gif of what I see.
To be honest, I found this very useful and it was built very quickly. I think I will continue with this project. The idea of this post is to gather ideas and ask if anyone wants to help.