// Sets pulse width in seconds bool RfSensor::setSlotPulseWidth(const Basic::Number* const msg) { bool ok = false; if (msg != 0) { ok = setPulseWidth( msg->getReal() ); if (!ok) { std::cerr << "RfSensor::setPulseWidth: Error setting pulse width!" << std::endl; } } return ok; }
// Sets pulse width using Basic::Time bool RfSensor::setSlotPulseWidth(const Basic::Time* const msg) { bool ok = false; if (msg != 0) { LCreal x = Basic::Seconds::convertStatic( *msg ); ok = setPulseWidth( x ); if (!ok) { std::cerr << "RfSensor::setPulseWidth: Error setting pulse width!" << std::endl; } } return ok; }
// Sets pulse width using base::Time bool RfSensor::setSlotPulseWidth(const base::Time* const msg) { bool ok = false; if (msg != nullptr) { const double x = base::Seconds::convertStatic( *msg ); ok = setPulseWidth( x ); if (!ok) { std::cerr << "RfSensor::setPulseWidth: Error setting pulse width!" << std::endl; } } return ok; }
void Oscillator::reset() { parameters.amp = 0.5f; parameters.wave = OSC_SAWTOOTH; counter = 0.0f; sqp = 1.0f; sqc = 0; parameters.pulsewidth = 0.0f; parameters.detune = 0; setAmp(1.0f); setWave(OSC_SAWTOOTH); setPulseWidth(0.0f); setNote(12); setDetune(0); }