Registry / Framework

framework · v0.1.2
Instrument Zero
Apply a zero-offset correction only after repeated reference measurements agree within one count.
Use Instrument Zero
use vendor::instrument_zero::instrument_zero;
Run the example
nest demo instrument_zero@0.1.2
blyxc native-run instrument_zero-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::instrument_zero::instrument_zero;
fn main() {
let arguments = cli_args();
if args_len(arguments) > 0 {
if args_len(arguments) % 2 != 0 {
stderr_line("Expected event and value pairs");
process_exit(2);
}
let mut live = instrument_zero_start();
let mut i = 0;
while i < args_len(arguments) {
let input = args_at(arguments, i + 1);
if !text_is_number(input) {
stderr_line("Expected a whole numeric event value");
process_exit(2);
}
live = instrument_zero_step(live, args_at(arguments, i), text_number(input));
let command = instrument_zero_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = instrument_zero_start();
state = instrument_zero_step(state, "baseline", 12.0);
println!(instrument_zero_command(state));
state = instrument_zero_step(state, "confirm", 18.0);
println!(instrument_zero_command(state));
state = instrument_zero_step(state, "confirm", 17.0);
println!(instrument_zero_command(state));
state = instrument_zero_step(state, "use", 0.0);
println!(instrument_zero_command(state));
}
Expected output
capture_reference
replace_reference
accept_offset
apply_offset
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | 0868e71b83 | 03e3d2b8c504f668d5b47d18991885f158797a44fa7fe67a491c991554fe419d |
| 0.1.1 | Download ZIP · Browse files | 23baf60452 | 45cf3cc6fe758cba4349d2d07c64d4cee395c9c241d3d52c01b6c1eab4dabfbe |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | 9f976023080982613fee11840a904de5e00d1e3284e4a2439b1b43b7087a6dd3 |