| 1 | package Lab::Moose::Instrument::SCPI::Sense::Protection; | ||
| 2 | 3 | $Lab::Moose::Instrument::SCPI::Sense::Protection::VERSION = '3.931'; | |
| 3 | #ABSTRACT: Role for the SCPI SENSe:$function:Protection subsystem | ||
| 4 | |||
| 5 | 3 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 3 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 3 | ▶ | use Lab::Moose::Instrument::Cache; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 3 | ▶ | use Lab::Moose::Instrument qw/validated_getter validated_setter/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 3 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | |||
| 14 | 3 | requires 'cached_sense_function'; | |
| 15 | |||
| 16 | 3 | cache sense_protection => ( getter => 'sense_protection_query' ); | |
| 17 | |||
| 18 | 6 | ▶ | sub sense_protection_query { |
|
Subroutine
sense_protection_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 6 | my ( $self, %args ) = validated_getter( \@_ ); | |
| 20 | |||
| 21 | 6 | my $func = $self->cached_sense_function(); | |
| 22 | |||
| 23 | 6 | return $self->cached_sense_protection( | |
| 24 | $self->query( command => "SENS:$func:PROT?", %args ) ); | ||
| 25 | } | ||
| 26 | |||
| 27 | 6 | ▶ | sub sense_protection { |
|
Subroutine
sense_protection: called CC=1 SCAR=0.0
Pod
documented
| |||
| 28 | 6 | my ( $self, $value, %args ) = validated_setter( | |
| 29 | \@_, | ||
| 30 | value => { isa => 'Lab::Moose::PosNum' }, | ||
| 31 | ); | ||
| 32 | |||
| 33 | 6 | my $func = $self->cached_sense_function(); | |
| 34 | |||
| 35 | 6 | $self->write( command => "SENS:$func:PROT $value", %args ); | |
| 36 | |||
| 37 | 6 | $self->cached_sense_protection($value); | |
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | 2 | ▶ | sub sense_protection_tripped_query { |
|
Subroutine
sense_protection_tripped_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 42 | 2 | my ( $self, %args ) = validated_getter( \@_ ); | |
| 43 | 2 | my $func = $self->cached_sense_function(); | |
| 44 | 2 | return $self->query( command => "SENS:$func:PROT:TRIP?" ); | |
| 45 | } | ||
| 46 | |||
| 47 | |||
| 48 | 3 | cache sense_protection_rsynchronize => | |
| 49 | ( getter => 'sense_protection_rsynchronize_query' ); | ||
| 50 | |||
| 51 | 0 | ▶ | sub sense_protection_rsynchronize_query { |
|
Subroutine
sense_protection_rsynchronize_query: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 52 | 0 | my ( $self, %args ) = validated_getter( \@_ ); | |
| 53 | 0 | my $func = $self->cached_sense_function(); | |
| 54 | 0 | return $self->cached_sense_protection_rsynchronize( | |
| 55 | $self->query( command => "SENS:$func:PROT:RSYN?", %args ) ); | ||
| 56 | } | ||
| 57 | |||
| 58 | 0 | ▶ | sub sense_protection_rsynchronize { |
|
Subroutine
sense_protection_rsynchronize: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 59 | 0 | my ( $self, $value, %args ) = validated_setter( | |
| 60 | \@_, | ||
| 61 | value => { isa => 'Bool' } | ||
| 62 | ); | ||
| 63 | 0 | my $func = $self->cached_sense_function(); | |
| 64 | 0 | $self->write( command => "SENS:$func:PROT:RSYN $value" ); | |
| 65 | 0 | $self->cached_sense_protection_rsynchronize($value); | |
| 66 | } | ||
| 67 | |||
| 68 | 3 | 1; | |
| 69 | |||
| 70 | __END__ | ||