I think the confusion has come about because dataref tool now has a press button where as in previous versions it had the separate BEGIN, ONCE & END buttons for each command. All the press does is send the BEGIN, ONCE, END sequence. Jacques posted the detail earlier in this thread. If you want to simulate a PRESS you just do the sequence. If PRESS were implemented in AM then it would be a simpler way of achieving the same. A useful addition i think.
Tony
xpl_command "ONCE" & "PRESS"?
Re: xpl_command "ONCE" & "PRESS"?
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: xpl_command "ONCE" & "PRESS"?
Hi,
You are right, it is the dataref tool causing the confusion. X-plane has no notion of a press command.
It is also very weird to me that this would be helpfull. Isn't a simple ONCE command sufficient when you have a button?
Corjan
You are right, it is the dataref tool causing the confusion. X-plane has no notion of a press command.
It is also very weird to me that this would be helpfull. Isn't a simple ONCE command sufficient when you have a button?
Corjan
Re: xpl_command "ONCE" & "PRESS"?
Hi,
Too get rid of all the confusion, I had a look at the dataref tool code to see what it does exactly:
So internally also uses BEGIN, ONCE and END commands. Same stuff already supported by X-plane and AM.
Corjan
Too get rid of all the confusion, I had a look at the dataref tool code to see what it does exactly:
Code: Select all
std::shared_ptr<Widget11Button> once_button = std::make_shared<Widget11Button>();
once_button->setLabel("Command once");
once_button->setAction([crr]() {
crr->commandOnce();
});
std::shared_ptr<Widget11Button> press_button = std::make_shared<Widget11Button>();
press_button->setLabel("Command press");
press_button->setPushAction([crr](bool is_down) {
if(is_down) {
crr->commandBegin();
} else {
crr->commandEnd();
}
});
So internally also uses BEGIN, ONCE and END commands. Same stuff already supported by X-plane and AM.
Corjan
Re: xpl_command "ONCE" & "PRESS"?
@CorjanSo internally also uses BEGIN, ONCE and END commands. Same stuff already supported by X-plane and AM.
Well actually not at the moment, the ONCE command is not implemented in AM as a parameter, only BEGIN and END are available from what I tested and also the Wiki says.
The standard AM command without any parameter sends a BEGIN ONCE END sequence which is interpreted by XPlane as a single button push.
To achieve the equivalent of press, I found out that AT LEAST two ONCE commands with some time in between need to be issued in sequence between the BEGIN and the END for the command to be interpreted as a Press by XPlane.
Some addon only react to button press command (understand maintained), hence my initial demand.
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
Re: xpl_command "ONCE" & "PRESS"?
Hi,
It might be that the aircraft model requires a special combo and timing.
But normally a ‘press’ is just an ONCE command.
In AM, if you do a ‘xpl_command’ without any additional arguments, an ONCE command call will be issued. So ONCE is also supported.
Corjan
It might be that the aircraft model requires a special combo and timing.
But normally a ‘press’ is just an ONCE command.
In AM, if you do a ‘xpl_command’ without any additional arguments, an ONCE command call will be issued. So ONCE is also supported.
Corjan
Re: xpl_command "ONCE" & "PRESS"?
The dataref tool maps the BEGIN when you start pressing the GUI button, and an END when you release it. This naturally creates some delay, based on how long you hold down the mouse button. The aircraft model might like that, and process it the way you expect.
Corjan
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: xpl_command "ONCE" & "PRESS"?
Hi,
From my side, what we now have is as expected, and a clearly explained in the API.
Thumbs up from me.
Keith
From my side, what we now have is as expected, and a clearly explained in the API.
Thumbs up from me.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card