File Coverage

blib/lib/Lab/XPRESS/Sweep/DietersCrazyTempSweep.pm
Criterion Covered Total %
statement 11 49 22.4
branch 0 18 0.0
condition 0 6 0.0
subroutine 4 9 44.4
pod 1 5 20.0
total 16 87 18.3


line stmt bran cond sub pod time code
1             package Lab::XPRESS::Sweep::DietersCrazyTempSweep;
2             #ABSTRACT: Dieter's crazy temperature sweep
3             $Lab::XPRESS::Sweep::DietersCrazyTempSweep::VERSION = '3.881';
4 1     1   1670 use v5.20;
  1         4  
5              
6 1     1   6 use Lab::XPRESS::Sweep;
  1         2  
  1         26  
7 1     1   11 use Time::HiRes qw/usleep/, qw/time/;
  1         2  
  1         8  
8 1     1   142 use strict;
  1         2  
  1         569  
9              
10             our @ISA = ('Lab::XPRESS::Sweep');
11              
12             sub new {
13 0     0 0   my $proto = shift;
14 0           my @args = @_;
15 0   0       my $class = ref($proto) || $proto;
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     0 0   my $self = shift;
45              
46             # No Backsweep allowed; adjust number of Repetitions if Backsweep is 1:
47 0 0         if ( $self->{config}->{backsweep} == 1 ) {
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     0 0   my $self = shift;
59              
60 0           my $T_Probe = $self->{config}->{instrument}->get_value(3);
61              
62 0 0         if ( $self->{sequence} == 0 ) {
    0          
63              
64 0 0 0       if ( $T_Probe >= @{ $self->{config}->{points} }[1] ) {
  0 0          
    0          
    0          
65 0           $self->{config}->{instrument}->set_heateroutput(0);
66 0           $self->{sequence}++;
67 0           foreach my $file ( @{ $self->{DataFiles} } ) {
  0            
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 ) {
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 0         if ( $T_Probe > @{ $self->{config}->{points} }[1] ) {
  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     0 1   my $self = shift;
101 0           return $self->{config}->{instrument}->get_value(3);
102             }
103              
104             sub halt {
105 0     0 0   return shift;
106             }
107              
108             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