-
Posts
2,397 -
Joined
-
Last visited
-
Days Won
66
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by jgcode
-
-
Hello,
I'm trying to build a project programmatically. The "Add Files to Project" example VI is a really good start but I'm trying to take it further. However, I'm struggling! I'd like to add a build specification under "Build Specifications", akin to right-clicking on "Build Specifications" and selecting "New">"Application (EXE)", and configuring it appropriately. The "ProjectItem:AddItem" method seems the way forward, with perhaps "Application (EXE)" (guessing) as the "Type" input, but "Name" and "Path" inputs baffle me somewhat. Has anyone any pointers for me? All I want to do is copy the build spec. from one project to another. Searches have revealed little.
Regards, GGT.
Hi Graeme
I have posted example code here that you may want to look at to add files to a project etc...
For your copying build spec question Cat tried to tackle it here. I had a really quick go to and kept corrupting the xml. I would be interested to know if you get it to go.
Cheers
-JG
-
ok, got it sorted... not sure what I was doing wrong! I dont think it installed correctly, but after manually coping the hook VI it worked ok.
Everything works as expected. Don't know why I expected the Class terminal to be bolded, only the actual inputs.
I made a small mod to your VI, I removed the automatic setting of camelCase in the hook VI, now it uses the Localised Strings as I want it to.
Thanks for posting your code!
Neil
Your welcome.
You should NOT have to do any manual coping!!
The package installed the required files.
I tested it at home last night and work this morning and it seems ok
Would you mind uninstalling/installing to confirm?
Additionally are you able to post how you used the CLSUIP_LocalizedStrings.vi in your code?
I wasn't able to use it as the global variable is accessesed scope as private?
Cheers
-JG
-
You would, because they're not related. I put type cast in bold in my original post to indicate that you should use the type cast primitive, which doesn't do the type checking (similar to the flatten-unflatten trick Felix used), but just reinterpets the data on the wire. As I also said, it was a long shot which didn't pay off.
Ah - ok.
I have never down this before, so are you saying even if you get a type mismatch with the More Specific Class functions you could get access to other hidden private properties using type casting?
If so that is cool.
-
Can you please explain to me why there are two CLSUIP_LocalizedStrings.vi? (one in LVClassLibrary and one in LVClassLibrary\NewAccessors). What is the difference between these two?
Hi Neil
I have made the fix to the package and uploaded it.
Attached is my CLSUIP_LocalizedStrings.vi file if you want to look at it.
[LabVIEW 9.0]
-
Got some time, so here the results.
New VI object: style = string Control 1; vi obj class = String Constant (Decoration.Text does not work).
To type cast the object, instead of to more specific class, I use Flatten To/Unflatten From String (works without errors). Now I have the reference as String Control. If I try to set the Key Focus I get Error 1058 'Specified property not found'.
Felix
Haha! I was playing around with yours too but couldn't get anything to go yet
Thanks for working on this
-
Pfft... I can get a pc any old place. I might want to borrow your brain though--mine appears to be wearing out.
Warning!! Brain will be shutting down over Christmas period...
-
That's what did it. I thought I had installed the update on this computer already... *shrug*
Want to borrow my PC?
-
Propably you can workaround by creating a mouse click on the appropiat location. But this would be heavy coding if you need to interface that via Win API (and not nice plattform independent code).
Do we have some way to directly pass Mouse Events to LV?
Felix
Sounds hardcore for what I want to do
I was actually refering to the string control class (although, as I suspected, the KeyFocus property is not supported). You can highlight the comment using the relevant method, but that won't edit it.
Hi Yair
That is what I meant when I said Control Class - but I get a type mismatch error when I tried to convert the Text Class to a String Class (which makes sense).
The problem is that I cannot get Text.Start-End Selection property to work either.
With Controls I need to put them in Focus first then use the Start-End Selection property otherwise that property doesn't work.
Am I doing this wrong for a BD label?
Cheers
-JG
-
Can you please explain to me why there are two CLSUIP_LocalizedStrings.vi? (one in LVClassLibrary and one in LVClassLibrary\NewAccessors). What is the difference between these two?
Hi Neil
Thanks for the feedback.
I meant to take this VI out of the package as I did not want to distribute NI VIs when I want to submit it for certification.
Therefore use the one under NewAccessors not mine (mine is getting installed in the wrong spot anyway!).
I use the default VI form NI as the hooks automatically change the name to the get/set.
Its a bug that it is still in there.
I will do a fix tonight at home and load a new version with readme.
Cheers
JG
-
I must be a friggin idiot. For the life of me I cannot get the clipboard to grab a copy of the template. I've tried following exactly what you do in the video but it always pastes an empty canvas. Did you secretly put a copy of the banner on your clipboard before you started recording?
Haha nope! No cheating here.
Don't know if that makes a difference - I am running 9.0f2 with the update for IE.
And if it helps, here are the exact steps I do:
- Start on Layers Tab with a Icon Template selected
- Double click the Select Tool to put a marquee around the icon preview
- Hit Ctrl + C for the copy shortcut
- Click in the User Layers control
- Hit Ctrl + V to paste
- The new layer will have the tag Clipboard
It works if User Layers exist of there are no User Layers, with Icon Text or without.
Let me know how you go.
Cheers
-JG
- Start on Layers Tab with a Icon Template selected
-
I'm guessing this won't work, but you could try to type cast the reference to the text control class. If the BD text class has the relevant properties and they're just hidden, this may work, but it's more likely not to work at all (and it even has the potential to cause damage).
Thanks Yair, the Text Reference is the same for the BD and FP, it was the control property I was after, so I don't know if it is possible
-
Howdy!
Does anyone know of a scripting method to give focus to a free label decoration on the block diagram?
I just want to programmatically have the cursor appear at the end of some text in a free label.
We have the Key Focus property for a control, but is there something similar on the BD for text class object?
Cheers
-JG
-
I did not looked at that part of the code, so no I don't know.
But I suspect it used the scripting method to read tag data.
PJM
Cheers
The API only has "image data" as input.
It must know what VI invoked it in order to read the tag data??
-
Hi JG
Yes it's true, the limitation of this solution is than there isn't any memory preallocating and for this reason it's better to use it with small size array.
Yes i know OpenG Conditional Auto Indexing Tunnel , but with it you must before have one booleen array (elements to keep)to filter the array in).
Perhapse it will be interesting that you show us, how you made the same exempl ( even array) with OpenG Conditional Auto Indexing Tunnel .
Certainly my good man.
Attached is an example project that includes benchmarking for building an array:
- From the front
- From the back
- Preallocating memory first, then taking subset
- Using the OpenG array
I get difference performance on single core vs dual core.
Unfortunately this example includes keeping odd numbers I hope that is ok!
[LabVIEW 2009]
- From the front
-
Hi Bob
Cool trick!
(Although in this case you have used a while loop)
I personally prefer OpenG Conditional Auto Indexing Tunnel over preallocating arrays.
All the performance, non of the hassle
Have you seen this VI?
-
You want to post your question here:
http://decibel.ni.com/content/groups/enhanced-icon-editor-2009
Done http://decibel.ni.com/content/thread/5192
But I was just querying the brains here at LAVA first!
As far as I know, the image data does not have layer information but instead the "merged" (flatten) layer data.
It is my understanding the the layer data is stored as tag in the VI file and they are not accessible through the get as image data method.
PJM
Thanks PJM
From all your playing with IE do you know how layers get loaded into the IE?
-
Thanks AQ
-
The class cube seems to be stored as a tag in the .lvclass:
<Property Name="EndevoGOOP_ClassItemIcon" Type="Str">GrayFull</Property>
Where the GrayFull has a corresponding png file in the Framework\Providers\Endevo directory
You can manually edit the .lvclass file and change the tag to some other icon name, and it shows correctly in the lvproj file :-)
(But I have the GDS installed!)
Good find!
I wonder if there is a native tag to point to a glyph?
-
I know I'm late in this topic, but there's a utility in the CR that you can use to ease your pain: LVClass API.
Thanks François, I have downloaded this ages ago but forgot about it. I will revisit it...
-
If I have a VI that has an icon with layers:
And I get it's icon data via the invoke node:
Then call the Icon Editor
I can't see the layers
The API for the Icon Editor seems to be just the image data.
Does anyone know how to:
- Load the layers programatically and invoke the Icon Editor?
- Update only one layer programmatically?
- Load the layers programatically and invoke the Icon Editor?
-
I didn't save it, but it's pretty simple:
Get subset of data starting with many zeros (it is black line) - I had to remove one or two starting zeros to get straight image. Now for 1024 times (32*32) scan for 3 integers and join them with "RGB to Color.vi". You'll get 1024 long U32 array. Reshape it to 32x32 and draw as unflatten pixmap.
But this image doesn't look like icon - it hasn't a border. I think that icon is coded within NI.Lib.Icon tag - there is no NI_IconEditor tag in classes I made in 8.2
Thanks Daklu
Vugie
Are you a genius? I think so!
Thanks I understand what you mean now - great description
That is the banner for the library you have reconstructed.
Here it is:
-
-
-
Howdy
Following along the lines of this topic... does anyone here know how to change the icon of a LVOOP class .ctl or are they able to read the data in a tag in the XML file?
I had a go at this tag: NI_IconEditor in this class
[LabVIEW 2009]
Did this...
And saw a bit of text!
Does anyone know? Or can point me in the right direction?
Cheers
-JG
[CR] Icons
in Code Repository (Certified)
Posted
Tom is talking about releasing some APIs for this really soon - I'm excited.