07-09-2014 01:52 PM
I'm an old hand at LabVIEW in general, and using Object Pascal, C++, etc (other object-oriented languages), but I'm trying to use LabVIEW objects and not having any luck.
I understand the trivial examples, about graphical shapes, and such, but I see no example making a real use of them.
Consider this:
I have a SCALER, which is a cluster of {A,B,C,D,E,FullScale, all numbers}. I'm thinking of making that a class, so I do that.
I have a CHANNEL, which has a NAME, an ACTIVE switch, and a SCALER.
If I put the SCALER.lvclass into the private data for CHANNEL, then I get a icon of a box. It's pretty and all, but not useful for a user interface.
If I put the SCALER.ctl into the private data for CHANNEL, then I get the cluster I want to see. But it's not an object. If I want to use the SCALER object methods on this data, the I have to create an object and set it to this value, don't I?
That's hardly a sensible approach.
I have a MODULE, which has a MODULE TYPE, some module-level stuff, and an array of CHANNELs.
Now, for reasons I don't understand, If I put a CHANNEL.ctl -OR- a CHANNEL.lvclass into the array in MODULE's private data, I get an array of the box icons. That's hardly useful for UI.
Are LabVIEW objects just not suitable for UI purposes like this?
Or is there something else I've missed?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-09-2014 02:13 PM
Not sure if this will help, but I just started playing with XControls. That may be what you are looking for.
07-09-2014 02:24 PM
<shameless_selfpromotion>
If you aren't doing anything special Tuesday of NI week from 4:45 to 5:45, I have a recommendation...
<\shameless_selfpromotion>
Mike...
07-09-2014 04:11 PM
@mikeporter wrote:
<shameless_selfpromotion>
If you aren't doing anything special Tuesday of NI week from 4:45 to 5:45, I have a recommendation...
<\shameless_selfpromotion>
Mike...
Will the presentation be available for download later?
07-09-2014 04:27 PM
07-09-2014 06:43 PM
07-10-2014 12:49 AM - edited 07-10-2014 12:54 AM
07-10-2014 08:41 AM
Hmmm... Where to start...
"...the initial reasons for xcontrols was to allow the programmer to create a visual representation of a class."
Really? I have never heard that --- and it certainly isn't in any of NI's description of XControls. XControls are for creating user interfaces, plain and simple. Of course using them as a way of providing class-specific interfaces, while I have never seen it done, is a neat idea.
"...LabVIEW so tightly couples UI elements to datatypes that we become blinded to the separation of the two."
What are you talking about? This doesn't make any sense on its face. A strip chart to the user is a graph with all kinds of controls and properties. To the code it is a scalar numeric indicator. Or you are saying that I should be able to wire anything up to a strip chart and let LV decide what I want? No thank you! We already have the dynamic data type and it causes problems enough.
"...it is pretty much impossible to actually implement MVC in LabVIEW."
Again, what in the world are you tralking about? MVC is a technique of understanding and defining the relationships between the various aspects of your application. A technique, by thte way, that is language independent. I first ran into the terminology in the discussion of website. Let me guess, you are one of those people that think LV wasn't object-oriented before LVOOP was introduced, right?
"Using purely LabVIEW your view is always coupled to procedural code."
Well, duh... The point of the View (the V part of MVC) is to "request information from the model that it uses to generate an output representation to the user". Now how is it to do that without procedural code? Without code how do you formulate or send a request? How do you process the response to that request? How do you generate an output representation?
Mike...
07-10-2014 09:26 AM
@GregFreeman wrote:
It is one of the reasons why it is pretty much impossible to actually implement MVC in LabVIEW.
Greg obviously wan't at the CLA summit a few years ago where all we did was talk about Model-View-Controller. We had some interesting solutions, including Queues, Events, and Actor Framework.
07-10-2014 09:28 AM
If you aren't doing anything special Tuesday of NI week from 4:45 to 5:45, I have a recommendation...
So, rather than offering an idea, you're pimping for your conference presentation in a couple of weeks?
OK, thanks.
Blog for (mostly LabVIEW) programmers: Tips And Tricks