| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Lab::Instrument::TemperatureControl; | 
| 2 |  |  |  |  |  |  | #ABSTRACT: Generic temperature control instrument base class | 
| 3 |  |  |  |  |  |  | $Lab::Instrument::TemperatureControl::VERSION = '3.880'; | 
| 4 | 1 |  |  | 1 |  | 1680 | use v5.20; | 
|  | 1 |  |  |  |  | 6 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 1 |  |  | 1 |  | 5 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 274 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | our @ISA = ('Lab::Instrument'); | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | our %fields = ( | 
| 11 |  |  |  |  |  |  | supported_connections => [], | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | # supported config options | 
| 14 |  |  |  |  |  |  | device_settings => { | 
| 15 |  |  |  |  |  |  | has_pidcontroller => undef, | 
| 16 |  |  |  |  |  |  | num_heaters       => 0, | 
| 17 |  |  |  |  |  |  | num_sensors       => 0, | 
| 18 |  |  |  |  |  |  | sample_sensor     => undef, | 
| 19 |  |  |  |  |  |  | sample_heater     => undef, | 
| 20 |  |  |  |  |  |  | }, | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | # Config hash passed to subchannel objects or $self->configure() | 
| 23 |  |  |  |  |  |  | default_device_settings => {}, | 
| 24 |  |  |  |  |  |  | ); | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | sub new { | 
| 27 | 0 |  |  | 0 | 1 |  | my $proto = shift; | 
| 28 | 0 |  | 0 |  |  |  | my $class = ref($proto) || $proto; | 
| 29 | 0 |  |  |  |  |  | my $self  = $class->SUPER::new(@_); | 
| 30 | 0 |  |  |  |  |  | $self->${ \( __PACKAGE__ . '::_construct' ) }(__PACKAGE__); | 
|  | 0 |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  |  | 
| 32 | 0 |  |  |  |  |  | print | 
| 33 |  |  |  |  |  |  | "Temperature control support is experimental. You have been warned.\n"; | 
| 34 | 0 |  |  |  |  |  | return $self; | 
| 35 |  |  |  |  |  |  | } | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | sub set_sample_sensor() { | 
| 38 | 0 |  |  | 0 | 0 |  | my $self    = shift; | 
| 39 | 0 |  |  |  |  |  | my $channel = shift; | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | # setze sample sensor if this is a valid channel number | 
| 42 |  |  |  |  |  |  | } | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | sub get_temperature() { | 
| 45 | 0 |  |  | 0 | 0 |  | my $self    = shift; | 
| 46 | 0 |  |  |  |  |  | my $channel = shift; | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | # no channel -> use default channel | 
| 49 |  |  |  |  |  |  | # use method from hardware | 
| 50 | 0 |  |  |  |  |  | return $self->_get_temperature($channel); | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | sub get_sample_temperature() { | 
| 54 | 0 |  |  | 0 | 0 |  | my $self = shift; | 
| 55 | 0 |  |  |  |  |  | return $self->get_temperature( $self->get_sample_sensor ); | 
| 56 |  |  |  |  |  |  | } | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | sub _get_temperature() { | 
| 59 | 0 |  |  | 0 |  |  | die "get_temperature not implemented for this instrument\n"; | 
| 60 |  |  |  |  |  |  | } | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | 1; | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | __END__ | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | =pod | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | =encoding UTF-8 | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  | =head1 NAME | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | Lab::Instrument::TemperatureControl - Generic temperature control instrument base class | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | =head1 VERSION | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | version 3.880 | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  | =head1 COPYRIGHT AND LICENSE | 
| 79 |  |  |  |  |  |  |  | 
| 80 |  |  |  |  |  |  | This software is copyright (c) 2023 by the Lab::Measurement team; in detail: | 
| 81 |  |  |  |  |  |  |  | 
| 82 |  |  |  |  |  |  | Copyright 2009       Andreas K. Huettel | 
| 83 |  |  |  |  |  |  | 2010       Andreas K. Huettel, Daniel Schroeer | 
| 84 |  |  |  |  |  |  | 2011       Andreas K. Huettel, Florian Olbrich | 
| 85 |  |  |  |  |  |  | 2012       Andreas K. Huettel | 
| 86 |  |  |  |  |  |  | 2016       Simon Reinhardt | 
| 87 |  |  |  |  |  |  | 2017       Andreas K. Huettel | 
| 88 |  |  |  |  |  |  | 2020       Andreas K. Huettel | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  |  | 
| 91 |  |  |  |  |  |  | This is free software; you can redistribute it and/or modify it under | 
| 92 |  |  |  |  |  |  | the same terms as the Perl 5 programming language system itself. | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | =cut |