Skip to content

Commit

Permalink
feat: add the "frequency" and spin system as "name" to the simulated …
Browse files Browse the repository at this point in the history
…spectrum info (#2530)

* fix: add frequency n nucleus to simualted spectrum

* chore: add spinSystem type as info.name

* chore: fix eslint

* refactor: add 'baseFrequency' and 'name' to the info

close #2526

---------

Co-authored-by: hamed-musallam <hamed.musallam@gmail.com>
  • Loading branch information
jobo322 and hamed-musallam committed Jul 21, 2023
1 parent c0c060d commit 21b1e1b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/component/reducer/actions/SpectrumsActions.ts
Expand Up @@ -658,14 +658,20 @@ function handleSimulateSpectrum(
const isInXDomain = options.to - options.from <= x2 - x1;
setDomain(draft, { updateYDomain: false, updateXDomain: !isInXDomain });
} else {
const { frequency } = options;
const spectrum = initiateDatum1D(
{
data: { x, re: y },
info: { isFt: true },
info: {
isFt: true,
originFrequency: frequency,
baseFrequency: frequency,
nucleus: '1H',
name: spinSystem,
},
},
{ usedColors: draft.usedColors },
);
spectrum.info.name = spectrum.id;
draft.data.push(spectrum);
draft.view.currentSimulatedSpectrumKey = spectrum.id;
setActiveTab(draft);
Expand Down

0 comments on commit 21b1e1b

Please sign in to comment.