vranki / ExtPlane

Plugin for X-Plane flight simulator which allows reading and writing simulation properties
138 stars 44 forks source link

Custom datarefs #14

Open Crashtender opened 7 years ago

Crashtender commented 7 years ago

It would be very handy to be able to create custom datarefs on the client side.

sfo commented 7 years ago

I can't see how this is intended to work. A dataref is translated into a function call. The function's implementation has to be located in X-Plane or a plugin. This is why it is only possible to subscribe to predefined datarefs. For a dataref created on client side (e.g. "ref/foo/bar"), X-Plane is not able to resolve a function because there is no implementation available for this one.

markcellis commented 7 years ago

@Crashtender , can you provide some detail on what you are trying to accomplish with this? There might be some alternatives

Crashtender commented 7 years ago

I'm working on a concept to build WYSIWYG gauges (currently an EFD1000) that have their own logic (menu's, multi function buttons and dials). It would be handy to define a custom dataref that can be called from e.g. ArdsimX (providing more input possibilities than a raspberry pi can provide out of the box) to operate those buttons and dials.

The gauge could simply subscribe to those custom datarefs and trigger the attached logic

markcellis commented 7 years ago

So I think this would be possible given my knowledge of the X-Plane plugin SDK. It is entirely possible for a plugin to create its own datarefs on the fly and make those datarefs available to other plugins. Conceptually you would add commands to ExtPlane that a client could use that told the ExtPlane plugin the name, type, and access privilege for the custom dataref. There would need to be a reasonable naming convention for the datarefs, something like ExtPlane/client/xxxxx where the client name would need to unique to prevent multiple clients from creating the same dataref name. I have used this concept with the X-Camera plugin to get integrations to HeadShake and LinuxTrack. I would think it would work here too.

http://www.xsquawkbox.net/xpsdk/mediawiki/DataAccess

http://www.xsquawkbox.net/xpsdk/mediawiki/Category:XPLMDataAccess

Alternatively you could create a C++ plugin separate from ExtPlane that would define these “integration datarefs” which I would think you could then access via ExtPlane. Of course this solution would be unique to your specific project and could not be leveraged on a wider scale.

I’m still learning the ExtPlane code as I extend the PFD in ExtPlane-Panel so I might be completely wrong in my assumptions here.

Mark

https://www.stickandrudderstudios.com/ StickandRudderStudios.com

From: Crashtender [mailto:notifications@github.com] Sent: Wednesday, March 29, 2017 3:54 PM To: vranki/ExtPlane Cc: Mark Ellis; Comment Subject: Re: [vranki/ExtPlane] Custom datarefs (#14)

I'm working on a concept to build WYSIWYG gauges (currently an EFD1000) that have their own logic (menu's, multi function buttons and dials). It would be handy to define a custom dataref that can be called from e.g. ArdsimX (providing more input possibilities than a raspberry pi can provide out of the box) to operate those buttons and dials.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vranki/ExtPlane/issues/14#issuecomment-290206001 , or mute the thread https://github.com/notifications/unsubscribe-auth/AYvMKpHM5VnwkokkVo8z9jWUY1dRNeRYks5rqrbfgaJpZM4Mr-p5 . https://github.com/notifications/beacon/AYvMKolJHMMVe-WC4vkuUfTigaO2njxtks5rqrbfgaJpZM4Mr-p5.gif

vranki commented 6 years ago

This sounds something we could implement. Just ability to create datarefs so that they can be used to share data between plugins.

Clamb94 commented 5 years ago

+1