Moose/Instrument/Rigol_DSA815.pm untested

filter: Statementstmt 0.0% 0 / 45 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 69 CC 2 SCAR 9.4
CC
2
Cov
0%
validate_trace_param
6.0
BUILD
2.0
sense_sweep_points_query
2.0
CRAP 2.6
1 package Lab::Moose::Instrument::Rigol_DSA815;
2 $Lab::Moose::Instrument::Rigol_DSA815::VERSION = '3.931';
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__