All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Brief description of class still missing. More...
#include <MiniSeedVolume.h>
Public Member Functions | |
bool | read (QString name) |
~MiniSeedVolume () | |
Static Public Member Functions | |
static void | errorLog (QString fileName, QString title, int errorCode) |
static void | errorMessage (QString fileName, QString title, int errorCode) |
static bool | isValid (QString fileName) |
Brief description of class still missing.
Represents a Mini Seed volume. This class is used only while reading a new file.
void GeopsyCore::MiniSeedVolume::errorLog | ( | QString | fileName, |
QString | title, | ||
int | errorCode | ||
) | [static] |
References QGpCoreTools::endl(), and TRACE.
Referenced by GeopsyCore::MiniSeedReader::nextRecord().
void GeopsyCore::MiniSeedVolume::errorMessage | ( | QString | fileName, |
QString | title, | ||
int | errorCode | ||
) | [static] |
bool GeopsyCore::MiniSeedVolume::isValid | ( | QString | fileName | ) | [static] |
References TRACE.
Referenced by GeopsyCore::SignalFileFormat::fromContent().
bool GeopsyCore::MiniSeedVolume::read | ( | QString | name | ) |
Parse a Mini seed volume and fill its internal list of MiniSeedTrace pointers
References GeopsyCore::MiniSeedTrace::addRecord(), errorMessage(), MSG_ID, GeopsyCore::MiniSeedTrace::split(), QGpCoreTools::tr(), and TRACE.
{ TRACE; LibMSeed::MSRecord * msr=0; int msErr=0; off_t currentPos=0; /* Read next seed record with int reclen=-1 Use automatic record length (usually read from Blockette 1000) off_t *fpos=currentPos Store all position of records in file int *last =NULL Don't care about last record, just wait for MS_ENDOFFILE flag skipnotdata=1 Skip all invalid data chunks flag dataflag=0 Do not unpack values flag verbose=0 Be not verbose */ // TODO: look for another way with UNICODE support for file names, tried with utf-8, but it does not work either. if(QString(name.toAscii())!=name) { Message::warning(MSG_ID, tr("Loading Miniseed"), tr("File path contains non-ASCII characters. This is a current limitation of IRIS MiniSeed library. " "Move your file to a directory path with ASCII characters only.\n%1").arg(name), Message::cancel(), true); return false; } while(( msErr=ms_readmsr (&msr, name.toAscii().data(), -1, ¤tPos, NULL, 1, 0, 0))==MS_NOERROR) { MiniSeedTrace * sig=findTrace(msr); if(!sig) { sig=new MiniSeedTrace(msr); append(sig); } sig->addRecord(msr, currentPos); } ms_readmsr (&msr, NULL, 0, NULL, NULL, 0, 0, 0); if(msErr!= MS_ENDOFFILE) { errorMessage(name, tr("Loading Miniseed"), msErr); return false; } // Check continuity of traces and split non-continuous traces for(int i=0; i<count(); i++) { MiniSeedTrace * sig=at(i); while(true) { sig=sig->split(); if(sig) { i++; insert(i, sig); } else { break; } } } return true; }