Moose/Instrument/RS_ZVM.pm

filter: Statementstmt 89.8% 44 / 49 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 86.6% 13 / 15 Podpod 28.5% 2 / 7 totaltotal 82.1% 60 / 73 CC 2 SCAR 2.3
CC
2
Cov
88%
sparam_catalog
2.1
set_power
2.0
get_power
2.0
CRAP 1.3
« Moose/Instrument/KeysightB2901A.pm ↑ Summary Moose/Instrument/Agilent34410A.pm »
1 package Lab::Moose::Instrument::RS_ZVM;
2 2 $Lab::Moose::Instrument::RS_ZVM::VERSION = '3.931';
3 #ABSTRACT: Rohde & Schwarz ZVM Vector Network Analyzer
4  
5 2 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Lab::Moose::Instrument qw/getter_params timeout_param validated_getter validated_setter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 extends 'Lab::Moose::Instrument';
16  
17 2 with 'Lab::Moose::Instrument::SCPI::Format' => {
18 -excludes => [qw/format_border format_border_query/],
19 },
20 qw(
21 Lab::Moose::Instrument::SCPI::Sense::Function
22 Lab::Moose::Instrument::SCPI::Source::Power
23 Lab::Moose::Instrument::VNASweep
24 );
25  
26 1 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
27 1 my $self = shift;
28  
29 #$self->clear();
30 #$self->cls(timeout => 5);
31 }
32  
33 1 ▶sub cached_format_data_builder {
Subroutine cached_format_data_builder: called CC=1 SCAR=0.0
Pod undocumented
34 1 my $self = shift;
35 1 return $self->format_data_query( timeout => 3 );
36 }
37  
38 4 ▶sub sparam_catalog {
Subroutine sparam_catalog: called CC=2 SCAR=7.2
Pod undocumented
39 4 my $self = shift;
40 4 my $function = $self->cached_sense_function();
41  
42 4 ▶ if ( $function !~ /(?<sparam>S[12]{2})/ ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($function =~ /(?<sparam>S[12]{2})/u) 0 4 4
43 0 croak "no S-parameter selected";
44 }
45  
46 4 my $sparam = $+{sparam};
47  
48 4 return [ "Re($sparam)", "Im($sparam)" ];
49 }
50  
51 3 ▶sub trace_data_response_all {
Subroutine trace_data_response_all: called CC=1 SCAR=0.0
Pod undocumented
52 3 my ( $self, %args ) = validated_hash(
53 \@_,
54 getter_params(),
55 trace => { isa => 'Str' },
56 );
57  
58 3 my $trace = delete $args{trace};
59  
60 3 return $self->binary_query(
61 command => "TRAC:DATA:RESP:ALL? $trace",
62 %args
63 );
64 }
65  
66 3 ▶sub sparam_sweep_data {
Subroutine sparam_sweep_data: called CC=1 SCAR=0.0
Pod undocumented
67 3 my ( $self, %args ) = validated_getter( \@_ );
68  
69 3 my $channel = $self->cached_instrument_nselect();
70  
71 # Start single sweep.
72 3 $self->initiate_immediate();
73  
74 # Wait until single sweep is finished.
75 3 $self->wai();
76 3 return $self->trace_data_response_all(
77 trace => "CH${channel}DATA",
78 %args
79 );
80 }
81  
82  
83  
84  
85 0 ▶sub set_power {
Subroutine set_power: not called CC=1 SCAR=6.9
Pod documented
86 0 my ( $self, $value, %args ) = validated_setter( \@_ );
87 0 $self->source_power_level_immediate_amplitude( value => $value );
88 }
89  
90 0 ▶sub get_power {
Subroutine get_power: not called CC=1 SCAR=6.9
Pod documented
91 0 my $self = shift;
92 0 return $self->source_power_level_immediate_amplitude_query();
93 }
94  
95  
96 2 __PACKAGE__->meta->make_immutable();
97  
98 2 1;
99  
100 __END__
« Moose/Instrument/KeysightB2901A.pm ↑ Summary Moose/Instrument/Agilent34410A.pm »