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 SCAR 7.0
CC
2
Cov
88%
sparam_catalog
2.1
set_power
2.0
get_power
2.0
CRAP 2.0
« Moose/Sweep/Step/Pulsewidth.pm ↑ Summary Moose/Catfile.pm »
1 package Lab::Moose::Instrument::RS_ZVM;
2 2 $Lab::Moose::Instrument::RS_ZVM::VERSION = '3.881';
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 sub BUILD {
27 1 ▶ my $self = shift;
Subroutine BUILD: called CC=1 SCAR=0.0
Pod undocumented
28  
29 #$self->clear();
30 #$self->cls(timeout => 5);
31 }
32  
33 sub cached_format_data_builder {
34 1 ▶ my $self = shift;
Subroutine cached_format_data_builder: called CC=1 SCAR=0.0
Pod undocumented
35 1 return $self->format_data_query( timeout => 3 );
36 }
37  
38 sub sparam_catalog {
39 4 ▶ my $self = shift;
Subroutine sparam_catalog: called CC=2 SCAR=7.2
Pod undocumented
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 sub trace_data_response_all {
52 3 ▶ my ( $self, %args ) = validated_hash(
Subroutine trace_data_response_all: called CC=1 SCAR=0.0
Pod undocumented
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 sub sparam_sweep_data {
67 3 ▶ my ( $self, %args ) = validated_getter( \@_ );
Subroutine sparam_sweep_data: called CC=1 SCAR=0.0
Pod undocumented
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 sub set_power {
86 0 ▶ my ( $self, $value, %args ) = validated_setter( \@_ );
Subroutine set_power: not called CC=1 SCAR=6.9
Pod documented
87 0 $self->source_power_level_immediate_amplitude( value => $value );
88 }
89  
90 sub get_power {
91 0 ▶ my $self = shift;
Subroutine get_power: not called CC=1 SCAR=6.9
Pod documented
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__
101  
102 =pod
103  
104 =encoding UTF-8
105  
106 =head1 NAME
107  
108 Lab::Moose::Instrument::RS_ZVM - Rohde & Schwarz ZVM Vector Network Analyzer
109  
110 =head1 VERSION
111  
112 version 3.881
113  
114 =head1 SYNOPSIS
115  
116 my $data = $zvm->sparam_sweep(timeout => 10);
117 my $matrix = $data->matrix;
118  
119 =head1 METHODS
120  
121 See L<Lab::Moose::Instrument::VNASweep> for the high-level C<sparam_sweep> and
122 C<sparam_catalog> methods.
123  
124 =head2 set_power, get_power
125  
126 Interface for power sweeps
127  
128 =head1 COPYRIGHT AND LICENSE
129  
130 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
131  
132 Copyright 2016 Simon Reinhardt
133 2017 Andreas K. Huettel, Simon Reinhardt
134 2020 Andreas K. Huettel
135 2023 Andreas K. Huettel
136  
137  
138 This is free software; you can redistribute it and/or modify it under
139 the same terms as the Perl 5 programming language system itself.
140  
141 =cut
« Moose/Sweep/Step/Pulsewidth.pm ↑ Summary Moose/Catfile.pm »