| 1 | package Lab::Moose::Instrument::SCPI::Sense::Range; | ||
| 2 | 5 | $Lab::Moose::Instrument::SCPI::Sense::Range::VERSION = '3.881'; | |
| 3 | #ABSTRACT: Role for the SCPI SENSe:$function:RANGe subsystem. | ||
| 4 | |||
| 5 | 5 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 5 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 5 | ▶ | use Moose::Util::TypeConstraints 'enum'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 5 | ▶ | use Lab::Moose::Instrument::Cache; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 5 | ▶ | use Lab::Moose::Instrument qw/validated_getter validated_setter/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 5 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | |||
| 15 | 5 | requires 'cached_sense_function'; | |
| 16 | |||
| 17 | 5 | cache sense_range => ( getter => 'sense_range_query' ); | |
| 18 | |||
| 19 | sub sense_range_query { | ||
| 20 | 20 | ▶ | my ( $self, %args ) = validated_getter( \@_ ); |
|
Subroutine
sense_range_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 21 | |||
| 22 | 20 | my $func = $self->cached_sense_function(); | |
| 23 | |||
| 24 | 20 | return $self->cached_sense_range( | |
| 25 | $self->query( command => "SENS:$func:RANG?", %args ) ); | ||
| 26 | } | ||
| 27 | |||
| 28 | sub sense_range { | ||
| 29 | 22 | ▶ | my ( $self, $value, %args ) = validated_setter( |
|
Subroutine
sense_range: called CC=1 SCAR=0.0
Pod
documented
| |||
| 30 | \@_, | ||
| 31 | ); | ||
| 32 | |||
| 33 | 22 | my $func = $self->cached_sense_function(); | |
| 34 | |||
| 35 | 22 | $self->write( command => "SENS:$func:RANG $value", %args ); | |
| 36 | |||
| 37 | 22 | $self->cached_sense_range($value); | |
| 38 | } | ||
| 39 | |||
| 40 | 5 | 1; | |
| 41 | |||
| 42 | __END__ | ||
| 43 | |||
| 44 | =pod | ||
| 45 | |||
| 46 | =encoding UTF-8 | ||
| 47 | |||
| 48 | =head1 NAME | ||
| 49 | |||
| 50 | Lab::Moose::Instrument::SCPI::Sense::Range - Role for the SCPI SENSe:$function:RANGe subsystem. | ||
| 51 | |||
| 52 | =head1 VERSION | ||
| 53 | |||
| 54 | version 3.881 | ||
| 55 | |||
| 56 | =head1 METHODS | ||
| 57 | |||
| 58 | =head2 sense_range_query | ||
| 59 | |||
| 60 | =head2 sense_range | ||
| 61 | |||
| 62 | $self->sense_range(value => '0.001'); | ||
| 63 | |||
| 64 | Query/Set the input range. | ||
| 65 | |||
| 66 | =head1 COPYRIGHT AND LICENSE | ||
| 67 | |||
| 68 | This software is copyright (c) 2023 by the Lab::Measurement team; in detail: | ||
| 69 | |||
| 70 | Copyright 2017-2018 Simon Reinhardt | ||
| 71 | 2020 Andreas K. Huettel | ||
| 72 | |||
| 73 | |||
| 74 | This is free software; you can redistribute it and/or modify it under | ||
| 75 | the same terms as the Perl 5 programming language system itself. | ||
| 76 | |||
| 77 | =cut | ||