From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

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

Optional (and easily-dismissable) prompt to change newly-dropped case structure frame to FALSE

Status: New

(Note that this idea has already been proposed and auto-declined. So I'm trying again, this time with a different UX, and pictures!)

 

I've got some code on my diagram:
1.png

 

I need to wrap the code in a case structure, so I do:
2.png

 

Then I connect a Boolean wire to the selector terminal and go on my merry wiring way. Unfortunately, I forgot to consider the fact that I need this code to run in the FALSE case, not the TRUE case. But since nothing is broken in my code, I don't realize my mistake until I start running things. I've made this mistake so many times over the years (the most recent being tonight), that I've decided to propose a solution.

 

There are plenty of times that I want the wrapped code to be in the TRUE case. There are also plenty of times I want the wrapped code to be in the FALSE case. With no obvious default that makes sense most of the time, here's what I propose:

 

If you interactively drop a case structure by dragging a rectangle around *existing* code, we float a button over where you let go of the mouse and give you a chance to make the visible frame the FALSE case instead of the TRUE case:

3.png

(I suck at Microsoft Paint, I'm sure somebody can come up with a better looking button or glyph)

 

If you click that button, then the case structure turns to the FALSE case. If you do *anything else*, the button goes away and the case stays TRUE.

 

With this proposed change, any time I wrap existing diagram code with a case structure, I'll be forced to think about whether the case needs to be TRUE or FALSE. And I'm given an easy out if it's supposed to be the TRUE case.

6 Comments
Taggart
Trusted Enthusiast

I like it! 

I have also made that mistake many times.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
wiebe@CARYA
Knight of NI

When will the floating button disappear? Obviously after a click, but would it stay there after a save?

 

EDIT: It disappears when you do "anything else"... Not sure I like that.

 

I wouldn't mind a way to acknowledge that you want it 'as is'. That way, it can stay there until you either "make case false" or "accept true case". If you don't change it or acknowledge it, it will stay there until you decide.

ncm
Member
Member

I have done this too many times!!  And definitely one of the harder things to troubleshoot, as you mentioned.  I like your idea of a quick reminder that will pop up to help ensure we check which case we want.  Reminds me of using the 'Time Delay' function that automatically pops up and allows you to enter another time besides the default 1 second.  I think it wouldn't take much time for the user to click which option and would greatly decrease troubleshooting time.

-ncm
Gregory
Trusted Enthusiast

That's an interesting idea! This would be the first "floating button" on the block diagram, correct?

Another option could be to hold down ctrl while clicking on the Case Selector.

Zafer.Depe
Active Participant

What about to colorize false and true cases like error case?

Hooovahh
Proven Zealot

I do make this mistake from time to time, but not all that often.  I try to remember to make sure the case is the first thing I configure after dropping a new one.  But honestly I like the subtle reminder of a button just after dropping the case to be like "Hey this is true by the way, click this little button real quick if that isn't what you wanted".  And then I'd prefer it goes away if you interact with something else or on a timer.