Skip to main content
Skip table of contents

novaHost - aeRosetta

Nova Host uses a library called aeRosetta to translate pC-Nova ICD fields into CIGI packets.

It essentially performs the opposite job as the hostIcdCigi*.dll on the IG which translates CIGI messages to the pC-Nova ICD for the IG to use.

Overview

Prior to CIGI, hosts wrote directly to the pC-Nova ICD via shared memory or a proprietary UDP interface.

With the adoption of CIGI, Aechelon developed the aeRosetta library to aid host side developers transition from these proprietary interfaces to CIGI.

aeRosetta takes a pointer to an instance of the pC-Nova ICD and evaluates every field to see if they've changed.  If so, it translates them to the needed CIGI packets to update the IG.

Source Code Location

src/aeRosetta

This folder contains all the source code for the aeRosetta library. Users can reference this code while developing their pC-Nova CIGI host applications or build the library and use it directly if they wish.

Note that aeRosetta also has the following dependencies:

src/ccl

The CIGI Class Library (CCL) is an opensource C++ library for implementing both host and IG CIGI applications and is a dependency of aeRosetta.

More information on CLL can be found here: https://cigi.sourceforge.io/product_ccl.php

src/aeIntrospectionProvider

Aechelon has proposed and implemented an extension to the CIGI standard called “Intropsection”. This allows hosts to query the IG at runtime for information such as loaded model types, articulations, and light groups and for information on how to control then via CIGI Component and Articulation control packets.

src/common

The common library contains some token parsing and utility functions along CCL compatible definitions of Aechelon’s user defined packets.

src/commonDefs

This library contains a single file with enumeration information pertaining to Aechelon’s CIGI interface. It is shared between aeRosetta and the IG’s hostIcdCigi*.dll code to ensure interoperability.

Because the header file is shared with runtime code it is peppered with ODL syntax. Users should ignore this as the file will still compile without any additional requirements.

Note that this project is included to mirror Aechelon’s build environment. The header file is referenced by other projects but the project does not build a library.

src/icd

Similar to commonDefs, the icd project contains Aechelon’s ICD header files but the project does not build a library.

Building

With build/novaHost.sln open in Microsoft Visual Studio 2019, the following projects should be built in order to use aeRosetta in your application: aeRosetta, ccl, aeIntrospectionProvider, and common.

This will result in the following libraries being created (assuming a Release build):

CODE
build/x64/Release/aeIntrospectionProvider.lib
build/x64/Release/aeRosetta.lib
build/x64/Release/ccl.lib
build/x64/Release/common.lib

Linking and Using aeRosetta

With aeRosetta and it’s dependencies built, users can add it to their host application to rapidly integrate pC-Nova through CIGI.

The process is as follows:

  1. Add the aforementioned built libraries (aeRosetta, ccl, aeIntrospectionProvider, and common) so they are linked in your project.

  2. Add the required header files for these libraries to your project.

  3. Create pC-Nova ICD variables in your code for the aeHost2Pcnova and aePcnova2Host data structures which will contain the data to translate to CIGI packets for sending to the IG and the data to house CIGI data returned from the IG respectively.

  4. Create an ae::rosetta variable in your code to handle the translation.

The following pseudo code provides the outline for an example host that’s capable of driving every pC-Nova feature through CIGI using aeRosetta.

CODE
aeHost2Pcnova   host2pcnova;
aePcnova2Host   pcnova2host;
ae::rosetta     rosetta;
MyUdpClass      udp;
char*           sendBuff = new char[50000];
char*           recvBuff = new char[50000];

void main()
{
  // receive IG CIGI response
  const int recvBytes = udp.recv( recvBuff, 50000 );
  if( recvBytes > 0 )
  {
    // translate the CIGI packets to aePcnova2Host
    rosetta.translate_incoming( &pcnova2host, recvBuff, recvBytes );
    
    // read ownship/landing gear HOTs, collisions, etc from pcnova2host
  }
  
  // update frame data
  host2pcnova.h2ig.cnt.exe_nframe++;
  
  // update ownship
  host2pcnova.h2ig.dat.ownship.pos[0] = airframeLat;
  host2pcnova.h2ig.dat.ownship.pos[1] = airframeLon;
  host2pcnova.h2ig.dat.ownship.pos[2] = airframeAlt;
  
  // update time
  host2pcnova.ios2ig.dat.tofday.hours = iosHours;
  
  // update weather, targets, HOT requests, ...
  
  // translate the host data to CIGI packets
  const int sendBytes = rosetta.translate_outgoing( &host2pcnova, sendBuff, 50000 );
  
  // send the CIGI message to the IG
  udp.send( sendBuff, sendBytes );
  
  Sleep( 16 );
}

Nova Host Usage

Looking at Nova Host Plugin code you'll notice that there are few CIGI related calls.  Most plugins only read and write to the pC-Nova ICD.

Nova Host creates its own instance of the pC-Nova ICD and passes a pointer to the host2pcnova ICD for plugins to send data to the IG and pcnova2host for them to read returns.

At the top of each frame Nova Host receives any IG messages and translates the return data using its aeRosetta instance. It then ticks that plugins for updates to the host2pcnova ICD and again calls aeRosetta to buffer any required CIGI messages to send to the IG.

Tokens

Nova Host initializes aeRosetta using the token/value pairs in the aeRosettaCfg INI file setting.

Please see src/aeRosetta/rosettacfg.h for a full listing of tokens and their description.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.