Moose/Instrument/Rigol_DSA815.pm untested

filter: Statementstmt 0.0% 0 / 45 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 67 SCAR 17.9
CC
2
Cov
0%
validate_trace_param
6.0
BUILD
2.0
sense_sweep_points_query
2.0
CRAP 6.0
1 package Lab::Moose::Instrument::Rigol_DSA815;
2 $Lab::Moose::Instrument::Rigol_DSA815::VERSION = '3.881';
3 #ABSTRACT: Rigol DSA815 Spectrum Analyzer
4  
5 use v5.20;
6  
7  
8 use PDL::Core qw/pdl cat nelem/;
9  
10 use Moose;
11 use Moose::Util::TypeConstraints;
12 use MooseX::Params::Validate;
13 use Lab::Moose::Instrument qw/
14 timeout_param
15 precision_param
16 validated_getter
17 validated_setter
18 validated_channel_getter
19 validated_channel_setter
20 /;
21 use Lab::Moose::Instrument::Cache;
22 use Carp;
23 use namespace::autoclean;
24  
25 extends 'Lab::Moose::Instrument';
26  
27 with 'Lab::Moose::Instrument::SpectrumAnalyzer', qw(
28 Lab::Moose::Instrument::Common
29  
30 Lab::Moose::Instrument::SCPI::Format
31  
32 Lab::Moose::Instrument::SCPI::Sense::Bandwidth
33 Lab::Moose::Instrument::SCPI::Sense::Frequency
34 Lab::Moose::Instrument::SCPI::Sense::Sweep
35 Lab::Moose::Instrument::SCPI::Sense::Power
36 Lab::Moose::Instrument::SCPI::Display::Window
37 Lab::Moose::Instrument::SCPI::Unit
38  
39 Lab::Moose::Instrument::SCPI::Initiate
40  
41 Lab::Moose::Instrument::SCPIBlock
42  
43 );
44  
45 sub BUILD {
46 my $self = shift;
47  
48 # limitation of hardware
49 $self->capable_to_query_number_of_X_points_in_hardware(0);
50 $self->capable_to_set_number_of_X_points_in_hardware(0);
51 $self->hardwired_number_of_X_points(601);
52  
53 $self->clear();
54 $self->cls();
55 sleep 1; # for Rigol Spectrum Analyzer we need to wait otherwise instrument is not ready
56 }
57  
58  
59 sub validate_trace_param {
60 my ( $self, $trace ) = @_;
61 if ( $trace < 1 || $trace > 3 ) {
62 confess "trace has to be in (1..3)";
63 }
64 return $trace;
65 }
66  
67  
68 sub sense_sweep_points_query {
69 confess(
70 "sub sense_sweep_points_query is not implemented by hardware, we should not be here"
71 );
72 }
73  
74 sub sense_sweep_points {
75 confess(
76 "sub sense_sweep_points is not implemented by hardware, we should not be here"
77 );
78 }
79  
80  
81 __PACKAGE__->meta()->make_immutable();
82  
83 1;
84  
85 __END__
86  
87 =pod
88  
89 =encoding UTF-8
90  
91 =head1 NAME
92  
93 Lab::Moose::Instrument::Rigol_DSA815 - Rigol DSA815 Spectrum Analyzer
94  
95 =head1 VERSION
96  
97 version 3.881
98  
99 =head1 Driver for Rigol DSA800 series spectrum analyzers
100  
101 =head1 METHODS
102  
103 =head2 validate_trace_param
104  
105 Validates or applies hardware friendly aliases to trace parameter.
106 Trace has to be in (1..3).
107  
108 =head1 Missing SCPI functionality
109  
110 Rigol DSA815 has no Sense:Sweep:Points implementation
111  
112 =head2 sense_sweep_points_query
113  
114 =head2 sense_sweep_points
115  
116 =head1 Consumed Roles
117  
118 This driver consumes the following roles:
119  
120 =over
121  
122 =item L<Lab::Moose::Instrument::Common>
123  
124 =item L<Lab::Moose::Instrument::SCPI::Format>
125  
126 =item L<Lab::Moose::Instrument::SCPI::Sense::Bandwidth>
127  
128 =item L<Lab::Moose::Instrument::SCPI::Sense::Frequency>
129  
130 =item L<Lab::Moose::Instrument::SCPI::Sense::Sweep>
131  
132 =item L<Lab::Moose::Instrument::SCPI::Initiate>
133  
134 =item L<Lab::Moose::Instrument::SCPIBlock>
135  
136 =back
137  
138 =head1 COPYRIGHT AND LICENSE
139  
140 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
141  
142 Copyright 2018 Eugeniy E. Mikhailov
143 2020 Andreas K. Huettel
144  
145  
146 This is free software; you can redistribute it and/or modify it under
147 the same terms as the Perl 5 programming language system itself.
148  
149 =cut