2020-10-07 Fred Gleason <fredg@paravelsystems.com>

* Added a 'SERVICES.SUB_EVENT_INHERITANCE' field to the
	database.
	* Incremented the database version to 339.
	* Added 'RDSvc::subEventInheritance()' and
	'RDSvc::setSubEventInheritance()' methods.
	* Added an 'Inline Traffic Inheritance' control to the 'Edit Service'
	dialog in rdadmin(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2020-10-07 14:01:11 -04:00
parent 92a019aebb
commit 2e60ea8f0b
17 changed files with 185 additions and 37 deletions

View File

@ -20400,3 +20400,11 @@
in rddbmgr(8).
2020-10-07 Patrick Linstruth <patrick@deltecent.com>
* Added '--scheduler-code=' switch to rdexport(1).
2020-10-07 Fred Gleason <fredg@paravelsystems.com>
* Added a 'SERVICES.SUB_EVENT_INHERITANCE' field to the
database.
* Incremented the database version to 339.
* Added 'RDSvc::subEventInheritance()' and
'RDSvc::setSubEventInheritance()' methods.
* Added an 'Inline Traffic Inheritance' control to the 'Edit Service'
dialog in rdadmin(1).

View File

@ -12,6 +12,8 @@ NAME_TEMPLATE varchar(191)
DESCRIPTION_TEMPLATE varchar(191)
PROGRAM_CODE varchar(191)
CHAIN_LOG enum('N','Y')
SUB_EVENT_INHERITANCE int(11) 0=Inherit from parent event,
1=Inherit from scheduler file
TRACK_GROUP varchar(10) From GROUPS.NAME
AUTOSPOT_GROUP varchar(10) From GROUPS.NAME
AUTO_REFRESH enum('N','Y')

View File

@ -24,7 +24,7 @@
/*
* Current Database Version
*/
#define RD_VERSION_DATABASE 338
#define RD_VERSION_DATABASE 339
#endif // DBVERSION_H

View File

@ -207,6 +207,19 @@ void RDSvc::setChainto(bool state) const
}
RDSvc::SubEventInheritance RDSvc::subEventInheritance() const
{
return (RDSvc::SubEventInheritance)
RDGetSqlValue("SERVICES","NAME",svc_name,"SUB_EVENT_INHERITANCE").toInt();
}
void RDSvc::setSubEventInheritance(RDSvc::SubEventInheritance inherit) const
{
SetRow("SUB_EVENT_INHERITANCE",inherit);
}
QString RDSvc::importTemplate(ImportSource src) const
{
QString fieldname=SourceString(src)+"IMPORT_TEMPLATE";

View File

@ -40,6 +40,7 @@ class RDSvc : public QObject
Title=6,StartHours=7,StartMinutes=8,StartSeconds=9,
LengthHours=10,LengthMinutes=11,LengthSeconds=12};
enum ShelflifeOrigin {OriginAirDate=0,OriginCreationDate=1};
enum SubEventInheritance {ParentEvent=0,SchedFile=1};
RDSvc(QString svcname,RDStation *station,RDConfig *config,QObject *parent=0);
QString name() const;
bool exists() const;
@ -67,6 +68,8 @@ class RDSvc : public QObject
void setIncludeImportMarkers(bool state);
bool chainto() const;
void setChainto(bool state) const;
SubEventInheritance subEventInheritance() const;
void setSubEventInheritance(SubEventInheritance inherit) const;
QString importTemplate(ImportSource src) const;
void setImportTemplate(ImportSource src,const QString &str) const;
QString breakString() const;

View File

@ -145,23 +145,37 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
label->setGeometry(10,157,170,19);
label->setAlignment(Qt::AlignRight);
//
// Inline Event Inheritance Log
//
svc_sub_event_inheritance_box=new QComboBox(this);
svc_sub_event_inheritance_box->setGeometry(185,178,240,19);
svc_sub_event_inheritance_box->
insertItem((int)RDSvc::ParentEvent,tr("From Parent RDLogManager Event"));
svc_sub_event_inheritance_box->
insertItem((int)RDSvc::SchedFile,tr("From Music Scheduler File"));
label=new QLabel(svc_sub_event_inheritance_box,
tr("Inline Traffic Inheritance")+":",this);
label->setGeometry(10,178,170,19);
label->setAlignment(Qt::AlignRight);
//
// Chain Log
//
svc_chain_box=new QCheckBox(this);
svc_chain_box->setGeometry(30,180,15,15);
svc_chain_box->setGeometry(30,201,15,15);
label=new QLabel(svc_chain_box,tr("Insert CHAIN TO at log end"),this);
label->setGeometry(50,180,170,19);
label->setGeometry(50,201,170,19);
label->setAlignment(Qt::AlignLeft);
//
// Default Auto Refresh
//
svc_autorefresh_box=new QCheckBox(this);
svc_autorefresh_box->setGeometry(230,180,15,15);
svc_autorefresh_box->setGeometry(230,201,15,15);
label=
new QLabel(svc_autorefresh_box,tr("Enable AutoRefresh By Default"),this);
label->setGeometry(250,180,200,19);
label->setGeometry(250,201,200,19);
label->setAlignment(Qt::AlignLeft);
//
@ -239,7 +253,7 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Traffic Import Section
//
label=new QLabel(tr("Traffic Data Import"),this);
label->setGeometry(10,213,160,24);
label->setGeometry(10,231,160,24);
label->setFont(sectionLabelFont());
label->setAlignment(Qt::AlignLeft);
@ -247,11 +261,11 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Linux Traffic Import Path
//
svc_tfc_path_edit=new QLineEdit(this);
svc_tfc_path_edit->setGeometry(185,234,240,19);
svc_tfc_path_edit->setGeometry(185,255,240,19);
svc_tfc_path_edit->setMaxLength(255);
svc_tfc_path_edit->setValidator(validator);
label=new QLabel(svc_tfc_path_edit,tr("Import Path:"),this);
label->setGeometry(10,234,170,19);
label->setGeometry(10,255,170,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_tfc_path_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -260,11 +274,11 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Linux Traffic Preimport Command
//
svc_tfc_preimport_cmd_edit=new QLineEdit(this);
svc_tfc_preimport_cmd_edit->setGeometry(185,255,240,19);
svc_tfc_preimport_cmd_edit->setGeometry(185,276,240,19);
svc_tfc_preimport_cmd_edit->setValidator(validator);
label=
new QLabel(svc_tfc_preimport_cmd_edit,tr("Preimport Command:"),this);
label->setGeometry(10,255,170,19);
label->setGeometry(10,276,170,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_tfc_preimport_cmd_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -273,10 +287,10 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Note Cart
//
svc_tfc_label_cart_edit=new QLineEdit(this);
svc_tfc_label_cart_edit->setGeometry(185,276,240,19);
svc_tfc_label_cart_edit->setGeometry(185,297,240,19);
svc_tfc_label_cart_edit->setMaxLength(32);
label=new QLabel(svc_tfc_label_cart_edit,tr("Note Cart String:"),this);
label->setGeometry(10,276,170,19);
label->setGeometry(10,297,170,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_tfc_label_cart_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -285,10 +299,10 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Track String
//
svc_tfc_track_edit=new QLineEdit(this);
svc_tfc_track_edit->setGeometry(185,297,240,19);
svc_tfc_track_edit->setGeometry(185,318,240,19);
svc_tfc_track_edit->setMaxLength(32);
label=new QLabel(svc_tfc_track_edit,tr("Insert Voice Track String:"),this);
label->setGeometry(10,297,170,19);
label->setGeometry(10,318,170,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_tfc_track_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -297,9 +311,9 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Traffic Import Template
//
svc_tfc_import_template_box=new QComboBox(this);
svc_tfc_import_template_box->setGeometry(185,318,240,19);
svc_tfc_import_template_box->setGeometry(185,339,240,19);
label=new QLabel(svc_tfc_import_template_box,tr("Import Template:"),this);
label->setGeometry(10,318,170,19);
label->setGeometry(10,339,170,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_tfc_import_template_box,SIGNAL(activated(int)),
this,SLOT(tfcTemplateActivatedData(int)));
@ -308,14 +322,14 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Traffic Parser Settings
//
svc_tfc_fields=new ImportFields(this);
svc_tfc_fields->setGeometry(10,339,svc_tfc_fields->sizeHint().width(),
svc_tfc_fields->setGeometry(10,360,svc_tfc_fields->sizeHint().width(),
svc_tfc_fields->sizeHint().height());
//
// Traffic Test Button
//
button=new QPushButton(this);
button->setGeometry(360,339,60,40);
button->setGeometry(360,360,60,40);
button->setFont(buttonFont());
button->setText(tr("Test \n&Traffic"));
connect(button,SIGNAL(clicked()),this,SLOT(trafficData()));
@ -324,7 +338,7 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Traffic Copy Button
//
svc_tfc_copy_button=new QPushButton(this);
svc_tfc_copy_button->setGeometry(360,389,60,40);
svc_tfc_copy_button->setGeometry(360,410,60,40);
svc_tfc_copy_button->setFont(buttonFont());
svc_tfc_copy_button->setText(tr("Copy To\nCustom"));
connect(svc_tfc_copy_button,SIGNAL(clicked()),this,SLOT(trafficCopyData()));
@ -333,7 +347,7 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Music Import Section
//
label=new QLabel(tr("Music Data Import"),this);
label->setGeometry(445,213,160,24);
label->setGeometry(445,234,160,24);
label->setFont(sectionLabelFont());
label->setAlignment(Qt::AlignLeft);
@ -341,11 +355,11 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Linux Music Import Path
//
svc_mus_path_edit=new QLineEdit(this);
svc_mus_path_edit->setGeometry(620,234,240,19);
svc_mus_path_edit->setGeometry(620,255,240,19);
svc_mus_path_edit->setMaxLength(255);
svc_mus_path_edit->setValidator(validator);
label=new QLabel(svc_mus_path_edit,tr("Import Path:"),this);
label->setGeometry(450,234,165,19);
label->setGeometry(450,255,165,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_mus_path_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -354,11 +368,11 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Linux Music Preimport Command
//
svc_mus_preimport_cmd_edit=new QLineEdit(this);
svc_mus_preimport_cmd_edit->setGeometry(620,255,240,19);
svc_mus_preimport_cmd_edit->setGeometry(620,276,240,19);
svc_mus_preimport_cmd_edit->setValidator(validator);
label=
new QLabel(svc_mus_preimport_cmd_edit,tr("Preimport Command:"),this);
label->setGeometry(450,255,165,19);
label->setGeometry(450,276,165,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_mus_preimport_cmd_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -367,10 +381,10 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Label Cart
//
svc_mus_label_cart_edit=new QLineEdit(this);
svc_mus_label_cart_edit->setGeometry(620,276,240,19);
svc_mus_label_cart_edit->setGeometry(620,297,240,19);
svc_mus_label_cart_edit->setMaxLength(32);
label=new QLabel(svc_mus_label_cart_edit,tr("Note Cart String:"),this);
label->setGeometry(450,276,165,19);
label->setGeometry(450,297,165,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_mus_label_cart_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -379,10 +393,10 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Insert Voice Track String
//
svc_mus_track_edit=new QLineEdit(this);
svc_mus_track_edit->setGeometry(620,297,240,19);
svc_mus_track_edit->setGeometry(620,318,240,19);
svc_mus_track_edit->setMaxLength(255);
label=new QLabel(svc_mus_track_edit,tr("Insert Voice Track String:"),this);
label->setGeometry(450,297,165,19);
label->setGeometry(450,318,165,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_mus_track_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -391,10 +405,10 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Insert Spot Break String
//
svc_mus_break_edit=new QLineEdit(this);
svc_mus_break_edit->setGeometry(620,318,240,19);
svc_mus_break_edit->setGeometry(620,339,240,19);
svc_mus_break_edit->setMaxLength(255);
label=new QLabel(svc_mus_break_edit,tr("Insert Traffic Break String:"),this);
label->setGeometry(450,318,165,19);
label->setGeometry(450,339,165,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_mus_break_edit,SIGNAL(textChanged(const QString &)),
this,SLOT(textChangedData(const QString &)));
@ -403,9 +417,9 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Music Import Template
//
svc_mus_import_template_box=new QComboBox(this);
svc_mus_import_template_box->setGeometry(620,339,240,19);
svc_mus_import_template_box->setGeometry(620,360,240,19);
label=new QLabel(svc_mus_import_template_box,tr("Import Template:"),this);
label->setGeometry(450,339,165,19);
label->setGeometry(450,360,165,19);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
connect(svc_mus_import_template_box,SIGNAL(activated(int)),
this,SLOT(musTemplateActivatedData(int)));
@ -414,14 +428,14 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Music Parser Settings
//
svc_mus_fields=new ImportFields(this);
svc_mus_fields->setGeometry(445,360,svc_mus_fields->sizeHint().width(),
svc_mus_fields->setGeometry(445,381,svc_mus_fields->sizeHint().width(),
svc_mus_fields->sizeHint().height());
//
// Music Test Button
//
button=new QPushButton(this);
button->setGeometry(795,360,60,40);
button->setGeometry(795,381,60,40);
button->setFont(buttonFont());
button->setText(tr("Test \n&Music"));
connect(button,SIGNAL(clicked()),this,SLOT(musicData()));
@ -430,7 +444,7 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
// Music Copy Button
//
svc_mus_copy_button=new QPushButton(this);
svc_mus_copy_button->setGeometry(795,410,60,40);
svc_mus_copy_button->setGeometry(795,431,60,40);
svc_mus_copy_button->setFont(buttonFont());
svc_mus_copy_button->setText(tr("Copy To\nCustom"));
connect(svc_mus_copy_button,SIGNAL(clicked()),this,SLOT(musicCopyData()));
@ -482,6 +496,8 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
svc_program_code_edit->setText(svc_svc->programCode());
svc_name_template_edit->setText(svc_svc->nameTemplate());
svc_description_template_edit->setText(svc_svc->descriptionTemplate());
svc_sub_event_inheritance_box->
setCurrentIndex((RDSvc::SubEventInheritance)svc_svc->subEventInheritance());
svc_chain_box->setChecked(svc_svc->chainto());
svc_autorefresh_box->setChecked(svc_svc->autoRefresh());
if(svc_svc->defaultLogShelflife()>=0) {
@ -548,7 +564,7 @@ EditSvc::~EditSvc()
QSize EditSvc::sizeHint() const
{
return QSize(870,670);
return QSize(870,691);
}
@ -726,6 +742,8 @@ void EditSvc::Save()
svc_svc->setProgramCode(svc_program_code_edit->text());
svc_svc->setNameTemplate(svc_name_template_edit->text().stripWhiteSpace());
svc_svc->setDescriptionTemplate(svc_description_template_edit->text());
svc_svc-> setSubEventInheritance((RDSvc::SubEventInheritance)
svc_sub_event_inheritance_box->currentIndex());
svc_svc->setChainto(svc_chain_box->isChecked());
svc_svc->setAutoRefresh(svc_autorefresh_box->isChecked());
if(svc_loglife_box->isChecked()) {

View File

@ -78,6 +78,7 @@ class EditSvc : public RDDialog
QLineEdit *svc_mus_label_cart_edit;
QLineEdit *svc_mus_break_edit;
QLineEdit *svc_mus_track_edit;
QComboBox *svc_sub_event_inheritance_box;
QCheckBox *svc_chain_box;
QCheckBox *svc_autorefresh_box;
QCheckBox *svc_loglife_box;

View File

@ -4345,6 +4345,18 @@ Custom</source>
<source>This action will overwrite your existing [custom] Music Data Import settings. Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inline Traffic Inheritance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Parent RDLogManager Event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Music Scheduler File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSvcPerms</name>

View File

@ -4154,6 +4154,18 @@ Custom</source>
<source>This action will overwrite your existing [custom] Music Data Import settings. Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inline Traffic Inheritance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Parent RDLogManager Event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Music Scheduler File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSvcPerms</name>

View File

@ -4298,6 +4298,18 @@ Custom</source>
<source>This action will overwrite your existing [custom] Music Data Import settings. Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inline Traffic Inheritance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Parent RDLogManager Event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Music Scheduler File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSvcPerms</name>

View File

@ -3440,6 +3440,18 @@ Custom</source>
<source>This action will overwrite your existing [custom] Music Data Import settings. Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inline Traffic Inheritance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Parent RDLogManager Event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Music Scheduler File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSvcPerms</name>

View File

@ -4059,6 +4059,18 @@ Custom</source>
<source>This action will overwrite your existing [custom] Music Data Import settings. Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inline Traffic Inheritance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Parent RDLogManager Event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Music Scheduler File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSvcPerms</name>

View File

@ -4059,6 +4059,18 @@ Custom</source>
<source>This action will overwrite your existing [custom] Music Data Import settings. Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inline Traffic Inheritance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Parent RDLogManager Event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Music Scheduler File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSvcPerms</name>

View File

@ -4138,6 +4138,18 @@ Custom</source>
<source>This action will overwrite your existing [custom] Music Data Import settings. Continue?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Inline Traffic Inheritance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Parent RDLogManager Event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>From Music Scheduler File</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditSvcPerms</name>

View File

@ -40,6 +40,14 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
// NEW SCHEMA REVERSIONS GO HERE...
//
// Revert 339
//
if((cur_schema==339)&&(set_schema<cur_schema)) {
DropColumn("SERVICES","SUB_EVENT_INHERITANCE");
WriteSchemaVersion(--cur_schema);
}
//
// Revert 338
//

View File

@ -161,7 +161,7 @@ void MainObject::InitializeSchemaMap() {
global_version_map["3.2"]=311;
global_version_map["3.3"]=314;
global_version_map["3.4"]=317;
global_version_map["3.5"]=338;
global_version_map["3.5"]=339;
}

View File

@ -10297,6 +10297,17 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
WriteSchemaVersion(++cur_schema);
}
if((cur_schema<339)&&(set_schema>cur_schema)) {
sql=QString("alter table SERVICES ")+
"add column SUB_EVENT_INHERITANCE int not null default 0 "+
"after CHAIN_LOG";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
WriteSchemaVersion(++cur_schema);
}
// NEW SCHEMA UPDATES GO HERE...