mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-01 14:20:11 +01:00
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:
@@ -318,14 +318,14 @@ void RDCatchConnect::DispatchCommand()
|
||||
}
|
||||
emit eventUpdated(id);
|
||||
}
|
||||
|
||||
/*
|
||||
if(!strcmp(args[0],"PE")) { // Purge Event
|
||||
if(sscanf(args[1],"%d",&id)!=1) {
|
||||
return;
|
||||
}
|
||||
emit eventPurged(id);
|
||||
}
|
||||
|
||||
*/
|
||||
if(!strcmp(args[0],"HB")) { // Heartbeat
|
||||
cc_heartbeat_timer->stop();
|
||||
cc_heartbeat_timer->start(CC_HEARTBEAT_INTERVAL);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -31,7 +31,7 @@ class RDCatchEvent
|
||||
public:
|
||||
enum Operation {NullOp=0,DeckEventProcessedOp=1,
|
||||
DeckStatusQueryOp=2,DeckStatusResponseOp=3,
|
||||
LastOp=4};
|
||||
PurgeEventOp=4,LastOp=5};
|
||||
RDCatchEvent(RDDeck::Status status);
|
||||
RDCatchEvent();
|
||||
Operation operation() const;
|
||||
|
||||
Reference in New Issue
Block a user