UltraScan III
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions
US_Noise Class Reference

Noise Vector object. More...

#include "us_noise.h"

Public Types

enum  NoiseType { RI, TI }
 Types of noise: radially-invariant or time-invariant. More...
 

Public Member Functions

 US_Noise ()
 Create a noise vector object. More...
 
int load (bool, const QString &, US_DB2 *=0)
 
int load (const QString &, US_DB2 *)
 
int load (const QString &)
 
bool operator== (const US_Noise &) const
 Compare two noise objects for equality. More...
 
bool operator!= (const US_Noise &n) const
 Compare two noise objects for non-equality. More...
 
int write (bool, const QString &, US_DB2 *=0)
 
int write (US_DB2 *)
 
int write (const QString &)
 
int apply_to_data (US_DataIO::EditedData &, bool=true)
 
bool sum_noise (US_Noise, bool=false)
 

Static Public Member Functions

static int apply_noise (US_DataIO::EditedData &, US_Noise *=0, bool=true)
 
static bool noise_path (QString &)
 
static bool sum_noises (US_Noise &, US_Noise, bool=false)
 

Public Attributes

NoiseType type
 Type of noise: RI or TI. More...
 
QString description
 String describing the noise set. More...
 
QString noiseGUID
 Global ID of this noise. More...
 
QString modelGUID
 Global ID of parent model object. More...
 
double minradius
 Minimum radius value for TI type. More...
 
double maxradius
 Maximum radius value for TI type. More...
 
int count
 Number of noise values in the vector. More...
 
QVector< double > values
 Vector of noise values. More...
 
QString message
 Used internally for communication. More...
 

Private Member Functions

int load_disk (const QString &)
 
int load_db (const QString &, US_DB2 *)
 
int load_stream (QXmlStreamReader &)
 
void write_stream (QXmlStreamWriter &)
 
void debug (void)
 

Detailed Description

Noise Vector object.

This class sets up a noise vector of time-invariant or radially-invariant values. It provides an interface to read and write values in the database or in local disk files.

Definition at line 17 of file us_noise.h.

Member Enumeration Documentation

Types of noise: radially-invariant or time-invariant.

Enumerator
RI 
TI 

Definition at line 24 of file us_noise.h.

Constructor & Destructor Documentation

US_Noise::US_Noise ( )

Create a noise vector object.

Definition at line 11 of file us_noise.cpp.

Member Function Documentation

int US_Noise::apply_noise ( US_DataIO::EditedData editdata,
US_Noise noise = 0,
bool  remove = true 
)
static

Static function to apply a noise vector to an EditedData set.

Parameters
editdataReference to EditedData set to apply to.
noisePointer to noise to apply to data (ti or ri).
removeFlag to remove (true) or add back (false) noise.
Returns
Noise apply status (< 0 if error): 0 iff noise subtracted/added. 1 iff null noise or noise count==0. -1 iff noise count does not match readings count -2 iff noise count does not match scan count

Definition at line 281 of file us_noise.cpp.

int US_Noise::apply_to_data ( US_DataIO::EditedData editdata,
bool  remove = true 
)

Apply a noise vector to an EditedData set.

Parameters
editdataReference to EditedData set to apply to.
removeFlag to remove (true) or add back (false) noise.
Returns
Noise apply status (< 0 if error): 0 iff noise subtracted/added. 1 iff null noise or noise count==0. -1 iff noise count does not match readings count -2 iff noise count does not match scan count

Definition at line 221 of file us_noise.cpp.

void US_Noise::debug ( void  )
private

Definition at line 427 of file us_noise.cpp.

int US_Noise::load ( bool  db_access,
const QString &  guid,
US_DB2 db = 0 
)

Read a noise vector from the disk or database

Parameters
db_accessA flag to indicate if the DB (true) or disk (false) should be searched for the noise vector
guidThe guid of the noise vector to be loaded
dbFor DB access, pointer to an open database connection
Returns
The US_DB2 return code for the operation

Definition at line 41 of file us_noise.cpp.

int US_Noise::load ( const QString &  id,
US_DB2 db 
)

An overloaded function to read a noise vector from a database

Parameters
idThe DB ID of the desired Noise record
dbA pointer to an open database connection
Returns
The US_DB2 return code for the operation

Definition at line 48 of file us_noise.cpp.

int US_Noise::load ( const QString &  filename)

An overloaded function to read a noise vector from the disk

Parameters
filenameThe name, including full path, of the noise XML file
Returns
The US_DB2 return code for the operation

Definition at line 66 of file us_noise.cpp.

int US_Noise::load_db ( const QString &  guid,
US_DB2 db 
)
private

Definition at line 367 of file us_noise.cpp.

int US_Noise::load_disk ( const QString &  guid)
private

Definition at line 313 of file us_noise.cpp.

int US_Noise::load_stream ( QXmlStreamReader &  xml)
private

Definition at line 82 of file us_noise.cpp.

bool US_Noise::noise_path ( QString &  path)
static

Static function to find and, if need be, create noise directory path.

Parameters
pathA reference to the full disk path for the directory into which to write the noise vector file.
Returns
Success if the path is found or created and failure if the path cannot be created

Definition at line 296 of file us_noise.cpp.

bool US_Noise::operator!= ( const US_Noise n) const
inline

Compare two noise objects for non-equality.

Definition at line 64 of file us_noise.h.

bool US_Noise::operator== ( const US_Noise n) const

Compare two noise objects for equality.

Definition at line 24 of file us_noise.cpp.

bool US_Noise::sum_noise ( US_Noise  noise2,
bool  always_sum = false 
)

Sum a second noise vector into a noise vector

Parameters
noise2A second noise object to sum into current noise
always_sumFlag if summing should proceed even with mismatch
Returns
Flag if summing was performed.

Definition at line 446 of file us_noise.cpp.

bool US_Noise::sum_noises ( US_Noise noise1,
US_Noise  noise2,
bool  always_sum = false 
)
static

Static function to sum two noise vectors

Parameters
noise1A first noise object into which to sum a second
noise2A second noise object to sum into the first
always_sumFlag if summing should proceed even with mismatch
Returns
Flag if summing was performed.

Definition at line 528 of file us_noise.cpp.

int US_Noise::write ( bool  db_access,
const QString &  filename,
US_DB2 db = 0 
)

Write a noise vector to the disk or database

Parameters
db_accessA flag to indicate if the DB (true) or disk (false) should be used to save the noise vector
filenameThe filename (with path) where the xml file is to be written if disk access is specified
dbFor DB access, pointer to an open database connection
Returns
The US_DB2 return code for the operation

Definition at line 128 of file us_noise.cpp.

int US_Noise::write ( US_DB2 db)

An overloaded function to write a noise vector to the DB

Parameters
dbA pointer to an open database connection
Returns
The US_DB2 return code for the operation

Definition at line 135 of file us_noise.cpp.

int US_Noise::write ( const QString &  filename)

An overloaded function to write a noise vector to a file on disk

Parameters
filenameThe filename to write
Returns
The US_DB2 return code for the operation

Definition at line 206 of file us_noise.cpp.

void US_Noise::write_stream ( QXmlStreamWriter &  xml)
private

Definition at line 382 of file us_noise.cpp.

Member Data Documentation

int US_Noise::count

Number of noise values in the vector.

Definition at line 35 of file us_noise.h.

QString US_Noise::description

String describing the noise set.

Definition at line 28 of file us_noise.h.

double US_Noise::maxradius

Maximum radius value for TI type.

Definition at line 33 of file us_noise.h.

QString US_Noise::message

Used internally for communication.

Definition at line 39 of file us_noise.h.

double US_Noise::minradius

Minimum radius value for TI type.

Definition at line 32 of file us_noise.h.

QString US_Noise::modelGUID

Global ID of parent model object.

Definition at line 30 of file us_noise.h.

QString US_Noise::noiseGUID

Global ID of this noise.

Definition at line 29 of file us_noise.h.

NoiseType US_Noise::type

Type of noise: RI or TI.

Definition at line 26 of file us_noise.h.

QVector< double > US_Noise::values

Vector of noise values.

Definition at line 37 of file us_noise.h.


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