15 #include "ui_dmmform.h"
18 #include "interface.h"
20 #include "xnodeconnector.h"
22 XDMM::XDMM(
const char *name,
bool runtime,
23 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas) :
26 dynamic_pointer_cast<
XDriver>(shared_from_this()))),
27 m_function(create<
XComboNode>(
"Function", false)),
28 m_waitInms(create<
XUIntNode>(
"WaitInms", false)),
29 m_form(new
FrmDMM(g_pFrmMain)) {
30 meas->scalarEntries()->
insert(tr_meas, m_entry);
32 tr[ *m_waitInms] = 100;
34 m_form->statusBar()->hide();
35 m_form->setWindowTitle(i18n(
"DMM - ") +
getLabel() );
36 m_function->setUIEnabled(
false);
37 m_waitInms->setUIEnabled(
false);
38 m_conFunction = xqcon_create<XQComboBoxConnector>(m_function, m_form->m_cmbFunction,
Snapshot( *m_function));
39 m_conWaitInms = xqcon_create<XQSpinBoxUnsignedConnector>(m_waitInms, m_form->m_numWait);
51 double x = reader.pop<
double>();
53 m_entry->value(tr, x);
65 e.print(
getLabel() +
" " + i18n(
"DMM Error"));
73 m_function->setUIEnabled(
true);
74 m_waitInms->setUIEnabled(
true);
77 m_lsnOnFunctionChanged =
78 tr[ *
function()].onValueChanged().connectWeakly(
82 msecsleep( ***waitInms());
83 if(( **
function())->to_str().empty())
continue;
85 auto writer = std::make_shared<RawData>();
87 XTime time_awared = XTime::now();
93 e.print(
getLabel() +
" " + i18n(
"DMM Read Error"));
100 m_function->setUIEnabled(
false);
101 m_waitInms->setUIEnabled(
false);
103 m_lsnOnFunctionChanged.reset();