ExtPlane icon indicating copy to clipboard operation
ExtPlane copied to clipboard

Custom datarefs

Open Crashtender opened this issue 8 years ago • 6 comments

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

Crashtender avatar Mar 28 '17 17:03 Crashtender

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.

sfo avatar Mar 29 '17 07:03 sfo

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

markcellis avatar Mar 29 '17 18:03 markcellis

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

Crashtender avatar Mar 29 '17 19:03 Crashtender

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:[email protected]] 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

markcellis avatar Mar 29 '17 20:03 markcellis

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

vranki avatar Dec 20 '17 12:12 vranki

+1

Clamb94 avatar Sep 27 '18 13:09 Clamb94