fix param units
parent
03874c0bfa
commit
01e97de2a0
|
@ -226,6 +226,7 @@ defmodule FarmbotFirmware.Param do
|
|||
@seconds "(seconds)"
|
||||
@steps "(steps)"
|
||||
@steps_per_mm "(steps/mm)"
|
||||
@steps_per_s "(steps/s)"
|
||||
@milliamps "(milliamps)"
|
||||
|
||||
@doc "Translates a param to a human readable string"
|
||||
|
@ -349,31 +350,31 @@ defmodule FarmbotFirmware.Param do
|
|||
do: {"steps per mm, z-axis", @steps_per_mm, format_float(value)}
|
||||
|
||||
def to_human(:movement_min_spd_x, value),
|
||||
do: {"minimum speed, x-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"minimum speed, x-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_min_spd_y, value),
|
||||
do: {"minimum speed, y-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"minimum speed, y-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_min_spd_z, value),
|
||||
do: {"minimum speed, z-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"minimum speed, z-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_home_spd_x, value),
|
||||
do: {"homing speed, x-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"homing speed, x-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_home_spd_y, value),
|
||||
do: {"homing speed, y-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"homing speed, y-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_home_spd_z, value),
|
||||
do: {"homing speed, z-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"homing speed, z-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_max_spd_x, value),
|
||||
do: {"max speed, x-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"max speed, x-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_max_spd_y, value),
|
||||
do: {"max speed, y-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"max speed, y-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_max_spd_z, value),
|
||||
do: {"max speed, z-axis", @steps_per_mm, format_float(value)}
|
||||
do: {"max speed, z-axis", @steps_per_s, format_float(value)}
|
||||
|
||||
def to_human(:movement_invert_2_endpoints_x, value),
|
||||
do: {"invert endstops, x-axis", nil, format_bool(value)}
|
||||
|
@ -412,13 +413,13 @@ defmodule FarmbotFirmware.Param do
|
|||
do: {"microsteps, z-axis", nil, format_float(value)}
|
||||
|
||||
def to_human(:encoder_enabled_x, value),
|
||||
do: {"enable encoders, x-axis", nil, format_bool(value)}
|
||||
do: {"enable encoders / stall detection, x-axis", nil, format_bool(value)}
|
||||
|
||||
def to_human(:encoder_enabled_y, value),
|
||||
do: {"enable encoders, y-axis", nil, format_bool(value)}
|
||||
do: {"enable encoders / stall detection, y-axis", nil, format_bool(value)}
|
||||
|
||||
def to_human(:encoder_enabled_z, value),
|
||||
do: {"enable encoders, z-axis", nil, format_bool(value)}
|
||||
do: {"enable encoders / stall detection, z-axis", nil, format_bool(value)}
|
||||
|
||||
def to_human(:encoder_type_x, value),
|
||||
do: {"encoder type, x-axis", nil, format_float(value)}
|
||||
|
@ -430,13 +431,13 @@ defmodule FarmbotFirmware.Param do
|
|||
do: {"encoder type, z-axis", nil, format_float(value)}
|
||||
|
||||
def to_human(:encoder_missed_steps_max_x, value),
|
||||
do: {"max missed steps, x-axis", nil, format_float(value)}
|
||||
do: {"max missed steps, x-axis", @steps, format_float(value)}
|
||||
|
||||
def to_human(:encoder_missed_steps_max_y, value),
|
||||
do: {"max missed steps, y-axis", nil, format_float(value)}
|
||||
do: {"max missed steps, y-axis", @steps, format_float(value)}
|
||||
|
||||
def to_human(:encoder_missed_steps_max_z, value),
|
||||
do: {"max missed steps, z-axis", nil, format_float(value)}
|
||||
do: {"max missed steps, z-axis", @steps, format_float(value)}
|
||||
|
||||
def to_human(:encoder_scaling_x, value),
|
||||
do: {"encoder scaling, x-axis", nil, format_float(value)}
|
||||
|
@ -448,13 +449,13 @@ defmodule FarmbotFirmware.Param do
|
|||
do: {"encoder scaling, z-axis", nil, format_float(value)}
|
||||
|
||||
def to_human(:encoder_missed_steps_decay_x, value),
|
||||
do: {"encoder missed steps decay, x-axis", nil, format_float(value)}
|
||||
do: {"missed step decay, x-axis", @steps, format_float(value)}
|
||||
|
||||
def to_human(:encoder_missed_steps_decay_y, value),
|
||||
do: {"encoder missed steps decay, y-axis", nil, format_float(value)}
|
||||
do: {"missed step decay, y-axis", @steps, format_float(value)}
|
||||
|
||||
def to_human(:encoder_missed_steps_decay_z, value),
|
||||
do: {"encoder missed steps decay, z-axis", nil, format_float(value)}
|
||||
do: {"missed step decay, z-axis", @steps, format_float(value)}
|
||||
|
||||
def to_human(:encoder_use_for_pos_x, value),
|
||||
do: {"use encoders for positioning, x-axis", nil, format_bool(value)}
|
||||
|
|
|
@ -5,6 +5,8 @@ defmodule FarmbotFirmware.ParamTest do
|
|||
test "to_human()" do
|
||||
float_value = 1.23
|
||||
seconds = "(seconds)"
|
||||
steps = "(steps)"
|
||||
steps_per_s = "(steps/s)"
|
||||
steps_per_mm = "(steps/mm)"
|
||||
|
||||
assert Param.to_human(:param_test, 1) ==
|
||||
|
@ -98,31 +100,31 @@ defmodule FarmbotFirmware.ParamTest do
|
|||
{"steps per mm, z-axis", steps_per_mm, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_min_spd_x, float_value) ==
|
||||
{"minimum speed, x-axis", steps_per_mm, "1.2"}
|
||||
{"minimum speed, x-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_min_spd_y, float_value) ==
|
||||
{"minimum speed, y-axis", steps_per_mm, "1.2"}
|
||||
{"minimum speed, y-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_min_spd_z, float_value) ==
|
||||
{"minimum speed, z-axis", steps_per_mm, "1.2"}
|
||||
{"minimum speed, z-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_home_spd_x, float_value) ==
|
||||
{"homing speed, x-axis", steps_per_mm, "1.2"}
|
||||
{"homing speed, x-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_home_spd_y, float_value) ==
|
||||
{"homing speed, y-axis", steps_per_mm, "1.2"}
|
||||
{"homing speed, y-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_home_spd_z, float_value) ==
|
||||
{"homing speed, z-axis", steps_per_mm, "1.2"}
|
||||
{"homing speed, z-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_max_spd_x, float_value) ==
|
||||
{"max speed, x-axis", steps_per_mm, "1.2"}
|
||||
{"max speed, x-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_max_spd_y, float_value) ==
|
||||
{"max speed, y-axis", steps_per_mm, "1.2"}
|
||||
{"max speed, y-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_max_spd_z, float_value) ==
|
||||
{"max speed, z-axis", steps_per_mm, "1.2"}
|
||||
{"max speed, z-axis", steps_per_s, "1.2"}
|
||||
|
||||
assert Param.to_human(:movement_invert_2_endpoints_x, 1) ==
|
||||
{"invert endstops, x-axis", nil, true}
|
||||
|
@ -133,14 +135,14 @@ defmodule FarmbotFirmware.ParamTest do
|
|||
assert Param.to_human(:movement_invert_2_endpoints_z, 1) ==
|
||||
{"invert endstops, z-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:encoder_enabled_x, 1)
|
||||
{"enable encoders, x-axis", nil, true}
|
||||
assert Param.to_human(:encoder_enabled_x, 1) ==
|
||||
{"enable encoders / stall detection, x-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:encoder_enabled_y, 1)
|
||||
{"enable encoders, y-axis", nil, true}
|
||||
assert Param.to_human(:encoder_enabled_y, 1) ==
|
||||
{"enable encoders / stall detection, y-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:encoder_enabled_z, 1)
|
||||
{"enable encoders, z-axis", nil, true}
|
||||
assert Param.to_human(:encoder_enabled_z, 1) ==
|
||||
{"enable encoders / stall detection, z-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:encoder_type_x, float_value) ==
|
||||
{"encoder type, x-axis", nil, "1.2"}
|
||||
|
@ -161,13 +163,13 @@ defmodule FarmbotFirmware.ParamTest do
|
|||
{"encoder scaling, z-axis", nil, "1.2"}
|
||||
|
||||
assert Param.to_human(:encoder_missed_steps_decay_x, float_value) ==
|
||||
{"encoder missed steps decay, x-axis", nil, "1.2"}
|
||||
{"missed step decay, x-axis", @steps, "1.2"}
|
||||
|
||||
assert Param.to_human(:encoder_missed_steps_decay_y, float_value) ==
|
||||
{"encoder missed steps decay, y-axis", nil, "1.2"}
|
||||
{"missed step decay, y-axis", @steps, "1.2"}
|
||||
|
||||
assert Param.to_human(:encoder_missed_steps_decay_z, float_value) ==
|
||||
{"encoder missed steps decay, z-axis", nil, "1.2"}
|
||||
{"missed step decay, z-axis", @steps, "1.2"}
|
||||
|
||||
assert Param.to_human(:encoder_use_for_pos_x, 1) ==
|
||||
{"use encoders for positioning, x-axis", nil, true}
|
||||
|
@ -178,14 +180,14 @@ defmodule FarmbotFirmware.ParamTest do
|
|||
assert Param.to_human(:encoder_use_for_pos_z, 1) ==
|
||||
{"use encoders for positioning, z-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:encoder_invert_x, 1)
|
||||
{"invert encoders, x-axis", nil, true}
|
||||
assert Param.to_human(:encoder_invert_x, 1) ==
|
||||
{"invert encoders, x-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:encoder_invert_y, 1)
|
||||
{"invert encoders, y-axis", nil, true}
|
||||
assert Param.to_human(:encoder_invert_y, 1) ==
|
||||
{"invert encoders, y-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:encoder_invert_z, 1)
|
||||
{"invert encoders, z-axis", nil, true}
|
||||
assert Param.to_human(:encoder_invert_z, 1) ==
|
||||
{"invert encoders, z-axis", nil, true}
|
||||
|
||||
assert Param.to_human(:movement_stop_at_max_x, 1) ==
|
||||
{"stop at max, x-axis", nil, true}
|
||||
|
|
Loading…
Reference in New Issue