07-01-2014 10:48 PM
Hi I'm wiring a new app, and I really need to make it flexible (the needs of my customers are changing a lot). Basically I'm using XNET and and I'm putting information into different trees. The thing is that if I want to add another column related to a new property I need to rewrite a lot VIs. Is there any solution to have more generic solution?
See the attachment, cause I'm not really that it makes sense for a lot of people here.
07-02-2014 01:54 AM
07-02-2014 05:00 AM
Well I think my post has been misunderstood. I downgraded the version required for opening the attachment (2010).
Hope this can help to better understand what I want to achieve.
07-02-2014 05:54 AM
07-02-2014 06:09 AM
I know what strictly datatyped means, however I thought they were some tricks to have the property values from a refnum, afaik there is still the Cast function in some cases, the type could also be added to this imaginary function to extract the property I want regarding its name... just like Generic in C# / Java (although not really true for Java)...
Well I'm afraid there is nothing I can do for that... that sad, it would avoid me to refactor a lot wires... Sometimes I think it's pretty limited out of the Prototype Application Design =/
That being said, I'm quite surprised that there is not such function.
07-02-2014 06:51 AM
Maybe your expectations from a programming language are too high. Sometimes you just have to do the legwork.
07-02-2014 11:47 AM
It sounds like maybe you're using the wrong architecture. Trying to pass several related values (value, min, max) through a reference to a front panel control is not a good solution. Can you explain in more detail what you're actually trying to do?
You might consider an OOP solution, where you pass objects around. Then you can have a method in the object that returns a list of all the available properties, and a way to retrieve them however you want. As the data expands you can simply add a new object an override a few methods.
07-02-2014 07:17 PM
I was more thinking about a language feature, of course I could go with a OOP but it does not solve this bottom line issue.
In C# I could use reflection to inspect the property/ies and to get the value of a certain property accordingly to its name, or just by going through a collection, whether it's refering to Type or a Instance.
I think once again it has been misunderstood... I will provide another example to highlight even more my problem.
07-03-2014 01:15 AM
Here is another sample...
I think that in this situation it's pretty obvious that if I want to change the property that I want to display it requires to hardcode a lot of things for example I cannot make a list of booleans and select which column to display. Or I need to provide to save first all the columns and use conditions tricks but that means it requires to check alllllll the properties in a very first place =/
07-03-2014 01:59 AM - edited 07-03-2014 02:00 AM