Moose/Instrument/SCPI/Sense/Range.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 100% 38 / 38 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Moose/Instrument/SCPI/Sense/Null.pm ↑ Summary Moose/Instrument/SCPI/Source/Function.pm »
1 package Lab::Moose::Instrument::SCPI::Sense::Range;
2 5 $Lab::Moose::Instrument::SCPI::Sense::Range::VERSION = '3.931';
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 20 ▶sub sense_range_query {
Subroutine sense_range_query: called CC=1 SCAR=0.0
Pod documented
20 20 my ( $self, %args ) = validated_getter( \@_ );
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 22 ▶sub sense_range {
Subroutine sense_range: called CC=1 SCAR=0.0
Pod documented
29 22 my ( $self, $value, %args ) = validated_setter(
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__
« Moose/Instrument/SCPI/Sense/Null.pm ↑ Summary Moose/Instrument/SCPI/Source/Function.pm »