2022-10-30 Fred Gleason <fredg@paravelsystems.com>

* Reimplemented the 'PurgeEvent' command using 'RDCatchEvent'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2022-10-30 16:02:46 -04:00
parent d65517215b
commit de49ba6cd9
9 changed files with 91 additions and 11 deletions

View File

@@ -141,6 +141,8 @@ bool RDCatchEvent::isValid() const
bool RDCatchEvent::read(const QString &str)
{
printf("RDCatchEvent::read(\"%s\")\n",str.toUtf8().constData());
RDCatchEvent::Operation op=RDCatchEvent::NullOp;
QStringList f0=str.split(" ");
bool ok=false;
@@ -214,6 +216,19 @@ bool RDCatchEvent::read(const QString &str)
}
}
if(ok&&(op==RDCatchEvent::PurgeEventOp)) {
if(f0.size()!=4) {
return false;
}
unsigned id=f0.at(3).toUInt(&ok);
if(ok) {
d_operation=op;
d_host_name=f0.at(1);
d_event_id=id;
return true;
}
}
return false;
}
@@ -246,6 +261,10 @@ QString RDCatchEvent::write() const
ret+=QString::asprintf(" %d",d_cut_number);
break;
case RDCatchEvent::PurgeEventOp:
ret+=QString::asprintf(" %u",d_event_id);
break;
case RDCatchEvent::DeckStatusQueryOp:
case RDCatchEvent::NullOp:
case RDCatchEvent::LastOp:
@@ -288,6 +307,11 @@ QString RDCatchEvent::dump() const
ret+=QString::asprintf("cut number: %d\n",d_cut_number);
break;
case RDCatchEvent::PurgeEventOp:
ret+="operation: RDCatchEvent::PurgeEventOpOp\n";
ret+=QString::asprintf("event id: %u\n",d_event_id);
break;
case RDCatchEvent::NullOp:
case RDCatchEvent::LastOp:
break;