Moose/Sweep/Step/Pulsewidth.pm

filter: Statementstmt 68.4% 13 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod n/a totaltotal 65.2% 15 / 23 SCAR 7.5
CC
2
Cov
68%
_pulsewidth_setter
6.0
_build_setter
2.0
BEGIN
1.0
CRAP 2.1
« Moose/Sweep/Step/Pulsedelay.pm ↑ Summary Moose/Instrument/RS_ZVM.pm »
1 package Lab::Moose::Sweep::Step::Pulsewidth;
2 1 $Lab::Moose::Sweep::Step::Pulsewidth::VERSION = '3.881';
3 #ABSTRACT: Pulsewidth sweep.
4  
5 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 extends 'Lab::Moose::Sweep::Step';
11  
12 1 has filename_extension =>
13 ( is => 'ro', isa => 'Str', default => 'Pulsewidth=' );
14  
15 1 has setter => ( is => 'ro', isa => 'CodeRef', builder => '_build_setter' );
16  
17 1 has instrument =>
18 ( is => 'ro', isa => 'ArrayRefOfInstruments', coerce => 1, required => 1 );
19  
20 1 has constant_delay => ( is => 'ro', isa => 'Bool', default => 0 );
21  
22 sub _build_setter {
23 0 ▶ return \&_pulsewidth_setter;
Subroutine _build_setter: not called CC=1 SCAR=6.9
24 }
25  
26 sub _pulsewidth_setter {
27 0 ▶ my $self = shift;
Subroutine _pulsewidth_setter: not called CC=2 SCAR=17.9
28 0 my $value = shift;
29 0 foreach (@{$self->instrument}) {
30 0 $_->set_pulsewidth(
31 value => $value,
32 constant_width => $self->constant_delay
33 );
34 }
35 }
36  
37 1 __PACKAGE__->meta->make_immutable();
38 1 1;
39  
40 __END__
41  
42 =pod
43  
44 =encoding UTF-8
45  
46 =head1 NAME
47  
48 Lab::Moose::Sweep::Step::Pulsewidth - Pulsewidth sweep.
49  
50 =head1 VERSION
51  
52 version 3.881
53  
54 =head1 Description
55  
56 Step sweep with following properties:
57  
58 =over
59  
60 =item *
61  
62 Uses instruments C<set_pulsewidth> method to change the pulsewidth. On initialization
63 an optional boolean parameter C<constant_delay> can be passed to keep a constant
64 delay time over a pulse period.
65  
66 =item *
67  
68 Default filename extension: C<'Pulsewidth='>
69  
70 =back
71  
72 See pulsewidth-sweep.pl in the examples::Sweeps folder for a simple pulsewidth
73 sweep example.
74  
75 =head1 COPYRIGHT AND LICENSE
76  
77 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
78  
79 Copyright 2021 Fabian Weinelt
80  
81  
82 This is free software; you can redistribute it and/or modify it under
83 the same terms as the Perl 5 programming language system itself.
84  
85 =cut
« Moose/Sweep/Step/Pulsedelay.pm ↑ Summary Moose/Instrument/RS_ZVM.pm »