General Helper Library

Help creating logic scripts for Air Manager Instruments

Moderators: Ralph, russ

Post Reply
Message
Author
Roxus
Posts: 57
Joined: Wed Sep 02, 2020 7:30 pm

General Helper Library

#1 Post by Roxus » Tue Jun 15, 2021 10:22 pm

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

User avatar
Sling
Posts: 4511
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: General Helper Library

#2 Post by Sling » Wed Jun 16, 2021 1:03 am

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.

Roxus
Posts: 57
Joined: Wed Sep 02, 2020 7:30 pm

Re: General Helper Library

#3 Post by Roxus » Wed Jun 16, 2021 2:55 am

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

User avatar
Sling
Posts: 4511
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: General Helper Library

#4 Post by Sling » Wed Jun 16, 2021 7:58 am

Ok for local use but as I said no good for sharing instruments.

Tetrachromat
Posts: 73
Joined: Sun Feb 14, 2021 6:55 pm

Re: General Helper Library

#5 Post by Tetrachromat » Wed Jun 16, 2021 6:48 pm

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

Roxus
Posts: 57
Joined: Wed Sep 02, 2020 7:30 pm

Re: General Helper Library

#6 Post by Roxus » Tue Jun 22, 2021 5:09 pm

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.

User avatar
jph
Posts: 758
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: General Helper Library

#7 Post by jph » Wed Jun 23, 2021 8:52 am

I very much doubt it is even on the radar of anyone's priorities. :roll:
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests