Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to handle config files in AF

Thanks for the response, AQ.  Hopefully my post didn't come across as offensive (please forgive me if it did).  This is probably not the best forum for getting into the AQCL, so I won't try to speak too much more about the AQCL.  But, if this is the case that the AQCL is exactly written for, I would love to see an example in action where the AQCL produces something reasonable but the "INI file breaks down".  It is likely I am missing something, but I deal with fairly large systems that require a significant amount of configuration, and I have never had an INI breakdown.  Indeed I do have nested objects, but this doesn't seem to be a particularly large hurdle to overcome. 

You speak of the AQCL as if it requires no effort to perform the serialization but I have found that I have to put in the same effort with the AQCL as I would with the standard configuration VIs, the difference being that rather than writing something to handle key-value pairs, I am now writing code to deal with how to serialize/deserialize a class.  And on top of this, I now have yet another class that seems to have been built strictly for configuration.  I think a real-world use case would be nice because it would probably illustrate something that is just alluding me.

Now, getting to the comment concerning the "specific problem" (as well as the brackets comment).  This was not in reference to the AQCL, this was in reference to the use of json as a configuration file format.  JSON was intended for data interchange (think server to browser communication).  I look at Benjamin's example above and all I can think is how easy it would be to drop a bracket when editing on something like notepad and I have now destroyed my configuration file.  I can find a bunch of different ways to write that more simply in the INI file format without the quotation marks and brackets and be less prone to errors when handled by an unwary customer.  I know the advantages of sending json data when blasting out an http response to a browser request, but it is not clear to me why you would use this format for configuration.

Cheers, Matt

0 Kudos
Message 11 of 27
(4,748 Views)

In my case I am not using AF or AQ’s serializer.  Most of the configuration info I’m saving is from Front Panel controls and I ‘m not expecting the User to modify the config file directly.   If I did, an INI is better than JSON.  JSON’s advantage is it can match any complex nesting structure (which INI can only by some ad-hoc naming convention in the section names), while still having some human readability/edit-ability if needed.

0 Kudos
Message 12 of 27
(4,748 Views)

mtat76 wrote:

Thanks for the response, AQ.  Hopefully my post didn't come across as offensive

Nope. And I hope mine didn't come across as offended! I just had a lot to say on the topic. 🙂

0 Kudos
Message 13 of 27
(4,748 Views)

Great!  You didn't - I just didn't want to make it clear that I wasn't trashing the lineator.  I haven't had a lot of time to delve into the guts to make sure that I understand what is happening, but I think for my work it could possibly be quite useful in other areas.

James, if you don't use the AQCL, did you put together your own serialization routine or are you using something else out there?

0 Kudos
Message 14 of 27
(4,748 Views)

I’m using the LAVA-CR JSON toolkit, though I did write about half of that.

Message 15 of 27
(4,748 Views)

Ok so I have some weird behavior coming out of the ESF when I tried to apply it to my main codebase.  When I launch the application, the Controller defines the config file path and obtains a session handle.  I verified that the handle is being obtained and that the file refnum is good.  When I launch a nested actor and try to obtain a session handle using the same name, a new queue is started.  This I think should not be.

Using the Desktop Execution Trace Toolkit, I DO NOT see the first named queue registering (first screenshot) when the application is launched. 

ESF Queue Issue 1.png

When I launch a nested actor, I DO see the queue registering (second screenshot).  Naturally, this breaks the whole thing. 

ESF Queue Issue 2.png

Any ideas what is causing this?

CLAD
0 Kudos
Message 16 of 27
(4,748 Views)

Ok so I missed that bit.  It did show up in the first image.  Still, the second queue should not have been created.

CLAD
0 Kudos
Message 17 of 27
(4,748 Views)

As long as the queue name and session type are the same, you are correct - there shouldn't be another queue created.  Can you post code?

0 Kudos
Message 18 of 27
(4,748 Views)

I got the same thing to happen in my lighter-weight test project. This is all in LV2014

CLAD
0 Kudos
Message 19 of 27
(4,748 Views)

PS:  The smaller sample project that I just uploaded originally had the Obtain Reference in the actor core of the Config Ctrl.  This setup did not produce the error.  When I moved that into the Read Config File method and put it in the Launcher vi, I recreated the issue I'm seeing in the real code.

CLAD
0 Kudos
Message 20 of 27
(4,748 Views)