LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Periodic Table of Elements

Solved!
Go to solution

DanNatCorning wrote:
Ben, I added the Mouse Down? event to the event structure, then unbundled the PlatMods to get the Ctrl item.  I then used a local variable of the indicator as an input to a Boolen Property/Boolean Text/Font/Bold that I placed between the TO More Specific Class and the Boolean LAbel Text.  The LED lights to tell me I've held down the ctrl key when I selected an element, but it does not format that font as bold. I readily confess my ignorance and beg your indulgence 🙂

 

 

 

1) If you watch your code in execution highlighting mode (light bulb on) what value (true or Flase) is being passed to the Boolean text Font Bold node?

 

2) Is there an erro being returned by that property node?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 31 of 43
(1,330 Views)
Ben, a true is being passed in wnenever the ctrl key is pressed, and no error is being generated
0 Kudos
Message 32 of 43
(1,323 Views)

Are you sure you have text on the Boolean text (not the label but the text for the sate, see the stop Button for example).

 

Try the property "Label.FontBold".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 33 of 43
(1,312 Views)
Ben, interesting observation:  If I probe the input and output to/from the Boolean Text/Font/Bold Property Node function, I notice that whatever the first element is for which I press the ctrl key, that element keeps showing up in these probes, no matter which element I select after that.
0 Kudos
Message 34 of 43
(1,310 Views)
Ben, as I had it configured, I was actually bolding the button labels. What I want to bold is the text in the array I build, so that I have text bolded whenever I hold the ctrl key while clicking on an element, and unbolded whenever I just click on the element key.  Still trying to figure out where to tie in the output from the Platmods cluster...
0 Kudos
Message 35 of 43
(1,309 Views)

Font is a property of the element.

 

All elements in an array can differ only in thier value and must share all properties. So you can not have mixed fonts in an array. You can do that with a table but that is a story for another thread.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 36 of 43
(1,294 Views)

DanNatCorning wrote:
SiegeX, your solution posted in number 14 worked absolutely perfectly.  It's simpler and works better than other solutions suggested by coworkers.  Thanks to all of you for all of your feedback.  Programmers here at work who've not yet seen the LabVIEW light were amazed by the number of responses I got in such a short period of time.  It proves again that the LabVIEW community is the best in programming! 

Dan,


I'm glad you liked my solution in #14 but there is actually a better (read more efficient and flexible) way to do this which I attached the VI for on post #18, I also reposted the screencapture for it on post#20 that hopefully you can see. 

 

Regarding differentiating between two different types of elements (analyte and matrix), I agree with you that trying to reuse the same Periodic Table is the optimal solution.  Ben informed us of the "PlatsMod" cluster that tells us if CTRL is held down or not.  However, this cluster is only returned on a Mouse event, not a value change which we are currently using.  However, with a bit of thought I realized that a Mouse Up/Down event on a boolean control is the same as a value change, so we can just change our event handler to use Mouse Up and get the same functionality with the added bonus of the PlatsMod cluster. (I decided to use MouseUP as that is just after the value is changed.)  So now we can determine whether or not CTRL is pressed down when we select an Element, but the question is now "how do we save this status?"  We must save it somewhere because each time you press a control, the array will be recreated and the CTRL status will be lost for all but the most recently pressed control.  My solution for this is a bit unorthodox and that is to use the Caption field as a memory element for each control; I don't think NI imagined it to be used this way but it works nonetheless!  Now instead of an array of Label Text, we will have an Array of Clusters and each cluster will contain the Label Text and whether or not it is of type Analyte or of type Matrix.   

 

The only issue I ran into is that LabVIEW will error on changing the Caption text unless the Caption text has already been created.  What this means to you is that you must right click on each boolean control and make the Caption text Visible then immediatley make it invisible again; doing so will create "space" for the caption text.  If anybody can think of a better way to do this or perhaps a better memory container for the controls please help us out!  

 

Also, as you can see the OpenG VI that conditionally auto-indexes and array cannot handle array of clusters and typecasts it to an array of varients that I later have to "un-varientize" to get back our Array of Clusters.  Perhaps Jim can add this functionality in the future  Smiley Wink

 

Message Edited by SiegeX on 11-25-2008 03:41 PM

Download All
0 Kudos
Message 37 of 43
(1,280 Views)

Hello all.  Well I've spent the better part of the afternoon (when I was not tied up in annoying meetings) working on this issue and I think I've decided to revert back to my original idea for seperating out the Analyte elements from the Matrix elements.  I have two identical Periodic tables, one on each tab.  I'll select the Analytes and then tab over and select the Matrix elements.  The chemist I'm working with actually prefers this approach. The only issue I still have to resolve is how to disable the element buttons on one tab for all of the elements that are selected on the other tab, since an element cannot be both an analyte and a matrix element.  I've tried wiring a local variable of the Indices of Elements from the Opan G Search Array from one periodic table to the Disable property node of the other table's cluster, but that obviously doesn't work, since the Disable property node applies to the entire cluster, rather than to individual elements.  Any suggestions on how I can disable selected elements within a cluster.  I've been all over the discussion board and LabVIEW help - no luck so far

 

Message Edited by DanNatCorning on 11-25-2008 05:01 PM
0 Kudos
Message 38 of 43
(1,270 Views)

DanNatCorning wrote:

Hello all.  Well I've spent the better part of the afternoon (when I was not tied up in annoying meetings) working on this issue and I think I've decided to revert back to my original idea for seperating out the Analyte elements from the Matrix elements.  I have two identical Periodic tables, one on each tab.  I'll select the Analytes and then tab over and select the Matrix elements.  The chemist I'm working with actually prefers this approach.


 

Aww too bad, I was looking forward to seeing my unorthodox approach in use Smiley Tongue

 

Anyway back to your new problem at hand.  Since we now have two seperate (but identical) clusters, we can have one cluster's values disable the others based upon the TRUE/FALSE value of the current cluster.  Note that I am still using the other method of Registering for Dynamic Events, but its worthwhile doing so as you can begin to see how flexible it is.   Load up the attached VI and I'll think you'll see this does what you are looking for.  Note that I assumed you wanted the disabled controls to be greyed out, if this is not the case you can just change the '2' to a '1' in the select vi.

Message Edited by SiegeX on 11-25-2008 06:45 PM

Download All
0 Kudos
Message 39 of 43
(1,253 Views)

So apparently using the Disabled property of the *clusters* didn't do what I intended which was to reset all the boolean controls back to enabled.  Looks like you'll have to run the control ref arrays through a for-loop and iterate over each boolean to set them back to their Enabled State.  Here is a picture of what I mean, the only thing I changed was the stuff on the left side of the while/event loops, nothing inside the loops changed.

 

 

Message Edited by SiegeX on 11-25-2008 07:15 PM

0 Kudos
Message 40 of 43
(1,243 Views)