|
SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
|
Abstract base class providing common serialization and visualization interface. More...
#include <interface.h>


Public Member Functions | |
| Interface () | |
| Default constructor. | |
| Interface (const Interface &intf) | |
| Copy constructor. | |
| Interface & | operator= (const Interface &intf) |
| Assignment operator. | |
| virtual string | ToString () const |
| Convert object to string representation. | |
| virtual QJsonObject | toJsonObject () const |
| Serialize object to JSON format. | |
| virtual bool | ReadFromJsonObject (const QJsonObject &jsonobject) |
| Deserialize object from JSON format. | |
| virtual bool | writetofile (QFile *file) |
| Write object data to a file. | |
| virtual bool | Read (const QStringList &strlist) |
| Parse object data from a string list. | |
| virtual QTableWidget * | ToTable () |
| Create a Qt table widget representation of the data. | |
| string | GetNotes () const |
| Get the notes/annotations associated with this object. | |
| void | SetNotes (const string ¬e) |
| Set the notes for this object, replacing any existing notes. | |
| void | AppendtoNotes (const string ¬e) |
| Append a note to existing notes. | |
| void | ClearNotes () |
| Clear all notes associated with this object. | |
| void | SetLimit (_range lowhigh, const double &value) |
| Set upper or lower limit for value highlighting. | |
| void | SetOption (options_key opt, bool val) |
| Set a configuration option. | |
| bool | Option (options_key opt) |
| Get the current value of a configuration option. | |
| options & | GetOptions () |
| Get reference to the options structure. | |
| QString | XAxisLabel () const |
| Get the X-axis label. | |
| QString | YAxisLabel () const |
| Get the Y-axis label. | |
| bool | SetXAxisLabel (const QString &label) |
| Set the X-axis label. | |
| bool | SetYAxisLabel (const QString &label) |
| Set the Y-axis label. | |
Public Attributes | |
| double | lowlimit |
| Lower threshold for value highlighting (when enabled) | |
| double | highlimit |
| Upper threshold for value highlighting (when enabled) | |
| bool | highlightoutsideoflimit = false |
| Flag indicating whether to highlight values outside defined limits. | |
Private Attributes | |
| string | Notes |
| Textual annotations and metadata about the data. | |
| options | Options |
| Configuration options for serialization and display. | |
| QString | XAxis_Label = "Sample" |
| Label for the X-axis in plots and table headers. | |
| QString | YAxis_Label = "Value" |
| Label for the Y-axis in plots and table headers. | |
Abstract base class providing common serialization and visualization interface.
Interface serves as an abstract base class for data structures that need to be:
This class provides a unified interface for data handling across the application, ensuring consistent behavior for file I/O, JSON serialization, and Qt integration.
Derived classes must implement the virtual methods to provide specific serialization and visualization behavior appropriate to their data structure.
Definition at line 64 of file interface.h.
| Interface::Interface | ( | ) |
Default constructor.
Initializes an Interface object with default settings:
Definition at line 3 of file interface.cpp.
| Interface::Interface | ( | const Interface & | intf | ) |
Copy constructor.
| intf | The Interface object to copy from |
Creates a deep copy of another Interface object, including all configuration options, axis labels, notes, and limit settings.
Definition at line 8 of file interface.cpp.
References Options, XAxis_Label, and YAxis_Label.
|
inline |
Append a note to existing notes.
| note | The note text to append |
If notes are empty, sets the note directly. Otherwise, appends with semicolon separator ("; ") for readability.
Definition at line 196 of file interface.h.
References Notes.
Referenced by Elemental_Profile_Set::DetectOutliers().
|
inline |
Clear all notes associated with this object.
Definition at line 207 of file interface.h.
References Notes.
|
inline |
Get the notes/annotations associated with this object.
Notes are used to store warnings, outlier information, QA/QC flags, or other metadata about the data.
Definition at line 177 of file interface.h.
References Notes.
Referenced by SelectSampleTableModel::data().
|
inline |
Get reference to the options structure.
Provides direct access to all configuration options for batch modification or inspection.
Definition at line 275 of file interface.h.
References Options.
Referenced by Conductor::ExecuteLevenbergMarquardtBatch(), Conductor::ExecuteSourceVerify(), Results::ReadFromJson(), and CMBTimeSeriesSet::ToTable().
Assignment operator.
| intf | The Interface object to copy from |
Copies all data and settings from another Interface object.
Definition at line 14 of file interface.cpp.
References Options, XAxis_Label, and YAxis_Label.
Referenced by CMBVectorSet::operator=(), CMBVectorSetSet::operator=(), Contribution::operator=(), Elemental_Profile::operator=(), Elemental_Profile_Set::operator=(), MultipleLinearRegression::operator=(), MultipleLinearRegressionSet::operator=(), Range::operator=(), RangeSet::operator=(), and ResultItem::operator=().
|
inline |
Get the current value of a configuration option.
| opt | The option identifier to query |
Definition at line 261 of file interface.h.
References Options, single_column_x, and options::single_column_x.
Referenced by CMBTimeSeriesSet::ToTable().
|
virtual |
Parse object data from a string list.
| strlist | List of strings containing the data to parse |
Pure virtual method for text-based deserialization. Each string in the list typically represents one line of input data.
Reimplemented in Elemental_Profile, Contribution, Elemental_Profile_Set, Range, and RangeSet.
Definition at line 43 of file interface.cpp.
|
virtual |
Deserialize object from JSON format.
| jsonobject | The JSON object to read from |
Pure virtual method for JSON deserialization. Derived classes must implement this to reconstruct their data structure from a JSON object.
Reimplemented in Elemental_Profile, CMBMatrix, CMBTimeSeries, CMBTimeSeriesSet, CMBVector, CMBVectorSet, CMBVectorSetSet, Contribution, Elemental_Profile_Set, MultipleLinearRegression, MultipleLinearRegressionSet, Range, and RangeSet.
Definition at line 32 of file interface.cpp.
|
inline |
Set upper or lower limit for value highlighting.
| lowhigh | Specifies whether setting high or low limit |
| value | The threshold value |
Sets the specified limit and automatically enables highlighting. Values outside [lowlimit, highlimit] will be highlighted when displayed.
Definition at line 233 of file interface.h.
References high, highlightoutsideoflimit, highlimit, and lowlimit.
Referenced by Conductor::ExecuteANOVA(), Conductor::ExecuteCorrelationMatrix(), Conductor::ExecuteEDP(), Conductor::ExecuteEDPM(), Conductor::ExecuteOutlierAnalysis(), and Results::ReadFromJson().
|
inline |
Set the notes for this object, replacing any existing notes.
| note | The new note text |
Definition at line 185 of file interface.h.
References Notes.
|
inline |
Set a configuration option.
| opt | The option identifier to set |
| val | The boolean value to set |
Currently supports:
Definition at line 250 of file interface.h.
References Options, single_column_x, and options::single_column_x.
Referenced by Conductor::ExecuteLevenbergMarquardtBatch(), Conductor::ExecuteSourceVerify(), and Results::ReadFromJson().
|
inline |
Set the X-axis label.
| label | The new X-axis label |
Definition at line 307 of file interface.h.
References XAxis_Label.
Referenced by Elemental_Profile::ReadFromJsonObject(), CMBVector::ReadFromJsonObject(), and ResultItem::setXAxisTitle().
|
inline |
Set the Y-axis label.
| label | The new Y-axis label |
Definition at line 317 of file interface.h.
References YAxis_Label.
Referenced by Elemental_Profile::ReadFromJsonObject(), and ResultItem::setYAxisTitle().
|
virtual |
Serialize object to JSON format.
Pure virtual method for JSON serialization. Derived classes must implement this to convert their data structure to a JSON object suitable for saving to .json files or transmitting over network.
Reimplemented in CMBMatrix, CMBTimeSeries, CMBTimeSeriesSet, CMBVector, CMBVectorSet, CMBVectorSetSet, Contribution, Elemental_Profile, Elemental_Profile_Set, MultipleLinearRegression, MultipleLinearRegressionSet, Range, and RangeSet.
Definition at line 27 of file interface.cpp.
Referenced by Results::toJsonObject().
|
virtual |
Convert object to string representation.
Pure virtual method that must be implemented by derived classes to provide a human-readable string representation of their data. Typically used for text file export or debugging.
Reimplemented in CMBMatrix, CMBTimeSeries, CMBTimeSeriesSet, CMBVector, CMBVectorSet, CMBVectorSetSet, Contribution, Elemental_Profile, Elemental_Profile_Set, MultipleLinearRegression, MultipleLinearRegressionSet, Range, and RangeSet.
Definition at line 22 of file interface.cpp.
Referenced by ResultsWindow::AppendResult().
|
virtual |
Create a Qt table widget representation of the data.
Pure virtual method that creates a visual table representation of the object's data suitable for display in the Qt GUI. The returned widget is dynamically allocated and should be managed by Qt's parent-child ownership system.
Reimplemented in CMBMatrix, CMBTimeSeries, CMBTimeSeriesSet, CMBVector, CMBVectorSet, CMBVectorSetSet, Contribution, Elemental_Profile, Elemental_Profile_Set, MultipleLinearRegressionSet, and RangeSet.
Definition at line 48 of file interface.cpp.
|
virtual |
Write object data to a file.
| file | Pointer to an open QFile object for writing |
Pure virtual method for file output. Derived classes implement this to write their data to an open file stream in their preferred text format.
Reimplemented in CMBTimeSeries, CMBTimeSeriesSet, Contribution, Range, RangeSet, CMBMatrix, CMBVector, CMBVectorSet, CMBVectorSetSet, Elemental_Profile, and Elemental_Profile_Set.
Definition at line 38 of file interface.cpp.
|
inline |
Get the X-axis label.
X-axis labels are used in plots and table headers to identify the independent variable or sample identifier.
Definition at line 287 of file interface.h.
References XAxis_Label.
Referenced by CMBVector::toJsonObject(), Elemental_Profile::toJsonObject(), CMBVector::ToString(), and ResultItem::XAxisTitle().
|
inline |
Get the Y-axis label.
Y-axis labels are used in plots and table headers to identify the dependent variable or measurement type (e.g., "Concentration (mg/kg)").
Definition at line 298 of file interface.h.
References YAxis_Label.
Referenced by CMBVector::toJsonObject(), Elemental_Profile::toJsonObject(), CMBVector::ToString(), CMBVector::ToTable(), Elemental_Profile::ToTable(), and ResultItem::YAxisTitle().
| bool Interface::highlightoutsideoflimit = false |
Flag indicating whether to highlight values outside defined limits.
When true, the ToTable() method will highlight cells with values outside the range [lowlimit, highlimit] in red, useful for identifying outliers or quality control issues.
Definition at line 221 of file interface.h.
Referenced by CMBMatrix::CMBMatrix(), CMBVector::CMBVector(), CMBMatrix::operator=(), CMBVector::operator=(), SetLimit(), CMBMatrix::ToTable(), CMBTimeSeries::ToTable(), CMBVector::ToTable(), Elemental_Profile::ToTable(), and Elemental_Profile_Set::ToTable().
| double Interface::highlimit |
Upper threshold for value highlighting (when enabled)
Definition at line 212 of file interface.h.
Referenced by CMBMatrix::CMBMatrix(), CMBVector::CMBVector(), CMBMatrix::operator=(), CMBVector::operator=(), SetLimit(), CMBMatrix::ToTable(), CMBTimeSeries::ToTable(), CMBVector::ToTable(), Elemental_Profile::ToTable(), and Elemental_Profile_Set::ToTable().
| double Interface::lowlimit |
Lower threshold for value highlighting (when enabled)
Definition at line 211 of file interface.h.
Referenced by CMBMatrix::CMBMatrix(), CMBVector::CMBVector(), CMBMatrix::operator=(), CMBVector::operator=(), SetLimit(), CMBMatrix::ToTable(), CMBTimeSeries::ToTable(), CMBVector::ToTable(), Elemental_Profile::ToTable(), and Elemental_Profile_Set::ToTable().
|
private |
Textual annotations and metadata about the data.
Stores semicolon-separated notes such as outlier warnings, QA/QC flags, or processing history. Can be displayed to users or included in reports.
Definition at line 330 of file interface.h.
Referenced by AppendtoNotes(), ClearNotes(), GetNotes(), and SetNotes().
|
private |
Configuration options for serialization and display.
Contains settings that control how data is formatted during export and how it should be interpreted during import.
Definition at line 338 of file interface.h.
Referenced by Interface(), GetOptions(), operator=(), Option(), and SetOption().
|
private |
Label for the X-axis in plots and table headers.
Default is "Sample" but can be customized to reflect the actual independent variable (e.g., "Time", "Distance", "Sample ID").
Definition at line 346 of file interface.h.
Referenced by Interface(), operator=(), SetXAxisLabel(), and XAxisLabel().
|
private |
Label for the Y-axis in plots and table headers.
Default is "Value" but should be customized to reflect the measurement type and units (e.g., "Lead Concentration (mg/kg)", "δ15N (‰)").
Definition at line 354 of file interface.h.
Referenced by Interface(), operator=(), SetYAxisLabel(), and YAxisLabel().