XPRESS/Sweep/DietersCrazyTempSweep.pm

filter: Statementstmt 26.9% 14 / 52 Branchbran 0.0% 0 / 18 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 44.4% 4 / 9 Podpod 20.0% 1 / 5 totaltotal 20.2% 19 / 94 SCAR 46.5
CC
13
Cov
18%
exit_loop
132.0
new
6.0
check_config_paramters
6.0
CRAP 104.8
« XPRESS/Sweep/Magnet.pm ↑ Summary Moose/Instrument/Lakeshore350.pm »
1 package Lab::XPRESS::Sweep::DietersCrazyTempSweep;
2 #ABSTRACT: Dieter's crazy temperature sweep
3 1 $Lab::XPRESS::Sweep::DietersCrazyTempSweep::VERSION = '3.881';
4 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Lab::XPRESS::Sweep;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Time::HiRes qw/usleep/, qw/time/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our @ISA = ('Lab::XPRESS::Sweep');
11  
12 sub new {
13 0 ▶ my $proto = shift;
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
14 0 my @args = @_;
15 0 ▶ my $class = ref($proto) || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
16  
17 # define default values for the config parameters:
18 my $self->{default_config} = {
19 0 id => 'Time_sweep',
20 interval => 1,
21 points => [ 0, 10 ],
22 duration => [1],
23 stepwidth => 1,
24 mode => 'continuous',
25 allowed_instruments => ['Lab::Instrument::ITC'],
26 allowed_sweep_modes => ['continuous'],
27 };
28  
29 # create self from Sweep basic class:
30 0 $self = $class->SUPER::new( $self->{default_config}, @args );
31 0 bless( $self, $class );
32  
33 # check and adjust config values if necessary:
34 0 $self->check_config_paramters();
35  
36 # init mandatory parameters:
37 0 $self->{DataFile_counter} = 0;
38 0 $self->{DataFiles} = ();
39  
40 0 return $self;
41 }
42  
43 sub check_config_paramters {
44 0 ▶ my $self = shift;
Subroutine check_config_paramters: not called CC=2 SCAR=17.9
Pod undocumented
45  
46 # No Backsweep allowed; adjust number of Repetitions if Backsweep is 1:
47 0 ▶ if ( $self->{config}->{backsweep} == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"config"}{"backsweep"} == 1) 0 0 0
48 0 $self->{config}->{repetitions} /= 2;
49 0 $self->{config}->{backsweep} = 0;
50 }
51  
52 # Set loop-Interval to Measurement-Interval:
53 0 $self->{loop}->{interval} = $self->{config}->{interval};
54  
55 }
56  
57 sub exit_loop {
58 0 ▶ my $self = shift;
Subroutine exit_loop: not called CC=11 SCAR=48.8
Pod undocumented
59  
60 0 my $T_Probe = $self->{config}->{instrument}->get_value(3);
61  
62 0 ▶ if ( $self->{sequence} == 0 ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'sequence'} == 0) { } 0 0 0
elsif ($self->{'sequence'} == 1) { } 0 0 0
63  
64 0 ▶ if ( $T_Probe >= @{ $self->{config}->{points} }[1] ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($T_Probe >= @{$$self{'config'}{'points'};}[1]) { } 0 0 0
elsif ($T_Probe < 15) { } 0 0 0
elsif ($T_Probe >= 15 and $T_Probe <= 40) { } 0 0 0
elsif ($T_Probe > 40) { } 0 0 0
65 0 $self->{config}->{instrument}->set_heateroutput(0);
66 0 $self->{sequence}++;
67 0 foreach my $file ( @{ $self->{DataFiles} } ) {
68 0 $file->start_block();
69 }
70 0 $self->skip_LOG();
71 }
72 elsif ( $T_Probe < 15 ) {
73 0 $self->{config}->{instrument}->set_heateroutput(33)
74 ; # 0..99% of heaterlimit
75 }
76 ▶ elsif ( $T_Probe >= 15 and $T_Probe <= 40 ) {
Condition0%0/3
$T_Probe >= 15 and $T_Probe <= 40
!ll&&!rl&&r
000
MC/DC0%0/2
$T_Probe >= 15 and $T_Probe <= 40
$T_Probe >= 15 $T_Probe <= 40
Truth table0%0/3
A and B
A= $T_Probe >= 15B= $T_Probe <= 40
ABresult
0X0
100
111
77 0 $self->{config}->{instrument}->set_heateroutput(56)
78 ; # 0..99% of heaterlimit
79 }
80 elsif ( $T_Probe > 40 ) {
81 0 $self->{config}->{instrument}->set_heateroutput(70)
82 ; # 0..99% of heaterlimit
83 }
84  
85 }
86 elsif ( $self->{sequence} == 1 ) {
87 0 ▶ if ( $T_Probe > @{ $self->{config}->{points} }[1] ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($T_Probe > @{$$self{'config'}{'points'};}[1]) { } 0 0 0
elsif ($T_Probe <= @{$$self{'config'}{'points'};}[0]) { } 0 0 0
88 0 $self->skip_LOG();
89 }
90 0 elsif ( $T_Probe <= @{ $self->{config}->{points} }[0] ) {
91 0 return 1;
92 }
93 }
94  
95 0 return 0;
96  
97 }
98  
99 sub get_value {
100 0 ▶ my $self = shift;
Subroutine get_value: not called CC=1 SCAR=6.9
Pod documented
101 0 return $self->{config}->{instrument}->get_value(3);
102 }
103  
104 sub halt {
105 0 ▶ return shift;
Subroutine halt: not called CC=1 SCAR=6.9
Pod undocumented
106 }
107  
108 1 1;
109  
110 __END__
111  
112 =pod
113  
114 =encoding UTF-8
115  
116 =head1 NAME
117  
118 Lab::XPRESS::Sweep::DietersCrazyTempSweep - Dieter's crazy temperature sweep
119  
120 =head1 VERSION
121  
122 version 3.881
123  
124 =head1 COPYRIGHT AND LICENSE
125  
126 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
127  
128 Copyright 2013 Andreas K. Huettel, Christian Butschkow
129 2016 Simon Reinhardt
130 2017 Andreas K. Huettel
131 2020 Andreas K. Huettel
132  
133  
134 This is free software; you can redistribute it and/or modify it under
135 the same terms as the Perl 5 programming language system itself.
136  
137 =cut
« XPRESS/Sweep/Magnet.pm ↑ Summary Moose/Instrument/Lakeshore350.pm »