Moose/Instrument/SCPI/Sense/Impedance.pm

filter: Statementstmt 94.2% 33 / 35 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 92.0% 46 / 50 CC 3 SCAR 3.3
CC
3
Cov
90%
sense_impedance_auto_query
2.1
sense_impedance_auto
2.1
BEGIN
1.0
CRAP 1.4
« Moose/Sweep/Step/Voltage.pm ↑ Summary Moose/Instrument/RS_ZVA.pm »
1 package Lab::Moose::Instrument::SCPI::Sense::Impedance;
2 2 $Lab::Moose::Instrument::SCPI::Sense::Impedance::VERSION = '3.931';
3 #ABSTRACT: Role for the HP/Agilent/Keysight SCPI SENSe:$function:IMPedance subsystem
4  
5 2 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Lab::Moose::Instrument qw/validated_getter validated_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Moose::Util::TypeConstraints 'enum';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 2 requires 'cached_sense_function';
16  
17 2 cache sense_impedance_auto => ( getter => 'sense_impedance_auto_query' );
18  
19 3 ▶sub sense_impedance_auto_query {
Subroutine sense_impedance_auto_query: called CC=2 SCAR=7.4
Pod documented
20 3 my ( $self, %args ) = validated_getter( \@_ );
21  
22 3 my $func = $self->cached_sense_function();
23 3 ▶ if ( $func ne 'VOLT' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($func ne "VOLT") 0 3 3
24 0 croak "query impedance with function $func";
25 }
26 3 return $self->cached_sense_impedance_auto(
27 $self->query( command => "SENS:$func:IMP:AUTO?", %args ) );
28 }
29  
30 3 ▶sub sense_impedance_auto {
Subroutine sense_impedance_auto: called CC=2 SCAR=7.2
Pod documented
31 3 my ( $self, $value, %args ) = validated_setter(
32 \@_,
33 value => { isa => enum( [ 0, 1 ] ) },
34 );
35  
36 3 my $func = $self->cached_sense_function();
37 3 ▶ if ( $func ne 'VOLT' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($func ne "VOLT") 0 3 3
38 0 croak "query impedance with function $func";
39 }
40 3 $self->write( command => "SENS:$func:IMP:AUTO $value", %args );
41  
42 3 $self->cached_sense_impedance_auto($value);
43 }
44  
45 2 1;
46  
47 __END__
« Moose/Sweep/Step/Voltage.pm ↑ Summary Moose/Instrument/RS_ZVA.pm »