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.900';
3             #ABSTRACT: Role for the SCPI SOURce:FUNCtion subsystem
4              
5 7     7   4549 use v5.20;
  7         32  
6              
7 7     7   48 use Moose::Role;
  7         18  
  7         64  
8 7     7   36515 use Moose::Util::TypeConstraints 'enum';
  7         26  
  7         69  
9 7     7   3269 use Lab::Moose::Instrument::Cache;
  7         26  
  7         61  
10 7     7   4359 use Lab::Moose::Instrument qw/validated_getter validated_setter/;
  7         29  
  7         394  
11              
12 7     7   66 use namespace::autoclean;
  7         15  
  7         72  
13              
14              
15             cache source_function => ( getter => 'source_function_query' );
16              
17             sub source_function_query {
18 4     4 1 3934 my ( $self, %args ) = validated_getter( \@_ );
19              
20 4         2135 my $value = $self->query( command => "SOUR:FUNC?", %args );
21 4         15 $value =~ s/["']//g;
22 4         15 return $self->cached_source_function($value);
23             }
24              
25             sub source_function {
26 4     4 1 16170 my ( $self, $value, %args ) = validated_setter( \@_ );
27 4         31 $self->write( command => "SOUR:FUNC $value", %args );
28 4         49 $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.900
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