Blyx Nest Blyx language
Registry / Framework
framework · v0.1.2

Survey Closure

Hold a survey traverse for remeasurement if its reported closure error exceeds the selected tolerance.

Source repository · Package JSON

Use Survey Closure

use vendor::survey_closure::survey_closure;

Run the example

nest demo survey_closure@0.1.2
blyxc native-run survey_closure-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::survey_closure::survey_closure;

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_closure_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_closure_step(live, args_at(arguments, i), text_number(input));
            let command = survey_closure_command(live);
            println!(command);
            if command == "reject" { process_exit(1); }
            i += 2;
        }
        return;
    }
    let mut state = survey_closure_start();
    state = survey_closure_step(state, "tolerance", 3.0);
    println!(survey_closure_command(state));
    state = survey_closure_step(state, "close", 4.0);
    println!(survey_closure_command(state));
    state = survey_closure_step(state, "repeat", 0.0);
    println!(survey_closure_command(state));
    state = survey_closure_step(state, "close", 2.0);
    println!(survey_closure_command(state));
    state = survey_closure_step(state, "file", 0.0);
    println!(survey_closure_command(state));
}

Expected output

set_tolerance
request_resurvey
reopen_traverse
lock_traverse
archive_survey

Published versions

VersionPackageSource commitSHA-256
0.1.2Download ZIP · Browse files33824152f3ac8a4c2ffc5c74ec2fca8621b1a7cff9ad20398573740967089809e40abb1968
0.1.1Download ZIP · Browse filesd29ee5fa1c56c8331fbde6f28c9c0488925b75873234ab372ba97c4b2c8c35f82315a68518
0.1.0Download ZIP · Browse files6349f237848f7e50d64d375fb59cf1b5f01297e7ce41756993f40ab15b2c27adbefc7db160