File Coverage

blib/lib/Lab/Moose/Sweep/Step/Voltage.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Lab::Moose::Sweep::Step::Voltage;
2             $Lab::Moose::Sweep::Step::Voltage::VERSION = '3.900';
3             #ABSTRACT: Voltage sweep.
4              
5 2     2   3406 use v5.20;
  2         11  
6              
7              
8 2     2   22 use Moose;
  2         4  
  2         22  
9              
10             extends 'Lab::Moose::Sweep::Step';
11              
12             has filename_extension => ( is => 'ro', isa => 'Str', default => 'Voltage=' );
13              
14             has setter => ( is => 'ro', isa => 'CodeRef', builder => '_build_setter' );
15              
16             has instrument =>
17             ( is => 'ro', isa => 'ArrayRefOfInstruments', coerce => 1, required => 1 );
18              
19             sub _build_setter {
20 17     17   535 return \&_voltage_setter;
21             }
22              
23             sub _voltage_setter {
24 167     167   270 my $self = shift;
25 167         252 my $value = shift;
26 167         240 foreach (@{$self->instrument}) {
  167         4972  
27 167         555 $_->set_level( value => $value );
28             }
29             }
30              
31             __PACKAGE__->meta->make_immutable();
32             1;
33              
34             __END__
35              
36             =pod
37              
38             =encoding UTF-8
39              
40             =head1 NAME
41              
42             Lab::Moose::Sweep::Step::Voltage - Voltage sweep.
43              
44             =head1 VERSION
45              
46             version 3.900
47              
48             =head1 DESCRIPTION
49              
50             Step sweep with following properties:
51              
52             =over
53              
54             =item *
55              
56             Uses instruments C<set_level> method to change the output voltage.
57              
58             =item *
59              
60             Default filename extension: C<'Voltage='>
61              
62             =back
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
67              
68             Copyright 2017 Simon Reinhardt
69             2018 Andreas K. Huettel, Simon Reinhardt
70             2020 Andreas K. Huettel
71             2021 Fabian Weinelt
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