#include "nml_intf/emc.hh"

#include <iostream>

int main()
{
    const bool default_units_visible = emcStatus->motion.traj.linearUnits == 1.0;
    const bool default_machine_units_mm =
        emcStatus->motion.traj.linearUnits > 0.5;

    emcStatus->motion.traj.linearUnits = 1.0 / 25.4;
    const bool inch_machine_units_visible =
        emcStatus->motion.traj.linearUnits <= 0.5;

    emcStatus->motion.traj.linearUnits = 1.0;
    const bool mm_machine_units_visible =
        emcStatus->motion.traj.linearUnits > 0.5;

    std::cout << "emc_status_default_linear_units="
              << emcStatus->motion.traj.linearUnits << "\n";
    std::cout << "emc_status_default_units_visible="
              << default_units_visible << "\n";
    std::cout << "emc_status_default_machine_units_mm="
              << default_machine_units_mm << "\n";
    std::cout << "emc_status_inch_machine_units_visible="
              << inch_machine_units_visible << "\n";
    std::cout << "emc_status_mm_machine_units_visible="
              << mm_machine_units_visible << "\n";

    if (!default_units_visible || !default_machine_units_mm ||
        !inch_machine_units_visible || !mm_machine_units_visible) {
        return 1;
    }

    return 0;
}
