line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lab::Moose::Instrument::SCPI::Sense::Protection; |
2
|
|
|
|
|
|
|
$Lab::Moose::Instrument::SCPI::Sense::Protection::VERSION = '3.900'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Role for the SCPI SENSe:$function:Protection subsystem |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
1852
|
use v5.20; |
|
3
|
|
|
|
|
15
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
27
|
use Moose::Role; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
24
|
|
8
|
3
|
|
|
3
|
|
16036
|
use Lab::Moose::Instrument::Cache; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
20
|
|
9
|
3
|
|
|
3
|
|
1896
|
use Lab::Moose::Instrument qw/validated_getter validated_setter/; |
|
3
|
|
|
|
|
23
|
|
|
3
|
|
|
|
|
168
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
21
|
use namespace::autoclean; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
19
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
requires 'cached_sense_function'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
cache sense_protection => ( getter => 'sense_protection_query' ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub sense_protection_query { |
19
|
6
|
|
|
6
|
1
|
3256
|
my ( $self, %args ) = validated_getter( \@_ ); |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
|
|
3113
|
my $func = $self->cached_sense_function(); |
22
|
|
|
|
|
|
|
|
23
|
6
|
|
|
|
|
42
|
return $self->cached_sense_protection( |
24
|
|
|
|
|
|
|
$self->query( command => "SENS:$func:PROT?", %args ) ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub sense_protection { |
28
|
6
|
|
|
6
|
1
|
12079
|
my ( $self, $value, %args ) = validated_setter( |
29
|
|
|
|
|
|
|
\@_, |
30
|
|
|
|
|
|
|
value => { isa => 'Lab::Moose::PosNum' }, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
6
|
|
|
|
|
28
|
my $func = $self->cached_sense_function(); |
34
|
|
|
|
|
|
|
|
35
|
6
|
|
|
|
|
48
|
$self->write( command => "SENS:$func:PROT $value", %args ); |
36
|
|
|
|
|
|
|
|
37
|
6
|
|
|
|
|
42
|
$self->cached_sense_protection($value); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub sense_protection_tripped_query { |
42
|
2
|
|
|
2
|
1
|
26
|
my ( $self, %args ) = validated_getter( \@_ ); |
43
|
2
|
|
|
|
|
1041
|
my $func = $self->cached_sense_function(); |
44
|
2
|
|
|
|
|
18
|
return $self->query( command => "SENS:$func:PROT:TRIP?" ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
cache sense_protection_rsynchronize => |
49
|
|
|
|
|
|
|
( getter => 'sense_protection_rsynchronize_query' ); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub sense_protection_rsynchronize_query { |
52
|
0
|
|
|
0
|
1
|
|
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
|
|
|
|
|
|
|
sub sense_protection_rsynchronize { |
59
|
0
|
|
|
0
|
1
|
|
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
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=pod |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=encoding UTF-8 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 NAME |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Lab::Moose::Instrument::SCPI::Sense::Protection - Role for the SCPI SENSe:$function:Protection subsystem |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 VERSION |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
version 3.900 |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 METHODS |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 sense_protection_query |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 sense_protection |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
$self->sense_protection(value => 1e-6); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Query/Set the measurement protection limit |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 sense_protection_tripped_query |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
my $tripped = $self->sense_protection_tripped_query(); |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Return '1' if source is in compliance, and '0' if source is not in compliance. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head2 sense_protection_rsynchronize_query/sense_protection_rsynchronize |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Get/Set measure and compliance range synchronization. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
This software is copyright (c) 2023 by the Lab::Measurement team; in detail: |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Copyright 2018 Simon Reinhardt |
109
|
|
|
|
|
|
|
2020 Andreas K. Huettel |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
113
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |