![]() MyRead(writeRefCon, values, offset, count) -> int MyWrite(writeRefCon, values, offset, count) MyRead(readRefCon, values, offset, count) -> int To do is pass by keyword parameter the ones you need. All callbacks by default are None, so the easiest thing Support, pass a read accessor function and a write accessor function if Read callbacks, and the other to all write callbacks. You can optionally provide two reference constants, one to be passed to (all) Of any write* accessor callbacks you provide. Not provided in the call) we’ll calculate the value based on the existence It defaults to -1 / not-set, and with that value (or The writable parameter provides the value forĬanWriteDataRef(). (e.g., if you only provide a readInt callback, we’ll set dataType to xp.Type_Int.) We’ll calculate the value based on the set of accessor callback you provide If not provided (or set to 0 / Type_Unknown), This will be readable by getDataRefTypes(). The dataType is constructed by bitwise OR’ing together the types you support, e.g., It with the name of you plugin or a domain name you own. The name needs to be unique and will be available to others. This routine creates a new item of data that can be read and written. Registration ¶ registerDataAccessor ( name, dataType=0, writable=-1. I’ve never found the “registry”: Pick a prefix to match your company / domainname + plugin name.) Prevent dataRef collisions between plugins. Registry where authors can select a unique first word for dataRef names, to Important: you must pick a prefix for your datarefs other than sim/. One callback to return the value when a plugin ‘reads’ it and another toĬhange the value when a plugin ‘writes’ it. Plug-in requests your data (e.g., with getDatai()), You share data by registering data provider callback functions using registerDataAccessor(). That your data reference will not be available to other plugins if/when Plugins operate the same as ones published by X-Plane in all manners except These functions allow you to create data references that other plug-ins canĪccess via the above data access APIs. Underlying data access system can be rebuilt.Ĭallbacks: Publishing Your Plugin’s Data ¶ This allows data access to be high performance, while leaving inĪbstraction since data references are opaque and are searched for, the Two function calls through function pointers). ReadingĪnd writing data references is relatively fast (the cost is equivalent to Your data references once based on verbose strings, and save the opaqueĭata reference value for the duration of your plugin’s operation. The task of looking up a data reference is relatively expensive look up Simulator is run (or the plugin that provides the data reference is Reference is implementation defined and is likely to change each time the To get a data reference, youĭata references are identified by verbose string names Read the data quickly and possibly write it. A data reference is a source ofĭata you do not know where it comes from, but once you have it you can The API works using opaque data references. The data access APIs are the way that you read and write data from the sim This API allows you to read and set the navigation radios, get the plane location,ĭetermine the current effective graphics frame rate, etc. Read and write data to and from X-Plane and other plug-ins. The data access API gives you a generic, flexible, high performance way to ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |