Brief description of class still missing. More...
#include <CurveProperties.h>
Signals | |
void | curveModified () |
void | nameChanged (QString n) |
Public Member Functions | |
void | curveChanged () |
CurveProperties (QWidget *parent=0) | |
void | cut (double minimum, double maximum, SamplingOptions options) |
CurveBrowserProxy * | proxy () const |
void | resample (int n, double minimum, double maximum, SamplingOptions options, bool distance) |
void | save () |
void | setCurrentLayer (LineLayer *layer) |
void | setEditable (bool e) |
void | setProxy (CurveBrowserProxy *proxy) |
void | showLog () |
void | smooth (double minimum, double maximum, SamplingOptions options) |
~CurveProperties () |
Brief description of class still missing.
Full description of class still missing
SciFigs::CurveProperties::CurveProperties | ( | QWidget * | parent = 0 | ) |
Description of constructor still missing
References TRACE.
: QWidget(parent) { TRACE; setupUi(this); CurveBrowserDelegate * delegate=new CurveBrowserDelegate(this); curveTable->setItemDelegate(delegate); connect(delegate, SIGNAL(dataChanged()), this, SLOT(applyAllSelected())); curveTable->setSelectionBehavior(QAbstractItemView::SelectItems); curveTable->setSelectionMode(QAbstractItemView::ExtendedSelection); curveTable->setEditTriggers(QAbstractItemView::AllEditTriggers); curveTable->resizeColumnsToContents(); _proxy=0; }
Description of destructor still missing
References SciFigs::CurveBrowserProxy::tag(), and TRACE.
References curveModified(), SciFigs::GraphContentLayer::deepUpdate(), SciFigs::CurveBrowserProxy::name(), SciFigs::CurveBrowserItem::reset(), and TRACE.
Referenced by SciFigs::CurveBrowser::average(), cut(), SciFigs::CurveBrowser::loadMultiColumns(), resample(), and smooth().
{ TRACE; CurveBrowserItem * model=static_cast<CurveBrowserItem *>(curveTable->model()); model->reset(); curveName->setText(_proxy->name()); _currentLayer->deepUpdate(); emit curveModified(); }
void SciFigs::CurveProperties::curveModified | ( | ) | [signal] |
Referenced by curveChanged(), and setProxy().
void SciFigs::CurveProperties::cut | ( | double | minimum, |
double | maximum, | ||
SamplingOptions | options | ||
) |
References SciFigs::CurveBrowserProxy::addLog(), curveChanged(), SciFigs::CurveBrowserProxy::cut(), QGpCoreTools::Function, QGpCoreTools::Interpole, QGpCoreTools::InversedScale, QGpCoreTools::tr(), TRACE, SciFigs::CurveBrowserProxy::xInversedUnit(), and SciFigs::CurveBrowserProxy::xUnit().
{ TRACE; if(minimum>maximum) { qSwap(minimum, maximum); } QString unit; options|=Function & Interpole; if(options & InversedScale) { unit=_proxy->xInversedUnit(); } else { unit=_proxy->xUnit(); } _proxy->cut(minimum, maximum, options); _proxy->addLog(tr("Cut from %2 %3 to %4 %5\n") .arg(minimum).arg(unit).arg(maximum).arg(unit) ); curveChanged(); }
void SciFigs::CurveProperties::nameChanged | ( | QString | n | ) | [signal] |
CurveBrowserProxy* SciFigs::CurveProperties::proxy | ( | ) | const [inline] |
Referenced by SciFigs::CurveBrowser::average(), SciFigs::CurveSelectorItem::data(), SciFigs::CurveBrowser::loadMultiColumns(), SciFigs::CurveBrowser::selectCurves(), and setProxy().
{return _proxy;}
void SciFigs::CurveProperties::resample | ( | int | n, |
double | minimum, | ||
double | maximum, | ||
SamplingOptions | options, | ||
bool | distance | ||
) |
References SciFigs::CurveBrowserProxy::addLog(), curveChanged(), QGpCoreTools::Function, QGpCoreTools::InversedScale, QGpCoreTools::LogScale, SciFigs::CurveBrowserProxy::maximumX(), SciFigs::CurveBrowserProxy::maximumY(), SciFigs::CurveBrowserProxy::minimumX(), SciFigs::CurveBrowserProxy::minimumY(), SciFigs::LineLayer::pointOptions(), SciFigs::CurveBrowserProxy::resample(), QGpCoreTools::tr(), TRACE, SciFigs::CurveBrowserProxy::xInversedName(), SciFigs::CurveBrowserProxy::xInversedUnit(), SciFigs::CurveBrowserProxy::xName(), and SciFigs::CurveBrowserProxy::xUnit().
{ TRACE; if(minimum>maximum) { qSwap(minimum, maximum); } QString sMode, unit; options|=Function; if(options & LogScale) { sMode=tr("log(%1)").arg(_proxy->xName()); unit=_proxy->xUnit(); } else if(options & InversedScale) { sMode=_proxy->xInversedName(); unit=_proxy->xInversedUnit(); } else { sMode=_proxy->xName(); unit=_proxy->xUnit(); } if(distance) { _proxy->resample(n, minimum, maximum, options, 0.5*(_proxy->minimumX()+_proxy->maximumX()), 0.5*(_proxy->minimumY(_currentLayer->pointOptions())+ _proxy->maximumY(_currentLayer->pointOptions())), _currentLayer->pointOptions()); _proxy->addLog(tr( "Resampled with constant distance along curve[%1] from %2 %3 to %4 %5 with %6 samples\n") .arg(sMode).arg(minimum).arg(unit).arg(maximum).arg(unit).arg(n)); } else { _proxy->resample(n, minimum, maximum, options); _proxy->addLog(tr("Resampled on a %1 scale from %2 %3 to %4 %5 with %6 samples\n") .arg(sMode).arg(minimum).arg(unit).arg(maximum).arg(unit).arg(n)); } curveChanged(); }
void SciFigs::CurveProperties::save | ( | ) |
References fileName, MSG_ID, SciFigs::CurveBrowserProxy::save(), QGpCoreTools::tr(), and TRACE.
{ TRACE; QString fileName=Message::getSaveFileName(tr("Save curve"), tr("Mutli-column file(*)")); if(!fileName.isEmpty()) { QFile f(fileName); if( !f.open(QIODevice::WriteOnly) ) { Message::warning(MSG_ID, tr("Saving curve ..."), tr("Impossible to write to file %1").arg(fileName), Message::cancel()); return; } QTextStream s(&f); _proxy->save(s); } }
void SciFigs::CurveProperties::setCurrentLayer | ( | LineLayer * | layer | ) | [inline] |
Referenced by SciFigs::CurveBrowser::addLine().
{_currentLayer=layer;}
void SciFigs::CurveProperties::setEditable | ( | bool | e | ) |
References SciFigs::CurveBrowserItem::setEditable().
Referenced by SciFigs::CurveBrowser::setEditable().
{ curveName->setEnabled(e); CurveBrowserItem * item=qobject_cast<CurveBrowserItem *>(curveTable->model()); item->setEditable(e); }
void SciFigs::CurveProperties::setProxy | ( | CurveBrowserProxy * | proxy | ) |
References curveModified(), proxy(), and SciFigs::CurveBrowserProxy::tag().
Referenced by SciFigs::CurveBrowser::addLine().
{ _proxy=proxy; CurveBrowserItem * model=new CurveBrowserItem(_proxy, this); curveTable->setModel(model); Settings::columnWidth(curveTable, _proxy->tag()); connect(model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), this, SIGNAL(curveModified())); }
void SciFigs::CurveProperties::showLog | ( | ) |
References SciFigs::CurveBrowserProxy::log(), MSG_ID, SciFigs::CurveBrowserProxy::name(), QGpCoreTools::tr(), and TRACE.
void SciFigs::CurveProperties::smooth | ( | double | minimum, |
double | maximum, | ||
SamplingOptions | options | ||
) |
References SciFigs::CurveBrowserProxy::addLog(), curveChanged(), QGpCoreTools::Function, QGpCoreTools::InversedScale, QGpCoreTools::LogScale, QGpCoreTools::tr(), TRACE, SciFigs::CurveBrowserProxy::xInversedName(), SciFigs::CurveBrowserProxy::xInversedUnit(), SciFigs::CurveBrowserProxy::xName(), and SciFigs::CurveBrowserProxy::xUnit().
{ TRACE; QString sMode, unit; options|=Function; if(options & LogScale) { sMode=tr("log(%1)").arg(_proxy->xName()); unit=_proxy->xUnit(); } else if(options & InversedScale) { sMode=_proxy->xInversedName(); unit=_proxy->xInversedUnit(); } else { sMode=_proxy->xName(); unit=_proxy->xUnit(); } // TODO //_proxy->smooth(minimum, maximum, options); _proxy->addLog(tr("Smoothed on a %1 scale from %2 %3 to %4 %5\n") .arg(sMode).arg(minimum).arg(unit).arg(maximum).arg(unit)); curveChanged(); }