CFEL - ASG Software Suite
2.5.0
CASS
|
the 1d data wrapper More...
#include <one_d_viewer_data.h>
Public Member Functions | |
OneDViewerData () | |
default constructor More... | |
virtual | ~OneDViewerData () |
destructor More... | |
virtual size_t | size () const |
return the size of the data More... | |
virtual QPointF | sample (size_t i) const |
return the x value for data point More... | |
virtual QRectF | boundingRect () const |
return the bounding rectangle More... | |
void | setResult (result_t::shared_pointer result) |
set the cass data to be wrapped by this More... | |
Data::result_t::shared_pointer | result () |
retrieve pointer to the cass data More... | |
const Data::result_t::shared_pointer | result () const |
retrieve const pointer to the cass data More... | |
void | setXRangeForLog (bool log) |
set up the bounding rect for when x should be log scale More... | |
void | setYRangeForLog (bool log) |
set up the bounding rect for when y should be log scale More... | |
![]() | |
Data () | |
constructor More... | |
virtual | ~Data () |
virtual destrutor More... | |
virtual void | setResult (result_t::shared_pointer result)=0 |
fill the data with the result More... | |
virtual void | setSourceName (const QString &name) |
set the source name More... | |
virtual QString | sourceName () const |
retrieve the source name More... | |
virtual bool | wasUpdated () const |
retrieve was upDated flag More... | |
Public Attributes | |
QPointF | _logMinPos |
the minimum positions in x and y for log scales More... | |
bool | _xLog |
flag to tell whether x scale will be drawn in log More... | |
bool | _yLog |
flag to tell whether y scale will be drawn in log More... | |
result_t::shared_pointer | _result |
pointer to the cass data More... | |
Additional Inherited Members | |
![]() | |
typedef cass::Result< float > | result_t |
define the result type More... | |
![]() | |
QString | _sourceName |
the name of the source More... | |
bool | _wasUpdated |
flag to tell whether the data was updated More... | |
the 1d data wrapper
Definition at line 32 of file one_d_viewer_data.h.
OneDViewerData::OneDViewerData | ( | ) |
default constructor
intializes the _hist pointer with 0
Definition at line 18 of file one_d_viewer_data.cpp.
|
virtual |
|
virtual |
return the bounding rectangle
Definition at line 49 of file one_d_viewer_data.cpp.
References _logMinPos, _xLog, _yLog, QRectF::setLeft(), QRectF::setTop(), QPointF::x(), and QPointF::y().
|
virtual |
retrieve pointer to the cass data
Implements jocassview::Data.
Definition at line 104 of file one_d_viewer_data.cpp.
References _result.
Referenced by sample(), setResult(), and size().
const Data::result_t::shared_pointer OneDViewerData::result | ( | ) | const |
retrieve const pointer to the cass data
Definition at line 109 of file one_d_viewer_data.cpp.
References _result.
|
virtual |
return the x value for data point
i | the datapoint whos x value should be returned |
Definition at line 36 of file one_d_viewer_data.cpp.
References result(), size(), cass::ACQIRIS::x, and cass::ACQIRIS::y.
Referenced by setResult().
void OneDViewerData::setResult | ( | result_t::shared_pointer | result | ) |
set the cass data to be wrapped by this
result | the cass data to be wrapped |
set the initial bounding rect in x
go through all data points of the curve and find min/max values for lin and log scale purposes
skip the check if the either coordinate of the point is not a number
find the max y value
find the min y value
find the min y value that is positive
find the min x value that is positive
Definition at line 59 of file one_d_viewer_data.cpp.
References _logMinPos, _result, result(), sample(), QPointF::setX(), QPointF::setY(), size(), QPointF::x(), cass::ACQIRIS::x, cass::Result< float >::xAxis, QPointF::y(), and cass::ACQIRIS::y.
Referenced by jocassview::OneDViewer::on_add_graph_triggered().
void OneDViewerData::setXRangeForLog | ( | bool | log | ) |
set up the bounding rect for when x should be log scale
in case of log-scale: find the minimum x value that is bigger than 0 and set Left to be that value.
in case of lin-scale: set Left to the lowest value
log | when this parameter is true the scale will be set up for log-scale otherwise for lin-scale |
Definition at line 114 of file one_d_viewer_data.cpp.
References _xLog.
Referenced by jocassview::OneDViewer::replot().
void OneDViewerData::setYRangeForLog | ( | bool | log | ) |
set up the bounding rect for when y should be log scale
in case of log-scale: find the minimum y value that is bigger than 0 and a valid number, set bottom to that value.
in case of lin-scale: set bottom to the lowest value
log | when this parameter is true the scale will be set up for log-scale otherwise for lin-scale |
Definition at line 119 of file one_d_viewer_data.cpp.
References _yLog.
Referenced by jocassview::OneDViewer::replot().
|
virtual |
return the size of the data
Definition at line 31 of file one_d_viewer_data.cpp.
References result().
Referenced by sample(), and setResult().
QPointF jocassview::OneDViewerData::_logMinPos |
the minimum positions in x and y for log scales
Definition at line 113 of file one_d_viewer_data.h.
Referenced by boundingRect(), and setResult().
result_t::shared_pointer jocassview::OneDViewerData::_result |
pointer to the cass data
Definition at line 122 of file one_d_viewer_data.h.
Referenced by result(), and setResult().
bool jocassview::OneDViewerData::_xLog |
flag to tell whether x scale will be drawn in log
Definition at line 116 of file one_d_viewer_data.h.
Referenced by boundingRect(), and setXRangeForLog().
bool jocassview::OneDViewerData::_yLog |
flag to tell whether y scale will be drawn in log
Definition at line 119 of file one_d_viewer_data.h.
Referenced by boundingRect(), and setYRangeForLog().