File Coverage

blib/lib/Lab/Moose/Instrument/SCPI/Sense/NPLC.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 30 30 100.0


line stmt bran cond sub pod time code
1             package Lab::Moose::Instrument::SCPI::Sense::NPLC;
2             $Lab::Moose::Instrument::SCPI::Sense::NPLC::VERSION = '3.880';
3             #ABSTRACT: Role for the SCPI SENSe:$function:NPLC subsystem
4              
5 5     5   3128 use v5.20;
  5         46  
6              
7 5     5   30 use Moose::Role;
  5         11  
  5         35  
8 5     5   26634 use Lab::Moose::Instrument::Cache;
  5         25  
  5         42  
9 5     5   3118 use Lab::Moose::Instrument qw/validated_getter validated_setter/;
  5         28  
  5         311  
10              
11 5     5   43 use namespace::autoclean;
  5         13  
  5         51  
12              
13              
14             requires 'cached_sense_function';
15              
16             cache sense_nplc => ( getter => 'sense_nplc_query' );
17              
18             sub sense_nplc_query {
19 14     14 1 6258 my ( $self, %args ) = validated_getter( \@_ );
20              
21 14         7090 my $func = $self->cached_sense_function();
22              
23 14         68 return $self->cached_sense_nplc(
24             $self->query( command => "SENS:$func:NPLC?", %args ) );
25             }
26              
27             sub sense_nplc {
28 16     16 1 14477 my ( $self, $value, %args ) = validated_setter(
29             \@_,
30             value => { isa => 'Num' },
31             );
32              
33 16         69 my $func = $self->cached_sense_function();
34              
35 16         157 $self->write( command => "SENS:$func:NPLC $value", %args );
36              
37 16         75 $self->cached_sense_nplc($value);
38             }
39              
40             1;
41              
42             __END__
43              
44             =pod
45              
46             =encoding UTF-8
47              
48             =head1 NAME
49              
50             Lab::Moose::Instrument::SCPI::Sense::NPLC - Role for the SCPI SENSe:$function:NPLC subsystem
51              
52             =head1 VERSION
53              
54             version 3.880
55              
56             =head1 METHODS
57              
58             =head2 sense_nplc_query
59              
60             =head2 sense_nplc
61              
62             $self->sense_nplc(value => '0.001');
63              
64             Query/Set the input nplc.
65              
66             =head1 COPYRIGHT AND LICENSE
67              
68             This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
69              
70             Copyright 2017-2018 Simon Reinhardt
71             2020 Andreas K. Huettel
72              
73              
74             This is free software; you can redistribute it and/or modify it under
75             the same terms as the Perl 5 programming language system itself.
76              
77             =cut