mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-16 15:41:13 +02:00
2022-10-28 Fred Gleason <fredg@paravelsystems.com>
* Added an 'RDCatchEvent' class. * Reimplemented the 'Deck Event Processed' command using 'RDCatchEvent'. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -52,6 +52,7 @@ dist_rdcatch_SOURCES = add_recording.cpp add_recording.h\
|
||||
edit_recording.cpp edit_recording.h\
|
||||
edit_switchevent.cpp edit_switchevent.h\
|
||||
edit_upload.cpp edit_upload.h\
|
||||
eventlight.cpp eventlight.h\
|
||||
eventwidget.cpp eventwidget.h\
|
||||
globals.h\
|
||||
list_reports.cpp list_reports.h\
|
||||
@@ -69,6 +70,7 @@ nodist_rdcatch_SOURCES = moc_add_recording.cpp\
|
||||
moc_edit_recording.cpp\
|
||||
moc_edit_switchevent.cpp\
|
||||
moc_edit_upload.cpp\
|
||||
moc_eventlight.cpp\
|
||||
moc_eventwidget.cpp\
|
||||
moc_list_reports.cpp\
|
||||
moc_rdcatch.cpp\
|
||||
|
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Monitor a Rivendell RDCatch Deck
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -40,10 +40,8 @@ DeckMon::DeckMon(QString station,unsigned channel,QWidget *parent)
|
||||
mon_red_palette=palette();
|
||||
mon_red_palette.setColor(QPalette::Background,Qt::darkRed);
|
||||
mon_red_palette.setColor(QPalette::Foreground,Qt::white);
|
||||
mon_red_stylesheet="color: white;background-color: darkRed;";
|
||||
mon_dark_palette=palette();
|
||||
mon_dark_palette.
|
||||
setColor(QPalette::Background,palette().color(QPalette::Active,QPalette::Mid));
|
||||
mon_dark_palette.setColor(QPalette::Foreground,Qt::white);
|
||||
|
||||
//
|
||||
// Station/Channel
|
||||
@@ -91,15 +89,8 @@ DeckMon::DeckMon(QString station,unsigned channel,QWidget *parent)
|
||||
//
|
||||
// Event Indicator
|
||||
//
|
||||
mon_event_label=new QLabel(this);
|
||||
mon_event_label->setFont(labelFont());
|
||||
mon_event_label->setAlignment(Qt::AlignCenter);
|
||||
mon_event_label->setFrameStyle(QFrame::Panel|QFrame::Sunken);
|
||||
mon_event_label->setPalette(mon_dark_palette);
|
||||
mon_event_label->setText("--");
|
||||
mon_event_timer=new QTimer(this);
|
||||
mon_event_timer->setSingleShot(true);
|
||||
connect(mon_event_timer,SIGNAL(timeout()),this,SLOT(eventResetData()));
|
||||
mon_event_light=new EventLight(this);
|
||||
mon_event_light->setFont(labelFont());
|
||||
|
||||
//
|
||||
// Status
|
||||
@@ -167,6 +158,7 @@ void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
|
||||
mon_left_meter->setPeakBar(-10000);
|
||||
mon_right_meter->setPeakBar(-10000);
|
||||
mon_abort_button->setDisabled(true);
|
||||
mon_event_light->setDisabled(true);
|
||||
return;
|
||||
}
|
||||
switch(status) {
|
||||
@@ -176,6 +168,7 @@ void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
|
||||
mon_left_meter->setPeakBar(-10000);
|
||||
mon_right_meter->setPeakBar(-10000);
|
||||
mon_abort_button->setDisabled(true);
|
||||
mon_event_light->setDisabled(true);
|
||||
break;
|
||||
|
||||
case RDDeck::Idle:
|
||||
@@ -184,6 +177,7 @@ void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
|
||||
mon_left_meter->setPeakBar(-10000);
|
||||
mon_right_meter->setPeakBar(-10000);
|
||||
mon_abort_button->setDisabled(true);
|
||||
mon_event_light->setDisabled(true);
|
||||
break;
|
||||
|
||||
case RDDeck::Ready:
|
||||
@@ -192,6 +186,7 @@ void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
|
||||
mon_left_meter->setPeakBar(-10000);
|
||||
mon_right_meter->setPeakBar(-10000);
|
||||
mon_abort_button->setEnabled(true);
|
||||
mon_event_light->setDisabled(true);
|
||||
break;
|
||||
|
||||
case RDDeck::Waiting:
|
||||
@@ -200,6 +195,7 @@ void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
|
||||
mon_left_meter->setPeakBar(-10000);
|
||||
mon_right_meter->setPeakBar(-10000);
|
||||
mon_abort_button->setEnabled(true);
|
||||
mon_event_light->setDisabled(true);
|
||||
break;
|
||||
|
||||
case RDDeck::Recording:
|
||||
@@ -211,17 +207,12 @@ void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
|
||||
}
|
||||
SetCutInfo(id,cutname);
|
||||
mon_abort_button->setEnabled(true);
|
||||
mon_event_light->setEnabled(true);
|
||||
break;
|
||||
|
||||
case RDDeck::LastStatus:
|
||||
break;
|
||||
}
|
||||
mon_event_label->setText("--");
|
||||
}
|
||||
|
||||
|
||||
void DeckMon::setEvent(int number)
|
||||
{
|
||||
mon_event_label->setText(QString::asprintf("%d",number));
|
||||
mon_event_label->setPalette(mon_red_palette);
|
||||
mon_event_timer->start(1000);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,6 +228,16 @@ void DeckMon::setRightMeter(int level)
|
||||
}
|
||||
|
||||
|
||||
void DeckMon::processCatchEvent(RDCatchEvent *evt)
|
||||
{
|
||||
if((evt->hostName()==mon_station)&&(evt->deckChannel()==mon_channel)) {
|
||||
if(evt->operation()==RDCatchEvent::DeckEventProcessedOp) {
|
||||
mon_event_light->trigger(evt->eventNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DeckMon::monitorButtonData()
|
||||
{
|
||||
emit monitorClicked();
|
||||
@@ -249,19 +250,13 @@ void DeckMon::abortButtonData()
|
||||
}
|
||||
|
||||
|
||||
void DeckMon::eventResetData()
|
||||
{
|
||||
mon_event_label->setPalette(mon_dark_palette);
|
||||
}
|
||||
|
||||
|
||||
void DeckMon::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
mon_station_label->setGeometry(10,6,140,18);
|
||||
mon_monitor_button->setGeometry(155,5,40,20);
|
||||
mon_abort_button->setGeometry(200,5,40,20);
|
||||
mon_cut_label->setGeometry(245,6,e->size().width()-595,18);
|
||||
mon_event_label->setGeometry(e->size().width()-345,6,20,18);
|
||||
mon_event_light->setGeometry(e->size().width()-345,6,20,18);
|
||||
mon_status_label->setGeometry(e->size().width()-320,6,80,18);
|
||||
mon_left_meter->setGeometry(e->size().width()-235,6,225,10);
|
||||
mon_right_meter->setGeometry(e->size().width()-235,16,225,10);
|
||||
|
@@ -29,6 +29,8 @@
|
||||
#include <rdplaymeter.h>
|
||||
#include <rdrecording.h>
|
||||
|
||||
#include "eventlight.h"
|
||||
|
||||
class DeckMon : public RDFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -42,10 +44,10 @@ class DeckMon : public RDFrame
|
||||
public slots:
|
||||
void setMonitor(bool state);
|
||||
void setStatus(RDDeck::Status status,int id,const QString &cutname);
|
||||
void setEvent(int number);
|
||||
void setLeftMeter(int level);
|
||||
void setRightMeter(int level);
|
||||
|
||||
void processCatchEvent(RDCatchEvent *evt);
|
||||
|
||||
signals:
|
||||
void monitorClicked();
|
||||
void abortClicked();
|
||||
@@ -56,13 +58,12 @@ class DeckMon : public RDFrame
|
||||
private slots:
|
||||
void monitorButtonData();
|
||||
void abortButtonData();
|
||||
void eventResetData();
|
||||
|
||||
private:
|
||||
void SetCutInfo(int id,const QString &cutname);
|
||||
QLabel *mon_station_label;
|
||||
QLabel *mon_cut_label;
|
||||
QLabel *mon_event_label;
|
||||
EventLight *mon_event_light;
|
||||
QLabel *mon_status_label;
|
||||
QPushButton *mon_abort_button;
|
||||
QPushButton *mon_monitor_button;
|
||||
@@ -73,7 +74,9 @@ class DeckMon : public RDFrame
|
||||
unsigned mon_channel;
|
||||
QTimer *mon_event_timer;
|
||||
QPalette mon_red_palette;
|
||||
QString mon_red_stylesheet;
|
||||
QPalette mon_dark_palette;
|
||||
QString mon_dark_stylesheet;
|
||||
};
|
||||
|
||||
|
||||
|
74
rdcatch/eventlight.cpp
Normal file
74
rdcatch/eventlight.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
// eventlight.h
|
||||
//
|
||||
// Indicator light for cut events in rdcatch(1);
|
||||
//
|
||||
// (C) Copyright 2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include "eventlight.h"
|
||||
|
||||
EventLight::EventLight(QWidget *parent)
|
||||
: QLabel("--",parent)
|
||||
{
|
||||
setAlignment(Qt::AlignCenter);
|
||||
setFrameStyle(QFrame::Panel|QFrame::Sunken);
|
||||
|
||||
d_timer=new QTimer(this);
|
||||
d_timer->setSingleShot(true);
|
||||
connect(d_timer,SIGNAL(timeout()),this,SLOT(reset()));
|
||||
}
|
||||
|
||||
|
||||
QSize EventLight::sizeHint() const
|
||||
{
|
||||
return QSize(20,18);
|
||||
}
|
||||
|
||||
|
||||
QSizePolicy EventLight::sizePolicy() const
|
||||
{
|
||||
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
}
|
||||
|
||||
|
||||
void EventLight::trigger(int num)
|
||||
{
|
||||
setText(QString::asprintf("%d",num));
|
||||
setStyleSheet("color: "+palette().color(QPalette::HighlightedText).name()+";"+
|
||||
"background-color: "+
|
||||
palette().color(QPalette::Highlight).name()+";");
|
||||
d_timer->start(3000);
|
||||
}
|
||||
|
||||
|
||||
void EventLight::setEnabled(bool state)
|
||||
{
|
||||
QLabel::setEnabled(state);
|
||||
}
|
||||
|
||||
|
||||
void EventLight::setDisabled(bool state)
|
||||
{
|
||||
setText("--");
|
||||
setStyleSheet("");
|
||||
QLabel::setDisabled(state);
|
||||
}
|
||||
|
||||
|
||||
void EventLight::reset()
|
||||
{
|
||||
setStyleSheet("");
|
||||
}
|
48
rdcatch/eventlight.h
Normal file
48
rdcatch/eventlight.h
Normal file
@@ -0,0 +1,48 @@
|
||||
// eventlight.h
|
||||
//
|
||||
// Indicator light for cut events in rdcatch(1);
|
||||
//
|
||||
// (C) Copyright 2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef EVENTLIGHT_H
|
||||
#define EVENTLIGHT_H
|
||||
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
|
||||
class EventLight : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EventLight(QWidget *parent=0);
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
|
||||
public slots:
|
||||
void trigger(int num);
|
||||
void setEnabled(bool state);
|
||||
void setDisabled(bool state);
|
||||
|
||||
private slots:
|
||||
void reset();
|
||||
|
||||
private:
|
||||
QTimer *d_timer;
|
||||
};
|
||||
|
||||
|
||||
#endif // EVENTLIGHT_H
|
@@ -208,9 +208,11 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
connect(catch_connect.back()->connector(),
|
||||
SIGNAL(eventPurged(int)),
|
||||
this,SLOT(eventPurgedData(int)));
|
||||
/*
|
||||
connect(catch_connect.back()->connector(),
|
||||
SIGNAL(deckEventSent(int,int,int)),
|
||||
this,SLOT(deckEventSentData(int,int,int)));
|
||||
*/
|
||||
connect(catch_connect.back()->connector(),
|
||||
SIGNAL(heartbeatFailed(int)),
|
||||
this,SLOT(heartbeatFailedData(int)));
|
||||
@@ -230,11 +232,12 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
catch_connect.back()->chan.push_back(q1->value(0).toUInt());
|
||||
catch_connect.back()->mon_id.push_back(catch_monitor.size());
|
||||
|
||||
|
||||
DeckMon *mon=new DeckMon(q->value(0).toString(),q1->value(0).toUInt(),
|
||||
catch_monitor_vbox);
|
||||
connect(rda->ripc(),SIGNAL(catchEventReceived(RDCatchEvent *)),
|
||||
mon,SLOT(processCatchEvent(RDCatchEvent *)));
|
||||
catch_monitor.push_back(new CatchMonitor());
|
||||
catch_monitor.back()->setDeckMon(new DeckMon(q->value(0).toString(),
|
||||
q1->value(0).toUInt(),
|
||||
catch_monitor_vbox));
|
||||
catch_monitor.back()->setDeckMon(mon);
|
||||
catch_monitor.back()->setSerialNumber(catch_connect.size()-1);
|
||||
catch_monitor.back()->setChannelNumber(q1->value(0).toUInt());
|
||||
catch_monitor_vbox->addWidget(catch_monitor.back()->deckMon());
|
||||
@@ -771,7 +774,7 @@ void MainWidget::monitorChangedData(int serial,unsigned chan,bool state)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void MainWidget::deckEventSentData(int serial,int chan,int number)
|
||||
{
|
||||
int mon=GetMonitor(serial,chan);
|
||||
@@ -779,6 +782,13 @@ void MainWidget::deckEventSentData(int serial,int chan,int number)
|
||||
catch_monitor[mon]->deckMon()->setEvent(number);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void MainWidget::catchEventReceivedData(RDCatchEvent *evt)
|
||||
{
|
||||
printf("catchEventReceivedData()\n");
|
||||
printf("%s\n",evt->dump().toUtf8().constData());
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::scrollButtonData()
|
||||
|
@@ -82,7 +82,8 @@ class MainWidget : public RDMainWindow
|
||||
void statusChangedData(int,unsigned,RDDeck::Status,int,
|
||||
const QString &cutname);
|
||||
void monitorChangedData(int serial,unsigned chan,bool state);
|
||||
void deckEventSentData(int serial,int chan,int number);
|
||||
// void deckEventSentData(int serial,int chan,int number);
|
||||
void catchEventReceivedData(RDCatchEvent *evt);
|
||||
void scrollButtonData();
|
||||
void reportsButtonData();
|
||||
void headButtonData();
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# The QMake project file for RDCatch.
|
||||
#
|
||||
# (C) Copyright 2003-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
# (C) Copyright 2003-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
@@ -30,6 +30,7 @@ x11 {
|
||||
SOURCES += edit_switchevent.cpp
|
||||
SOURCES += edit_download.cpp
|
||||
SOURCES += edit_upload.cpp
|
||||
SOURCES += eventlight.cpp
|
||||
SOURCES += eventwidget.cpp
|
||||
SOURCES += rdcatch.cpp
|
||||
SOURCES += list_reports.cpp
|
||||
@@ -47,6 +48,7 @@ x11 {
|
||||
HEADERS += edit_switchevent.h
|
||||
HEADERS += edit_download.h
|
||||
HEADERS += edit_upload.h
|
||||
HEADERS += eventlight.h
|
||||
HEADERS += eventwidget.h
|
||||
HEADERS += rdcatch.h
|
||||
HEADERS += list_reports.h
|
||||
|
Reference in New Issue
Block a user