File Coverage

blib/lib/Lab/Moose/Sweep/Step/Repeat.pm
Criterion Covered Total %
statement 14 15 93.3
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 21 24 87.5


line stmt bran cond sub pod time code
1             package Lab::Moose::Sweep::Step::Repeat;
2             $Lab::Moose::Sweep::Step::Repeat::VERSION = '3.880';
3             #ABSTRACT: Repeat something (e.g. some sweep) N times
4              
5 2     2   2889 use v5.20;
  2         9  
6              
7              
8 2     2   14 use Moose;
  2         5  
  2         17  
9 2     2   14270 use Carp;
  2         6  
  2         562  
10             extends 'Lab::Moose::Sweep::Step';
11              
12             has filename_extension => ( is => 'ro', isa => 'Str', default => 'Repeat=' );
13             has count => (is => 'ro', isa => 'Lab::Moose::PosInt', required => 1);
14             has setter => (is => 'ro', isa => 'CodeRef', builder => '_build_setter');
15              
16             sub _build_setter {
17 1     11   37 return sub {};
        1      
18             }
19              
20             sub BUILD {
21 1     1 0 2 my $self = shift;
22 1         35 my $count = $self->count;
23 1 50       4 if ($count < 1) {
24 0         0 croak "count must be a positive integer";
25             }
26 1         29 my @list = (1..$self->count);
27 1         44 $self->_list(\@list);
28             }
29              
30             __PACKAGE__->meta->make_immutable();
31             1;
32              
33             __END__
34              
35             =pod
36              
37             =encoding UTF-8
38              
39             =head1 NAME
40              
41             Lab::Moose::Sweep::Step::Repeat - Repeat something (e.g. some sweep) N times
42              
43             =head1 VERSION
44              
45             version 3.880
46              
47             =head1 SYNOPSIS
48              
49             # Repeat voltage sweep 10 times
50            
51             my $repeat = sweep(
52             type => 'Step::Repeat',
53             count => 10
54             );
55              
56             my $voltage_sweep = sweep(...);
57             my $meas = ...;
58             my $datafile = sweep_datafile(...);
59            
60             $repeat->start(
61             slave => $voltage_sweep,
62             measurement => $meas,
63             datafile => $datafile
64             );
65              
66             =head1 COPYRIGHT AND LICENSE
67              
68             This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
69              
70             Copyright 2018 Andreas K. Huettel, 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