07-05-2018 07:20 AM
I have quite a big typdef, with many clusters in it, all of them in the standard "modern" style. I want to change these to "UI Control Suite: System Controls 2.0"-Elements, because they look way nicer in the frontpanel. But when I do this change by rightclick -> replace I simply get an empty cluster! I have to put all elements back in manually! Is this some sort of bug? Or am I doing something wrong?
Solved! Go to Solution.
07-05-2018 07:37 AM
Hi jucasa,
what do you expect when you replace an existing cluster with an empty cluster?
Suggestion: place the new cluster next to the existing one, then drag'n drop the cluster elements from old to new cluster.
Suggestion 2: IMHO those "big typedef's with many clusters" most often look ugly on an UI, regardless of the control style used. Much better UX can be created with a dedicated UI handling user input and storing the data in your typedef'd cluster - without showing that part to the user…
07-05-2018 07:40 AM
I believe that is by "design". When you create an empty Control on the Front Panel, you choose the Style of the Control, which becomes a part of the Control's definition. According to my understanding, the only time you set the Control's style is when you create it. So the only way to "change Styles" is to do the following steps:
I know this is a lot of steps, but with a little foresight, you won't need to "change the Style of your Controls" very often.
Bob Schor
07-05-2018 08:15 AM - edited 07-05-2018 08:16 AM
Ah, I see. Ok, it won't take that long, but I figured "replace" would keep the input of the cluster as it is.
Why do you suggest to rename the file? Can't I just create the new cluster, copy the elements over and delete the old cluster? Or could something go wrong that way?
@ GerdW
You are right, the big cluster is never shown to the user but is only for saving parameters in the background in a shiftregister. But because I want to place parts of the big cluster here and there on the frontpanel in different tabs I want them to be already in the correct design so I won't have to bother about that anymore 😉
Best regards
07-05-2018 08:31 AM
@jusaca wrote:
Why do you suggest to rename the file? Can't I just create the new cluster, copy the elements over and delete the old cluster? Or could something go wrong that way?
Not only can something go wrong that way, but (sooner or later) something will go wrong (I know -- I've made all of these mistakes more than once!). It is both Better (in some ways) and Worse (in others) if you are using LabVIEW Project (which I highly recommend!), as Project has its own "memory" of names and their current status. The "catch" is you can't have two LabVIEW "Things" with the same name in memory at the same time. You'll notice that I take care to do the Rename/Replace operation when LabVIEW is not running -- also from sad experience.
Bob Schor
07-05-2018 09:36 AM
If you're not doing it already, it might be a good idea to make each cluster a type-def. Then it should be easy enough to Place the new empty cluster besides the old one, drag all the Controls over, delete the old (now empty) cluster and save the type-def.
/Y
07-05-2018 10:19 AM - edited 07-05-2018 10:26 AM
@Bob_Schor wrote:
I believe that is by "design". When you create an empty Control on the Front Panel, you choose the Style of the Control, which becomes a part of the Control's definition. According to my understanding, the only time you set the Control's style is when you create it. So the only way to "change Styles" is to do the following steps:
- Create a new (blank) Control in the Style you wish to use. It is probably a Good Idea to have the original Control available on the "defining" Front Panel.
- Set up your new Control's size, colors, decorations, etc., using the original Control as reference.
- If your Control is an Array, copy the Array Element from the Old Control to the New Control.
- If your Control is a Cluster, copy the Cluster Elements, in order, from the Old to the New Control.
- Show or Hide Control elements as desired.
- Save the new Control with a new, unique name (I recommend something like New <Old Control Name>.
- Now, exit the Project and (for safety) stop LabVIEW.
- Rename (or if you feel confident, Delete) the Old Control.
- Rename the New Control to the name of the Old Control (e.g. delete "New ").
- Reopen LabVIEW and the Project. If LabVIEW complains it cannot find "New <Old Control Name>", simply choose "Remove from Project".
I know this is a lot of steps, but with a little foresight, you won't need to "change the Style of your Controls" very often.
Bob Schor
I usually just open the original typedef'd cluster, create the equivalent cluster with equivalent controls, temporarily breaking the control, renaming all the stuff new stuff to the old stuff, then deleting the old stuff. Apply the changes. You're done. If your original typedef'd cluster contains typedf'd controls, you'll have to drill all the way down the the elemental typedefs and start the process from there first. By the time you fix all the elemental typedefs, your original typedef'd cluster will contain all the new controls. This simplifies things at the top level because then all you need to do is create a cluster in the new style and move all the controls from the original cluster to the new one and delete the old one.
Does that make sense?
Edit:
I didn't read your response to the OPs question about doing a similar thing. In my experience, as long as I updated the typedef, it always seemed to work.
Since you had a different experience, maybe I was just lucky enough for it not to bite me.
Edit 2:
Typedf's have become much more robust since the early days (I want to say pre-2010); maybe your experiences were with older versions of LV?
07-05-2018 02:53 PM - edited 07-05-2018 02:54 PM
@billko wrote:
@Bob_SchorI usually just open the original typedef'd cluster, create the equivalent cluster with equivalent controls, temporarily breaking the control, renaming all the stuff new stuff to the old stuff, then deleting the old stuff. Apply the changes. You're done. .
Edit 2:
Typedf's have become much more robust since the early days (I want to say pre-2010); maybe your experiences were with older versions of LV?
I used to use the latest version of LabVIEW, but when LabVIEW 2017 fried two of my PCs, I've stopped at LabVIEW 2016 (I now have LabVIEW 2017 and 2018 installed safely on VMs, all by themselves ...).
One reason I was so careful/cautious is because of LabVIEW Project, which I always use for anything other than a simple "one-off" demo or code test routine. Depending where/how you "rename" and/or "delete", Project can get really screwed up (as it maintains its own idea of what VIs you are using "in your Project" and where they are located, and will whine if it doesn't find them ...).
Bob Schor
07-05-2018 04:48 PM
@Bob_Schor wrote:
@billko wrote:
@Bob_SchorI usually just open the original typedef'd cluster, create the equivalent cluster with equivalent controls, temporarily breaking the control, renaming all the stuff new stuff to the old stuff, then deleting the old stuff. Apply the changes. You're done. .
Edit 2:
Typedf's have become much more robust since the early days (I want to say pre-2010); maybe your experiences were with older versions of LV?
I used to use the latest version of LabVIEW, but when LabVIEW 2017 fried two of my PCs, I've stopped at LabVIEW 2016 (I now have LabVIEW 2017 and 2018 installed safely on VMs, all by themselves ...).
One reason I was so careful/cautious is because of LabVIEW Project, which I always use for anything other than a simple "one-off" demo or code test routine. Depending where/how you "rename" and/or "delete", Project can get really screwed up (as it maintains its own idea of what VIs you are using "in your Project" and where they are located, and will whine if it doesn't find them ...).
Bob Schor
Oh, man - I think I have PTSD from dealing with the issue highlighted above. Then throw in SVN renaming if you really want to self-flagellate.