LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OOP usage in UI

What you'll need is a UI control which shows the interesting information from the Class, this is the same as in C or any other language. So what's the question?

 

The basic question is "Is my conclusion that LVClasses are for data handling only, and useless for UI work, incorrect?".

 

If I have to pick out the stuff from the class and place it into another structure for screen editing, and then reverse that when saving, then that nullifies some of the data handling advantages that OOP might offer.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 11 of 19
(695 Views)

But the whole idea of class data is that it is private. You can create accessor VIs to work with the class data, but the UI shouldn't be tightly coupled to your internal data -- whether in a class or not.

 

In fact, the whole point of modularity is to decouple the operation of one part of the code from the details of the operation of another part of the code. Why should your UI be tied to a particular data representation? That was part of the point I made in an earlier post. A strip chart at the data level is a scalar numeric, but at the UI level it's a graph with a lot of different interface features. (Although this idea can be taken too far through over-generalization.)

 

Mike...

 

PS: Want an idea, how about this one: You're thinking in the wrong language. Stop thinking in Object Pascal, C++ or whatever, and trying to translate into LV. It doesn't work because LV is a fundamentally different kind of computer language.


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 12 of 19
(683 Views)

You're thinking in the wrong language. Stop thinking in Object Pascal, C++ or whatever, and trying to translate into LV. It doesn't work because LV is a fundamentally different kind of computer language.

 

OK, that's something I can use.  I'm well aware that LV is fundamentally different, which is why I was thinking that maybe the UI connection was built into objects.  It looks like there is no such connection.

Thanks.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 13 of 19
(680 Views)

Just as an addition: Although clusters can be used in user interface panels for presenting data, I never do this. Plopping an ugly cluster onto my front panel is a hideous solution to creating data access points in my UI. I find that my user interfaces always require specific additional code to pull out the important information and present that in a unique way. Extra work? Sure, but it's always worth it / necessary.

 

I can see your frustration that LabVIEW classes don't allow UI visibility, but I personally wouldn't want that for the same reason I don't for clusters.

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 14 of 19
(674 Views)

Wow, Mike, kind of confrontational. I will respond when I have a chance, but I would like to point people to how web development works as a reference for more flexible separation of concerns.

 

With regards to X controls, I read that on LAVA sowewhere. There definitely are plenty of discussions about using X Controls as the visual representation of a class, but as for my exact comment I can't find the thread right now. I think AQ said it over there at one point.

 

And of course LabVIEW was OO, it just wasn't LVOOP. Look at VI server (or any API for that matter).

 

Actually, while writing this, I decided I am not going to bother responding in depth because it will just go downhill fast if that is the type of discussion we will be having. I'm all for standing behind your opinion, but man, take a breath.

0 Kudos
Message 15 of 19
(671 Views)

Although clusters can be used in user interface panels for presenting data, I never do this. Plopping an ugly cluster onto my front panel is a hideous solution to creating data access points in my UI.

 

 

Hmmm.  I have a different approach, which is perhaps why the question came up for me.  I don't put ugly clusters onto my panels - I pretty them up and make them part of the UI.  Sometimes they carry around related but not user-interactive stuff- those get stashed outside the borders.

 

I was just wondering if there was a similar possibility for Classes, but apparently not.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 16 of 19
(664 Views)

@CoastalMaineBird wrote:

Although clusters can be used in user interface panels for presenting data, I never do this. Plopping an ugly cluster onto my front panel is a hideous solution to creating data access points in my UI.

 

 

Hmmm.  I have a different approach, which is perhaps why the question came up for me.  I don't put ugly clusters onto my panels - I pretty them up and make them part of the UI.  Sometimes they carry around related but not user-interactive stuff- those get stashed outside the borders.

 

I was just wondering if there was a similar possibility for Classes, but apparently not.


I can appreciate that approach, but I find that prettied up clusters (including graphics etc.) use more memory. Consequently, all my subVIs that use the same cluster datatype are inflated in size. Multiply this over hundreds of subVIs and you have an avoidable problem.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 17 of 19
(627 Views)

@Thoric wrote:

@CoastalMaineBird wrote:

Although clusters can be used in user interface panels for presenting data, I never do this. Plopping an ugly cluster onto my front panel is a hideous solution to creating data access points in my UI.

 

 

Hmmm.  I have a different approach, which is perhaps why the question came up for me.  I don't put ugly clusters onto my panels - I pretty them up and make them part of the UI.  Sometimes they carry around related but not user-interactive stuff- those get stashed outside the borders.

 

I was just wondering if there was a similar possibility for Classes, but apparently not.


I can appreciate that approach, but I find that prettied up clusters (including graphics etc.) use more memory. Consequently, all my subVIs that use the same cluster datatype are inflated in size. Multiply this over hundreds of subVIs and you have an avoidable problem.


Only if you use a Strict Type Defined Cluster.  If you use a normal Type Defined, then you just have to pretty up the main GUI cluster.  However, you do have the issue where your "prettiness" will magically disappear as soon as you change your cluster and you will have to rework it.

 

Such are the games we must play as engineers...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 18 of 19
(622 Views)

I find that prettied up clusters (including graphics etc.) use more memory.

 

I've never worried about that, because my definition of "pretty" doesn't include graphics.  I'm talking about extra care with alignment, transparent borders, fonts, etc.

Occasionally, I'll make the cluster transparent and put a graphic behind it on the main panel - then the subVIs don't carry it around.  But that's rare.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 19 of 19
(608 Views)