17 m_SampleRate(saver, this,
"sampleRate", 1000.0,
"Sampling Rate for Extra Inputs"),
18 m_AcquireDelay(saver, this,
"acquireDelay", 0.107,
"Delay between exposure end and Image available in QXRD"),
19 m_ExposureTime(
QcepSettingsSaverPtr(), this,
"exposureTime", 0.107,
"Exposure time (in seconds)"),
20 m_DeviceName(saver, this,
"deviceName",
"",
"NI-DAQ Device Name"),
28 printf(
"QxrdAcquisitionExtraInputs::QxrdAcquisitionExtraInputs(%p)\n",
this);
53 printf(
"Deleting acquisition extra inputs\n");
57 printf(
"QxrdAcquisitionExtraInputs::~QxrdAcquisitionExtraInputs(%p)\n",
this);
77 int n = settings->beginReadArray(section+
"/channels");
87 for (
int i=0; i<n; i++) {
88 settings->setArrayIndex(i);
93 chan->readSettings(settings,
"");
108 settings->beginWriteArray(section+
"/channels");
112 for (
int i=0; i<n; i++) {
113 settings->setArrayIndex(i);
117 chan->writeSettings(settings,
"");
121 settings->endArray();
129 acq->printMessage(msg, ts);
138 acq->criticalMessage(msg, ts);
147 acq->statusMessage(msg, ts);
153 if (!get_Enabled()) {
163 QStringList uniqueChannels;
164 QVector<double> channelMinimum, channelMaximum;
167 if (chanp && chanp->get_Enabled()) {
168 QString channame = chanp->get_ChannelName();
169 double chanmin = chanp->get_Min();
170 double chanmax = chanp->get_Max();
172 int physChan = uniqueChannels.indexOf(channame);
175 uniqueChannels.append(channame);
176 physChan = uniqueChannels.count() - 1;
177 channelMinimum.append(chanmin);
178 channelMaximum.append(chanmax);
180 channelMinimum[physChan] = qMin(channelMinimum[physChan], chanmin);
181 channelMaximum[physChan] = qMin(channelMaximum[physChan], chanmax);
184 chanp->set_PhysicalChannel(physChan);
190 acq->get_ExposureTime(),
193 channelMaximum) == 0) {
195 set_ExposureTime(acq->get_ExposureTime());
197 QTimer::singleShot(1000*(get_AcquireDelay() + acq->get_ExposureTime() + 1.0),
263 if (!get_Skipping()) {
271 if (chanp && chanp->get_Enabled()) {
275 if (acq && chanp->get_Triggered()) {
276 acq->set_Triggered(
true);
288 if (get_Enabled() && img) {
311 if (chanp && chanp->get_Enabled()) {
312 double val = chanp->evaluateChannel();
315 printMessage(tr(
"QxrdAcquisitionExtraInputs::evaluateChannels [%1] = %2").arg(i).arg(val));
330 return chanp->evaluateChannel();
341 QVector<double> res(chanp->readChannel().count());
342 double offset = get_AcquireDelay();
343 double rate = get_SampleRate();
345 for (
int i=0; i<res.count(); i++) {
346 res[i] = i/rate - offset;
351 return QVector<double>();
360 return chanp->readChannel();
362 return QVector<double>();
371 return chanp->averageChannel();
381 double n=res.count(), sum=0;
383 for(
int i=0; i<n; i++) {
qint64 qcepDebug(int cond)
QSharedPointer< QxrdAcquisition > QxrdAcquisitionPtr
virtual void readSettings(QSettings *set, QString section)
QWeakPointer< QxrdExperiment > QxrdExperimentWPtr
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
QSharedPointer< QxrdNIDAQPluginInterface > QxrdNIDAQPluginInterfacePtr
virtual void writeSettings(QSettings *set, QString section)
QWeakPointer< QxrdAcquisition > QxrdAcquisitionWPtr
QWeakPointer< QxrdAcquisitionParameterPack > QxrdAcquisitionParameterPackWPtr
void valueChanged(double val, int index)
QSharedPointer< QcepInt16ImageData > QcepInt16ImageDataPtr
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr