Changeset 36:29e3b676c0c2 in xplra for src/client/python


Ignore:
Timestamp:
02/10/13 08:21:47 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added a new command to query the versions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/client/python/xplra.py

    r35 r36  
    2727
    2828COMMAND_EXECUTE_SET_MULTI = 0x23
     29
     30COMMAND_GET_VERSIONS = 0x31
    2931
    3032TYPE_INT = 0x01
     
    135137        """Create a new multi-dataref setter for this X-Plane object."""
    136138        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())
    137146
    138147    def getInt(self, name):
     
    392401
    393402        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
    394410
    395411    def addInt(self, name):
Note: See TracChangeset for help on using the changeset viewer.