Jump to content

Touch Portal App


Recommended Posts

On 3/17/2021 at 7:02 PM, Rider81 said:

Hi all, 

 

It is possible to create a button whose event changes the icon with respect to a light signal of an airplane (Example: landing gear down, Master Warning). I know how to get the code through DCS-BIOS. But not how to put it in Touch Portal. Could someone give me a help?

 

Thanks in advance

 

You need to create a plugin for touch portal.

With the plugin you can read and process the stream of data from DCS-BIOS or DCSExporter, and associate to a the value of each parameter exported to the value of a state. To read it basically you need to read a TCP/UDP port from data server, basically the loopback IP, unless you have the data server in another PC.

 

The you just need to send the key stroke with TP to DCS and the change of the value in DCS will trigger the change of the state in TP.

Cheking the value of the state, you can set the appropiate icon to the correct button, or change a text dinamically with the data readed.

 

I was developing a plugin in C# using a C# SDK, but the job, Cristmas holdays and the moving to a new house render all of my time to continue.

 

I was using DCSExporter to extract the info from DCS. The pros are that the stram of data is very straight forward, paramId:paramValue. Cons, paramValue is a percentage, or the int value of an Enum, and you must to process the values before to send to TP.

 

In the other hand DCS-BIOS have a more complex or more structurated stream of data and you must to process the raw information to know how many parameters are in the package received. Pros the paramValue is processed and have the same information you see in the cockpit or at least is much more user friendly than the information you can read from DCSExporter.

 

I would like to use DCS-BIOS but I can't really undesrtand the way the information is packed, when I thought I have the key I found another package which break my rule...

If you have that key I would like to know pleaseeeeeeee 😅

 

To create the plugin it's need to do some tedious work and is that you mut to create in a JSON file (or seneral files, as you wish), the hole set of states and the posible valueas of each one.

I found the way to do it more easly with an Excel spreadsheet, and using the functions to search in matrix and concatenating text string.

The result was a set of rows which you could copy and paste in noteapd++ and you had the final JSON file.

 

The state of the development was very early because I was learning to use the SDk, which was abandned by the guy who was developing it and also understaing the way TP works and readind the docs for the plugins development.

 

It's not difficult but some times the things were not working as I spected.   

  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

Rider81 asked about TP getting updates from DCS, and I thought about sharing my work if there's sufficient interests.

 

I had been working on a TP plugin feeding on data from Helios export script (found it easier to use than DCS BIOS) for the Hornet and was successful in getting instant updates on switch positions (eg. Flaps, Master Arm, A/A, A/G, LDG/Taxi Lights, and etc.),  alarms/indicators (Master Caution, Battery SW, and etc.) and detecting when the aircraft is online. These are visible to TP as events where buttons can be setup to react to.

 

However at the moment, I have yet to look into why it had caused CaptZeen's profiles to stop working on start-up. I want to use it together with TP as there are a few switches that I need to reach at directly without an intermediate step of having to open/close a panel or having to turn/aim my head too much.

  • Thanks 2
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Bonjour, pouvez vous me dire où je pourrais trouver le plugin pour l’essayer car j’ai déjà fait mes pages pour plusieurs avions (que je peux vous partager si vous le souhaitez aussi, mirage2000, f18 pour de bon complets, et qui fonctionnent parfaitement) mais maintenant j’aimerais savoir comment fonctionne le plugin pour qu’il puisse récupérer les informations directement de DCS. Merci d’avance.

Link to comment
Share on other sites

From Google Translate (for the benefit of others and myself who do not read French), here's what Machiavel posted above:

"Hello, can you tell me where I could find the plugin to try it out because I have already made my pages for several planes (which I can share with you if you wish too, mirage2000, f18 for good, and which work perfectly) but now I would like to know how the plugin works so that it can retrieve the information directly from DCS. Thanks in advance."

 

Hi Machiavel,

Hope you can understand my reply here. I will be glad to share it with you and anyone who's interested.

The TP plugin that I have put together is based on DCS-BIOS (which supports a long list of official and non-official DCS aircraft modules) and uses a library (dcs-bios-api-master) developed by Ranma-3 (hope I got his DCS forum sign-in name correct).

I have also created an installer with option to install my collection of DCS-BIOS files if needed. However, I have yet to find a place to host the files since I wasn't sure whether anyone else was interested in the "poor man's" version of the more popular Stream Deck.

Give me a few days and I will get back to you here. Cheers! 🙂

  • Like 1
Link to comment
Share on other sites

Hi Machiavel,

A heads-up for you. I have uploaded the zipped installation package for DCS-COINS (acronym for COckpit Indicator and States) to the official DCS website. It is now pending review and clearance by the admin/moderator before you can see it listed on the Downloads-->User files section. I will update again when it's released.

Stay tuned.

  • Like 1
Link to comment
Share on other sites

2 hours ago, Marcos Paes said:

Man i was really trying to do this. haha!
If yout need some help, i can try to help you on this task!

Are you going to post here when its done?
Thank You!

Certainly. Will have you in mind if the need arises. 🙂

 

Anyway, it's now available:

https://www.digitalcombatsimulator.com/en/files/3319022/

 

Note that I have only tested it on own my machine. I may need to fine-tune the installer program for others.

  • Like 1
Link to comment
Share on other sites

11 hours ago, Marcos Paes said:

I got this error:
image.png

Hi Marcos, I thought you were one of the first few who had downloaded and posted comments in the download page. 🙂

Regarding your error, no one else has reported this. The setup is expecting your user script folder to be in either %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS\Scripts or %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS.Openbeta\Scripts. Where's yours? It's where the file Export.lua is located.

I will need to add some logic to allow user to specify the folder concerned.

Let me know. Cheers!

Link to comment
Share on other sites

7 hours ago, xoomigo said:

Hi Marcos, I thought you were one of the first few who had downloaded and posted comments in the download page. 🙂

Regarding your error, no one else has reported this. The setup is expecting your user script folder to be in either %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS\Scripts or %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS.Openbeta\Scripts. Where's yours? It's where the file Export.lua is located.

I will need to add some logic to allow user to specify the folder concerned.

Let me know. Cheers!

Mine is in a different folder: M:\Saved Games\DCS.openbeta
I think the easy way to let the user type the folder path!

Link to comment
Share on other sites

10 hours ago, Marcos Paes said:

Mine is in a different folder: M:\Saved Games\DCS.openbeta
I think the easy way to let the user type the folder path!

Okay. Latest DCS-COINS.Setup.exe now has option "Set DCS Script Folder" (top-right) in the event it cannot detect the folder concerned. You can download it from the same link.

Let me know how it goes.

Link to comment
Share on other sites

On 10/24/2021 at 9:57 AM, xoomigo said:

Hi Xoomigo,

First of all, Thanks for creating DCS-COINS and enabling us to extract the DCS values to use with Touch Portal.

I worked with your tool yesterday, followed the instructions to the letter, and everything worked perfectly. Great job!

So today I started working on my first TP profile for the F/A-18 but I have ran into some issues. I was hoping that you might be able to point me in the direction of a solution.

I have started with a page for the UFC:

TP UFC.JPG

Whenever I push one of the Function Selector buttons (A/P, IFF, TCN, ILS, D/L or BCN) Touch Portal populates the green buttons with the content of the Option Displays in DCS via the following vallues: ${value:mgdc_fa-18c_hornet_st_ufc_option_cueing_1}${value:mgdc_fa-18c_hornet_st_ufc_option_display_1}

On Pressed.JPG

On Event.JPG

On Hold.JPG

It works okay for the first push...but when I push another button and the values change, they don't update/ refresh on my Iphone.

For Example:

- I push the A/P button on my Iphone, it activates the A/P button in DCS and the options displayed on the DCS UFC are also shown on my Iphone.

- When I then push the ILS button on my Iphone, the values change in game, but not on my Iphone. I need to tap the ILS button several times before the fields on my Iphone completely reflect whats in the game.

I hope I am making sense a bit and that you can help me find a solution.

Please let me know If you need any additonal information.

Thanks in advance!

Link to comment
Share on other sites

Hi PHMAC,

Thanks for the feedback and compliments. It has been pretty quiet - except for two others, I was wondering whether anyone else got it to work...😅

I am guessing that it could be a case of DCS-BIOS triggering a load of noisy events from that point which had overwhelmed your Wifi connection or TP app on your iPhone - causing the desired events to be missed.

To check is to run "DCS-COINS -v" in verbose mode in Command Prompt - before loading DCS. Once the aircraft is running, you will see a stream of events being listed in the Command Prompt as they are received by DCS-COINS, and re-routed to TP.

After you hit the ILS button, pause DCS and check to confirm that the st_ufc_option_display_1 event is triggered as below.

image.png

Once confirmed that the value is updated as expected, the next thing I would recommend you to do is to eliminate the other unneeded noisy events (eg. commondata_st_ias_eu or commondata_st_ias_us, or both). You can do this by following the steps outlined under TIP#3 in the download page. For parameters with "commondata" string, they are located in your extract folder acdb\CommonData.pp. The others would be in the FA-18C_hornet.pp file.

Coincidentally, I have just uploaded the package with the latest DCS-BIOS files and had potentially noisy parameters disabled by default. To update DCS-BIOS files, you will need to first delete the DCS-BIOS folder in %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS\Scripts or %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS.Openbeta\Scripts (depending on where it got installed earlier). Alternatively, rename it to something else (eg. DCS-BIOS.old). This is to enable the "Install DCS-BIOS" button in the Setup program.

So, you may want to do the DCS-BIOS update first and test whether it's resolved - before doing the earlier approach of identifying and eliminating the unneeded noisy events to lighten the TP load for your iPhone. This is optional of course.

Cheers!

  • Like 1
Link to comment
Share on other sites

Hi PHMAC,

I thought over again the issue you have and I can see clearer where the problem is.

For simplicity and to avoid heavy performance hit, DCS-COINS's design is for a single-direction signal from DCS --> DCS-BIOS --> DCS-COINS --> TP. In short, TP can only listen/wait for events to be served from DCS-COINS.

Therefore, your "On Event" settings should not work as it trying to request for parameter updates from DCS-COINS - as such function does not exist.

Your first UFC button push probably got the values from an earlier TP cache of the parameters concerned.

It's a long shot with my initial suggestion but it may work - if the page "On Event" "When fa-18c_hornet Function Selector Pushbutton, ILS is ON" is triggered after TP received related update for "mgdc_fa-18c_hornet_st_ufc_option_cueing_1" and "mgdc_fa-18c_hornet_st_ufc_option_display_1". To increase this probability, put a "Wait for Timer" for perhaps 500ms to 1 second before the "Change title to" to the parameter value action.

A limitation with current TP version is the absence of "not" operator in conditional matching. If it can do the following, it would be ideal. Not sure whether it's in TP's future road map.

     When fa-18c_hornet_st_ufc_option_display_1 is not empty
         Change title to $(value:fa-18c_hornet_st_ufc_option_display_1)

        
Other more troublesome approach is to map out all possible values for the parameter concerned - which requires mapping them within DCS-COINS and listing it in TP.

     When fa-18c_hornet_st_ufc_option_display_1 is CHNL
         Change title to $(value:fa-18c_hornet_st_ufc_option_display_1)
        
     When fa-18c_hornet_st_ufc_option_display_1 is XXXX
        Change title to $(value:fa-18c_hornet_st_ufc_option_display_1)
        
     When fa-18c_hornet_st_ufc_option_display_1 is YYYY
        Change title to $(value:fa-18c_hornet_st_ufc_option_display_1)

If someone can provide a complete list, I may be able to map them for use in TP in the above manner.

Cheers!


Edited by xoomigo
Eliminate potential confusion from an earlier statement.
  • Like 1
Link to comment
Share on other sites

Hi Xoomigo,

Thanks for trying to solve this with me.

I have done as you suggested. First redownloaded en re-installed your package and DCS-BIOS. This didn't change anything in the behaviour.

After that I put in a delay in the Event-tab to allow some more time to refresh. I had to increase the delay up to 3 seconds. And now it works much better.

It is not perfect yet because of the delay but at least I can see the correct values on my Ipad.

Good thinking!

Link to comment
Share on other sites

14 hours ago, PHMAC said:

Hi Xoomigo,

Thanks for trying to solve this with me.

I have done as you suggested. First redownloaded en re-installed your package and DCS-BIOS. This didn't change anything in the behaviour.

After that I put in a delay in the Event-tab to allow some more time to refresh. I had to increase the delay up to 3 seconds. And now it works much better.

It is not perfect yet because of the delay but at least I can see the correct values on my Ipad.

Good thinking!

Hi PHMAC,

If you are still wiling to spend a little more time to try to fix it... I just thought of this approach. You can try using the TP "Values" and "Events" feature.

From "Events", you can setup a trigger for a "does not change" to an empty value condition (basically in a inverse manner where event will trigger if parameter value received is not empty). And the action will populate a pre-defined TP local value (eg. UFCDisp1) with that of the aircraft parameter.

image.png

image.png

And then you set your UFC page "On Event" to trigger on does not change to empty value.

image.png

Let me know how it goes.

Cheers!


Edited by xoomigo
Improve intelligibility.
Link to comment
Share on other sites

Hi Xoomigo,

Great idea!...

Although I only have a faint idea of what I just 'programmed'...I am glad to say that it works much better. The fields are populated more accurate and faster.

I have created the same Events and Values for the other displays.

 

The Option fields in the F18 UFC can actually contain two values:

${value:mgdc_fa-18c_hornet_st_ufc_option_display_1} = shows the value in the field

${value:mgdc_fa-18c_hornet_st_ufc_option_cueing_1} = the ":" when a field is selected

 

How can I make sure that ${value:mgdc_fa-18c_hornet_st_ufc_option_cueing_1} is included as well and also updated automatically whenever there is a change?

 

Thanks again for your help!

I really appreciate your effort.

kind regards!

 

 

 

Link to comment
Share on other sites

8 hours ago, PHMAC said:

Hi Xoomigo,

Great idea!...

Although I only have a faint idea of what I just 'programmed'...I am glad to say that it works much better. The fields are populated more accurate and faster.

I have created the same Events and Values for the other displays.

 

The Option fields in the F18 UFC can actually contain two values:

${value:mgdc_fa-18c_hornet_st_ufc_option_display_1} = shows the value in the field

${value:mgdc_fa-18c_hornet_st_ufc_option_cueing_1} = the ":" when a field is selected

 

How can I make sure that ${value:mgdc_fa-18c_hornet_st_ufc_option_cueing_1} is included as well and also updated automatically whenever there is a change?

 

Thanks again for your help!

I really appreciate your effort.

kind regards!

 

 

 

Hi PHMAC,

I think you should be able to get the same results for "ufc_option_cueing_1" with the same method for "ufc_option_display_1".

1. Create a "Value" for it eg. "UFCCueing1".

2. Create a "Event" eg. "F/A-18C UFC Cueing 1 Change" with "When the plugin fa18c_hornet_cueing_1 does not change to <empty>" and action as "Set value with id Option Cueing 1 to "mgdc_fa-18c_hornet_st_ufc_option_cueing_1.

3. On your TP page "On Event", add "When the value UFCCueing_1 does not change to <empty>" with the action change title to "${value:mgdc_fa-18c_hornet_st_ufc_option_cueing_1}${value:mgdc_fa-18c_hornet_st_ufc_option_display_1} ".

Cheers!

  • Like 1
Link to comment
Share on other sites

Perfect!...Now it works exactly as I wanted...Thanks a million!

 

7 hours ago, xoomigo said:

3. On your TP page "On Event", add "When the value UFCCueing_1 does not change to <empty>" with the action change title to "${value:mgdc_fa-18c_hornet_st_ufc_option_cueing_1}${value:mgdc_fa-18c_hornet_st_ufc_option_display_1} ".

Please correct me if I'm wrong,...but I suppose the Action change title needs to be: "${value:UFCCue1}${value:UFCDisp1}"

 

Thanks again!...It's working great now!

Link to comment
Share on other sites

1 hour ago, PHMAC said:

Perfect!...Now it works exactly as I wanted...Thanks a million!

 

Please correct me if I'm wrong,...but I suppose the Action change title needs to be: "${value:UFCCue1}${value:UFCDisp1}"

 

Thanks again!...It's working great now!

Hi PHMAC,

No, you got it right! I was inadvertently leading you off track - bad habit of copy-and-paste without thinking. 😅

Very glad that you have a effective workaround to get your desired outcome.

Cheers! 😊

 

Link to comment
Share on other sites

On 10/29/2021 at 11:30 AM, xoomigo said:

Hi Marcos, I thought you were one of the first few who had downloaded and posted comments in the download page. 🙂

Regarding your error, no one else has reported this. The setup is expecting your user script folder to be in either %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS\Scripts or %HOMEDRIVE%%HOMEPATH%\Saved Games\DCS.Openbeta\Scripts. Where's yours? It's where the file Export.lua is located.

I will need to add some logic to allow user to specify the folder concerned.

Let me know. Cheers!

WORKING PERFECT 🙂

Link to comment
Share on other sites

×
×
  • Create New...