From 54d8bd4a109debadce68d7633bc90f149a84755b Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Tue, 1 Nov 2022 16:46:02 -0400 Subject: [PATCH] 2022-11-01 Fred Gleason * Added a 'Reload Decks' operation to 'RDCatchEvent'. Signed-off-by: Fred Gleason --- ChangeLog | 2 ++ docs/apis/notification.xml | 43 ++++++++++++++++++++++++++++++++++++++ lib/rdcatchevent.cpp | 28 ++++++++++++++++++++++--- lib/rdcatchevent.h | 2 +- rdadmin/edit_decks.cpp | 5 +++++ rdcatchd/rdcatchd.cpp | 6 ++++++ 6 files changed, 82 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06f82afe..dea0176e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23602,3 +23602,5 @@ 2022-11-01 Fred Gleason * Refactored rdcatchd(1) to eliminate the need for the 'Set Exit Code' catch command. +2022-11-01 Fred Gleason + * Added a 'Reload Decks' operation to 'RDCatchEvent'. diff --git a/docs/apis/notification.xml b/docs/apis/notification.xml index ab8acda0..cd4ec1d1 100644 --- a/docs/apis/notification.xml +++ b/docs/apis/notification.xml @@ -612,6 +612,49 @@ + + Reload Decks Operation + + Emitted by rdadmin1 to + trigger a reload of the record and play-out deck parameters. + + + RDCatch Reload Decks Fields + + + + + + + Field + Offset + Value + + + Keyword + 0 + CATCH + + + Originating Hostname + 1 + String, from STATIONS.NAME + + + Operation + 2 + Integer. 7 [RDCatchEvent::ReloadDecksOp] + + + Target Hostname + 3 + String, from STATIONS.NAME + + + +
+
+ Stop Deck Operation diff --git a/lib/rdcatchevent.cpp b/lib/rdcatchevent.cpp index 35a6323e..9b68538d 100644 --- a/lib/rdcatchevent.cpp +++ b/lib/rdcatchevent.cpp @@ -292,6 +292,19 @@ bool RDCatchEvent::read(const QString &str) } break; + case RDCatchEvent::ReloadDecksOp: + if(f0.size()!=4) { + return false; + } + chan=f0.at(4).toInt(&ok); + if(ok&&(chan<255)) { + d_operation=op; + d_host_name=f0.at(1); + d_target_host_name=f0.at(3); + return true; + } + break; + case RDCatchEvent::NullOp: case RDCatchEvent::LastOp: break; @@ -349,6 +362,10 @@ QString RDCatchEvent::write() const ret+=" "+d_target_host_name; ret+=QString::asprintf(" %u",d_deck_channel); break; + + case RDCatchEvent::ReloadDecksOp: + ret+=" "+d_target_host_name; + break; } return ret; @@ -387,21 +404,26 @@ QString RDCatchEvent::dump() const ret+=QString::asprintf("cut number: %d\n",d_cut_number); break; + case RDCatchEvent::ReloadDecksOp: + ret+="operation: RDCatchEvent::ReloadDecksOp\n"; + ret+="target hostname: "+d_target_host_name+"\n"; + break; + case RDCatchEvent::StopDeckOp: - ret+="operation: RDCatchEvent::DeckEventProcessedOp\n"; + ret+="operation: RDCatchEvent::StopDeckOp\n"; ret+="target hostname: "+d_target_host_name+"\n"; ret+=QString::asprintf("deck channel: %u\n",d_deck_channel); break; case RDCatchEvent::SetInputMonitorOp: - ret+="operation: RDCatchEvent::DeckEventProcessedOp\n"; + ret+="operation: RDCatchEvent::SetInputMonitorOp\n"; ret+="target hostname: "+d_target_host_name+"\n"; ret+=QString::asprintf("deck channel: %u\n",d_deck_channel); ret+=QString::asprintf("input monitor active: %u\n",d_input_monitor_active); break; case RDCatchEvent::SetInputMonitorResponseOp: - ret+="operation: RDCatchEvent::DeckEventProcessedOp\n"; + ret+="operation: RDCatchEvent::SetInputMonitorResponseOp\n"; ret+=QString::asprintf("deck channel: %u\n",d_deck_channel); ret+=QString::asprintf("input monitor active: %u\n",d_input_monitor_active); break; diff --git a/lib/rdcatchevent.h b/lib/rdcatchevent.h index 226630da..28a4cc32 100644 --- a/lib/rdcatchevent.h +++ b/lib/rdcatchevent.h @@ -32,7 +32,7 @@ class RDCatchEvent enum Operation {NullOp=0,DeckEventProcessedOp=1, DeckStatusQueryOp=2,DeckStatusResponseOp=3, StopDeckOp=4,SetInputMonitorOp=5,SetInputMonitorResponseOp=6, - LastOp=7}; + ReloadDecksOp=7,LastOp=8}; RDCatchEvent(RDDeck::Status status); RDCatchEvent(); Operation operation() const; diff --git a/rdadmin/edit_decks.cpp b/rdadmin/edit_decks.cpp index 628735eb..6fe885d0 100644 --- a/rdadmin/edit_decks.cpp +++ b/rdadmin/edit_decks.cpp @@ -538,6 +538,11 @@ void EditDecks::closeData() WriteRecord(0); WriteRecord(edit_record_channel); WriteRecord(edit_play_channel); + RDCatchEvent *evt=new RDCatchEvent(); + evt->setOperation(RDCatchEvent::ReloadDecksOp); + evt->setTargetHostName(edit_station->name()); + rda->ripc()->sendCatchEvent(evt); + delete evt; done(true); } diff --git a/rdcatchd/rdcatchd.cpp b/rdcatchd/rdcatchd.cpp index 7f5a5526..0f0f4e50 100644 --- a/rdcatchd/rdcatchd.cpp +++ b/rdcatchd/rdcatchd.cpp @@ -519,6 +519,12 @@ void MainObject::catchEventReceivedData(RDCatchEvent *evt) } break; + case RDCatchEvent::ReloadDecksOp: + if(evt->targetHostName()==rda->station()->name()) { + LoadDeckList(); + } + break; + case RDCatchEvent::DeckEventProcessedOp: case RDCatchEvent::DeckStatusResponseOp: case RDCatchEvent::SetInputMonitorResponseOp: