Jump to content

eaolson

Members
  • Posts

    261
  • Joined

  • Last visited

Posts posted by eaolson

  1. QUOTE(Aristos Queue @ Oct 15 2007, 12:01 PM)

    I tried to play games or do some LV coding, but tracking the movements of the mouse cursor was making me nauseous. So I'm sticking to text.

    I always say I have to get sick every once in a while just to remind myself how bad daytime television is.

  2. QUOTE(Michael_Aivaliotis @ Oct 10 2007, 11:07 PM)

    Try using the "sort array" function in the array palette.

    Also, the OpenG Sort Array function allows you to sort a 2D array by a particular column. Put your number is the first column, the names in the second, then sort on the second column.

  3. I don't compile a lot of applications to EXEs, but I've been doing some lately and am confused about the .alias and .ini files created by the application builder. Every time I build my app, I get one of each file created in the build directory. The .alias file contains only My Computer <My IP address> and the .ini file contains a lot of VI Server, ActiveX, and web server keys even though I'm not using any of those. The ini file is frustrating because it's cryptic to me (server.tcp.paranoid? why is server.tcp.servic misspelled?) and I imagine even more confusing to an end-user. Now I've discovered that if I delete them both, my program works just fine. The ini file gets recreated empty, but not the aliases file. So if these files are unnecessary, as they appear to be, why create them at all?

  4. QUOTE(Christina Rogers @ Oct 8 2007, 11:08 AM)

    Do you think that removing the file extensions would get confusing to some folks? I am concerned that the icons in the project aren't distinct enough.

    That very reason is why I've pretty much trained my brain to ignore the icons. It's like the Windows default to hide the file extension; I always want to ask people, "How can you work like this?"

    Perhaps make it a setting in the Options?

  5. QUOTE(Petersdon @ Oct 8 2007, 05:10 AM)

    i am developing an image processing application in labview(version 8.2) where i have to compare certain patterns on two different images and compare and check whether the patterns are the same(something like signature recognition)...i am new to labview (started using it only a year ago)...what i would like to know is whether there exists any way to get information about the image in the form of pixels(i would like to convert a color image to gray scale format if possible).right now i trying to do this with jpeg images...i need to get the information in an array so that i can analyze it later...can i do the same withinage formats other than jpeg

    I don't know if the student version has the Picture VIs or not, but you can use Unflatten Pixmap to get a 2D array of pixels. If the image is 24-bit, each value of the array will be the color of the pixel. If it's 8-bit or less, the value in the array will be an index into the colors array, which contains the actual color.

    There is no "correct" color -> grayscale conversion. The most commonly used one for photos is Y = 0.3*R + 0.59*G + 0.11*B, which emphasizes the information in the green channel.

  6. QUOTE(Aristos Queue @ Oct 7 2007, 03:14 PM)

    Actually, I may have led him to this if he's read my posts on factories in various forums. I've been asked by many people what class should properly own the factory method. I don't have a problem with the parent class owning that method. I don't see the need for a separate Factory class. I'd be curious to hear pros/cons on this point.

    Sorry Tomi, AQ outranks you. :) Yes, in fact it was a post of yours on a different thread on this very issue. You have an example up somewhere (I forget where) with a dynamic factory example; I figured this was a small enough class that it wasn't worth the effort to go through all that.

    He has a point. Your method means that the parent has to be aware of its children and that seems a bit inelegant. My original approach was sort of an implementation of the Chain of Responsibility pattern (yes, I've been reading the Gang of Four book again), though because of the way the image data cluster is written, the topmost class still needed to know where to send the data for instantiation, so it didn't really help much.

    Anyway Tomi, thanks for checking this out and verifying that the error doesn't happen in 8.5.

  7. QUOTE(Tomi Maila @ Oct 5 2007, 05:03 PM)

    Yes, you should not be able to have a class instance flowing along a wire that is not in memory. So I guess you are encountering a bug. Can you provide an example that duplicates the issue, there could be something I'm not thinking of that you are doing that's actually causing the problem.

    I've attached the whole directory as a zip file. If you open Image Demo.vi by itself, this problem happens (8.2.1), if you open Image Demo.lvproj first, then the Demo, it doesn't. I would appreciate any suggestions.

  8. I am developing a library of classes. The classes are all in a lvlib, the library is in a project, and the project also has a small test VI, which uses the library. If I open the test VI from the project, everything is fine. If I open the VI on its own, running it gives this error in a popup window: The LabVIEW class is not in memory. The dynamic subVI cannot execute. Probe the wire going into the dynamic terminal to see the data type." The problem seems to occur when the dataflow enters into a dynamic dispatch VI. Shouldn't the classes be loaded when the calling VI is loaded?

    (Crossposted from the NI forums.)

  9. QUOTE(BrokenArrow @ Oct 2 2007, 11:13 AM)

    I need to write, to a txt file, some of the extended ascii characters, specifically the "box drawing" type such as alt+203, alt+204, etc. How is that done in LabVIEW? I've done it with unicode (by writing FFFE 6625 for example, to get one of the characters), but as you know, the file resulting Unicode becomes useless to LV when you read it and parse for data later.

    You can write the extended characters just as you would a normal character. The problem might be that Windows and DOS use different character encodings. If you have a file containing extended characters and open it with Notepad, you'll see lots of vowels with umlauts and accents. If you open the same file in a DOS window, you see the box-drawing characters. Character 203 (0xCB) is a capital E with an umlaut in Windows, but displays as a double-walled box character in DOS. You can use a string constant with the slash display or hex display to get to the extended characters without worrying about how they are displayed in LabVIEW.

  10. QUOTE(Kevin P @ Sep 26 2007, 02:21 PM)

    In the meantime, there's a fairly efficient workaround. You can use "Reshape Array" to morph the 2D back into 1D. If I'm not mistaken, this can be done without additional data copying. The values are already stored in contiguous memory in the desired concatenation-like order. As I understand it, a Reshape just transfers ownership of that memory chunk over to the (1D) output array wire.

    Yes, that works, but only if the loop adds the same number of elements each time. It wouldn't work for this (pardon for not doing this in LV):

    array a = {}; for (i = 1; i &lt;= 3; i++) {	for (j = 1; j &lt;= i; j++) {	   append j to a;	} }

    This creates the array, a = {1, 1, 2, 1, 2, 3}.

  11. The addition of auto-indexing to While and For loops was great. Sometimes, however, I have multiple nested loops and auto-indexing makes a 2D or 3D array, which is not necessarily what I want. It would be nice to have an auto-indexing tunnel that has a "auto-append" option rather than only the default "build array" behavior. Much like how the Build Array function has the "Concatinate Inputs" option. I guess this really makes the most sense for 1D arrays.

  12. QUOTE(jdebuhr @ Sep 20 2007, 08:02 AM)

    BUT, now they want the numeric to go to 0 before the mouse release and still after the 5 secs.. any thoughts as to how to do this?

    My initial thought: when the button goes down, put a reference to it in a shift register. In the timeout case (5 s), put the code to reset the numeric if the shift register contains a valid reference. In the mouse up case, invalidate the reference in the shift register. You'll also want to check when the mouse up happens after the numeric is reset that you don't increment it.

  13. All my computers at this point are single-core because they are either (a) in my lab where they are a bit old or (b) at home where I am a bit poor, so I have not had the chance to do anything with the multicore capabilities of LV. I'm just wondering, how much effort is it to take advantage of this? Can I expect to just drop any old VI on a multicore computer and see a significant increase in speed, or would it have to be carefully optimized for multicore execution?

  14. QUOTE(Jim Kring @ Sep 17 2007, 10:53 AM)

    I'll see your 20:1 and raise you to 200:1. http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=lSy&q=%22Thank+you+for+suggestions.+So+far+I+found+freedback+and+this+free%22&btnG=Search' target="_blank">Google knows all. A poster asks a question, then comes back several days later with an ad for that site. The questions are different, but the answer posts are verbatim identical. Wow, spammers are getting really sneaky.

  15. QUOTE(Justin Goeres @ Sep 12 2007, 08:17 AM)

    Of course, it's obvious now that I've seen it. Am I the last person in the world to learn this? :lightbulb:

    I believe I can authoritatively say no, you weren't the last. Now, am *I* the last person in the world to learn this?

    For some reason, I knew you could wire the N terminal inside a For loop, but doing it in the case of an auto-indexed loop never occurred to me.

  16. QUOTE(yen @ Sep 1 2007, 03:00 PM)

    • It would make it easier to understand which class is which if they had different icons. As it is, when all the VIs have the same icon, you just get the feeling you're opening the same VI over and over.
    • Did you save this on a different drive than your C drive? It looks for the 8.2 vi.lib, which means it did not save it as a logical path and I believe that's the usual reason for that.

    1. Art was not one of my best classes, so I'm not so great at making icons. :) I'll try to come up with some way of differentiating them. My idea, though, was that you'd just use the methods from the Image class and it would dynamic dispatch to the correct child method, so you'd never need to see the icons for the subclasses.

    2. No I didn't save it on a different drive and it gives me that notice, too. I'm not sure why. I actually made a source distribution in the project file I'm using to aggregate all the VIs to one folder, so I suspect it has something to do with that.

  17. I've been playing around with images, and have come up with the attached set of classes to hopefully eliminate the somewhat complicated way LabVIEW handles images loaded from disk. The "flattened pixmap" approach is a pretty clever way to handle both truecolor and indexed images in the same data structure, but it's unnecessarily complicated in my book and can lead to some problems if the image you load is not the image you expected at design time.

    The transparency aspects of loading the images may not be exactly correct, which is why I haven't put this in the CR yet. It seems LabVIEW doesn't load the alpha channel exactly as it's described in the help text when the image is very small.

    This is my first real foray into LVOOP, so I would appreciate any critiques or comments anyone would offer, on anything from whether it works as it should to the OOP design.

  18. QUOTE(alukindo @ Aug 31 2007, 11:07 AM)

    Is there a way to slow down the frequency of these slider value change events? :( My current work around is to use a separate loop that fires the value change event only after detecting a lapse of say 0.5 sec from the most recent slider value change.

    There's no way that I'm aware of to discard the value change event while the slider is still sliding. I got around this by catching the Value Changed event, the Mouse Down event for a slider, and the Mouse Up event.

    1. On the mouse down, put a control reference to the slider in a shift register, and the current value in another shift register.

    2. In the mouse up case (which is not specific to a particular control), check the reference and if it is valid, fire the value changed event using the Value (Signaling) property. Also invalidate the control ref in the shift register.

    3. In the value changed event, check the value of the control reference in the shift register. If it's valid, the mouse is still down and do nothing. If it's invalid, the slider is no longer moving and handle the event.

×
×
  • Create New...

Important Information

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