Changeset 36:29e3b676c0c2 in xplra for src/client
- Timestamp:
- 02/10/13 08:21:47 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/client
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/client/c/hu/varadiistvan/xplra/XPlane.cc
r30 r36 193 193 //------------------------------------------------------------------------------ 194 194 195 void XPlane::getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion) 196 throw(Exception) 197 { 198 stream->writeU8(Protocol::COMMAND_GET_VERSIONS); 199 stream->flush(); 200 checkResult(); 201 202 xplaneVersion = stream->readS32(); 203 xplmVersion = stream->readS32(); 204 xplraVersion = stream->readS32(); 205 206 checkStream(); 207 } 208 209 //------------------------------------------------------------------------------ 210 195 211 void XPlane::getScalar(const char* name, uint8_t type) throw(Exception) 196 212 { -
src/client/c/hu/varadiistvan/xplra/XPlane.h
r30 r36 145 145 146 146 /** 147 * Get the versions of X-Plane, XPLM and the XPLRA plugin. 148 */ 149 void getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion) throw(Exception); 150 151 /** 147 152 * Get the integer value of the dataref with the given name. 148 153 */ -
src/client/c/hu/varadiistvan/xplra/xplra.cc
r29 r36 498 498 //------------------------------------------------------------------------------ 499 499 500 extern "C"int xplra_get_versions(int connectionID, 501 int* xplaneVersion, int* xplmVersion, 502 int* xplraVersion) 503 { 504 Connection* connection = ConnectionSlot::getValue(connectionID); 505 if (connection==0) return -1; 506 try { 507 connection->getVersions(*xplaneVersion, *xplmVersion, *xplraVersion); 508 return 0; 509 } catch (...) { 510 connection->handleException(); 511 return -1; 512 } 513 } 514 515 //------------------------------------------------------------------------------ 516 500 517 extern "C" int xplra_get_int(int* value, int connectionID, const char* name) 501 518 { -
src/client/c/hu/varadiistvan/xplra/xplra.h
r29 r36 130 130 131 131 /*----------------------------------------------------------------------------*/ 132 133 /** 134 * Get the versions of X-Plane, the XPLM library and XPLRA 135 */ 136 int xplra_get_versions(int connectionID, 137 int* xplaneVersion, int* xplmVersion, 138 int* xplraVersion); 139 140 /*----------------------------------------------------------------------------*/ 132 141 /* Single dataref support */ 133 142 /*----------------------------------------------------------------------------*/ -
src/client/python/xplra.py
r35 r36 27 27 28 28 COMMAND_EXECUTE_SET_MULTI = 0x23 29 30 COMMAND_GET_VERSIONS = 0x31 29 31 30 32 TYPE_INT = 0x01 … … 135 137 """Create a new multi-dataref setter for this X-Plane object.""" 136 138 return MultiSetter(self) 139 140 def getVersions(self): 141 """Get the versions of X-Plane, XPLM and XPLRA as a tuple.""" 142 self._writeU8(COMMAND_GET_VERSIONS) 143 self._flush() 144 self._checkResult() 145 return (self._readS32(), self._readS32(), self._readS32()) 137 146 138 147 def getInt(self, name): … … 392 401 393 402 self._registeredID = None 403 404 @property 405 def values(self): 406 """Query the values as a list.""" 407 if self._values is None: 408 self.finalize() 409 return self._values 394 410 395 411 def addInt(self, name):
Note:
See TracChangeset
for help on using the changeset viewer.