Moose/Instrument/SCPI/Source/Power.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 100% 39 / 39 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Moose/Instrument/SCPI/Source/Level.pm ↑ Summary Moose/Instrument/SCPI/Source/Range.pm »
1 package Lab::Moose::Instrument::SCPI::Source::Power;
2 #ABSTRACT: Role for the SCPI SOURce:POWer subsystem
3 4 $Lab::Moose::Instrument::SCPI::Source::Power::VERSION = '3.881';
4 4 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 use Lab::Moose::Instrument
9 4 ▶ qw/validated_channel_getter validated_channel_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 4 cache source_power_level_immediate_amplitude =>
17 ( getter => 'source_power_level_immediate_amplitude_query' );
18  
19 sub source_power_level_immediate_amplitude_query {
20 6 ▶ my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
Subroutine source_power_level_immediate_amplitude_query: called CC=1 SCAR=0.0
Pod documented
21  
22 6 return $self->cached_source_power_level_immediate_amplitude(
23 $self->query( command => "SOUR${channel}:POW?", %args ) );
24 }
25  
26 sub source_power_level_immediate_amplitude {
27 6 ▶ my ( $self, $channel, $value, %args ) = validated_channel_setter(
Subroutine source_power_level_immediate_amplitude: called CC=1 SCAR=0.0
Pod documented
28 \@_,
29 value => { isa => 'Num' }
30 );
31 6 $self->write(
32 command => sprintf( "SOUR%s:POW %.17g", $channel, $value ),
33 %args
34 );
35 6 $self->cached_source_power_level_immediate_amplitude($value);
36 }
37  
38 4 1;
39  
40 __END__
41  
42 =pod
43  
44 =encoding UTF-8
45  
46 =head1 NAME
47  
48 Lab::Moose::Instrument::SCPI::Source::Power - Role for the SCPI SOURce:POWer subsystem
49  
50 =head1 VERSION
51  
52 version 3.881
53  
54 =head1 METHODS
55  
56 =head2 source_power_level_immediate_amplitude_query
57  
58 =head2 source_power_level_immediate_amplitude
59  
60 $self->source_power_level_immediate_amplitude(value => -20);
61  
62 Query/Set the signal amplitude, which will be set without waiting for further
63 commands (like e.g. triggers).
64  
65 =head1 COPYRIGHT AND LICENSE
66  
67 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
68  
69 Copyright 2017 Andreas K. Huettel, Simon Reinhardt
70 2020 Andreas K. Huettel
71  
72  
73 This is free software; you can redistribute it and/or modify it under
74 the same terms as the Perl 5 programming language system itself.
75  
76 =cut
« Moose/Instrument/SCPI/Source/Level.pm ↑ Summary Moose/Instrument/SCPI/Source/Range.pm »