Jump to content

viSci

Members
  • Posts

    464
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by viSci

  1. In my MVC architecture I have many Views all running in separate threads so I needed a way to provide thread safe access to the Model data. Initially, I created the Model class with the idea that the DVR would be my locking mechanism but soon realized that the 'Modify' logic in some cases was too complex to put into the Model class itself so I needed to add the semaphore to allow the external locking. I think my BD suggests that the DVR reference is public but actually only Model Class vi's have access to it. I would be curious to know how others would construct a transactional model that is fast and can conveniently store and retrieve any LV data type. BTW, I think that the prominent feature of 'thread safety' is avoiding race conditions in shared data structures (at least according to wikipedia
  2. At first I did not have the semaphore but then realized that I might not want to build all forms of R-M-W permutations into specific class methods. With the semaphore I can have use cases that allow external concatenation of Lock,Read,Modify,Write,Unlock methods without having to change the core Model class.
  3. Besides retribution from God, it seems that there are some legitimate use cases (at least I hope so since my latest MVC architecture is based on the concept). In my application, Model data is housed in the DVR wrapped class data of a singleton. Various methods within the class allow View instances to perform Read or Read-Modify-Write operations. RMW operations can be locked using the built-in semaphore. So far it all seems to work nicely with up to 6 View instances all performing rapid transactions on the Model. I guess the downside is that a hung View could block access to the Model (maybe I should have put a timeout in the semaphore lock Since this is a first attempt please do not be too harsh if I am doing something utterly foolish...
  4. I thought my mutex'd singletons were a good idea but now it seems I have blood on my hands...
  5. Maybe a hybrid approach could work... You could create a singleton class that provides global access to an encapsulated DVR that references your 'Model' data. You can put semaphore mutex functions in the class so that Read/Modify/Write sequences can be safely performed by any processes in your app.
  6. If you only have one or a few mask colors then you could layer simple square booleans (mask color/transparent) over your sensor
  7. Well then I guess I was lucky that the main effect was LV crashing!
  8. Thanks Yair and others that replied. I did find the caveat you mentioned. For some reason I wishfully was thinking that LV was automagically creating a event queue at each event structure From LV Help: Make Sure You Have a Register For Events Function for Each Event Structure If you wire the event registration refnum to more than one Event structure, each Event structure handles dynamic events out of the same event queue. This can occur if you branch the event reg refnum out output of a Register For Events function to another Event structure. This causes a race condition, because the first Event structure to handle the event can prevent the other Event structure from receiving the event if it completes the event case before the other Event structure executes. To avoid this problem, make sure you wire each Event structure which handles dynamic events to a unique Register For Events function.
  9. Here is a simple application that uses User Events to communicate with a single process running in a subpanel. I am finding that I cannot have both the main vi and the subpanel process both registered for the same set of events without LV crashing. If anyone would care to take a look I would appreciate it very much. Just unzip and run the Aircraft Emulator vi with one event enabled, observe the event generation and reception counters are keeping up with each other. Now enable the 2nd event and watch LV crash. BTW, I have tried running the process outside the subpanel and it still crashes. TIA Aircraft Emulator.zip
  10. I recently test drove a number to open source tts software packages. The festival online demo is quite good. http://www.cstr.ed.ac.uk/projects/festival/onlinedemo.html I have also played around with the microsoft tts but to my ear does not sound natural enough. I was wondering what others have found out there and in particular if anyone has worked with festival in LabVIEW. Thanks
      • 1
      • Like
  11. I would definitely consider hiring a guy like Flarn. Many moons ago scripting was taboo too. That did not stop some of the more intrepid LV'ers from using it and proving to NI that it should be a released interface.
  12. The 3D picture control is very cool and it does seem possible to create wrappers that would emulate basic 2D functionality while benefiting from such features as object hierarchies, support for transparency and anti-aliasing. I have also been toying with the .net GDI+ picturebox, It is much more sophisticated than the native LV picture control and am surprised that there are little to no LV examples of its usage. I have also heard a rumor of a LV->SVG toolset which could be used to turn an embedded browser into a rendering canvas. Wait are you saying that a decision made way back in LV 2.5 has been the reason why LV 10 years later still does have GDI+ under the hood?
  13. Yeah the opcode thing is cute http://lavag.org/files/file/26-picture-hacks/ but not sure it is anything useful. Reminds me of this crazy stuff to parse SVG into a LV Graph http://drics.googlecode.com/svn/LabView/SVG/ I am really surprised no one (at least I have yet to find them) that has explored the .net PictureBox for use in LV. It has tons of cool features. I have been trying to use the API but so far have not gotten much to work yet.
  14. Yeah Bitman is awesome but I don't think it really helps with anti-aliased display of 2D primitives like lines and arc's
  15. Just wondering, since we have some SVG afficianado's in the audience, if it is possible to use LV to dynamically creat SVG content and display within a .net container? I can see that it is possible to place a .net picture control on the front panel but I think SVG would be much more elegant. A little ranting here... I am a little frustrated that all LV programmers have for developing embedded custom 2D graphics is the very very very old 2D picture control. The rest of the world has marvelous tools like WPF, SVG or even GDI+. Yes, I know, as many have pointed out, that you can do anything with the 2D picture control and I think LV'ers get a kick out of how much they can force out of such primitive tools. Wow, how did you get the picture control to do that nice anti-aliased display with z-ordering of emulated alpha channel bitmaps? I think some people would be willing to pay for a nice 3rd party 2D graphics toolset.
  16. I have been looking for a way to generate perfect antialiased circles that I can programmatically manipulate (position, radius, color). Seems like a simple enough goal but is not very easy to do unless you want to jump into the 3D picture control api and generate meshes for every anti-aliased primitive you want. Finally I found that the silver gauge control has some ultra cool antialiased circular decorations that can be used for this purpose. I am attaching an example to demonstrate. It would be really nice if the decoration palatte would get some native anti-aliased primitives and of course it would be extra nice if the picture control would also get anti-aliased as well. Actually I think the holy grail would be a 2D version of the 3D picture control. BTW, you can use the xy graph to draw antialiased circles but they always look a bit bumpy. Antialiased Circle.vi
  17. Hi Vugie, I am also exploring various 3D engines for use in aircraft simulators. I thought at first to use the native 2D picture control with your BITMAN library (very nice!) but found that I would need native support for transparency and anti-aliasing. Do you have any examples of using LabVIEW with VTK? Thanks
  18. I would like to be able to capture a controls image but have noticed that the Get Image method does not include mask data or any way to preserve transparency. Perhaps someone has found another way to do this?
  19. and when you really really really think about it... free will is a somewhat convoluted concept.
  20. Ok, here is what I have found... Anti-aliasing options need to be selected in the advanced settings of your computers graphics card. Once I enabled antialiasing (there are many different modes, see http://www.tomshardware.com/reviews/anti-aliasing-nvidia-geforce-amd-radeon,2868.html for a good tutorial) for all applications on my machine then my 3D picture control started drawing with anti-aliasing. You can configure anti-aliasing to be global for all app's or tailored to specific app's with the app determining if anti-aliasing is enabled or not. I think if you do this then the anti-aliasing enable property node in LV might start working. Thanks Vugie!
  21. Maybe you guys are a little too hard on this fellow. Personally I enjoy unusual 'educational' threads like this. Actually some of my favorite threads ended up with someone getting kicked off the list
  22. Interesting...could you post your code, I would like to see if I get anti aliased output on my machine. Thanks.
  23. Has anyone ever seen this feature working? I am gearing up to start design on a aircraft EFIS emulator and would very much like to have features such as anti aliasing and transparency. Transparency works out of the box with 3D picture controls but anti aliasing is still a no-go...
  24. Next Generation of User Interfaces... http://zone.ni.com/wv/app/doc/p/id/wv-3567 I really love LV so it is especially disheartening to see what we are missing...
×
×
  • Create New...

Important Information

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