本文整理汇总了C++中Signal::setReason方法的典型用法代码示例。如果您正苦于以下问题:C++ Signal::setReason方法的具体用法?C++ Signal::setReason怎么用?C++ Signal::setReason使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal::setReason方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
SignalClassifier::classifySignal(Activity *act, SignalDescription& sig,
SuperClusterer *superClusterer, int32_t sigNum, int32_t maxCandidates)
{
sig.pol = superClusterer->getNthPolarization(sigNum);
sig.subchannelNumber = act->getChannel()->getSubchannel(sig.path.rfFreq);
sig.signalId = superClusterer->getNthSignalId(sigNum);
sig.origSignalId = SignalId();
// initial classification of the signal depends on the
// operating mode
sig.sigClass = CLASS_CAND;
sig.reason = PASSED_POWER_THRESH;
// test for zero-drift signal
if (operations.test(REJECT_ZERO_DRIFT_SIGNALS)) {
float64_t absDrift = fabs(sig.path.drift);
if (absDrift <= params.zeroDriftTolerance) {
sig.sigClass = CLASS_RFI;
sig.reason = ZERO_DRIFT;
}
}
// test for too-big-drift signal
if (operations.test(REJECT_ZERO_DRIFT_SIGNALS)) {
float32_t absDrift = fabs(sig.path.drift);
float32_t maxDrift = params.maxDriftRateTolerance
* MHZ_TO_GHZ(params.dxSkyFreq);
if (absDrift > maxDrift) {
sig.sigClass = CLASS_RFI;
sig.reason = DRIFT_TOO_HIGH;
}
}
// test for recent RFI mask match
Debug(DEBUG_SIGNAL_CLASS,
(int32_t) operations.test(APPLY_RECENT_RFI_MASK),
"apply recent RFI mask");
Debug(DEBUG_SIGNAL_CLASS, (void *) recentRfi, "recent RFI mask");
if (act->getMode() == PRIMARY) {
if (operations.test(APPLY_RECENT_RFI_MASK) && recentRfi) {
Debug(DEBUG_SIGNAL_CLASS, (void *) recentRfi, "apply mask?");
if (recentRfi->isMasked(sig.path.rfFreq,
HZ_TO_MHZ(sig.path.width))) {
sig.sigClass = CLASS_RFI;
sig.reason = RECENT_RFI_MATCH;
Debug(DEBUG_SIGNAL_CLASS, (void *) recentRfi, "yep");
} else
Debug(DEBUG_SIGNAL_CLASS, (void *) recentRfi, "nope");
}
}
// test for test signal mask match; this overrides rfi mask
if (operations.test(APPLY_TEST_SIGNAL_MASK) && testSignal) {
if (testSignal->isMasked(sig.path.rfFreq, HZ_TO_MHZ(sig.path.width))) {
sig.sigClass = CLASS_CAND;
sig.reason = TEST_SIGNAL_MATCH;
}
}
// test for followup candidates; the signal must already
// be a candidate;
if (operations.test(FOLLOW_UP_CANDIDATES)) {
Signal *signal = findFollowupSignal(act, sig);
if (signal) {
sig.origSignalId = signal->getOrigSignalId();
if (sig.sigClass == CLASS_CAND)
act->removeFollowupSignal(signal);
else {
// preserve the class/reason information for the
// candidate
signal->setClass(sig.sigClass);
signal->setReason(sig.reason);
}
}
else {
sig.sigClass = CLASS_UNKNOWN;
sig.reason = PASSED_POWER_THRESH;
}
}
// if we are not selecting candidates, or we have exceeded
// the maximum number of candidates, mark any candidate signal as
// class unknown
if (!operations.test(CANDIDATE_SELECTION))
sig.sigClass = CLASS_UNKNOWN;
else if (sig.path.rfFreq < act->getChannel()->getLowFreq()
|| sig.path.rfFreq >= act->getChannel()->getHighFreq()) {
sig.sigClass = CLASS_UNKNOWN;
sig.reason = SIGNAL_NOT_IN_CHANNEL;
}
else if (sig.sigClass == CLASS_CAND
&& act->getCandidateCount(ANY_TYPE) >= maxCandidates) {
++candidatesOverMax;
sig.sigClass = CLASS_UNKNOWN;
sig.reason = TOO_MANY_CANDIDATES;
}
Debug(DEBUG_SIGNAL_CLASS, sig.signalId.number, "sig.signalId.number");
Debug(DEBUG_SIGNAL_CLASS, sig.sigClass, "sig.sigClass");
Debug(DEBUG_SIGNAL_CLASS, sig.reason, "sig.reason");
}