Moose/Instrument/Common.pm

filter: Statementstmt 48.0% 25 / 52 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 52.9% 9 / 17 Podpod 100% 11 / 11 totaltotal 54.8% 45 / 82 CC 2 SCAR 6.6
CC
2
Cov
46%
opc_sync
6.0
idn
2.0
idn_manufacturer
2.0
CRAP 1.9
« Moose/Instrument/RS_FSV.pm ↑ Summary Moose/Instrument/ZI_MFLI.pm »
1 package Lab::Moose::Instrument::Common;
2 #ABSTRACT: Role for common commands declared mandatory by IEEE 488.2
3 14 $Lab::Moose::Instrument::Common::VERSION = '3.931';
4 14 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 14 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 14 ▶use MooseX::Params::Validate;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 14 ▶use Lab::Moose::Instrument qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
10 validated_getter
11 validated_setter
12 validated_no_param_setter
13 14 /;
14 14 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 14 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 9 ▶sub cls {
Subroutine cls: called CC=1 SCAR=0.0
Pod documented
20 9 my ( $self, %args ) = validated_no_param_setter( \@_ );
21 9 return $self->write( command => '*CLS', %args );
22 }
23  
24  
25 0 ▶sub idn {
Subroutine idn: not called CC=1 SCAR=6.9
Pod documented
26 0 my ( $self, %args ) = validated_getter( \@_ );
27 0 return $self->query( command => '*IDN?', %args );
28 }
29  
30  
31 0 ▶sub idn_manufacturer {
Subroutine idn_manufacturer: not called CC=1 SCAR=6.9
Pod documented
32 0 my ( $self, %args ) = validated_getter( \@_ );
33 0 my $i=$self->query( command => '*IDN?', %args );
34 0 my ($man, $mod, $ser, $fir) = split /,\s*/, $i, 4;
35 0 return $man;
36 }
37  
38  
39 0 ▶sub idn_model {
Subroutine idn_model: not called CC=1 SCAR=6.9
Pod documented
40 0 my ( $self, %args ) = validated_getter( \@_ );
41 0 my $i=$self->query( command => '*IDN?', %args );
42 0 my ($man, $mod, $ser, $fir) = split /,\s*/, $i, 4;
43 0 return $mod;
44 }
45  
46  
47 0 ▶sub idn_serial {
Subroutine idn_serial: not called CC=1 SCAR=6.9
Pod documented
48 0 my ( $self, %args ) = validated_getter( \@_ );
49 0 my $i=$self->query( command => '*IDN?', %args );
50 0 my ($man, $mod, $ser, $fir) = split /,\s/, $i, 4;
51 0 return $ser;
52 }
53  
54  
55 0 ▶sub idn_firmware {
Subroutine idn_firmware: not called CC=1 SCAR=6.9
Pod documented
56 0 my ( $self, %args ) = validated_getter( \@_ );
57 0 my $i=$self->query( command => '*IDN?', %args );
58 0 my ($man, $mod, $ser, $fir) = split /,\s/, $i, 4;
59 0 return $fir;
60 }
61  
62  
63 0 ▶sub opc {
Subroutine opc: not called CC=1 SCAR=6.9
Pod documented
64 0 my ( $self, %args ) = validated_no_param_setter( \@_ );
65 0 return $self->write( command => '*OPC', %args );
66 }
67  
68  
69 0 ▶sub opc_query {
Subroutine opc_query: not called CC=1 SCAR=6.9
Pod documented
70 0 my ( $self, %args ) = validated_getter( \@_ );
71 0 return $self->query( command => '*OPC?', %args );
72 }
73  
74  
75 0 ▶sub opc_sync {
Subroutine opc_sync: not called CC=2 SCAR=17.9
Pod documented
76 0 my ( $self, %args ) = validated_getter( \@_ );
77 0 my $one = $self->opc_query(%args);
78 0 ▶ if ( $one ne '1' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($one ne 1) 0 0 0
79 0 croak "OPC query did not return '1'";
80 }
81 0 return $one;
82 }
83  
84  
85 14 ▶sub rst {
Subroutine rst: called CC=1 SCAR=0.0
Pod documented
86 14 my ( $self, %args ) = validated_no_param_setter( \@_ );
87 14 return $self->write( command => '*RST', %args );
88 }
89  
90  
91 9 ▶sub wai {
Subroutine wai: called CC=1 SCAR=0.0
Pod documented
92 9 my ( $self, %args ) = validated_no_param_setter( \@_ );
93 9 return $self->write( command => '*WAI', %args );
94 }
95  
96 14 1;
97  
98 __END__
« Moose/Instrument/RS_FSV.pm ↑ Summary Moose/Instrument/ZI_MFLI.pm »