KstDataObjectPtr KstCPlugin::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
  KstCPluginPtr plugin = new KstCPlugin;

  // use same inputs
  for (KstVectorMap::ConstIterator iter = _inputVectors.begin(); iter != _inputVectors.end(); ++iter) {
    plugin->inputVectors().insert(iter.key(), iter.data());
  }
  for (KstScalarMap::ConstIterator iter = _inputScalars.begin(); iter != _inputScalars.end(); ++iter) {
    plugin->inputScalars().insert(iter.key(), iter.data());  
  }
  for (KstStringMap::ConstIterator iter = _inputStrings.begin(); iter != _inputStrings.end(); ++iter) {
    plugin->inputStrings().insert(iter.key(), iter.data());  
  }
  
  // create new outputs
  for (KstVectorMap::ConstIterator iter = outputVectors().begin(); iter != outputVectors().end(); ++iter) {
    KstWriteLocker blockVectorUpdates(&KST::vectorList.lock());
    KstVectorPtr v = new KstVector(KstObjectTag(iter.data()->tag().tag() + "'", iter.data()->tag().context()), 0, plugin.data()); // FIXME: unique tag generation
    plugin->outputVectors().insert(iter.key(), v);
  }
  for (KstScalarMap::ConstIterator iter = outputScalars().begin(); iter != outputScalars().end(); ++iter) {
    KstScalarPtr s = new KstScalar(KstObjectTag(iter.data()->tag().tag() + "'", iter.data()->tag().context()), plugin.data()); // FIXME: unique tag generation
    plugin->outputScalars().insert(iter.key(), s);
  }
  for (KstStringMap::ConstIterator iter = outputStrings().begin(); iter != outputStrings().end(); ++iter) {
    KstStringPtr s = new KstString(KstObjectTag(iter.data()->tag().tag() + "'", iter.data()->tag().context()), plugin.data()); // FIXME: unique tag generation
    plugin->outputStrings().insert(iter.key(), s);
  }
  
  // set the same plugin
  plugin->setPlugin(_plugin);
  plugin->setTagName(KstObjectTag(tag().tag() + "'", tag().context())); // FIXME: unique tag generation method
  duplicatedMap.insert(this, KstDataObjectPtr(plugin));  
  return KstDataObjectPtr(plugin);
}
Example #2
0
KstDataObjectPtr KstEquation::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
  QString name(tagName() + '\'');
  while (KstData::self()->dataTagNameNotUnique(name, false)) {
    name += '\'';
  }
  KstEquationPtr eq = new KstEquation(name, _equation, _inputVectors[XINVECTOR], _doInterp);
  duplicatedMap.insert(this, KstDataObjectPtr(eq));
  return KstDataObjectPtr(eq);
}
Example #3
0
KstDataObjectPtr KstCSD::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
  QString name(tagName() + '\'');
  while (KstData::self()->dataTagNameNotUnique(name, false)) {
    name += '\'';
  }
  KstCSDPtr csd = new KstCSD(name, _inputVectors[INVECTOR], _frequency, _average, _removeMean,
                             _apodize, _apodizeFxn, _windowSize, _length, _gaussianSigma, _vectorUnits, _rateUnits);
  duplicatedMap.insert(this, KstDataObjectPtr(csd));
  return KstDataObjectPtr(csd);
}
Example #4
0
KstDataObjectPtr KstHistogram::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
  QString name(tagName() + '\'');
  while (KstData::self()->dataTagNameNotUnique(name, false)) {
    name += '\'';
  }
  KstHistogramPtr histogram = new KstHistogram(name, _inputVectors[RAWVECTOR],
                                               _MinX, _MaxX, _NBins, _NormMode);
  duplicatedMap.insert(this, KstDataObjectPtr(histogram));
  return KstDataObjectPtr(histogram);
}
KstDataObjectPtr KstPSD::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
  QString name(tagName() + '\'');
  while (KstData::self()->dataTagNameNotUnique(name, false)) {
    name += '\'';
  }
  KstPSDPtr psd = new KstPSD(name, _inputVectors[INVECTOR], _Freq,
                             _Average, _averageLen, _Apodize, _RemoveMean, _vUnits, _rUnits, 
                             _apodizeFxn, _gaussianSigma, _Output);
  duplicatedMap.insert(this, KstDataObjectPtr(psd));    
  return KstDataObjectPtr(psd);
}
Example #6
0
KstDataObjectPtr KstPlugin::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
  KstPluginPtr plugin = new KstPlugin;

  // use same inputs
  for (KstVectorMap::ConstIterator iter = _inputVectors.begin(); iter != _inputVectors.end(); ++iter) {
    plugin->inputVectors().insert(iter.key(), iter.data());
  }
  for (KstScalarMap::ConstIterator iter = _inputScalars.begin(); iter != _inputScalars.end(); ++iter) {
    plugin->inputScalars().insert(iter.key(), iter.data());  
  }
  for (KstStringMap::ConstIterator iter = _inputStrings.begin(); iter != _inputStrings.end(); ++iter) {
    plugin->inputStrings().insert(iter.key(), iter.data());  
  }
  
  // create new outputs
  for (KstVectorMap::ConstIterator iter = outputVectors().begin(); iter != outputVectors().end(); ++iter) {
    KstVectorPtr v = new KstVector;
    v->writeLock();
    plugin->outputVectors().insert(iter.key(), v);
    v->setTagName(iter.data()->tagName() + "'");
    v->setProvider(plugin.data());
    KST::addVectorToList(v);
    v->writeUnlock();
  }
  for (KstScalarMap::ConstIterator iter = outputScalars().begin(); iter != outputScalars().end(); ++iter) {
    KstScalarPtr s = new KstScalar;
    s->writeLock();
    plugin->outputScalars().insert(iter.key(), s);
    s->setTagName(iter.data()->tagName() + "'");
    s->setProvider(plugin.data());
    s->writeUnlock();
  }
  for (KstStringMap::ConstIterator iter = outputStrings().begin(); iter != outputStrings().end(); ++iter) {
    KstStringPtr s = new KstString;
    s->writeLock();
    plugin->outputStrings().insert(iter.key(), s);
    s->setTagName(iter.data()->tagName() + "'");
    s->setProvider(plugin.data());
    s->writeUnlock();  
  }
  
  // set the same plugin
  plugin->setPlugin(_plugin);
  plugin->setTagName(tagName() + "'");
  duplicatedMap.insert(this, KstDataObjectPtr(plugin));  
  return KstDataObjectPtr(plugin);
}
Example #7
0
KstDataObjectPtr EventMonitorEntry::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
  QString name(tagName() + '\'');
  while (KstData::self()->dataTagNameNotUnique(name, false)) {
    name += '\'';
  }
  EventMonitorEntryPtr event = new EventMonitorEntry(name);
  event->setEvent(_event);
  event->setDescription(_description);
  event->setLevel(_level);
  event->setLogKstDebug(_logKstDebug);
  event->setLogEMail(_logEMail);
  event->setLogELOG(_logELOG);
  event->setEMailRecipients(_eMailRecipients);

  duplicatedMap.insert(this, KstDataObjectPtr(event));
  return KstDataObjectPtr(event);
}