File Coverage

blib/lib/Lab/Moose/Instrument/SCPI/Initiate.pm
Criterion Covered Total %
statement 23 23 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod 3 3 100.0
total 35 36 97.2


line stmt bran cond sub pod time code
1             package Lab::Moose::Instrument::SCPI::Initiate;
2             #ABSTRACT: Role for the SCPI INITiate subsystem used by Rohde&Schwarz
3             $Lab::Moose::Instrument::SCPI::Initiate::VERSION = '3.881';
4 4     4   2318 use v5.20;
  4         19  
5              
6 4     4   22 use Moose::Role;
  4         9  
  4         26  
7             use Lab::Moose::Instrument
8 4     4   19142 qw/validated_no_param_setter validated_setter validated_getter/;
  4         14  
  4         221  
9 4     4   25 use Lab::Moose::Instrument::Cache;
  4         27  
  4         27  
10 4     4   2208 use MooseX::Params::Validate;
  4         12  
  4         26  
11              
12              
13             cache initiate_continuous => ( getter => 'initiate_continuous_query' );
14              
15             sub initiate_continuous {
16 3     3 1 27 my ( $self, %args )
17             = validated_no_param_setter( \@_, value => { isa => 'Bool' } );
18              
19 3         22 my $value = delete $args{value};
20 3 50       17 $value = $value ? 1 : 0;
21              
22 3         21 $self->write( command => "INIT:CONT $value", %args );
23 3         21 $self->cached_initiate_continuous($value);
24             }
25              
26             sub initiate_continuous_query {
27 3     3 1 16 my ( $self, %args ) = validated_getter( \@_ );
28              
29 3         1429 return $self->cached_initiate_continuous(
30             $self->query( command => 'INIT:CONT?', %args ) );
31             }
32              
33              
34             sub initiate_immediate {
35 9     9 1 35 my ( $self, %args ) = validated_no_param_setter( \@_ );
36 9         64 $self->write( command => 'INIT', %args );
37             }
38              
39             1;
40              
41             __END__
42              
43             =pod
44              
45             =encoding UTF-8
46              
47             =head1 NAME
48              
49             Lab::Moose::Instrument::SCPI::Initiate - Role for the SCPI INITiate subsystem used by Rohde&Schwarz
50              
51             =head1 VERSION
52              
53             version 3.881
54              
55             =head1 METHODS
56              
57             =head2 initiate_continuous_query
58              
59             =head2 initiate_continuous
60              
61             Query/Set whether to use single sweeps or continuous sweep mode.
62              
63             =head2 initiate_immediate
64              
65             $self->initiate_immediate();
66              
67             Start a new single sweep.
68              
69             =head1 COPYRIGHT AND LICENSE
70              
71             This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
72              
73             Copyright 2016 Simon Reinhardt
74             2017 Andreas K. Huettel, Simon Reinhardt
75             2020 Andreas K. Huettel
76              
77              
78             This is free software; you can redistribute it and/or modify it under
79             the same terms as the Perl 5 programming language system itself.
80              
81             =cut