LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Has anyone created a Visio-like VI app?

Why not draw the pictures in paint, and link the buttons to the files?


Regards,


Wiebe.
"Ben" <x@no.email> wrote in message news:1152717009219-390322@exchange.ni.com...
Just another thought....
Rather than doing all of the drawing work from scratch (ouch), if you develop all of the basic shapes as customized LV controls, a "proto-type" of each can be used to do the dynamic dragging and re-sizing stuff and only when the the object is "dropped" grab its image and stuff it in the picture.
I am thinking the prototypes would be hidden and off-screen. When the use indicates they want a "square" the "square control proto-type control" is made visable and positioned over the picture control where the mouse is.
Ben
0 Kudos
Message 11 of 22
(2,121 Views)
Here's a short demo of what I imagine Ben's idea would be like. It gives an idea at least of what could be done along these lines. (This is written in LV8 - sorry! But I can try in a bit to downgrade if necessary).
Jarrod S.
National Instruments
Message 12 of 22
(2,111 Views)

HI Jarrod,

Thanks fo rthe kind words.

You have another resource that we on the outside can not tap.

Chase down the guy who wrote the State Diagram Editor.

That add-on uses a picture control as the UI and scripts in the background.

Toss the scripting and you are well on your way.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 22
(2,106 Views)
Cheers to that! I had thought of the idea as well with the SDT, but perhaps just write a VI that could analyze the scripted code like a compiler and build some data model from that. But I suppose even the analysis would involve scripting, so we're back to square one. Alas...
Jarrod S.
National Instruments
0 Kudos
Message 14 of 22
(2,100 Views)
"but perhaps just write a VI that could analyze the scripted code like a compiler and build some data model from that"
 
Nice thought but the way i read my LV usage agreement, reverse engineering is a big no-no.
 
Besides, the SDE does not support "un-do" so that would only get us a little  past what we can already do.
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 22
(2,097 Views)
Thanks for all the suggestions!  I have to keep this as a weekend-only project, but I'm working furiously on it.
 
Wiebe, I really liked the idea of creating a separate palette of color-coded objects!  Wow!  That solves the tricky problem of object seletcion.  For example, for a diagonal line, I didn't want a rectangle's worth of selectable area.  I wanted just the line.  Or, for skinny lines, I wanted a slightly thickened line.  With your approach, it's easy!  I've got it working, and I can tell which object has been selected.  Awesome!
 
I'm just a bit worried about a couple things in that approach.  There probably will always be less than 256 objects on the screen, but there might not be.  (A pretty full screen that I've already designed has 75 elements.)  The Picture is about 500x500.  When I do a "Picture to Pixmap", I have to supply the "depth" - 8bit, 16bit, 24bit.  For now, I'm giving a depth of 8bits, making the "image" array 250K elements.  I don't know if there will be a big time hit if/when I go to 16bits.  It probably won't be noticable.
 
Question:  When I do a 8-bit "Picture to Pixmap", I've been only able to get colors 0-245, which I can correlate to the object number I placed.  What are the last 10 colors?  In other words, if I drop a filled rectangle onto a Picture, what color do I make it to receive the values 246-254 when I look at the "image" array?
 
The "ROI test.vi" was pretty neat, but like someone mentioned earlier, it seems more suited for a single object, not for many objects.
 
The Endevo GOOP toolkit - UML modeler scares me a bit.  I'm not familiar with the GOOP concept.  I downloaded the demo and ran it.  Neat stuff, and it seems like it might be a good idea, but they're not showing the block diagram...
 
Ben's idea of dropping prototypes onto the screen is neat.  I'll keep that in the back of my mind, but I think I like the idea of dragging a ghost outline when dropping objects.  I don't use PhotoShop or Visio all too much, so I don't know what the popular approach is, but I'm trying to adopt the LabView approach for selecting, dropping, and resizing objects.  I really like the idea of having an invisible Picture where all the ghosting / resizing is done.
 
It's going to take a few more weekends, but when I'm done, I'll post what I've got.
 
Thanks for all the help!  I'll make this work!
 
One last question, which maybe should go into a separate thread.  For the objects, I allow the user to select a color out of 256 possible colors.  For simplicity, I've just been asking for a numeric input (U08 Numeric Control), so the user must know what the colors are.  Is it possible to make a control where a color box, the color index, and the color name can be visible?  And simply return a U08 like it always has done?  I don't want to make an array of clusters if I don't have to.  I'd love it if it could be in a Menu Ring, returning a simple U08.
 
-Tom
Message 16 of 22
(2,070 Views)


@tdurand wrote:
 
One last question, which maybe should go into a separate thread.  For the objects, I allow the user to select a color out of 256 possible colors.  For simplicity, I've just been asking for a numeric input (U08 Numeric Control), so the user must know what the colors are.  Is it possible to make a control where a color box, the color index, and the color name can be visible?  And simply return a U08 like it always has done?  I don't want to make an array of clusters if I don't have to.  I'd love it if it could be in a Menu Ring, returning a simple U08.

If you have 8.0, you could probably make an Xcontrol for this.

Before 8, I think the array of clusters is your only way, but it might be easier than you think. If you create a subVI with a 16*16 array of those clusters and use that subVI as your color picker, you can simply extract the number from there. Here's a really quick example.


___________________
Try to take over the world!
0 Kudos
Message 17 of 22
(2,062 Views)
Tom,


I always used 32 bit pictures. Never noticed any speed decrease. It's posible that you'll even get a speed increase, because most internal display stuff works on 24 bit. (The last 8 bit is not used by LV). I used to get a subimage of 1X1 pixels, and then got the first element of the returned 2d array. That was fast.


For the color picker, I also used a picture control once... I made a top level vi with a picture of the color pallete. Internally, you keep a selection mask picture (easy to make in paint or something). When the user clickes, or presses ok or whatever, lookup the selected color. If it is not masked, a color is selected. If it is masked, wait for a selected color. I used a screenshot of LabVIEW's color picker dialog, but you can use anything you like. (Can't post the code, corporate property.)


The most difficult part is to locate the color picker dialog at the point the user clicked. Normally, not a problem, but when the main vi is in a subpanel, all coordinates are screwed up. Also, you don't want the dialog to get of the screen. And if the used clicks next to the window, the dialog should hide... Guess I have to fill in a feature request form...


Regards,


Wiebe.


"tdurand" <x@no.email> wrote in message news:1153163411511-392339@exchange.ni.com...
Thanks for all the suggestions!&nbsp; I have to keep this as a weekend-only project, but I'm working furiously on it.
&nbsp;
Wiebe, I really liked the idea of creating a separate palette of color-coded objects!&nbsp; Wow!&nbsp; That solves the tricky problem of object seletcion.&nbsp; For example, for a diagonal line, I didn't want a rectangle's worth of selectable area.&nbsp; I wanted just the line.&nbsp; Or, for skinny lines, I wanted a slightly thickened line.&nbsp; With your approach, it's easy!&nbsp; I've got it working, and I can tell which object has been selected.&nbsp; Awesome!
&nbsp;
I'm just a bit worried about a couple things in that approach.&nbsp; There probably will&nbsp;always be less than 256 objects on the screen, but there might not be.&nbsp; (A pretty full screen that I've already designed has 75 elements.)&nbsp; The Picture is about 500x500.&nbsp; When I do a "Picture to Pixmap", I have to supply the "depth" - 8bit, 16bit, 24bit.&nbsp; For now, I'm giving a depth of 8bits, making the "image" array 250K elements.&nbsp; I don't know if there will be a big time hit if/when I go to 16bits.&nbsp; It probably won't be noticable.
&nbsp;
Question:&nbsp; When I do a 8-bit "Picture to Pixmap", I've been only able to get colors 0-245, which I can correlate to the object number I placed.&nbsp; What are the last 10 colors?&nbsp; In other words, if I drop a filled rectangle onto a Picture, what color do I make it to receive the values 246-254 when I look at the "image" array?
&nbsp;
The "ROI test.vi" was pretty neat, but like someone mentioned earlier, it seems more suited for a single object, not for many objects.
&nbsp;
The Endevo GOOP toolkit - UML modeler scares me a bit.&nbsp; I'm not familiar with the GOOP concept.&nbsp; I downloaded the demo and ran it.&nbsp; Neat stuff, and it seems like it might be a good idea, but they're not showing the block diagram...
&nbsp;
Ben's idea of dropping prototypes onto the screen is neat.&nbsp; I'll keep that in the back of my mind, but I think I like the idea of dragging a ghost outline when dropping objects.&nbsp; I don't use PhotoShop or Visio all too much, so I don't know what the popular approach is, but I'm trying to adopt the LabView approach for selecting, dropping, and resizing objects.&nbsp; I really like the idea of having an invisible Picture where all the ghosting / resizing is done.
&nbsp;
It's going to take a few more weekends, but when I'm done, I'll post what I've got.
&nbsp;
Thanks for all the help!&nbsp; I'll make this work!
&nbsp;
0 Kudos
Message 18 of 22
(2,051 Views)
As uncool as it is, I just had a thought - you could place a Visio control in an ActiveX container on the front panel and use that.

___________________
Try to take over the world!
0 Kudos
Message 19 of 22
(2,044 Views)

Here is an alternative activex control that might work.

http://www.sharewareriver.com/products/7116.htm

0 Kudos
Message 20 of 22
(2,037 Views)