line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::SCPI::Unit; |
2
|
|
|
|
|
|
|
$Lab::Moose::Instrument::SCPI::Unit::VERSION = '3.880'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Role for SCPI UNIT subsystem. |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
12549
|
use v5.20; |
|
1
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
12
|
use Moose::Role; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
22
|
|
8
|
1
|
|
|
1
|
|
7507
|
use Lab::Moose::Instrument qw/setter_params getter_params validated_channel_setter validated_getter/; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
83
|
|
9
|
1
|
|
|
1
|
|
7
|
use Lab::Moose::Instrument::Cache; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
10
|
1
|
|
|
1
|
|
741
|
use MooseX::Params::Validate; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
11
|
1
|
|
|
1
|
|
560
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
255
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
cache unit_power => ( getter => 'unit_power_query' ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub unit_power_query { |
17
|
0
|
|
|
0
|
1
|
|
my ( $self, %args ) = validated_getter( \@_ ); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
return $self->cached_unit_power( |
20
|
|
|
|
|
|
|
$self->query( command => "UNIT:POWer?", %args ) ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub unit_power { |
24
|
0
|
|
|
0
|
1
|
|
my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ ); |
25
|
0
|
|
|
|
|
|
$self->write( |
26
|
|
|
|
|
|
|
command => sprintf( "UNIT:POWer %s", $value ), |
27
|
|
|
|
|
|
|
%args |
28
|
|
|
|
|
|
|
); |
29
|
0
|
|
|
|
|
|
$self->cached_unit_power($value); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding UTF-8 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Lab::Moose::Instrument::SCPI::Unit - Role for SCPI UNIT subsystem. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
version 3.880 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 METHODS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 unit_power_query |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 unit_power |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Set/Get amplitude units for the input, output and display. |
55
|
|
|
|
|
|
|
Allowed values are DBM|DBMV|DBUV|DBUA|V|W|A. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Copyright 2018 Eugeniy E. Mikhailov |
62
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
66
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |