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 SCAR 11.0
CC
3
Cov
88%
sparam_sweep_data
2.1
sparam_catalog
2.0
set_power
2.0
CRAP 3.0
« Moose/Instrument/SCPI/Format.pm ↑ Summary Moose/Connection.pm »
1 package Lab::Moose::Instrument::RS_ZVA;
2 2 $Lab::Moose::Instrument::RS_ZVA::VERSION = '3.881';
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 sub BUILD {
25 1 ▶ my $self = shift;
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
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 sub calculate_data_call_catalog {
36 1 ▶ my ( $self, $channel, %args ) = validated_channel_getter( \@_ );
Subroutine calculate_data_call_catalog: called CC=1 SCAR=0.0
Pod undocumented
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 sub calculate_data_call {
47 3 ▶ my ( $self, $channel, %args ) = validated_channel_getter(
Subroutine calculate_data_call: called CC=1 SCAR=0.0
Pod undocumented
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 sub sparam_catalog {
62 4 ▶ my $self = shift;
Subroutine sparam_catalog: called CC=2 SCAR=6.9
Pod undocumented
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 sub sparam_sweep_data {
75 3 ▶ my ( $self, %args ) = validated_getter( \@_ );
Subroutine sparam_sweep_data: called CC=2 SCAR=7.5
Pod undocumented
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 sub set_power {
95 0 ▶ my ( $self, $value, %args ) = validated_setter( \@_ );
Subroutine set_power: not called CC=1 SCAR=6.9
Pod undocumented
96 0 $self->source_power_level_immediate_amplitude( value => $value );
97 }
98  
99 sub get_power {
100 0 ▶ my $self = shift;
Subroutine get_power: not called CC=1 SCAR=6.9
Pod undocumented
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__
112  
113 =pod
114  
115 =encoding UTF-8
116  
117 =head1 NAME
118  
119 Lab::Moose::Instrument::RS_ZVA - Rohde & Schwarz ZVA Vector Network Analyzer
120  
121 =head1 VERSION
122  
123 version 3.881
124  
125 =head1 SYNOPSIS
126  
127 my $data = $zva->sparam_sweep(timeout => 10);
128  
129 =head1 METHODS
130  
131 See L<Lab::Moose::Instrument::VNASweep> for the high-level C<sparam_sweep> and
132 C<sparam_catalog> methods.
133  
134 =head1 COPYRIGHT AND LICENSE
135  
136 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
137  
138 Copyright 2016 Simon Reinhardt
139 2017 Andreas K. Huettel, Simon Reinhardt
140 2020 Andreas K. Huettel, Simon Reinhardt
141 2023 Andreas K. Huettel
142  
143  
144 This is free software; you can redistribute it and/or modify it under
145 the same terms as the Perl 5 programming language system itself.
146  
147 =cut
« Moose/Instrument/SCPI/Format.pm ↑ Summary Moose/Connection.pm »