Skip to content
Snippets Groups Projects
Commit c18c6eda authored by Petar Trifunovic's avatar Petar Trifunovic
Browse files

Update texture extraction max plotted bins

parent 1b1a4c71
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,8 @@ extern MolFlow* mApp; ...@@ -37,6 +37,8 @@ extern MolFlow* mApp;
extern SynRad* mApp; extern SynRad* mApp;
#endif #endif
constexpr size_t max_plotted_bins = 3000;
TextureExtraction::TextureExtraction(InterfaceGeometry* g, Worker* w) : GLWindow() { TextureExtraction::TextureExtraction(InterfaceGeometry* g, Worker* w) : GLWindow() {
interfGeom = g; interfGeom = g;
work = w; work = w;
...@@ -1271,9 +1273,9 @@ void TextureExtraction::AddView() { ...@@ -1271,9 +1273,9 @@ void TextureExtraction::AddView() {
Refresh(); Refresh();
if (nbBins > 1000) { // Add a warning if there are more than 1000 bins if (nbBins > max_plotted_bins) { // Add a warning if there are more than max_plotted_bins bins
GLMessageBox::Display("For performance reasons only the first 1000 bins will be plotted.\n" GLMessageBox::Display(fmt::format("For performance reasons only the first {} bins will be plotted.\n"
"You can still get the data for all the bins by using the Copy all data button.", "More than 1000 bins", { "OK" }, GLDLG_ICONWARNING); "You can still get the data for all the bins by using the Copy all data button.", max_plotted_bins), fmt::format("More than {} bins", max_plotted_bins), { "OK" }, GLDLG_ICONWARNING);
} }
} }
...@@ -1386,7 +1388,7 @@ void TextureExtraction::RefreshChart() { ...@@ -1386,7 +1388,7 @@ void TextureExtraction::RefreshChart() {
if (work->globalStatCache.globalHits.nbDesorbed > 0) { if (work->globalStatCache.globalHits.nbDesorbed > 0) {
int mode = physicalModeCombo->GetSelectedIndex(); int mode = physicalModeCombo->GetSelectedIndex();
auto [dataSumsPerBin, areaSumsPerBin] = CalculateViewValues(item, mode); auto [dataSumsPerBin, areaSumsPerBin] = CalculateViewValues(item, mode);
size_t plotLimit = std::min(dataSumsPerBin.size(), (size_t)1000); size_t plotLimit = std::min(dataSumsPerBin.size(), max_plotted_bins);
double xScaleFactor = 1; double xScaleFactor = 1;
switch (xScaleCombo->GetSelectedIndex()) { // Choose the right scaling factor for x axis switch (xScaleCombo->GetSelectedIndex()) { // Choose the right scaling factor for x axis
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment