| 1 | package Lab::Moose::Sweep::Step::Repeat; | ||||||||||
| 2 | 2 | $Lab::Moose::Sweep::Step::Repeat::VERSION = '3.881'; | |||||||||
| 3 | #ABSTRACT: Repeat something (e.g. some sweep) N times | ||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use v5.20; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | extends 'Lab::Moose::Sweep::Step'; | |||||||||
| 11 | |||||||||||
| 12 | 2 | has filename_extension => ( is => 'ro', isa => 'Str', default => 'Repeat=' ); | |||||||||
| 13 | 2 | has count => (is => 'ro', isa => 'Lab::Moose::PosInt', required => 1); | |||||||||
| 14 | 2 | has setter => (is => 'ro', isa => 'CodeRef', builder => '_build_setter'); | |||||||||
| 15 | |||||||||||
| 16 | sub _build_setter { | ||||||||||
| 17 | 1 | ▶ | return sub {}; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
_build_setter: called CC=1 SCAR=0.0
| |||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | sub BUILD { | ||||||||||
| 21 | 1 | ▶ | my $self = shift; | ||||||||
|
Subroutine
BUILD: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 22 | 1 | my $count = $self->count; | |||||||||
| 23 | 1 | ▶ | if ($count < 1) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | croak "count must be a positive integer"; | |||||||||
| 25 | } | ||||||||||
| 26 | 1 | my @list = (1..$self->count); | |||||||||
| 27 | 1 | $self->_list(\@list); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 2 | __PACKAGE__->meta->make_immutable(); | |||||||||
| 31 | 2 | 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.881 | ||||||||||
| 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 | ||||||||||