CIGIPP/SensorControl.pm

filter: Statementstmt 69.5% 98 / 141 Branchbran 40.3% 21 / 52 Conditioncond 33.3% 14 / 42 MC/DCmcdc 0.0% 0 / 22 Subroutinesub 91.3% 21 / 23 Podpod 100% 19 / 19 totaltotal 57.8% 173 / 299 CC 42 SCAR 21.6
CC
42
Cov
57%
track_mode
25.0
new
19.6
unpack
6.0
CRAP 8.7
« CIGIPP/EventNotification.pm ↑ Summary CIGIPP/AnimationStopNotification.pm »
1 #
2 # Rinchi Common Image Generator Interface for Perl
3 # Class Identifier: f78ae02a-200e-11de-bdb1-001c25551abc
4 # Author: Brian M. Ames
5 #
6  
7 package Rinchi::CIGIPP::SensorControl;
8  
9 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 require Exporter;
15  
16 2 our @ISA = qw(Exporter);
17  
18 # Items to export into callers namespace by default. Note: do not export
19 # names by default without a very good reason. Use EXPORT_OK instead.
20 # Do not simply export all your public functions/methods/constants.
21  
22 # This allows declaration use Rinchi::CIGI::AtmosphereControl ':all';
23 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
24 # will save memory.
25 2 our %EXPORT_TAGS = ( 'all' => [ qw(
26
27 ) ] );
28  
29 2 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
30  
31 2 our @EXPORT = qw(
32
33 );
34  
35 2 our $VERSION = '0.01';
36  
37 # Preloaded methods go here.
38  
39 =head1 NAME
40  
41 Rinchi::CIGIPP::SensorControl - Perl extension for the Common Image Generator
42 Interface - Sensor Control data packet.
43 data packet.
44 =head1 SYNOPSIS
45  
46 use Rinchi::CIGIPP::SensorControl;
47 my $sensor_ctl = Rinchi::CIGIPP::SensorControl->new();
48  
49 $packet_type = $sensor_ctl->packet_type();
50 $packet_size = $sensor_ctl->packet_size();
51 $view_ident = $sensor_ctl->view_ident(53486);
52 $sensor_ident = $sensor_ctl->sensor_ident(190);
53 $track_mode = $sensor_ctl->track_mode(Rinchi::CIGIPP->Off);
54 $track_white_black = $sensor_ctl->track_white_black(Rinchi::CIGIPP->Black);
55 $automatic_gain_enable = $sensor_ctl->automatic_gain_enable(Rinchi::CIGIPP->Enable);
56 $line_by_line_dropout_enable = $sensor_ctl->line_by_line_dropout_enable(Rinchi::CIGIPP->Enable);
57 $polarity = $sensor_ctl->polarity(Rinchi::CIGIPP->WhiteHot);
58 $sensor_on_off = $sensor_ctl->sensor_on_off(Rinchi::CIGIPP->Off);
59 $response_type = $sensor_ctl->response_type(Rinchi::CIGIPP->ExtendedSRT);
60 $gain = $sensor_ctl->gain(62.89);
61 $level = $sensor_ctl->level(54.416);
62 $ac_coupling = $sensor_ctl->ac_coupling(61.664);
63 $noise = $sensor_ctl->noise(42.664);
64  
65 =head1 DESCRIPTION
66  
67 The Sensor Control packet is used to control sensor modes and display behavior
68 for sensor-based weapons systems and other sensor applications. It is typically
69 used in conjunction the View Control packet, which moves the sensor camera
70 eyepoint. The View Definition and Component Control packets can also be used to
71 control various aspects of camera and sensor behavior.
72  
73 A sensor is associated with a view through the View ID attribute. A sensor may
74 be associated with more than one view to allow the sensor imagery to be
75 displayed on multiple displays; however, this may evoke multiple Sensor
76 Response or Sensor Extended Response packets from the IG.
77  
78 In a typical scenario, the sensor will be inactive until the user turns the
79 sensor on. The Host will send a Sensor Control packet with the Sensor On/Off
80 attribute set to On (1). Because the sensor is not yet tracking a target, the
81 Track Mode attribute of this packet should be set to Off (0). The Host might
82 also send a View Control packet to make sure the initial sensor camera position
83 is set. Additional View Control packets will be sent as the user slews the
84 sensor view.
85  
86 When the user attempts to lock onto a target, the Host will send a Sensor
87 Control packet, setting the Track Mode attribute to the appropriate value.
88 Because the Host will need the position of the track point to determine which
89 entity is the target, it sets the Response Type attribute to Gate and Target
90 Position (1).
91  
92 The IG will immediately begin sending response packets (in this case, Sensor
93 Extended Response packets) that contain the gate symbol position and, if
94 appropriate, the sensor target position. A response packet will be sent every
95 frame until the IG is directed to do otherwise by the Host.
96  
97 The Sensor Status attribute of the response packets will indicate whether the
98 sensor was able to establish a lock. If the sensor was unable to do so, the
99 Sensor Status attribute will be set to zero (0). The Host then should reset the
100 Track Mode attribute to Off (0) before the user again tries to lock onto the
101 target. If, on the other hand, the lock was successful, then the Sensor Status
102 attribute will be set to one (1).
103  
104 The Entity ID attribute of the Sensor Extended Response packet contains the ID
105 of the target entity. If the IG cannot determine the target, or if the sensor
106 is tracking non-entity geometry, then the Entity ID Valid attribute of the
107 response packet will be set to Invalid (0). The Host must then use the target
108 position returned by the IG to determine which entity or object is being
109 tracked by the sensor. This may occur immediately or over several frames,
110 depending upon the number and proximity of entities along the sensor viewing
111 vector.
112 Once the Host has determined the target, it can send a Sensor Control packet
113 with its Response Type attribute set to Gate Position (1), directing the IG to
114 send Sensor Response packets instead of Sensor Extended Response packets.
115  
116 =head2 EXPORT
117  
118 None by default.
119  
120 #==============================================================================
121  
122 =item new $sensor_ctl = Rinchi::CIGIPP::SensorControl->new()
123  
124 Constructor for Rinchi::SensorControl.
125  
126 =cut
127  
128 2 ▶sub new {
Subroutine new: called CC=7 SCAR=29.8
Pod documented
129 2 my $class = shift;
130 2 ▶ $class = ref($class) || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
020
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
131  
132 2 my $self = {
133 '_Buffer' => '',
134 '_ClassIdent' => 'f78ae02a-200e-11de-bdb1-001c25551abc',
135 '_Pack' => 'CCSCCCCffff',
136 '_Swap1' => 'CCvCCCCVVVV',
137 '_Swap2' => 'CCnCCCCNNNN',
138 'packetType' => 17,
139 'packetSize' => 24,
140 'viewIdent' => 0,
141 'sensorIdent' => 0,
142 '_bitfields1' => 0, # Includes bitfields trackMode, TrackWhtBlk, automaticGainEnable, lineByLineDropoutEnable, polarity, and sensorOnOff.
143 'trackMode' => 0,
144 'trackWhiteBlack' => 0,
145 'automaticGainEnable' => 0,
146 'lineByLineDropoutEnable' => 0,
147 'polarity' => 0,
148 'sensorOnOff' => 0,
149 '_bitfields2' => 0, # Includes bitfields unused30, and responseType.
150 'responseType' => 0,
151 '_unused31' => 0,
152 'gain' => 0,
153 'level' => 0,
154 'acCoupling' => 0,
155 'noise' => 0,
156 };
157  
158 2 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 2 2
159 0 ▶ if (ref($_[0]) eq 'ARRAY') {
Branch: 2 branches
BranchTrueFalseTotal
if (ref $_[0] eq 'ARRAY') { } 0 0 0
elsif (ref $_[0] eq 'HASH') { } 0 0 0
160 0 $self->{'_Buffer'} = $_[0][0];
161 } elsif (ref($_[0]) eq 'HASH') {
162 0 foreach my $attr (keys %{$_[0]}) {
163 0 ▶ $self->{"_$attr"} = $_[0]->{$attr} unless ($attr =~ /^_/);
Branch: 1 branch
BranchTrueFalseTotal
unless $attr =~ /^_/ 0 0 0
164 }
165 }
166 }
167  
168 2 bless($self,$class);
169 2 return $self;
170 }
171  
172 #==============================================================================
173  
174 =item sub packet_type()
175  
176 $value = $sensor_ctl->packet_type();
177  
178 Data Packet Identifier.
179  
180 This attribute identifies this data packet as the Sensor Control packet. The
181 value of this attribute must be 17.
182  
183 =cut
184  
185 2 ▶sub packet_type() {
Subroutine packet_type: called CC=1 SCAR=0.0
Pod documented
186 2 my ($self) = @_;
187 2 return $self->{'packetType'};
188 }
189  
190 #==============================================================================
191  
192 =item sub packet_size()
193  
194 $value = $sensor_ctl->packet_size();
195  
196 Data Packet Size.
197  
198 This attribute indicates the number of bytes in this data packet. The value of
199 this attribute must be 24.
200  
201 =cut
202  
203 2 ▶sub packet_size() {
Subroutine packet_size: called CC=1 SCAR=0.0
Pod documented
204 2 my ($self) = @_;
205 2 return $self->{'packetSize'};
206 }
207  
208 #==============================================================================
209  
210 =item sub view_ident([$newValue])
211  
212 $value = $sensor_ctl->view_ident($newValue);
213  
214 View ID.
215  
216 This attribute identifies the view to which the specified sensor is assigned.
217 Note that a sensor cannot be assigned to a view group.
218  
219 =cut
220  
221 2 ▶sub view_ident() {
Subroutine view_ident: called CC=2 SCAR=7.0
Pod documented
222 2 my ($self,$nv) = @_;
223 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
224 2 $self->{'viewIdent'} = $nv;
225 }
226 2 return $self->{'viewIdent'};
227 }
228  
229 #==============================================================================
230  
231 =item sub sensor_ident([$newValue])
232  
233 $value = $sensor_ctl->sensor_ident($newValue);
234  
235 Sensor ID.
236  
237 This attribute specifies the sensor to which the data in this packet are applied.
238  
239 =cut
240  
241 2 ▶sub sensor_ident() {
Subroutine sensor_ident: called CC=2 SCAR=7.0
Pod documented
242 2 my ($self,$nv) = @_;
243 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
244 2 $self->{'sensorIdent'} = $nv;
245 }
246 2 return $self->{'sensorIdent'};
247 }
248  
249 #==============================================================================
250  
251 =item sub track_mode([$newValue])
252  
253 $value = $sensor_ctl->track_mode($newValue);
254  
255 Track Mode.
256  
257 This attribute specifies which track mode the sensor should use:
258  
259 Off – No tracking will occur.
260  
261 Force Correlate – The sensor processes a portion of the view image, establishes
262 an image pattern, and attempts to keep the seeker pointed at the center of that
263 image pattern. This mode is typically used for Maverick sensors.
264  
265 Scene – The sensor processes a portion of the view image, establishes an image
266 pattern, and attempts to keep the seeker pointed at the center of that image
267 pattern. This mode is typically used for FLIR sensors.
268  
269 Target – The sensor uses contrast tracking to lock to a specific target area.
270  
271 Ship – The sensor uses contrast tracking and adjusts the tracking point so that
272 the weapon strikes close to the water line.
273  
274 Off 0
275 ForceCorrelate 1
276 Scene 2
277 Target 3
278 Ship 4
279 IGDefined3 5
280 IGDefined2 6
281 IGDefined1 7
282  
283 =cut
284  
285 2 ▶sub track_mode() {
Subroutine track_mode: called CC=10 SCAR=32.2
Pod documented
286 2 my ($self,$nv) = @_;
287 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
288 2 ▶ if (($nv==0) or ($nv==1) or ($nv==2) or ($nv==3) or ($nv==4) or ($nv==5) or ($nv==6) or ($nv==7)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1 or $nv == 2 or $nv == 3 or $nv == 4 or $nv == 5 or $nv == 6 or $nv == 7) { } 2 0 2
Condition33%7/21
$nv == 0 or $nv == 1 or $nv == 2 or $nv == 3 or $nv == 4 or $nv == 5 or $nv == 6 or $nv == 7
l!l&&r!l&&!r
200
$nv == 0 or $nv == 1 or $nv == 2 or $nv == 3 or $nv == 4 or $nv == 5 or $nv == 6
l!l&&r!l&&!r
200
$nv == 0 or $nv == 1 or $nv == 2 or $nv == 3 or $nv == 4 or $nv == 5
l!l&&r!l&&!r
200
$nv == 0 or $nv == 1 or $nv == 2 or $nv == 3 or $nv == 4
l!l&&r!l&&!r
200
$nv == 0 or $nv == 1 or $nv == 2 or $nv == 3
l!l&&r!l&&!r
200
$nv == 0 or $nv == 1 or $nv == 2
l!l&&r!l&&!r
200
$nv == 0 or $nv == 1
l!l&&r!l&&!r
200
MC/DC0%0/8
$nv == 0 or $nv == 1 or $nv == 2 or $nv == 3 or $nv == 4 or $nv == 5 or $nv == 6 or $nv == 7
$nv == 0 $nv == 1 $nv == 2 $nv == 3 $nv == 4 $nv == 5 $nv == 6 $nv == 7
Truth table11%1/9
A or B or C or D or E or F or G or H
A= $nv == 0B= $nv == 1C= $nv == 2D= $nv == 3E= $nv == 4F= $nv == 5G= $nv == 6H= $nv == 7
ABCDEFGHresult
1XXXXXXX1
01XXXXXX1
001XXXXX1
0001XXXX1
00001XXX1
000001XX1
0000001X1
000000011
000000000
289 2 $self->{'trackMode'} = $nv;
290 2 $self->{'_bitfields1'} |= ($nv << 5) &0xE0;
291 } else {
292 0 carp "track_mode must be 0 (Off), 1 (ForceCorrelate), 2 (Scene), 3 (Target), 4 (Ship), 5 (IGDefined3), 6 (IGDefined2), or 7 (IGDefined1).";
293 }
294 }
295 2 return (($self->{'_bitfields1'} & 0xE0) >> 5);
296 }
297  
298 #==============================================================================
299  
300 =item sub track_white_black([$newValue])
301  
302 $value = $sensor_ctl->track_white_black($newValue);
303  
304 Track White/Black.
305  
306 This attribute specifies whether the sensor tracks white (0) or black (1).
307 This, along with the Polarity attribute, controls whether the sensor tracks hot
308 or cold spots.
309  
310 White 0
311 Black 1
312  
313 =cut
314  
315 2 ▶sub track_white_black() {
Subroutine track_white_black: called CC=4 SCAR=15.5
Pod documented
316 2 my ($self,$nv) = @_;
317 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
318 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
319 2 $self->{'trackWhiteBlack'} = $nv;
320 2 $self->{'_bitfields1'} |= ($nv << 4) &0x10;
321 } else {
322 0 carp "track_white_black must be 0 (White), or 1 (Black).";
323 }
324 }
325 2 return (($self->{'_bitfields1'} & 0x10) >> 4);
326 }
327  
328 #==============================================================================
329  
330 =item sub automatic_gain_enable([$newValue])
331  
332 $value = $sensor_ctl->automatic_gain_enable($newValue);
333  
334 Automatic Gain.
335  
336 This attribute specifies whether the sensor automatically adjusts the gain
337 value to optimize the brightness and contrast of the sensor display.
338  
339 Disable 0
340 Enable 1
341  
342 =cut
343  
344 2 ▶sub automatic_gain_enable() {
Subroutine automatic_gain_enable: called CC=4 SCAR=15.5
Pod documented
345 2 my ($self,$nv) = @_;
346 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
347 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
200
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
348 2 $self->{'automaticGainEnable'} = $nv;
349 2 $self->{'_bitfields1'} |= ($nv << 3) &0x08;
350 } else {
351 0 carp "automatic_gain_enable must be 0 (Disable), or 1 (Enable).";
352 }
353 }
354 2 return (($self->{'_bitfields1'} & 0x08) >> 3);
355 }
356  
357 #==============================================================================
358  
359 =item sub line_by_line_dropout_enable([$newValue])
360  
361 $value = $sensor_ctl->line_by_line_dropout_enable($newValue);
362  
363 Line-by-Line Dropout Enable.
364  
365 This attribute specifies whether line-by-line dropout is enabled.
366  
367 Disable 0
368 Enable 1
369  
370 =cut
371  
372 2 ▶sub line_by_line_dropout_enable() {
Subroutine line_by_line_dropout_enable: called CC=4 SCAR=15.5
Pod documented
373 2 my ($self,$nv) = @_;
374 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
375 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
376 2 $self->{'lineByLineDropoutEnable'} = $nv;
377 2 $self->{'_bitfields1'} |= ($nv << 2) &0x04;
378 } else {
379 0 carp "line_by_line_dropout_enable must be 0 (Disable), or 1 (Enable).";
380 }
381 }
382 2 return (($self->{'_bitfields1'} & 0x04) >> 2);
383 }
384  
385 #==============================================================================
386  
387 =item sub polarity([$newValue])
388  
389 $value = $sensor_ctl->polarity($newValue);
390  
391 Polarity.
392  
393 This attribute specifies whether the sensor shows white hot (0) or black hot (1).
394  
395 WhiteHot 0
396 BlackHot 1
397  
398 =cut
399  
400 2 ▶sub polarity() {
Subroutine polarity: called CC=4 SCAR=15.5
Pod documented
401 2 my ($self,$nv) = @_;
402 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
403 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
404 2 $self->{'polarity'} = $nv;
405 2 $self->{'_bitfields1'} |= ($nv << 1) &0x02;
406 } else {
407 0 carp "polarity must be 0 (WhiteHot), or 1 (BlackHot).";
408 }
409 }
410 2 return (($self->{'_bitfields1'} & 0x02) >> 1);
411 }
412  
413 #==============================================================================
414  
415 =item sub sensor_on_off([$newValue])
416  
417 $value = $sensor_ctl->sensor_on_off($newValue);
418  
419 Sensor On/Off.
420  
421 This attribute specifies whether the sensor is turned on or off.
422  
423 Off 0
424 On 1
425  
426 =cut
427  
428 2 ▶sub sensor_on_off() {
Subroutine sensor_on_off: called CC=4 SCAR=15.5
Pod documented
429 2 my ($self,$nv) = @_;
430 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
431 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
200
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
432 2 $self->{'sensorOnOff'} = $nv;
433 2 $self->{'_bitfields1'} |= $nv &0x01;
434 } else {
435 0 carp "sensor_on_off must be 0 (Off), or 1 (On).";
436 }
437 }
438 2 return ($self->{'_bitfields1'} & 0x01);
439 }
440  
441 #==============================================================================
442  
443 =item sub response_type([$newValue])
444  
445 $value = $sensor_ctl->response_type($newValue);
446  
447 Response Type.
448  
449 This attribute specifies whether the IG should return a Sensor Response packet
450 or a Sensor Extended Response packet.
451  
452 NormalSRT 0
453 ExtendedSRT 1
454  
455 =cut
456  
457 2 ▶sub response_type() {
Subroutine response_type: called CC=4 SCAR=15.5
Pod documented
458 2 my ($self,$nv) = @_;
459 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
460 2 ▶ if (($nv==0) or ($nv==1)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($nv == 0 or $nv == 1) { } 2 0 2
Condition33%1/3
$nv == 0 or $nv == 1
l!l&&r!l&&!r
200
MC/DC0%0/2
$nv == 0 or $nv == 1
$nv == 0 $nv == 1
Truth table33%1/3
A or B
A= $nv == 0B= $nv == 1
ABresult
1X1
011
000
461 2 $self->{'responseType'} = $nv;
462 2 $self->{'_bitfields2'} |= $nv &0x01;
463 } else {
464 0 carp "response_type must be 0 (NormalSRT), or 1 (ExtendedSRT).";
465 }
466 }
467 2 return ($self->{'_bitfields2'} & 0x01);
468 }
469  
470 #==============================================================================
471  
472 =item sub gain([$newValue])
473  
474 $value = $sensor_ctl->gain($newValue);
475  
476 Gain.
477  
478 This attribute specifies the contrast for the sensor display.
479  
480 =cut
481  
482 2 ▶sub gain() {
Subroutine gain: called CC=2 SCAR=7.0
Pod documented
483 2 my ($self,$nv) = @_;
484 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
485 2 $self->{'gain'} = $nv;
486 }
487 2 return $self->{'gain'};
488 }
489  
490 #==============================================================================
491  
492 =item sub level([$newValue])
493  
494 $value = $sensor_ctl->level($newValue);
495  
496 Level.
497  
498 This attribute specifies the brightness for the sensor display.
499  
500 =cut
501  
502 2 ▶sub level() {
Subroutine level: called CC=2 SCAR=7.0
Pod documented
503 2 my ($self,$nv) = @_;
504 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
505 2 $self->{'level'} = $nv;
506 }
507 2 return $self->{'level'};
508 }
509  
510 #==============================================================================
511  
512 =item sub ac_coupling([$newValue])
513  
514 $value = $sensor_ctl->ac_coupling($newValue);
515  
516 AC Coupling.
517  
518 This attribute specifies the AC coupling decay constant for the sensor display.
519  
520 =cut
521  
522 2 ▶sub ac_coupling() {
Subroutine ac_coupling: called CC=2 SCAR=7.0
Pod documented
523 2 my ($self,$nv) = @_;
524 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
525 2 $self->{'acCoupling'} = $nv;
526 }
527 2 return $self->{'acCoupling'};
528 }
529  
530 #==============================================================================
531  
532 =item sub noise([$newValue])
533  
534 $value = $sensor_ctl->noise($newValue);
535  
536 Noise.
537  
538 This attribute specifies the amount of detector noise for the sensor.
539  
540 =cut
541  
542 2 ▶sub noise() {
Subroutine noise: called CC=2 SCAR=7.0
Pod documented
543 2 my ($self,$nv) = @_;
544 2 ▶ if (defined($nv)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $nv) 2 0 2
545 2 $self->{'noise'} = $nv;
546 }
547 2 return $self->{'noise'};
548 }
549  
550 #==========================================================================
551  
552 =item sub pack()
553  
554 $value = $sensor_ctl->pack();
555  
556 Returns the packed data packet.
557  
558 =cut
559  
560 2 ▶sub pack($) {
Subroutine pack: called CC=1 SCAR=0.0
Pod documented
561 2 my $self = shift ;
562
563 $self->{'_Buffer'} = CORE::pack($self->{'_Pack'},
564 $self->{'packetType'},
565 $self->{'packetSize'},
566 $self->{'viewIdent'},
567 $self->{'sensorIdent'},
568 $self->{'_bitfields1'}, # Includes bitfields trackMode, TrackWhtBlk, automaticGainEnable, lineByLineDropoutEnable, polarity, and sensorOnOff.
569 $self->{'_bitfields2'}, # Includes bitfields unused30, and responseType.
570 $self->{'_unused31'},
571 $self->{'gain'},
572 $self->{'level'},
573 $self->{'acCoupling'},
574 2 $self->{'noise'},
575 );
576  
577 2 return $self->{'_Buffer'};
578 }
579  
580 #==========================================================================
581  
582 =item sub unpack()
583  
584 $value = $sensor_ctl->unpack();
585  
586 Unpacks the packed data packet.
587  
588 =cut
589  
590 0 ▶sub unpack($) {
Subroutine unpack: not called CC=2 SCAR=17.9
Pod documented
591 0 my $self = shift @_;
592
593 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
594 0 $self->{'_Buffer'} = shift @_;
595 }
596 0 my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k) = CORE::unpack($self->{'_Pack'},$self->{'_Buffer'});
597 0 $self->{'packetType'} = $a;
598 0 $self->{'packetSize'} = $b;
599 0 $self->{'viewIdent'} = $c;
600 0 $self->{'sensorIdent'} = $d;
601 0 $self->{'_bitfields1'} = $e; # Includes bitfields trackMode, TrackWhtBlk, automaticGainEnable, lineByLineDropoutEnable, polarity, and sensorOnOff.
602 0 $self->{'_bitfields2'} = $f; # Includes bitfields unused30, and responseType.
603 0 $self->{'_unused31'} = $g;
604 0 $self->{'gain'} = $h;
605 0 $self->{'level'} = $i;
606 0 $self->{'acCoupling'} = $j;
607 0 $self->{'noise'} = $k;
608  
609 0 $self->{'trackMode'} = $self->track_mode();
610 0 $self->{'trackWhiteBlack'} = $self->track_white_black();
611 0 $self->{'automaticGainEnable'} = $self->automatic_gain_enable();
612 0 $self->{'lineByLineDropoutEnable'} = $self->line_by_line_dropout_enable();
613 0 $self->{'polarity'} = $self->polarity();
614 0 $self->{'sensorOnOff'} = $self->sensor_on_off();
615 0 $self->{'responseType'} = $self->response_type();
616  
617 0 return $self->{'_Buffer'};
618 }
619  
620 #==========================================================================
621  
622 =item sub byte_swap()
623  
624 $obj_name->byte_swap();
625  
626 Byte swaps the packed data packet.
627  
628 =cut
629  
630 0 ▶sub byte_swap($) {
Subroutine byte_swap: not called CC=2 SCAR=17.9
Pod documented
631 0 my $self = shift @_;
632
633 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
634 0 $self->{'_Buffer'} = shift @_;
635 } else {
636 0 $self->pack();
637 }
638 0 my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k) = CORE::unpack($self->{'_Swap1'},$self->{'_Buffer'});
639  
640 0 $self->{'_Buffer'} = CORE::pack($self->{'_Swap2'},$a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k);
641 0 $self->unpack();
642  
643 0 return $self->{'_Buffer'};
644 }
645  
646 2 1;
647 __END__
« CIGIPP/EventNotification.pm ↑ Summary CIGIPP/AnimationStopNotification.pm »