I see the wiki where we can create a lib/ for an instrument.
Is there a place we can create library code for all instruments ?
Personal helper code
General Helper Library
Re: General Helper Library
Hi,
There is a Lua file in the AM directory tree where the current helpers such as var_cap(), var_round() etc are located. I suppose they could be added there but they may get overwritten during an update. I wouldn’t do this.
It’s best to just include the helpers you create in a lib file and include with any instrument that needs to use them. This way if you ever share something it’s all right there and the instrument is guaranteed to work.
There is a Lua file in the AM directory tree where the current helpers such as var_cap(), var_round() etc are located. I suppose they could be added there but they may get overwritten during an update. I wouldn’t do this.
It’s best to just include the helpers you create in a lib file and include with any instrument that needs to use them. This way if you ever share something it’s all right there and the instrument is guaranteed to work.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: General Helper Library
if only Windows had *nix symlinking ... holy crap, it turns out they do !?!? I didnt know that !!
In an Administrator console (need elevated priveleges it seems - although there is an Explorer plugin to add the ability) :
mklink <instrumentid>/lib/functions.lua /path/to/helper_functions.lua
I tested it and AM worked as expected
I didnt test zipping it up if sharing an instrument whether Windows Zip will copy the original or create a link entry like *nix
mklink does have a hardlink option tho, which would solve that problem if it works like *nix as well
In an Administrator console (need elevated priveleges it seems - although there is an Explorer plugin to add the ability) :
mklink <instrumentid>/lib/functions.lua /path/to/helper_functions.lua
I tested it and AM worked as expected
I didnt test zipping it up if sharing an instrument whether Windows Zip will copy the original or create a link entry like *nix
mklink does have a hardlink option tho, which would solve that problem if it works like *nix as well
Re: General Helper Library
Ok for local use but as I said no good for sharing instruments.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: General Helper Library
I personally place my common code into the lua_libs directory in the installation folder. No problems with updating Air Manager so far, but keeping a repository as backup.
There is also a lib directory in each panel. If your instruments are used in the same panel, I would place the common lua library files there. I assume they are loaded as well when the panel gets loaded.
Paul
There is also a lib directory in each panel. If your instruments are used in the same panel, I would place the common lua library files there. I assume they are loaded as well when the panel gets loaded.
Paul
Re: General Helper Library
I added hardlinks to my libraries yesterday and it zips up fine.
But when I CLONE an Instrument, AM takes a copy of the files in the lib, so they dont get the changes coz they are unique copies.
But when I CLONE an Instrument, AM takes a copy of the files in the lib, so they dont get the changes coz they are unique copies.
Re: General Helper Library
I very much doubt it is even on the radar of anyone's priorities.
Joe. CISSP, MSc.