/** * Initialize and enable the comparator. * * Enables the comperator and sets important values. * * Do NOT set lock = true if you want to be able to set other values * later. */ static inline void initialize( InvertingInput n_in, NonInvertingInput p_in, Output out = Output::NOT_CONNECTED, Hysteresis hyst = Hysteresis::NO_HYSTERESIS, Mode mode = Mode::HIGH_SPEED, Polarity pol = Polarity::NOT_INVERTED, bool lock_comp = false) { setInvertingInput(n_in); setNonInvertingInput(p_in); setOutputSelection(out); setHysteresis(hyst); setMode(mode); setPolarity(pol); setEnabled(true); // enable comparator if(lock_comp) lock(); }
CLSPGT8000HVChannel::CLSPGT8000HVChannel(const QString &name, const QString &pvBaseName, QObject *parent) : AMHighVoltageChannel(name, parent) { wasConnected_ = false; poweringDown_ = false; setNoPolarity(false); setPolarity(AMHighVoltageChannel::negative); setNoCurrent(true); description_ = ""; demand_ = new AMPVControl(name+"Demand", pvBaseName+":Bias:Volt:fbk", pvBaseName+":Bias:Volt", QString(), this, 1.0); voltage_ = new AMReadOnlyPVControl(name+"Voltage", pvBaseName+":Bias:VoltActual:fbk", this); toggle_ = new AMPVControl(name+"Toggle", pvBaseName+":Power:fbk", pvBaseName+":Power", QString(), this, 0.5); connect(demand_, SIGNAL(valueChanged(double)), this, SLOT(onDemandChanged(double))); connect(voltage_, SIGNAL(valueChanged(double)), this, SLOT(onVoltageChanged(double))); connect(toggle_, SIGNAL(valueChanged(double)), this, SLOT(onToggleChanged(double))); connect(demand_, SIGNAL(connected(bool)), this, SLOT(onChildConnected(bool))); connect(voltage_, SIGNAL(connected(bool)), this, SLOT(onChildConnected(bool))); connect(toggle_, SIGNAL(connected(bool)), this, SLOT(onChildConnected(bool))); }