File Coverage

blib/lib/Lab/Moose/Instrument/SCPI/Sense/Bandwidth.pm
Criterion Covered Total %
statement 33 38 86.8
branch n/a
condition n/a
subroutine 12 14 85.7
pod 6 6 100.0
total 51 58 87.9


line stmt bran cond sub pod time code
1             package Lab::Moose::Instrument::SCPI::Sense::Bandwidth;
2             $Lab::Moose::Instrument::SCPI::Sense::Bandwidth::VERSION = '3.880';
3             #ABSTRACT: Role for the SCPI SENSe:BANDwidth subsystem
4              
5 4     4   2706 use v5.20;
  4         18  
6              
7 4     4   25 use Moose::Role;
  4         20  
  4         30  
8 4     4   21952 use Lab::Moose::Instrument::Cache;
  4         26  
  4         38  
9             use Lab::Moose::Instrument
10 4     4   2464 qw/validated_channel_getter validated_channel_setter/;
  4         15  
  4         272  
11 4     4   38 use MooseX::Params::Validate;
  4         25  
  4         30  
12 4     4   1964 use Moose::Util::TypeConstraints qw/enum/;
  4         15  
  4         42  
13 4     4   1991 use Carp;
  4         27  
  4         280  
14              
15 4     4   44 use namespace::autoclean;
  4         14  
  4         26  
16              
17              
18             cache sense_bandwidth_resolution =>
19             ( getter => 'sense_bandwidth_resolution_query' );
20              
21             sub sense_bandwidth_resolution_query {
22 6     6 1 3081 my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
23              
24 6         39 return $self->cached_sense_bandwidth_resolution(
25             $self->query( command => "SENS${channel}:BAND?", %args ) );
26             }
27              
28             sub sense_bandwidth_resolution {
29 6     6 1 18161 my ( $self, $channel, $value, %args ) = validated_channel_setter(
30             \@_,
31             value => { isa => 'Num' }
32             );
33 6         99 $self->write(
34             command => sprintf( "SENS%s:BAND %.17g", $channel, $value ),
35             %args
36             );
37 6         34 $self->cached_sense_bandwidth_resolution($value);
38             }
39              
40              
41             cache sense_bandwidth_video => ( getter => 'sense_bandwidth_video_query' );
42              
43             sub sense_bandwidth_video_query {
44 0     0 1 0 my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
45              
46 0         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     0 1 0 my ( $self, $channel, $value, %args ) = validated_channel_setter(
52             \@_,
53             value => { isa => 'Num' }
54             );
55 0         0 $self->write(
56             command => sprintf( "SENS%s:BAND:VIDEO %.17g", $channel, $value ),
57             %args
58             );
59 0         0 $self->cached_sense_bandwidth_video($value);
60             }
61              
62              
63             cache sense_bandwidth_resolution_select =>
64             ( getter => 'sense_bandwidth_resolution_select_query' );
65              
66             sub sense_bandwidth_resolution_select_query {
67 3     3 1 2700 my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
68              
69 3         18 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     3 1 6501 my ( $self, $channel, $value, %args ) = validated_channel_setter(
75             \@_,
76             value => { isa => enum( [qw/NORM HIGH/] ) }
77             );
78              
79 3         47 $self->write(
80             command => sprintf( "SENS%s:BAND:SEL %s", $channel, $value ), %args );
81 3         28 $self->cached_sense_bandwidth_resolution_select($value);
82             }
83              
84             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.880
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