line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::SCPI::Sense::Frequency; |
2
|
|
|
|
|
|
|
$Lab::Moose::Instrument::SCPI::Sense::Frequency::VERSION = '3.880'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Role for the SCPI SENSe:FREQuency subsystem |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
2560
|
use v5.20; |
|
4
|
|
|
|
|
24
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
24
|
use Moose::Role; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
64
|
|
8
|
4
|
|
|
4
|
|
21156
|
use Lab::Moose::Instrument::Cache; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
30
|
|
9
|
|
|
|
|
|
|
use Lab::Moose::Instrument |
10
|
4
|
|
|
4
|
|
2516
|
qw/validated_channel_getter validated_channel_setter/; |
|
4
|
|
|
|
|
24
|
|
|
4
|
|
|
|
|
225
|
|
11
|
4
|
|
|
4
|
|
36
|
use MooseX::Params::Validate; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
37
|
|
12
|
4
|
|
|
4
|
|
2026
|
use Carp; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
232
|
|
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
30
|
use namespace::autoclean; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
34
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
with 'Lab::Moose::Instrument::SCPI::Sense::Sweep'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
cache sense_frequency_start => ( getter => 'sense_frequency_start_query' ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub sense_frequency_start_query { |
22
|
6
|
|
|
6
|
1
|
1731
|
my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); |
23
|
|
|
|
|
|
|
|
24
|
6
|
|
|
|
|
39
|
return $self->cached_sense_frequency_start( |
25
|
|
|
|
|
|
|
$self->query( command => "SENS${channel}:FREQ:STAR?", %args ) ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub sense_frequency_start { |
29
|
4
|
|
|
4
|
1
|
16714
|
my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ ); |
30
|
4
|
|
|
|
|
55
|
$self->write( |
31
|
|
|
|
|
|
|
command => sprintf( "SENS%s:FREQ:STAR %.17g", $channel, $value ), |
32
|
|
|
|
|
|
|
%args |
33
|
|
|
|
|
|
|
); |
34
|
4
|
|
|
|
|
23
|
$self->cached_sense_frequency_start($value); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
cache sense_frequency_stop => ( getter => 'sense_frequency_stop_query' ); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub sense_frequency_stop_query { |
40
|
6
|
|
|
6
|
1
|
1601
|
my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); |
41
|
|
|
|
|
|
|
|
42
|
6
|
|
|
|
|
67
|
return $self->cached_sense_frequency_stop( |
43
|
|
|
|
|
|
|
$self->query( command => "SENS${channel}:FREQ:STOP?", %args ) ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub sense_frequency_stop { |
47
|
4
|
|
|
4
|
1
|
6581
|
my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ ); |
48
|
4
|
|
|
|
|
58
|
$self->write( |
49
|
|
|
|
|
|
|
command => sprintf( "SENS%s:FREQ:STOP %.17g", $channel, $value ), |
50
|
|
|
|
|
|
|
%args |
51
|
|
|
|
|
|
|
); |
52
|
4
|
|
|
|
|
18
|
$self->cached_sense_frequency_stop($value); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub sense_frequency_linear_array { |
57
|
9
|
|
|
9
|
1
|
42
|
my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); |
58
|
|
|
|
|
|
|
|
59
|
9
|
|
|
|
|
59
|
my $start = $self->cached_sense_frequency_start(); |
60
|
9
|
|
|
|
|
46
|
my $stop = $self->cached_sense_frequency_stop(); |
61
|
9
|
|
|
|
|
38
|
my $num_points = $self->cached_sense_sweep_points(); |
62
|
|
|
|
|
|
|
|
63
|
9
|
|
|
|
|
30
|
my $num_intervals = $num_points - 1; |
64
|
|
|
|
|
|
|
|
65
|
9
|
50
|
|
|
|
36
|
if ( $num_intervals == 0 ) { |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# Return a single point. |
68
|
0
|
|
|
|
|
0
|
return [$start]; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
9
|
|
|
|
|
19
|
my @result; |
72
|
|
|
|
|
|
|
|
73
|
9
|
|
|
|
|
29
|
for my $i ( 0 .. $num_intervals ) { |
74
|
321
|
|
|
|
|
560
|
my $f = $start + ( $stop - $start ) * ( $i / $num_intervals ); |
75
|
321
|
|
|
|
|
541
|
push @result, $f; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
9
|
|
|
|
|
37
|
return \@result; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=pod |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=encoding UTF-8 |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 NAME |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Lab::Moose::Instrument::SCPI::Sense::Frequency - Role for the SCPI SENSe:FREQuency subsystem |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 VERSION |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
version 3.880 |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 METHODS |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 sense_frequency_start_query |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
my $freq = $self->sense_frequency_start_query(); |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Query the starting point of the frequency sweep. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 sense_frequency_start |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
$self->sense_frequency_start(value => 4e9); |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Set the starting point of the frequency sweep. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 sense_frequency_stop_query |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 sense_frequency_stop |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Query and set the end point of the frequency sweep. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head2 sense_frequency_linear_array |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
my $arrayref = $self->sense_frequency_linear_array(); |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Helper method to get an arrayref of all points in the frequency sweep. |
122
|
|
|
|
|
|
|
Does not provide a cached form, but will read it's input from cache. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Copyright 2016 Simon Reinhardt |
129
|
|
|
|
|
|
|
2017 Andreas K. Huettel, Simon Reinhardt |
130
|
|
|
|
|
|
|
2018 Eugeniy E. Mikhailov |
131
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
135
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=cut |