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

#include <TimeRange.h>

Inheritance diagram for GeopsyCore::TimeRange:
GeopsyCore::TimeRangeParameters GeopsyGui::TimeWindow

List of all members.

Public Member Functions

double end () const
TimeRange intersection (const TimeRange &tw) const
bool intersects (const TimeRange &tw) const
int lengthSamples (double deltaT) const
double lengthSeconds () const
void operator= (const TimeRange &o)
void printDebug () const
void scale (double center, double factor)
void setEnd (double m)
void setStart (double m)
void shift (double s)
TimeRange shifted (double s) const
void sort ()
double start () const
 TimeRange ()
 TimeRange (const TimeRange &o)
 TimeRange (double start, double end)
 ~TimeRange ()

Constructor & Destructor Documentation

Referenced by GeopsyCore::TimeRangeParameters::absoluteRange(), and shifted().

{
  _start=0.0;
  _end=0.0;
}
{operator=(o);}
GeopsyCore::TimeRange::TimeRange ( double  start,
double  end 
) [inline]

References end(), and start().

{
  if(start>end) {
    _start=end;
    _end=start;
  } else {
    _start=start;
    _end=end;
  }
}
{}

Member Function Documentation

double GeopsyCore::TimeRange::end ( ) const [inline]

Return true if this window has an intersection with tw, tw is modified to match the intersection of this window and tw.

See also:
intersect()

Referenced by GeopsyCore::Signal::cut(), and Process::run().

{
  TimeRange res;
  if(tw._end < _start || tw._start > _end)
    return res;
  if(tw._start < _start && _start < tw._end)
    res._start=_start;
  else
    res._start=tw._start;
  if(tw._start < _end && _end < tw._end)
    res._end=_end;
  else
    res._end=tw._end;
  return res;
}
bool GeopsyCore::TimeRange::intersects ( const TimeRange tw) const [inline]

Referenced by GeopsyCore::SparseTimeRange::hit(), and GeopsyCore::TimeRangeList::remove().

{
  if(tw._end < _start || tw._start > _end)
    return false;
  return true;
}
int GeopsyCore::TimeRange::lengthSamples ( double  deltaT) const [inline]

Referenced by TFAResults::compute(), GeopsyCore::Signal::cut(), and SpectrumStation::start().

{return (int)round(lengthSeconds()/deltaT);}
double GeopsyCore::TimeRange::lengthSeconds ( ) const [inline]
void GeopsyCore::TimeRange::operator= ( const TimeRange o) [inline]
{
  _start=o._start;
  _end=o._end;
}

References TRACE.

  {
    TRACE;
    printf("Range from %s to %s\n", Number::secondsToTime(start()).toAscii().data(),
                                    Number::secondsToTime(end()).toAscii().data());
  }
void GeopsyCore::TimeRange::scale ( double  center,
double  factor 
) [inline]
{
  _start=center+(_start-center)*factor;
  _end=center+(_end-center)*factor;
}
void GeopsyCore::TimeRange::setEnd ( double  m) [inline]
void GeopsyCore::TimeRange::setStart ( double  m) [inline]
void GeopsyCore::TimeRange::shift ( double  s) [inline]
{
  _start+=s;
  _end+=s;
}
TimeRange GeopsyCore::TimeRange::shifted ( double  s) const [inline]

References TimeRange().

Referenced by GeopsyCore::Signal::taper().

{
  return TimeRange(_start+s, _end+s);
}
void GeopsyCore::TimeRange::sort ( ) [inline]
{
  if(_start>_end) {
    qSwap(_start, _end);
  }
}
double GeopsyCore::TimeRange::start ( ) const [inline]

Referenced by GeopsyCore::SparseTimeRange::add(), GeopsyCore::TimeRangeList::add(), GeopsyCore::Signal::add(), GeopsyCore::TimeRangeList::addOne(), GeopsyCore::TaperDelegate::apply(), LinearFKActiveStationSignals::beginPreprocess(), TFAResults::compute(), DampingResults::compute(), GeopsyCore::StationProcessSignals::copyOriginalSignal(), GeopsyCore::Signal::copySamplesFrom(), GeopsyCore::Signal::correlation(), GeopsyCore::Signal::cut(), GeopsyGui::ChronogramLayer::exportGaps(), FKLoopTask::exportResults(), GeopsyGui::TimeRangeParameterWidget::getParameters(), ManualPick::init(), GeopsyCore::SparseKeepSignal::intersection(), GeopsyCore::SparseTimeRange::intersection(), GeopsyCore::SparseTimeRange::invert(), GeopsyCore::SparseKeepSignal::keeps(), GeopsyCore::Signal::maximumAmplitudeAt(), GeopsyCore::SubSignalPool::merge(), StackWeights::misfit(), GeopsyGui::TimeRangeParameterWidget::on_fromType_activated(), GeopsyCore::SparseKeepSignal::remove(), GeopsyCore::TimeRangeList::remove(), GeopsyCore::SparseTimeRange::remove(), GeopsyCore::SparseTimeRange::removeGaps(), Process::run(), GraphicWindow::setLimits(), GeopsyGui::TimeRangeParameterWidget::setParameters(), GeopsyCore::SparseKeepSignal::setSampling(), GeopsyCore::StationSignals::setSampling(), Acquisition::setSignals(), GraphicWindow::signalsUpdate(), RealTimeArrayManager::start(), TimeRange(), GeopsyCore::TimeRangeList::timeRange(), GeopsyCore::TimeRangeList::TimeRangeList(), GeopsyCore::TimeRangeList::toString(), GeopsyCore::TimeRangeParameters::toString(), PtMotionResults::updateSignals(), T0Correlation::value(), GeopsyGui::TimeWindow::xml_attributes(), and GeopsyCore::TimeRangeParameters::xml_attributes().

{return _start;}

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