All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
GeopsySLinkGui::SeedLinkStreamItem Class Reference

Brief description of class still missing. More...

#include <SeedLinkStreamItem.h>

List of all members.

Public Member Functions

virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
void commit (const QModelIndex &i)
virtual QVariant data (const QModelIndex &index, int role) const
virtual Qt::ItemFlags flags (const QModelIndex &) const
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
bool isStation (const QModelIndex &index) const
bool isStream (const QModelIndex &index) const
virtual QModelIndex parent (const QModelIndex &index) const
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 SeedLinkStreamItem (QObject *parent=0)
void setServer (const SeedLinkServer *s)
SeedLinkStationstation (const QModelIndex &index) const
SeedLinkStreamstream (const QModelIndex &index) const
 ~SeedLinkStreamItem ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

References TRACE.

    : QAbstractItemModel(parent)
{
  TRACE;
  _server=0;
}

Description of destructor still missing

References TRACE.

{
  TRACE;
}

Member Function Documentation

int GeopsySLinkGui::SeedLinkStreamItem::columnCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]

References TRACE.

{
  TRACE;
  return 9;
}
void GeopsySLinkGui::SeedLinkStreamItem::commit ( const QModelIndex &  i) [inline]
                                    {emit dataChanged(index( i.row(), 0, parent(i)),
                                                          index(i.row(), columnCount(), parent(i)));}
QVariant GeopsySLinkGui::SeedLinkStreamItem::data ( const QModelIndex &  index,
int  role 
) const [virtual]

References GeopsySLink::SeedLinkStream::beginRecNo(), GeopsySLink::SeedLinkStream::beginTime(), GeopsySLink::SeedLinkStation::description(), GeopsySLink::SeedLinkStream::endRecNo(), GeopsySLink::SeedLinkStream::endTime(), GeopsySLink::SeedLinkStream::gapCheck(), GeopsySLink::SeedLinkStream::gapThreshold(), isStream(), GeopsySLink::SeedLinkStream::listening(), GeopsySLink::SeedLinkStream::location(), GeopsySLink::SeedLinkStation::name(), GeopsySLink::SeedLinkStation::network(), GeopsySLink::SeedLinkStream::seedName(), station(), stream(), GeopsySLink::SeedLinkStation::streamCheck(), QGpCoreTools::tr(), TRACE, and GeopsySLink::SeedLinkStream::type().

{
  TRACE;
  if( !index.isValid()) return QVariant();
  if(isStream(index)) {
    SeedLinkStream * s=stream(index);
    switch (role) {
    case Qt::DisplayRole:
      switch (index.column()) {
      case 0: return s->location();
      case 1: return s->seedName();
      case 2: return s->type();
      case 3: return s->beginTime();
      case 4: return s->endTime();
      case 5: return s->beginRecNo();
      case 6: return s->endRecNo();
      case 7: return s->gapCheck();
      case 8: return s->gapThreshold();
      default: return QVariant();
      }
    case Qt::DecorationRole:
      switch (index.column()) {
      case 0: return s->listening() ? QPixmap( ":/images/update_available.png" ) : QVariant();
      default: return QVariant();
      }
    case Qt::ToolTipRole:
      switch (index.column()) {
      case 1: return tr("Stream name");
      case 2: return tr("Type (D=data)");
      default: return QVariant();
      }
    default:
      return QVariant();
    }
  } else {
    SeedLinkStation * s=station(index);
    switch (role) {
    case Qt::DisplayRole:
      switch (index.column()) {
      case 0: return s->network()+"_"+s->name()+" ("+s->description()+")"+(s->streamCheck() ? " checked" : "");
      default: return QVariant();
      }
    case Qt::BackgroundRole:
      return Qt::lightGray;
    default:
      return QVariant();
    }
  }
}
virtual Qt::ItemFlags GeopsySLinkGui::SeedLinkStreamItem::flags ( const QModelIndex &  ) const [inline, virtual]
{return Qt::ItemIsSelectable | Qt::ItemIsEnabled;}
QVariant GeopsySLinkGui::SeedLinkStreamItem::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const [virtual]

References QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  if(orientation==Qt::Horizontal) {
    switch (role) {
    case Qt::DisplayRole:
      switch (section) {
      case 0: return tr("Location");
      case 1: return tr("Seed name");
      case 2: return tr("Type");
      case 3: return tr("Begin time");
      case 4: return tr("End time");
      case 5: return tr("Begin recno");
      case 6: return tr("End recno");
      case 7: return tr("Gap check");
      case 8: return tr("Gap treshold");
      default: return QVariant();
      }
    default:
      return QVariant();
    }
  } else
    return QVariant();
}
QModelIndex GeopsySLinkGui::SeedLinkStreamItem::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const [virtual]

References GeopsySLink::SeedLinkServer::at(), GeopsySLink::SeedLinkStation::at(), station(), and TRACE.

Referenced by GeopsySLinkGui::SeedLinkLoader::selectStreams().

{
  TRACE;
  if( !parent.isValid())
    return createIndex(row, column, const_cast<SeedLinkStation *>(_server->at(row)));
  else {
    const SeedLinkStation * station=_server->at(parent.row());
    return createIndex(row, column, const_cast<SeedLinkStream *>(station->at(row)));
  }
}
bool GeopsySLinkGui::SeedLinkStreamItem::isStation ( const QModelIndex &  index) const

References TRACE.

Referenced by rowCount().

{
  TRACE;
  return static_cast<XMLClass *>(index.internalPointer())->xml_tagName()==SeedLinkStation::xmlSeedLinkStationTag;
}
bool GeopsySLinkGui::SeedLinkStreamItem::isStream ( const QModelIndex &  index) const

References TRACE.

Referenced by data(), and parent().

{
  TRACE;
  return static_cast<XMLClass *>(index.internalPointer())->xml_tagName()==SeedLinkStream::xmlSeedLinkStreamTag;
}
QModelIndex GeopsySLinkGui::SeedLinkStreamItem::parent ( const QModelIndex &  index) const [virtual]

References GeopsySLink::SeedLinkServer::indexOf(), isStream(), GeopsySLink::SeedLinkStream::station(), str, stream(), and TRACE.

{
  TRACE;
  if(!index.isValid()) return QModelIndex();
  if(isStream(index)) {
    SeedLinkStream * str=stream(index);
    SeedLinkStation * sta=str->station();
    return createIndex(_server->indexOf(sta), 0, sta);
  } else {
    return QModelIndex();
  }
}
int GeopsySLinkGui::SeedLinkStreamItem::rowCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]

References GeopsySLink::SeedLinkServer::at(), GeopsySLink::SeedLinkServer::count(), isStation(), and TRACE.

Referenced by GeopsySLinkGui::SeedLinkLoader::selectStreams().

{
  TRACE;
  if(!_server) return 0;
  if(!parent.isValid()) return _server->count();
  if(isStation(parent)) return _server->at(parent.row())->count();
  return 0;
}

References TRACE.

{
  TRACE;
  _server=s;
  reset();
}
SeedLinkStation * GeopsySLinkGui::SeedLinkStreamItem::station ( const QModelIndex &  index) const

References TRACE.

Referenced by data(), and index().

{
  TRACE;
  return static_cast<SeedLinkStation *>(index.internalPointer());
}
SeedLinkStream * GeopsySLinkGui::SeedLinkStreamItem::stream ( const QModelIndex &  index) const

References TRACE.

Referenced by data(), and parent().

{
  TRACE;
  return static_cast<SeedLinkStream *>(index.internalPointer());
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines