| 1 | package Lab::Moose::Instrument::SCPI::Sense::Function; | ||
| 2 | 4 | $Lab::Moose::Instrument::SCPI::Sense::Function::VERSION = '3.931'; | |
| 3 | #ABSTRACT: Role for the SCPI SENSe:FUNCtion subsystem | ||
| 4 | |||
| 5 | 4 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 4 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 4 | ▶ | use Lab::Moose::Instrument::Cache; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | use Lab::Moose::Instrument | ||
| 10 | 4 | ▶ | qw/validated_channel_getter validated_channel_setter/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 4 | ▶ | use MooseX::Params::Validate; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 4 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 4 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 4 | excludes 'Lab::Moose::Instrument::SCPI::Sense::Function::Concurrent'; | |
| 17 | |||
| 18 | |||
| 19 | # Cache used by multiple functions in sense subsystem | ||
| 20 | 4 | cache sense_function => ( getter => 'sense_function_query' ); | |
| 21 | |||
| 22 | 5 | ▶ | sub sense_function_query { |
|
Subroutine
sense_function_query: called CC=1 SCAR=0.0
Pod
documented
| |||
| 23 | 5 | my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); | |
| 24 | |||
| 25 | 5 | my $value = $self->query( command => "SENS${channel}:FUNC?", %args ); | |
| 26 | 5 | $value =~ s/["']//g; | |
| 27 | 5 | return $self->cached_sense_function($value); | |
| 28 | } | ||
| 29 | |||
| 30 | 9 | ▶ | sub sense_function { |
|
Subroutine
sense_function: called CC=1 SCAR=0.0
Pod
documented
| |||
| 31 | 9 | my ( $self, $channel, $value, %args ) = validated_channel_setter( \@_ ); | |
| 32 | |||
| 33 | 9 | $self->write( command => "SENS${channel}:FUNC '$value'", %args ); | |
| 34 | 9 | return $self->cached_sense_function($value); | |
| 35 | } | ||
| 36 | |||
| 37 | |||
| 38 | |||
| 39 | 4 | 1; | |
| 40 | |||
| 41 | __END__ | ||