本文整理汇总了C++中dtkWarn函数的典型用法代码示例。如果您正苦于以下问题:C++ dtkWarn函数的具体用法?C++ dtkWarn怎么用?C++ dtkWarn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dtkWarn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dtkDebug
void medJobRunner::run()
{
emit m_job->running(true);
medAbstractJob::medJobExitStatus jobExitStatus = medAbstractJob::MED_JOB_EXIT_FAILURE;
try
{
jobExitStatus = m_job->run();
if(jobExitStatus == medAbstractJob::MED_JOB_EXIT_CANCELLED)
{
dtkDebug() << "job aborted (cancelled)"
<< m_job->caption() << m_job;
}
}
catch(std::exception &err)
{
QString errorMessage = QString::fromLatin1(err.what());
dtkWarn() << "Error occured while runing job"
<< m_job->caption() << m_job
<< "\n\t" <<errorMessage;
emit exceptionCaught(errorMessage);
}
catch(...)
{
dtkWarn() << "Error occured while runing job"
<< m_job->caption() << m_job;
}
emit m_job->finished(jobExitStatus);
emit m_job->running(false);
}
示例2: dtkError
void dtkComposerNodeVectorRealExtractor::run(void)
{
if (!d->receiver_vector.isEmpty() && !d->receiver_index.isEmpty()) {
dtkVectorReal *vector = d->receiver_vector.data();
qlonglong index = *d->receiver_index.data();
if (!vector) {
dtkError() << "Input vector is not defined.";
return;
}
if (index >= vector->size()) {
dtkWarn() << "index > size of the input vector. Zero is returned.";
d->value = 0;
} else {
d->value = (*vector)[index];
}
} else {
dtkWarn() << "Inputs not specified. Zero is returned.";
d->value = 0;
}
}
示例3: dtkError
void dtkComposerNodeArrayScalarOperatorDivide::run(void)
{
if (!d->receiver_array.isEmpty() && !d->receiver_index.isEmpty() && !d->receiver_value.isEmpty() ) {
dtkContainerVectorReal *array = d->receiver_array.data();
if (!array) {
dtkError() << "Input array is not defined.";
d->emitter_array.clearData();
return;
}
qlonglong index = *d->receiver_index.data<qlonglong>();
qreal value = *d->receiver_value.data<qreal>();
if (index >= array->count()) {
dtkWarn() << "index > size of the vector. Same array is returned.";
} else {
if (value == 0)
dtkWarn() << "Value is zero. Same array is returned." ;
else
(*array)[index] /= value;
}
d->emitter_array.setData(array);
} else {
dtkWarn() << "Inputs not specified. Nothing is done";
d->emitter_array.clearData();
}
}
示例4: dtkTrace
void dtkComposerGraphView::update(void)
{
if (!d->graphviz_avail)
return;
QByteArray content = d->graph->toString().append("\n").toLocal8Bit() ;
// run dot
QStringList arglist;
arglist << "-Tsvg";
QString command = "dot";
QProcess cmd;
QStringList PATH = QProcessEnvironment::systemEnvironment().value("PATH").split(":") ;
QDir::setSearchPaths("bin",PATH);
if(QFile("bin:"+command).exists()) {
dtkTrace() << "run graphviz dot" ;
cmd.start(command, arglist, QProcess::Unbuffered | QProcess::ReadWrite);
cmd.write(content);
cmd.closeWriteChannel();
cmd.waitForBytesWritten();
qlonglong timeout = 3000;
QString stdout_data;
if (cmd.waitForFinished(timeout)) {
QByteArray svg = cmd.readAllStandardOutput();
this->load(svg);
} else {
dtkWarn() << "graphviz timeout !";
}
} else {
d->graphviz_avail = false;
dtkWarn() << "can't find 'dot' binary in PATH, graphviz probably not installed";
}
}
示例5: initialize
bool undoRedoRegistrationPlugin::initialize(void)
{
if (!undoRedoRegistration::registered()) { dtkWarn() << "Unable to register undoRedoRegistration type"; }
if (!undoRedoRegistrationToolBox::registered()) { dtkWarn() << "Unable to register undoRedoRegistration toolbox"; }
return true;
}
示例6: dtkWarn
QByteArray dtkDistributedServerDaemon::waitForData(int rank, QString jobid)
{
dtkDistributedSocket *socket = d->sockets.value(qMakePair(rank, jobid), NULL);
if(!socket) {
dtkWarn() << "No socket found for rank " << rank;
return QByteArray();
}
socket->blockSignals(true);
dtkDistributedMessage *data = NULL;
if (socket->waitForReadyRead(30000))
data = socket->parseRequest();
else
dtkWarn() << "Data not ready for rank " << rank;
socket->blockSignals(false);
if (data) {
return data->content();
} else {
dtkWarn() << "Message not allocated - return void QByteArray";
return QByteArray();
}
}
示例7: dtkWarn
bool itkN4BiasCorrectionPlugin::initialize()
{
if(!itkN4BiasCorrection::registered())
{
dtkWarn() << "Unable to register itkN4BiasCorrection type";
}
if ( !itkN4BiasCorrectionToolBox::registered() )
{
dtkWarn() << "Unable to register itkN4BiasCorrection toolbox";
}
return true;
}
示例8: dtkWarn
bool iterativeClosestPointPlugin::initialize()
{
if(!iterativeClosestPointProcess::registered())
{
dtkWarn() << "Unable to register iterativeClosestPoint type";
}
if(!iterativeClosestPointToolBox::registered())
{
dtkWarn() << "Unable to register iterativeClosestPoint toolbox";
}
return true;
}
示例9: dtkWarn
bool manualRegistrationPlugin::initialize()
{
if(!manualRegistration::registered())
{
dtkWarn() << "Unable to register manualRegistration type";
}
if ( !manualRegistrationToolBox::registered() )
{
dtkWarn() << "Unable to register manualRegistration toolbox";
}
return true;
}
示例10: dtkWarn
bool MyPluginPlugin::initialize(void)
{
MyPluginPlugin::dataFactSingleton = dtkAbstractDataFactory::instance();
//dataFactorySingleton();
MyPluginPlugin::processFactSingleton = dtkAbstractProcessFactory::instance();
//processFactorySingleton();
if(!MyPluginDefaultProcess::registered())
dtkWarn() << "Unable to register MyPluginProcess type";
if(!MyPluginDefaultProcessDialog::registered())
dtkWarn() << "Unable to register MyPluginProcessDialog type";
if(!MyPluginDefaultData::registered())
dtkWarn() << "Unable to register MyPluginData type";
if(!MyPluginDefaultDataDialog::registered())
dtkWarn() << "Unable to register MyPluginDataDialog type";
if(!MyPluginDefaultDataReader::registered())
dtkWarn() << "Unable to register MyPluginDataReader type";
if(!MyPluginDefaultDataWriter::registered())
dtkWarn() << "Unable to register MyPluginDataWriter type";
if(!MyPluginDefaultDataConverter::registered())
dtkWarn() << "Unable to register MyPluginDataConverter type";
if(!MyPluginDefaultDataCreatorProcessDialog::registered())
dtkWarn() << "Unable to register MyPluginDataCreatorProcessDialog type";
return true;
}
示例11: dtkWarn
void dtkComposerNodeStringListSet::run(void)
{
if (!d->receiver_list.isEmpty() && !d->receiver_value.isEmpty()&& !d->receiver_index.isEmpty() ) {
d->list = *(d->receiver_list.data());
qlonglong index = d->receiver_index.data();
if (index >= 0 && index < d->list.size())
d->list.replace(index, d->receiver_value.data());
else
dtkWarn() << "bad index value in set string list" << index;
} else {
dtkWarn() << "Inputs not specified. Nothing is done";
d->emitter.clearData();
}
}
示例12: dtkWarn
bool itkDataSHImageWriterPlugin::initialize()
{
if(!itkMetaDataSHImageWriter::registered())
{
dtkWarn() << "Unable to register itkMetaDataSHImageWriter type";
}
return true;
}
示例13: dtkWarn
void dtkComposerNodeMetaContainerAt::run(void)
{
if(!d->receiver_container.isEmpty()) {
QVariant var_container = d->receiver_container.data();
dtkMetaContainerSequential m_c = var_container.value<dtkMetaContainerSequential>();
if(!d->receiver_index.isEmpty()) {
d->emitter_value.setData(m_c.at(d->receiver_index.data()));
} else {
dtkWarn() << "No input index for the at operation. First item of the container is returned.";
d->emitter_value.setData(m_c.at(0));
}
} else {
dtkWarn() << "No input container for at operation. Nothing is emitted.";
d->emitter_value.clearData();
}
}
示例14: deref
inline void deref(int index, QString & s, const QRegExp & regex, const QHash<QString, QString> & vars, int lineCount) {
QString varName = regex.cap(1).isEmpty() ? regex.cap(2) : regex.cap(1);
if (vars.contains(varName)) {
s.replace(index, regex.matchedLength(), vars[varName]);
} else {
s.replace(index, regex.matchedLength(), "");
dtkWarn() << "Unknown variable name line " << lineCount << " :" << varName;
}
}
示例15: QString
// set method, and also, if necessary, jobid and rank
void dtkDistributedMessage::setMethod(QString method)
{
QStringList tokens = QString(method).split(QRegExp("/"));
if (method.startsWith("GET /status")) {
d->method = STATUS;
} else if (method.startsWith("PUT /job HTTP")) {
d->method = NEWJOB;
} else if (method.startsWith("DELETE /job")) {
d->jobid = tokens[2].remove("HTTP").trimmed();
if (d->headers.contains("x-dtk-finished")) {
d->method = ENDJOB;
} else {
d->method = DELJOB;
}
} else if (method.startsWith("DELETE /")) {
d->method = STOP;
} else if (method.startsWith("POST /data")) {
d->method = DATA;
d->jobid = tokens[2];
if (tokens.size() > 2)
d->rank = tokens[3].remove("HTTP").toInt();
} else if (method.startsWith("PUT /rank")) {
d->method = SETRANK;
d->jobid = tokens[2];
d->rank = tokens[3].remove("HTTP").toInt();
} else if (method.startsWith("HTTP/1.1 200 OK")) {
if (d->headers.contains("x-dtk-status")) {
d->method = OKSTATUS;
} else {
dtkWarn() << "Unsupported method " << method;
}
} else if (method.startsWith("HTTP/1.1 201 OK")) {
d->method = OKJOB;
} else if (method.startsWith("HTTP/1.1 204 OK")) {
d->method = OKDEL;
} else if (method.startsWith("HTTP/1.1 400 OK")) {
d->method = ERRORJOB;
} else if (method.startsWith("HTTP/1.1 410 OK")) {
d->method = ERRORDEL;
} else {
dtkWarn() << "Unsupported method " << method;
}
}