Moose/Instrument/SCPI/Source/Function.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 100% 37 / 37 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Moose/Instrument/SCPI/Sense/Range.pm ↑ Summary Moose/Instrument/SCPI/Source/Level.pm »
1 package Lab::Moose::Instrument::SCPI::Source::Function;
2 7 $Lab::Moose::Instrument::SCPI::Source::Function::VERSION = '3.881';
3 #ABSTRACT: Role for the SCPI SOURce:FUNCtion subsystem
4  
5 7 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 7 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 7 ▶use Moose::Util::TypeConstraints 'enum';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 7 ▶use Lab::Moose::Instrument qw/validated_getter validated_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 7 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 7 cache source_function => ( getter => 'source_function_query' );
16  
17 sub source_function_query {
18 4 ▶ my ( $self, %args ) = validated_getter( \@_ );
Subroutine source_function_query: called CC=1 SCAR=0.0
Pod documented
19  
20 4 my $value = $self->query( command => "SOUR:FUNC?", %args );
21 4 $value =~ s/["']//g;
22 4 return $self->cached_source_function($value);
23 }
24  
25 sub source_function {
26 4 ▶ my ( $self, $value, %args ) = validated_setter( \@_ );
Subroutine source_function: called CC=1 SCAR=0.0
Pod documented
27 4 $self->write( command => "SOUR:FUNC $value", %args );
28 4 $self->cached_source_function($value);
29 }
30  
31 7 1;
32  
33 __END__
34  
35 =pod
36  
37 =encoding UTF-8
38  
39 =head1 NAME
40  
41 Lab::Moose::Instrument::SCPI::Source::Function - Role for the SCPI SOURce:FUNCtion subsystem
42  
43 =head1 VERSION
44  
45 version 3.881
46  
47 =head1 METHODS
48  
49 =head2 source_function_query
50  
51 =head2 source_function
52  
53 $self->source_function(value => 'VOLT');
54  
55 Query/Set the type of output signal.
56  
57 =head1 COPYRIGHT AND LICENSE
58  
59 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
60  
61 Copyright 2017-2018 Simon Reinhardt
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
« Moose/Instrument/SCPI/Sense/Range.pm ↑ Summary Moose/Instrument/SCPI/Source/Level.pm »