Jump to content
Sign in to follow this  
ptimale

Fenix change the EFB wallpaper automatically ICAO

Recommended Posts

I understand
that the script will only be valid for one livery.

I will test your latest script next week with
thank you again for your patient

olivier

Share this post


Link to post
Share on other sites
Posted (edited)
4 minutes ago, ptimale said:

that the script will only be valid for one livery.

Correct. 

You would have to make a new aircraft.cfg somewhere else, where you simply collect all the others into one single file. Then point the script at that, it should be able to figure it out.

The next version of AAO will have an LVar "(L:AirFile, String)" that will (for MSFS) contain the current path to the airfile.cfg. It is up to you to send me that email 🙂

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, ptimale said:

I understand
that the script will only be valid for one livery.

I will test your latest script next week with
thank you again for your patient

olivier

I'm sorry, but after checking it our with the latest version of the Fenix, I have come to the conclusion that my idea won't work. The sim is not reporting the actual location of the aircraft.cfg in use at all, it is always pointing at the "Master" file in the Fenix folders. It is not possible to find the correct file that way. The only option would be if you combine all aircraft.cfgs into one and point the script at that files.

But honestly, I would stick to SimBrief. That sounds like the best solution to me.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
Posted (edited)

If you wonder how to refresh the EFB "mid-flight", for example if you swap the background image when the simulation is already running - there may be a solution, but it is not for the faint of heart. And it will completely reset the EFB. In theory this should then show the new background image.

0. Make sure that the sim is not running.

1. Find this file: \Community\fnx-aircraft-320\html_ui\Pages\VCockpit\Instruments\FNX32X\EFB\EFB_Captain.js
    and open it in Notepad++

2. Change the code to this (new code in bold font)

Quote

class EFB_Captain extends BaseInstrument {
    get isInteractive() { return true; }
    constructor() {
        super();
    }
    get templateID() { return "EFB_Captain"; }
    connectedCallback() {
        super.connectedCallback();
        SimVar.SetSimVarValue("L:N_BRIGHTNESS_EFB_CAPT", "number", 0.5);
    }
    disconnectedCallback() {
        super.disconnectedCallback();
    }
    Update() {
        super.Update();
        var refChk = SimVar.GetSimVarValue("L:REFRESH_EFB_CAPT", "number");
        if (refChk == 1){
            SimVar.SetSimVarValue("L:REFRESH_EFB_CAPT", "number", 0);
            window.location.reload();
        }

    }
}


registerInstrument("efb-captain-element", EFB_Captain);

3. Save.

Now you can force a refresh by triggering the LVar from AAO or any other app:

1 (>L:REFRESH_EFB_CAPT, Number)

Edited by Lorby_SI
  • Like 1

LORBY-SI

Share this post


Link to post
Share on other sites

If you are just interested in refreshing the efb after setting the bg.jpg file, can't you just add the line window.location.reload(); at the end of the previous script and run it as an aircraft automated script?

Share this post


Link to post
Share on other sites
8 hours ago, ha5mvo said:

If you are just interested in refreshing the efb after setting the bg.jpg file, can't you just add the line window.location.reload(); at the end of the previous script and run it as an aircraft automated script?

No. One has nothing whatsoever to do with the other.

The reload must be executed inside the HTML instrument in the sim itself.


LORBY-SI

Share this post


Link to post
Share on other sites
20 hours ago, Lorby_SI said:

Si vous vous demandez comment rafraîchir l'EFB "en plein vol", par exemple si vous échangez l'image de fond alors que la simulation est déjà en cours, il existe peut-être une solution, mais elle n'est pas pour les âmes sensibles. Et cela réinitialisera complètement l’EFB. En théorie, cela devrait alors afficher la nouvelle image d'arrière-plan.

0. Assurez-vous que la carte SIM n'est pas en cours d'exécution.

1. Recherchez ce fichier : \Community\fnx-aircraft-320\html_ui\Pages\VCockpit\Instruments\FNX32X\EFB\EFB_Captain.js
    et ouvrez-le dans Notepad++

2. Remplacez le code par ceci (nouveau code en gras)

3. Enregistrez.

Vous pouvez désormais forcer un rafraîchissement en déclenchant la LVar depuis AAO ou toute autre application :

1 (>L:REFRESH_EFB_CAPT, Number)

tube is too loud I looked to see if there was a variable to restart the EFB in configuration files Thanks a lot

Share this post


Link to post
Share on other sites
Posted (edited)
(LOAD_SIMBRIEF)·(SPLIT:2500)·
'C:\ProgramData\Fenix\FenixSim·A320\efb\img\'·(L:simbrief.general.icao_airline,·String)·scat·'.png'·scat·'C:\ProgramData\Fenix\FenixSim·A320\efb\img\bg.png'·(COPYFILE:%s1|%s2)
1·(>L:REFRESH_EFB_CAPT,·Number)
(SPLIT:10000)·
'C:\ProgramData\Fenix\FenixSim·A320\efb\img\bg.png'·(DELETEFILE:%s1)·

It works very well thank you
even though I didn't have a problem before
at least now we have a variable to refresh the efb

Edited by ptimale
modif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...