Moose/Instrument/SCPI/Sense/Bandwidth.pm

filter: Statementstmt 88.3% 38 / 43 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 12 / 14 Podpod 100% 6 / 6 totaltotal 88.8% 56 / 63 CC 1 SCAR 1.3
CC
1
Cov
88%
sense_bandwidth_video_query
2.0
sense_bandwidth_video
2.0
BEGIN
1.0
CRAP 1.1
« Moose/Instrument/HP34420A.pm ↑ Summary Moose/Instrument/SCPI/Instrument.pm »
1 package Lab::Moose::Instrument::SCPI::Sense::Bandwidth;
2 4 $Lab::Moose::Instrument::SCPI::Sense::Bandwidth::VERSION = '3.931';
3 #ABSTRACT: Role for the SCPI SENSe:BANDwidth subsystem
4  
5 4 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 use Lab::Moose::Instrument
10 4 ▶ qw/validated_channel_getter validated_channel_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Moose::Util::TypeConstraints qw/enum/;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17  
18 4 cache sense_bandwidth_resolution =>
19 ( getter => 'sense_bandwidth_resolution_query' );
20  
21 6 ▶sub sense_bandwidth_resolution_query {
Subroutine sense_bandwidth_resolution_query: called CC=1 SCAR=0.0
Pod documented
22 6 my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
23  
24 6 return $self->cached_sense_bandwidth_resolution(
25 $self->query( command => "SENS${channel}:BAND?", %args ) );
26 }
27  
28 6 ▶sub sense_bandwidth_resolution {
Subroutine sense_bandwidth_resolution: called CC=1 SCAR=0.0
Pod documented
29 6 my ( $self, $channel, $value, %args ) = validated_channel_setter(
30 \@_,
31 value => { isa => 'Num' }
32 );
33 6 $self->write(
34 command => sprintf( "SENS%s:BAND %.17g", $channel, $value ),
35 %args
36 );
37 6 $self->cached_sense_bandwidth_resolution($value);
38 }
39  
40  
41 4 cache sense_bandwidth_video => ( getter => 'sense_bandwidth_video_query' );
42  
43 0 ▶sub sense_bandwidth_video_query {
Subroutine sense_bandwidth_video_query: not called CC=1 SCAR=6.9
Pod documented
44 0 my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
45  
46 0 return $self->cached_sense_bandwidth_video(
47 $self->query( command => "SENS${channel}:BAND:VIDEO?", %args ) );
48 }
49  
50 0 ▶sub sense_bandwidth_video {
Subroutine sense_bandwidth_video: not called CC=1 SCAR=6.9
Pod documented
51 0 my ( $self, $channel, $value, %args ) = validated_channel_setter(
52 \@_,
53 value => { isa => 'Num' }
54 );
55 0 $self->write(
56 command => sprintf( "SENS%s:BAND:VIDEO %.17g", $channel, $value ),
57 %args
58 );
59 0 $self->cached_sense_bandwidth_video($value);
60 }
61  
62  
63 4 cache sense_bandwidth_resolution_select =>
64 ( getter => 'sense_bandwidth_resolution_select_query' );
65  
66 3 ▶sub sense_bandwidth_resolution_select_query {
Subroutine sense_bandwidth_resolution_select_query: called CC=1 SCAR=0.0
Pod documented
67 3 my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
68  
69 3 return $self->cached_sense_bandwidth_resolution(
70 $self->query( command => "SENS${channel}:BAND:SEL?", %args ) );
71 }
72  
73 3 ▶sub sense_bandwidth_resolution_select {
Subroutine sense_bandwidth_resolution_select: called CC=1 SCAR=0.0
Pod documented
74 3 my ( $self, $channel, $value, %args ) = validated_channel_setter(
75 \@_,
76 value => { isa => enum( [qw/NORM HIGH/] ) }
77 );
78  
79 3 $self->write(
80 command => sprintf( "SENS%s:BAND:SEL %s", $channel, $value ), %args );
81 3 $self->cached_sense_bandwidth_resolution_select($value);
82 }
83  
84 4 1;
85  
86 __END__
« Moose/Instrument/HP34420A.pm ↑ Summary Moose/Instrument/SCPI/Instrument.pm »