Unexpected pre-execution of panel script causes errors
Posted: Mon May 03, 2021 5:39 am
I get many errors from my panel script because the panel script is executed many times before the script is realy started. Except for the last exectution the script is executed without the neccessary data which causes an error in a (library) function which is called with only nil values.
Even when starting AM the panel script is executed.
When starting the panel, the script is executed several times before the script is realy started. The last time it runs fine and the library function works OK as expected. I added info logging to see what happens which is only visible the last time (last two lines). The error message indicates "Error loading instrument script", but the library is only part of the panel, not part of any instrument.
For testing the panel has 5 instruments at the moment (see Instrument switcher panel).
I expect the panel script is executed only once after instrument loading when the panel is started. Perhaps these errors also causes user properties not to be visible which is another issue.
Even when starting AM the panel script is executed.
Code: Select all
2021-05-03 06:40:04 INFO AMBase - Initializing
2021-05-03 06:40:04 INFO AMBase - HW id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2021-05-03 06:40:06 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "logic.lua"]:186: attempt to call a nil value (field 'load_config')
2021-05-03 06:40:06 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "logic.lua"]:186: attempt to call a nil value (field 'load_config')
2021-05-03 06:40:06 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "logic.lua"]:186: attempt to call a nil value (field 'load_config')
Code: Select all
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 ERROR InstrumentScanner - Instrument Switcher panel: Error loading instrument script: [string "config_loader.lua"]:150: bad argument #1 to 'for iterator' (table expected, got nil)
2021-05-03 06:45:08 INFO SiRunner - Instrument Switcher panel: logic.lua started
2021-05-03 06:45:08 INFO SiRunner - Instrument Switcher panel: PanelConfig.load called
I expect the panel script is executed only once after instrument loading when the panel is started. Perhaps these errors also causes user properties not to be visible which is another issue.