Moose/Instrument/SCPI/Sense/Null.pm

filter: Statementstmt 100% 39 / 39 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 100% 4 / 4 totaltotal 100% 54 / 54 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/NPLC.pm ↑ Summary Moose/Instrument/SCPI/Sense/Range.pm »
1 package Lab::Moose::Instrument::SCPI::Sense::Null;
2 2 $Lab::Moose::Instrument::SCPI::Sense::Null::VERSION = '3.931';
3 #ABSTRACT: Role for the HP/Agilent/Keysight SCPI SENSe:$function:NULL 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_null_state => ( getter => 'sense_null_state_query' );
18  
19 3 ▶sub sense_null_state_query {
Subroutine sense_null_state_query: called CC=1 SCAR=0.0
Pod documented
20 3 my ( $self, %args ) = validated_getter( \@_ );
21  
22 3 my $func = $self->cached_sense_function();
23 3 return $self->cached_sense_null_state(
24 $self->query( command => "SENS:$func:NULL:STAT?", %args ) );
25 }
26  
27 3 ▶sub sense_null_state {
Subroutine sense_null_state: called CC=1 SCAR=0.0
Pod documented
28 3 my ( $self, $value, %args ) = validated_setter(
29 \@_,
30 value => { isa => enum( [ 0, 1 ] ) },
31 );
32  
33 3 my $func = $self->cached_sense_function();
34 3 $self->write( command => "SENS:$func:NULL:STATE $value", %args );
35  
36 3 $self->cached_sense_null_state($value);
37 }
38  
39  
40 2 cache sense_null_value => ( getter => 'sense_null_value_query' );
41  
42 3 ▶sub sense_null_value_query {
Subroutine sense_null_value_query: called CC=1 SCAR=0.0
Pod documented
43 3 my ( $self, %args ) = validated_getter( \@_ );
44  
45 3 my $func = $self->cached_sense_function();
46  
47 3 return $self->cached_sense_null_value(
48 $self->query( command => "SENS:$func:NULL:VAL?", %args ) );
49 }
50  
51 3 ▶sub sense_null_value {
Subroutine sense_null_value: called CC=1 SCAR=0.0
Pod documented
52 3 my ( $self, $value, %args ) = validated_setter(
53 \@_,
54 value => { isa => 'Num' },
55 );
56  
57 3 my $func = $self->cached_sense_function();
58  
59 3 $self->write( command => "SENS:$func:NULL:VAL $value", %args );
60  
61 3 $self->cached_sense_null_value($value);
62 }
63  
64 2 1;
65  
66 __END__
« Moose/Instrument/SCPI/Sense/NPLC.pm ↑ Summary Moose/Instrument/SCPI/Sense/Range.pm »