The wiki page has details of how to do this - I've put some effort into making it as straightforward as possible.
For the Nasal code setting up everything, I would still suggest to use named function call arguments in the form of:
- Code: Select all
fg1000system.addPFD(device:1);
fg1000system.addMFD(device:2);
fg1000system.displayGUI(device:1, scale:0.5);
the .getInstance helper could also be named getOrCreateInstance(), because that's basically what it is doing, isn't it ?
and like I said in my PM, I would definitely suggest versioning the fgcommand layer that encapsulates Emesary notifications - so that interlinked fgfs instances (dual-control, multi-instance setups etc) can detect mismatching fg/fg1000 versions.
for the fgcommand layer, we could also use OBJECT.METHOD notification - even though I do think that making the class/name of the instrument part of the fgcommand arg vector would make sense so that the correspondign logic can be moved to the MFD framework