CFEL - ASG Software Suite
2.5.0
CASS
|
a viewer that displays 2d data More...
#include <two_d_viewer.h>
Public Member Functions | |
TwoDViewer (QString title, QWidget *parent=0) | |
constructor More... | |
virtual | ~TwoDViewer () |
destructor More... | |
virtual QList< Data * > | data () |
set the data to display More... | |
virtual QString | type () const |
retrieve the type of the data viewer More... | |
virtual void | saveData (const QString &filename) |
save the data to file More... | |
virtual void | dataChanged () |
update the plot More... | |
virtual QStringList | dataFileSuffixes () const |
suffixes for the data of this viewer More... | |
![]() | |
DataViewer (QString title, QWidget *parent) | |
constructor More... | |
virtual | ~DataViewer () |
destructor More... | |
virtual void | print () const |
print the plot More... | |
![]() | |
TabShape | |
ToolButtonStyle | |
QMainWindow (QWidget *parent=0, Qt::WindowFlags flags=0) | |
addDockWidget (Qt::DockWidgetArea area, QDockWidget *dockwidget) | |
addDockWidget (Qt::DockWidgetArea area, QDockWidget *dockwidget, Qt::Orientation orientation) | |
addToolBar (Qt::ToolBarArea area, QToolBar *toolbar) | |
addToolBar (QToolBar *toolbar) | |
addToolBar (const QString &title) | |
addToolBarBreak (Qt::ToolBarArea area=Qt::TopToolBarArea) | |
centralWidget () | |
contextMenuEvent (QContextMenuEvent *event) | |
DockWidgetArea QMainWindow::corner(Qt::Corner corner) | |
createPopupMenu () | |
DockWidgetArea QMainWindow::dockWidgetArea(QDockWidget *dockwidget) | |
event (QEvent *event) | |
iconSizeChanged (const QSize &iconSize) | |
insertToolBar (QToolBar *before, QToolBar *toolbar) | |
insertToolBarBreak (QToolBar *before) | |
menuBar () | |
menuWidget () | |
removeDockWidget (QDockWidget *dockwidget) | |
removeToolBar (QToolBar *toolbar) | |
removeToolBarBreak (QToolBar *before) | |
restoreDockWidget (QDockWidget *dockwidget) | |
restoreState (const QByteArray &state, int version=0) | |
saveState (int version=0) | |
setCentralWidget (QWidget *widget) | |
setCorner (Qt::Corner corner, Qt::DockWidgetArea area) | |
setMenuBar (QMenuBar *menuBar) | |
setMenuWidget (QWidget *menuBar) | |
setStatusBar (QStatusBar *statusbar) | |
setTabPosition (Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition) | |
splitDockWidget (QDockWidget *first, QDockWidget *second, Qt::Orientation orientation) | |
statusBar () | |
TabPosition QMainWindow::tabPosition(Qt::DockWidgetArea area) | |
tabifiedDockWidgets (QDockWidget *dockwidget) | |
tabifyDockWidget (QDockWidget *first, QDockWidget *second) | |
ToolBarArea QMainWindow::toolBarArea(QToolBar *toolbar) | |
toolBarBreak (QToolBar *toolbar) | |
toolButtonStyleChanged (Qt::ToolButtonStyle toolButtonStyle) | |
data () | |
iterator_category | |
const_iterator () | |
const_iterator (const iterator &other) | |
key () | |
value () | |
operator!= (const const_iterator &other) | |
operator* () | |
operator+ (int j) | |
operator++ () | |
operator++ (int) | |
operator+= (int j) | |
operator- (int j) | |
operator-- () | |
operator-- (int) | |
operator-= (int j) | |
operator-& gt;() | |
operator== (const const_iterator &other) | |
data () | |
iterator_category | |
iterator () | |
key () | |
value () | |
operator!= (const iterator &other) | |
operator!= (const const_iterator &other) | |
operator* () | |
operator+ (int j) | |
operator++ () | |
operator++ (int) | |
operator+= (int j) | |
operator- (int j) | |
operator-- () | |
operator-- (int) | |
operator-= (int j) | |
operator-& gt;() | |
operator== (const iterator &other) | |
operator== (const const_iterator &other) | |
erase (const Key &key) | |
insert (const Key &key, const T &value, bool overwrite) | |
remove (iterator it) | |
replace (const Key &key, const T &value) | |
Private Slots | |
void | replot () |
replot the data More... | |
void | on_load_geomfile_triggered () |
load the geom file More... | |
Private Member Functions | |
QwtLinearColorMap * | cmap (const int mapId, bool log) const |
retrieve a color id More... | |
QStringList | cmaps () const |
return the list of possible colormaps More... | |
Private Attributes | |
QwtPlotSpectrogram * | _spectrogram |
the spectrogram that is used to display the 2d data More... | |
MinMaxControl * | _zControl |
the z-scale control More... | |
QSpinBox * | _colorId |
the colorbar control More... | |
QAction * | _axisTitleControl |
an action to control the legend of curves More... | |
TrackZoomer2D * | _zoomer |
a zoomer for the 2d view More... | |
QString | _geomFile |
the geom file to convert data to lab frame More... | |
bool | _lutPresent |
the geom file to convert data to lab frame More... | |
cass::GeometryInfo::lookupTable_t | _lut |
the geom file to convert data to lab frame More... | |
cass::Result< float >::shared_pointer | _origHist |
the original histogram More... | |
bool | _isOriginalData |
flag to tell whether the data is the original data More... | |
Additional Inherited Members | |
![]() | |
void | viewerClosed (DataViewer *viewer) |
signal emitted when viewer is about to be destroyed More... | |
![]() | |
void | closeEvent (QCloseEvent *event) |
react when a close event is send to this viewer More... | |
void | moveEvent (QMoveEvent *event) |
receive move events to store the current position to the settings More... | |
void | resizeEvent (QResizeEvent *event) |
receive resize events to store the current size to the settings More... | |
![]() | |
QwtPlot * | _plot |
the plot inside which the data will be displayed More... | |
a viewer that displays 2d data
Definition at line 35 of file two_d_viewer.h.
constructor
title | the title of this viewer |
parent | The parent of this |
Definition at line 50 of file two_d_viewer.cpp.
References _axisTitleControl, _colorId, _geomFile, _isOriginalData, _lutPresent, jocassview::DataViewer::_plot, _spectrogram, _zControl, _zoomer, QToolBar::addAction(), QToolBar::addSeparator(), QMainWindow::addToolBar(), QToolBar::addWidget(), QSettings::beginGroup(), data(), QSettings::endGroup(), on_load_geomfile_triggered(), replot(), jocassview::TrackZoomer2D::setCameraDistance_cm(), QMainWindow::setCentralWidget(), jocassview::TrackZoomer2D::setData(), jocassview::TrackZoomer2D::setPixelSize_um(), QSpinBox::setRange(), jocassview::TrackZoomer2D::setWavelength_A(), size, and QSettings::value().
|
virtual |
destructor
Definition at line 133 of file two_d_viewer.cpp.
|
private |
retrieve a color id
the colormap needs be created on the heap and a pointer is then passed to the functions who will take over ownership and destroy the allocated space.
In case the mapId is unknown a standart black & white map is returned
mapId | the key of the requested color id |
log | if true a log scale color map will be returned |
Definition at line 361 of file two_d_viewer.cpp.
References map.
Referenced by replot().
|
private |
return the list of possible colormaps
Definition at line 508 of file two_d_viewer.cpp.
set the data to display
Implements jocassview::DataViewer.
Definition at line 138 of file two_d_viewer.cpp.
References _spectrogram, and QList::append().
Referenced by dataChanged(), replot(), saveData(), and TwoDViewer().
|
virtual |
update the plot
check if the zoomer is still valid and replot the plot
check if the data has really been updated, when it should original data
if the data is original, save the original histogram
reset flag
check if the user wants to convert cheetah layout to lab frame
create lookup table from the geom file if its not created yet
check if the data is different (the bounding box changed) in which case we reinitialize the zoomer @note the below will be done when zooming into the initial bounding rect
Reimplemented from jocassview::DataViewer.
Definition at line 174 of file two_d_viewer.cpp.
References _geomFile, _isOriginalData, _lut, _lutPresent, _origHist, _spectrogram, _zoomer, cass::Result< T >::begin(), cass::Result< T >::clone(), data(), cass::Result< T >::end(), front, cass::GeometryInfo::generateLookupTable(), QString::isEmpty(), cass::GeometryInfo::lookupTable_t::lut, cass::GeometryInfo::lookupTable_t::max, cass::GeometryInfo::lookupTable_t::min, cass::Result< T >::name(), cass::GeometryInfo::lookupTable_t::nCols, cass::GeometryInfo::lookupTable_t::nRows, replot(), cass::Result< T >::shape(), cass::Result< T >::size(), cass::GeometryInfo::pos_t::x, and cass::GeometryInfo::pos_t::y.
Referenced by on_load_geomfile_triggered().
|
virtual |
suffixes for the data of this viewer
Implements jocassview::DataViewer.
Definition at line 238 of file two_d_viewer.cpp.
|
privateslot |
load the geom file
reset the parameters
open dialogs and retrieve the requested info
Definition at line 300 of file two_d_viewer.cpp.
References _geomFile, _isOriginalData, _lutPresent, _zoomer, QSettings::beginGroup(), QString::clear(), QDir::currentPath(), dataChanged(), QSettings::endGroup(), QFileInfo::exists(), QInputDialog::getDouble(), QFileDialog::getOpenFileName(), QString::isEmpty(), jocassview::TrackZoomer2D::setCameraDistance_cm(), jocassview::TrackZoomer2D::setPixelSize_um(), QSettings::setValue(), jocassview::TrackZoomer2D::setWavelength_A(), and QSettings::value().
Referenced by TwoDViewer().
|
privateslot |
replot the data
get the data from the spectrogram and get the min and max z-values to be displayed
get the colormap to be used
set the colormap and min / max z-value
display the axis titles if requested
replot the plot
save the current settings
Definition at line 245 of file two_d_viewer.cpp.
References _axisTitleControl, _colorId, jocassview::DataViewer::_plot, _spectrogram, _zControl, jocassview::MinMaxControl::autoscale(), QSettings::beginGroup(), cmap(), data(), QSettings::endGroup(), QString::fromStdString(), jocassview::MinMaxControl::log(), jocassview::MinMaxControl::max(), jocassview::MinMaxControl::min(), jocassview::TwoDViewerData::origZInterval(), jocassview::TwoDViewerData::result(), and QSettings::setValue().
Referenced by dataChanged(), and TwoDViewer().
|
virtual |
save the data to file
filename | the file name to save the data to |
print a png of the whole widget if requested and the file doesn't exist
let the file handler handle the other formats
Implements jocassview::DataViewer.
Definition at line 150 of file two_d_viewer.cpp.
References data(), QFileInfo::exists(), front, QPixmap::save(), jocassview::FileHandler::saveData(), QFileInfo::suffix(), and QString::toUpper().
|
virtual |
retrieve the type of the data viewer
Implements jocassview::DataViewer.
Definition at line 145 of file two_d_viewer.cpp.
|
private |
an action to control the legend of curves
Definition at line 118 of file two_d_viewer.h.
Referenced by replot(), and TwoDViewer().
|
private |
the colorbar control
Definition at line 115 of file two_d_viewer.h.
Referenced by replot(), and TwoDViewer().
|
private |
the geom file to convert data to lab frame
Definition at line 124 of file two_d_viewer.h.
Referenced by dataChanged(), on_load_geomfile_triggered(), and TwoDViewer().
|
private |
flag to tell whether the data is the original data
Definition at line 136 of file two_d_viewer.h.
Referenced by dataChanged(), on_load_geomfile_triggered(), and TwoDViewer().
|
private |
the geom file to convert data to lab frame
Definition at line 130 of file two_d_viewer.h.
Referenced by dataChanged().
|
private |
the geom file to convert data to lab frame
Definition at line 127 of file two_d_viewer.h.
Referenced by dataChanged(), on_load_geomfile_triggered(), and TwoDViewer().
|
private |
|
private |
the spectrogram that is used to display the 2d data
Definition at line 109 of file two_d_viewer.h.
Referenced by data(), dataChanged(), replot(), and TwoDViewer().
|
private |
the z-scale control
Definition at line 112 of file two_d_viewer.h.
Referenced by replot(), and TwoDViewer().
|
private |
a zoomer for the 2d view
Definition at line 121 of file two_d_viewer.h.
Referenced by dataChanged(), on_load_geomfile_triggered(), and TwoDViewer().