LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 

Allow editing of map and set constants

Status: New

Similar to how array and cluster constants on the block diagram can be edited, it would be useful to be able to edit map and set constants on the block diagram.

 

For example:

tannells_0-1581381337525.png

In the map constant above, the developer can scroll through and see all of the key value pairs in the map (plus an empty element at the end of the map).

 

It would be useful to also be able to edit the key-value pairs in the map (and add more key-value pairs to the map by changing the empty element at the end of the map).

16 Comments
AristosQueue (NI)
NI Employee (retired)

Over the weekend, I built a prototype editor for sets. Works in LV 2019 (or 2020 for those of you in the beta program):

https://forums.ni.com/t5/LabVIEW-Shortcut-Menu-Plug-Ins/Edit-A-Set-Value-llb/ta-p/4020190

The UI is not good, but it works. I worked out the tricks of getting the type updated right so the plugin can work on any set data type. If someone wants to polish it to be a good UI, please, take a whack at it.

 

The procedure for making a map editor would be similar.

CaseyM
Active Participant

What about a floating button (✓ - Apply) that appears when you're editing a set/map constant (on the BD)? If you click outside of the constant (the whole thing) it discards. If you click the button, that's when changes are applied.

CLA CLED AF Guild
OneOfTheDans
Active Participant

I like Casey's idea. An explicit X to discard might be better than implicitly when the user clicks out, in case someone's copy/pasting multiple values. Both buttons appear at the top-right of a BD map/set constant when you start editing it. If it's still in edit mode when the user runs the VI, probably automatically apply the changes (it's easier to revert or Ctrl+Z than to re-enter a large map constant).

CaseyM
Active Participant

FYI, in the meantime, we added "Convert Array to Map/Set" VIMs to the Collection Extensions VIP as a workaround. Just edit your map/set as an array first and then use those VIMs to easily convert to the desired collection type.

CLA CLED AF Guild
OneOfTheDans
Active Participant

That's a convenient workaround and those extensions look useful, thanks for sharing!

Albert.Geven
Trusted Enthusiast

The easiest to build is a delete element from map constant, but editing an array of constants that build a map constant is almost as much work as writing a create map control and change that into a constant, So maybe a bit later.

greetings from the Netherlands