2021-08-31 Fred Gleason <fredg@paravelsystems.com>

* Added a 'SERVICES.INCLUDE_MUS_IMPORT_MARKERS' field to the database.
	* Added a 'SERVICES.INCLUDE_TFC_IMPORT_MARKERS' field to the database.
	* Added a 'LOGS.INCLUDE_MUS_IMPORT_MARKERS' field to the database.
	* Added a 'LOGS.INCLUDE_TFC_IMPORT_MARKERS' field to the database.
	* Incremented the database version to 354.
	* Replaced the 'Include Import Marker in Finished Logs' checkbox
	with 'Include Music Import Markers in Finished Logs' and
	'Include Traffic Import Markers in Finished Logs' checkboxes in
	the 'Edit Service' dialog in rdadmin(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-08-31 13:24:57 -04:00
parent fc61172a55
commit e30fe2b0b7
21 changed files with 304 additions and 137 deletions

View File

@ -22344,3 +22344,13 @@
* Fixed a bug in rdlogmanager(1) that would cause a segfault when
a cart was dropped in a Pre- or Post-Import list beneath the
'--End of List--' marker.
2021-08-31 Fred Gleason <fredg@paravelsystems.com>
* Added a 'SERVICES.INCLUDE_MUS_IMPORT_MARKERS' field to the database.
* Added a 'SERVICES.INCLUDE_TFC_IMPORT_MARKERS' field to the database.
* Added a 'LOGS.INCLUDE_MUS_IMPORT_MARKERS' field to the database.
* Added a 'LOGS.INCLUDE_TFC_IMPORT_MARKERS' field to the database.
* Incremented the database version to 354.
* Replaced the 'Include Import Marker in Finished Logs' checkbox
with 'Include Music Import Markers in Finished Logs' and
'Include Traffic Import Markers in Finished Logs' checkboxes in
the 'Edit Service' dialog in rdadmin(1).

View File

@ -4,5 +4,5 @@
00:09:14 10004 Atchafalaya 00:28:02 GUID4567890123456789012345678904
00:30:00 BREAK Spot Break 00:02:00
00:32:00 10005 Mr. Banks 00:03:54 GUID4567890123456789012345678905
00:35:54 VOICETRACK 00:01:30
00:35:54 TRACK Voicetrack 00:01:30
00:38:24 10006 The Grey and the Green 00:03:23 GUID4567890123456789012345678906

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -392,16 +392,17 @@
of days after being generated.
</para>
<para>
The <computeroutput>Include Import Markers in Finished Logs</computeroutput>
box, if ticked, will cause markers to indicate the base location
of imported Music and Traffic events to be retained even after
such events have been imported. Some users find these markers
The <computeroutput>Include Music Import Markers in Finished Logs</computeroutput> and
<computeroutput>Include Traffic Import Markers in Finished Logs</computeroutput>
boxes, if ticked, will cause markers to indicate the base location
of imported Music and Traffic events respectively to be retained even
after such events have been imported. Some users find these markers
distracting, so their retention can be disabled by clearing this
check box.
</para>
<warning>
If import markers are not included in finished logs, then it will
not be possible re-import music or traffic data into those logs.
not be possible re-import data of the respective type into those logs.
</warning>
<sect3 xml:id="sect.rdadmin.manage_services.general.inline_event_scheduling_parameters">

5
docs/tables/DEAD.txt Normal file
View File

@ -0,0 +1,5 @@
This note lists DB fields that are currently unused and may be removed
in future.
LOGS.INCLUDE_IMPORT_MARKERS
SERVICES.INCLUDE_IMPORT_MARKERS

View File

@ -34,6 +34,7 @@ EXTRA_DIST = audio_cards.txt\
clocks.txt\
cut_events.txt\
cuts.txt\
DEAD.txt\
deck_events.txt\
decks.txt\
dropboxes.txt\

View File

@ -22,6 +22,8 @@ IMPORT_DATE date
SCHEDULED_TRACKS int unsigned(10)
COMPLETED_TRACKS int unsigned(10)
INCLUDE_IMPORT_MARKERS enum('N','Y')
INCLUDE_MUS_IMPORT_MARKERS enum('N','Y')
INCLUDE_TFC_IMPORT_MARKERS enum('N','Y')
MUSIC_LINKS int
MUSIC_LINKED enum('N','Y')
TRAFFIC_LINKS int

View File

@ -20,7 +20,8 @@ AUTO_REFRESH enum('N','Y')
DEFAULT_LOG_SHELFLIFE int(11)
LOG_SHELFLIFE_ORIGIN int(11) 0=Air Date, 1=Log Creation
ELR_SHELFLIFE int(11)
INCLUDE_IMPORT_MARKERS enum('N','Y')
INCLUDE_MUS_IMPORT_MARKERS enum('N','Y')
INCLUDE_TFC_IMPORT_MARKERS enum('N','Y')
TFC_PATH varchar(191)
TFC_PREIMPORT_CMD text
TFC_WIN_PATH varchar(191)

View File

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

View File

@ -922,6 +922,7 @@ bool RDEventLine::linkLog(RDLogModel *e,RDLog *log,const QString &svcname,
QString sql;
RDSqlQuery *q;
RDLogLine *logline=NULL;
RDLog::Source log_src;
//
// Initial Import Parameters
@ -930,10 +931,12 @@ bool RDEventLine::linkLog(RDLogModel *e,RDLog *log,const QString &svcname,
switch(event_import_source) {
case RDEventLine::Music:
event_src=RDLogLine::Music;
log_src=RDLog::SourceMusic;
break;
case RDEventLine::Traffic:
event_src=RDLogLine::Traffic;
log_src=RDLog::SourceTraffic;
break;
case RDEventLine::Scheduler:
@ -948,7 +951,7 @@ bool RDEventLine::linkLog(RDLogModel *e,RDLog *log,const QString &svcname,
//
// Insert Parent Link
//
if(log->includeImportMarkers()) {
if(log->includeImportMarkers(log_src)) {
e->insert(e->lineCount(),1);
logline=new RDLogLine();
*logline=*link_logline;

View File

@ -232,15 +232,23 @@ void RDLog::setCompletedTracks(unsigned tracks) const
}
bool RDLog::includeImportMarkers() const
bool RDLog::includeImportMarkers(RDLog::Source src) const
{
return RDBool(GetStringValue("INCLUDE_IMPORT_MARKERS"));
if(src==RDLog::SourceMusic) {
return RDBool(GetStringValue("INCLUDE_MUS_IMPORT_MARKERS"));
}
return RDBool(GetStringValue("INCLUDE_TFC_IMPORT_MARKERS"));
}
void RDLog::setIncludeImportMarkers(bool state)
void RDLog::setIncludeImportMarkers(RDLog::Source src,bool state)
{
SetRow("INCLUDE_IMPORT_MARKERS",RDYesNo(state));
if(src==RDLog::SourceMusic) {
SetRow("INCLUDE_MUS_IMPORT_MARKERS",RDYesNo(state));
}
else {
SetRow("INCLUDE_TFC_IMPORT_MARKERS",RDYesNo(state));
}
}

View File

@ -63,8 +63,8 @@ class RDLog
void setScheduledTracks(unsigned tracks) const;
unsigned completedTracks() const;
void setCompletedTracks(unsigned tracks) const;
bool includeImportMarkers() const;
void setIncludeImportMarkers(bool state);
bool includeImportMarkers(Source src) const;
void setIncludeImportMarkers(Source src,bool state);
int linkQuantity(RDLog::Source src) const;
void setLinkQuantity(RDLog::Source src,int quan) const;
void updateLinkQuantity(RDLog::Source src) const;

View File

@ -182,19 +182,28 @@ void RDSvc::setElrShelflife(int days) const
}
bool RDSvc::includeImportMarkers() const
bool RDSvc::includeImportMarkers(RDSvc::ImportSource src) const
{
if(src==RDSvc::Music) {
return
RDBool(RDGetSqlValue("SERVICES","NAME",svc_name,"INCLUDE_IMPORT_MARKERS").
toString());
RDBool(RDGetSqlValue("SERVICES","NAME",svc_name,
"INCLUDE_MUS_IMPORT_MARKERS").toString());
}
return
RDBool(RDGetSqlValue("SERVICES","NAME",svc_name,
"INCLUDE_TFC_IMPORT_MARKERS").toString());
}
void RDSvc::setIncludeImportMarkers(bool state)
void RDSvc::setIncludeImportMarkers(RDSvc::ImportSource src,bool state)
{
SetRow("INCLUDE_IMPORT_MARKERS",RDYesNo(state));
if(src==RDSvc::Music) {
SetRow("INCLUDE_MUS_IMPORT_MARKERS",RDYesNo(state));
}
else {
SetRow("INCLUDE_TFC_IMPORT_MARKERS",RDYesNo(state));
}
}
bool RDSvc::chainto() const
{
@ -847,7 +856,10 @@ bool RDSvc::generateLog(const QDate &date,const QString &logname,
log=new RDLog(logname);
log->setDescription(RDDateDecode(descriptionTemplate(),date,svc_station,
svc_config,svc_name));
log->setIncludeImportMarkers(includeImportMarkers());
log->setIncludeImportMarkers(RDLog::SourceMusic,
includeImportMarkers(RDSvc::Music));
log->setIncludeImportMarkers(RDLog::SourceTraffic,
includeImportMarkers(RDSvc::Traffic));
emit generationProgress(1);
qApp->processEvents();

View File

@ -64,8 +64,8 @@ class RDSvc : public QObject
void setLogShelflifeOrigin(ShelflifeOrigin orig);
int elrShelflife() const;
void setElrShelflife(int days) const;
bool includeImportMarkers() const;
void setIncludeImportMarkers(bool state);
bool includeImportMarkers(ImportSource src) const;
void setIncludeImportMarkers(ImportSource src,bool state);
bool chainto() const;
void setChainto(bool state) const;
SubEventInheritance subEventInheritance() const;

View File

@ -229,14 +229,23 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
label->setAlignment(Qt::AlignLeft);
//
// Include Import Markers by Default
// Include Music Import Markers by Default
//
svc_import_markers_check=new QCheckBox(this);
svc_import_markers_check->setGeometry(460,140,15,15);
label=new QLabel(tr("Include Import Markers in Finished Logs"),this);
svc_mus_import_markers_check=new QCheckBox(this);
svc_mus_import_markers_check->setGeometry(460,140,15,15);
label=new QLabel(tr("Include Music Import Markers in Finished Logs"),this);
label->setGeometry(480,140,sizeHint().width()-490,19);
label->setAlignment(Qt::AlignLeft);
//
// Include Traffic Import Markers by Default
//
svc_tfc_import_markers_check=new QCheckBox(this);
svc_tfc_import_markers_check->setGeometry(460,163,15,15);
label=new QLabel(tr("Include Traffic Import Markers in Finished Logs"),this);
label->setGeometry(480,163,sizeHint().width()-490,19);
label->setAlignment(Qt::AlignLeft);
//
// Enable Hosts Button
//
@ -516,7 +525,10 @@ EditSvc::EditSvc(QString svc,QWidget *parent)
else {
svc_shelflife_spin->setDisabled(true);
}
svc_import_markers_check->setChecked(svc_svc->includeImportMarkers());
svc_mus_import_markers_check->
setChecked(svc_svc->includeImportMarkers(RDSvc::Music));
svc_tfc_import_markers_check->
setChecked(svc_svc->includeImportMarkers(RDSvc::Traffic));
svc_tfc_path_edit->setText(svc_svc->importPath(RDSvc::Traffic));
svc_tfc_preimport_cmd_edit->
setText(svc_svc->preimportCommand(RDSvc::Traffic));
@ -760,7 +772,10 @@ void EditSvc::Save()
else {
svc_svc->setElrShelflife(-1);
}
svc_svc->setIncludeImportMarkers(svc_import_markers_check->isChecked());
svc_svc->setIncludeImportMarkers(RDSvc::Music,
svc_mus_import_markers_check->isChecked());
svc_svc->setIncludeImportMarkers(RDSvc::Traffic,
svc_tfc_import_markers_check->isChecked());
svc_svc->setImportPath(RDSvc::Traffic,svc_tfc_path_edit->text());
svc_svc->
setPreimportCommand(RDSvc::Traffic,svc_tfc_preimport_cmd_edit->text());

View File

@ -87,7 +87,8 @@ class EditSvc : public RDDialog
QComboBox *svc_loglifeorigin_box;
QCheckBox *svc_shelflife_box;
QSpinBox *svc_shelflife_spin;
QCheckBox *svc_import_markers_check;
QCheckBox *svc_mus_import_markers_check;
QCheckBox *svc_tfc_import_markers_check;
QPushButton *svc_tfc_copy_button;
QPushButton *svc_mus_copy_button;
bool import_changed;

View File

@ -365,7 +365,7 @@ void GenerateLog::musicData()
RDLog *log=new RDLog(logname);
if(((log->linkState(RDLog::SourceMusic)==RDLog::LinkDone)||
(log->linkState(RDLog::SourceTraffic)==RDLog::LinkDone))) {
if(log->includeImportMarkers()) {
if(log->includeImportMarkers(RDLog::SourceMusic)) {
if(QMessageBox::question(this,"RDLogManager - "+tr("Music Exists"),
tr("The log for")+" "+
rda->shortDateString(gen_date_edit->date())+" "+
@ -446,7 +446,7 @@ void GenerateLog::trafficData()
rda->station(),rda->config(),svc->name());
RDLog *log=new RDLog(logname);
if((log->linkState(RDLog::SourceTraffic)==RDLog::LinkDone)) {
if(log->includeImportMarkers()) {
if(log->includeImportMarkers(RDLog::SourceTraffic)) {
if(QMessageBox::question(this,"RDLogManager - "+tr("Traffic Exists"),
tr("The log for")+" "+
rda->shortDateString(gen_date_edit->date())+" "+
@ -508,9 +508,9 @@ void GenerateLog::fileScanData()
if(gen_music_enabled) {
if(QFile::exists(svc->
importFilename(RDSvc::Music,gen_date_edit->date()))) {
gen_music_button->setEnabled(log->includeImportMarkers()||
(log->linkState(RDLog::SourceMusic)==
RDLog::LinkMissing));
gen_music_button->
setEnabled(log->includeImportMarkers(RDLog::SourceMusic)||
(log->linkState(RDLog::SourceMusic)==RDLog::LinkMissing));
gen_mus_avail_label->
setPixmap(rda->iconEngine()->listIcon(RDIconEngine::GreenBall));
}
@ -530,7 +530,7 @@ void GenerateLog::fileScanData()
gen_traffic_button->
setEnabled(((!gen_music_enabled)||
(log->linkState(RDLog::SourceMusic)==RDLog::LinkDone))&&
(log->includeImportMarkers()||
(log->includeImportMarkers(RDLog::SourceTraffic)||
(log->linkState(RDLog::SourceTraffic)==
RDLog::LinkMissing)));
gen_tfc_avail_label->

View File

@ -132,7 +132,7 @@ void LogObject::userData()
log->name().toUtf8().constData());
exit(RDApplication::ExitLogLinkFailed);
}
if((!log->includeImportMarkers())&&
if((!log->includeImportMarkers(RDLog::SourceMusic))&&
(log->linkState(RDLog::SourceMusic)!=RDLog::LinkMissing)) {
fprintf(stderr,
"rdlogmanager: music for log \"%s\" cannot be reimported\n",
@ -178,7 +178,7 @@ void LogObject::userData()
(const char *)log->name().toUtf8());
exit(RDApplication::ExitLogLinkFailed);
}
if((!log->includeImportMarkers())&&
if((!log->includeImportMarkers(RDLog::SourceTraffic))&&
(log->linkState(RDLog::SourceTraffic)!=RDLog::LinkMissing)) {
fprintf(stderr,
"rdlogmanager: traffic for log \"%s\" cannot be reimported\n",

View File

@ -18,6 +18,7 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <rdconf.h>
#include <rddb.h>
#include <rdescape_string.h>
@ -40,6 +41,53 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
// NEW SCHEMA REVERSIONS GO HERE...
//
// Revert 354
//
if((cur_schema==354)&&(set_schema<cur_schema)) {
sql=QString("select ")+
"`NAME`,"+ // 00
"`INCLUDE_MUS_IMPORT_MARKERS`,"+ // 01
"`INCLUDE_TFC_IMPORT_MARKERS` "+ // 02
"from `SERVICES`";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString("update `SERVICES` set ")+
"`INCLUDE_IMPORT_MARKERS`='"+
RDYesNo((q->value(1).toString()=="Y")||(q->value(2).toString()=="Y"))+
"' where "+
"`NAME`='"+RDEscapeString(q->value(0).toString())+"'";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
}
delete q;
DropColumn("SERVICES","INCLUDE_MUS_IMPORT_MARKERS");
DropColumn("SERVICES","INCLUDE_TFC_IMPORT_MARKERS");
sql=QString("select ")+
"`NAME`,"+ // 00
"`INCLUDE_MUS_IMPORT_MARKERS`,"+ // 01
"`INCLUDE_TFC_IMPORT_MARKERS` "+ // 02
"from `LOGS`";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString("update `LOGS` set ")+
"`INCLUDE_IMPORT_MARKERS`='"+
RDYesNo((q->value(1).toString()=="Y")||(q->value(2).toString()=="Y"))+
"' where "+
"`NAME`='"+RDEscapeString(q->value(0).toString())+"'";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
}
delete q;
DropColumn("LOGS","INCLUDE_MUS_IMPORT_MARKERS");
DropColumn("LOGS","INCLUDE_TFC_IMPORT_MARKERS");
WriteSchemaVersion(--cur_schema);
}
//
// Revert 353
//

View File

@ -160,7 +160,7 @@ void MainObject::InitializeSchemaMap() {
global_version_map["3.4"]=317;
global_version_map["3.5"]=346;
global_version_map["3.6"]=347;
global_version_map["4.0"]=353;
global_version_map["4.0"]=354;
}

View File

@ -10889,6 +10889,66 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
WriteSchemaVersion(++cur_schema);
}
if((cur_schema<354)&&(set_schema>cur_schema)) {
sql=QString("alter table `SERVICES` ")+
"add column `INCLUDE_MUS_IMPORT_MARKERS` enum('N','Y') default 'Y' "+
"after `INCLUDE_IMPORT_MARKERS`";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("alter table `SERVICES` ")+
"add column `INCLUDE_TFC_IMPORT_MARKERS` enum('N','Y') default 'Y' "+
"after `INCLUDE_MUS_IMPORT_MARKERS`";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("select ")+
"`NAME`, "+ // 00
"`INCLUDE_IMPORT_MARKERS` "+ // 01
"from `SERVICES`";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString("update `SERVICES` set ")+
"`INCLUDE_MUS_IMPORT_MARKERS`='"+q->value(1).toString()+"',"+
"`INCLUDE_TFC_IMPORT_MARKERS`='"+q->value(1).toString()+"' "+
"where `NAME`='"+RDEscapeString(q->value(0).toString())+"'";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
}
delete q;
sql=QString("alter table `LOGS` ")+
"add column `INCLUDE_MUS_IMPORT_MARKERS` enum('N','Y') default 'Y' "+
"after `INCLUDE_IMPORT_MARKERS`";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("alter table `LOGS` ")+
"add column `INCLUDE_TFC_IMPORT_MARKERS` enum('N','Y') default 'Y' "+
"after `INCLUDE_MUS_IMPORT_MARKERS`";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("select ")+
"`NAME`, "+ // 00
"`INCLUDE_IMPORT_MARKERS` "+ // 01
"from `LOGS`";
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString("update `LOGS` set ")+
"`INCLUDE_MUS_IMPORT_MARKERS`='"+q->value(1).toString()+"',"+
"`INCLUDE_TFC_IMPORT_MARKERS`='"+q->value(1).toString()+"' "+
"where `NAME`='"+RDEscapeString(q->value(0).toString())+"'";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
}
delete q;
WriteSchemaVersion(++cur_schema);
}
// NEW SCHEMA UPDATES GO HERE...