Example #1
0
 /**
  * Request SimObject data from a class. The class must be registered before using this method (see
  * {@link #registerClass(Class)}). See {@link SimConnect#requestDataOnSimObject(Enum, Enum, int,
  * SimConnectPeriod)} for more informations on this simconnect request.
  *
  * @param cl class to use. must be registered
  * @param objectId object ID, or {@link SimConnectConstants#OBJECT_ID_USER} for user aircraft
  * @param requestId forced request id
  * @param period period, see {@link SimConnectPeriod}
  * @param onlyWhenChanged set to true if you want to receive data only if it was changed
  * @return ID of request (here <code>requestId</code>)
  * @throws IOException simconnect error
  * @throws IllegalDataDefinition if this class was not registered
  * @since 0.7
  */
 public int requestSimObjectData(
     Class<?> cl, Enum requestId, int objectId, SimConnectPeriod period, boolean onlyWhenChanged)
     throws IOException, IllegalDataDefinition {
   return requestSimObjectData(cl, requestId.ordinal(), objectId, period, onlyWhenChanged);
 }
Example #2
0
 /**
  * Register a class prior to use. This is mandatory before calling {@link
  * #requestSimObjectData(Class, int, SimConnectPeriod, boolean)} or {@link
  * #unwrap(RecvSimObjectData)} or {@link #setSimObjectData(Object, int)}
  *
  * @param c class to use
  * @param dataDefID force data definition ID
  * @return data definition ID (here <code>dataDefID</code>)
  * @throws IllegalDataDefinition if the class <code>c</code> contains invalid or non-mappable
  *     fields
  * @throws IOException SimConnect IO Errors
  * @since 0.7
  */
 public int registerClass(Enum dataDefID, Class<?> c) throws IOException, IllegalDataDefinition {
   return registerClass(dataDefID.ordinal(), c);
 }