template<> bool device<UserFDK>::readData( task& task, waveform& data ) { static std::chrono::high_resolution_clock::time_point __uptime = std::chrono::high_resolution_clock::now(); IAgMD2LogicDevicePtr spDpuA = task.spAgDrvr()->LogicDevices->Item[L"DpuA"]; long words_32bits = task.method().nbr_of_s_to_acquire; data.method_ = task.method(); try { SAFEARRAY * psaWfmDataRaw(0); spDpuA->ReadIndirectInt32(0x11, 0, words_32bits, &psaWfmDataRaw, &data.actualElements_, &data.firstValidElement_); // workaround data.timestamp_ = std::chrono::duration< uint64_t, std::pico >( std::chrono::high_resolution_clock::now() - __uptime ).count(); safearray_t<int32_t> sa( psaWfmDataRaw ); data.d_.resize( words_32bits ); std::copy( sa.data() + data.firstValidElement_, sa.data() + words_32bits, data.d_.begin() ); } catch ( _com_error& e ) { TERR(e,"readData::ReadIndirectInt32"); } return true; }
template<> bool device<Simulate>::readData( task& task, waveform& data ) { data.method_ = task.method(); if ( simulator * simulator = task.simulator() ) return simulator->readData( data ); return false; }