Skip to content

plugin-api/TuneOperationRegistry#

useTuneOperations()#

function useTuneOperations(): TuneOperationDef[];

Returns all registered tune operations sorted by order, re-rendering on changes.

Returns#

TuneOperationDef[]


tuneOperationRegistry#

const tuneOperationRegistry: TuneOperationRegistry;

TuneMode#

Properties#

id#

id: string;

label#

label: string;

paramsOverride?#

optional paramsOverride?: Record<string, unknown>;

Params to merge into the call when this mode is selected.


TuneOperationDef#

Properties#

capability?#

optional capability?: string;

Device capability required to show this tab. Hidden when absent.

component?#

optional component?: 
  | ComponentType<TuneOperationProps>
  | ComponentType<Record<string, never>>;

Full custom component. If provided, rendered instead of the generic schema-driven form. Receives TuneOperationProps for generic operations, but plugins can provide any component (rendered with no props — the plugin manages its own state via context/hooks).

defaultParams?#

optional defaultParams?: Record<string, unknown>;

Static default parameters when no schema topic is defined.

icon?#

optional icon?: ComponentType<{
  fontSize?: "small" | "medium" | "inherit" | "large";
}>;

Optional tab icon component.

id#

id: string;

Unique identifier, e.g. 'core:tune-frequency' or 'nanalysis:shim'.

label#

label: string | (() => string);

Tab label — string or lazy function for i18n.

modes?#

optional modes?: TuneMode[];

Quick/Full or custom modes shown as a toggle.

order#

order: number;

Sort order. Built-in operations use 100–500.

paramsSchemaTopic?#

optional paramsSchemaTopic?: string;

Topic to fetch dynamic parameter schema from the device.

plotId?#

optional plotId?: string;

Plot ID for results visualization.

pluginTopic#

pluginTopic: string;

Plugin topic to call when user clicks Start, e.g. 'nmr_tuning.tune_frequency'.

resultTopic?#

optional resultTopic?: string;

Topic for async results, e.g. 'nmr_tuning.tune_frequency_result'.


TuneOperationProps#

Properties#

isRunning#

isRunning: boolean;

onCancel#

onCancel: () => void;
Returns#

void

onStart#

onStart: (params) => void;
Parameters#
Parameter Type
params Record<string, unknown>
Returns#

void

plotId#

plotId: string;