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 CC 1 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.931';
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 4 ▶sub source_function_query {
Subroutine source_function_query: called CC=1 SCAR=0.0
Pod documented
18 4 my ( $self, %args ) = validated_getter( \@_ );
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 4 ▶sub source_function {
Subroutine source_function: called CC=1 SCAR=0.0
Pod documented
26 4 my ( $self, $value, %args ) = validated_setter( \@_ );
27 4 $self->write( command => "SOUR:FUNC $value", %args );
28 4 $self->cached_source_function($value);
29 }
30  
31 7 1;
32  
33 __END__
« Moose/Instrument/SCPI/Sense/Range.pm ↑ Summary Moose/Instrument/SCPI/Source/Level.pm »