Moose/Instrument/SCPI/Output/State.pm

filter: Statementstmt 80.0% 20 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 100% 2 / 2 totaltotal 80.0% 28 / 35 CC 1 SCAR 2.2
CC
1
Cov
80%
output_state_query
2.0
output_state
2.0
BEGIN
1.0
CRAP 1.2
« Moose/Sweep/DataFile.pm ↑ Summary Moose/Instrument/SCPI/Unit.pm »
1 package Lab::Moose::Instrument::SCPI::Output::State;
2 3 $Lab::Moose::Instrument::SCPI::Output::State::VERSION = '3.931';
3 #ABSTRACT: Role for the SCPI OUTPut:STATe subsystem
4  
5 3 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Moose::Util::TypeConstraints 'enum';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Lab::Moose::Instrument qw/validated_getter validated_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 3 cache output_state => ( getter => 'output_state_query' );
16  
17 0 ▶sub output_state_query {
Subroutine output_state_query: not called CC=1 SCAR=6.9
Pod documented
18 0 my ( $self, %args ) = validated_getter( \@_ );
19  
20 0 return $self->cached_output_state(
21 $self->query( command => "OUTP:STAT?", %args ) );
22 }
23  
24 0 ▶sub output_state {
Subroutine output_state: not called CC=1 SCAR=6.9
Pod documented
25 0 my ( $self, $value, %args ) = validated_setter(
26 \@_,
27 value => { isa => enum( [qw/ON OFF/] ) }
28 );
29  
30 0 $self->write( command => "OUTP:STAT $value", %args );
31 0 $self->cached_output_state($value);
32 }
33  
34 3 1;
35  
36 __END__
« Moose/Sweep/DataFile.pm ↑ Summary Moose/Instrument/SCPI/Unit.pm »