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 SCAR 0.0
CC
1
Cov
88%
sense_bandwidth_video_query
2.0
sense_bandwidth_video
2.0
BEGIN
1.0
CRAP 1.0
« Moose/Instrument/SCPI/Sense/Sweep.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.881';
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 sub sense_bandwidth_resolution_query {
22 6 ▶ my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
Subroutine sense_bandwidth_resolution_query: called CC=1 SCAR=0.0
Pod documented
23  
24 6 return $self->cached_sense_bandwidth_resolution(
25 $self->query( command => "SENS${channel}:BAND?", %args ) );
26 }
27  
28 sub sense_bandwidth_resolution {
29 6 ▶ my ( $self, $channel, $value, %args ) = validated_channel_setter(
Subroutine sense_bandwidth_resolution: called CC=1 SCAR=0.0
Pod documented
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 sub sense_bandwidth_video_query {
44 0 ▶ my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
Subroutine sense_bandwidth_video_query: not called CC=1 SCAR=6.9
Pod documented
45  
46 0 return $self->cached_sense_bandwidth_video(
47 $self->query( command => "SENS${channel}:BAND:VIDEO?", %args ) );
48 }
49  
50 sub sense_bandwidth_video {
51 0 ▶ my ( $self, $channel, $value, %args ) = validated_channel_setter(
Subroutine sense_bandwidth_video: not called CC=1 SCAR=6.9
Pod documented
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 sub sense_bandwidth_resolution_select_query {
67 3 ▶ my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
Subroutine sense_bandwidth_resolution_select_query: called CC=1 SCAR=0.0
Pod documented
68  
69 3 return $self->cached_sense_bandwidth_resolution(
70 $self->query( command => "SENS${channel}:BAND:SEL?", %args ) );
71 }
72  
73 sub sense_bandwidth_resolution_select {
74 3 ▶ my ( $self, $channel, $value, %args ) = validated_channel_setter(
Subroutine sense_bandwidth_resolution_select: called CC=1 SCAR=0.0
Pod documented
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__
87  
88 =pod
89  
90 =encoding UTF-8
91  
92 =head1 NAME
93  
94 Lab::Moose::Instrument::SCPI::Sense::Bandwidth - Role for the SCPI SENSe:BANDwidth subsystem
95  
96 =head1 VERSION
97  
98 version 3.881
99  
100 =head1 METHODS
101  
102 =head2 sense_bandwidth_resolution_query
103  
104 =head2 sense_bandwidth_resolution
105  
106 Query/Set the bandwidth resolution (in Hz).
107  
108 =head2 sense_bandwidth_video_query
109  
110 =head2 sense_bandwidth_video
111  
112 Query/Set the video bandwidth (in Hz).
113  
114 =head2 sense_bandwidth_resolution_select_query
115  
116 =head2 sense_bandwidth_resolution_select
117  
118 Query/Set selectivity of IF filter. Can be NORM or HIGH.
119  
120 Used by R&S VNAs.
121  
122 =head1 COPYRIGHT AND LICENSE
123  
124 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
125  
126 Copyright 2017 Andreas K. Huettel, Simon Reinhardt
127 2018 Eugeniy E. Mikhailov
128 2020 Andreas K. Huettel
129  
130  
131 This is free software; you can redistribute it and/or modify it under
132 the same terms as the Perl 5 programming language system itself.
133  
134 =cut
« Moose/Instrument/SCPI/Sense/Sweep.pm ↑ Summary Moose/Instrument/SCPI/Instrument.pm »