SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
targetsheet.h File Reference

Which sheet of a workbook holds the target samples. More...

#include <QStringList>
Include dependency graph for targetsheet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int GuessTargetSheet (const QStringList &sheets)
 Index of the sheet whose name says it holds the target samples.

Detailed Description

Which sheet of a workbook holds the target samples.

Only one group in a project is the target; every other group is a source group. Which one it is cannot be read from the data, so the user says so when importing a workbook, and the answer is stored in the project file.

Getting it wrong is costly and quiet. A source group put in the target's place is left out of every source list in the program, because those lists hold the source groups only, and the unmixing then runs against its samples instead of the real target samples. Both look like the program misbehaving rather than like a wrong setting.

Definition in file targetsheet.h.

Function Documentation

◆ GuessTargetSheet()

int GuessTargetSheet ( const QStringList & sheets)

Index of the sheet whose name says it holds the target samples.

Used to preselect a row in the import dialog. A workbook's sheet order says nothing about which sheet is the target, so the sheet is looked for by name instead: "target", "sink" or "mixture", matched as a substring, ignoring case and surrounding spaces.

Returns -1 unless exactly one sheet matches, so an ambiguous workbook (say, "Target" and "Target old") preselects nothing and the choice stays with the user: no guess is better than a wrong one.

Parameters
sheetsSheet names, in the order they are shown
Returns
Index into sheets, or -1 if no single sheet matches

Definition at line 6 of file targetsheet.cpp.

References name.

Referenced by IndicateSheetsDialog::Populate_Table().