本文整理汇总了C++中QTime::start方法的典型用法代码示例。如果您正苦于以下问题:C++ QTime::start方法的具体用法?C++ QTime::start怎么用?C++ QTime::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTime
的用法示例。
在下文中一共展示了QTime::start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildFlow
FlowField_sV* FlowSourceOpenCV_sV::buildFlow(uint leftFrame, uint rightFrame, FrameSize frameSize) throw(FlowBuildingError)
{
#if CV_MAJOR_VERSION == 2
#ifdef HAVE_OPENCV_OCL
if (ocl_device_index >= 0) {
setupOclDevice();
}
#endif
#endif
QString flowFileName(flowPath(leftFrame, rightFrame, frameSize));
/// \todo Check if size is equal
if (!QFile(flowFileName).exists()) {
QTime time;
time.start();
QString prevpath = project()->frameSource()->framePath(leftFrame, frameSize);
QString path = project()->frameSource()->framePath(rightFrame, frameSize);
qDebug() << "Building flow for left frame " << leftFrame << " to right frame " << rightFrame << "; Size: " << frameSize;
// check if file have been generated !
//TODO: maybe better error handling ?
if (!QFile(prevpath).exists())
throw FlowBuildingError(QString("Could not read image " + prevpath));
if (!QFile(path).exists())
throw FlowBuildingError(QString("Could not read image " + path));
cv::Mat prevgray, gray;
prevgray = cv::imread(prevpath.toStdString(), CV_LOAD_IMAGE_ANYDEPTH);
gray = cv::imread(path.toStdString(), CV_LOAD_IMAGE_ANYDEPTH);
#if CV_MAJOR_VERSION == 3
cv::UMat uprevgray, ugray;
prevgray.copyTo(uprevgray);
gray.copyTo(ugray);
#endif
{
if (!prevgray.empty()) {
#if CV_MAJOR_VERSION == 3
buildFlowOpenCV_3(uprevgray, ugray, flowFileName.toStdString());
#else
#ifdef HAVE_OPENCV_OCL
if (ocl_device_index >= 0) {
buildFlowOpenCV_OCL(prevgray, gray, flowFileName.toStdString());
} else {
buildFlowOpenCV_CPU(prevgray, gray, flowFileName.toStdString());
}
#else
buildFlowOpenCV_CPU(prevgray, gray, flowFileName.toStdString());
#endif
#endif
} else {
qDebug() << "imread: Could not read image " << prevpath;
throw FlowBuildingError(QString("imread: Could not read image " + prevpath));
}
}
qDebug() << "Optical flow built for " << flowFileName << " in " << time.elapsed() << " ms.";
} else {
qDebug().nospace() << "Re-using existing flow image for left frame " << leftFrame << " to right frame " << rightFrame << ": " << flowFileName;
}
try {
return FlowRW_sV::load(flowFileName.toStdString());
} catch (FlowRW_sV::FlowRWError &err) {
throw FlowBuildingError(err.message.c_str());
}
}
示例2: load
void XSPFParser::load() {
QTime timeElapsed;
timeElapsed.start();
_stop = false;
QList<MediaInfo> files;
qDebug() << __FUNCTION__ << "Playlist:" << _filename;
QFile file(_filename);
if (file.open(QIODevice::ReadOnly)) {
MediaInfo mediaInfo;
QXmlStreamReader xml(&file);
while (!xml.atEnd() && !_stop) {
xml.readNext();
switch (xml.tokenType()) {
case QXmlStreamReader::StartElement: {
QString element(xml.name().toString());
if (element == XSPF_TRACK) {
readTrack(xml, mediaInfo);
if (!mediaInfo.fileName().isEmpty()) {
//Add file to the list of files
files << mediaInfo;
//Clear the MediaInfo
mediaInfo.clear();
if (files.size() > FILES_FOUND_LIMIT) {
//Emits the signal every FILES_FOUND_LIMIT files found
emit filesFound(files);
files.clear();
}
}
}
//Otherwise won't read the track end element
break;
}
}
}
if (xml.hasError()) {
qCritical() << __FUNCTION__ << "Error:" << xml.errorString()
<< "line:" << xml.lineNumber()
<< "column:" << xml.columnNumber();
}
}
file.close();
if (!files.isEmpty()) {
//Emits the signal for the remaining files found (< FILES_FOUND_LIMIT)
emit filesFound(files);
}
//Emits the last signal
emit finished(timeElapsed.elapsed());
}
示例3: query
QList<struct BansheeDbConnection::PlaylistEntry> BansheeDbConnection::getPlaylistEntries(int playlistId) {
QTime time;
time.start();
QList<struct BansheeDbConnection::PlaylistEntry> list;
struct BansheeDbConnection::PlaylistEntry entry;
QSqlQuery query(m_database);
query.setForwardOnly(true); // Saves about 50% time
QString queryString;
if (playlistId == 0) {
// Create Master Playlist
queryString = QString(
"SELECT "
"CoreTracks.TrackID, " // 0
"CoreTracks.TrackID, " // 1
"CoreTracks.Title, " // 2
"CoreTracks.Uri, " // 3
"CoreTracks.Duration, " // 4
"CoreTracks.ArtistID, " // 5
"CoreArtists.Name, " // 6
"CoreTracks.Year, " // 7
"CoreTracks.AlbumID, " // 8
"CoreAlbums.Title, " // 9
"CoreTracks.Rating, " // 10
"CoreTracks.Genre, " // 11
"CoreTracks.TrackNumber, " // 12
"CoreTracks.DateAddedStamp, " // 13
"CoreTracks.BPM, " // 14
"CoreTracks.BitRate, " // 15
"CoreTracks.Comment, " // 16
"CoreTracks.PlayCount, " // 17
"CoreTracks.Composer, " // 18
"CoreTracks.Grouping, " // 19
"CoreAlbums.ArtistID, " // 20
"AlbumArtists.Name " // 21
"FROM CoreTracks "
"INNER JOIN CoreArtists ON CoreArtists.ArtistID = CoreTracks.ArtistID "
"INNER JOIN CoreArtists AlbumArtists ON AlbumArtists.ArtistID = CoreAlbums.ArtistID "
"INNER JOIN CoreAlbums ON CoreAlbums.AlbumID = CoreTracks.AlbumID ");
} else {
// SELECT playlist from CorePlaylistEntries
queryString = QString(
"SELECT "
"CorePlaylistEntries.TrackID, " // 0
"CorePlaylistEntries.ViewOrder, " // 1
"CoreTracks.Title, " // 2
"CoreTracks.Uri, " // 3
"CoreTracks.Duration, " // 4
"CoreTracks.ArtistID, " // 5
"CoreArtists.Name, " // 6
"CoreTracks.Year, " // 7
"CoreTracks.AlbumID, " // 8
"CoreAlbums.Title, " // 9
"CoreTracks.Rating, " // 10
"CoreTracks.Genre, " // 11
"CoreTracks.TrackNumber, " // 12
"CoreTracks.DateAddedStamp, " // 13
"CoreTracks.BPM, " // 14
"CoreTracks.BitRate, " // 15
"CoreTracks.Comment, " // 16
"CoreTracks.PlayCount, " // 17
"CoreTracks.Composer, " // 18
"CoreTracks.Grouping, " // 19
"CoreAlbums.ArtistID, " // 20
"AlbumArtists.Name " // 21
"FROM CorePlaylistEntries "
"INNER JOIN CoreTracks ON CoreTracks.TrackID = CorePlaylistEntries.TrackID "
"INNER JOIN CoreArtists ON CoreArtists.ArtistID = CoreTracks.ArtistID "
"INNER JOIN CoreArtists AlbumArtists ON AlbumArtists.ArtistID = CoreAlbums.ArtistID "
"INNER JOIN CoreAlbums ON CoreAlbums.AlbumID = CoreTracks.AlbumID "
"WHERE CorePlaylistEntries.PlaylistID = %1")
.arg(playlistId);
}
query.prepare(queryString);
if (query.exec()) {
while (query.next()) {
entry.trackId = query.value(0).toInt();
entry.viewOrder = query.value(1).toInt();
m_trackMap[entry.trackId].title = query.value(2).toString();
m_trackMap[entry.trackId].uri = QUrl::fromEncoded(query.value(3).toByteArray(), QUrl::StrictMode);
m_trackMap[entry.trackId].duration = query.value(4).toInt();
int artistId = query.value(5).toInt();
m_artistMap[artistId].name = query.value(6).toString();
m_trackMap[entry.trackId].year = query.value(7).toInt();
int albumId = query.value(8).toInt();
m_albumMap[albumId].title = query.value(9).toString();
int albumArtistId = query.value(20).toInt();
m_artistMap[albumArtistId].name = query.value(21).toString();
m_trackMap[entry.trackId].rating = query.value(10).toInt();
m_trackMap[entry.trackId].genre = query.value(11).toString();
m_trackMap[entry.trackId].grouping = query.value(19).toString();
m_trackMap[entry.trackId].tracknumber = query.value(12).toInt();
m_trackMap[entry.trackId].dateadded = query.value(13).toInt();
//.........这里部分代码省略.........
示例4: run
void run()
{
testsTurn.release();
// TEST 1: thread can't acquire lock
threadsTurn.acquire();
QVERIFY(!normalMutex.tryLock());
testsTurn.release();
// TEST 2: thread can acquire lock
threadsTurn.acquire();
QVERIFY(normalMutex.tryLock());
QVERIFY(lockCount.testAndSetRelaxed(0, 1));
QVERIFY(!normalMutex.tryLock());
QVERIFY(lockCount.testAndSetRelaxed(1, 0));
normalMutex.unlock();
testsTurn.release();
// TEST 3: thread can't acquire lock, timeout = waitTime
threadsTurn.acquire();
QTime timer;
timer.start();
QVERIFY(!normalMutex.tryLock(waitTime));
QVERIFY(timer.elapsed() >= waitTime);
testsTurn.release();
// TEST 4: thread can acquire lock, timeout = waitTime
threadsTurn.acquire();
timer.start();
QVERIFY(normalMutex.tryLock(waitTime));
QVERIFY(timer.elapsed() <= waitTime);
QVERIFY(lockCount.testAndSetRelaxed(0, 1));
timer.start();
// it's non-recursive, so the following lock needs to fail
QVERIFY(!normalMutex.tryLock(waitTime));
QVERIFY(timer.elapsed() >= waitTime);
QVERIFY(lockCount.testAndSetRelaxed(1, 0));
normalMutex.unlock();
testsTurn.release();
// TEST 5: thread can't acquire lock, timeout = 0
threadsTurn.acquire();
QVERIFY(!normalMutex.tryLock(0));
testsTurn.release();
// TEST 6: thread can acquire lock, timeout = 0
threadsTurn.acquire();
timer.start();
QVERIFY(normalMutex.tryLock(0));
QVERIFY(timer.elapsed() < waitTime);
QVERIFY(lockCount.testAndSetRelaxed(0, 1));
QVERIFY(!normalMutex.tryLock(0));
QVERIFY(lockCount.testAndSetRelaxed(1, 0));
normalMutex.unlock();
testsTurn.release();
// TEST 7 overflow: thread can acquire lock, timeout = 3000 (QTBUG-24795)
threadsTurn.acquire();
timer.start();
QVERIFY(normalMutex.tryLock(3000));
QVERIFY(timer.elapsed() < 3000);
normalMutex.unlock();
testsTurn.release();
threadsTurn.acquire();
}
示例5: hideAllTrajectoryPaths
void
NodeMobilityMgr::populateNodePosTable(QString filter1,
QString filter2,
QString filter3,
QString filter4,
QTableWidget *tbl,
bool showTraj,
QProgressBar * progressBar)
{
QStringList headerList;
headerList << "Time"
<< "Node Id"
<< "X coord"
<< "Y coord";
tbl->clearContents();
tbl->setRowCount(0);
tbl->setColumnCount(headerList.count());
tbl->setHorizontalHeaderLabels(headerList);
int64_t filter1NodeId = -1;
int64_t filter2NodeId = -1;
int64_t filter3NodeId = -1;
int64_t filter4NodeId = -1;
if(filter1 != "All")
{
filter1NodeId = filter1.toUInt();
}
if(filter2 != "None")
{
filter2NodeId = filter2.toUInt();
}
if(filter3 != "None")
{
filter3NodeId = filter3.toUInt();
}
if(filter4 != "None")
{
filter4NodeId = filter4.toUInt();
}
QTime t;
t.start();
hideAllTrajectoryPaths();
uint32_t progressBarValue = 0;
for(NodeIdTimeLocationMap_t::const_iterator i = m_tsAnimNodes.begin();
i != m_tsAnimNodes.end();
++i)
{
uint32_t nodeId = i->first;
if(filter1 != "All")
{
if(filter1NodeId == nodeId)
goto resume;
if(filter2NodeId == nodeId)
goto resume;
if(filter3NodeId == nodeId)
goto resume;
if(filter4NodeId == nodeId)
goto resume;
continue;
}
resume:
TimeLocationVector_t tlv = i->second;
if(showTraj)
showTrajectory(nodeId, tlv);
for (TimeLocationVector_t::const_iterator j = tlv.begin();
j != tlv.end();
++j)
{
TimeLocation tl = *j;
if(!tbl)
{
return;
}
int row = tbl->rowCount();
tbl->insertRow(row);
QTableWidgetItem * wiTime = new QTableWidgetItem(QString::number(tl.timeStamp));
QTableWidgetItem * wiNodeId = new QTableWidgetItem(QString::number(nodeId));
QTableWidgetItem * wiXCoord = new QTableWidgetItem(QString::number(tl.location.x()));
QTableWidgetItem * wiYCoord = new QTableWidgetItem(QString::number(tl.location.y()));
tbl->setItem(row, 0, wiTime);
tbl->setItem(row, 1, wiNodeId);
tbl->setItem(row, 2, wiXCoord);
tbl->setItem(row, 3, wiYCoord);
}
progressBar->setValue(++progressBarValue);
if(t.elapsed() > 1000)
{
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
t.restart();
}
}
//.........这里部分代码省略.........
示例6: run
void UARTWidget::run()
{
qDebug() << "[UARTWidget] Thread created.";
m_serialPort = new QSerialPort(m_serialInfo);
m_serialPort->setBaudRate(250000);
m_serialPort->setDataBits(QSerialPort::Data8);
m_serialPort->setStopBits(QSerialPort::TwoStop);
m_serialPort->setParity(QSerialPort::NoParity);
m_serialPort->setFlowControl(QSerialPort::NoFlowControl);
if (!m_serialPort->open(QIODevice::ReadWrite))
{
qWarning() << QString("[UARTWidget] Failed to open port %1, error: %2")
.arg(m_serialInfo.portName()).arg(m_serialPort->errorString());
return;
}
// If the "new" custom baud rate method is available, then use it to
// make sure the baud rate is properly set to 250Kbps
#if defined(TCGETS2)
int fd = m_serialPort->handle();
static const int rate = 250000;
struct termios2 tio; // linux-specific terminal stuff
if (ioctl(fd, TCGETS2, &tio) < 0)
{
qDebug() << "[UARTWidget] Error in getting termios2 data";
return;
}
tio.c_cflag &= ~CBAUD;
tio.c_cflag |= BOTHER;
tio.c_ispeed = rate;
tio.c_ospeed = rate; // set custom speed directly
if (ioctl(fd, TCSETS2, &tio) < 0)
{
qDebug() << "[UARTWidget] Error in setting termios2 data";
return;
}
#endif
m_serialPort->clear();
m_serialPort->setRequestToSend(false);
// One "official" DMX frame can take (1s/44Hz) = 23ms
int frameTime = (int) floor(((double)1000 / 30) + (double)0.5);
m_granularity = Bad;
QTime time;
time.start();
usleep(1000);
if (time.elapsed() <= 3)
m_granularity = Good;
m_running = true;
while (m_running == true)
{
time.restart();
if (m_mode & Output)
{
m_serialPort->setBreakEnabled(true);
if(m_granularity == Good)
usleep(DMX_BREAK);
m_serialPort->setBreakEnabled(false);
if(m_granularity == Good)
usleep(DMX_MAB);
if (m_serialPort->write(m_outputBuffer) == 0)
qDebug() << "[UARTWidget] Error in writing output buffer";
m_serialPort->waitForBytesWritten(10);
// Sleep for the rest of the DMX frame time
if (m_granularity == Good)
while (time.elapsed() < frameTime) { usleep(1000); }
else
while (time.elapsed() < frameTime) { /* Busy sleep */ }
}
}
}
示例7: ICore
// instance is created by Core::CorePlugin()
CoreImpl::CoreImpl(QObject *parent) :
ICore(parent),
m_MainWindow(0),
m_ActionManager(0),
m_ContextManager(0),
m_PadTools(0)
{
m_instance = this;
m_Settings = new SettingsPrivate(this);
m_Settings->setPath(ISettings::UpdateUrl, Utils::Constants::FREETOOLBOX_UPDATE_URL);
m_Theme = new ThemePrivate(this);
m_Theme->setThemeRootPath(m_Settings->path(ISettings::ThemeRootPath));
// m_CommandLine = new CommandLine();
// m_CommandLine->feedPatientDatas(m_Patient);
QTime chrono;
chrono.start();
bool logChrono = false; // m_CommandLine->value(CommandLine::CL_Chrono).toBool();
if (logChrono)
Utils::Log::logTimeElapsed(chrono, "Core", "command line parsing");
m_Theme->createSplashScreen(Constants::FREETOOLBOX_SPLASHSCREEN);
// add translators
m_Theme->messageSplashScreen(tkTr(Trans::Constants::INITIALIZING_TRANSLATIONS));
m_Translators = new Translators(this);
m_Translators->setPathToTranslations(m_Settings->path(ISettings::TranslationsPath));
// Qt
m_Translators->addNewTranslator("qt");
// Core Needed Libs
m_Translators->addNewTranslator(Trans::Constants::CONSTANTS_TRANSLATOR_NAME);
m_Translators->addNewTranslator("lib_utils");
m_Translators->addNewTranslator("plugin_ftbcore");
if (logChrono)
Utils::Log::logTimeElapsed(chrono, "Core", "translators");
m_Theme->messageSplashScreen(tkTr(Trans::Constants::STARTING_APPLICATION_AT_1).arg(QDateTime::currentDateTime().toString()));
m_FileManager = new FileManager(this);
m_UpdateChecker = new Utils::UpdateChecker(this);
LOG_FOR("Core", tkTr(Trans::Constants::STARTING_APPLICATION_AT_1).arg( QDateTime::currentDateTime().toString()));
// initialize the settings
m_Theme->messageSplashScreen(tkTr(Trans::Constants::LOADING_SETTINGS));
// WINE compatibility (only for testing under ubuntu when crosscompiling)
#ifdef Q_OS_WIN
// For WINE testings
// if (m_CommandLine->value(Core::CommandLine::CL_RunningUnderWine).toBool()) {
// LOG_FOR( "Core", "Running under Wine environnement." );
// QFont::insertSubstitution("MS Shell Dlg", "Tahoma" );
// QFont::insertSubstitution("MS Shell Dlg 2", "Tahoma" );
// }
#endif
foreach(const QString &l, QCoreApplication::libraryPaths()) {
LOG_FOR("Core" , tkTr(Trans::Constants::USING_LIBRARY_1).arg(l));
}
示例8: start
void Spider::start(){
XpathUtil *util = new XpathUtil(page);
int count = 0;
global::unVisitedUrl->pop();
global::unVisitedUrl->pop();
while (!global::unVisitedUrl->empty())
{
Node node = global::unVisitedUrl->top();
this->node = node;
//判断url是否本地采集过
if(global::bf->contains(node.url.toStdString())){
qDebug()<< node.url<<" already crawled before !";
global::unVisitedUrl->pop();
continue;
}
count++;
qDebug()<<count;
//判断数据采集节点是否服务器已经采集过
if(node.depth == global::maxDepth){
instance->flag = false;
instance->getService = true;
if(this->get(instance,node.url)){
qDebug()<<"elasticesearch indexed :" +node.url;
logInfo(QString::number(count)+" elasticesearch indexed :"+node.url);
global::bf->insert(node.url.toStdString());
global::unVisitedUrl->pop();
continue;
}
}
logInfo(QString::number(count)+" load url :"+node.url);
qDebug()<<"load url :"+node.url;
page->flag = true;
page->mainFrame()->load(QUrl(node.url));
QEventLoop eventLoop;
QObject::connect(page, SIGNAL(loadFinished(bool)), &eventLoop, SLOT(quit()));
QTimer timer;
timer.setSingleShot(true);
QObject::connect(&timer,SIGNAL(timeout()),&eventLoop,SLOT(quit()));
//5s
timer.start(5000);
eventLoop.exec(); //block until finish
if(timer.isActive()){
timer.stop();
}
//采集数据节点
int emptyCount = 0;
if(node.depth == global::maxDepth){
page->flag = true;
QMap<int,QStringList> result;
QMap<QString, QVariant> map;
emptyCount=0;
for(int j=0;j<node.collectData.size()-3;j++){
QStringList tmpResult;
QString nameFiled = node.collectData.at(j)["name"];
QString resultFiled = util->parserXpath(page,node.collectData.at(j)["xpath"],node.collectData.at(j)["type"].toInt());
//logInfo("[collect data ] nameFiled : "+nameFiled +" resultFiled :"+resultFiled);
//logInfo("debug : "+node.collectData.at(j)["xpath"]+ " debug :"+node.collectData.at(j)["type"]);
tmpResult.append(nameFiled);
tmpResult.append(resultFiled);
result.insert(j+1,tmpResult);
map.insert(nameFiled,resultFiled);
if(resultFiled.trimmed()==""){
emptyCount++;
}
}
QStringList tmpResult;
tmpResult.append("url");
tmpResult.append(node.url);
result.insert(node.collectData.size()-2,tmpResult);
map.insert("url",node.url);
QStringList tmpResult2;
tmpResult2.append("来源");
tmpResult2.append(global::taskID);
result.insert(node.collectData.size()-1,tmpResult2);
map.insert("来源",global::taskID);
QDateTime current_date_time = QDateTime::currentDateTime();
QString current_date = current_date_time.toString("yyyy-MM-dd hh:mm:ss");
QStringList tmpResult3;
tmpResult3.append("采集时间");
tmpResult3.append(current_date);
map.insert("采集时间",current_date);
result.insert(node.collectData.size(),tmpResult3);
if(emptyCount<7){
global::sqlite->insertXpathResult(global::taskID,result);
this->post(map,instance);
}
}else{
//非采集节点
page->flag = false;
//qDebug()<<page->mainFrame()->toHtml();
for(int j=0;j<node.regionXpath.size();j++){
qDebug()<<"region xpath";
this->node = (*(global::nodeMap))[node.depth];
this->isRegionNode = true;
//.........这里部分代码省略.........
示例9: computeOrbitalGrids
// This requires all the Grids be of the same size and all the orbitals to be
// of the same spin. Returns true only if something was calculated.
bool MolecularOrbitals::computeOrbitalGrids(Data::GridDataList& grids)
{
if (grids.isEmpty()) return false;;
// Check that the grids are all of the same size and Spin
Data::GridData* g0(grids[0]);
QList<int> orbitals;
Data::GridDataList::iterator iter;
for (iter = grids.begin(); iter != grids.end(); ++iter) {
qDebug() << "Computing grid" << (*iter)->surfaceType().toString() ;
(*iter)->size().dump();
if ( ((*iter)->size() != g0->size()) ) {
QLOG_ERROR() << "Different sized grids found in molecular orbitals calculator";
return false;
}
if ( ((*iter)->surfaceType().kind() != Data::SurfaceType::AlphaOrbital) &&
((*iter)->surfaceType().kind() != Data::SurfaceType::BetaOrbital) ) {
QLOG_ERROR() << "Incorrect grid type found in molecular orbitals calculator";
QLOG_ERROR() << (*iter)->surfaceType().toString();
return false;
}
orbitals.append((*iter)->surfaceType().index()-1);
}
QTime time;
time.start();
Matrix const* coefficients;
if (g0->surfaceType().kind() == Data::SurfaceType::AlphaOrbital) {
QLOG_TRACE() << "Setting MO coefficient data to Alpha";
coefficients = &(m_molecularOrbitals.alphaCoefficients());
}else {
QLOG_TRACE() << "Setting MO coefficient data to Beta";
coefficients = &(m_molecularOrbitals.betaCoefficients());
}
unsigned nOrb(orbitals.size());
unsigned nx, ny, nz;
g0->getNumberOfPoints(nx, ny, nz);
Vec delta(g0->delta());
Vec origin(g0->origin());
QProgressDialog progressDialog("Calculating orbital grid data", "Cancel", 0,
nx, QApplication::activeWindow());
int progress(0);
progressDialog.setValue(progress);
progressDialog.setWindowModality(Qt::WindowModal);
progressDialog.show();
double x, y, z;
double* values;
double* tmp = new double[nOrb];
unsigned i, j, k;
Data::ShellList const& shells(m_molecularOrbitals.shellList());
Data::ShellList::const_iterator shell;
for (i = 0, x = origin.x; i < nx; ++i, x += delta.x) {
for (j = 0, y = origin.y; j < ny; ++j, y += delta.y) {
for (k = 0, z = origin.z; k < nz; ++k, z += delta.z) {
Vec gridPoint(x,y,z);
for (unsigned orb = 0; orb < nOrb; ++orb) tmp[orb] = 0.0;
unsigned count(0);
//-----------------------------------------------------
for (shell = shells.begin(); shell != shells.end(); ++shell) {
if ( (values = (*shell)->evaluate(gridPoint)) ) {
for (unsigned s = 0; s < (*shell)->nBasis(); ++s) {
for (unsigned orb = 0; orb < nOrb; ++orb) {
tmp[orb] += (*coefficients)(orbitals[orb], count) * values[s];
}
++count;
}
}else {
count += (*shell)->nBasis();
}
}
for (unsigned orb = 0; orb < nOrb; ++orb) {
(*grids.at(orb))(i, j, k) = tmp[orb];
}
//-----------------------------------------------------
}
}
++progress;
progressDialog.setValue(progress);
if (progressDialog.wasCanceled()) return false;
}
delete [] tmp;
double t = time.elapsed() / 1000.0;
QLOG_INFO() << "Time to compute orbital grid data:" << t << "seconds";
//.........这里部分代码省略.........
示例10: computeDensityGrids
bool MolecularOrbitals::computeDensityGrids(Data::GridData*& alpha, Data::GridData*& beta)
{
QTime time;
time.start();
unsigned nx, ny, nz;
alpha->getNumberOfPoints(nx, ny, nz);
Vec delta(alpha->delta());
Vec origin(alpha->origin());
// We take a two pass approach, the first computes data on a grid with half
// the number of points for each dimension (so a factor of 8 fewer points
// than the target grid). We then used these values in a subsequent pass to
// refine only those parts with significant density.
unsigned totalProgress(8*nx); // first and second passes
unsigned progress(0);
unsigned i, j, k;
double x, y, z;
QProgressDialog progressDialog("Calculating density grid data", "Cancel", 0,
totalProgress, QApplication::activeWindow());
progressDialog.setValue(progress);
progressDialog.setWindowModality(Qt::WindowModal);
progressDialog.show();
for (i = 0, x = origin.x; i < nx; i += 2, x += 2*delta.x) {
for (j = 0, y = origin.y; j < ny; j += 2, y += 2*delta.y) {
for (k = 0, z = origin.z; k < nz; k += 2, z += 2*delta.z) {
Vec gridPoint(x, y, z);
computeShellPairs(gridPoint);
(*alpha)(i, j, k) = inner_prod(m_alphaDensity, m_shellPairValues);
(*beta )(i, j, k) = inner_prod(m_betaDensity, m_shellPairValues);
}
}
++progress;
progressDialog.setValue(progress);
if (progressDialog.wasCanceled()) return false;
}
double a000, a001, a010, a011, a100, a101, a110, a111, aTot;
double b000, b001, b010, b011, b100, b101, b110, b111, bTot;
double thresh(0.125*Data::Shell::thresh());
origin += delta;
for (i = 1, x = origin.x; i < nx-1; i += 2, x += 2*delta.x) {
for (j = 1, y = origin.y; j < ny-1; j += 2, y += 2*delta.y) {
for (k = 1, z = origin.z; k < nz-1; k += 2, z += 2*delta.z) {
a000 = (*alpha)(i-1, j-1, k-1);
a001 = (*alpha)(i-1, j-1, k+1);
a010 = (*alpha)(i-1, j+1, k-1);
a011 = (*alpha)(i-1, j+1, k+1);
a100 = (*alpha)(i+1, j-1, k-1);
a101 = (*alpha)(i+1, j-1, k+1);
a110 = (*alpha)(i+1, j+1, k-1);
a111 = (*alpha)(i+1, j+1, k+1);
aTot = a000+a001+a010+a011+a100+a101+a110+a111;
b000 = (*beta)(i-1, j-1, k-1);
b001 = (*beta)(i-1, j-1, k+1);
b010 = (*beta)(i-1, j+1, k-1);
b011 = (*beta)(i-1, j+1, k+1);
b100 = (*beta)(i+1, j-1, k-1);
b101 = (*beta)(i+1, j-1, k+1);
b110 = (*beta)(i+1, j+1, k-1);
b111 = (*beta)(i+1, j+1, k+1);
bTot = b000+b001+b010+b011+b100+b101+b110+b111;
if (std::abs(aTot) > thresh || std::abs(bTot) > thresh) {
computeShellPairs(Vec(x, y, z));
(*alpha)(i, j, k ) = inner_prod(m_alphaDensity, m_shellPairValues);
(*beta )(i, j, k ) = inner_prod(m_betaDensity, m_shellPairValues);
computeShellPairs(Vec(x, y, z-delta.z));
(*alpha)(i, j, k-1) = inner_prod(m_alphaDensity, m_shellPairValues);
(*beta )(i, j, k-1) = inner_prod(m_betaDensity, m_shellPairValues);
computeShellPairs(Vec(x, y-delta.y, z));
(*alpha)(i, j-1,k ) = inner_prod(m_alphaDensity, m_shellPairValues);
(*beta )(i, j-1,k ) = inner_prod(m_betaDensity, m_shellPairValues);
computeShellPairs(Vec(x, y-delta.y, z-delta.z));
(*alpha)(i, j-1,k-1) = inner_prod(m_alphaDensity, m_shellPairValues);
(*beta )(i, j-1,k-1) = inner_prod(m_betaDensity, m_shellPairValues);
computeShellPairs(Vec(x-delta.x, y, z));
(*alpha)(i-1,j, k ) = inner_prod(m_alphaDensity, m_shellPairValues);
(*beta )(i-1,j, k ) = inner_prod(m_betaDensity, m_shellPairValues);
computeShellPairs(Vec(x-delta.x, y, z-delta.z));
(*alpha)(i-1,j, k-1) = inner_prod(m_alphaDensity, m_shellPairValues);
(*beta )(i-1,j, k-1) = inner_prod(m_betaDensity, m_shellPairValues);
computeShellPairs(Vec(x-delta.x, y-delta.y, z));
(*alpha)(i-1,j-1,k ) = inner_prod(m_alphaDensity, m_shellPairValues);
//.........这里部分代码省略.........
示例11: run
void Interpreter::run()
{
int res;
QTime time;
// init
try
{
ChirpProc versionProc;
uint16_t *version;
uint32_t verLen, responseInt;
if (m_link.open()<0)
throw std::runtime_error("Unable to open USB device.");
m_chirp = new ChirpMon(this, &m_link);
// get version and compare
versionProc = m_chirp->getProc("version");
if (versionProc<0)
throw std::runtime_error("Can't get firmware version.");
res = m_chirp->callSync(versionProc, END_OUT_ARGS, &responseInt, &verLen, &version, END_IN_ARGS);
if (res<0)
throw std::runtime_error("Can't get firmware version.");
memcpy(m_version, version, 3*sizeof(uint16_t));
if (m_version[0]!=VER_MAJOR || m_version[1]>VER_MINOR)
{
char buf[0x100];
sprintf(buf, "This Pixy's firmware version (%d.%d.%d) is not compatible with this PixyMon version (%d.%d.%d).",
m_version[0], m_version[1], m_version[2], VER_MAJOR, VER_MINOR, VER_BUILD);
throw std::runtime_error(buf);
}
m_exec_run = m_chirp->getProc("run");
m_exec_running = m_chirp->getProc("running");
m_exec_stop = m_chirp->getProc("stop");
m_exec_get_action = m_chirp->getProc("getAction");
m_get_param = m_chirp->getProc("prm_get");
m_getAll_param = m_chirp->getProc("prm_getAll");
m_set_param = m_chirp->getProc("prm_set");
if (m_exec_run<0 || m_exec_running<0 || m_exec_stop<0 || m_exec_get_action<0 ||
m_get_param<0 || m_getAll_param<0 || m_set_param<0)
throw std::runtime_error("Communication error with Pixy.");
}
catch (std::runtime_error &exception)
{
emit error(QString(exception.what()));
return;
}
qDebug() << "*** init done";
time.start();
getRunning();
handleLoadParams(); // load params upon initialization
while(m_run)
{
if (!m_programming &&
((m_fastPoll && time.elapsed()>RUN_POLL_PERIOD_FAST) ||
(!m_fastPoll && time.elapsed()>RUN_POLL_PERIOD_SLOW)))
{
getRunning();
time.start();
}
else
{
m_chirp->service(false);
msleep(1); // give config thread time to run
}
handlePendingCommand();
if (!m_running)
{
if (m_localProgramRunning)
execute();
else
{
Sleeper::msleep(10);
if (m_mutexProg.tryLock())
{
if (m_argv.size())
{
if (m_externalCommand!="") // print command to make things explicit and all pretty
emit textOut(PROMPT " " + m_externalCommand);
if (m_argv[0]=="help")
handleHelp();
else
{
res = call(m_argv, true);
if (res<0)
{
if (m_programming)
{
endLocalProgram();
clearLocalProgram();
}
m_commandList.clear(); // abort our little scriptlet
}
}
m_argv.clear();
//.........这里部分代码省略.........
示例12: doAnalysis
// This is called from the AnalyserQueue thread
bool AnalyserQueue::doAnalysis(TrackPointer tio, SoundSourceProxy* pSoundSource) {
int totalSamples = pSoundSource->length();
//qDebug() << tio->getFilename() << " has " << totalSamples << " samples.";
int processedSamples = 0;
QTime progressUpdateInhibitTimer;
progressUpdateInhibitTimer.start(); // Inhibit Updates for 60 milliseconds
int read = 0;
bool dieflag = false;
bool cancelled = false;
int progress; // progress in 0 ... 100
do {
ScopedTimer t("AnalyserQueue::doAnalysis block");
read = pSoundSource->read(kAnalysisBlockSize, m_pSamplesPCM);
// To compare apples to apples, let's only look at blocks that are the
// full block size.
if (read != kAnalysisBlockSize) {
t.cancel();
}
// Safety net in case something later barfs on 0 sample input
if (read == 0) {
t.cancel();
break;
}
// If we get more samples than length, ask the analysers to process
// up to the number we promised, then stop reading - AD
if (read + processedSamples > totalSamples) {
qDebug() << "While processing track of length " << totalSamples << " actually got "
<< read + processedSamples << " samples, truncating analysis at expected length";
read = totalSamples - processedSamples;
dieflag = true;
}
// Normalize the samples from [SHRT_MIN, SHRT_MAX] to [-1.0, 1.0].
// TODO(rryan): Change the SoundSource API to do this for us.
for (int i = 0; i < read; ++i) {
m_pSamples[i] = static_cast<CSAMPLE>(m_pSamplesPCM[i]) / SHRT_MAX;
}
QListIterator<Analyser*> it(m_aq);
while (it.hasNext()) {
Analyser* an = it.next();
//qDebug() << typeid(*an).name() << ".process()";
an->process(m_pSamples, read);
//qDebug() << "Done " << typeid(*an).name() << ".process()";
}
// emit progress updates
// During the doAnalysis function it goes only to 100% - FINALIZE_PERCENT
// because the finalise functions will take also some time
processedSamples += read;
//fp div here prevents insane signed overflow
progress = (int)(((float)processedSamples)/totalSamples *
(1000 - FINALIZE_PERCENT));
if (m_progressInfo.track_progress != progress) {
if (progressUpdateInhibitTimer.elapsed() > 60) {
// Inhibit Updates for 60 milliseconds
emitUpdateProgress(tio, progress);
progressUpdateInhibitTimer.start();
}
}
// Since this is a background analysis queue, we should co-operatively
// yield every now and then to try and reduce CPU contention. The
// analyser queue is CPU intensive so we want to get out of the way of
// the audio callback thread.
//QThread::yieldCurrentThread();
//QThread::usleep(10);
//has something new entered the queue?
if (deref(m_aiCheckPriorities)) {
m_aiCheckPriorities = false;
if (isLoadedTrackWaiting(tio)) {
qDebug() << "Interrupting analysis to give preference to a loaded track.";
dieflag = true;
cancelled = true;
}
}
if (m_exit) {
dieflag = true;
cancelled = true;
}
// Ignore blocks in which we decided to bail for stats purposes.
if (dieflag || cancelled) {
t.cancel();
}
} while(read == kAnalysisBlockSize && !dieflag);
return !cancelled; //don't return !dieflag or we might reanalyze over and over
}
示例13: qWarning
bool GribV2::loadFile(QString fileName) {
FILE * fptr=NULL;
int msg=0;
this->fileName=fileName;
QTime tLoad;
int m_sec_readCgrib=0;
int m_sec_ginfo=0;
int m_sec_g2_getfld=0;
int m_sec_grecConst=0;
int m_sec_endLoop=0;
qWarning() << "GV2 loading " << fileName;
g2int lskip=0,lgrib=0,iseek=0;
unsigned char *cgrib; // msg buffer
g2int ierr,listsec0[3],listsec1[13],numfields,numlocal;
std::string fname = qPrintable(fileName);
if(fileName == "") return false;
gribfield *gfld=NULL;
ok=false;
fptr=fopen(fname.c_str(),"rb");
if(!fptr) {
qWarning() << "Can't open Grib2 file (in loadFile): " << fileName;
return false;
}
fseek(fptr,0,SEEK_END);
fileSize=ftell(fptr);
rewind(fptr);
/* clean data structure + iso lines */
clean_all_vectors();
Util::cleanListPointers(listIsobars);
Util::cleanListPointers(listIsotherms0);
for(;;) {
msg++;
seekgb(fptr,iseek,32000,&lskip,&lgrib);
if (lgrib == 0) break; // end loop at EOF or problem
cgrib=(unsigned char *)malloc(lgrib);
fseek(fptr,lskip,SEEK_SET);
tLoad.start();
fread(cgrib,sizeof(unsigned char),lgrib,fptr);
m_sec_readCgrib+=tLoad.elapsed();
//qWarning() << "Size of cgrib: " << lgrib << ", skip=" << lskip;
//qWarning() << "Bytes read from file: " << bRead;
//qWarning() << "EOF=" << feof(fptr) << ", ferror=" << ferror(fptr);
//qWarning() << "File pos=" << ftell(fptr);
//qWarning() << "End of grib=" << cgrib[lgrib-4] << cgrib[lgrib-3] << cgrib[lgrib-2] << cgrib[lgrib-1];
iseek=lskip+lgrib;
tLoad.start();
ierr=g2_info(cgrib,listsec0,listsec1,&numfields,&numlocal);
m_sec_ginfo+=tLoad.elapsed();
if(ierr) {
qWarning() << "msg " << msg << ": g2_info error num=" << ierr;
fclose(fptr);
return false;
}
// accepting only GRIB2 with discipline=0 => Meteorological product (table 0.0)
if(listsec0[1]!=2 || (listsec0[0]!=0 && listsec0[0]!=10)) {
qWarning() << "msg " << msg << ": wrong version " << listsec0[1] << ", or discipline: " << listsec0[0];
continue;
}
if(listsec1[4]!=1) {
qWarning() << "msg " << msg << ": wrong reference time type: " << listsec1[4];
continue;
}
/* loop on th fields => 1 field = 1 GribRecord */
//qWarning() << "nb fields=" << numfields << ", nb locals=" << numlocal;
for(int i=0;i<numfields;++i) {
tLoad.start();
ierr=g2_getfld(cgrib,i+1,GRB2_UNPACK,GRB2_EXPAND,&gfld);
m_sec_g2_getfld+=tLoad.elapsed();
if(ierr) {
qWarning() << "msg=" << msg << "- field=" << i << ": g2_getfld error num=" << ierr;
continue;
}
tLoad.start();
GribV2Record * record = new GribV2Record(gfld,msg,i);
m_sec_grecConst+=tLoad.elapsed();
//.........这里部分代码省略.........
示例14: getEvents
void ConversationModelPerfTest::getEvents()
{
QFETCH(int, messages);
QFETCH(int, contacts);
QFETCH(int, limit);
qRegisterMetaType<QModelIndex>("QModelIndex");
QDateTime startTime = QDateTime::currentDateTime();
addTestGroups( group1, group2 );
int commitBatchSize = 75;
#ifdef PERF_BATCH_SIZE
commitBatchSize = PERF_BATCH_SIZE;
#endif
EventModel addModel;
QDateTime when = QDateTime::currentDateTime();
QList<QString> remoteUids;
qDebug() << __FUNCTION__ << "- Creating" << contacts << "new contacts";
int ci = 0;
while(ci < contacts) {
ci++;
QString phoneNumber = QString().setNum(qrand() % 10000000);
remoteUids << phoneNumber;
addTestContact(QString("Test Contact %1").arg(ci), phoneNumber);
if(ci % commitBatchSize == 0 && ci < contacts) {
qDebug() << __FUNCTION__ << "- adding" << commitBatchSize
<< "contacts (" << ci << "/" << contacts << ")";
waitForIdle(5000);
}
}
qDebug() << __FUNCTION__ << "- adding rest of the contacts ("
<< ci << "/" << contacts << ")";
waitForIdle(5000);
QTest::qWait(TIMEOUT);
qDebug() << __FUNCTION__ << "- Creating" << messages << "new messages";
QList<Event> eventList;
int ei = 0;
while(ei < messages) {
ei++;
Event::EventDirection direction;
direction = qrand() % 2 > 0 ? Event::Inbound : Event::Outbound;
Event e;
e.setType(Event::SMSEvent);
e.setDirection(direction);
e.setGroupId(group1.id());
e.setStartTime(when.addSecs(ei));
e.setEndTime(when.addSecs(ei));
e.setLocalUid(ACCOUNT1);
e.setRemoteUid(remoteUids.at(0));
e.setFreeText(randomMessage(qrand() % 49 + 1)); // Max 50 words / message
e.setIsDraft(false);
e.setIsMissedCall(false);
eventList << e;
if(ei % commitBatchSize == 0 && ei != messages) {
qDebug() << __FUNCTION__ << "- adding" << commitBatchSize
<< "messages (" << ei << "/" << messages << ")";
QVERIFY(addModel.addEvents(eventList, false));
eventList.clear();
waitForIdle();
}
}
QVERIFY(addModel.addEvents(eventList, false));
qDebug() << __FUNCTION__ << "- adding rest of the messages ("
<< ei << "/" << messages << ")";
eventList.clear();
waitForIdle();
int iterations = 10;
int sum = 0;
QList<int> times;
#ifdef PERF_ITERATIONS
iterations = PERF_ITERATIONS;
#endif
char *iterVar = getenv("PERF_ITERATIONS");
if (iterVar) {
int iters = QString::fromAscii(iterVar).toInt();
if (iters > 0) {
iterations = iters;
}
}
QTest::qWait(TIMEOUT);
qDebug() << __FUNCTION__ << "- Fetching messages." << iterations << "iterations";
//.........这里部分代码省略.........
示例15: initBuf
//............................................................................
bool QP::QS::onStartup(void const *) {
static uint8_t qsBuf[4*1024]; // 4K buffer for Quantum Spy
initBuf(qsBuf, sizeof(qsBuf));
QSPY_config(QP_VERSION, // version
QS_OBJ_PTR_SIZE, // objPtrSize
QS_FUN_PTR_SIZE, // funPtrSize
QS_TIME_SIZE, // tstampSize
Q_SIGNAL_SIZE, // sigSize,
QF_EVENT_SIZ_SIZE, // evtSize
QF_EQUEUE_CTR_SIZE, // queueCtrSize
QF_MPOOL_CTR_SIZE, // poolCtrSize
QF_MPOOL_SIZ_SIZE, // poolBlkSize
QF_TIMEEVT_CTR_SIZE,// tevtCtrSize
(void *)0, // matFile,
(void *)0,
&custParserFun); // customized parser function
l_time.start(); // start the time stamp
// set up the QS filters...
// QS_FILTER_ON(QS_QEP_STATE_ENTRY);
// QS_FILTER_ON(QS_QEP_STATE_EXIT);
// QS_FILTER_ON(QS_QEP_STATE_INIT);
// QS_FILTER_ON(QS_QEP_INIT_TRAN);
// QS_FILTER_ON(QS_QEP_INTERN_TRAN);
// QS_FILTER_ON(QS_QEP_TRAN);
// QS_FILTER_ON(QS_QEP_IGNORED);
// QS_FILTER_ON(QS_QEP_DISPATCH);
// QS_FILTER_ON(QS_QEP_UNHANDLED);
// QS_FILTER_ON(QS_QF_ACTIVE_ADD);
// QS_FILTER_ON(QS_QF_ACTIVE_REMOVE);
// QS_FILTER_ON(QS_QF_ACTIVE_SUBSCRIBE);
// QS_FILTER_ON(QS_QF_ACTIVE_UNSUBSCRIBE);
// QS_FILTER_ON(QS_QF_ACTIVE_POST_FIFO);
// QS_FILTER_ON(QS_QF_ACTIVE_POST_LIFO);
// QS_FILTER_ON(QS_QF_ACTIVE_GET);
// QS_FILTER_ON(QS_QF_ACTIVE_GET_LAST);
// QS_FILTER_ON(QS_QF_EQUEUE_INIT);
// QS_FILTER_ON(QS_QF_EQUEUE_POST_FIFO);
// QS_FILTER_ON(QS_QF_EQUEUE_POST_LIFO);
// QS_FILTER_ON(QS_QF_EQUEUE_GET);
// QS_FILTER_ON(QS_QF_EQUEUE_GET_LAST);
// QS_FILTER_ON(QS_QF_MPOOL_INIT);
QS_FILTER_ON(QS_QF_MPOOL_GET);
// QS_FILTER_ON(QS_QF_MPOOL_PUT);
// QS_FILTER_ON(QS_QF_PUBLISH);
// QS_FILTER_ON(QS_QF_RESERVED8);
// QS_FILTER_ON(QS_QF_NEW);
// QS_FILTER_ON(QS_QF_GC_ATTEMPT);
// QS_FILTER_ON(QS_QF_GC);
// QS_FILTER_ON(QS_QF_TICK);
// QS_FILTER_ON(QS_QF_TIMEEVT_ARM);
// QS_FILTER_ON(QS_QF_TIMEEVT_AUTO_DISARM);
// QS_FILTER_ON(QS_QF_TIMEEVT_DISARM_ATTEMPT);
// QS_FILTER_ON(QS_QF_TIMEEVT_DISARM);
// QS_FILTER_ON(QS_QF_TIMEEVT_REARM);
// QS_FILTER_ON(QS_QF_TIMEEVT_POST);
// QS_FILTER_ON(QS_QF_TIMEEVT_CTR);
// QS_FILTER_ON(QS_QF_CRIT_ENTRY);
// QS_FILTER_ON(QS_QF_CRIT_EXIT);
// QS_FILTER_ON(QS_QF_ISR_ENTRY);
// QS_FILTER_ON(QS_QF_ISR_EXIT);
// QS_FILTER_ON(QS_QF_INT_DISABLE);
// QS_FILTER_ON(QS_QF_INT_ENABLE);
// QS_FILTER_ON(QS_QF_ACTIVE_POST_ATTEMPT);
// QS_FILTER_ON(QS_QF_EQUEUE_POST_ATTEMPT);
// QS_FILTER_ON(QS_QF_MPOOL_GET_ATTEMPT);
// QS_FILTER_ON(QS_QF_RESERVED1);
// QS_FILTER_ON(QS_QF_RESERVED0);
// QS_FILTER_ON(QS_QK_MUTEX_LOCK);
// QS_FILTER_ON(QS_QK_MUTEX_UNLOCK);
// QS_FILTER_ON(QS_QK_SCHEDULE);
// QS_FILTER_ON(QS_QK_RESERVED1);
// QS_FILTER_ON(QS_QK_RESERVED0);
// QS_FILTER_ON(QS_QEP_TRAN_HIST);
// QS_FILTER_ON(QS_QEP_TRAN_EP);
// QS_FILTER_ON(QS_QEP_TRAN_XP);
// QS_FILTER_ON(QS_QEP_RESERVED1);
// QS_FILTER_ON(QS_QEP_RESERVED0);
QS_FILTER_ON(QS_SIG_DICT);
QS_FILTER_ON(QS_OBJ_DICT);
QS_FILTER_ON(QS_FUN_DICT);
QS_FILTER_ON(QS_USR_DICT);
QS_FILTER_ON(QS_EMPTY);
QS_FILTER_ON(QS_RESERVED3);
QS_FILTER_ON(QS_RESERVED2);
QS_FILTER_ON(QS_TEST_RUN);
QS_FILTER_ON(QS_TEST_FAIL);
QS_FILTER_ON(QS_ASSERT_FAIL);
return true; // success
}