pre-release v0.3.0-alpha.1 Tell us what breaks
downrange

Starting from a file you already have

Status: on main, not in a release. Tested by unit tests, socket-level tests and one scripted run in headless Chromium. Nobody outside the project has used it yet.

You have a CSV from a past test and a program or a board that prints numbers. This page gets you from that to a working console without writing a mission file or packing a binary frame.

1. Import #

downrange import hotfire.csv

or, in a browser:

downrange web          # then open http://127.0.0.1:48622

Both do the same thing. The browser version lets you untick columns, fix names and units, and pick pages before anything is written.

The importer accepts two kinds of CSV and tells them apart itself.

A data log. One row per sample time, one column per channel:

time_ms,PT-OX [psi],TC chamber (degC),Vbat_V,valve_ox,state
0,14.7,22.0,12.4,0,IDLE
10,14.8,22.0,12.4,0,IDLE

A definition table. One row per field. It needs a name column and a type column. These other columns are read if they are there: unit, packet, scale, offset, states (0=SAFE;1=ARMED), rate, warn_low, warn_high, alarm_low, alarm_high, min, max.

Name,Type,Units,Packet,Scale,Min,Max
chamber_p,uint16,psi,engine,0.1,0,900
tank_temp,float,degC,engine,,,60

min and max are written as alarm limits. The importer tells you it did that.

What it copes with #

Comma, semicolon or tab. Quoted cells. A byte-order mark. Lines starting with #. Rows with too few or too many cells. A units row under the header. Decimal commas in a semicolon file. No header row at all (columns become col1, col2, ...). A few unreadable cells in a numeric column (up to 1 in 20; they become "no sample").

What it guesses, and how you can tell #

Every guess has a reason and a confidence. The command prints them, the browser shows them, and import-report.json keeps them.

Guess From
Unit name [unit], name (unit), a _unit ending, or the units row. A one-letter ending such as _V only counts when the name agrees (vbat_V yes, valve_a no).
Time column A column named like time whose values only go up. Its unit comes from the name (time_ms), from Unix-time magnitude, or is assumed and marked low confidence. Date-and-time text is read too.
Type f32, or f64 for latitude, longitude and numbers past 16.7 million. Whole numbers with a state-like name become u8.
States A text column with 16 or fewer different words becomes a state, numbered in the order the words first appear.
Role Pressure, temperature, altitude and so on, from the unit first and the name second. Roles decide which pages are offered.
Sample rate The middle step of the time column.

Left out, with the reason given: free-text columns, empty columns, a second time column.

It gets things wrong. A unit in a form it doesn't know is kept as text and can't be converted. A time column in whole numbers with no unit in its name is a coin toss between milliseconds and microseconds. Read the proposal.

Limits are never switched on for you #

For each numeric column the importer works out the range it saw and widens it. That is a suggestion. It is written into mission.toml as a comment and offered as a tick box in the browser. A range from one file is not a safety limit, and a console that alarms on invented numbers teaches people to ignore alarms. Set real ones yourself.

What you get #

hotfire/
  mission.toml         the proposed mission file, with every guess as a comment
  layout.toml          the dashboard pages you picked
  data.mcap            a data log only: the rows as a recording
  import-report.json   the whole proposal, machine-readable

data.mcap is an ordinary recording. downranged verify, report, export and evaluate all accept it. An existing project folder is not written over unless you pass --force; the browser picks a new folder name.

2. Pages #

Seven templates. Each is built only from channels that exist, and says what it found.

Page Offered when the data has Shows
Overview anything up to six headline values, two plots, the alarm list
Trends anything numeric one plot per unit, six channels a plot
All channels anything tables, 16 channels each
Fluids a pressure, flow or level gauges, valve lamps, pressure, temperature and flow plots
Flight altitude, speed, acceleration, position or a quaternion plots, a map, a 3-D trajectory, attitude
Power a voltage, current, power or battery charge values and plots
Alarms always the alarm list, and a table of channels with limits

downrange import file.csv --pages overview,fluids picks them on the command line. The result is an ordinary layout file (12-dashboards.md). Edit it by hand or in the workstation's edit mode.

A mission with no layout file gets the same templates applied to its channel list in the browser console.

3. Look at it #

downrange open hotfire            # desktop window, replaying the file
downrange open hotfire --web      # browser console instead

4. Live data #

Start the daemon on the project, then send it lines of text.

downrange open hotfire --live
python3 my_logger.py | downrange-feed --mission hotfire/mission.toml --time time_ms:ms

downrange-feed reads CSV (first line names the columns) or JSON (one object a line) and packs each line into frames the way the mission file says. Columns are matched to fields by name. The importer prints the exact command for your file.

Where the lines come from Option
Another program's output pipe it in
A file being appended to --file log.csv --follow
A TCP server --tcp 192.168.1.50:5000
UDP datagrams --udp 0.0.0.0:9000
A serial device --serial /dev/tty.usbmodem101 --baud 115200

Things to know:

  • A line it can't read is counted and skipped. Counts print every 5 seconds.
  • A float field with no value in a line is sent as "no sample". An integer field repeats its last value, because an integer has no way to say "nothing".
  • Without --time, lines are stamped with downrange-feed's own clock, so timing includes however long the line took to arrive.
  • It refuses missions it can't pack correctly (raw framing, bit fields, big-endian fields, polynomial or table calibration) and names the field.
  • --udp and --tcp read from the network. The daemon's own ports stay on loopback.
  • Serial has not been tried on real hardware. It opens the device as a file and calls stty for the speed. That works on macOS and Linux in principle. Windows needs another way.

If you would rather send binary yourself, examples/publish is 30 lines of Python.

5. The browser console #

--web on downranged run, downranged replay, or downrange open serves a console at http://127.0.0.1:48622. Give --layout file.toml to use your layout.

It draws these widget kinds: value, stat, bar, gauge, light, table, plot, alarms, text. The others (map, trajectory, globe, attitude, camera, schematic, system, timeline) show a box that names the kind and says it needs the desktop workstation.

It marks a value stale after 2 seconds with no new sample, like the desktop. A replay that has finished says so.

What it is not:

  • Not remote access. It binds loopback only and has no login. There is no option to change that. For another computer, forward the port over SSH.
  • Not a control surface. Nothing in it can send anything to a vehicle. The server has no code that could.
  • Not the full workstation. No edit mode, no pop-out windows, no pan and zoom on plots, no units conversion, no Korean. Nine of 17 widget kinds.
  • Not every sample. A channel with more than 1,000 new samples in a tenth of a second is thinned for display. The recording always has all of them.

Not done #

  • Importing XTCE, DBC or a spreadsheet.
  • Editing checks and requirements for the system model from an imported file.
  • Units the table doesn't know, as anything but text.
  • A hosted demo. That needs a login or a build that carries only simulated data.