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 SCAR 0.1
CC
1
Cov
80%
output_state_query
2.0
output_state
2.0
BEGIN
1.0
CRAP 1.0
« Moose/Instrument/SCPI/Display/Window.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.881';
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 sub output_state_query {
18 0 ▶ my ( $self, %args ) = validated_getter( \@_ );
Subroutine output_state_query: not called CC=1 SCAR=6.9
Pod documented
19  
20 0 return $self->cached_output_state(
21 $self->query( command => "OUTP:STAT?", %args ) );
22 }
23  
24 sub output_state {
25 0 ▶ my ( $self, $value, %args ) = validated_setter(
Subroutine output_state: not called CC=1 SCAR=6.9
Pod documented
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__
37  
38 =pod
39  
40 =encoding UTF-8
41  
42 =head1 NAME
43  
44 Lab::Moose::Instrument::SCPI::Output::State - Role for the SCPI OUTPut:STATe subsystem
45  
46 =head1 VERSION
47  
48 version 3.881
49  
50 =head1 METHODS
51  
52 =head2 output_state_query
53  
54 =head2 output_state
55  
56 $self->output_state(value => 'ON');
57 $self->output_state(value => 'OFF');
58  
59 Query/Set whether output is on or off. Allowed values: C<ON, OFF>.
60  
61 =head1 COPYRIGHT AND LICENSE
62  
63 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
64  
65 Copyright 2017 Simon Reinhardt
66 2020 Andreas K. Huettel
67  
68  
69 This is free software; you can redistribute it and/or modify it under
70 the same terms as the Perl 5 programming language system itself.
71  
72 =cut
« Moose/Instrument/SCPI/Display/Window.pm ↑ Summary Moose/Instrument/SCPI/Unit.pm »