Jump to content

Interactive preview of VI


vugie

Recommended Posts

First of all I would like to welcome everybody at LAVA forum. I'm reading it from time to time since my LV beginnings. Although I was not active at all, each time I had a problem, or wanted to learn something new, I was able to find the answer somewhere here. Thank you guys.

Now to the point.

I'm using my national LV community portal and my experience is that due to graphical nature of VI's code very often it is quite hard or at least inconvenient to describe a problem, help to solve one or share an idea. One way is to publish VI itself. But not everybody uses same LV version, VI is often dependent on number of subVI's, type definitions or libraries, downloading and opening VI takes time, particularly if one is doing something else at the same time. Another way is publishing a screenshots. But in this case you have to use a graphical editor to arrange subcases (with some trouble if you have nested conditions), crop the picture, etc. Diagram may be larger than screen causing additional problems, and large pictures posted at some forums may destroy layout (which is not a case here AFAIK). I know that there is a Code Capture Tool - frontly speaking I did not try it yet, but for sure in does not solve all these problems.

So this is a background for my idea mentioned in the title - interactive VI preview. A preview which would allow user to switch between front panel and diagram view, to swich between subdiagrams within a Case Structure, Diagram Disable structure or Stacked Sequence independently on nesting level, which would allow to zoom and pan the view, see descriptions of elements and allow to enter the subVI and browse it the same way.

Natural way to realize such idea is to alayze the VI (using dark and legendary method called scripting :) ) and to generate result as dynamic HTML or Flash animation. I decided to use Flash as it is mor compact and easier to embend (forums often support it) and here is the first result:

http://vugie.republika.pl/mult/mult.html

(sorry for the icons - it took me 2 mins to make them...) I hope that browsing this example is natural: you can drag diagram with mouse, switch cases using arrows, zoom with magnifying glass. Additionaly tips with name and some text appears when cursor is over an element. Of course this animation was generated automaticly with a preliminary version of tool I called VIpreVIEW. This is very early stage of development and is not advancing very fast as I do it in my spare time (which I do not have to much). So I decided to share this idea with you, just not to loose the motivation :) .

If anybody is interested, I serve with details.

Link to comment

QUOTE(vugie @ Feb 15 2008, 03:48 PM)

So I decided to share this idea with you, just not to loose the motivation :) .

If anybody is interested, I serve with details.

Wohoayuhasyadf, drewl drewl :thumbup: :thumbup: :thumbup: :thumbup: :thumbup: :thumbup:

Very nice, (did I tell I am bazzled?)

Please share!

Ton

Link to comment

QUOTE(Aristos Queue @ Feb 15 2008, 07:48 PM)

Are you planning on posting the VIs?

Definitely yes, but not now - this is probably most ugly looking code I wrote ever... You know - patches for patches for patches... Anyway it works. It requires rewriting at least to let me understand my code <img src="http://lavag.org/old_files/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br />But I can describe the scheme. First stage is diagram analysis. I'm taking a shot of whole the diagram and then parsing it recursively (which is one of reasons why the code looks like this) classifying all nodes to switchable ones, subVIs, functions and terminals. For each of these I store bounds, label and description in tree-like structure. For each switchable node I switch between nodes taking a shot of each and parsing them recursively same way. Then it is needed to parse the front panel (it would be good to switch between tabs if any). It is not implemented yet - in example I just glued the image of panel manually in the middle of the process <img src="http://lavag.org/old_files/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br />Then all pictures are being saved to PNG files. At this stage user shoud decite what he want to show - which subVI to include, determine size of an animation, whether to show tips and what to put there, etc. Probably only initially selected part of code should be processed. All this stuff is not implemented yet. For generating SWF files I use Swftools (<a href="http://www.swftools.org/" target="_blank">http://www.swftools.org/</a>). As the name says it is a set of tools for dealing with SWF files <img src="http://lavag.org/old_files/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />. One of these tools is a compiler for text based flash generation scripts (see the examples on the webpage). I created a set of sth like script templates for various object types (including some ActionScript also) and traverse the diagram tree replacing keywords in these templates with picture names, labels, etc. and glueing pieces together in order to create one big script file which may be compiled by calling external program. This is probably not very elegant and efficient solution and I treat it as a proof of concept. I would like rather to directly generate flash file using i.e. Ming library (<a href="http://www.libming.net/" target="_blank">http://www.libming.net/</a>). But Swftools were easy too learn - it is my first experience with Flash. Learning and creating wrappers for Ming will be quite big task - collegue of mine already started to work on this. Another advantage of Ming is that it uses less resrictive LGPL licence (Swftools is GPL). So forget about BSD, but I think it should be enough for such a tool.<br />So as you see lot of work is to be done...

Link to comment

QUOTE(vugie @ Feb 15 2008, 05:50 PM)

Once you've cleaned it up a little, I'm sure it will be really welcomed here. If you'd like to eventually submit it to the LAVA Code Repository, (and based on the enthusiasm already shown on this thread), I figure there'll be at least a few talented people that would love to help you out.

Link to comment

This is certainly very impressive and could be immensely useful in sharing code online. Thank you.

One thing that is important to note is that for this to be usable by wide audiences it will have to have a one-click usability. For the CCT we went to some effort to make it very easy both to install and to use. Ideally, when a user generates something like this, they should end up with an easy way of building a path to embed this as a Flash object.

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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