- REQUIRED METHODS
- COPYRIGHT AND LICENSE
Lab::Moose::Instrument::AdjustRange - Role for automatic adjustment of measurement ranges.
This role provides the
'adjust_measurement_range' method, which selects a measurement range suitable for the current input signal.
my $value = $instrument->get_value(); my $old_range = $instrument->adjust_measurement_range( value => $value, verbose => 1, ); my $new_range = $instrument->get_range();
To limit the allowed ranges, supply an arrayref with allowed ranges:
$instrument->adjust_measurement_range( value => ..., allowed_ranges => [0.1, 10], );
verbose is set, carp whenever the measurement range is changed.
By default, the range is changed, whenever the signal exceeds 100% of the measurement range, this factor can be adjusted with the
$instrument->adjust_measurement_range( ..., ..., safety_factor => 0.8, # change range when signal is at 80% of current range );
Arrayref with allowed ranges
$instrument->set_range(value => $new_range);
Set measurement range.
Get current range from cache.
This software is copyright (c) 2018 by the Lab::Measurement team; in detail:
Copyright 2018 Simon Reinhardt
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.