| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Lab::Moose::Instrument::RS_ZVA; | 
| 2 |  |  |  |  |  |  | $Lab::Moose::Instrument::RS_ZVA::VERSION = '3.880'; | 
| 3 |  |  |  |  |  |  | #ABSTRACT: Rohde & Schwarz ZVA Vector Network Analyzer | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 2 |  |  | 2 |  | 1340 | use v5.20; | 
|  | 2 |  |  |  |  | 12 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 2 |  |  | 2 |  | 66 | use Moose; | 
|  | 2 |  |  |  |  | 9 |  | 
|  | 2 |  |  |  |  | 19 |  | 
| 8 | 2 |  |  | 2 |  | 15433 | use Moose::Util::TypeConstraints; | 
|  | 2 |  |  |  |  | 7 |  | 
|  | 2 |  |  |  |  | 20 |  | 
| 9 | 2 |  |  | 2 |  | 5209 | use MooseX::Params::Validate; | 
|  | 2 |  |  |  |  | 14 |  | 
|  | 2 |  |  |  |  | 22 |  | 
| 10 |  |  |  |  |  |  | use Lab::Moose::Instrument | 
| 11 | 2 |  |  | 2 |  | 1097 | qw/validated_getter validated_setter validated_channel_getter validated_channel_setter /; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 155 |  | 
| 12 | 2 |  |  | 2 |  | 1219 | use Lab::Moose::Instrument::Cache; | 
|  | 2 |  |  |  |  | 7 |  | 
|  | 2 |  |  |  |  | 9 |  | 
| 13 | 2 |  |  | 2 |  | 1286 | use Carp; | 
|  | 2 |  |  |  |  | 9 |  | 
|  | 2 |  |  |  |  | 133 |  | 
| 14 | 2 |  |  | 2 |  | 14 | use namespace::autoclean; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 10 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | extends 'Lab::Moose::Instrument'; | 
| 17 |  |  |  |  |  |  |  | 
| 18 |  |  |  |  |  |  | with qw( | 
| 19 |  |  |  |  |  |  | Lab::Moose::Instrument::VNASweep | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | Lab::Moose::Instrument::SCPI::Output::State | 
| 22 |  |  |  |  |  |  | ); | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | sub BUILD { | 
| 25 | 1 |  |  | 1 | 0 | 3 | my $self = shift; | 
| 26 | 1 |  |  |  |  | 9 | $self->clear(); | 
| 27 | 1 |  |  |  |  | 8 | $self->cls(); | 
| 28 |  |  |  |  |  |  | } | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | cache calculate_data_call_catalog => ( | 
| 31 |  |  |  |  |  |  | getter => 'calculate_data_call_catalog', | 
| 32 |  |  |  |  |  |  | isa    => 'ArrayRef' | 
| 33 |  |  |  |  |  |  | ); | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | sub calculate_data_call_catalog { | 
| 36 | 1 |  |  | 1 | 0 | 15 | my ( $self, $channel, %args ) = validated_channel_getter( \@_ ); | 
| 37 |  |  |  |  |  |  |  | 
| 38 | 1 |  |  |  |  | 8 | my $string | 
| 39 |  |  |  |  |  |  | = $self->query( command => "CALC${channel}:DATA:CALL:CAT?", %args ); | 
| 40 | 1 |  |  |  |  | 6 | $string =~ s/'//g; | 
| 41 |  |  |  |  |  |  |  | 
| 42 | 1 |  |  |  |  | 12 | return $self->cached_calculate_data_call_catalog( | 
| 43 |  |  |  |  |  |  | [ split ',', $string ] ); | 
| 44 |  |  |  |  |  |  | } | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | sub calculate_data_call { | 
| 47 | 3 |  |  | 3 | 0 | 19 | my ( $self, $channel, %args ) = validated_channel_getter( | 
| 48 |  |  |  |  |  |  | \@_, | 
| 49 |  |  |  |  |  |  | format => { isa => 'Str' }    # {isa => enum([qw/FDATA SDATA MDATA/])} | 
| 50 |  |  |  |  |  |  | ); | 
| 51 |  |  |  |  |  |  |  | 
| 52 | 3 |  |  |  |  | 17 | my $format = delete $args{format}; | 
| 53 |  |  |  |  |  |  |  | 
| 54 | 3 |  |  |  |  | 21 | return $self->binary_query( | 
| 55 |  |  |  |  |  |  | command => "CALC${channel}:DATA:CALL? $format", | 
| 56 |  |  |  |  |  |  | %args | 
| 57 |  |  |  |  |  |  | ); | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | } | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | sub sparam_catalog { | 
| 62 | 4 |  |  | 4 | 0 | 100309 | my $self = shift; | 
| 63 |  |  |  |  |  |  |  | 
| 64 | 4 |  |  |  |  | 29 | my $catalog = $self->cached_calculate_data_call_catalog(); | 
| 65 | 4 |  |  |  |  | 12 | my @complex_catalog; | 
| 66 |  |  |  |  |  |  |  | 
| 67 | 4 |  |  |  |  | 9 | for my $sparam ( @{$catalog} ) { | 
|  | 4 |  |  |  |  | 10 |  | 
| 68 | 4 |  |  |  |  | 19 | push @complex_catalog, "Re($sparam)", "Im($sparam)"; | 
| 69 |  |  |  |  |  |  | } | 
| 70 |  |  |  |  |  |  |  | 
| 71 | 4 |  |  |  |  | 15 | return \@complex_catalog; | 
| 72 |  |  |  |  |  |  | } | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | sub sparam_sweep_data { | 
| 75 | 3 |  |  | 3 | 0 | 15 | my ( $self, %args ) = validated_getter( \@_ ); | 
| 76 |  |  |  |  |  |  |  | 
| 77 | 3 |  |  |  |  | 2042 | my $byte_order = $self->cached_format_border(); | 
| 78 | 3 | 50 |  |  |  | 16 | if ( $byte_order ne 'SWAP' ) { | 
| 79 | 0 |  |  |  |  | 0 | carp 'setting network byteorder to little endian.'; | 
| 80 | 0 |  |  |  |  | 0 | $self->format_border( value => 'SWAP' ); | 
| 81 |  |  |  |  |  |  | } | 
| 82 |  |  |  |  |  |  |  | 
| 83 |  |  |  |  |  |  | # Start single sweep. | 
| 84 | 3 |  |  |  |  | 19 | $self->initiate_immediate(); | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | # Wait until single sweep is finished. | 
| 87 | 3 |  |  |  |  | 29 | $self->wai(); | 
| 88 |  |  |  |  |  |  |  | 
| 89 | 3 |  |  |  |  | 15 | return $self->calculate_data_call( format => 'SDATA', %args ); | 
| 90 |  |  |  |  |  |  | } | 
| 91 |  |  |  |  |  |  |  | 
| 92 |  |  |  |  |  |  |  | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | sub set_power { | 
| 95 | 0 |  |  | 0 | 0 |  | my ( $self, $value, %args ) = validated_setter( \@_ ); | 
| 96 | 0 |  |  |  |  |  | $self->source_power_level_immediate_amplitude( value => $value ); | 
| 97 |  |  |  |  |  |  | } | 
| 98 |  |  |  |  |  |  |  | 
| 99 |  |  |  |  |  |  | sub get_power { | 
| 100 | 0 |  |  | 0 | 0 |  | my $self = shift; | 
| 101 | 0 |  |  |  |  |  | return $self->source_power_level_immediate_amplitude_query(); | 
| 102 |  |  |  |  |  |  | } | 
| 103 |  |  |  |  |  |  |  | 
| 104 |  |  |  |  |  |  |  | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  |  | 
| 107 |  |  |  |  |  |  | __PACKAGE__->meta->make_immutable(); | 
| 108 |  |  |  |  |  |  |  | 
| 109 |  |  |  |  |  |  | 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.880 | 
| 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 |