Rinchi::CIGIPP::ComponentControl - Perl extension for the Common Image Generator Interface - Component Control data packet. data packet. =head1 SYNOPSIS
use Rinchi::CIGIPP::ComponentControl; my $cmp_ctl = Rinchi::CIGIPP::ComponentControl->new(); $packet_type = $cmp_ctl->packet_type(); $packet_size = $cmp_ctl->packet_size(); $component_ident = $cmp_ctl->component_ident(37562); $instance_ident = $cmp_ctl->instance_ident(26282); $component_class = $cmp_ctl->component_class(Rinchi::CIGIPP->EntityCC); $component_state = $cmp_ctl->component_state(245); $data1 = $cmp_ctl->data1(26); $data2 = $cmp_ctl->data2(383); $data3 = $cmp_ctl->data3(25589); $data4 = $cmp_ctl->data4(28613); $data5 = $cmp_ctl->data5(23541); $data6 = $cmp_ctl->data6(43464);
The Component Control packet is provided as a generic mechanism to control various components within the simulation. Because CIGI is designed to be a general-purpose interface, only the most common attributes of entities, views, and other objects are explicitly represented by attributes within specific data packets. Other attributes can be represented by components.
Components may correspond to parts or properties of entities, views and view groups, sensors, weather and environment, terrain, and even the IG itself. The type of object possessing the component is identified by the Component Class attribute. The specific instance of that object is specified by the Instance ID attribute. Depending upon the value of the Component Class attribute, the instance ID might correspond to an Entity ID, a view ID, an environmental attribute, etc. The Component ID attribute uniquely identifies the component for the instance.
Each component has zero or more discrete states, and/or up to six user-defined values. The user-defined values may either be integers or floating-point real numbers. A light, for instance, might have two discrete states (On and Off), an RGB color value represented as a 32-bit integer, and a real-value intensity level. A component representing the global lightpoint intensity value might have a real-value intensity level and no discrete states.
Regardless of how the six user-defined data fields are formatted, they will be byte-swapped as separate 32-bit values if the Host and IG use different byte ordering schemes. This ensures that all Component Control packets are byte-swapped in a consistent manner. The data should be packaged using masks and bit-wise operations so that the values are not changed when the 32-bit words are byte-swapped.
None by default.
#==============================================================================
Constructor for Rinchi::ComponentControl.
$value = $cmp_ctl->packet_type();
Data Packet Identifier.
This attribute identifies this data packet as the Component Control packet. The value of this attribute must be 4.
$value = $cmp_ctl->packet_size();
Data Packet Size.
This attribute indicates the number of bytes in this data packet. The value of this attribute must be 32.
$value = $cmp_ctl->component_ident($newValue);
Component Identifier.
This attribute uniquely identifies the component to which the data in this packet should be applied.
If Component Class is set to Regional Layered Weather (6), the weather layer ID is specified by the most significant byte of Component ID.
$value = $cmp_ctl->instance_ident($newValue);
Instance Identifier.
This attribute uniquely identifies the object to which the component belongs. This value corresponds to an entity ID, a view or view group ID, a sensor ID, environmental region ID, global weather layer ID, or event ID depending upon the value of the Component Class attribute.
$value = $cmp_ctl->component_class($newValue);
Component Class.
This attribute identifies the type of object to which the Instance ID attribute refers. Both of these attributes are used in conjunction with Component ID to uniquely identify a component in the simulation.
EntityCC 0 ViewCC 1 ViewGroupCC 2 SensorCC 3 RegionalSeaSurfaceCC 4 RegionalTerrainSurfaceCC 5 RegionalLayeredWeatherCC 6 GlobalSeaSurfaceCC 7 GlobalTerrainSurfaceCC 8 GlobalLayeredWeatherCC 9 AtmosphereCC 10 CelestialSphereCC 11 EventCC 12 SystemCC 13 SymbolSurfaceCC 14 SymbolCC 15
$value = $cmp_ctl->component_state($newValue);
Component State.
This attribute specifies a discrete state for the component. If a discrete state is not applicable to the component, this attribute is ignored.
$value = $cmp_ctl->data1($newValue);
Component Data 1.
This attribute represents one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
Note: This attribute will be byte-swapped as a 32-bit value if the receiver and sender use different byte ordering schemes. If the attribute is used to store multiple 8- or 16-bit values, the data should be packed so that byte swapping will be performed correctly. Use data1_short1 and data1_short2 for 16-bit values, or data1_byte1, data1_byte2, data1_byte3, and data1_byte4 for 8-bit values.
$value = $cmp_ctl->data1_float($newValue);
This attribute represents as a float one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
Note: This attribute will be byte-swapped as a 32-bit value if the receiver and sender use different byte ordering schemes. If the attribute is used to store multiple 8- or 16-bit values, the data should be packed so that byte swapping will be performed correctly.
$value = $cmp_ctl->data1_short1($newValue);
This attribute represents as a short the two most significant bytes of one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
$value = $cmp_ctl->data1_short2($newValue);
This attribute represents as a short the two least significant bytes of one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
$value = $cmp_ctl->data1_byte1($newValue);
This attribute represents the most significant byte of one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
$value = $cmp_ctl->data1_byte2($newValue);
This attribute represents the second most significant byte of one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
$value = $cmp_ctl->data1_byte3($newValue);
This attribute represents the second least significant byte of one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
$value = $cmp_ctl->data1_byte4($newValue);
This attribute represents the least significant byte of one of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
$value = $cmp_ctl->data1_and_2_double($newValue);
This attribute represents as a double two of six 32-bit words used for user-defined component data. If this attribute is not needed by the component, this value is ignored.
$value = $cmp_ctl->data2($newValue);
Component Data 2.
Note: This attribute will be byte-swapped as a 32-bit value if the receiver and sender use different byte ordering schemes. If the attribute is used to store multiple 8- or 16-bit values, the data should be packed so that byte swapping will be performed correctly. Use data2_short1 and data2_short2 for 16-bit values, or data2_byte1, data2_byte2, data2_byte3, and data2_byte4 for 8-bit values.
$value = $cmp_ctl->data2_float($newValue);
$value = $cmp_ctl->data2_short1($newValue);
$value = $cmp_ctl->data2_short2($newValue);
$value = $cmp_ctl->data2_byte1($newValue);
$value = $cmp_ctl->data2_byte2($newValue);
$value = $cmp_ctl->data2_byte3($newValue);
$value = $cmp_ctl->data2_byte4($newValue);
$value = $cmp_ctl->data3($newValue);
Component Data 3.
Note: This attribute will be byte-swapped as a 32-bit value if the receiver and sender use different byte ordering schemes. If the attribute is used to store multiple 8- or 16-bit values, the data should be packed so that byte swapping will be performed correctly. Use data3_short1 and data3_short2 for 16-bit values, or data3_byte1, data3_byte2, data3_byte3, and data3_byte4 for 8-bit values.
$value = $cmp_ctl->data3_float($newValue);
$value = $cmp_ctl->data3_short1($newValue);
$value = $cmp_ctl->data3_short2($newValue);
$value = $cmp_ctl->data3_byte1($newValue);
$value = $cmp_ctl->data3_byte2($newValue);
$value = $cmp_ctl->data3_byte3($newValue);
$value = $cmp_ctl->data3_byte4($newValue);
$value = $cmp_ctl->data3_and_4_double($newValue);
Component Data 3 and 4.
$value = $cmp_ctl->data4($newValue);
Component Data 4.
Note: This attribute will be byte-swapped as a 32-bit value if the receiver and sender use different byte ordering schemes. If the attribute is used to store multiple 8- or 16-bit values, the data should be packed so that byte swapping will be performed correctly. Use data4_short1 and data4_short2 for 16-bit values, or data4_byte1, data4_byte2, data4_byte3, and data4_byte4 for 8-bit values.
$value = $cmp_ctl->data4_short1($newValue);
$value = $cmp_ctl->data4_short2($newValue);
$value = $cmp_ctl->data4_byte1($newValue);
$value = $cmp_ctl->data4_byte2($newValue);
$value = $cmp_ctl->data4_byte3($newValue);
$value = $cmp_ctl->data4_byte4($newValue);
$value = $cmp_ctl->data5($newValue);
Component Data 5.
Note: This attribute will be byte-swapped as a 32-bit value if the receiver and sender use different byte ordering schemes. If the attribute is used to store multiple 8- or 16-bit values, the data should be packed so that byte swapping will be performed correctly. Use data5_short1 and data5_short2 for 16-bit values, or data5_byte1, data5_byte2, data5_byte3, and data5_byte4 for 8-bit values.
$value = $cmp_ctl->data5_short1($newValue);
$value = $cmp_ctl->data5_short2($newValue);
$value = $cmp_ctl->data5_byte1($newValue);
$value = $cmp_ctl->data5_byte2($newValue);
$value = $cmp_ctl->data5_byte3($newValue);
$value = $cmp_ctl->data5_byte4($newValue);
$value = $cmp_ctl->data5_and_6_double($newValue);
Component Data 5 and 6.
$value = $cmp_ctl->data6($newValue);
Component Data 6.
Note: This attribute will be byte-swapped as a 32-bit value if the receiver and sender use different byte ordering schemes. If the attribute is used to store multiple 8- or 16-bit values, the data should be packed so that byte swapping will be performed correctly. Use data6_short1 and data6_short2 for 16-bit values, or data6_byte1, data6_byte2, data6_byte3, and data6_byte4 for 8-bit values.
$value = $cmp_ctl->data6_short1($newValue);
$value = $cmp_ctl->data6_short2($newValue);
$value = $cmp_ctl->data6_byte1($newValue);
$value = $cmp_ctl->data6_byte2($newValue);
$value = $cmp_ctl->data6_byte3($newValue);
$value = $cmp_ctl->data6_byte4($newValue);
$value = $cmp_ctl->pack();
Returns the packed data packet.
$value = $cmp_ctl->unpack();
Unpacks the packed data packet.
$obj_name->byte_swap();
Byte swaps the packed data packet.
Refer the the Common Image Generator Interface ICD which may be had at this URL: http://cigi.sourceforge.net/specification.php
Brian M. Ames, <bmames@apk.net>
Copyright (C) 2009 by Brian M. Ames
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Rinchi::CIGIPP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rinchi::CIGIPP
CPAN shell
perl -MCPAN -e shell install Rinchi::CIGIPP
For more information on module installation, please visit the detailed CPAN module installation guide.