| 1 | package Lab::Moose::Instrument::SCPI::Sense::Impedance; | ||||||||||
| 2 | 2 | $Lab::Moose::Instrument::SCPI::Sense::Impedance::VERSION = '3.881'; | |||||||||
| 3 | #ABSTRACT: Role for the HP/Agilent/Keysight SCPI SENSe:$function:IMPedance subsystem | ||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use v5.20; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use Lab::Moose::Instrument::Cache; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use Lab::Moose::Instrument qw/validated_getter validated_setter/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | use Moose::Util::TypeConstraints 'enum'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 2 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | 2 | requires 'cached_sense_function'; | |||||||||
| 16 | |||||||||||
| 17 | 2 | cache sense_impedance_auto => ( getter => 'sense_impedance_auto_query' ); | |||||||||
| 18 | |||||||||||
| 19 | sub sense_impedance_auto_query { | ||||||||||
| 20 | 3 | ▶ | my ( $self, %args ) = validated_getter( \@_ ); | ||||||||
|
Subroutine
sense_impedance_auto_query: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||
| 21 | |||||||||||
| 22 | 3 | my $func = $self->cached_sense_function(); | |||||||||
| 23 | 3 | ▶ | if ( $func ne 'VOLT' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | croak "query impedance with function $func"; | |||||||||
| 25 | } | ||||||||||
| 26 | 3 | return $self->cached_sense_impedance_auto( | |||||||||
| 27 | $self->query( command => "SENS:$func:IMP:AUTO?", %args ) ); | ||||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | sub sense_impedance_auto { | ||||||||||
| 31 | 3 | ▶ | my ( $self, $value, %args ) = validated_setter( | ||||||||
|
Subroutine
sense_impedance_auto: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||
| 32 | \@_, | ||||||||||
| 33 | value => { isa => enum( [ 0, 1 ] ) }, | ||||||||||
| 34 | ); | ||||||||||
| 35 | |||||||||||
| 36 | 3 | my $func = $self->cached_sense_function(); | |||||||||
| 37 | 3 | ▶ | if ( $func ne 'VOLT' ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 0 | croak "query impedance with function $func"; | |||||||||
| 39 | } | ||||||||||
| 40 | 3 | $self->write( command => "SENS:$func:IMP:AUTO $value", %args ); | |||||||||
| 41 | |||||||||||
| 42 | 3 | $self->cached_sense_impedance_auto($value); | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 2 | 1; | |||||||||
| 46 | |||||||||||
| 47 | __END__ | ||||||||||
| 48 | |||||||||||
| 49 | =pod | ||||||||||
| 50 | |||||||||||
| 51 | =encoding UTF-8 | ||||||||||
| 52 | |||||||||||
| 53 | =head1 NAME | ||||||||||
| 54 | |||||||||||
| 55 | Lab::Moose::Instrument::SCPI::Sense::Impedance - Role for the HP/Agilent/Keysight SCPI SENSe:$function:IMPedance subsystem | ||||||||||
| 56 | |||||||||||
| 57 | =head1 VERSION | ||||||||||
| 58 | |||||||||||
| 59 | version 3.881 | ||||||||||
| 60 | |||||||||||
| 61 | =head1 METHODS | ||||||||||
| 62 | |||||||||||
| 63 | =head2 sense_impedance_auto_query | ||||||||||
| 64 | |||||||||||
| 65 | =head2 sense_impedance_auto | ||||||||||
| 66 | |||||||||||
| 67 | $self->sense_impedance_auto(value => 1); | ||||||||||
| 68 | |||||||||||
| 69 | Query/Set input impedance mode. Allowed values: '0' or '1'. | ||||||||||
| 70 | |||||||||||
| 71 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 72 | |||||||||||
| 73 | This software is copyright (c) 2023 by the Lab::Measurement team; in detail: | ||||||||||
| 74 | |||||||||||
| 75 | Copyright 2018 Simon Reinhardt | ||||||||||
| 76 | 2020 Andreas K. Huettel | ||||||||||
| 77 | |||||||||||
| 78 | |||||||||||
| 79 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 80 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 81 | |||||||||||
| 82 | =cut | ||||||||||