Moose/Instrument/KeysightE3633E.pm

filter: Statementstmt 53.1% 34 / 64 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.1% 8 / 19 Podpod 70.0% 7 / 10 totaltotal 52.6% 49 / 93 CC 1 SCAR 4.6
CC
1
Cov
53%
__ANON__
2.0
BUILD
2.0
source_level_query
2.0
CRAP 1.6
« Moose/DataFile/Gnuplot/Compressed.pm ↑ Summary Moose/Instrument/Yokogawa7651.pm »
1 package Lab::Moose::Instrument::KeysightE3633E;
2 1 $Lab::Moose::Instrument::KeysightE3633E::VERSION = '3.931';
3 #ABSTRACT: Keysight E3633E voltage/current source.
4  
5 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Moose::Util::TypeConstraints qw(enum);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 use Lab::Moose::Instrument
12 1 ▶ qw/validated_getter validated_setter setter_params/;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 extends 'Lab::Moose::Instrument';
18  
19 0 ▶around default_connection_options => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
20 0 my $orig = shift;
21 0 my $self = shift;
22 0 my $options = $self->$orig();
23  
24 #my $usb_opts = { vid => 0x0b21, pid => 0x0039 };
25 #$options->{USB} = $usb_opts;
26 #$options->{'VISA::USB'} = $usb_opts;
27 0 return $options;
28 1 };
29  
30 1 has [qw/max_units_per_second max_units_per_step min_units max_units/] =>
31 ( is => 'ro', isa => 'Num', required => 1 );
32  
33 1 has source_level_timestamp => (
34 is => 'rw',
35 isa => 'Num',
36 init_arg => undef,
37 );
38  
39 1 has verbose => (
40 is => 'ro',
41 isa => 'Bool',
42 default => 1
43 );
44  
45 1 has mode => (
46 is => 'ro',
47 isa => enum( [ 'CURR', 'VOLT' ] ),
48 required => 1,
49 );
50  
51 0 ▶sub BUILD {
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
52 0 my $self = shift;
53 0 $self->clear();
54 0 $self->cls();
55 }
56  
57  
58  
59 1 cache source_level => ( getter => 'source_level_query' );
60  
61 0 ▶sub source_level_query {
Subroutine source_level_query: not called CC=1 SCAR=6.9
Pod undocumented
62 0 my ( $self, %args ) = validated_getter( \@_ );
63 0 my $mode = $self->mode();
64  
65 0 return $self->cached_source_level(
66 $self->query( command => "$mode?", %args ) );
67 }
68  
69 0 ▶sub source_level {
Subroutine source_level: not called CC=1 SCAR=6.9
Pod undocumented
70 0 my ( $self, $value, %args ) = validated_setter(
71 \@_,
72 value => { isa => 'Num' }
73 );
74 0 my $mode = $self->mode();
75 0 $self->write(
76 command => sprintf( "$mode %.15g", $value ),
77 %args
78 );
79 0 $self->cached_source_level($value);
80 }
81  
82  
83 0 ▶sub set_level {
Subroutine set_level: not called CC=1 SCAR=6.9
Pod documented
84 0 my ( $self, $value, %args ) = validated_setter(
85 \@_,
86 value => { isa => 'Num' },
87 );
88  
89 0 return $self->linear_step_sweep(
90 to => $value, verbose => $self->verbose,
91 %args
92 );
93 }
94  
95 #
96 # Aliases for Lab::XPRESS::Sweep API
97 #
98  
99  
100 0 ▶sub cached_level {
Subroutine cached_level: not called CC=1 SCAR=6.9
Pod documented
101 0 my $self = shift;
102 0 return $self->cached_source_level(@_);
103 }
104  
105  
106 0 ▶sub get_level {
Subroutine get_level: not called CC=1 SCAR=6.9
Pod documented
107 0 my $self = shift;
108 0 return $self->source_level_query(@_);
109 }
110  
111  
112 0 ▶sub get_voltage {
Subroutine get_voltage: not called CC=1 SCAR=6.9
Pod documented
113 0 my ( $self, %args ) = validated_getter( \@_ );
114 0 return $self->query( command => "VOLT?", %args );
115 }
116  
117  
118 0 ▶sub get_current {
Subroutine get_current: not called CC=1 SCAR=6.9
Pod documented
119 0 my ( $self, %args ) = validated_getter( \@_ );
120 0 return $self->query( command => "CURR?", %args );
121 }
122  
123  
124 0 ▶sub set_voltage {
Subroutine set_voltage: not called CC=1 SCAR=6.9
Pod documented
125 0 my $self = shift;
126 0 my $value = shift;
127 0 return $self->set_level( value => $value );
128 }
129  
130  
131 0 ▶sub sweep_to_level {
Subroutine sweep_to_level: not called CC=1 SCAR=6.9
Pod documented
132 0 my $self = shift;
133 0 my $target = shift;
134 0 return $self->set_level( value => $target );
135 }
136  
137 1 with qw(
138 Lab::Moose::Instrument::Common
139 Lab::Moose::Instrument::LinearStepSweep
140 );
141  
142 1 __PACKAGE__->meta()->make_immutable();
143  
144 1 1;
145  
146 __END__
« Moose/DataFile/Gnuplot/Compressed.pm ↑ Summary Moose/Instrument/Yokogawa7651.pm »