pulserdrivernidaq.cpp
1 /***************************************************************************
2  Copyright (C) 2002-2015 Kentaro Kitagawa
3  kitagawa@phys.s.u-tokyo.ac.jp
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  You should have received a copy of the GNU Library General
11  Public License and a list of authors along with this program;
12  see the files COPYING and AUTHORS.
13 ***************************************************************************/
14 #include "pulserdrivernidaq.h"
15 
16 #include "interface.h"
17 
18 REGISTER_TYPE(XDriverList, NIDAQAODOPulser, "NMR pulser NI-DAQ analog/digital output");
19 REGISTER_TYPE(XDriverList, NIDAQDOPulser, "NMR pulser NI-DAQ digital output only");
20 REGISTER_TYPE(XDriverList, NIDAQMSeriesWithSSeriesPulser, "NMR pulser NI-DAQ M Series with S Series");
21 
22 XNIDAQMSeriesWithSSeriesPulser::XNIDAQMSeriesWithSSeriesPulser(const char *name, bool runtime,
23  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
24  XNIDAQmxPulser(name, runtime, ref(tr_meas), meas),
25  m_ao_interface(XNode::create<XNIDAQmxInterface>("SubInterface", false,
26  dynamic_pointer_cast<XDriver>(this->shared_from_this()))) {
27  meas->interfaces()->insert(tr_meas, m_ao_interface);
28  m_ao_interface->control()->setUIEnabled(false);
29 }
30 void
32  openAODO();
33  this->start();
34 }
35 void
37 // if(XString(interface()->productSeries()) != "M")
38 // throw XInterface::XInterfaceError(i18n("Product-type mismatch."), __FILE__, __LINE__);
39  openDO();
40  this->start();
41 }
42 void
44  if(XString(interface()->productSeries()) != "M")
45  throw XInterface::XInterfaceError(i18n("Product-type mismatch."), __FILE__, __LINE__);
46 
47  intfAO()->start();
48  if(!intfAO()->isOpened())
49  throw XInterface::XInterfaceError(i18n("Opening M series device failed."), __FILE__, __LINE__);
50 
51  if(XString(intfAO()->productSeries()) != "S")
52  throw XInterface::XInterfaceError(i18n("Product-type mismatch."), __FILE__, __LINE__);
53  openAODO();
54  this->start();
55 }

Generated for KAME4 by  doxygen 1.8.3