added the class PStringNumberList which allow to parse a generic encoded list of numbers. Used this class to improve PMsrHandler, and improved the runList feature of msr2data. For details see the documentation of msr2data.
This commit is contained in:
@@ -493,40 +493,6 @@ void PTextEdit::doConnections( PSubTextEdit *e )
|
||||
connect( e, SIGNAL( cursorPositionChanged(int, int) ), this, SLOT( currentCursorPosition(int, int) ));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
bool PTextEdit::validRunList(const QString runList)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
int i = 0;
|
||||
QString subStr;
|
||||
bool done = false;
|
||||
int val;
|
||||
bool ok;
|
||||
while (!done) {
|
||||
subStr = runList.section(' ', i, i, QString::SectionSkipEmpty);
|
||||
if (subStr.isEmpty()) {
|
||||
done = true;
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
val = subStr.toInt(&ok);
|
||||
if (!ok) {
|
||||
done = true;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) { // no token found
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
@@ -1500,12 +1466,6 @@ void PTextEdit::musrMsr2Data()
|
||||
break;
|
||||
case 1: // run list
|
||||
runList = fMsr2DataParam->runList;
|
||||
if (!validRunList(runList)) {
|
||||
QMessageBox::critical(this, "**ERROR**",
|
||||
"Invalid Run List!\nThe run list needs to be a space separated list of run numbers.",
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2: // run list file name
|
||||
runListFileName = fMsr2DataParam->runListFileName;
|
||||
|
||||
@@ -64,7 +64,6 @@ private:
|
||||
void load( const QString &f, const int index=-1 );
|
||||
PSubTextEdit *currentEditor() const;
|
||||
void doConnections( PSubTextEdit *e );
|
||||
bool validRunList(const QString runList);
|
||||
|
||||
private slots:
|
||||
void fileNew();
|
||||
|
||||
Reference in New Issue
Block a user