2017-10-19 Fred Gleason <fredg@paravelsystems.com>

* Added a 'Show Event Type' filter to rdcatch(1).
This commit is contained in:
Fred Gleason 2017-10-19 09:52:13 -04:00
parent 4b5adfd53c
commit 349fe63e5c
12 changed files with 543 additions and 457 deletions

View File

@ -16174,3 +16174,5 @@
* Updated 'NEWS'. * Updated 'NEWS'.
2017-10-17 Fred Gleason <fredg@paravelsystems.com> 2017-10-17 Fred Gleason <fredg@paravelsystems.com>
* Incremented the package version to 2.17.0int00. * Incremented the package version to 2.17.0int00.
2017-10-19 Fred Gleason <fredg@paravelsystems.com>
* Added a 'Show Event Type' filter to rdcatch(1).

View File

@ -671,7 +671,7 @@ QString RDRecording::feedKeyName() const
QString RDRecording::typeString(RDRecording::Type type) QString RDRecording::typeString(RDRecording::Type type)
{ {
QString str; QString str=QObject::tr("Unknown");
switch(type) { switch(type) {
case RDRecording::Recording: case RDRecording::Recording:
@ -697,6 +697,9 @@ QString RDRecording::typeString(RDRecording::Type type)
case RDRecording::Upload: case RDRecording::Upload:
str=QObject::tr("Upload"); str=QObject::tr("Upload");
break; break;
case RDRecording::LastType:
break;
} }
return str; return str;

View File

@ -32,7 +32,7 @@ class RDRecording
enum StartType {HardStart=0,GpiStart=1}; enum StartType {HardStart=0,GpiStart=1};
enum EndType {HardEnd=0,GpiEnd=1,LengthEnd=2}; enum EndType {HardEnd=0,GpiEnd=1,LengthEnd=2};
enum Type {Recording=0,MacroEvent=1,SwitchEvent=2,Playout=3, enum Type {Recording=0,MacroEvent=1,SwitchEvent=2,Playout=3,
Download=4,Upload=5}; Download=4,Upload=5,LastType=6};
enum ExitCode {Ok=0,Short=1,LowLevel=2,HighLevel=3, enum ExitCode {Ok=0,Short=1,LowLevel=2,HighLevel=3,
Downloading=4,Uploading=5,ServerError=6,InternalError=7, Downloading=4,Uploading=5,ServerError=6,InternalError=7,
Interrupted=8,RecordActive=9,PlayActive=10,Waiting=11, Interrupted=8,RecordActive=9,PlayActive=10,Waiting=11,

View File

@ -164,16 +164,15 @@ MainWidget::MainWidget(QWidget *parent)
// //
// Create Icons // Create Icons
// //
catch_record_map=new QPixmap(record_xpm); catch_type_maps[RDRecording::Recording]=new QPixmap(record_xpm);
catch_playout_map=new QPixmap(play_xpm); catch_type_maps[RDRecording::Playout]=new QPixmap(play_xpm);
catch_macro_map=new QPixmap(rml5_xpm); catch_type_maps[RDRecording::MacroEvent]=new QPixmap(rml5_xpm);
catch_switch_map=new QPixmap(switch3_xpm); catch_type_maps[RDRecording::SwitchEvent]=new QPixmap(switch3_xpm);
catch_download_map=new QPixmap(download_xpm); catch_type_maps[RDRecording::Download]=new QPixmap(download_xpm);
catch_upload_map=new QPixmap(upload_xpm); catch_type_maps[RDRecording::Upload]=new QPixmap(upload_xpm);
catch_rivendell_map=new QPixmap(rdcatch_22x22_xpm); catch_rivendell_map=new QPixmap(rdcatch_22x22_xpm);
setIcon(*catch_rivendell_map); setIcon(*catch_rivendell_map);
// //
// Generate Palettes // Generate Palettes
// //
@ -395,7 +394,19 @@ order by CHANNEL",(const char *)q->value(0).toString().lower());
catch_dow_box->insertItem(tr("Thursday")); catch_dow_box->insertItem(tr("Thursday"));
catch_dow_box->insertItem(tr("Friday")); catch_dow_box->insertItem(tr("Friday"));
catch_dow_box->insertItem(tr("Saturday")); catch_dow_box->insertItem(tr("Saturday"));
connect(catch_dow_box,SIGNAL(activated(int)),this,SLOT(dowChangedData(int))); connect(catch_dow_box,SIGNAL(activated(int)),this,SLOT(filterActivatedData(int)));
catch_type_box=new QComboBox(this);
connect(catch_type_box,SIGNAL(activated(int)),this,SLOT(filterActivatedData(int)));
catch_type_label=new QLabel(catch_type_box,tr("Show Event Type")+":",this);
catch_type_label->setFont(label_font);
catch_type_label->setAlignment(AlignRight|AlignVCenter);
for(int i=0;i<RDRecording::LastType;i++) {
catch_type_box->insertItem(*(catch_type_maps[i]),
RDRecording::typeString((RDRecording::Type)i));
}
catch_type_box->insertItem(tr("All Types"));
catch_type_box->setCurrentItem(catch_type_box->count()-1);
// //
// Cart Picker // Cart Picker
@ -869,6 +880,9 @@ void MainWidget::editData()
} }
delete upload; delete upload;
break; break;
case RDRecording::LastType:
break;
} }
ProcessNewRecords(&new_events); ProcessNewRecords(&new_events);
} }
@ -1307,13 +1321,19 @@ void MainWidget::filterChangedData(bool)
case 7: case 7:
day_column=7; day_column=7;
} }
RDRecording::Type filter_type=
(RDRecording::Type)catch_type_box->currentItem();
if(catch_show_active_box->isChecked()) { if(catch_show_active_box->isChecked()) {
if(catch_show_today_box->isChecked()) { if(catch_show_today_box->isChecked()) {
while(item!=NULL) { while(item!=NULL) {
RDRecording::Type event_type=
(RDRecording::Type)item->text(29).toInt();
if((item->textColor(1)==EVENT_ACTIVE_TEXT_COLOR)&& if((item->textColor(1)==EVENT_ACTIVE_TEXT_COLOR)&&
(!item->text(day_column).isEmpty())) { (!item->text(day_column).isEmpty())) {
if((event_type==filter_type)||(filter_type==RDRecording::LastType)) {
ShowEvent(item); ShowEvent(item);
} }
}
else { else {
item->setVisible(false); item->setVisible(false);
} }
@ -1323,7 +1343,10 @@ void MainWidget::filterChangedData(bool)
else { else {
if(catch_show_active_box->isChecked()) { if(catch_show_active_box->isChecked()) {
while(item!=NULL) { while(item!=NULL) {
if(item->textColor(1)==EVENT_ACTIVE_TEXT_COLOR) { RDRecording::Type event_type=
(RDRecording::Type)item->text(29).toInt();
if((item->textColor(1)==EVENT_ACTIVE_TEXT_COLOR)&&
((event_type==filter_type)||(filter_type==RDRecording::LastType))) {
ShowEvent(item); ShowEvent(item);
} }
else { else {
@ -1337,7 +1360,10 @@ void MainWidget::filterChangedData(bool)
else { else {
if(catch_show_today_box->isChecked()) { if(catch_show_today_box->isChecked()) {
while(item!=NULL) { while(item!=NULL) {
if(!item->text(day_column).isEmpty()) { RDRecording::Type event_type=
(RDRecording::Type)item->text(29).toInt();
if((!item->text(day_column).isEmpty())&&
((event_type==filter_type)||(filter_type==RDRecording::LastType))) {
ShowEvent(item); ShowEvent(item);
} }
else { else {
@ -1348,7 +1374,14 @@ void MainWidget::filterChangedData(bool)
} }
else { else {
while(item!=NULL) { while(item!=NULL) {
RDRecording::Type event_type=
(RDRecording::Type)item->text(29).toInt();
if((event_type==filter_type)||(filter_type==RDRecording::LastType)) {
ShowEvent(item); ShowEvent(item);
}
else {
item->setVisible(false);
}
item=(RDListViewItem *)item->nextSibling(); item=(RDListViewItem *)item->nextSibling();
} }
} }
@ -1356,7 +1389,7 @@ void MainWidget::filterChangedData(bool)
} }
void MainWidget::dowChangedData(int id) void MainWidget::filterActivatedData(int id)
{ {
filterChangedData(false); filterChangedData(false);
} }
@ -1408,12 +1441,14 @@ void MainWidget::resizeEvent(QResizeEvent *e)
deck_height=catch_monitor_view->geometry().y()+ deck_height=catch_monitor_view->geometry().y()+
catch_monitor_view->geometry().height(); catch_monitor_view->geometry().height();
} }
catch_show_active_label->setGeometry(35,deck_height+5,160,20); catch_show_active_label->setGeometry(35,deck_height+5,140,20);
catch_show_active_box->setGeometry(15,deck_height+7,15,15); catch_show_active_box->setGeometry(15,deck_height+7,15,15);
catch_show_today_label->setGeometry(265,deck_height+5,165,20); catch_show_today_label->setGeometry(205,deck_height+5,145,20);
catch_show_today_box->setGeometry(245,deck_height+7,15,15); catch_show_today_box->setGeometry(185,deck_height+7,15,15);
catch_dow_label->setGeometry(480,deck_height+5,125,20); catch_dow_label->setGeometry(370,deck_height+5,125,20);
catch_dow_box->setGeometry(610,deck_height+4,120,20); catch_dow_box->setGeometry(500,deck_height+4,120,20);
catch_type_label->setGeometry(630,deck_height+5,125,20);
catch_type_box->setGeometry(760,deck_height+4,140,20);
catch_recordings_list-> catch_recordings_list->
setGeometry(10,deck_height+25,e->size().width()-20, setGeometry(10,deck_height+25,e->size().width()-20,
e->size().height()-90-deck_height); e->size().height()-90-deck_height);
@ -1777,9 +1812,9 @@ void MainWidget::RefreshList()
l->setText(28,q->value(25).toString()); // Id l->setText(28,q->value(25).toString()); // Id
l->setText(29,q->value(26).toString()); // Type l->setText(29,q->value(26).toString()); // Type
l->setText(32,QString().sprintf("%u",RDDeck::Idle)); l->setText(32,QString().sprintf("%u",RDDeck::Idle));
l->setPixmap(0,*(catch_type_maps[q->value(26).toInt()]));
switch((RDRecording::Type)q->value(26).toInt()) { switch((RDRecording::Type)q->value(26).toInt()) {
case RDRecording::Recording: case RDRecording::Recording:
l->setPixmap(0,*catch_record_map);
l->setText(2,QString().sprintf("%s : %dR", l->setText(2,QString().sprintf("%s : %dR",
(const char *)q->value(2).toString(), (const char *)q->value(2).toString(),
q->value(23).toInt())); q->value(23).toInt()));
@ -1893,7 +1928,6 @@ void MainWidget::RefreshList()
break; break;
case RDRecording::Playout: case RDRecording::Playout:
l->setPixmap(0,*catch_playout_map);
l->setText(2,QString().sprintf("%s : %dP", l->setText(2,QString().sprintf("%s : %dP",
(const char *)q->value(2).toString(), (const char *)q->value(2).toString(),
q->value(23).toInt()-128)); q->value(23).toInt()-128));
@ -1912,7 +1946,6 @@ void MainWidget::RefreshList()
break; break;
case RDRecording::MacroEvent: case RDRecording::MacroEvent:
l->setPixmap(0,*catch_macro_map);
l->setText(2,q->value(2).toString()); l->setText(2,q->value(2).toString());
str=QString(tr("Hard")); str=QString(tr("Hard"));
l->setText(3,q->value(3).toTime(). l->setText(3,q->value(3).toTime().
@ -1924,7 +1957,6 @@ void MainWidget::RefreshList()
break; break;
case RDRecording::SwitchEvent: case RDRecording::SwitchEvent:
l->setPixmap(0,*catch_switch_map);
l->setText(2,q->value(2).toString()); l->setText(2,q->value(2).toString());
str=QString(tr("Hard")); str=QString(tr("Hard"));
l->setText(3,q->value(3).toTime(). l->setText(3,q->value(3).toTime().
@ -1938,7 +1970,6 @@ void MainWidget::RefreshList()
break; break;
case RDRecording::Download: case RDRecording::Download:
l->setPixmap(0,*catch_download_map);
l->setText(2,q->value(2).toString()); l->setText(2,q->value(2).toString());
str=QString(tr("Hard")); str=QString(tr("Hard"));
l->setText(3,q->value(3).toTime(). l->setText(3,q->value(3).toTime().
@ -1952,7 +1983,6 @@ void MainWidget::RefreshList()
break; break;
case RDRecording::Upload: case RDRecording::Upload:
l->setPixmap(0,*catch_upload_map);
l->setText(2,q->value(2).toString()); l->setText(2,q->value(2).toString());
str=QString(tr("Hard")); str=QString(tr("Hard"));
l->setText(3,q->value(3).toTime(). l->setText(3,q->value(3).toTime().
@ -2009,6 +2039,9 @@ void MainWidget::RefreshList()
q->value(22).toInt()/1000)); q->value(22).toInt()/1000));
} }
break; break;
case RDRecording::LastType:
break;
} }
DisplayExitCode(l,(RDRecording::ExitCode)q->value(28).toInt(), DisplayExitCode(l,(RDRecording::ExitCode)q->value(28).toInt(),
q->value(45).toString()); q->value(45).toString());
@ -2153,9 +2186,6 @@ void MainWidget::RefreshLine(RDListViewItem *item)
-q->value(17).toInt(),(const char *)str)); -q->value(17).toInt(),(const char *)str));
item->setText(18,q->value(17).toString()); // Startdate Offset item->setText(18,q->value(17).toString()); // Startdate Offset
item->setText(19,q->value(18).toString()); // Enddate Offset item->setText(19,q->value(18).toString()); // Enddate Offset
/*
*/
item->setText(24,q->value(2).toString()); // Station item->setText(24,q->value(2).toString()); // Station
item->setText(25,q->value(23).toString()); // Deck item->setText(25,q->value(23).toString()); // Deck
item->setText(26,q->value(5).toString()); // Cut Name item->setText(26,q->value(5).toString()); // Cut Name
@ -2166,6 +2196,7 @@ void MainWidget::RefreshLine(RDListViewItem *item)
item->setText(27,""); item->setText(27,"");
} }
item->setText(29,q->value(25).toString()); // Type item->setText(29,q->value(25).toString()); // Type
item->setPixmap(0,*(catch_type_maps[q->value(25).toInt()]));
switch((RDRecording::Type)q->value(25).toInt()) { // Source switch((RDRecording::Type)q->value(25).toInt()) { // Source
case RDRecording::Recording: case RDRecording::Recording:
item->setText(2,QString().sprintf("%s : %dR", item->setText(2,QString().sprintf("%s : %dR",
@ -2241,7 +2272,6 @@ void MainWidget::RefreshLine(RDListViewItem *item)
delete q1; delete q1;
item->setText(6,QString(). item->setText(6,QString().
sprintf("Cut %s",(const char *)q->value(5).toString())); sprintf("Cut %s",(const char *)q->value(5).toString()));
item->setPixmap(0,*catch_record_map);
switch((RDSettings::Format)q->value(19).toInt()) { // Format switch((RDSettings::Format)q->value(19).toInt()) { // Format
case RDSettings::Pcm16: case RDSettings::Pcm16:
item->setText(20,tr("PCM16")); item->setText(20,tr("PCM16"));
@ -2296,7 +2326,6 @@ void MainWidget::RefreshLine(RDListViewItem *item)
item->setText(5,QString(). item->setText(5,QString().
sprintf("%s %s",(const char *)str, sprintf("%s %s",(const char *)str,
(const char *)q->value(5).toString())); (const char *)q->value(5).toString()));
item->setPixmap(0,*catch_playout_map);
item->setText(20,""); item->setText(20,"");
item->setText(21,""); item->setText(21,"");
item->setText(22,""); item->setText(22,"");
@ -2310,7 +2339,6 @@ void MainWidget::RefreshLine(RDListViewItem *item)
sprintf("%s: hh:mm:ss",(const char *)str))); sprintf("%s: hh:mm:ss",(const char *)str)));
item->setText(4,""); item->setText(4,"");
item->setText(5,QString().sprintf("Cart %06d",q->value(24).toInt())); item->setText(5,QString().sprintf("Cart %06d",q->value(24).toInt()));
item->setPixmap(0,*catch_macro_map);
item->setText(20,""); item->setText(20,"");
item->setText(21,""); item->setText(21,"");
item->setText(22,""); item->setText(22,"");
@ -2326,7 +2354,6 @@ void MainWidget::RefreshLine(RDListViewItem *item)
item->setText(5,GetSourceName(q->value(2).toString(), item->setText(5,GetSourceName(q->value(2).toString(),
q->value(23).toInt(), q->value(23).toInt(),
q->value(13).toInt())); q->value(13).toInt()));
item->setPixmap(0,*catch_switch_map);
item->setText(6,GetDestinationName(q->value(2).toString(), // Dest item->setText(6,GetDestinationName(q->value(2).toString(), // Dest
q->value(23).toInt(), q->value(23).toInt(),
q->value(26).toInt())); q->value(26).toInt()));
@ -2337,7 +2364,6 @@ void MainWidget::RefreshLine(RDListViewItem *item)
break; break;
case RDRecording::Download: case RDRecording::Download:
item->setPixmap(0,*catch_download_map);
str=QString(tr("Hard")); str=QString(tr("Hard"));
item->setText(2,q->value(2).toString()); item->setText(2,q->value(2).toString());
item->setText(3,q->value(3).toTime(). item->setText(3,q->value(3).toTime().
@ -2354,7 +2380,6 @@ void MainWidget::RefreshLine(RDListViewItem *item)
break; break;
case RDRecording::Upload: case RDRecording::Upload:
item->setPixmap(0,*catch_upload_map);
str=QString(tr("Hard")); str=QString(tr("Hard"));
item->setText(2,q->value(2).toString()); item->setText(2,q->value(2).toString());
item->setText(3,q->value(3).toTime(). item->setText(3,q->value(3).toTime().
@ -2412,6 +2437,9 @@ void MainWidget::RefreshLine(RDListViewItem *item)
q->value(22).toInt()/1000)); q->value(22).toInt()/1000));
} }
break; break;
case RDRecording::LastType:
break;
} }
DisplayExitCode(item,(RDRecording::ExitCode)q->value(27).toInt(), DisplayExitCode(item,(RDRecording::ExitCode)q->value(27).toInt(),
q->value(44).toString()); q->value(44).toString());

View File

@ -108,7 +108,7 @@ class MainWidget : public QWidget
void selectionChangedData(QListViewItem *item); void selectionChangedData(QListViewItem *item);
void doubleClickedData(QListViewItem *,const QPoint &,int); void doubleClickedData(QListViewItem *,const QPoint &,int);
void filterChangedData(bool state); void filterChangedData(bool state);
void dowChangedData(int id); void filterActivatedData(int id);
void clockData(); void clockData();
void midnightData(); void midnightData();
void eventUpdatedData(int id); void eventUpdatedData(int id);
@ -162,12 +162,7 @@ class MainWidget : public QWidget
QString catch_filter; QString catch_filter;
QString catch_group; QString catch_group;
QString catch_schedcode; QString catch_schedcode;
QPixmap *catch_record_map; QPixmap *catch_type_maps[RDRecording::LastType];
QPixmap *catch_playout_map;
QPixmap *catch_macro_map;
QPixmap *catch_switch_map;
QPixmap *catch_download_map;
QPixmap *catch_upload_map;
QTimer *catch_next_timer; QTimer *catch_next_timer;
QPalette catch_scroll_color[2]; QPalette catch_scroll_color[2];
bool catch_scroll; bool catch_scroll;
@ -179,6 +174,8 @@ class MainWidget : public QWidget
QCheckBox *catch_show_today_box; QCheckBox *catch_show_today_box;
QLabel *catch_dow_label; QLabel *catch_dow_label;
QComboBox *catch_dow_box; QComboBox *catch_dow_box;
QLabel *catch_type_label;
QComboBox *catch_type_box;
QString catch_filter_string; QString catch_filter_string;
QTimer *catch_midnight_timer; QTimer *catch_midnight_timer;
int catch_time_offset; int catch_time_offset;
@ -187,4 +184,4 @@ class MainWidget : public QWidget
}; };
#endif #endif // RDCATCH_H

View File

@ -1323,5 +1323,13 @@ nové</translation>
<source>PCM24</source> <source>PCM24</source>
<translation type="unfinished">PCM24</translation> <translation type="unfinished">PCM24</translation>
</message> </message>
<message>
<source>Show Event Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All Types</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1323,5 +1323,13 @@ Neu</translation>
<source>PCM24</source> <source>PCM24</source>
<translation type="unfinished">PCM24</translation> <translation type="unfinished">PCM24</translation>
</message> </message>
<message>
<source>Show Event Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All Types</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1267,5 +1267,13 @@ como Nuevo</translation>
<source>PCM24</source> <source>PCM24</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Show Event Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All Types</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1257,5 +1257,13 @@ New</source>
<source>PCM24</source> <source>PCM24</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Show Event Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All Types</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1320,5 +1320,13 @@ ny</translation>
<source>PCM24</source> <source>PCM24</source>
<translation type="unfinished">PCM24</translation> <translation type="unfinished">PCM24</translation>
</message> </message>
<message>
<source>Show Event Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All Types</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1320,5 +1320,13 @@ ny</translation>
<source>PCM24</source> <source>PCM24</source>
<translation type="unfinished">PCM24</translation> <translation type="unfinished">PCM24</translation>
</message> </message>
<message>
<source>Show Event Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All Types</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1323,5 +1323,13 @@ Novo</translation>
<source>PCM24</source> <source>PCM24</source>
<translation type="unfinished">PCM24</translation> <translation type="unfinished">PCM24</translation>
</message> </message>
<message>
<source>Show Event Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>All Types</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>