本文整理汇总了C++中Measurement::GetNextData方法的典型用法代码示例。如果您正苦于以下问题:C++ Measurement::GetNextData方法的具体用法?C++ Measurement::GetNextData怎么用?C++ Measurement::GetNextData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Measurement
的用法示例。
在下文中一共展示了Measurement::GetNextData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// fprintf(f, "unit_x: %.1lf ns | %.1lf ns\n", meas->GetTimebaseInNs(), meas->GetReportedTimebaseInNs());
tmp_dbl = meas->GetTimebaseInNs();
fprintf(f, "unit_x: %.1lf ns\n", tmp_dbl);
fprintf(f, "range_x: %.1lf ns\n", x.GetLength()*tmp_dbl);
tmp_dbl = x.GetVoltageDouble();
fprintf(f, "unit_y: %.10le V\n", tmp_dbl*3.0757874015748e-5); // 1/(127*256) actually, but this might have to be fixed for series 4000
fprintf(f, "range_y: %g V\n", tmp_dbl);
if(x.GetNTraces() > 1) {
if(x.IsTriggered()) {
fprintf(f, "trigger_ch: %c\n", (char)(meas->GetTrigger()->GetChannel()->GetIndex()+'A'));
// fprintf(f, "trigger_xfrac: %g\n", meas->GetTrigger()->GetXFraction());
// fprintf(f, "trigger_yfrac: %g\n", meas->GetTrigger()->GetYFraction());
fprintf(f, "trigger_dx: %d (%g %% of %ld)\n", meas->GetLengthBeforeTrigger(), meas->GetLengthBeforeTrigger()*100.0/x.GetLength(), x.GetLength());
tmp_short = meas->GetTrigger()->GetThreshold();
tmp_dbl = meas->GetTrigger()->GetYFraction();
fprintf(f, "trigger_dy: %g V (%d)\n", meas->GetTrigger()->GetThresholdInVolts() /*tmp_dbl*x.GetVoltageDouble()*/, tmp_short);
}
}
// fprintf(f, "unit_x: %.1lf ns | %.1lf ns\n", meas->GetTimebaseInNs(), meas->GetReportedTimebaseInNs());
fprintf(f, "out_bin: %s\n", x.IsBinaryOutput() ? "yes" : "no");
fprintf(f, "out_dat: %s\n", x.IsTextOutput() ? "yes" : "no");
// triggered (TODO: we could also ask for a single triggered event)
if(x.GetNTraces() > 1) {
unsigned int run=0;
for(run=0; run<x.GetNRepeats() && !_kbhit(); run++) {
//FILE_LOG(logINFO) << "Running experiment nr. " << run+1;
if(run>0) {
cerr << "\nRepeat #" << run+1 << endl;
meas->RunBlock();
}
while(meas->GetNextDataBulk() > 0) {
for(i=0; i<PICOSCOPE_N_CHANNELS; i++) {
if(ch[i]->IsEnabled()) {
if(x.IsTextOutput()) {
meas->WriteDataTxt(ft[i], i); // zero for channel A
}
if(x.IsBinaryOutput()) {
meas->WriteDataBin(fb[i], i); // zero for channel A
}
}
}
}
}
if(run>1) {
fprintf(f, "repeats: %u\n", run);
}
// tmp_dbl = meas->GetRatePerSecond();
// fprintf(f, "\nrate: \n");
// if(fabs(tmp_dbl) > 1e6) {
// fprintf(f, "%.3f MS/s\n", tmp_dbl*1e-6);
// } else if(fabs(tmp_dbl) > 1e3) {
// fprintf(f, "%.3f kS/s\n", tmp_dbl*1e-3);
// } else {
// fprintf(f, "%f S/s\n", tmp_dbl);
// }
} else {
unsigned int run=0;
for(run=0; run<x.GetNRepeats() && !_kbhit(); run++) {
if(run>0) {
cerr << "\nRepeat #" << run+1 << endl;
meas->RunBlock();
}
while(meas->GetNextData() > 0) {