20 this->
signal = signal_wanted;
22 setAttribute( Qt::WA_DeleteOnClose );
29 setWindowTitle( tr(
"Rotor Type Selection" ) );
32 QGridLayout* top =
new QGridLayout(
this );
33 top->setSpacing ( 2 );
34 top->setContentsMargins ( 2, 2, 2, 2 );
41 if ( DB.isEmpty() ) DB <<
"Undefined";
43 QLabel* lbl_bannerDB =
us_banner( tr(
"Current Database: " ) + DB.at( 0 ) );
45 top->addWidget( lbl_bannerDB, row++, 0, 1, 2 );
53 QLabel* lbl_lab =
us_label( tr(
" Please select a Rotor Type: " ) );
54 top->addWidget( lbl_lab, row, 0, 1, 1 );
56 connect(
cb_rotors, SIGNAL( activated (
int ) ),
58 top->addWidget(
cb_rotors, row++, 1, 1, 1 );
62 qDebug() <<
"Problem loading Abstract Rotors...";
67 te_details->setText(tr(
"Rotor Type Details:"));
74 QLabel *lbl_name =
us_label( tr(
" Rotor name: "), -1 );
75 top->addWidget( lbl_name, row, 0 );
79 top->addWidget(
le_name, row++, 1);
81 QLabel *lbl_serialNumber =
us_label( tr(
" Rotor serial number: "), -1 );
82 top->addWidget( lbl_serialNumber, row, 0 );
89 connect(
pb_help, SIGNAL( clicked() ),
this, SLOT(
help() ) );
90 top->addWidget(
pb_help, row, 0 );
93 connect(
pb_reset, SIGNAL( clicked() ),
this, SLOT(
reset() ) );
94 top->addWidget(
pb_reset, row++, 1 );
97 connect(
pb_close, SIGNAL( clicked() ),
this, SLOT( close() ) );
118 if ( db && ( DB.size() < 5 ) )
120 QMessageBox::warning(
this,
122 tr(
"There is no default database set." ) );
126 qApp->processEvents();
155 QMessageBox::warning(
this, tr(
"Database Problem" ),
156 tr(
"Could not read abstract rotor information \n" ) );
167 QMessageBox::warning(
this, tr(
"Local Disk Problem" ),
168 tr(
"Could not read abstract rotor information\n" ) );
174 QStringList arDescriptions;
179 arDescriptions << ( QString::number( ar.
ID ) +
": " + ar.
name );
198 QString itemText =
cb_rotors->currentText();
199 QStringList parts = itemText.split(
":" );
200 int arID = parts[ 0 ].toInt();
220 QMessageBox::warning(
this, tr(
"Please provide the missing information:" ),
221 tr(
"Please provide both a rotor name and serial number"));
240 QMessageBox::warning(
this, tr(
"Connection Problem" ),
241 tr(
"Could not connect to database \n" ) + error );
253 QString text = tr(
"Details for the ") + ar.
name + tr(
" Rotor Type:\n\n");
254 text +=
"Database ID: " + QString::number(ar.
ID) +
"\n";
255 text +=
"GUID: " + ar.
GUID +
"\n";
256 text +=
"Number of Holes: " + QString::number(ar.
numHoles) +
"\n";
257 text +=
"Maximum Speed: " + QString::number(ar.
maxRPM) +
" rpm\n";
258 text +=
"Magnet Offset: " + QString::number(ar.
magnetOffset) +
" degrees\n";
259 text +=
"Cell Center: " + QString::number(ar.
cellCenter) +
" cm\n";
260 text +=
"Material: " + ar.
material +
"\n";