04-20-2009 09:41 AM
I would like to create custom controls that a user can drag-and-drop from the controls palette. The user will import an image showing pipelines and then drag-and-drop valves on the pipelines. I want to create these valve controls so that you can easily set their timing or connect them to other valves to have an identical, inverse or delayed response.
Would it be more appropriate to use Xcontrols than custom controls for this application?
Thanks,
Suretha
04-20-2009 09:44 AM - edited 04-20-2009 09:45 AM
It depends on whether or not the controls require any kind of "intelligence". If the customization is purely for cosmetic reasons, then a regular custom control is adequate. If the control needs some "smarts", such as changing its output based on some parameter, then you need an XControl.
You may want to look at the DSC module, as that ships with a lot of pipes and valves, and it may be worth the cost of the development time you would need to spend to develop the controls.
04-20-2009 12:49 PM
Suretha wrote:I would like to create custom controls that a user can drag-and-drop from the controls palette. The user will import an image showing pipelines and then drag-and-drop valves on the pipelines. I want to create these valve controls so that you can easily set their timing or connect them to other valves to have an identical, inverse or delayed response.
Would it be more appropriate to use Xcontrols than custom controls for this application?
Thanks,
Suretha
So your user is a developer?
If so then XControls will let you code up the behaviour of the valaves you are looking for.
If your user is not a develper, then the challenge is must larger (been there, done that).
So please clarify your requirments and feel free to include png or jpg to illustrate your desires.
Just trying to help,
Ben
04-21-2009 01:50 AM
The user wil not necessarily be a developer, no. I have been thinking a lot about how to make it simple and intuitive because of this.
We are developing microfluidics (micron-sized channels controlling fluids and particles), with valves controlling the flow of fluids in these channels. I am developing the control platform for the valves. At the moment we have ten or less valves per chip, but it will soon grow to hundreds of valves per chip, making manual control of each valve impossible. I am thus trying to come up with some control platform where the user can drag and drop valves, or groups of valves and easily program their operating sequence.
My idea is to create a basic valve with different attributes, for instance it's timing can be linked to another valve, but then you can specify if it should be identical, inverse or a delayed version of the other valve's timing sequence. This sounds like intelligence to me, so I assume an Xcontrol will be necessary?
04-21-2009 06:17 AM
Suretha wrote:The user wil not necessarily be a developer, no.
...
My idea is to create a basic valve with different attributes, for instance it's timing can be linked to another valve, but then you can specify if it should be identical, inverse or a delayed version of the other valve's timing sequence.
...
This sounds like intelligence to me, so I assume an Xcontrol will be necessary?
This is starting to shape up as a "control on the Fly" Challenge. But I'm not going ther yet.
XControls are great if you as a developer have same functionality you want to include in more than one app. They wrap-up all of the functionality you associate with that control. You (as a developer) just drop another one in a new app and the functionlaity comses along for the ride. In my experience this means I code up the function I want in an app (done coding if I don't go to XControl) and then start the work of converting to work as an XControl.
If you can put an upper limit on the number of objects you will present on the screen at any one time you can;
Create a cluster with the max number of controls you need and hide what you are not using at the time.
Do the same as above with hidden controls.
If you can let the GUI NOT look like the widget you are testing then arrays are useful.
If all of the above leaves you lacking I'll outline what I went through to do my last "Controls on the Fly" app.
1) Get very familiar with the LV Picture control. If allows you to draw whatever you want and offers mouse down/up move, enter and leave events. The picture control will be used to render your objects.
2) Get familiar with LVOOP. I used LVOOP because many of the routings of mouse clicks, possitioning, rendering, etc are common to all of the object on the screen. Code up this functionality in a parent class so the childeren can inherit this functionality.
3) Code up an application that operates in two modes (optional but it makes design easier) "Desgn mode" and "Operate". In Design all the user to layout the GUI but do not implment any functionality beyond Deisgn work. The design when loaded in Operate mode should establish all nessesary communications and use the events captured from the Picture control to invoke the methods required for each class of gizmo on your widget.
There is a LOT of work that goes into a "Controls on the Fly" app. If the work I outlined above "bugs" you. It should.
Ben
04-28-2009 03:27 AM
12-10-2024 05:16 PM - edited 12-10-2024 05:23 PM
@Ben wrote:
Suretha wrote:
The user wil not necessarily be a developer, no.
...
My idea is to create a basic valve with different attributes, for instance it's timing can be linked to another valve, but then you can specify if it should be identical, inverse or a delayed version of the other valve's timing sequence.
...
This sounds like intelligence to me, so I assume an Xcontrol will be necessary?
This is starting to shape up as a "control on the Fly" Challenge. But I'm not going ther yet.
XControls are great if you as a developer have same functionality you want to include in more than one app. They wrap-up all of the functionality you associate with that control. You (as a developer) just drop another one in a new app and the functionlaity comses along for the ride. In my experience this means I code up the function I want in an app (done coding if I don't go to XControl) and then start the work of converting to work as an XControl.
If you can put an upper limit on the number of objects you will present on the screen at any one time you can;
Create a cluster with the max number of controls you need and hide what you are not using at the time.
Do the same as above with hidden controls.
If you can let the GUI NOT look like the widget you are testing then arrays are useful.
If all of the above leaves you lacking I'll outline what I went through to do my last "Controls on the Fly" app.
1) Get very familiar with the LV Picture control. If allows you to draw whatever you want and offers mouse down/up move, enter and leave events. The picture control will be used to render your objects.
2) Get familiar with LVOOP. I used LVOOP because many of the routings of mouse clicks, possitioning, rendering, etc are common to all of the object on the screen. Code up this functionality in a parent class so the childeren can inherit this functionality.
3) Code up an application that operates in two modes (optional but it makes design easier) "Desgn mode" and "Operate". In Design all the user to layout the GUI but do not implment any functionality beyond Deisgn work. The design when loaded in Operate mode should establish all nessesary communications and use the events captured from the Picture control to invoke the methods required for each class of gizmo on your widget.
There is a LOT of work that goes into a "Controls on the Fly" app. If the work I outlined above "bugs" you. It should.
Ben
I lit a hundred candles, memorized a witch doctor chant, and followed all the guidelines on moon phase and planet alignment, and sourced several gigawatts to bring this thread back from the dead.
Ben, I understand what you're describing here but would absolutely love to see an example implementation. By any chance do you have something like that you can share publicly? I totally understand if not, sounds rather horrendous to code up just for an example.
Does anyone have code for this (eg. the picture control stuff Ben describes) that's shareable?
I'll be honest, I would probably exhaust every avenue relating to convincing client they don't want a UI like that or just implement said UI using a different language and likely some relevant third party UI library. UI's like that are one of LabVIEW's Achilles' heel.
That last sentence it was kills me. Basically the OP would love a somewhat limited palette/dumbed down version of the LabVIEW block diagram IDE, something I have posted about my desires for more than once. I really think it would be worth the trouble for NI, possibly even the "killer app" for LabVIEW. Many of us write applications that are used by highly educated/trained, technically minded, scientists/engineers/operators. While asking them to master LabVIEW themselves is probably a tall and unrealistic order, but giving them a built executable with a UI that works and resembles the LV block diagram with a limited palette and custom rules/limitations would be the bees knees in many applications I have been involved in. Even better if it's prettied up like the block diagramming in the ill-fated NXG IDE.
Using the picture control, even with LVOOP/inheritance, is just impractical for anything but the most cartoonish basics (and that's assuming the developer has an artistic eye to begin with, judging by the LV UI's that I see, that eliminates about 99.9% of us LV devs).
But I would love to see this picture control method with my own eyes if someone has anything. If so, please share! I vaguely remember making a similar attempt using picture control years ago, after awhile I decided it was too much trouble for something that was just an internal project with no requirement for such a UI (but it would have been cool).
12-11-2024 01:05 PM
There is a .NET open source DLL set that creates a form that allows for the creation of shapes, then linking those shapes together. I have used it successfully in LabVIEW before to create a sort of clickable tree diagram in a way that offered a lot more functionality with a lot less hassle than doing everything in a Picture control manually.
It is called NShape and is here:
https://github.com/dataweb-GmbH/NShape
However, I did not try to use it for any drag and drop operations, just creating my tree diagram with an arbitrary amount of clickable nodes on the tree. So I can't verify LabVIEW will allow for those, however there are events listed in the "Register event callback" node that is created that are related to dragging and dropping so it may be possible.
It also appears that adding new shapes requires creating them yourself in C# so if the built-in ones aren't good enough it also might not be what you are looking for.