7 #include <dtkCoreSupport/dtkAbstractProcess.h>
8 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
17 #include <QDoubleSpinBox>
35 this->setParent(parent);
38 this->setValue(value);
40 connect(
this, SIGNAL(valueChanged(
int)),
this, SLOT(
addParameterInt(
int)));
47 disconnect(
this, SIGNAL(valueChanged(
int)),
this, SLOT(
addParameterInt(
int)));
81 this->setParent(parent);
83 this->setValue(value);
84 this->setSingleStep(0.10);
86 connect(
this, SIGNAL(valueChanged(
double)),
this, SLOT(
addParameter(
double)));
93 disconnect(
this, SIGNAL(valueChanged(
double)),
this, SLOT(
addParameter(
double)));
134 this->addItem(item->text(0));
138 QString name = this->currentText();
140 QString nameList = item->text(0);
143 if(nameList == name){
151 connect(
this, SIGNAL(activated(QString)),
this, SLOT(
OnFindingInput(
const QString&)));
157 disconnect(
this, SIGNAL(activated(QString)),
this, SLOT(
OnFindingInput(
const QString&)));
172 QString nameList = item->text(0);
174 if(nameList == name){
176 process->setInput(controller->
data(item));
178 process->setInput(controller->
data(item),
channel);
193 this->setText(
"Output:" + channel +
" "+label);
215 this->setParent(parent);
218 this->addItems(list);
220 connect(
this, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
addParameter(
int)));
227 disconnect(
this, SIGNAL(currentIndexChanged(
int)),
this, SLOT(
addParameter(
int)));
234 process->setParameter(currentIndex);
261 QList<axlAbstractData *>dataList;
266 if( (item->text(2) ==
"Selected" || item->text(2) ==
"Editable"))
268 dataList << dynamic_cast<axlAbstractData *>(
controller->
data(item));
298 class axlInspectorToolGenericPrivate
324 d->process = qobject_cast<
axlAbstractProcess *>(dtkAbstractProcessFactory::instance()->create(implementation));
326 d->process->setParent(
this);
328 d->controller = control;
331 d->button =
new QPushButton(
"Run",
this);
332 d->layout->addWidget(d->button);
336 dtkWarn() <<
"no process available";
338 this->setAttribute(Qt::WA_DeleteOnClose);
346 disconnect(d->button, SIGNAL(clicked()), d->process, SLOT(update()));
360 if(d->process->update()){
362 if(d->process->output()){
363 emit
dataInserted(dynamic_cast<axlAbstractData *>(d->process->output()));
370 void axlInspectorToolGenericPrivate::setup(
void)
372 this->layout =
new QFormLayout(q);
375 this->layout->addRow(
new QLabel(
"Invalid process", q));
377 this->layout->addRow(
new QLabel(this->process->identifier(), q));
380 QString form = this->process->form();
384 QList<dtkAbstractData*> dataSet;
385 int numberOfDataSelected =0;
389 if(item->text(2) ==
"Selected")
391 dataSet.push_back (this->controller->data(item));
392 numberOfDataSelected++;
397 if(dataSet.size() == 0)
398 qDebug() <<
" No input data selected for : "<< process->identifier();
400 else if(dataSet.size() == 1)
401 process->setInput(dataSet.first());
404 for (
int i = 0 ; i < dataSet.size() ; i++)
405 process->setInput(dataSet[i], i);
413 QStringList lines = form.split(
"\n");
414 foreach(QString line, lines) {
416 QStringList tokens = line.simplified().split(QRegExp(
"\\s"));
417 int l=tokens.at(0).size();
419 if(tokens.first().startsWith(
"INPUT")) {
421 Q_ASSERT(tokens.count() >3);
423 QString type = tokens.at(1);
424 QString label = tokens.at(2);
428 QString channel = tokens.at(0).right(l-6);
431 int value = tokens.last().toInt();
435 if(type ==
"double"){
436 double value = tokens.last().toDouble();
444 if(type ==
"dataList")
449 int value = tokens.last().toInt();
453 if(type ==
"double"){
454 double value = tokens.last().toDouble();
462 if(type ==
"dataList")
469 if(tokens.first().startsWith(
"PARAMETER")) {
475 QString channel = tokens.at(0).right(l-10);
476 QString type = tokens.at(1);
477 QString label = tokens.at(2);
481 int value = tokens.last().toInt();
485 if(type ==
"double"){
486 double value = tokens.last().toDouble();
494 if(tokens.first().startsWith(
"OUTPUT")){
496 Q_ASSERT(tokens.count() > 2);
498 QString channel =
"";
500 channel = tokens.at(0).right(l-8);
501 QString label = tokens.at(2);
508 #include "axlInspectorToolGeneric.moc"
dtkAbstractData * data(axlInspectorObjectManagerTreeItem *item)
QList< axlInspectorObjectManagerTreeItem * > items(void)
Class axlAbstractData defines an API for all type of axel data.