File Coverage

blib/lib/Lab/Moose/Instrument/SCPI/Source/Function.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 2 2 100.0
total 34 34 100.0


line stmt bran cond sub pod time code
1             package Lab::Moose::Instrument::SCPI::Source::Function;
2             $Lab::Moose::Instrument::SCPI::Source::Function::VERSION = '3.881';
3             #ABSTRACT: Role for the SCPI SOURce:FUNCtion subsystem
4              
5 7     7   4620 use v5.20;
  7         36  
6              
7 7     7   71 use Moose::Role;
  7         30  
  7         50  
8 7     7   36749 use Moose::Util::TypeConstraints 'enum';
  7         28  
  7         84  
9 7     7   3408 use Lab::Moose::Instrument::Cache;
  7         27  
  7         62  
10 7     7   4302 use Lab::Moose::Instrument qw/validated_getter validated_setter/;
  7         23  
  7         419  
11              
12 7     7   68 use namespace::autoclean;
  7         20  
  7         49  
13              
14              
15             cache source_function => ( getter => 'source_function_query' );
16              
17             sub source_function_query {
18 4     4 1 3706 my ( $self, %args ) = validated_getter( \@_ );
19              
20 4         2067 my $value = $self->query( command => "SOUR:FUNC?", %args );
21 4         14 $value =~ s/["']//g;
22 4         18 return $self->cached_source_function($value);
23             }
24              
25             sub source_function {
26 4     4 1 16298 my ( $self, $value, %args ) = validated_setter( \@_ );
27 4         30 $self->write( command => "SOUR:FUNC $value", %args );
28 4         23 $self->cached_source_function($value);
29             }
30              
31             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