line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::SCPI::Sense::Average; |
2
|
|
|
|
|
|
|
#ABSTRACT: Role for the SCPI SENSe:AVERage subsystem |
3
|
|
|
|
|
|
|
$Lab::Moose::Instrument::SCPI::Sense::Average::VERSION = '3.880'; |
4
|
3
|
|
|
3
|
|
1850
|
use v5.20; |
|
3
|
|
|
|
|
13
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
17
|
use Moose::Role; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
23
|
|
7
|
3
|
|
|
3
|
|
15954
|
use Lab::Moose::Instrument::Cache; |
|
3
|
|
|
|
|
21
|
|
|
3
|
|
|
|
|
28
|
|
8
|
|
|
|
|
|
|
use Lab::Moose::Instrument |
9
|
3
|
|
|
3
|
|
1980
|
qw/validated_channel_getter validated_channel_setter/; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
214
|
|
10
|
3
|
|
|
3
|
|
22
|
use MooseX::Params::Validate; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
24
|
|
11
|
3
|
|
|
3
|
|
1494
|
use Carp; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
171
|
|
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
51
|
use namespace::autoclean; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
20
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
cache sense_average_state => ( getter => 'sense_average_state_query' ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub sense_average_state_query { |
19
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
return $self->cached_sense_average_state( |
22
|
|
|
|
|
|
|
$self->query( command => "SENS${channel}:AVER?", %args ) ); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub sense_average_state { |
26
|
0
|
|
|
0
|
1
|
0
|
my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ ); |
27
|
0
|
|
|
|
|
0
|
$self->write( command => "SENS${channel}:AVER $value", %args ); |
28
|
0
|
|
|
|
|
0
|
return $self->cached_sense_average_state($value); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
cache sense_average_count => ( |
33
|
|
|
|
|
|
|
getter => 'sense_average_count_query', |
34
|
|
|
|
|
|
|
isa => 'Int' |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub sense_average_count_query { |
38
|
2
|
|
|
2
|
1
|
12
|
my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); |
39
|
|
|
|
|
|
|
|
40
|
2
|
|
|
|
|
16
|
return $self->cached_sense_average_count( |
41
|
|
|
|
|
|
|
$self->query( command => "SENS${channel}:AVER:COUN?", %args ) ); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub sense_average_count { |
45
|
2
|
|
|
2
|
1
|
13
|
my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ ); |
46
|
2
|
|
|
|
|
17
|
$self->write( command => "SENS${channel}:AVER:COUN $value", %args ); |
47
|
2
|
|
|
|
|
16
|
return $self->cached_sense_average_count($value); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
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.880 |
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 |