Jump to content

ThomasGutzler

Members
  • Posts

    205
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by ThomasGutzler

  1. This post has been promoted to an articleTortoiseSVN_GetInfo.vi
  2. With TortoiseSVN you can always manually "fix" files that have been renamed by using the "Repair move" option. For this to work you need a file that is missing and a file that hasn't been added. You select both, click Repair move and you get your version tracking back
  3. You mean something like this? The trouble with svn and versions is that when you use svn info on a FILE it only returns the revision of your file. To get the most recent revision on the server, you need to point it to the svn URL. The snippet can do both. Just be careful with that because if your repository needs authentication it will not work unless you've saved your credentials in the tortoise svn password manager by ticking the "remember password" box. The --non-interactive switch disables password prompts, which you wouldn't be able to see anyway, because it's hidden away by System Exec. I guess, as a workaround, you can pop up your own password dialog if you need one.
  4. And I thought Internet Time was the coolest thing... @139.beats
  5. If you have the OpenG library installed, this can be done with - Remove Duplicates from 1D Array - Search Array And the following native functions - Array Size - a For Loop If you don't have the OpenG library, you need to use those native functions instead - A For Loop with a shift register - Search 1D Array - A Case Structure - Build Array - Another For Loop - A While Loop with a shift register - Another Search 1D Array - Less Than 0? - Increment Have fun connecting them up
  6. I've seen LabVIEW run "out of memory" when trying to recompile vis with very high code complexity. In one case I had a large project with a vi of a complexity over 30. Every time I changed something inside, LabVIEW allocated Gigabytes of memory (hooray for the 64 bit version) for the recompile and wouldn't free the memory again. When this project was loaded in a 32 bit version of LabVIEW it ran out of memory before being able to change anything. Lesson for the future: be careful with combinations of parallel loops inside inline vis inside parallel loops etc
  7. Just be careful with this vi, because it doesn't have an error out. If you're passing it an invalid file path or it can't write to the file for some reason, it will pop up an error message blocking everything else, unless you've got automatic error handling disabled, in which case you will never know that things go wrong until you can't find the files. This is why I sometimes prefer to use a combination of "Array to Spreadsheet String" and "Write to Text File", which allows you to handle the errors.
  8. You have to be careful with the FIR filter the way you're using it because it applies a shift to your data by the amount of "Num of Averages". To fix that, you have to do some padding at both ends of your input data. In this example I just repeat the first and last value: If you run it through a graph it becomes obvious:
  9. You can always do "File / Revert..." after reverting a single VI (via svn/git/whatnot). If that option is greyed out, just make any change to the VI. This will reload the VI from disk. This works well if you only reverted a single or very few files because LabVIEW then checks dependencies in both ways. Reverting an entire class somewhere in the middle of the dependency tree will leave you with a 30 minute exercise for your click-finger. Much faster to just kill LabVIEW and load from scratch.
  10. LabVIEW is too clever to let you do that, but there's a trick:
  11. If anyone is wondering how to get "git diff" working from the git bash, here's what I came up with: Configure a different diff method for *.vi and *.ctl To do that, we add the following to .gitattributes (or .git/info/attributes or your global gitattributes file) *.vi diff=lvdiff *.ctl diff=lvdiff Define what git should do for those files $ git config --global diff.lvdiff.command 'lvcomparewrapper.sh "$LOCAL" "$REMOTE"' Put lvcomparewrapper.sh somwhere in the $PATH ($ echo $PATH) (or modify above command to an absolute call) I had to slightly modify the wrapper script to this: #!/bin/bash# Method to determine absolute path# The -W parameter on the pwd command is necessary to return the Windows version of the path.# Not using the -W parameter will result in a conversion of temp directory to a 'tmp' path meaningful only in the Linux # environment.# Piping the result through tr '/' '' translates the forward slashes to backslashes.# Windows understands forward slashes, but LVCompare.exe does not.abspath () { ( DIR=$(dirname "$1") FN=$(basename "$1") cd "$DIR" printf "%s/%s" "$(pwd -W)" "$FN" | tr '/' '' )}lvcompare="C:Program Files (x86)National InstrumentsSharedLabVIEW CompareLVCompare.exe"local=$(abspath "$4")remote=$(abspath "$3")echo Launching "$lvcompare"#echo Launching "$lvcompare" -nobdpos -nofppos "$local" "$remote"exec "$lvcompare" -nobdpos -nofppos "$local" "$remote" Now you're all set up to use the good old command line: $ git diff Main.viLaunching C:Program Files (x86)National InstrumentsSharedLabVIEW CompareLVCompare.exe
  12. Interesting, hooovahh must have done that in his version but when I loaded it, I got the warning dialog that the dependencies had changed. I thought it was just fixing the OpenG path and ignored the warning. Doh. Now I just have to work out why it doesn't actually bring the window to front. I thought it may have something to do with my desktop manager as discussed here but turning it off doesn't make a difference. Strangely, my own BringToFront.vi doesn't work anymore either. Does this (exe or Main.vi) come to front for anyone? ToFront.zip EDIT: Unfortunately, I can only build in 2013 at the moment so I haven't included 2012 code either
  13. I have a 13" laptop, which I sometimes use to develop on. To organise my desktop I run the VirtuaWin virtual desktop manager, a great piece of software that lets me distribute my open applications over several virtual desktops. I chose it because it's lightweight, free and has sensible keyboard shortcuts. My Browser can be on one, email on the next and LabVIEW on the third, etc. Running LabVIEW isn't such a great experience though. Everytime I switch to a different desktop and come back to the one with LabVIEW on it all front panels and block diagrams are just white. Usually I can force a redraw of all windows by pressing Windows+D twice to minimise and restore all windows. This is quite annoying and sometimes doesn't work with all windows. What experience do you have with desktop managers for windows and their use together with LabVIEW?
  14. I'm afraid, this also crashes my app when I build it - and it doesn't bring the window to front. Something's seriously effed up here. So, I've made a vi that waits for three seconds and then brings itself to front (it doesn't come to front on my PC). I also built an exe from it, which crashes immediately (not after 3s). All attached in LV 2013 and 2012: ToFront.zip Could someone try this out so that I know if it's a problem with my build or my PC?
  15. Hi, I've been trying to use FindWindow and BringWindowToTop. It works well when run from the dev env. When I build an executable and run that, it crashes straight away with an access violation even though the BringToFront.vi hasn't been run yet. Any suggestions what that could be? I'm building on 2013 32bit. BringToFront.vi
  16. Wow, pattern matching for numeric arrays. I'm loving it! If only we had a proper regex function that let us do the cool stuff we're used to (or not) from perl! xkcd
  17. Aha, I'm in a very good position here. I never really intended to turn this into a publicly available/supported project. I just wanted to be able to read the video from .mov files for a private side project. QTlib does that for me, just takes a bit longer. I can just try out both alternatives and see which I like better. It might take a bit longer to get two wrappers working to the point where I can decode the video stream; or I might give up on one half way through. It doesn't matter if it doesn't work out. The main point for me at the moment is that I'm learning new stuff. And if I like it so much that I can't stop and it's starting to become useful for others I will turn it into a public project. Next item on my reading list: anything I can find about cintools starting here.
  18. ned, Thanks for your offer, but at this point it might be better to leave it where it is and never touch it again Rolf, Thanks for your careful explanations, they are very helpful and most appreciated. For what it's worth, I agree with the LabVIEW developers for keeping the size of pointers constant over platforms. I was wondering how long it would take for that suggestion to come up. I shall accept the challenge - again, more for self-educational purpose more than anything else. That's what "weekend projects" are for, right? Any reading suggestions are welcome. This is what I've bookmarked so far: Building a DLL in Visual C++ Writing Win32 Dynamic Link Libraries (DLLs) and Calling Them from LabVIEW Building a Shared Library to call from LabVIEW So yes, there won't be an ffmpeg.lvlib coming from my end for a while Cheers
  19. So why does my 32 bit LabVIEW use I64 when I tell it to make a pointer-sized integer parameter on a cln? Maybe redefine isn't the right word. The AVFormatContext struct is fully declared in the header - just couldn't be imported by the library import, so I defined it from scratch. It seemed to be the easier way at the time and helped me understand things (better). Maybe I'm missing a few preprocessor definitions for a more successful import. The struct is definitely supposed to be used in applications. This seems to be a way to find your first video stream in the list of available streams: AVFormatContext *pFormatCtx;pFormatCtx = avformat_alloc_context();avformat_open_input(&pFormatCtx,filepath,NULL,NULL);for(i=0; i<pFormatCtx->nb_streams; i++) if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { // congratulations, you found the video stream ned, I can save you a 2012 version if you want. The "problem" with the filename isn't that I'm passing it but that it's part of that struct which is returned to me. Tom
  20. I think this turned into a self education project more than anything else. Instead of building a library that fully wraps ffmpeg, I went on their forum and wondered if I could implement the "Simplest ffmpeg player". It turns out, I couldn't (yet) - got stuck in line 3. A few problems: I'm getting an error on the av_find_stream_info() node I had to define the AVFormatContext struct as a cluster because I need to use some of its properties later on. I wasn't sure if I had done that rightAll pointers were represented by an I64 How do you do "char filname[1024]"? Only thing I could think of is a cluster that contains 1024 U8 controls Looking at the filename I've reconstructed from the U8 array I found that its first 24 characters were missing. To me, that was a success, because it means I got *something* right and 24 got me thinking... There were 6 pointers defined in the cluster before filename, if I change the pointer size from I64 to I32 I can make it work so that the entire filename is reconstructed correctly. And 4 byte sized pointers doesn't seem unreasonable seeing the library is compiled for 32bit. That probably means that all other pointers in the cluster should be 4 bytes long too. But what about the pointer I pass into MoveBlock? If I change that to I32, the filename contains mostly unreadable characters. Where do I draw the line? Surely I can't just type cast the pointer and hope all is well? Tom I've attached my project, which needs the shared lib from here player.zip
  21. Hi, I realise this hasn't been touched for a year, but there is always hope... As explained here I'm trying to read quicktime videos frame by frame. I'd like to do this using the ffmpeg library but I got stuck way earlier than bublina. Possibly because I've never interfaced to external code from LabVIEW before... So I got myself a copy of the ffmpeg-shared and -dev package and tried out the Shared Library Import on libavformat.dll. After adding the Include folder from my visual studio installation I got 73 out of 162 functions recognised. It turns out those are the ones that don't have a struct as a parameter. First one to fail was this: int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags); The following symbols are not defined: AVStream; The AVStream struct is defined in avformat.h, which I specified as header for the library. Surely it got parsed. So why isn't this working? Isn't the import wizzard clever enough to parse structs or is there a trick I'm unaware of? I read in another post by rolfk that, if I was using the call library node, I can just define separate inputs for each of the elements of a struct (instead of passing a bundled cluster to the library). Before doing that (and defining all the other 1000000 structs this one depends on) I'd like to be sure there isn't an easier way. Cheers, Tom Edit: Just noticed that not all functions with structs as parameters failed to import. There is this one: which was created with an empty cluster s. AVFormatContext is also defined in avformat.h. As a bonus, I also found three "Custom Controls" in my imported library. One of them is called AVInputFormat and has 4 elements - unlike the actual definition in the header file, which has many more. But importantly, the first four are standard types like char and int while the 5th one is a struct. So it seems, the parser wasn't clever enough to resolve a struct inside a struct. Maybe I was a bit too ambitious with this project; it looks like this isn't going to be just a one weekend thing.
  22. Speaking of in place structures, is there much point cascading them (top) or is all data inside an in place structure automatically acted upon in place (bottom)?
  23. Thanks hooovahh, I think I'll go with ffmpeg. Dumping the video in jpeg/png files using ffmpeg is very easy. Not sure if it's faster though. I'll have to invest some time to figure how I can use the ffmpeg libraries directly to read my frames. Will keep you posted.
  24. Hi, I've got a bunch of quicktime videos that I'd like to analyse - open them and do some image processing on every frame. From what I understand, that cannot be done with the quicktime ActiveX object. I've looked through the methods and properties and I couldn't find anything that would let me extract a single frame. So, I'm opening the topic again: How can I read quicktime .mov videos (on windows)? All I found was Chris's Quicktime VIs, which, to me, seems like a half finished job. It works but it's not great. The biggest problem I have is that it takes a very long time to read a video file - even if I don't display the frames in a picture control. This snippet here (you need to get the qtlib for it to work) runs at just 20fps for a 640x480 video: Is there anything better out there? Cheers, Tom
  25. And that almost certainly works if you have a "small" project. When I work with projects that started with compiled code inside the vi and were changed to separate, I occasionally open this vi from the project explorer and run it over the relevant folders: (for the few of you who haven't coded it up themselves )
×
×
  • Create New...

Important Information

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