Jump to content
Sign in to follow this  
ptimale

Fenix change the EFB wallpaper automatically ICAO

Recommended Posts

Good morning

is it possible to read icao_airline charger or in the aircraft.cfg file of the livery

THANKS

Share this post


Link to post
Share on other sites

THANKS

(A:ATC ID, String) gives me the registration of the oat, it doesn't work

I found a trick with the simbrief flight plan export in xml

it's very useful

if we have the possibility via AAO to read the airline icao code of the simbrief flight plan

the goal of the exercise is to create a condition based on the icao airline code

if icao_airline is ezy then run the script, which loads an image of the company

Share this post


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

THANKS

(A:ATC ID, String) gives me the registration of the oat, it doesn't work

I found a trick with the simbrief flight plan export in xml

it's very useful

if we have the possibility via AAO to read the airline icao code of the simbrief flight plan

the goal of the exercise is to create a condition based on the icao airline code

if icao_airline is ezy then run the script, which loads an image of the company

You can query SimBrief from within AAO and get all the information in LVars.

Enter your SimBrief credentials in the AAO "Extras" menu, then use the (LOAD_SIMBRIEF) or (LOAD_SIMBRIEF_PLAN) RPN commands. After the download has completed, you can find the LVars with "Scripts->Watch simulator variables->Select variable->Active local AAO variables" (they are all called (L:simbrief.*)

The one you are looking for is probably "(L:simbrief.general.icao_airline, String)", obtained with (LOAD_SIMBRIEF)

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

(L:simbrief.general.icao_airline,·String)

I have the icao airline code

now I need to figure out how to rename a file in a folder based on the ivao_airline variable

Share this post


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

now I need to figure out how to rename a file in a folder based on the ivao_airline variable

What for, what is the use case?

AAO has commands for file operations (read, write, copy, move, delete). Check the AAO manual, chapter "Scripting", section about "File system operations". You can use them in RPN, JScript or VBScript.

In JScript and VBScript you have additional options for file system access, but that requires a fair bit of research first (you have to utilize good old ActiveXObject class, Google will be your friend here)

Random example for file access in JScript:

var Fso = new ActiveXObject("Scripting.FileSystemObject");
var Log = Fso.OpenTextFile("LogFile.txt",2,true); //1 read, 2 write, 8 append
Log.WriteLine("Something to log");
Log.close();

 

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

I want to change the screen background of the Fenix EFB according to the icao_airline code

The files are located in the folder: C:\ProgramData\Fenix\FenixSim A320\efb\img

I just saw that when restarting the EFB it takes into account the change of the wallpaper

Share this post


Link to post
Share on other sites
2 minutes ago, ptimale said:

I want to change the screen background of the Fenix EFB according to the icao_airline code

The files are located in the folder: C:\ProgramData\Fenix\FenixSim A320\efb\img

I just saw that when restarting the EFB it takes into account the change of the wallpaper

I wouldn't rename files in that realm. Besides, you would probably have to force a refresh of the EFB html page anyway. 


LORBY-SI

Share this post


Link to post
Share on other sites

this is a cache folder where the wallpaper is saved

I'm not taking a big risk

I have already made a powershell script that works via OFP simbrief, it's a bit crooked but it works 🙂

I would like to do it when loading the plane with AAO

Share this post


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

I would like to do it when loading the plane with AAO

I don't see a problem with that? All the necessary elements are mentioned here in the thread. Create a script that queries simbrief, waits for a bit to make sure that the result is available, then evaluates that result and renames your target file. Implement it as an Aircraft Automated Script, One Shot, Beginning.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

yes no problem for that

for the moment I'm looking on Google how to rename the image in jscript and use the variable (L:simbrief.general.icao_airline,·String)
I don't know the language 🙂

Share this post


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

yes no problem for that

for the moment I'm looking on Google how to rename the image in jscript and use the variable (L:simbrief.general.icao_airline,·String)
I don't know the language 🙂

Give me an example of what the files are called and I'll write an example for you. You don't have to use native JScript things, you can also call AAO commands from within JScript.

Or use plain RPN like this. The file names you can build dynamically using the "scat" operator

(LOAD_SIMBRIEF)·(SPLIT:2500)·
'SourceFile_'·(L:simbrief.general.icao_airline,·String)·scat·'.jpg'·scat·'TargetFile.jpg'·(COPYFILE:%s1|%s2)

will for example query SimBrief, wait for 2,5 seconds, then copy "SourceFile_DLH.jpg" over "TargetFile.jpg".

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
Posted (edited)

le fichier est "C:\ProgramData\Fenix\FenixSim A320\efb\img\EWG.jpg"
J'ai plusieurs fichiers d'arrière-plan dans ce dossier en fonction du code iCAO

si la variable (L:simbrief.general.icao_airline,·String) est EWG alors renommez le fichier qui porte le titre ewg en Exif en bg.jpg

Je peux vous envoyer mon script PowerShell pour comprendre le processus

Edited by ptimale

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·'.jpg'·scat·'C:\ProgramData\Fenix\FenixSim A320\efb\img\bg.jpg'·(COPYFILE:%s1|%s2)

This is pure theory though. On my computer the \img\ folder doesn't exist, so I can't test it.

Edited by Lorby_SI
MOVEFILE was the wrong command!

LORBY-SI

Share this post


Link to post
Share on other sites

the script works but if I load "EWG"
and then I load AFR it doesn't work because there is a bg.jpg file conflict

script:
Stage 1: rename the bg.jpg according to the title in title image tab
Step 2: run your script
Step 3: end of the script rename the bg.jpg with the variable (L:simbrief.general.icao_airline,·String)

I'm looking but you go faster than me

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...