08-01-2023 04:08 PM
Hello,
I am working on a drag and drop UI for defining a test sequence. I have some tiles (clusters) for each test that I create when the VI launches. The idea is that the user grabs a tile and drags it onto the timeline to define the test (this works fine, see image). My issue is that I define a finite number of clusters for each test and then stack them on top of each other. I would rather create a new instance of the cluster on the front panel each time the user grabs a tile and moves it to the timeline.
My question; Is there a way to programmatically create a cluster object from a template (or typedef) on the front panel at runtime?
Solved! Go to Solution.
08-01-2023 04:31 PM
08-01-2023 05:33 PM
@Gregory wrote:
You could have an array that changes size. Just out of curiosity, is this an executable or source code?
Having an array is an interesting idea. Visually I don't want to have an array but I understand how I could make that work. I have done some UI work where I rolled every UI element from picture and draw object privatives but that is so much work. I'm trying not to go there for this one. This is source code.
08-01-2023 06:40 PM
I'm imagining in my head that there may be some way to create a cluster from a typedef similar to how you would launch and load a .vit front panel by reference into sub panel at runtime.
If I have a reference to the typedef can I instantiate it an add it to the FP objects somehow?
08-01-2023 06:59 PM
With scripting, one VI can edit another VI, as long as the VI being edited is neither running, nor reserved for run.
08-01-2023 08:22 PM - edited 08-01-2023 08:28 PM
It is not possible to create FP objects during runtime, instead, you need to have them pre-created in the FP outside visual area and reposition them to visual area based on user selection to insert/delete/move objects.
Alternate idea - if these are just to represent, treat them as images, observe drag drop and update the image indicator to represent the appropriate block.
08-01-2023 09:29 PM
@paul_a_cardinale wrote:
With scripting, one VI can edit another VI, as long as the VI being edited is neither running, nor reserved for run.
That is exactly what I want to do. Too bad the vi has to be not running.
08-01-2023 10:04 PM - edited 08-01-2023 10:09 PM
@santo_13 wrote:
It is not possible to create FP objects during runtime,
Bummer, I was hoping there was some way.
instead, you need to have them pre-created in the FP outside visual area and reposition them to visual area based on user selection to insert/delete/move object
That is what I'm doing now but the tiles are all stacked on top of each other and the user grabs the top one to drag into the timeline.
Alternate idea - if these are just to represent, treat them as images, observe drag drop and update the image indicator to represent the appropriate block.
That is an interesting idea. At the moment the tiles are fully editable on the timeline, and they attach to the cursor so they move with the mouse pointer when dragging. But there is not nearly enough room for all the data fields on each tile, maybe only one or two fields and an image. At some point more data is needed to be entered so maybe each tile on mouse click could open an edit window for the fields and the tile itself would just be an image. But I need to display some user defined info on the tiles... I feel like I am going to end up rolling all the images from draw primitives again, which is what I am trying to avoid. I need to think about it.
08-01-2023 10:56 PM
Based on your last piece of info, looks like the application will blow up large pretty soon. As you already figured out, a separate window to configure each tile or a subpanel to edit/view configuration of a tile will make it more scalable and keep your UI simple.
We created an application where there is a graphical programming/sequencing (like LabVIEW but limited), in the UI user can drag and drop various predefined blocks, configure, connect block together to sequence and create data flow. Save, retrieve and run the created pseudo-VI. All of these in an EXE build using LabVIEW and the end-user doesn't need to worry about LV licensing. This is made scalable using plugins for each block that show up in the palette of the application.
08-02-2023 01:40 AM
There is an invoke node for generating a picture of a control which you could use for this.
I am envisaging that you click on a tile, opens a separate config window which returns a new image
If I am honest, every time I do something like this I always resort to a table/tree with text describing the steps, it becomes much more manageable. You can even add icons to a tree control.