Moose/Instrument/SCPI/Sense/Average.pm

filter: Statementstmt 85.2% 29 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 100% 4 / 4 totaltotal 85.7% 42 / 49 SCAR 0.0
CC
1
Cov
85%
sense_average_state_query
2.0
sense_average_state
2.0
BEGIN
1.0
CRAP 1.0
« Moose/Instrument/SCPI/Sense/Protection.pm ↑ Summary Moose/Instrument/HP34420A.pm »
1 package Lab::Moose::Instrument::SCPI::Sense::Average;
2 #ABSTRACT: Role for the SCPI SENSe:AVERage subsystem
3 3 $Lab::Moose::Instrument::SCPI::Sense::Average::VERSION = '3.881';
4 3 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 use Lab::Moose::Instrument
9 3 ▶ qw/validated_channel_getter validated_channel_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 cache sense_average_state => ( getter => 'sense_average_state_query' );
16  
17  
18 sub sense_average_state_query {
19 0 ▶ my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
Subroutine sense_average_state_query: not called CC=1 SCAR=6.9
Pod documented
20  
21 0 return $self->cached_sense_average_state(
22 $self->query( command => "SENS${channel}:AVER?", %args ) );
23 }
24  
25 sub sense_average_state {
26 0 ▶ my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ );
Subroutine sense_average_state: not called CC=1 SCAR=6.9
Pod documented
27 0 $self->write( command => "SENS${channel}:AVER $value", %args );
28 0 return $self->cached_sense_average_state($value);
29 }
30  
31  
32 3 cache sense_average_count => (
33 getter => 'sense_average_count_query',
34 isa => 'Int'
35 );
36  
37 sub sense_average_count_query {
38 2 ▶ my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
Subroutine sense_average_count_query: called CC=1 SCAR=0.0
Pod documented
39  
40 2 return $self->cached_sense_average_count(
41 $self->query( command => "SENS${channel}:AVER:COUN?", %args ) );
42 }
43  
44 sub sense_average_count {
45 2 ▶ my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ );
Subroutine sense_average_count: called CC=1 SCAR=0.0
Pod documented
46 2 $self->write( command => "SENS${channel}:AVER:COUN $value", %args );
47 2 return $self->cached_sense_average_count($value);
48 }
49  
50 3 1;
51  
52 __END__
53  
54 =pod
55  
56 =encoding UTF-8
57  
58 =head1 NAME
59  
60 Lab::Moose::Instrument::SCPI::Sense::Average - Role for the SCPI SENSe:AVERage subsystem
61  
62 =head1 VERSION
63  
64 version 3.881
65  
66 =head1 METHODS
67  
68 =head2 sense_average_state_query
69  
70 =head2 sense_average_state
71  
72 Query/Set whether averaging is turned on/off.
73  
74 =head2 sense_average_count_query
75  
76 =head2 sense_average_count
77  
78 Query/Set the number of measurements used for an average.
79  
80 =head1 COPYRIGHT AND LICENSE
81  
82 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
83  
84 Copyright 2016 Simon Reinhardt
85 2017 Andreas K. Huettel, Simon Reinhardt
86 2020 Andreas K. Huettel
87  
88  
89 This is free software; you can redistribute it and/or modify it under
90 the same terms as the Perl 5 programming language system itself.
91  
92 =cut
« Moose/Instrument/SCPI/Sense/Protection.pm ↑ Summary Moose/Instrument/HP34420A.pm »