| 1 | package Lab::Moose::Instrument::SCPI::Sense::Null; | ||
| 2 | 2 | $Lab::Moose::Instrument::SCPI::Sense::Null::VERSION = '3.881'; | |
| 3 | #ABSTRACT: Role for the HP/Agilent/Keysight SCPI SENSe:$function:NULL 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_null_state => ( getter => 'sense_null_state_query' ); | |
| 18 | |||
| 19 | sub sense_null_state_query { | ||
| 20 | 3 | ▶ | my ( $self, %args ) = validated_getter( \@_ ); |
|
Subroutine
sense_null_state_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 21 | |||
| 22 | 3 | my $func = $self->cached_sense_function(); | |
| 23 | 3 | return $self->cached_sense_null_state( | |
| 24 | $self->query( command => "SENS:$func:NULL:STAT?", %args ) ); | ||
| 25 | } | ||
| 26 | |||
| 27 | sub sense_null_state { | ||
| 28 | 3 | ▶ | my ( $self, $value, %args ) = validated_setter( |
|
Subroutine
sense_null_state: called CC=1 SCAR=0.0
Pod
documented
| |||
| 29 | \@_, | ||
| 30 | value => { isa => enum( [ 0, 1 ] ) }, | ||
| 31 | ); | ||
| 32 | |||
| 33 | 3 | my $func = $self->cached_sense_function(); | |
| 34 | 3 | $self->write( command => "SENS:$func:NULL:STATE $value", %args ); | |
| 35 | |||
| 36 | 3 | $self->cached_sense_null_state($value); | |
| 37 | } | ||
| 38 | |||
| 39 | |||
| 40 | 2 | cache sense_null_value => ( getter => 'sense_null_value_query' ); | |
| 41 | |||
| 42 | sub sense_null_value_query { | ||
| 43 | 3 | ▶ | my ( $self, %args ) = validated_getter( \@_ ); |
|
Subroutine
sense_null_value_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 44 | |||
| 45 | 3 | my $func = $self->cached_sense_function(); | |
| 46 | |||
| 47 | 3 | return $self->cached_sense_null_value( | |
| 48 | $self->query( command => "SENS:$func:NULL:VAL?", %args ) ); | ||
| 49 | } | ||
| 50 | |||
| 51 | sub sense_null_value { | ||
| 52 | 3 | ▶ | my ( $self, $value, %args ) = validated_setter( |
|
Subroutine
sense_null_value: called CC=1 SCAR=0.0
Pod
documented
| |||
| 53 | \@_, | ||
| 54 | value => { isa => 'Num' }, | ||
| 55 | ); | ||
| 56 | |||
| 57 | 3 | my $func = $self->cached_sense_function(); | |
| 58 | |||
| 59 | 3 | $self->write( command => "SENS:$func:NULL:VAL $value", %args ); | |
| 60 | |||
| 61 | 3 | $self->cached_sense_null_value($value); | |
| 62 | } | ||
| 63 | |||
| 64 | 2 | 1; | |
| 65 | |||
| 66 | __END__ | ||
| 67 | |||
| 68 | =pod | ||
| 69 | |||
| 70 | =encoding UTF-8 | ||
| 71 | |||
| 72 | =head1 NAME | ||
| 73 | |||
| 74 | Lab::Moose::Instrument::SCPI::Sense::Null - Role for the HP/Agilent/Keysight SCPI SENSe:$function:NULL subsystem | ||
| 75 | |||
| 76 | =head1 VERSION | ||
| 77 | |||
| 78 | version 3.881 | ||
| 79 | |||
| 80 | =head1 METHODS | ||
| 81 | |||
| 82 | =head2 sense_null_state_query | ||
| 83 | |||
| 84 | =head2 sense_null_state | ||
| 85 | |||
| 86 | $self->sense_null_state(value => 1); | ||
| 87 | |||
| 88 | Query/Set state of null function. | ||
| 89 | |||
| 90 | =head1 METHODS | ||
| 91 | |||
| 92 | =head2 sense_null_value_query | ||
| 93 | |||
| 94 | =head2 sense_null_value | ||
| 95 | |||
| 96 | $self->sense_null_value(value => 0.12345); | ||
| 97 | |||
| 98 | Query/Set state of null function. | ||
| 99 | |||
| 100 | =head1 COPYRIGHT AND LICENSE | ||
| 101 | |||
| 102 | This software is copyright (c) 2023 by the Lab::Measurement team; in detail: | ||
| 103 | |||
| 104 | Copyright 2018 Simon Reinhardt | ||
| 105 | 2020 Andreas K. Huettel | ||
| 106 | |||
| 107 | |||
| 108 | This is free software; you can redistribute it and/or modify it under | ||
| 109 | the same terms as the Perl 5 programming language system itself. | ||
| 110 | |||
| 111 | =cut | ||