Moose/Instrument/RS_ZVA.pm

filter: Statementstmt 89.6% 52 / 58 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 86.6% 13 / 15 Podpod 0.0% 0 / 7 totaltotal 80.4% 66 / 82 CC 3 SCAR 3.1
CC
3
Cov
88%
sparam_sweep_data
2.1
sparam_catalog
2.0
set_power
2.0
CRAP 1.4
« Moose/Instrument/SCPI/Sense/Impedance.pm ↑ Summary Moose/Connection.pm »
1 package Lab::Moose::Instrument::RS_ZVA;
2 2 $Lab::Moose::Instrument::RS_ZVA::VERSION = '3.931';
3 #ABSTRACT: Rohde & Schwarz ZVA 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 use Lab::Moose::Instrument
11 2 ▶ qw/validated_getter validated_setter validated_channel_getter validated_channel_setter /;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 2 extends 'Lab::Moose::Instrument';
17  
18 2 with qw(
19 Lab::Moose::Instrument::VNASweep
20  
21 Lab::Moose::Instrument::SCPI::Output::State
22 );
23  
24 1 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
25 1 my $self = shift;
26 1 $self->clear();
27 1 $self->cls();
28 }
29  
30 2 cache calculate_data_call_catalog => (
31 getter => 'calculate_data_call_catalog',
32 isa => 'ArrayRef'
33 );
34  
35 1 ▶sub calculate_data_call_catalog {
Subroutine calculate_data_call_catalog: called CC=1 SCAR=0.0
Pod undocumented
36 1 my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
37  
38 1 my $string
39 = $self->query( command => "CALC${channel}:DATA:CALL:CAT?", %args );
40 1 $string =~ s/'//g;
41  
42 1 return $self->cached_calculate_data_call_catalog(
43 [ split ',', $string ] );
44 }
45  
46 3 ▶sub calculate_data_call {
Subroutine calculate_data_call: called CC=1 SCAR=0.0
Pod undocumented
47 3 my ( $self, $channel, %args ) = validated_channel_getter(
48 \@_,
49 format => { isa => 'Str' } # {isa => enum([qw/FDATA SDATA MDATA/])}
50 );
51  
52 3 my $format = delete $args{format};
53  
54 3 return $self->binary_query(
55 command => "CALC${channel}:DATA:CALL? $format",
56 %args
57 );
58  
59 }
60  
61 4 ▶sub sparam_catalog {
Subroutine sparam_catalog: called CC=2 SCAR=6.9
Pod undocumented
62 4 my $self = shift;
63  
64 4 my $catalog = $self->cached_calculate_data_call_catalog();
65 4 my @complex_catalog;
66  
67 4 for my $sparam ( @{$catalog} ) {
68 4 push @complex_catalog, "Re($sparam)", "Im($sparam)";
69 }
70  
71 4 return \@complex_catalog;
72 }
73  
74 3 ▶sub sparam_sweep_data {
Subroutine sparam_sweep_data: called CC=2 SCAR=7.5
Pod undocumented
75 3 my ( $self, %args ) = validated_getter( \@_ );
76  
77 3 my $byte_order = $self->cached_format_border();
78 3 ▶ if ( $byte_order ne 'SWAP' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($byte_order ne "SWAP") 0 3 3
79 0 carp 'setting network byteorder to little endian.';
80 0 $self->format_border( value => 'SWAP' );
81 }
82  
83 # Start single sweep.
84 3 $self->initiate_immediate();
85  
86 # Wait until single sweep is finished.
87 3 $self->wai();
88  
89 3 return $self->calculate_data_call( format => 'SDATA', %args );
90 }
91  
92  
93  
94 0 ▶sub set_power {
Subroutine set_power: not called CC=1 SCAR=6.9
Pod undocumented
95 0 my ( $self, $value, %args ) = validated_setter( \@_ );
96 0 $self->source_power_level_immediate_amplitude( value => $value );
97 }
98  
99 0 ▶sub get_power {
Subroutine get_power: not called CC=1 SCAR=6.9
Pod undocumented
100 0 my $self = shift;
101 0 return $self->source_power_level_immediate_amplitude_query();
102 }
103  
104  
105  
106  
107 2 __PACKAGE__->meta->make_immutable();
108  
109 2 1;
110  
111 __END__
« Moose/Instrument/SCPI/Sense/Impedance.pm ↑ Summary Moose/Connection.pm »