示例#1
0
KRecordList *IntervalCPU::calcNext( KRecordList *displayList, bool initCalc )
{
  SemanticHighInfo highInfo;

  if( displayList == NULL )
    displayList = &myDisplayList;

  if( !initCalc )
  {
    *begin = *end;
  }

  if( intervalCompose.empty() )
    return displayList;

  if( intervalCompose[ begin->getThread() - firstThreadOnCPU ] == NULL )
  {
    int i = begin->getThread() - firstThreadOnCPU;
    intervalThread[ i ] = new IntervalThread( window, THREAD, begin->getThread() );
    intervalThread[ i ]->setNotWindowInits( true );
    intervalThread[ i ]->setSemanticFunction( functionThread );

    intervalCompose[ i ] = new IntervalCompose( window, COMPOSETHREAD, begin->getThread() );
    intervalCompose[ i ]->setNotWindowInits( true );
    intervalCompose[ i ]->setCustomChild( intervalThread[ i ] );
    intervalCompose[ i ]->setSemanticFunction( functionComposeThread );

    intervalCompose[ i ]->init( currentInitialTime, NOCREATE, NULL );
  }

  Interval *currentThread = intervalCompose[ begin->getThread() - firstThreadOnCPU ];
  highInfo.callingInterval = this;
  if( begin->getType() == STATE + END )
    highInfo.values.push_back( 0.0 );
  else
  {
    while( currentThread->getEndTime() <= begin->getTime() &&
           currentThread->getBeginTime() < window->getTrace()->getEndTime() )
      currentThread->calcNext( NULL );
    if( currentThread->getBegin()->getCPU() != order )
      highInfo.values.push_back( 0.0 );
    else
      highInfo.values.push_back( currentThread->getValue() );
  }
  currentValue = function->execute( &highInfo );
  end = getNextRecord( end, displayList );

  return displayList;
}
示例#2
0
KRecordList *IntervalCPU::calcPrev( KRecordList *displayList, bool initCalc )
{
  SemanticHighInfo highInfo;

  if( displayList == NULL )
    displayList = &myDisplayList;

  if( !initCalc )
  {
    *end = *begin;
  }

  if( intervalCompose.empty() )
    return displayList;

  begin = getPrevRecord( begin, displayList );
  highInfo.callingInterval = this;

  if( intervalCompose[ begin->getThread() - firstThreadOnCPU ] == NULL )
  {
    int i = begin->getThread() - firstThreadOnCPU;
    intervalThread[ i ] = new IntervalThread( window, THREAD, begin->getThread() );
    intervalThread[ i ]->setNotWindowInits( true );
    intervalThread[ i ]->setSemanticFunction( functionThread );

    intervalCompose[ i ] = new IntervalCompose( window, COMPOSETHREAD, begin->getThread() );
    intervalCompose[ i ]->setNotWindowInits( true );
    intervalCompose[ i ]->setCustomChild( intervalThread[ i ] );
    intervalCompose[ i ]->setSemanticFunction( functionComposeThread );

    intervalCompose[ i ]->init( currentInitialTime, NOCREATE, NULL );
  }

  Interval *currentThread = intervalCompose[ begin->getThread() - firstThreadOnCPU ];
  while( currentThread->getBeginTime() >= begin->getTime() &&
         currentThread->getEndTime() > 0.0 )
    currentThread->calcPrev( NULL );
  highInfo.values.push_back( currentThread->getValue() );
  currentValue = function->execute( &highInfo );

  if( initCalc )
  {
    *end = *begin;
  }

  return displayList;
}