nmrium
nmrium copied to clipboard
auto processing workflows
To support more flexible auto-processing workflows from the processing panel, we need to refactor the existing structure.
The old structure of the auto processing filters is based on the nucleus type ('1H', '13C')
onLoadProcessing: {
autoProcessing: true,
filters: {
'1H': [ /* array of filters */ ],
'13C': [ /* array of filters */ ],
}
}
The new format introduces a flat list of workflow, where:
- Each item has a condition (jpath and value)
- Workflow items are linked using
idandparentIdto form a hierarchical tree. The system traverses this tree sequentially, performing a value match for each specified jpath. Filters are applied only when they have matching conditions.
onLoadProcessing: {
autoProcessing: true,
workflows: [
{
id: '1',
parentId: null,
jpath: ['info','nucleus'],
value: '1H',
enabled: true,
filters: [ /* array of filters */ ]
},
{
id: '2',
parentId: '1',
jpath:['info','x'],
value: '298K',
enabled: true,
filters:[ /* array of filters */ ]
},
{
id: '3',
parentId: '2',
jpath: ['info','y'],
value: 1002,
enabled: true,
filters: [ /* array of filters */ ]
}
]
}
Add a new workflow sketch
New format autoprocessing pipelines
onLoadProcessing: {
autoProcessing: true,
pipelines: [
{
id:'1',
label: 'Pipeline 1',
enabled: true,
selectors: [
{ jpath: ['info', 'nucleus'], value: '1H' }
],
filters: [ /* array of filters */ ]
},
{
id:'2',
label: 'Pipeline 2',
enabled: true,
selectors: [
{ jpath: ['info', 'nucleus'], value: '1H' },
{ jpath: ['info', 'x'], value: '298K' }
],
filters: [ /* array of filters */ ]
},
{
id:'3',
label: 'Pipeline 3',
enabled: true,
selectors: [
{ jpath: ['info', 'nucleus'], value: '1H' },
{ jpath: ['info', 'x'], value: '298K' },
{ jpath: ['info', 'y'], value: 1002 }
],
filters: [ /* array of filters */ ]
}
]
}
interface Selector {
jpath: string[];
value: string | number;
}
interface Pipeline {
id:string;
label:string;
enabled: boolean;
selectors: Selector[]; // ordered by hierarchy
filters: Filter[];
}
interface OnLoadProcessing {
autoProcessing: boolean;
pipelines: Pipeline[];
}
How are you doing those sketches ?? They look great !
Maybe I would make the design more horizontal (like most of the screens) and put the selector part and the save button on the right.
@lpatiny Like this
We need an optional label for the pipeline