void Nmr::updatePlot() { m_plot->clearGraphs(); QList<double> data; QString isotope(currentIsotope()); if (isotope.isEmpty()) { data = m_data.shieldings(); m_plot->xAxis->setLabel("Nuclear Shielding (ppm)"); }else { data = computeShifts(currentReference(), isotope); m_plot->xAxis->setLabel("Chemical Shift (ppm)"); } if (m_ui->impulseButton->isChecked()) { // the range is really determining the resolution here plotImpulse(data, standardRange(isotope)); }else if (m_ui->lorentzianButton->isChecked()) { // There has to be an easier way double min(m_plot->xAxis->pixelToCoord(m_plot->axisRect()->right())); double max(m_plot->xAxis->pixelToCoord(m_plot->axisRect()->left())); plotSpectrum(data, qMakePair(min, max)); } m_plot->replot(); }
//-------------------------------------------------------------- void testApp::draw(){ plotSpectrum(); drawScene(); drawSceneDebug(); }
void ExcitedStates::updateSpectrum() { m_spectrum->clearGraphs(); double width(m_configurator.widthSlider->value()); if (m_configurator.impulseButton->isChecked()) { plotImpulse(); m_spectrum->yAxis->setLabel("Strength"); }else if (m_configurator.gaussianButton->isChecked()) { plotSpectrum(Gaussian, width); m_spectrum->yAxis->setLabel("Rel. Strength"); }else if (m_configurator.lorentzianButton->isChecked()) { plotSpectrum(Lorentzian, width); m_spectrum->yAxis->setLabel("Rel. Strength"); } m_spectrum->replot(); }
void Frequencies::updatePlot() { m_customPlot->clearGraphs(); double scale(m_configurator.scaleFactor->value()); double width(m_configurator.widthSlider->value()); if (m_configurator.impulseButton->isChecked()) { plotImpulse(scale); m_customPlot->yAxis->setLabel("Intensity"); }else if (m_configurator.gaussianButton->isChecked()) { plotSpectrum(Gaussian, scale, width); m_customPlot->yAxis->setLabel("Rel. Intensity"); }else if (m_configurator.lorentzianButton->isChecked()) { plotSpectrum(Lorentzian, scale, width); m_customPlot->yAxis->setLabel("Rel. Intensity"); } m_customPlot->replot(); }
/// Handle notifications from the view. void WorkspacePresenter::notifyFromView(ViewNotifiable::Flag flag) { switch (flag) { case ViewNotifiable::Flag::LoadWorkspace: loadWorkspace(); break; case ViewNotifiable::Flag::LoadLiveDataWorkspace: loadLiveData(); break; case ViewNotifiable::Flag::RenameWorkspace: renameWorkspace(); break; case ViewNotifiable::Flag::GroupWorkspaces: groupWorkspaces(); break; case ViewNotifiable::Flag::UngroupWorkspaces: ungroupWorkspaces(); break; case ViewNotifiable::Flag::SortWorkspaces: sortWorkspaces(); break; case ViewNotifiable::Flag::DeleteWorkspaces: deleteWorkspaces(); break; case ViewNotifiable::Flag::SaveSingleWorkspace: saveSingleWorkspace(); break; case ViewNotifiable::Flag::SaveWorkspaceCollection: saveWorkspaceCollection(); break; case ViewNotifiable::Flag::FilterWorkspaces: filterWorkspaces(); break; case ViewNotifiable::Flag::PopulateAndShowWorkspaceContextMenu: populateAndShowWorkspaceContextMenu(); break; case ViewNotifiable::Flag::ShowWorkspaceData: showWorkspaceData(); break; case ViewNotifiable::Flag::ShowInstrumentView: showInstrumentView(); break; case ViewNotifiable::Flag::SaveToProgram: saveToProgram(); break; case ViewNotifiable::Flag::PlotSpectrum: plotSpectrum(); break; case ViewNotifiable::Flag::PlotSpectrumWithErrors: plotSpectrumWithErrors(); break; case ViewNotifiable::Flag::ShowColourFillPlot: showColourFillPlot(); break; case ViewNotifiable::Flag::ShowDetectorsTable: showDetectorsTable(); break; case ViewNotifiable::Flag::ShowBoxDataTable: showBoxDataTable(); break; case ViewNotifiable::Flag::ShowVatesGUI: showVatesGUI(); break; case ViewNotifiable::Flag::ShowMDPlot: showMDPlot(); break; case ViewNotifiable::Flag::ShowListData: showListData(); break; case ViewNotifiable::Flag::ShowSpectrumViewer: showSpectrumViewer(); break; case ViewNotifiable::Flag::ShowSliceViewer: showSliceViewer(); break; case ViewNotifiable::Flag::ShowLogs: showLogs(); break; case ViewNotifiable::Flag::ShowSampleMaterialWindow: showSampleMaterialWindow(); break; case ViewNotifiable::Flag::ShowAlgorithmHistory: showAlgorithmHistory(); break; case ViewNotifiable::Flag::ShowTransposed: showTransposed(); break; case ViewNotifiable::Flag::ConvertToMatrixWorkspace: convertToMatrixWorkspace(); break; case ViewNotifiable::Flag::ConvertMDHistoToMatrixWorkspace: convertMDHistoToMatrixWorkspace(); break; case ViewNotifiable::Flag::ClearUBMatrix: clearUBMatrix(); break; case ViewNotifiable::Flag::ShowSurfacePlot: showSurfacePlot(); break; case ViewNotifiable::Flag::ShowContourPlot: showContourPlot(); break; case ViewNotifiable::Flag::RefreshWorkspaces: refreshWorkspaces(); break; } }
void WorkspacePresenter::plotSpectrumWithErrors() { auto view = lockView(); view->plotSpectrum(true); }
void WorkspacePresenter::plotSpectrum() { auto view = lockView(); view->plotSpectrum(false); }
void SpectrumWindow::updateSpectrum() { plotWaveform(); plotSpectrum(); emit spectrumUpdated(); }