Jump to content

hooovahh

Moderators
  • Posts

    3,365
  • Joined

  • Last visited

  • Days Won

    268

Posts posted by hooovahh

  1. Nice. It's too bad there doesn't seem to be enough events exposed to stay away from polling, but I'd take working over not any day :)

    Well if we wanted to get tricky I think it could be hidden a little more.  We could use the Windows Message Queue library.  You could register for mouse movement, and then use that to fire user events.  I don't know if you can register for a message that isn't tied to a HWnd, so now that I'm thinking about it I don't know if that would work.

     

    But even so I don't think it's that big of a deal.  Sure you are polling but only while the object is being dropped.  So this will likely happen relatively quickly.

  2. If you are having problems installing VIPM you may want to contact JKI or post on their forums here.

     

    As for alternative ways to install package files.  The packages them selves are just zips, so you can extract the file and see the contents.  The spec file defines things about the package, and the files and groups.  Using this information you can manually install the files by placing them in the right locations.  It wouldn't be too much trouble to make a VI that does this.

     

    HOWEVER, this will go against what JKI has been trying to do with VIPM having configuration management.  Lets say you manually install a bunch of packages.  You have no way of knowing what conflicts, or limitations exist and you may end up with code that is broken, or missing components.  You also don't know what versions of what packages you have already manually installed, and you may overwrite VIs with newer, or older versions of them selves.  VIPM helps to know the dependencies, and links requires, as well as the limitations, and environments that those VIs can be used in.

  3. I'm not able to capture this as Double Click. Instead I register a single Left Click, no matter how quickly the double click is done.  Does anyone have a working example of this actually working?

    The example code posted by Ton works just fine.  After adding it to a VI you will need to re-link the event to the pane but both the "Mouse Down?" and "Mouse Down" work just fine for stopping the VI only after a double click.

  4. Okay so I promise I haven't been working on this since November, but I did come up with a solution that uses pure LabVIEW (mostly) and doesn't rely on ActiveX, .Net, or HTML.

     

    It is very rough around the edges.  There is little error handling, there is at least one default subVI Icon, and I'm pretty sure there are some unclosed references.  But in any case, extract the zip and run Main Parent.  It will call a dynamic number of Children, each one being an item in the grid.  They are then put into the Parent using some Windows DLLs.  Then when there is a mouse down we can fire the event and determine what one was clicked.  It still supports captions, mouse over, and disabling items.  It also now supports resizing without the odd clicking sound.  The images look much more crappy because of how LabVIEW loads and then zooms the images.

     

    You can also change the number of items while it is running.  For me it took about 700ms to load 8 images but I do have 8 logical CPU cores.  Alot of the Parent/Children code was taken from the DynaPanels found here.

    Native Test.zip

  5. Scripting is your friend.  With it you can automate code development.  So given a folder of VIs, open a reference to them, then create a new object (text) set its value, place it and save the VI then move on to the next.  Here are a few links.

     

    http://sine.ni.com/nips/cds/view/p/lang/en/nid/209110

    http://sine.ni.com/nips/cds/view/p/lang/en/nid/209110

     

    Note that scripting is free and is enabled using the Tools >> Options menu in LabVIEW 2011 and newer.

  6. So I did some testing with Arrays of numerics and seeing how close together they are. I found that the array of numerics are the same size, if you are using a System Array, Classic Array, or Modern Array controls. The Silver Array takes up more space, which didn't surprise me.

    I couldn't find anything about smaller arrays, but in my searching I did find this post about small clusters.

    The "TopLeftBorderOnlyCluster" is the smallest cluster I've found, but it has the down side of only being able to click it on the left or top edge. The right and bottom edge appear to really be 0px in size and unclickable.

    • Like 1
  7. I was told (possibly incorrectly) that both BSD and LGPL were very close. The explanation given was you can use it in commercial applications, and you can modify it, but the author must be attributed. I was not aware that LGPL was the one less recommended.

    My knowledge on licensing is limited so please someone correct me if I am misinformed.

  8. What do you think is the best way to help users? In a recent thread I helped a user with a basic data transport / manipulation problem. My reaction to her problem was to show her how to solve the problem with a better way to program so that her application would be faster and more flexible in the future. I didn't rearchitect anything, just made a suggestion for a small change.

    Then rolfk came along and described a much simpler way to fix her problem. He acknowledged there were some potential problems in the design, but solved it quickly (i.e. with a simple cast) of helping?

    To be fair I'm guessing rolfk was just suggesting another path. If you would have opened with the simple solution he may have replied with the "better way to program" answer.

    You see this alot on the forums (and I do it myself). Someone will ask a question and an answer will have already been posted, but there are usually multiple ways to do the same thing, so I will post another possible answer (if I know of one). This gives the user more than one option, and they can choose what works best for them.

    • Like 1
  9. Well this isn't a VBA or Excel forum, so you will likely find better answers elsewhere. If this is being done in LabVIEW it is quite easy. You use the OpenG Array package and use the "Remove Duplicates" function, which returns the indicies that were removed. Then you can use the Delete From Array providing a 2D array and then removing columns or rows, at the indicies found earlier.

    • Like 1
  10. I agree to use defer front panel updates, but if you are dealing with coloring alot of cells (more than say 40) I would recommend trying to do something like this which uses a "Virtual MultiColumn Listbox"

    This technique only shows a few rows of data, and the rest is shown as the scrollbar changes. This is a good candidate for an XControl.

    • Like 1
  11. Hi hooovahh, thanks for adding the test cases.

    I did test resize event handling and then noticed the same issues that you did. Since we are generating a new html document and loading it in the browser every time the size changes, it was really slow and the clicks were annoying.

    For handling panel resize event, while still doing most of this stuff in LabVIEW, I would rather refresh in a separate loop and use lossy enqueue to a single element queue to pass on the panel resize message so that we don't refresh for every single resize event LabVIEW fires. Ideally, we should resize the thumbnails using JavaScript onresize event and calculate the thumbnail sizes within JavaScript, not in LabVIEW. Yair has lots of munitions on that. May be we can put together a quick example.

    I'm not sure how close you looked at my resize code, but it is essentially a lossy queue. If you resize a windows by dragging you get lets say 100 events to resize, but I don't have the resize take place, all I do in those 100 events is set a boolean to TRUE, which is handled in the timeout case. So the resize only takes place if another resize hasn't been fired in the last 0ms. This isn't perfect but much better than performing 100 resizes on the UI.

  12. Very nice, but I didn't like how panel resize wasn't handled, so I modified the .Net version to basically perform a refresh after a resize. I also wanted to see the disable function in action, so I added code to disable items randomly when a refresh takes place. One side effect is I see flickering of the images when resizing slowly. I added a defer front panel at one point but that didn't seem to fix it.

    Regarding the "Click" noise, I'm wondering if you can query Windows and ask what the volume settings are (muted or not and volume level) then mute the speaker, then set the speaker back to the previous settings that it was before a refresh. There are examples on how to mute speakers using Windows DLL calls, but I don't know how to query the current settings.

    Thumbnail Grid .NET Browser.vi

  13. I have a suggestion (back on topic to the original post). For the 1D to 2D VI you have a control for how many columns to make. Would it also be useful to have a control for the number of rows to make? I guess at that point there still is the choice of the order they are put into. So for instance I have an array.

    [1, 2, 3, 4, 5, 6]

    If I choose 2 rows how should the output look?

    [1, 2

    3, 4

    5, 6]

    Or

    [1, 4

    2, 5

    3, 6]

    My gut says it would be more useful to have the first but I could see uses for the second output.

  14. If you don't, the reentrant VIs will block on whatever VIs are not reentrant. Instinct says this will only become a problem when you forget that you did it that way. :)

    Yes, yes, and more yes. Some VIs shouldn't be reentrant (things like functional globals and uninitialized shift registers), but any other subVI in a reentrant VI should be made reentrant. I found an NI article that talks about it more a while ago but can't find it right now.

    I've been burned more than once, where I had a reentrant VI spin off, but one of the subVIs were not reentrant. Under almost all circumstances the program would run like normal, but once in a while there would be a dead lock, where one VI was running this subVI that was waiting on another VI, which blocked all the other reentrant VIs from running.

    Attached is a VI if you're interested, which can take a folder of VIs and turn them all into reentrant.

    Save VIs as Reentrant.vi

    • Like 2
  15. I also have this application to silenly install LV2012 RT eninge if needed.

    This is a great idea, and I've thought of it before but never did anything about it. One issue with LabVIEW when no runtime engine is installed, is there is no way to do any thing (kinda obvious but still frustrating). Having an AutoIt EXE that just checks for the existence of the LabVIEW runtime engine seems like a great idea. Not sure what JKI does at the moment, but I assume they could use something similar when distributing VIPM to a machine that may or may not have the right runtime engine installed.

    Out of curiosity how do you do the automated install of the runtime engine? I understand there is silent switches that can be used, but do you have it automatically download the runtime engine? Or do you include it with the AutoIt EXE?

  16. On a project once I needed to take a large sample of data, then break it up into chucks and analyze each chunk. I figured I'd use the waveform data type, because the analyzing I was doing was using a few NI VIs that used the waveform datatype. So I read, then used the split waveform VI then analyzed. I found that my VI was running really slowly and the slowness was from the split, and concatenate waveform VIs. I found it was much faster to read as an array of doubles, split or concatenate the array, then turn it into a waveform for the analysis.

    I wanted to tell this story because in my case it (for some reason) was much for efficient to split and merge arrays then convert to a waveform, then it was to work with the waveform from the start.

  17. Thats why I asked, I have never used AutoIT, so I don't know. Have you used it together with LabVIEW or other languages?

    I have used AutoIt with LabVIEW. If you choose to install AutoIt (which is optional) it will install some ActiveX components. I can't remember why, but when I did this I found the features to be lacking when compared to just writing AutoIt code and compiling. I also looked into getting DDE to work between an AutoIt EXE program I wrote, and LabVIEW. I could get LabVIEW to talk to the AutoIt EXE but couldn't figure out the other way for some reason.

    In either case I highly recommend downloading it and at least looking at the shipped examples. They do a pretty decent job of showing you how to do the basics. There's a relatively large community out there to support more complicated programs and functions. It's very liberating, being able to download a single zip that contains source, and a method to build an EXE that will run on any Windows machine, without needing a development environment, or run-time engine.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.