本文整理汇总了C++中MixedData::addValue方法的典型用法代码示例。如果您正苦于以下问题:C++ MixedData::addValue方法的具体用法?C++ MixedData::addValue怎么用?C++ MixedData::addValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MixedData
的用法示例。
在下文中一共展示了MixedData::addValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadGUI
void STI_Application::loadGUI()
{
networkFile = new NetworkFileSource(appGUIpathName);
//Put the GUI into a file
STI::Types::TFile file;
file.description = CORBA::string_dup("");
file.fileName = CORBA::string_dup(appGUIpathName.c_str());
file.fileServerAddress = CORBA::string_dup("");
file.fileServerDirectory = CORBA::string_dup("");
file.networkFile = networkFile->getNetworkFileReference();
//Put the loaded GUI into the labeled data as a File
MixedData guiData;
guiData.addValue(GUIjavaclasspath);
guiData.addValue(file);
setLabeledData("JavaGUI", guiData);
}
示例2: if
void HPSidebandLockDevice::HPSidebandLockEvent::collectMeasurementData()
{
MixedData results;
// results.addValue(0);
// eventMeasurements.at(0)->setData( results );
// return;
boost::shared_lock< boost::shared_mutex > readLock(_this->spectrumMutex);
long timeout = 5; //seconds
boost::system_time wakeTime =
boost::get_system_time()
+ boost::posix_time::seconds( static_cast<long>(timeout) );
//Attempt to wait until the data is ready, or until timeout
_this->callbackCondition.timed_wait(readLock, wakeTime);
if(getChannel() == _this->calibrationTraceChannel) {
MixedData calPeaks;
_this->calibrationResults->getPeakValues(calPeaks);
MixedData calResults;
calResults.addValue(std::string("Calibration Peaks"));
calResults.addValue(calPeaks);
results.addValue(calResults);
eventMeasurements.at(0)->setData( results );
}
else if (getChannel() == _this->lockLoopChannel) {
MixedData peakResults;
peakResults.addValue(std::string("Spectral Peaks"));
peakResults.addValue(_this->targetSpectrumPeaks);
MixedData feedbackResults;
feedbackResults.addValue(std::string("Feedback Signals (sideband difference, sideband to carrier ratio)"));
feedbackResults.addValue(_this->feedbackSignals);
results.addValue(feedbackResults);
results.addValue(peakResults);
eventMeasurements.at(0)->setData( results );
}
}
示例3:
void HighPowerIntensityLockDevice::HPIntensityLockEvent::collectMeasurementData()
{
//save the current value of the VCA setpoint
MixedData vcaData;
vcaData.addValue(std::string("VCA Setpoint"));
vcaData.addValue(_this->vcaSetpoint);
//Also save the PD voltage:
MixedData pdData;
pdData.addValue(std::string("PD Voltage"));
pdData.addValue(_this->photodiodeVoltage);
MixedData feedbackLoopData;
feedbackLoopData.addValue( vcaData );
feedbackLoopData.addValue( pdData );
//Save feedbackLoopData as a measurement for the HP Intensity Lock device
eventMeasurements.at(0)->setData( feedbackLoopData );
}
示例4: calculateFeedbackSignalsFromFirstAndSecondSideband
bool MathematicaPeakFinder::calculateFeedbackSignalsFromFirstAndSecondSideband(const MixedData& peaks, MixedData& feedback)
{
WolframLibraryData libData = 0;
WolframRTL_initialize(WolframLibraryVersion);
libData = WolframLibraryData_new(WolframLibraryVersion);
//Setup arguments
//Initialize peak tensor
MTensor peakTensor;
int err;
mint type = MType_Real;
mint rank = 2;
mint dims[2];
dims[0] = 4;
dims[1] = 2;
err = libData->MTensor_new(type, rank, dims, &peakTensor);
if(err != 0)
return false;
mint peakPos[2];
for(int i = 1; i <= dims[0]; i++) {
peakPos[0] = i;
for(int j = 1; j <= dims[1]; j++) {
peakPos[1] = j;
err = libData->MTensor_setReal(peakTensor, peakPos,
peaks.getVector().at(i-1).getVector().at(j-1).getDouble());
}
}
if(err != 0)
return false;
//Initialize result tensor
MTensor feedbackResults;
type = MType_Real;
rank = 1;
mint dimsRes[1];
dimsRes[0] = 2;
err = libData->MTensor_new(type, rank, dimsRes, &feedbackResults);
if(err != 0)
return false;
Initialize_getFeedbackSignalsFromFirstAndSecondSidebands(libData); //Begin call to Mathematica code
err = getFeedbackSignalsFromFirstAndSecondSidebands(libData, peakTensor, &feedbackResults);
Uninitialize_getFeedbackSignalsFromFirstAndSecondSidebands(libData); //End call to Mathematica code
if( err == 0) {
//Copy results of the feedback function
double value = 0;
mint pos[1];
feedback.clear();
for(int j = 1; j <= 2; j++) {
pos[0] = j;
err = libData->MTensor_getReal(feedbackResults, pos, &value);
feedback.addValue(value);
}
}
cout << "Feedback results:" << endl;
cout << feedback.print() << endl;
libData->MTensor_free(peakTensor);
libData->MTensor_free(feedbackResults);
return (err == 0);
}
示例5: findFirstAndSecondOrderSidebandPeaks
bool MathematicaPeakFinder::findFirstAndSecondOrderSidebandPeaks(const STI::Types::TDataMixedSeq& rawSidebandData,
const CalibrationResults_ptr& calibration,
double firstOrderSidebandSpacing,
double secondOrderSidebandSpacing,
double minimumX,
double targetRange,
MixedData& peaks,
double carrierOffset)
{
WolframLibraryData libData = 0;
WolframRTL_initialize(WolframLibraryVersion);
libData = WolframLibraryData_new(WolframLibraryVersion);
//Setup arguments
MTensor formatedSidebandData; //List of {x,y} pairs, with gaps when y is below threshold
if(!convertRawScopeData(libData, rawSidebandData, formatedSidebandData)) {
return false;
}
//Initialize calibration tensor
MTensor calTensor;
int err;
mint type = MType_Real;
mint rank = 2;
mint dims[2];
dims[0] = 2;
dims[1] = 2;
err = libData->MTensor_new(type, rank, dims, &calTensor);
if(err != 0)
return false;
if(!calibration->getPeaks(libData, &calTensor))
return false;
//Initialize results tensor
MTensor peakResults;
type = MType_Real;
rank = 2;
dims[2];
dims[0] = 4; //First and second order sidebands: { {+1, -1}, {+2, -2} }
dims[1] = 2; //{time, peak height}
err = libData->MTensor_new(type, rank, dims, &peakResults);
mreal firstOrderSidebandSpacingArg = firstOrderSidebandSpacing;
mreal secondOrderSidebandSpacingArg = secondOrderSidebandSpacing;
mreal minX = minimumX;
mreal targetRangeArg = targetRange;
mreal carrierOffsetArg = carrierOffset;
if(err == 0) {
Initialize_findFirstAndSecondOrderSidebands(libData); //Begin call to Mathematica code
err = findFirstAndSecondOrderSidebands(libData, formatedSidebandData, calTensor, firstOrderSidebandSpacingArg, secondOrderSidebandSpacingArg, minX, targetRangeArg, carrierOffsetArg, &peakResults);
Uninitialize_findFirstAndSecondOrderSidebands(libData); //End call to Mathematica code
}
if( err == 0) {
//Copy results of peak search
double value = 0;
mint pos[2];
peaks.clear();
MixedData peak;
for(int i = 1; i <= 4; i++) {
pos[0] = i;
peak.clear();
for(int j = 1; j <= 2; j++) {
pos[1] = j;
err = libData->MTensor_getReal(peakResults, pos, &value);
peak.addValue(value);
}
peaks.addValue(peak);
}
}
cout << "Peak find results:" << endl;
cout << peaks.print() << endl;
libData->MTensor_free(formatedSidebandData);
libData->MTensor_free(calTensor);
libData->MTensor_free(peakResults);
return (err == 0);
}