MCPcopy Create free account
hub / github.com/KDE/labplot / updateResultsNote

Method updateResultsNote

src/backend/worksheet/plots/cartesian/XYFitCurve.cpp:1838–1988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1836}
1837
1838void XYFitCurvePrivate::updateResultsNote() {
1839 DEBUG(Q_FUNC_INFO)
1840 if (!resultsNote)
1841 return;
1842
1843 QString text;
1844 const auto numberLocale = QLocale();
1845
1846 text += i18n("Nonlinear Fit to X/Y data");
1847 if (xDataColumn && yDataColumn)
1848 text += QStringLiteral(": ") + xDataColumn->name() + QStringLiteral(" / ") + yDataColumn->name();
1849 text += NEWLINE + NEWLINE;
1850
1851 // model
1852 text += i18n("MODEL") + NEWLINE + NEWLINE;
1853 switch (fitData.modelCategory) {
1854 case nsl_fit_model_basic:
1855 text += QLatin1String(nsl_fit_model_basic_name[fitData.modelType]);
1856 text += QStringLiteral(", ") + i18n("Degree") + QStringLiteral(" ") + numberLocale.toString(fitData.degree);
1857 break;
1858 case nsl_fit_model_peak:
1859 text += QLatin1String(nsl_fit_model_peak_name[fitData.modelType]);
1860 if (fitData.degree > 1)
1861 text += QStringLiteral(", ") + numberLocale.toString(fitData.degree) + QStringLiteral(" ") + i18n("Peaks");
1862 break;
1863 case nsl_fit_model_growth:
1864 text += QLatin1String(nsl_fit_model_growth_name[fitData.modelType]);
1865 break;
1866 case nsl_fit_model_distribution:
1867 text += QLatin1String(nsl_sf_stats_distribution_name[fitData.modelType]);
1868 break;
1869 case nsl_fit_model_custom:
1870 text += i18n("Custom");
1871 }
1872
1873 text += QStringLiteral(": ") + fitData.model + NEWLINE + NEWLINE;
1874 DEBUG(Q_FUNC_INFO << ", model: " << fitData.model.toStdString())
1875
1876 // TODO: errors? (see Origin)
1877 // TODO: weighting? (see Origin)
1878
1879 // parameter
1880 text += i18n("PARAMETERS") + NEWLINE + NEWLINE;
1881
1882 int np = fitResult.paramValues.size();
1883
1884 auto valueString = i18n("Value");
1885 auto errorString = i18n("Uncertainty");
1886 auto errorPString = i18n("Uncertainty, %");
1887 auto tValueString = i18n("t Statistic");
1888 auto pValueString = QStringLiteral("P > |t|");
1889 auto lowerString = i18n("Lower");
1890 auto upperString = i18n("Upper");
1891 int maxParameterLength = 0;
1892 int maxValueLength = valueString.size();
1893 int maxErrorLength = errorString.size();
1894 int maxErrorPLength = errorPString.size();
1895 int maxTValueLength = tValueString.size();

Callers 1

loadMethod · 0.80

Calls 9

toStdStringMethod · 0.80
lengthMethod · 0.80
QStringClass · 0.50
nameMethod · 0.45
toStringMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
setTextMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected