Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Fenix change the EFB wallpaper automatically ICAO

Featured Replies

  • Commercial Member
11 minutes ago, ptimale said:

because there is a bg.jpg file conflict

Why is there a conflict? Which process is locking the file?

When the file is locked, it doesn't matter what steps you take - you cannot rename or overwrite it.

Edited by Lorby_SI

LORBY-SI

  • Replies 53
  • Views 8.4k
  • Created
  • Last Reply
  • Author

when loading the plane the script is executed the image is renamed to bg.jpg but it is deleted

  • Commercial Member
Just now, ptimale said:

when loading the plane the script is executed the image is renamed to bg.jpg but it is deleted

Did you see that I've changed the command in the script? It must be COPYFILE.

(and not MOVEFILE, obviously)

LORBY-SI

  • Author

no better

if I run the script with the test button it works

but when loading the plane the AFR.jpg file is renamed to bg.jpg but it is deleted

  • Author

sorry I was wrong
I'll come back after the test

  • Author

it works very well
remains to delete the bg.jpg file after loading the plane

  • Commercial Member
5 minutes ago, ptimale said:

remains to delete the bg.jpg file after loading the plane

Why do you want to do that? COPYFILE will overwrite it, when it can. When/if the file is locked by the Fenix process, you cannot delete it either. 

Anyway, on the AAO RPN editor there is a button called "Insert AAO cmd" where you can get all the special RPN commands that only exist in AAO. And use the AAO manual (click on the grey question mark button at the top of the AAO windows), everything is in there. Like for example "(DELETEFILE:xxxx)"

 

Edited by Lorby_SI

LORBY-SI

  • Author

Why do you want to do that? COPYFILE will overwrite it, when it can. When/if the file is locked by the Fenix process, you cannot delete it either.

no the file is not locked

but thank you for your time I will look

congratulations again for your help

  • Commercial Member
22 minutes ago, ptimale said:

Why do you want to do that? COPYFILE will overwrite it, when it can. When/if the file is locked by the Fenix process, you cannot delete it either.

no the file is not locked

but thank you for your time I will look

congratulations again for your help

I'm sorry, but I am really lost. I don't understand the problem that you are seeing, what that "conflict" is supposed to be or what process you are following with your steps exactly. It seems to me that even the point when "my" script is executed is not when I thought that it would run.

I'm afraid that this makes it impossible to suggest any code.

LORBY-SI

  • Author

here is the complete code for anyone who wants to do the same thing
copy your images to the folder C:\ProgramData\Fenix\FenixSim A320\efb\img

you must first load a wallpaper with the name bg.jpg see the procedure on the Fenix website

rename your wallpaper with the icao airline code

A big thank you to Olivier Mr. AAO for his help (my name is also Olivier :))

load the script with Aircraft Automated Script page 65 of the manual

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

 

Edited by ptimale

I wonder if I'm doing something wrong. 

I'm running the script and it indeed identifies the code and creates a correct copy named bg.jpg. However, the efb screen itself does not refresh from the default background AND a few seconds after running the script the bg.jpg is deleted.

Any clue to what went wrong?

  • Commercial Member
43 minutes ago, ha5mvo said:

I wonder if I'm doing something wrong. 

I'm running the script and it indeed identifies the code and creates a correct copy named bg.jpg. However, the efb screen itself does not refresh from the default background AND a few seconds after running the script the bg.jpg is deleted.

Any clue to what went wrong?

Sorry, but I'm not doing any of that myself. Please consider sending @ptimale a personal message.

LORBY-SI

  • Author

Hi

before using the script, you must load a wallpaper with an image called bg.jpg

you will see that by default it is automatically saved in the folder C:\ProgramData\Fenix\FenixSim·A320\efb\img\

it is this image that is called up each time the plane is loaded

5 hours ago, ptimale said:

Hi

before using the script, you must load a wallpaper with an image called bg.jpg

you will see that by default it is automatically saved in the folder C:\ProgramData\Fenix\FenixSim·A320\efb\img\

it is this image that is called up each time the plane is loaded

I do just that.

What happens in practice though, is that the correct image is turned to into bg.jpg (corresponding with the simbrief data), however it fails to load and is automatically deleted after about 10 seconds leaving the background as it was and no bg.jpg in the folder.

For some reason, the tablet won't refresh with the new bg file. If you bring up the remote tablet on http://localhost:8083/ - you will indeed get the new background showing up but not in the VC

  • Commercial Member
22 hours ago, ptimale said:

Hi

before using the script, you must load a wallpaper with an image called bg.jpg

you will see that by default it is automatically saved in the folder C:\ProgramData\Fenix\FenixSim·A320\efb\img\

it is this image that is called up each time the plane is loaded

For anyone interested, here is a solution using JScript in AAO. This script queries SimBrief on its own (supply your account name!), so no need to use (LOAD_SIMBRIEF):

(I still don't understand why you are deleting the bg.jpg file?)

(WSH:jscript|AaoEntry)

function AaoEntry(){
  // your SimBrief user name goes here
  var sbuser = 'yourusername';
  // query SimBrief
  var xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");   
  var commandStr = "https://www.simbrief.com/api/xml.fetcher.php?username=" + sbuser;
  xmlHttpReq.open("POST", commandStr, false);
  xmlHttpReq.send();
  var content = xmlHttpReq.responseText;
  // load the resoponse XML into a DOM structure
  var dom = new ActiveXObject("msxml2.DOMDocument.6.0");
  dom.async = false;
  dom.loadXML(content); 
  // query the airline icao
  var objNodeList = dom.documentElement.selectNodes("general/icao_airline");
  if (objNodeList && objNodeList.length > 0){
    // if it exists, copy the file
    var acIcao = "" + objNodeList[0].text;
    var srcImgName = "C:\\ProgramData\\Fenix\\FenixSim A320\\efb\\img\\" + acIcao + ".jpg";
    var trgImgName = "C:\\ProgramData\\Fenix\\FenixSim A320\\efb\\img\\bg.jpg";
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    fso.CopyFile(srcImgName, trgImgName, true);
    // delete the target file after 20 seconds (why?)
    AaoCmd.sleep(20000);
    fso.DeleteFile(trgImgName, true);
  }
}

 

LORBY-SI

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.