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.880';
4 4     4   2731 use v5.20;
  4         25  
5              
6 4     4   34 use Moose::Role;
  4         10  
  4         33  
7             use Lab::Moose::Instrument
8 4     4   21719 qw/validated_no_param_setter validated_setter validated_getter/;
  4         26  
  4         264  
9 4     4   33 use Lab::Moose::Instrument::Cache;
  4         16  
  4         39  
10 4     4   2528 use MooseX::Params::Validate;
  4         9  
  4         31  
11              
12              
13             cache initiate_continuous => ( getter => 'initiate_continuous_query' );
14              
15             sub initiate_continuous {
16 3     3 1 44 my ( $self, %args )
17             = validated_no_param_setter( \@_, value => { isa => 'Bool' } );
18              
19 3         15 my $value = delete $args{value};
20 3 50       19 $value = $value ? 1 : 0;
21              
22 3         32 $self->write( command => "INIT:CONT $value", %args );
23 3         20 $self->cached_initiate_continuous($value);
24             }
25              
26             sub initiate_continuous_query {
27 3     3 1 19 my ( $self, %args ) = validated_getter( \@_ );
28              
29 3         1542 return $self->cached_initiate_continuous(
30             $self->query( command => 'INIT:CONT?', %args ) );
31             }
32              
33              
34             sub initiate_immediate {
35 9     9 1 37 my ( $self, %args ) = validated_no_param_setter( \@_ );
36 9         72 $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.880
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