Commit b063b823 authored by Alessio Igor Bogani's avatar Alessio Igor Bogani
Browse files

Truncate decimals

parent ced0d519
......@@ -684,7 +684,7 @@ int main(int argc, char *argv[])
}
if (mode == STATUS) {
if (control_action + setpoint_action + kp_action + ki_action + kff_action + kd_action
if (control_action /*+ setpoint_action*/ + kp_action + ki_action + kff_action + kd_action
+ ramp_action + min_action + max_action + a0_action
+ a1_action + a2_action + a3_action + a4_action + a5_action
+ reset_action + pulse_duration_action
......@@ -751,7 +751,7 @@ int main(int argc, char *argv[])
} else { /* control_action == NOTHING */ }
if (setpoint_action == READ || print_all_config) {
printf("Output current setpoint:\t%f\tA\n", config.output_current_setpoint);
printf("Output current setpoint:\t%.04f\tA\n", config.output_current_setpoint);
} else if (setpoint_action == WRITE) {
config.output_current_setpoint = setpoint_value;
} else { /* setpoint_action == NOTHING */ }
......@@ -789,13 +789,13 @@ int main(int argc, char *argv[])
} else { /* ramp_action == NOTHING */ }
if (min_action == READ || print_all_config) {
printf("Output current min:\t\t%f\tA\n", config.output_current_min);
printf("Output current min:\t\t%.04f\tA\n", config.output_current_min);
} else if (min_action == WRITE) {
config.output_current_min = min_value;
} else { /* min_action == NOTHING */ }
if (max_action == READ || print_all_config) {
printf("Output current max:\t\t%f\tA\n", config.output_current_max);
printf("Output current max:\t\t%.04f\tA\n", config.output_current_max);
} else if (max_action == WRITE) {
config.output_current_max = max_value;
} else { /* max_action == NOTHING */ }
......@@ -948,12 +948,16 @@ int main(int argc, char *argv[])
}
} else { /* iostatus_action == NOTHING */ }
if (setpoint_action == READ) {
printf("Output current setpoint:\t%.4f\tA\n", config.output_current_setpoint);
} else { /* setpoint_action == NOTHING */ }
if (output_action == READ || print_all_status) {
printf("Output current:\t\t\t%f\tA\n", status.output_current);
printf("Output current:\t\t\t%.04f\tA\n", status.output_current);
} else { /* output_action == NOTHING */ }
if (outvoltage_action == READ || print_all_status) {
printf("Output voltage:\t\t\t%f\tV\n", output_voltage_a0 + (output_voltage_a1 * (float)status.output_voltage));
printf("Output voltage:\t\t\t%.02f\tV\n", output_voltage_a0 + (output_voltage_a1 * (float)status.output_voltage));
} else { /* outvoltage_action == NOTHING */ }
if (dc_action == READ || print_all_status) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment