LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
EngrStudent

remember Object formatting in diagram cleanup

Status: New

Background:

 

I have a single pane that I was using to debug a state machine.  It is not clever at all, but it is useful.

Capture.PNG

I viewer of the Snip might not see what I did here, but I used the "Align Objects >> Left Edges" tool and the "Distribut Objects >> Vertical Compress" tool to get all the text tags and the order of the components to be "human readable".

 

fztvpepa479127866874303765.jpg

nrlsubih1015103514127206467.jpg

 

A human doesn't know that but the software should. 

 

When I hit "cleanup" I get this:

Capture.PNG

 

From this image you can observe that "fast, human readability" is lost.  I can hunt, but its not a simple up-down. 

 

I think that the "cleanup" should recognize the formmating, and retain it in this case.  It should do this by default.  The entire paradigm of LabVIEW is visual programming.  The diagram cleanup tool, in this particular case, has room for improvement there. 

10 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

Room for improvement!

Priceless...

Actually, it is apparently not even NI's fault.

They use someone else's algorithm.

EngrStudent
Active Participant

They already allow you to "lock" the layout on the Front Panel.  This wouldn't be "new code" in that sense.

 

Even if they (badly) use someone elses algorithm, this is a feature they already have implemented elsewhere in the tool.

X.
Trusted Enthusiast
Trusted Enthusiast

Locking, grouping on the BD has already been suggested. Do a search.

tst
Knight of NI Knight of NI
Knight of NI

I agree that there's a lot of room for improvement in the results of the cleanup tool, but I'm not sure how practical it is to automatically identify the "clean" parts and maintain their layout. I certainly don't think I would want NI spending a lot of time on it.

 

In your specific example, because you used a structure (why?), you can right click it and mark it to be excluded from the cleanup, which will give you what you want.

 

Also in the case of your specific example, I would have expected both you and the cleanup tool to move the labels to the left of the constants and then align and compress the constants together, as that would make it much more readable, but at least in the case of the cleanup tool, I have learned not to let that expectation set my actual level of expectation 😉 .


___________________
Try to take over the world!
EngrStudent
Active Participant

>> because you used a structure (why?

 

because it imposes a visual grammar on the visual programming language that is not obliterated on clean-up.  It is really clever.  Literate programming should apply to LabVIEW too.  Donald Knuth rocks.

 

>> I would have expected both you and the cleanup tool to move the labels to the left of the constants and then align and compress the constants together

 

why isn't this default?  The "best practices" should always be default.  Every roll of software they have to set defaults, why would they start with anything less than the best?

Intaris
Proven Zealot

Because the best is different depending on who you ask.

 

This is a major problem with "human readable".  It depends on humans who, im my experience, are fickle things.

 

And yes, of course Donald Knuth rocks.  That's as close as you can get to a tautology in computer science without risking compiler optimisations removing your opinion.

EngrStudent
Active Participant

@Intaris - well said.  Humans are obstreperious, truculent, supercillious and all the rest.

 

Good thing the language itself, like the statistical mean, evens out when observed over a vat of them.  Like drunkards they all walk their own random route, but like paired drunkards walks, they orbit the mean, and the more they are the more closely the orbit.

 

Literate programming:

http://www.literateprogramming.com/

http://www.literateprogramming.com/knuthweb.pdf

 

Drunkards walk:

http://mathworld.wolfram.com/RandomWalk2-Dimensional.html

 

 

Mr._Bob
Member
I agree that the block diagram tool needs a lot of improvements. I have seen it stretch out a while loop to a mile long for no reason at all. Then if you select only the while loop for cleanup, it makes it as small as you could ever imagine. I've also seen constants placed 6 inches away from SubVI's. I would rather wait 2 minutes for a "really good" cleanup. If you incorporate a tool like that as a feature, it should mimic the old world of aligning things by hand as best as possible. It does however, do a great job on SubVI's. But the original example where it factors in the label positions as part of the equation, does not look like the smartest thing to do. Bob
EngrStudent
Active Participant

@Bob,

 

My point was not about label positions as much as vertical alignment consistency of constant vs. array input, and readability of the controls.

  • The top row should be the top row, no matter where the label is. 
  • If I align left, then it should not make it generally justified.

 

AristosQueue (NI)
NI Employee (retired)

> I agree that there's a lot of room for improvement in the results of the cleanup tool

 

Me too. It improves in small ways every release. A long way to go to an aesthetic ideal, but it ooches.

 

> Because the best is different depending on who you ask.

 

I think LV will be able to define "the best for everyone" graphical layout within 1 year of all C/C#/C++/JAVA programmers agreeing on

  • tabs or spaces?
  • 2, 3, 4 or 7 spaces?
  • open brace on same line or its own line?
  • whitespace around operators?

🙂