Skip to content

Dataset Save Menu ​

The Dataset Save Menu widget shows a card titled CONFIGURATION with one section per image source. Each section has a Suffix text field and a Dataset list. The flow fills the list of datasets and can preset the values; the operator changes them and presses the confirm button, and the widget sends the configuration of every source to the flow.

Dataset Save Menu

Palette: category Utils, label dataset save menu. 1 input, 1 output.

Configuration ​

PropertyDescriptionDefault
NameNode name shown in the editor.''
GroupDashboard group where the widget is displayed.— (required)
SizeWidget width and height (0 = fit to the group).0 x 0
Confirm button textText of the button that sends the configuration.CONFIRM
Images pathTraining or Log. It selects the key of the output (configTraining or configLog) and the folder sent with each source.Training
Fill heightStretch the card down to the bottom of the window (at least 240 px); the list of sources scrolls inside it.off
Subtitle headerShow a light CONFIGURATION subtitle instead of the coloured title bar, so the card reads as part of the card above it.off
Image sourcesNumber of sources, with one field per source (Source name 1, Source name 2, ...). With two or more, a trash button next to each removes it.1 (one empty name)

Source names are saved in lower case and trimmed; with more than one source, empty names are dropped. The sources appear in the widget in this order. A single source left empty is kept: the widget then shows a section without a name, sent as sourceName: "".

Input ​

PropertyTypeEffect
msg.optionsarrayEntries of the Dataset lists, as { label, value }: label is shown, value is sent.
msg.payload.configTraining or msg.payload.configLogarrayValues to show: one { sourceName, suffix, dataset } per source. sourceName is matched in lower case; sources not in the array are cleared.
js
msg.options = [
    { label: "Scratches", value: "rp-class-scratches" },
    { label: "Training Set 1", value: "train_dataset_1" }
];
msg.payload = {
    configTraining: [
        { sourceName: "camera1", suffix: "_defect", dataset: "train_dataset_1" }
    ]
};

Options and configuration can arrive in separate messages: the node keeps the last of each, in memory, and a browser that opens the page later receives both. A deploy or a restart forgets them.

Output ​

One message for each button:

  • DATASETS sends msg.payload = "refreshDatasets", so the flow can reload the list and send msg.options again.
  • The confirm button sends the value of every source, under configLog when Images path is Log and under configTraining otherwise:
js
msg.payload = {
    configTraining: [
        {
            sourceName: "camera1",
            suffix: "_defect",
            dataset: "train_dataset_1",
            folder: "/opt/storage/images/training/imageSaveDir"
        }
    ]
};

suffix and dataset are null when left empty. folder is /opt/storage/images/<images path>/imageSaveDir, with training or log.

Usage example ​

Two cameras, camera1 and camera2, saving to training datasets:

  1. Set Image sources to 2, with source names camera1 and camera2, and Confirm button text to SAVE CONFIGURATION.
  2. When the dashboard loads, and when the output carries "refreshDatasets", read the dataset list and send it:
js
msg.options = flow.get("datasets").map(d => ({ label: d.name, value: d.id }));
return msg;
  1. Send the saved configuration, if any, so the widget shows it:
js
msg.payload = { configTraining: flow.get("configTraining") || [] };
return msg;
  1. When the operator presses SAVE CONFIGURATION, store msg.payload.configTraining (for example with flow.set("configTraining", msg.payload.configTraining)) and use it where images are saved.