IG.CIGI.Connector Class
This class implements the connection between the IG Plugin and the CIGI protocol.
IG plugin must be loaded.
IG::CIGI::Connector Class
Перечисления (Enums)
CIGI_MODE#
Properties
bool IsInitialized#
The value indicating if the CIGI Connector was initialized successfully.
int IGStatus#
The current IG status. The following values are supported:
- 0 - normal
- 1-255 - an error has occurred
bool Synchronous#
The value indicating if synchronous operation mode is currently enabled (when disabled, asynchronous mode is used).
bool IsInterpolation#
The value indicating if interpolation and extrapolation are enabled.
CIGI.CIGI_MODE IGMode#
The current IG mode.
uint IGFrame#
The number of the current frame for the IG.
uint HostFrame#
The number of the current frame for the Host.
double Time#
The IG's simulation time.
double LastReceivedHostTime#
The last received Host time (timestamp value in "IG Control").
Members
int Init ( int version, string host, int send, int recv, int size = 1432 ) #
Initializes the CIGI Connector using the given parameters.Arguments
- int version - CIGI protocol version. One of the CIGI_VERSION_* values.
- string host - CIGI Host address.
- int send - TCP port number to be used for sending packets to the CIGI Host.
- int recv - TCP port number to be used for receiving packets from the CIGI Host.
- int size - Packet size. The default value is 1432.
Return value
1 if the CIGI Connector was initialized successfully; otherwise, 0.int Shutdown ( ) #
Returns a value indicating if the CIGI Connector was shutdown successfully.Return value
true if the CIGI Connector was shutdown successfully; otherwise, false.IntPtr AddOnConnectCallback ( OnConnectDelegate func ) #
Adds a callback function to be fired when the Host has connected.Arguments
- OnConnectDelegate func - Callback function with the following signature: void OnConnectDelegate(void)
Return value
ID of the last added connect callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.bool RemoveOnConnectCallback ( IntPtr id ) #
Removes the specified callback from the list of Connect callbacks.Arguments
- IntPtr id - Connect callback ID obtained when adding it.
Return value
True if the Connect callback with the given ID was removed successfully; otherwise false.IntPtr AddOnReceivePacketCallback ( int cigi_opcode, OnReceivePacketDelegate func ) #
Sets a callback function to be fired when a packet of the specified type has been received from the Host.Arguments
- int cigi_opcode - CIGI data packet opcode. One of the CIGI_OPCODE_* values.
- OnReceivePacketDelegate func - Callback function with the following signature: void OnReceivePacketDelegate(CigiHostPacket)
Return value
ID of the last added Receive Packet callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.bool RemoveOnReceivePacketCallback ( IntPtr id ) #
Removes the specified callback from the list of Receive Packet callbacks.Arguments
- IntPtr id - Receive Packet callback ID obtained when adding it.
Return value
true if the Receive Packet callback with the given ID was removed successfully; otherwise false.int GetNumHostPackets ( ) #
Returns the total number of packets received from the Host.Return value
Total number of packets received from the Host.CigiIGPacket GetHostPacket ( int num ) #
Returns the specified CIGI Host packet.Arguments
- int num - ID of the Host packet.
Return value
CIGI Host packet.CigiIGPacket CreateIGPacket ( int ig_opcode ) #
Creates IG Packet to be sent to the Host.Arguments
- int ig_opcode - IG opcode, one of CIGI_OPCODE_* values.
Return value
IG Packet to be sent to the Host.void AddIGPacket ( CigiIGPacket packet ) #
Sends the specified IG packet to the Host.Arguments
- CigiIGPacket packet - IG Packet to be sent to the Host.
void SetProcessPacket ( int op_code, bool enabled ) #
Sets a value indicating if the specified IG packets received are to be processed or skipped.Arguments
- int op_code - IG opcode, one of CIGI_OPCODE_* values.
- bool enabled - true to process packets of the specified type, false to skip them.
void ShowDebug ( ) #
Displays the debug information.Last update:
13.12.2024
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter