Registry / Framework

framework · v0.1.2
Survey Transect
Visit field waypoints in order and distinguish revisits from the next required station.
Use Survey Transect
use vendor::survey_transect::survey_transect;
Run the example
nest demo survey_transect@0.1.2
blyxc native-run survey_transect-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::survey_transect::survey_transect;
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 = survey_transect_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 = survey_transect_step(live, args_at(arguments, i), text_number(input));
let command = survey_transect_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = survey_transect_start();
state = survey_transect_step(state, "start", 1.0);
println!(survey_transect_command(state));
state = survey_transect_step(state, "visit", 1.0);
println!(survey_transect_command(state));
state = survey_transect_step(state, "visit", 3.0);
println!(survey_transect_command(state));
state = survey_transect_step(state, "visit", 2.0);
println!(survey_transect_command(state));
state = survey_transect_step(state, "visit", 1.0);
println!(survey_transect_command(state));
state = survey_transect_step(state, "finish", 3.0);
println!(survey_transect_command(state));
}
Expected output
set_first_station
log_station
flag_skipped_station
log_station
log_revisit
seal_survey
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | 5f99057b46 | f455980a369e18ad674c60e3eaf56099752b76bec1166a204e0c534cf1240ae4 |
| 0.1.1 | Download ZIP · Browse files | 61173e5a2a | 41473c4ea9ae5ccc45a3e5a87c25cda789ed7d9ac08b0209d542f1620241fcf7 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | f184b3e2dc563b2c69b717e3b8222cfbb5c5208b6306dc6ed668e3483e7150d7 |