Moose/Instrument/HP83732A.pm

filter: Statementstmt 55.0% 38 / 69 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 46.1% 12 / 26 Podpod 50.0% 7 / 14 totaltotal 52.2% 57 / 109 CC 1 SCAR 4.3
CC
1
Cov
55%
BUILD
2.0
get_id
2.0
reset
2.0
CRAP 1.5
« Moose/Connection/IsoBus.pm ↑ Summary Moose/Instrument/SCPI/Sense/Function/Concurrent.pm »
1 package Lab::Moose::Instrument::HP83732A;
2 1 $Lab::Moose::Instrument::HP83732A::VERSION = '3.931';
3 #ABSTRACT: HP 83732A Series Synthesized Signal Generator
4  
5 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Time::HiRes qw (usleep);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Moose::Util::TypeConstraints qw/enum/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Lab::Moose::Instrument qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
13 validated_getter
14 validated_setter
15 validated_no_param_setter
16 setter_params
17 1 /;
18 1 ▶use Lab::Moose::Instrument::Cache;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use Time::HiRes qw/time usleep/;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Lab::Moose 'linspace';
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 1 extends 'Lab::Moose::Instrument';
25  
26 0 ▶sub BUILD {
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
27 0 my $self = shift;
28 0 $self->get_id();
29 }
30  
31 0 ▶sub get_id {
Subroutine get_id: not called CC=1 SCAR=6.9
Pod undocumented
32 0 my $self = shift;
33 0 return $self->query( command => sprintf("*IDN?") );
34 }
35  
36  
37  
38 0 ▶sub reset {
Subroutine reset: not called CC=1 SCAR=6.9
Pod documented
39 0 my $self = shift;
40 0 $self->write( command => sprintf("*RST") );
41 }
42  
43  
44 0 ▶sub set_frq {
Subroutine set_frq: not called CC=1 SCAR=6.9
Pod documented
45 0 my ( $self, $value, %args ) = validated_setter( \@_,
46 value => { isa => 'Num' },
47 );
48  
49 0 $self->write( command => sprintf("FREQuency:CW %d Hz", $value), %args );
50 }
51  
52  
53 0 ▶sub get_frq {
Subroutine get_frq: not called CC=1 SCAR=6.9
Pod documented
54 0 my $self = shift;
55  
56 0 return $self->query( command => sprintf("FREQuency:CW?") );
57 }
58  
59 0 ▶sub set_power {
Subroutine set_power: not called CC=1 SCAR=6.9
Pod documented
60 0 my ( $self, $value, %args ) = validated_setter( \@_,
61 value => { isa => 'Num' },
62 );
63  
64 0 $self->write( command => sprintf("POWer:LEVel %d DBM", $value) );
65 }
66  
67  
68 0 ▶sub get_power {
Subroutine get_power: not called CC=1 SCAR=6.9
Pod documented
69 0 my $self = shift;
70  
71 0 return $self->query( command => sprintf("POWer:LEVel?") );
72 }
73  
74 0 ▶sub power_on {
Subroutine power_on: not called CC=1 SCAR=6.9
Pod documented
75 0 my $self = shift;
76 0 $self->write( command => sprintf("OUTP:STATe ON") );
77 }
78  
79 0 ▶sub power_off {
Subroutine power_off: not called CC=1 SCAR=6.9
Pod documented
80 0 my $self = shift;
81 0 $self->write( command => sprintf("OUTP:STATe OFF") );
82 }
83  
84 0 ▶sub selftest {
Subroutine selftest: not called CC=1 SCAR=6.9
Pod undocumented
85 0 my $self = shift;
86 0 return $self->query( command => sprintf("*TST?") );
87 }
88  
89 0 ▶sub display_on {
Subroutine display_on: not called CC=1 SCAR=6.9
Pod undocumented
90 0 my $self = shift;
91 0 $self->write( command => sprintf("DISPlay ON") );
92 }
93  
94 0 ▶sub display_off {
Subroutine display_off: not called CC=1 SCAR=6.9
Pod undocumented
95 0 my $self = shift;
96 0 $self->write( command => sprintf("DISPlay OFF") );
97 }
98  
99 0 ▶sub enable_external_am {
Subroutine enable_external_am: not called CC=1 SCAR=6.9
Pod undocumented
100 0 my $self = shift;
101 0 $self->write( command => sprintf("AM:DEPTh MAX") );
102 0 $self->write( command => sprintf("AM:SENSitivity 70PCT/VOLT") );
103 0 $self->write( command => sprintf("AM:TYPE LINear") );
104 0 $self->write( command => sprintf("AM:STATe ON") );
105 }
106  
107 0 ▶sub disable_external_am {
Subroutine disable_external_am: not called CC=1 SCAR=6.9
Pod undocumented
108 0 my $self = shift;
109 0 $self->write( command => sprintf("AM:STATe OFF") );
110 }
111  
112 1 1;
113  
114 __END__
« Moose/Connection/IsoBus.pm ↑ Summary Moose/Instrument/SCPI/Sense/Function/Concurrent.pm »