Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow export of RAW DCS API to allow for DCS Features that are unsupported in DCS-BIOS #1018

Open
1 task done
kbastronomics opened this issue Dec 3, 2024 · 16 comments
Open
1 task done
Assignees
Labels
enhancement needs triage The issue has yet to be reviewed by a maintainer

Comments

@kbastronomics
Copy link

Version

  • I am using the latest version

Aircraft

F/A-18C ( this would apply to all though)

Control

RAW API control access

Description

Currently there are features in DCS that DCS-BIOS is not able to support. Such as Magnetically held switched in the F/A-18, F-16 i believe has same issue.

by allowing DCS-BIOS to send/receive RAW API messages and allowing the end user to handle on thier own this opens up DCS-BIOS so that thing like Magnetically Held swtich can work.

as a proof of this. in the F/A-18 module we know that DCS-BIOS does not process the needed functions as it only does the performClickableAction. while testing we found that the issue existed for the Arduino library making the request and the way DCS-BIOS processed it did not function as it should, and the switch would not release.

however, using DCS Insight we were able to show that DCS itself recognized the events and released the switch as it should

with this in mind allow DCS-BIOS to process the same messages as Insight does would resolve this issue but also open up new support withing DCS-BIOS for new features allowing user to implement them even if the core project chooses not to.

this could be a use are your own risk to avoid the DCS-BIOS team from having to support user written code and allowing only the community to support

Screenshots

No response

Additional context

No response

@kbastronomics kbastronomics added enhancement needs triage The issue has yet to be reviewed by a maintainer labels Dec 3, 2024
@charliefoxtwo
Copy link
Member

@kbastronomics could you detail some of the raw functions you'd like to use? If not performClickableAction, then what? There are a lot of functions exposed by dcs and I'd like to know which one(s) we should target.

@kbastronomics
Copy link
Author

What I was thinking was more generic
in Insight you can specify the control number and cotnrol it directly

like this for the APU switch on the F/A-18

elements["pnt_375"]		= default_button2(_("APU Control Switch, ON/OFF"),	devices.ENGINES_INTERFACE, engines_commands.APU_ControlSw,	375)
elements["pnt_375"].updatable	= true

so allowing us to send to 375 directly, bypass the clickable action.

Does that clarify what I'm thinking better?

@kbastronomics
Copy link
Author

As we know for the F/A-18 the performClickableAction does not work. I believe it was something to do with how the cockpit treats things as momentary but thr bios it's not (i probably have that all wrong, going from memory)

but when I used Insight, the APU behaved as it should and disengage after about 2 minutes once both engines spun up

so what I'm hoping for (in that particular example)
i still receive the DCS-BIOS message as expected but instead of calling the normal 2position switch which does not work
i can send the message direct to 375 like insight does

@charliefoxtwo
Copy link
Member

Could you perhaps show a screenshot of what you were doing in Insight? That constant is an argument to a function, and I just need to know which one.

@kbastronomics
Copy link
Author

lets see if video's attach, too big
link to discord messages

https://discord.com/channels/533342958712258572/535008796536340480/1156314850037870746

the last one is how it should work and does work in insight.
where we send the engine crank right (different mag switch but same thing happens on all them)
then send the command to return to off. swtich stays in place then turns off as it should once engine is at 65%

but I did notice in insight i seed the 3003 not the 377 (engine crank) from the clickabledata.lua file

doing that in insight works, bort nor thru arduino does work

@charliefoxtwo
Copy link
Member

So looks like this is the video you're referring to. That uses performClickableAction, which is exactly what the dcs-bios command does.

From watching this other video you posted using bort, that also shows that it does in fact work with dcs-bios in the same way (well, crank right doesn't work, but that would be a separate bug and I thought we fixed that, but maybe not)

Overall, I'm not following: what is working with insight that is not working with bort?

@kbastronomics
Copy link
Author

Would it do us any good to set up a voice chat so we can talk through what's going on?

@charliefoxtwo
Copy link
Member

I'd prefer to stick to text.

The issue (as I recall it) was that telling bios to set 1 and then set 0 in the same frame resulted in the 0 being ignored. But that's not bios dumping the message to my knowledge - that's dcs ignoring it. In fact, we even tried having bios set 0 and then set 1 on the click. We do this for many other controls and it works fine. For this control, it doesn't seem to. So you can do the same with a raw call to performClickableAction or whatever else, but I suspect you'll get the same result - dcs is going to dump the subsequent message sent in the same frame.

@kbastronomics
Copy link
Author

kbastronomics commented Dec 3, 2024 via email

@charliefoxtwo
Copy link
Member

Could you tell me which part of the bort video is not working as expected? Because when I watched the bort video I saw you click to set it to 0 (crank left), and then while it was cranking you clicked to set it to 1 (center position), and the switch remained in the left position until the magnet released at which point the switch returned to center. This is also exactly what you did (albeit for the right side) in the insight video.

Perhaps you could attach a video demonstrating exactly what isn't working using bort?

@kbastronomics
Copy link
Author

Not ingoring just going back and re-capturing data to be sure I'm reporting/asking correctly.

@kbastronomics
Copy link
Author

i hooked up a caution panel so we can see what is happening in the video's
first video is the Engine Crank switch using a normal momentary contact swtich. when done this way things work as they should
what you see in
RED is the physical switch
Grean is the state of the magnets and other signals from DCS/DCS-BIOS
Blue is just showing connected to DCS

https://cdn.discordapp.com/attachments/1046812440354103296/1314102421747798106/IMG_0738.mov?ex=6753de40&is=67528cc0&hm=71b9b3cb14de337b4de96338d0ae786ea69185dad323486bb7a328659cdef88b&

the next video is same momentary switch but held in position like the mag switch would do
what we see here is that it appears that the magnet is never released

however what I believe is happening is as you know the main loop() in Arduino is asynchronous, its called as fast as possible by the Arduino code itself

so DCS-BIOS sends the message to turn the magnet off but is immediate re-read by dcs-bios via the call in loop()
so DCS is told the crank switch is still engage and turn the magnet on.
this happens so fast that you cannot see that it gets turned off

https://cdn.discordapp.com/attachments/1046812440354103296/1314105650569150525/IMG_0740.mov?ex=6753e141&is=67528fc1&hm=e8066915c4338c6a62deaf7a6fdf986e100911990341065884ca935bfeab3f32&

so it would seem we need a method to stop checking the switch position when the magnet is on, but this has a side effect of you cannot manually change it now so there has to be a better way

thats why I was thinking of raw data but after a year I guess my memory was fuzzy

@charliefoxtwo
Copy link
Member

I'm currently traveling but will try to take a look at this in a few days

@charliefoxtwo
Copy link
Member

@kbastronomics those video links don't seem to work for me - clicking definitely doesn't work and copy/pasting the url into my browser says "This content is no longer available."

@kbastronomics
Copy link
Author

copy/paste the text of the links into the broswers, github seems to want to send you to github and these are discord links

BTW, i have the Engine Crank working (kindoff) we can not manually turn to off in the pit so something not in sync there
I created a new switch type and am playing with that.

the 2 pos switch so far I can not get to work

@kbastronomics
Copy link
Author

oh I see what you mean on the link
let me fix that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs triage The issue has yet to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants