Moose/Instrument/HP34420A.pm

filter: Statementstmt 88.8% 40 / 45 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 12 / 14 Podpod 83.3% 5 / 6 totaltotal 87.6% 57 / 65 CC 1 SCAR 1.3
CC
1
Cov
89%
input_filter_state_query
2.0
input_filter_state
2.0
BEGIN
1.0
CRAP 1.1
« Moose/Instrument/SCPI/Sense/Sweep.pm ↑ Summary Moose/Instrument/SCPI/Sense/Bandwidth.pm »
1 package Lab::Moose::Instrument::HP34420A;
2 2 $Lab::Moose::Instrument::HP34420A::VERSION = '3.931';
3 #ABSTRACT: HP 34420A nanovolt meter.
4  
5 2 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # So far only one channel. Could add support for two channels
8 # by using validated_channel_(setter/getter) in the SCPI/SENSE roles.
9  
10 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Moose::Util::TypeConstraints 'enum';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use Lab::Moose::Instrument qw/validated_getter validated_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 extends 'Lab::Moose::Instrument';
19  
20 2 with qw(
21 Lab::Moose::Instrument::Common
22 Lab::Moose::Instrument::SCPI::Sense::Function
23 Lab::Moose::Instrument::SCPI::Sense::Range
24 Lab::Moose::Instrument::SCPI::Sense::NPLC
25 );
26  
27 1 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
28 1 my $self = shift;
29 1 $self->clear();
30 1 $self->cls();
31 }
32  
33  
34  
35 1 ▶sub get_value {
Subroutine get_value: called CC=1 SCAR=0.0
Pod documented
36 1 my ( $self, %args ) = validated_getter( \@_ );
37 1 return $self->query( command => 'READ?', %args );
38 }
39  
40  
41 2 cache route_terminals => ( getter => 'route_terminals_query' );
42  
43 2 ▶sub route_terminals_query {
Subroutine route_terminals_query: called CC=1 SCAR=0.0
Pod documented
44 2 my ( $self, %args ) = validated_getter( \@_ );
45 2 return $self->cached_route_terminals(
46 $self->query( command => 'ROUT:TERM?', %args ) );
47 }
48  
49 3 ▶sub route_terminals {
Subroutine route_terminals: called CC=1 SCAR=0.0
Pod documented
50 3 my ( $self, $value, %args ) = validated_setter(
51 \@_,
52 value => { isa => enum( [qw/FRON FRON1 FRON2/] ) }
53 );
54 3 $self->write( command => "ROUT:TERM $value" );
55 3 $self->cached_route_terminals($value);
56 }
57  
58  
59 2 cache input_filter_state => ( getter => 'input_filter_state_query' );
60  
61 0 ▶sub input_filter_state_query {
Subroutine input_filter_state_query: not called CC=1 SCAR=6.9
Pod documented
62 0 my ( $self, %args ) = validated_getter( \@_ );
63 0 return $self->cached_input_filter_state(
64 $self->query( command => 'INP:FILT:STAT?', %args ) );
65 }
66  
67 0 ▶sub input_filter_state {
Subroutine input_filter_state: not called CC=1 SCAR=6.9
Pod documented
68 0 my ( $self, $value, %args ) = validated_setter(
69 \@_,
70 value => { isa => enum( [ 0 .. 1 ] ) }
71 );
72 0 $self->write( command => "INP:FILT:STAT? $value", %args );
73 0 return $self->cached_input_filter_state($value);
74 }
75  
76 2 __PACKAGE__->meta()->make_immutable();
77  
78 2 1;
79  
80 __END__
« Moose/Instrument/SCPI/Sense/Sweep.pm ↑ Summary Moose/Instrument/SCPI/Sense/Bandwidth.pm »