21 QShortcut *helpF1 =
new QShortcut(Qt::Key_F1,
this);
22 connect(helpF1, SIGNAL(activated()),
this, SLOT(
help()));
31 title+=tr(
"Edit Processor - Name: ");
33 title+=tr(
" - Type: ");
35 setWindowTitle(title);
47 desc->setFont( QFont(
"Helvetica", 10, QFont::Bold) );
49 QPalette pal = desc->palette();
50 pal.setColor(QPalette::WindowText, QColor(32,64,140,220) );
51 desc->setPalette(pal);
53 desc->setWordWrap(
true);
55 QVBoxLayout *descLO =
new QVBoxLayout;
56 descLO->addWidget( desc );
58 QGroupBox *descGB =
new QGroupBox(tr(
"Processor Description "),
this);
59 descGB->setMaximumHeight( 80 );
60 descGB->setLayout( descLO );
69 if( colHeaders.
size() != 0 ){
71 QTableWidget *colTable =
new QTableWidget;
74 labels << tr(
"Name") << tr(
"Type") << tr(
"Value");
75 colTable->setColumnCount(3);
76 colTable->verticalHeader()->hide();
77 colTable->setHorizontalHeaderLabels(labels);
78 colTable->horizontalHeader()->resizeSection(0, 300);
79 colTable->horizontalHeader()->resizeSection(1, 300);
80 colTable->horizontalHeader()->resizeSection(2, 300);
81 colTable->setSelectionMode(QAbstractItemView::NoSelection);
82 colTable->setEditTriggers(QAbstractItemView::AllEditTriggers);
86 for( ssMap::const_iterator p=colHeaders.
begin(); p!=colHeaders.
end(); p++ ){
89 for(
unsigned int i=0; i<cols.
size(); i++ ){
94 int row = colTable->rowCount();
95 colTable->setRowCount(row + 1);
97 QTableWidgetItem *item0 =
new QTableWidgetItem( (*p).first.c_str() );
98 QTableWidgetItem *item1 =
new QTableWidgetItem( (*p).second.c_str() );
99 QTableWidgetItem *item2 =
new QTableWidgetItem( cols[i]->
getValue().c_str() );
105 item0->setFlags(item0->flags() & ~Qt::ItemIsEditable);
106 item1->setFlags(item1->flags() & ~Qt::ItemIsEditable);
109 item2->setBackgroundColor(
_p->
isErrorCol( p->second.c_str(), cols[i]->getValue().c_str() ) ?
110 QColor(184,16,0,180) : QColor(32,140,64,180) );
113 colTable->setItem(row, 0, item0);
114 colTable->setItem(row, 1, item1);
115 colTable->setItem(row, 2, item2);
122 colTable->setItemDelegate(delegate);
125 QVBoxLayout *colsTLayout =
new QVBoxLayout;
126 colsTLayout->addWidget(colTable);
129 QGroupBox *colsTGroupBox =
new QGroupBox(tr(
"INPUT COLLECTIONS - SINGLE VALUE"));
130 colsTGroupBox->setLayout(colsTLayout);
131 colsTGroupBox->setMaximumHeight(220);
134 mainLayout->addWidget(colsTGroupBox, Qt::AlignTop);
144 if( colHeaders.
size() != 0 ){
150 for( ssMap::const_iterator p=colHeaders.
begin(); p!=colHeaders.
end(); p++ ){
156 QTableWidget *colTable =
new QTableWidget;
158 colTable->setColumnCount(1);
159 colTable->horizontalHeader()->resizeSection(0, 240);
160 colTable->horizontalHeader()->hide();
161 colTable->verticalHeader()->hide();
162 colTable->setSelectionMode(QAbstractItemView::NoSelection);
163 colTable->setEditTriggers(QAbstractItemView::AllEditTriggers);
168 for(
unsigned int i=0; i<cols.
size(); i++ ){
169 int row = colTable->rowCount();
170 colTable->setRowCount(row + 1);
172 QTableWidgetItem *item0 =
new QTableWidgetItem( cols[i]->
getValue().c_str() );
177 item0->setBackgroundColor(
_p->
isErrorCol( p->second.c_str(), cols[i]->getValue().c_str() ) ?
178 QColor(184,16,0,180) : QColor(32,140,64,180) );
182 colTable->setItem(row, 0, item0);
188 colTable->setItemDelegate(delegate);
194 QPushButton *addColButton =
new QPushButton(tr(
"Add"));
195 QPushButton *remColButton =
new QPushButton(tr(
"Rem"));
197 addColButton->setToolTip(tr(
"Add New Collection"));
198 remColButton->setToolTip(tr(
"Remove Selected Collection"));
200 connect(addColButton, SIGNAL(clicked()), delegate, SLOT(addCollection()));
201 connect(remColButton, SIGNAL(clicked()), delegate, SLOT(remCollection()));
202 addColButton->setAutoDefault(
false );
203 remColButton->setAutoDefault(
false );
206 QVBoxLayout *colButtonsLayout =
new QVBoxLayout;
207 colButtonsLayout->addWidget(addColButton);
208 colButtonsLayout->addWidget(remColButton);
212 colButtons->setFixedWidth(55);
213 colButtons->setLayout(colButtonsLayout);
216 QGridLayout *colLayout =
new QGridLayout;
217 colLayout->addWidget(colTable,0,0);
218 colLayout->addWidget(colButtons,0,1);
221 QString colTitle(
"Name: [");
222 colTitle+= (*p).first.c_str();
223 colTitle+=
"] - Type: [";
224 colTitle+= (*p).second.c_str();
227 QGroupBox *colGroupBox =
new QGroupBox( colTitle );
228 colGroupBox->setLayout( colLayout );
229 colGroupBox->setMinimumWidth(350);
230 colGroupBox->setMaximumHeight(180);
233 fLayout->addWidget(colGroupBox);
238 QGroupBox *colsGroupBox =
new QGroupBox(tr(
"INPUT COLLECTIONS - MULTIPLE VALUES"));
239 colsGroupBox->setLayout(fLayout);
240 colsGroupBox->setMinimumWidth(1300);
244 QScrollArea *scroll =
new QScrollArea;
245 scroll->setWidget(colsGroupBox);
257 if( colHeaders.
size() != 0 ){
259 QTableWidget *colTable =
new QTableWidget;
262 labels << tr(
"Name") << tr(
"Type") << tr(
"Value");
263 colTable->setColumnCount(3);
264 colTable->verticalHeader()->hide();
265 colTable->setHorizontalHeaderLabels(labels);
266 colTable->horizontalHeader()->resizeSection(0, 300);
267 colTable->horizontalHeader()->resizeSection(1, 300);
268 colTable->horizontalHeader()->resizeSection(2, 300);
269 colTable->setSelectionMode(QAbstractItemView::NoSelection);
270 colTable->setEditTriggers(QAbstractItemView::AllEditTriggers);
274 for( ssMap::const_iterator p=colHeaders.
begin(); p!=colHeaders.
end(); p++ ){
279 for(
unsigned int i=0; i<cols.
size(); i++ ){
280 int row = colTable->rowCount();
281 colTable->setRowCount(row + 1);
283 QTableWidgetItem *item0 =
new QTableWidgetItem( (*p).first.c_str() );
284 QTableWidgetItem *item1 =
new QTableWidgetItem( (*p).second.c_str() );
285 QTableWidgetItem *item2 =
new QTableWidgetItem( cols[i]->
getValue().c_str() );
292 item2->setBackgroundColor(
_p->
isErrorCol( p->second.c_str(), cols[i]->getValue().c_str() ) ?
293 QColor(184,16,0,180) : QColor(32,140,64,180) );
296 item0->setFlags(item0->flags() & ~Qt::ItemIsEditable);
297 item1->setFlags(item1->flags() & ~Qt::ItemIsEditable);
299 colTable->setItem(row, 0, item0);
300 colTable->setItem(row, 1, item1);
301 colTable->setItem(row, 2, item2);
307 colTable->setItemDelegate(delegate);
310 QVBoxLayout *colsLayout =
new QVBoxLayout;
311 colsLayout->addWidget(colTable);
314 QGroupBox *colsGroupBox =
new QGroupBox(tr(
"OUTPUT COLLECTIONS"));
315 colsGroupBox->setLayout(colsLayout);
316 colsGroupBox->setMaximumHeight(240);
319 mainLayout->addWidget(colsGroupBox, Qt::AlignTop);
331 labels << tr(
"Parameter Name") << tr(
"Parameter Value");
334 paramTable->setHorizontalHeaderLabels(labels);
335 paramTable->horizontalHeader()->resizeSection(0, 300);
336 paramTable->horizontalHeader()->resizeSection(1, 300);
337 paramTable->setSelectionMode(QAbstractItemView::SingleSelection);
338 paramTable->setSelectionBehavior(QAbstractItemView::SelectRows);
339 paramTable->setEditTriggers(QAbstractItemView::AllEditTriggers);
348 for(
unsigned int i=0; i<paramKeys.
size(); i++ ){
361 connect(
paramTable, SIGNAL(cellClicked(
int,
int)), nparamvecset, SLOT(updateTable()));
364 QGridLayout *paramLayout =
new QGridLayout;
366 paramLayout->addWidget(nparamvecset,0,1, Qt::AlignTop | Qt::AlignRight);
369 QGroupBox *paramGroupBox =
new QGroupBox(tr(
"Processor Parameters"));
370 paramGroupBox->setLayout(paramLayout);
372 mainLayout->addWidget(paramGroupBox, Qt::AlignTop);
383 labels << tr(
"Parameter Name") << tr(
"Parameter Value") << tr(
"Active");
390 optParamTable->setSelectionMode(QAbstractItemView::SingleSelection);
391 optParamTable->setSelectionBehavior(QAbstractItemView::SelectRows);
392 optParamTable->setEditTriggers(QAbstractItemView::AllEditTriggers);
399 for(
unsigned int i=0; i<paramKeys.
size(); i++ ){
412 for(
unsigned int j=0; j<paramValues.
size(); j++ ){
413 str+=paramValues[j].c_str();
417 QTableWidgetItem *item0 =
new QTableWidgetItem( paramKeys[i].c_str() );
418 QTableWidgetItem *item1 =
new QTableWidgetItem( str );
419 QTableWidgetItem *item2 =
new QTableWidgetItem;
421 item0->setFlags(item0->flags() & ~Qt::ItemIsEditable);
422 item2->setFlags(item0->flags() & ~Qt::ItemIsEditable);
425 item1->setFlags(item1->flags() & ~Qt::ItemIsEditable);
430 item2->setToolTip( QString(
431 tr(
"Activate this checkbox to write the parameter as a normal parameter in the xml file.\n"
432 "Please note that if you don't want to use this parameter and leave this option unchecked\n"
433 "the value of the parameter will still be written as a comment in the xml file but\n"
434 "the next time you open the xml file in the GUI the value will get lost."
440 item2->setCheckState(
_p->
isParamOptional( paramKeys[i] ) ? Qt::Unchecked : Qt::Checked );
450 connect(
optParamTable, SIGNAL(cellClicked(
int,
int)), nparamvecset, SLOT(updateTable()));
453 QGridLayout *paramLayout =
new QGridLayout;
455 paramLayout->addWidget(nparamvecset,0,1, Qt::AlignTop | Qt::AlignRight);
458 QGroupBox *paramGroupBox =
new QGroupBox(tr(
"Optional Processor Parameters"));
459 paramGroupBox->setLayout(paramLayout);
461 mainLayout->addWidget(paramGroupBox, Qt::AlignTop);
472 QPushButton *applyButton =
new QPushButton(tr(
"&Apply Changes"));
473 QPushButton *cancelButton =
new QPushButton(tr(
"&Cancel"));
475 connect(applyButton, SIGNAL(clicked()),
this, SLOT(accept()));
476 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
478 applyButton->setAutoDefault(
false );
479 cancelButton->setAutoDefault(
false );
480 applyButton->setFixedHeight( 40 );
481 cancelButton->setFixedHeight( 40 );
482 applyButton->setFixedWidth( 150 );
483 cancelButton->setFixedWidth( 150 );
486 QGridLayout *mainButtonsLayout =
new QGridLayout;
487 mainButtonsLayout->addWidget(cancelButton, 0, 1, 0, 1, Qt::AlignLeft | Qt::AlignTop);
488 mainButtonsLayout->addWidget(applyButton, 0, 2, 0, 2, Qt::AlignRight | Qt::AlignTop);
492 mainButtons->setFixedHeight( 50 );
493 mainButtons->setLayout(mainButtonsLayout);
495 mainLayout->addWidget(mainButtons, Qt::AlignTop);
504 for(
unsigned int i=0; i<paramKeys.
size(); i++ ){
516 for(
unsigned int j=0; j<paramValues.
size(); j++ ){
517 str+=paramValues[j].c_str();
521 QTableWidgetItem *item0 =
new QTableWidgetItem( paramKeys[i].c_str() );
522 QTableWidgetItem *item1 =
new QTableWidgetItem( str );
524 item0->setFlags(item0->flags() & ~Qt::ItemIsEditable);
527 item1->setFlags(item1->flags() & ~Qt::ItemIsEditable);
544 if(item2->checkState() == Qt::Checked){
this class is a Marlin Steering File consistency check Tool.
bool isErrorCol(const std::string &type, const std::string &value)
Returns true if the given collection is in the unavailable or duplicate list of this processor...
Dialog(const Dialog &)=default
QTableWidget * paramTable
handles information about marlin processors and their collections needed by MarlinSteerCheck ...
const std::string getParamD(const std::string &type, const std::string &key)
returns the description of the parameter with the given key for the processor with the given type ...
bool isParamOptional(const std::string &key)
Returns true if a parameter is optional (optional means the parameter will be written out as a commen...
void setOptionalParam(const std::string &key, bool optional=true)
Sets a parameter as optional (if optional=true parameter is written out as a comment) ...
const std::string & getType()
Returns the Type of the processor.
const std::string & getName()
Returns the Name of the processor.
ColVec & getCols(const std::string &iotype, const std::string &type_name="ALL_COLLECTIONS")
Returns collections of a given iotype ( INPUT, OUTPUT, UNAVAILABLE, DUPLICATE ) for a given name or t...
CMProcessor * getMProcs()
Returns the Marlin Processors.
const ssMap & getColHeaders(const std::string &iotype)
Returns a map with collection names and their respective types for INPUT/OUTPUT collections of this p...
bool hasParameters()
Returns true if the processor has parameters.
int getParamSetSize(const std::string &type, const std::string &key)
returns the set_size of the parameter with the given key for the processor with the given type ...
QTableWidget * optParamTable
bool isParamOpt(const std::string &type, const std::string &key)
returns true if the parameter with the given key for the processor with the given type is optional ...
bool isParamVec(const std::string &type, const std::string &key)
returns true if the parameter with the given key for the processor with the given type is a vector ...
bool isActive()
Returns true if the processor is active.
const std::string getDescription()
Returns the Description of the processor.
std::shared_ptr< StringParameters > getParameters()
Returns the string parameters for this processor.