Jump to content

Touch Portal App


Recommended Posts

On 9/19/2023 at 4:44 PM, virgo47 said:

How about those inverted sliders? Is there some kind of way to do something like (65535-<valueFromBios>)*-1 in the PP file for that =ctrl(...)?

It's a matter of introducing an invert function to adjust the values before sending it to DCS-BIOS. Will add to to-do list.

  • Thanks 1
Link to comment
Share on other sites

On 9/19/2023 at 7:21 PM, Tanuki44 said:

I also need to understand how to synchronize the lights, buttons during a hot start

From my past experience, the control states (of button, dials, levers, lights, and etc) events are not all triggered by DCS-BIOS on start-up (whether cold start, hot start, in flight and so on). This could a matter of how DCS-BIOS programming was done for specific aircraft.

Link to comment
Share on other sites

I defined in the lua of my mod in DCS-BIOS :

local defineFloat = BIOS.util.defineFloat
defineFloat("LIGHTING_SWITCHES", 206, {0, 1}, "LIGHTS", "Lighting_Switches")


that I find in the .json

                   "LIGHTS": {
                                 "LIGHTING_SWITCHES": {
                                                              "category": "LIGHTS",
                                                          "control_type": "analog_gauge",
                                                           "description": "Lighting_Switches",
                                                            "identifier": "LIGHTING_SWITCHES",
                                                                "inputs": [  ],
                                                               "outputs": [ {
                                                                                  "address": 25088,
                                                                              "description": "gauge position",
                                                                                     "mask": 65535,
                                                                                "max_value": 65535,
                                                                                 "shift_by": 0,
                                                                                   "suffix": "",
                                                                                     "type": "integer"
                                                                          } ]
                                                      }
                             },


and in  .pp

LIGHTING_SWITCHES|lighting_switches|Lighting_Switches|0|0|#=int(65535)#|0

Everything seems OK, but impossible to find it in TouchPortal to test its value,
What am I doing wrong or forgetting?
Thanks for help

 


Edited by Tanuki44
Link to comment
Share on other sites

8 hours ago, Tanuki44 said:

and in  .pp
LIGHTING_SWITCHES|lighting_switches|Lighting_Switches|0|0|#=int(65535)#|0

Everything seems OK, but impossible to find it in TouchPortal to test its value,

Oh, this is due to the presence of "#" character in the line in the PP file - which a deliberate way to make tell the plugin to bypass the record from being loaded into TP.

Not all records mined from a DCS-BIOS JSON file is enabled by default. In this case, "int(65535)" data type are ignored - unless they are included in an exception table. This is to avoid risk of unused/unnecessary parameters overwhelming plugin performance and TP/DCS-BIOS response time.

In your case, just use the text editor to remove the 2 hash characters in the line concerned.

LIGHTING_SWITCHES|lighting_switches|Lighting_Switches|0|0|=int(65535)|0

Then, add the same line to the file CustomACParam.dat. This will ensure that the next time you run the PP extractor script, it will not add the hash characters for the line concerned. You will need to do the same for all new record lines with the data type concerned.

Link to comment
Share on other sites

On 9/22/2023 at 7:40 PM, Tanuki44 said:

I use this function to read the value of an argument (here 206), however the value does not change and always remains at 0 while the arg goes to 1
That I use a 'Event' or a 'If Statement'
Again, have I missed something?

What's the output of "dcs-coins -V" (running in Command Prompt) when the value changes? Was there an event triggered from DCS-BIOS that was captured in DCS-COINS?

If not, it will not be passed on to TP.

Link to comment
Share on other sites

I come back to my question about starting a mission in Hot Start,
I tried different things, but I can't figure out how to synchronize the objects.
Some events seem not to happen which is not the case with a Cold Start.
Is there a way to make a button that would run a series of tests to resync the elements of that series which could be triggered by the event 'Aircraft connection is ON'
Thanks

Link to comment
Share on other sites

14 hours ago, Tanuki44 said:

I come back to my question about starting a mission in Hot Start,
I tried different things, but I can't figure out how to synchronize the objects.
Some events seem not to happen which is not the case with a Cold Start.
Is there a way to make a button that would run a series of tests to resync the elements of that series which could be triggered by the event 'Aircraft connection is ON'

This is a gap that I was trying to address too within DCS-COINS earlier on but to no avail.

The solution needs to come from DCS-BIOS - something that's outside my capability (for the time being). If you can build a DCS-BIOS function, either in general as a Common parameter or aircraft-specific, I can define a DCS-COINS action to trigger it.

I would suggest consulting WarLord to assist here. 🙂

Link to comment
Share on other sites

Quote

Bios shows the actual stateof the pit. It does not matter in wich state it is, since bios reads the switch position in the cockpit.

Using ctrldef we can see that the values are correct during a Hot Start.

For example, in Hot Start, the Battery switch is positioned on ON


on1.png

 

yet in TouchPortal it shows Current: OFF

on.png


Edited by Tanuki44
Link to comment
Share on other sites

On 9/22/2023 at 5:10 AM, xoomigo said:

In your case, just use the text editor to remove the 2 hash characters in the line concerned.

LIGHTING_SWITCHES|lighting_switches|Lighting_Switches|0|0|=int(65535)|0

Then, add the same line to the file CustomACParam.dat. This will ensure that the next time you run the PP extractor script, it will not add the hash characters for the line concerned. You will need to do the same for all new record lines with the data type concerned.

I tested this
LGHT_SW|lght_sw|Lighting_Switches|0|0|#=int(65535)#|0
modified 
LGHT_SW|lght_sw|Lighting_Switches|0|0|=int(65535)|0

I added this edited line in the CustomACParams.dat file

but when I execute the extractor script, the line is not taken into account 

after the script .\dbParamExtractor.ps1 MH-60R
in MH-60R.tt
the line is 
Lights|analog_gauge|LGHT_SW|Lighting_Switches|0|0|65535|integer

after the script .\ppGenerator.ps1 MH-60R
in MH-60R.pp
the line is always
LGHT_SW|lght_sw|Lighting_Switches|0|0|#=int(65535)#|0

I tested with the option --verbose
98 LGHT_SW : Not customized

I tried to read the script but I'm not comfortable with this language...

Link to comment
Share on other sites

20 hours ago, Tanuki44 said:

I tested this
LGHT_SW|lght_sw|Lighting_Switches|0|0|#=int(65535)#|0
modified 
LGHT_SW|lght_sw|Lighting_Switches|0|0|=int(65535)|0

I added this edited line in the CustomACParams.dat file

but when I execute the extractor script, the line is not taken into account 

after the script .\dbParamExtractor.ps1 MH-60R
in MH-60R.tt
the line is 
Lights|analog_gauge|LGHT_SW|Lighting_Switches|0|0|65535|integer

after the script .\ppGenerator.ps1 MH-60R
in MH-60R.pp
the line is always
LGHT_SW|lght_sw|Lighting_Switches|0|0|#=int(65535)#|0

I tested with the option --verbose
98 LGHT_SW : Not customized

I tried to read the script but I'm not comfortable with this language...

Sorry, the earlier format that I gave you was incomplete - it was missing the first column which indicates the PP file concerned.

Please try replacing the line in CustomACParams.dat file:

MH-60R.pp|LGHT_SW|lght_sw|Lighting_Switches|0|0|=int(65535)|0

Or if you want the value to be in percentage, then use the following

MH-60R.pp|LGHT_SW|lght_sw|Lighting_Switches|0|0|=pct(65535)|0

 

  • Thanks 1
Link to comment
Share on other sites

On 9/27/2023 at 12:03 AM, Tanuki44 said:

Using ctrldef we can see that the values are correct during a Hot Start.

For example, in Hot Start, the Battery switch is positioned on ON


on1.png

 

yet in TouchPortal it shows Current: OFF

on.png

 

Can you share the BATT_SW line in the PP file?

Potentially, it is caused by unexpected inverted values. If the second last column value is "OnOff", change it to "OffOn", or vice-versa.

Link to comment
Share on other sites

here is the line, but I don't think that's the problem, the battery switch is just an example (also found on the Huey page)
 
BATT_SW|batt_sw|Battery Switch, OFF/ON|4|0|OffOn|OFF

but I will test to understand the difference, this concerns all of cocpkit's elements (inter, light, value of arguments).

Everything works normally from COLD START, with all the tests that I have done, I am convinced that in HOT START mode,

there is no event at the start of the mission, the elements are not initialized or maybe I missed something in the cockpit concept?

To be continued... 😉

 


Edited by Tanuki44
Link to comment
Share on other sites

  • 2 weeks later...

For my mod MH-60R
There are currently 6 pages: NAV, RADAR, ASN1-28B, ENGINE, ASW, CSAR
Some elements communicate bidirectionally, others via keybinds.
Everything seems OK in COLD START, there is still the problem in HOT START, a workaround is in place but still needs fine-tuning.

Thanks again for your help and your work on the plugin that made this adaptation possible.

Touch_Portal.png?ex=653157fd&is=651ee2fd


Edited by Tanuki44
Link to comment
Share on other sites

On 10/7/2023 at 3:40 AM, Tanuki44 said:

For my mod MH-60R
There are currently 6 pages: NAV, RADAR, ASN1-28B, ENGINE, ASW, CSAR
Some elements communicate bidirectionally, others via keybinds.
Everything seems OK in COLD START, there is still the problem in HOT START, a workaround is in place but still needs fine-tuning.

Thanks again for your help and your work on the plugin that made this adaptation possible.

Thanks for the update - you are welcome! 🙂

Will the next DCS-BIOS release by FlightPanel will include your mod? Also, will you be sharing your work on TP pages when it's complete?

Link to comment
Share on other sites

7 hours ago, Tanuki44 said:

FlightPanel should include the MH-60R (UH-60L compatible) mod in the next release of DCS-BIOS.
Afterwards, I will make my pages available with the explanation of my workaround for HOT START

 

Will look forward to it!

Link to comment
Share on other sites

  • 1 month later...

Touch Portal 4.0 got out recently and it has a few interesting improvements that can be handy for multi-page "pages" 🙂 (or panels, let's say). It can export multiple pages at once and on import it asks what to do with conflicting value ids (unfortunately, for now it asks for each of them, instead of something like "ignore/reuse for all"). But it's not all bells and whistles.

While built-in actions seem to work, COINS action seems to not work properly - as it is not possible to drag'n'drop them into On Pressed/On Event canvases anymore. Also, existing actions don't show the value as a select box anymore:

image.png

Funny that "everything works" - but nothing can be changed. I asked on the TP Discord as well, but I have no info yet. Not sure whether the plugin needs to be rebuilt for 4.0 or what. I'll let you know when/if TP guy(s) tell me more.

✈️ L-39, F-5E, F/A-18C, MiG-15, F-86F, C-101, FC3 🛩️ Yak-52, P-47, Spitfire 🚁 UH-1H, Ka-50 III 🗺️ NTTR, PG, SY, Chnl, Norm2 📦 Supercarrier, NS430, WWII 🕹️ VKB STECS+Gladiator/Kosmosima ▶️ DCS Unscripted YouTube

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
On 11/20/2023 at 12:23 AM, virgo47 said:

Touch Portal 4.0 got out recently and it has a few interesting improvements that can be handy for multi-page "pages" 🙂 (or panels, let's say). It can export multiple pages at once and on import it asks what to do with conflicting value ids (unfortunately, for now it asks for each of them, instead of something like "ignore/reuse for all"). But it's not all bells and whistles.

While built-in actions seem to work, COINS action seems to not work properly - as it is not possible to drag'n'drop them into On Pressed/On Event canvases anymore. Also, existing actions don't show the value as a select box anymore:

Funny that "everything works" - but nothing can be changed. I asked on the TP Discord as well, but I have no info yet. Not sure whether the plugin needs to be rebuilt for 4.0 or what. I'll let you know when/if TP guy(s) tell me more.

Hi virgo47 & DCS-COINS users,

Besides work, I have been very preoccupied with many other things and have been out of touch with DCS and TP for quite a while...

The latest TP 4 release came with revised TP format structures - which unexpectedly broke certain DCS-COINS functionalities.

I will need to go through the API documentations to identify the changes needed before I can determine what needs to be done for the plugin. However, I can only try to do so sometime in the first quarter of next year. Sorry. 😞

  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...