File Coverage

blib/lib/Lab/Moose/Instrument/SCPI/Sense/Range.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 2 2 100.0
total 34 34 100.0


line stmt bran cond sub pod time code
1             package Lab::Moose::Instrument::SCPI::Sense::Range;
2             $Lab::Moose::Instrument::SCPI::Sense::Range::VERSION = '3.880';
3             #ABSTRACT: Role for the SCPI SENSe:$function:RANGe subsystem.
4              
5 5     5   3065 use v5.20;
  5         23  
6              
7 5     5   33 use Moose::Role;
  5         14  
  5         35  
8 5     5   26607 use Moose::Util::TypeConstraints 'enum';
  5         13  
  5         50  
9 5     5   2400 use Lab::Moose::Instrument::Cache;
  5         14  
  5         46  
10 5     5   3211 use Lab::Moose::Instrument qw/validated_getter validated_setter/;
  5         15  
  5         291  
11              
12 5     5   38 use namespace::autoclean;
  5         15  
  5         52  
13              
14              
15             requires 'cached_sense_function';
16              
17             cache sense_range => ( getter => 'sense_range_query' );
18              
19             sub sense_range_query {
20 20     20 1 9697 my ( $self, %args ) = validated_getter( \@_ );
21              
22 20         10100 my $func = $self->cached_sense_function();
23              
24 20         104 return $self->cached_sense_range(
25             $self->query( command => "SENS:$func:RANG?", %args ) );
26             }
27              
28             sub sense_range {
29 22     22 1 23573 my ( $self, $value, %args ) = validated_setter(
30             \@_,
31             );
32              
33 22         90 my $func = $self->cached_sense_function();
34              
35 22         198 $self->write( command => "SENS:$func:RANG $value", %args );
36              
37 22         163 $self->cached_sense_range($value);
38             }
39              
40             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.880
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