Moose/Instrument/SCPI/Sense/NPLC.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 34 / 34 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Moose/Instrument/SCPI/Sense/Function.pm ↑ Summary Moose/Instrument/SCPI/Sense/Null.pm »
1 package Lab::Moose::Instrument::SCPI::Sense::NPLC;
2 5 $Lab::Moose::Instrument::SCPI::Sense::NPLC::VERSION = '3.881';
3 #ABSTRACT: Role for the SCPI SENSe:$function:NPLC subsystem
4  
5 5 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use Lab::Moose::Instrument qw/validated_getter validated_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 5 requires 'cached_sense_function';
15  
16 5 cache sense_nplc => ( getter => 'sense_nplc_query' );
17  
18 sub sense_nplc_query {
19 14 ▶ my ( $self, %args ) = validated_getter( \@_ );
Subroutine sense_nplc_query: called CC=1 SCAR=0.0
Pod documented
20  
21 14 my $func = $self->cached_sense_function();
22  
23 14 return $self->cached_sense_nplc(
24 $self->query( command => "SENS:$func:NPLC?", %args ) );
25 }
26  
27 sub sense_nplc {
28 16 ▶ my ( $self, $value, %args ) = validated_setter(
Subroutine sense_nplc: called CC=1 SCAR=0.0
Pod documented
29 \@_,
30 value => { isa => 'Num' },
31 );
32  
33 16 my $func = $self->cached_sense_function();
34  
35 16 $self->write( command => "SENS:$func:NPLC $value", %args );
36  
37 16 $self->cached_sense_nplc($value);
38 }
39  
40 5 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.881
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
« Moose/Instrument/SCPI/Sense/Function.pm ↑ Summary Moose/Instrument/SCPI/Sense/Null.pm »