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

#include </home/runner/work/SedSat3/SedSat3/range.h>

Inheritance diagram for Range:
Inheritance graph
Collaboration diagram for Range:
Collaboration graph

Public Member Functions

 Range ()
 
 Range (const Range &rhs)
 
Rangeoperator= (const Range &rhs)
 
QJsonObject toJsonObject () const override
 Serialize object to JSON format.
 
bool ReadFromJsonObject (const QJsonObject &jsonobject) override
 Deserialize object from JSON format.
 
string ToString () const override
 Convert object to string representation.
 
bool writetofile (QFile *) override
 Write object data to a file.
 
bool Read (const QStringList &strlist) override
 Parse object data from a string list.
 
void Set (_range lowhigh, const double &value)
 
double Get (_range lowhigh) const
 
double Mean () const
 
void SetMean (const double &m)
 
double Median () const
 
void SetMedian (const double &m)
 
void SetValue (const double value)
 
double GetValue ()
 
- Public Member Functions inherited from Interface
 Interface ()
 Default constructor.
 
 Interface (const Interface &intf)
 Copy constructor.
 
Interfaceoperator= (const Interface &intf)
 Assignment operator.
 
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 &note)
 Set the notes for this object, replacing any existing notes.
 
void AppendtoNotes (const string &note)
 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.
 
optionsGetOptions ()
 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.
 

Private Attributes

vector< double > range
 
double median = 0
 
double mean = 0
 
double observed_value =0
 

Additional Inherited Members

- Public Attributes inherited from Interface
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.
 

Detailed Description

Definition at line 7 of file range.h.

Constructor & Destructor Documentation

◆ Range() [1/2]

Range::Range ( )

Definition at line 6 of file range.cpp.

References range.

◆ Range() [2/2]

Range::Range ( const Range rhs)

Definition at line 11 of file range.cpp.

References mean, median, observed_value, and range.

Member Function Documentation

◆ Get()

double Range::Get ( _range  lowhigh) const

Definition at line 71 of file range.cpp.

References high, and range.

Referenced by SourceSinkData::MCMC_Batch().

◆ GetValue()

double Range::GetValue ( )
inline

Definition at line 25 of file range.h.

References observed_value.

◆ Mean()

double Range::Mean ( ) const
inline

Definition at line 20 of file range.h.

References mean.

Referenced by SourceSinkData::MCMC_Batch().

◆ Median()

double Range::Median ( ) const
inline

Definition at line 22 of file range.h.

References median.

Referenced by SourceSinkData::MCMC_Batch().

◆ operator=()

Range & Range::operator= ( const Range rhs)

Definition at line 18 of file range.cpp.

References mean, median, observed_value, Interface::operator=(), and range.

◆ Read()

bool Range::Read ( const QStringList &  strlist)
overridevirtual

Parse object data from a string list.

Parameters
strlistList of strings containing the data to parse
Returns
true if parsing was successful, false otherwise

Pure virtual method for text-based deserialization. Each string in the list typically represents one line of input data.

Note
Format and parsing rules are determined by the derived class

Reimplemented from Interface.

Definition at line 59 of file range.cpp.

◆ ReadFromJsonObject()

bool Range::ReadFromJsonObject ( const QJsonObject &  jsonobject)
overridevirtual

Deserialize object from JSON format.

Parameters
jsonobjectThe JSON object to read from
Returns
true if deserialization was successful, false otherwise

Pure virtual method for JSON deserialization. Derived classes must implement this to reconstruct their data structure from a JSON object.

Warning
Implementations should validate JSON structure and handle missing fields gracefully

Reimplemented from Interface.

Definition at line 40 of file range.cpp.

References mean, median, observed_value, and range.

Referenced by RangeSet::ReadFromJsonObject().

◆ Set()

void Range::Set ( _range  lowhigh,
const double &  value 
)

Definition at line 64 of file range.cpp.

References high, and range.

Referenced by SourceSinkData::BootStrap(), and SourceSinkData::MCMC().

◆ SetMean()

void Range::SetMean ( const double &  m)
inline

Definition at line 21 of file range.h.

References mean.

Referenced by SourceSinkData::BootStrap(), and SourceSinkData::MCMC().

◆ SetMedian()

void Range::SetMedian ( const double &  m)
inline

Definition at line 23 of file range.h.

References median.

Referenced by SourceSinkData::BootStrap(), and SourceSinkData::MCMC().

◆ SetValue()

void Range::SetValue ( const double  value)
inline

Definition at line 24 of file range.h.

References observed_value.

Referenced by SourceSinkData::MCMC().

◆ toJsonObject()

QJsonObject Range::toJsonObject ( ) const
overridevirtual

Serialize object to JSON format.

Returns
QJsonObject containing the serialized data

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.

Note
The JSON structure is determined by the derived class

Reimplemented from Interface.

Definition at line 28 of file range.cpp.

References mean, median, observed_value, and range.

◆ ToString()

string Range::ToString ( ) const
overridevirtual

Convert object to string representation.

Returns
String representation of the object's data

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.

Note
Format is determined by the derived class implementation

Reimplemented from Interface.

Definition at line 50 of file range.cpp.

References range.

Referenced by writetofile().

◆ writetofile()

bool Range::writetofile ( QFile *  file)
overridevirtual

Write object data to a file.

Parameters
filePointer to an open QFile object for writing
Returns
true if write was successful, false otherwise

Pure virtual method for file output. Derived classes implement this to write their data to an open file stream in their preferred text format.

Precondition
file must be opened in write mode
Note
File is not closed by this method

Reimplemented from Interface.

Definition at line 54 of file range.cpp.

References ToString().

Member Data Documentation

◆ mean

double Range::mean = 0
private

◆ median

double Range::median = 0
private

Definition at line 28 of file range.h.

Referenced by Range(), Median(), operator=(), ReadFromJsonObject(), SetMedian(), and toJsonObject().

◆ observed_value

double Range::observed_value =0
private

Definition at line 30 of file range.h.

Referenced by Range(), GetValue(), operator=(), ReadFromJsonObject(), SetValue(), and toJsonObject().

◆ range

vector<double> Range::range
private

Definition at line 27 of file range.h.

Referenced by Range(), Range(), Get(), operator=(), ReadFromJsonObject(), Set(), toJsonObject(), and ToString().


The documentation for this class was generated from the following files: