#include <AsciiSignalRulesWidget.h>
List of all members.
Public Member Functions |
| AsciiSignalRulesItem (QObject *parent) |
virtual int | columnCount (const QModelIndex &) const |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
virtual bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
virtual bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
virtual int | rowCount (const QModelIndex &) const |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
void | setFormat (AsciiSignalFormat *f) |
void | setHeader (const QString &h) |
Constructor & Destructor Documentation
: QAbstractTableModel(parent) {_format=0;}
Member Function Documentation
References GeopsyCore::AsciiSignalFormatRule::constant(), and GeopsyCore::AsciiSignalFormat::rule().
{
const AsciiSignalFormatRule& r=_format->rule(index.row());
if(r.constant()) {
switch(index.column()) {
case 0:
return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable;
case 1:
return Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable;
default:
return 0;
}
} else {
switch(index.column()) {
case 0:
case 2:
return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable;
case 1:
return 0;
default:
return Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable;;
}
}
}
References QGpCoreTools::tr().
{
switch(role) {
case Qt::DisplayRole:
if(orientation==Qt::Vertical) {
return section+1;
} else {
switch(section) {
case 0:
return tr("Constant");
case 1:
return tr("Value");
case 2:
return tr("Mandatory");
case 3:
return tr("Pattern");
case 4:
return tr("Index");
case 5:
return tr("Factor");
case 6:
return tr("Channel");
case 7:
return tr("Data");
case 8:
return tr("Index");
default:
return QVariant();
}
}
break;
case Qt::ToolTipRole:
if(orientation==Qt::Horizontal) {
switch(section) {
case 0:
return tr("Value is not extracted from header");
case 1:
return tr("For constant values only");
case 2:
return tr("Generate an error if pattern cannot be found");
case 3:
return tr("Regular expression to identify information in header");
case 4:
return tr("Pattern must contain at least one expression between (), "
"this index identifies the value to extract");
case 5:
return tr("Multiply the value by this factor");
case 6:
return tr("Assign the value only if signal matches this channel number");
case 7:
return tr("Signal data to assign");
case 8:
return tr("For signal data vectors, the index to assign");
default:
return QVariant();
}
}
break;
default:
break;
}
return QVariant();
}
References GeopsyCore::AsciiSignalFormatRule::data(), GeopsyCore::MetaDataIndex::index(), GeopsyCore::AsciiSignalFormat::rule(), GeopsyCore::AsciiSignalFormatRule::setChannel(), GeopsyCore::AsciiSignalFormatRule::setConstant(), GeopsyCore::AsciiSignalFormatRule::setData(), GeopsyCore::AsciiSignalFormatRule::setFactor(), GeopsyCore::MetaDataIndex::setIndex(), GeopsyCore::AsciiSignalFormatRule::setMandatory(), GeopsyCore::AsciiSignalFormatRule::setPattern(), GeopsyCore::AsciiSignalFormatRule::setPatternIndex(), and GeopsyCore::AsciiSignalFormatRule::setValue().
{
AsciiSignalFormatRule& r=_format->rule(index.row());
switch(role) {
case Qt::EditRole:
switch(index.column()) {
case 0:
r.setConstant(value.toBool());
updateValue(index);
return true;
case 1:
r.setValue(value);
return true;
case 2:
r.setMandatory(value.toBool());
return true;
case 3:
r.setPattern(value.toString());
updateValue(index);
return true;
case 4:
r.setPatternIndex(value.toInt());
updateValue(index);
return true;
case 5:
r.setFactor(value.toDouble());
updateValue(index);
return true;
case 6:
r.setChannel(value.toInt());
updateValue(index);
return true;
case 7: {
MetaDataIndex index=MetaDataFactory::instance()->index(value.toString());
index.setIndex(r.data().index());
r.setData(index);
}
return true;
case 8: {
MetaDataIndex index=r.data();
index.setIndex(value.toString());
r.setData(index);
}
return true;
default:
return false;
}
break;
default:
return false;
}
}
The documentation for this class was generated from the following files: