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

* Added an 'IMPORTER_LINES.FILE_LINE' field to the database.
	* Added an 'IMPORTER_LINES.LINK_START_TIME' field to the database.
	* Added an 'IMPORTER_LINES.LINK_LENGTH' field to the database.
	* Incremented the database version to 341.
	* Reimplemented the 'RDSvc::linkLog()' and 'RDEventLine::linkLog()'
	methods to use the updated 'IMPORTER_LINES' table schema.
	* Added generation of an 'RDLogManager Error Report' when errors
	are detected when importing an external scheduler file in
	rdlogmanager(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2020-10-08 20:08:57 -04:00
parent 53faf2a4b9
commit b9f84fca37
32 changed files with 547 additions and 207 deletions

View File

@ -20422,3 +20422,13 @@
* Incremented the database version to 340. * Incremented the database version to 340.
* Added type icons to the 'Imported Events' list in the 'Test Import' * Added type icons to the 'Imported Events' list in the 'Test Import'
dialog in rdadmin(1). dialog in rdadmin(1).
2020-10-08 Fred Gleason <fredg@paravelsystems.com>
* Added an 'IMPORTER_LINES.FILE_LINE' field to the database.
* Added an 'IMPORTER_LINES.LINK_START_TIME' field to the database.
* Added an 'IMPORTER_LINES.LINK_LENGTH' field to the database.
* Incremented the database version to 341.
* Reimplemented the 'RDSvc::linkLog()' and 'RDEventLine::linkLog()'
methods to use the updated 'IMPORTER_LINES' table schema.
* Added generation of an 'RDLogManager Error Report' when errors
are detected when importing an external scheduler file in
rdlogmanager(1).

View File

@ -7,7 +7,8 @@ FIELD NAME TYPE REMARKS
---------------------------------------------------------------- ----------------------------------------------------------------
ID int(10) unsigned Primary key, auto increment ID int(10) unsigned Primary key, auto increment
STATION_NAME varchar(64) From STATIONS.NAME STATION_NAME varchar(64) From STATIONS.NAME
PROCESS_ID int unsigned PROCESS_ID int(10) unsigned
FILE_LINE int(10) unsigned
LINE_ID int(10) unsigned LINE_ID int(10) unsigned
TYPE int(10) unsigned RDLogLine::Type TYPE int(10) unsigned RDLogLine::Type
START_HOUR int(11) signed START_HOUR int(11) signed
@ -19,4 +20,6 @@ EXT_DATA varchar(32)
EXT_EVENT_ID varchar(32) EXT_EVENT_ID varchar(32)
EXT_ANNC_TYPE varchar(8) EXT_ANNC_TYPE varchar(8)
EXT_CART_NAME varchar(32) EXT_CART_NAME varchar(32)
LINK_START_TIME time
LINK_LENGTH int(11)
EVENT_USED enum('N','Y') EVENT_USED enum('N','Y')

View File

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

View File

@ -2958,5 +2958,21 @@ Zkuste to, prosím, znovu!</translation>
<source>Import failed</source> <source>Import failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>invalid start time and/or length on inline traffic break.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>multiple inline traffic breaks not permitted within the same music event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In event</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -2953,5 +2953,21 @@ bitte erneut versuchen!</translation>
<source>Import failed</source> <source>Import failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>invalid start time and/or length on inline traffic break.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>multiple inline traffic breaks not permitted within the same music event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In event</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -2937,5 +2937,21 @@ please try again!</source>
<source>Import failed</source> <source>Import failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>invalid start time and/or length on inline traffic break.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>multiple inline traffic breaks not permitted within the same music event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In event</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -2323,5 +2323,21 @@ please try again!</source>
<source>Import failed</source> <source>Import failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>invalid start time and/or length on inline traffic break.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>multiple inline traffic breaks not permitted within the same music event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In event</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -2859,5 +2859,21 @@ prøv ein gong til!</translation>
<source>Import failed</source> <source>Import failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>invalid start time and/or length on inline traffic break.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>multiple inline traffic breaks not permitted within the same music event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In event</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -2859,5 +2859,21 @@ prøv ein gong til!</translation>
<source>Import failed</source> <source>Import failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>invalid start time and/or length on inline traffic break.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>multiple inline traffic breaks not permitted within the same music event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In event</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -2904,5 +2904,21 @@ por favor, tente novamente!</translation>
<source>Import failed</source> <source>Import failed</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>invalid start time and/or length on inline traffic break.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>multiple inline traffic breaks not permitted within the same music event</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>In event</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -1003,13 +1003,10 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
"EXT_EVENT_ID,"+ // 04 "EXT_EVENT_ID,"+ // 04
"EXT_ANNC_TYPE,"+ // 05 "EXT_ANNC_TYPE,"+ // 05
"EXT_CART_NAME,"+ // 06 "EXT_CART_NAME,"+ // 06
"INSERT_BREAK,"+ // 07 "TITLE,"+ // 07
"INSERT_TRACK,"+ // 08 "TYPE,"+ // 08
"INSERT_FIRST,"+ // 09 "LINK_START_TIME,"+ // 09
"TITLE,"+ // 10 "LINK_LENGTH "+ // 10
"TRACK_STRING,"+ // 11
"LINK_START_TIME,"+ // 12
"LINK_LENGTH "+ // 13
"from IMPORTER_LINES where "+ "from IMPORTER_LINES where "+
"STATION_NAME=\""+RDEscapeString(event_station->name())+"\" && "+ "STATION_NAME=\""+RDEscapeString(event_station->name())+"\" && "+
QString().sprintf("PROCESS_ID=%u && ",getpid())+ QString().sprintf("PROCESS_ID=%u && ",getpid())+
@ -1020,8 +1017,11 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
q=new RDSqlQuery(sql); q=new RDSqlQuery(sql);
while(q->next()) { while(q->next()) {
int length=GetLength(q->value(0).toUInt(),q->value(2).toInt()); int length=GetLength(q->value(0).toUInt(),q->value(2).toInt());
if(q->value(9).toUInt()==RDEventLine::InsertBreak) {
if(q->value(7).toString()=="Y") { // Insert Break //
// Inline Traffic Break
//
if(q->value(8).toUInt()==RDLogLine::TrafficLink) {
if((!event_nested_event.isEmpty()&&(event_nested_event!=event_name))) { if((!event_nested_event.isEmpty()&&(event_nested_event!=event_name))) {
e->insert(e->size(),1); e->insert(e->size(),1);
logline=e->logLine(e->size()-1); logline=e->logLine(e->size()-1);
@ -1032,88 +1032,41 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
logline->setTransType(trans_type); logline->setTransType(trans_type);
logline->setEventLength(event_length); logline->setEventLength(event_length);
logline->setLinkEventName(event_nested_event); logline->setLinkEventName(event_nested_event);
if(!q->value(13).isNull()) { logline->setLinkStartTime(q->value(9).toTime());
logline->setLinkStartTime(q->value(12).toTime()); logline->setLinkLength(q->value(10).toInt());
logline->setLinkLength(q->value(13).toInt());
}
else {
logline->setLinkStartTime(link_logline->linkStartTime());
logline->setLinkLength(link_logline->linkLength());
}
logline->setLinkStartSlop(link_logline->linkStartSlop()); logline->setLinkStartSlop(link_logline->linkStartSlop());
logline->setLinkEndSlop(link_logline->linkEndSlop()); logline->setLinkEndSlop(link_logline->linkEndSlop());
logline->setLinkId(link_logline->linkId()); logline->setLinkId(link_logline->linkId());
logline->setLinkEmbedded(true); logline->setLinkEmbedded(true);
} }
} }
if(q->value(8).toString()=="Y") { // Insert Track
e->insert(e->size(),1);
logline=e->logLine(e->size()-1);
logline->setId(e->nextId());
logline->setStartTime(RDLogLine::Logged,time);
logline->setType(RDLogLine::Track);
logline->setSource(event_src);
logline->setTransType(RDLogLine::Segue);
logline->setMarkerComment(q->value(11).toString());
logline->setEventLength(event_length);
logline->setLinkEventName(event_name);
logline->setLinkStartTime(link_logline->linkStartTime());
logline->setLinkLength(link_logline->linkLength());
logline->setLinkStartSlop(link_logline->linkStartSlop());
logline->setLinkEndSlop(link_logline->linkEndSlop());
logline->setLinkId(link_logline->linkId());
logline->setLinkEmbedded(true);
}
}
else {
if(q->value(8).toString()=="Y") { // Insert Track
e->insert(e->size(),1);
logline=e->logLine(e->size()-1);
logline->setId(e->nextId());
logline->setStartTime(RDLogLine::Logged,time);
logline->setType(RDLogLine::Track);
logline->setSource(event_src);
logline->setTransType(RDLogLine::Segue);
logline->setMarkerComment(q->value(11).toString());
logline->setEventLength(event_length);
logline->setLinkEventName(event_name);
logline->setLinkStartTime(link_logline->linkStartTime());
logline->setLinkLength(link_logline->linkLength());
logline->setLinkStartSlop(link_logline->linkStartSlop());
logline->setLinkEndSlop(link_logline->linkEndSlop());
logline->setLinkId(link_logline->linkId());
logline->setLinkEmbedded(true);
}
if(q->value(7).toString()=="Y") { // Insert Break
if((!event_nested_event.isEmpty()&&(event_nested_event!=event_name))) {
e->insert(e->size(),1);
logline=e->logLine(e->size()-1);
logline->setId(e->nextId());
logline->setStartTime(RDLogLine::Logged,time);
logline->setType(RDLogLine::TrafficLink);
logline->setSource(event_src);
logline->setTransType(trans_type);
logline->setEventLength(event_length);
logline->setLinkEventName(event_nested_event);
if(!q->value(13).isNull()) {
logline->setLinkStartTime(q->value(12).toTime());
logline->setLinkLength(q->value(13).toInt());
}
else {
logline->setLinkStartTime(link_logline->linkStartTime());
logline->setLinkLength(link_logline->linkLength());
}
logline->setLinkStartSlop(link_logline->linkStartSlop());
logline->setLinkEndSlop(link_logline->linkEndSlop());
logline->setLinkId(link_logline->linkId());
logline->setLinkEmbedded(true);
}
}
}
// //
// Insert imported event // Voicetrack Marker
// //
if(q->value(8).toUInt()==RDLogLine::Track) {
e->insert(e->size(),1);
logline=e->logLine(e->size()-1);
logline->setId(e->nextId());
logline->setStartTime(RDLogLine::Logged,time);
logline->setType(RDLogLine::Track);
logline->setSource(event_src);
logline->setTransType(RDLogLine::Segue);
logline->setMarkerComment(q->value(7).toString());
logline->setEventLength(event_length);
logline->setLinkEventName(event_name);
logline->setLinkStartTime(link_logline->linkStartTime());
logline->setLinkLength(link_logline->linkLength());
logline->setLinkStartSlop(link_logline->linkStartSlop());
logline->setLinkEndSlop(link_logline->linkEndSlop());
logline->setLinkId(link_logline->linkId());
logline->setLinkEmbedded(true);
}
//
// Cart
//
if(q->value(8).toUInt()==RDLogLine::Cart) {
e->insert(e->size(),1); e->insert(e->size(),1);
logline=e->logLine(e->size()-1); logline=e->logLine(e->size()-1);
logline->setId(e->nextId()); logline->setId(e->nextId());
@ -1141,13 +1094,13 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
logline->setLinkEmbedded(link_logline->linkEmbedded()); logline->setLinkEmbedded(link_logline->linkEmbedded());
if((q->value(6).toString()==label_cart)&&(!label_cart.isEmpty())) { if((q->value(6).toString()==label_cart)&&(!label_cart.isEmpty())) {
logline->setType(RDLogLine::Marker); logline->setType(RDLogLine::Marker);
logline->setMarkerComment(q->value(10).toString()); logline->setMarkerComment(q->value(7).toString());
logline->setCartNumber(0); logline->setCartNumber(0);
} }
else { else {
if((q->value(6).toString()==track_cart)&&(!track_cart.isEmpty())) { if((q->value(6).toString()==track_cart)&&(!track_cart.isEmpty())) {
logline->setType(RDLogLine::Track); logline->setType(RDLogLine::Track);
logline->setMarkerComment(q->value(10).toString()); logline->setMarkerComment(q->value(7).toString());
logline->setCartNumber(0); logline->setCartNumber(0);
} }
else { else {
@ -1156,6 +1109,7 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
} }
} }
time=time.addMSecs(length); time=time.addMSecs(length);
}
// //
// Clear Leading Event Values // Clear Leading Event Values

View File

@ -569,6 +569,7 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
QString track_label; QString track_label;
QTime link_time; QTime link_time;
int file_line=0;
while(fgets(buf,RD_MAX_IMPORT_LINE_LENGTH,infile)!=NULL) { while(fgets(buf,RD_MAX_IMPORT_LINE_LENGTH,infile)!=NULL) {
str_buf=QString::fromUtf8(buf); str_buf=QString::fromUtf8(buf);
@ -598,11 +599,26 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
// //
// Length // Length
// //
hours_len_buf=str_buf.mid(hours_len_offset,hours_len_length); cartlen=-1;
minutes_len_buf=str_buf.mid(minutes_len_offset,minutes_len_length); int len=0;
seconds_len_buf=str_buf.mid(seconds_len_offset,seconds_len_length); bool ok1=true;
cartlen=3600000*hours_len_buf.toInt()+60000*minutes_len_buf.toInt()+ bool ok2=true;
1000*seconds_len_buf.toInt(); bool ok3=true;
if(hours_len_length>0) {
QString buf=str_buf.mid(hours_len_offset,hours_len_length);
len+=3600000*buf.toUInt(&ok1);
}
if(minutes_len_length>0) {
QString buf=str_buf.mid(minutes_len_offset,minutes_len_length);
len+=60000*buf.toInt(&ok2);
}
if(seconds_len_length>0) {
QString buf=str_buf.mid(seconds_len_offset,seconds_len_length);
len+=1000*buf.toUInt(&ok3);
}
if(ok1&&ok2&&ok3) {
cartlen=len;
}
// //
// External Data // External Data
@ -627,13 +643,14 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
sql=QString("insert into IMPORTER_LINES set ")+ sql=QString("insert into IMPORTER_LINES set ")+
"STATION_NAME=\""+RDEscapeString(svc_station->name())+"\","+ "STATION_NAME=\""+RDEscapeString(svc_station->name())+"\","+
QString().sprintf("PROCESS_ID=%d,",getpid())+ QString().sprintf("PROCESS_ID=%d,",getpid())+
QString().sprintf("FILE_LINE=%u,",file_line)+
QString().sprintf("LINE_ID=%d,",line_id); QString().sprintf("LINE_ID=%d,",line_id);
if(start_time_ok) { if(start_time_ok) {
sql+=QString().sprintf("START_HOUR=%d,",start_hour)+ sql+=QString().sprintf("START_HOUR=%d,",start_hour)+
QString().sprintf("START_SECS=%d,", QString().sprintf("START_SECS=%d,",
60*start_minutes+start_seconds); 60*start_minutes+start_seconds);
} }
if(cartlen>0) { if(cartlen>=0) {
sql+=QString().sprintf("LENGTH=%d,",cartlen); sql+=QString().sprintf("LENGTH=%d,",cartlen);
} }
@ -650,6 +667,7 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
"TITLE=\""+RDEscapeString(title)+"\""; "TITLE=\""+RDEscapeString(title)+"\"";
RDSqlQuery::apply(sql); RDSqlQuery::apply(sql);
line_id++; line_id++;
file_line++;
continue; continue;
} }
@ -661,6 +679,7 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
sql+=QString().sprintf("TYPE=%u",RDLogLine::TrafficLink); sql+=QString().sprintf("TYPE=%u",RDLogLine::TrafficLink);
RDSqlQuery::apply(sql); RDSqlQuery::apply(sql);
line_id++; line_id++;
file_line++;
continue; continue;
} }
} }
@ -673,8 +692,10 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
"TITLE=\""+RDEscapeString(str_buf.simplified().trimmed())+"\""; "TITLE=\""+RDEscapeString(str_buf.simplified().trimmed())+"\"";
RDSqlQuery::apply(sql); RDSqlQuery::apply(sql);
line_id++; line_id++;
file_line++;
continue; continue;
} }
file_line++;
} }
// //
@ -800,6 +821,10 @@ bool RDSvc::linkLog(RDSvc::ImportSource src,const QDate &date,
QString sql; QString sql;
RDSqlQuery *q; RDSqlQuery *q;
QString autofill_errors; QString autofill_errors;
QTime prev_start_time;
RDLogEvent *src_event=NULL;
RDLogEvent *dest_event=NULL;
RDLogLine *logline=NULL;
RDLogLock *log_lock=new RDLogLock(logname,user,svc_station,this); RDLogLock *log_lock=new RDLogLock(logname,user,svc_station,this);
if(!TryLock(log_lock,err_msg)) { if(!TryLock(log_lock,err_msg)) {
@ -847,13 +872,21 @@ bool RDSvc::linkLog(RDSvc::ImportSource src,const QDate &date,
return false; return false;
} }
//
// Resolve embedded link parameters
//
if(src==RDSvc::Music) {
if(!ResolveInlineTrafficLinks(logname,err_msg)) {
return false;
}
}
// //
// Iterate Through the Log // Iterate Through the Log
// //
RDLogEvent *src_event=new RDLogEvent(logname); src_event=new RDLogEvent(logname);
RDLogEvent *dest_event=new RDLogEvent(logname); dest_event=new RDLogEvent(logname);
src_event->load(); src_event->load();
RDLogLine *logline=NULL;
for(int i=0;i<src_event->size();i++) { for(int i=0;i<src_event->size();i++) {
logline=src_event->logLine(i); logline=src_event->logLine(i);
if(logline->type()==src_type) { if(logline->type()==src_type) {
@ -904,7 +937,8 @@ bool RDSvc::linkLog(RDSvc::ImportSource src,const QDate &date,
"IMPORTER_LINES.STATION_NAME=\""+ "IMPORTER_LINES.STATION_NAME=\""+
RDEscapeString(svc_station->name())+"\" && "+ RDEscapeString(svc_station->name())+"\" && "+
QString().sprintf("IMPORTER_LINES.PROCESS_ID=%u && ",getpid())+ QString().sprintf("IMPORTER_LINES.PROCESS_ID=%u && ",getpid())+
"IMPORTER_LINES.EVENT_USED=\"N\""; "IMPORTER_LINES.EVENT_USED=\"N\" "+
"order by LINE_ID";
q=new RDSqlQuery(sql); q=new RDSqlQuery(sql);
while(q->next()) { while(q->next()) {
event=true; event=true;
@ -1582,3 +1616,130 @@ bool RDSvc::CheckId(std::vector<int> *v,int value)
v->push_back(value); v->push_back(value);
return true; return true;
} }
QString RDSvc::MakeErrorLine(int indent,unsigned lineno,const QString &msg)
const
{
QString margin;
for(int i=0;i<indent;i++) {
margin+=" ";
}
return margin+tr("Line")+QString().sprintf(" %u: ",1+lineno)+msg+"\n";
}
bool RDSvc::ResolveInlineTrafficLinks(const QString &logname,QString *err_msg)
const
{
RDLogEvent *evt=NULL;
RDLogLine *logline=NULL;
QTime start;
QTime end;
QString sql;
RDSqlQuery *q=NULL;
bool ok=false;
switch(subEventInheritance()) {
case RDSvc::ParentEvent:
evt=new RDLogEvent(logname);
evt->load();
ok=true;
for(int i=0;i<evt->size();i++) {
logline=evt->logLine(i);
if(logline->type()==RDLogLine::MusicLink) {
start=logline->linkStartTime();
end=logline->linkStartTime().addSecs(logline->linkLength());
sql=QString("select ")+
"ID,"+ // 00
"FILE_LINE "+ // 01
"from IMPORTER_LINES where "+
"IMPORTER_LINES.STATION_NAME=\""+
RDEscapeString(svc_station->name())+"\" && "+
QString().sprintf("IMPORTER_LINES.PROCESS_ID=%u && ",getpid())+
QString().sprintf("TYPE=%u && ",RDLogLine::TrafficLink)+
QString().sprintf("START_HOUR=%d && ",start.hour())+
QString().sprintf("START_SECS>=%d && ",
60*start.minute()+start.second())+
QString().sprintf("START_SECS<%d",60*start.minute()+start.second()+logline->linkLength()/1000);
q=new RDSqlQuery(sql);
if(q->size()>1) {
*err_msg+=tr("In event")+" \""+logline->linkEventName()+"\"@"+
logline->startTime(RDLogLine::Logged).toString("hh:mm:ss")+":\n";
while(q->next()) {
*err_msg+=MakeErrorLine(4,q->value(1).toUInt(),
tr("multiple inline traffic breaks not permitted within the same music event"));
}
*err_msg+="\n";
ok=false;
}
if(q->first()) {
sql=QString("update IMPORTER_LINES set ")+
"LINK_START_TIME=\""+
logline->linkStartTime().toString("hh:mm:ss")+"\","+
QString().sprintf("LINK_LENGTH=%d where ",logline->linkLength())+
QString().sprintf("ID=%u",q->value(0).toUInt());
RDSqlQuery::apply(sql);
}
delete q;
}
}
delete evt;
evt=NULL;
if(!ok) {
return false;
}
break;
case RDSvc::SchedFile:
//
// Verify that all inline traffic events have explicit start times
// and length
//
sql=QString("select ")+
"FILE_LINE "+ // 00
"from IMPORTER_LINES where "+
"IMPORTER_LINES.STATION_NAME=\""+
RDEscapeString(svc_station->name())+"\" && "+
QString().sprintf("IMPORTER_LINES.PROCESS_ID=%u && ",getpid())+
QString().sprintf("TYPE=%u && ",RDLogLine::TrafficLink)+
"(START_HOUR is null || START_SECS is null || LENGTH is null)";
ok=true;
q=new RDSqlQuery(sql);
while(q->next()) {
*err_msg=MakeErrorLine(0,q->value(0).toUInt(),
tr("invalid start time and/or length on inline traffic break."));
ok=false;
}
delete q;
if(!ok) {
return false;
}
//
// Resolve link parameters
//
sql=QString("select ")+
"ID,"+ // 00
"START_HOUR,"+ // 01
"START_SECS,"+ // 02
"LENGTH "+ // 03
"from IMPORTER_LINES where "+
QString().sprintf("TYPE=%u",RDLogLine::TrafficLink);
q=new RDSqlQuery(sql);
while(q->next()) {
sql=QString("update IMPORTER_LINES set ")+
"LINK_START_TIME=\""+QTime(q->value(1).toInt(),0,0).
addSecs(q->value(2).toInt()).toString("hh:mm:ss")+"\","+
QString().sprintf("LINK_LENGTH=%d where ",q->value(3).toInt())+
QString().sprintf("ID=%u",q->value(0).toUInt());
RDSqlQuery::apply(sql);
}
delete q;
break;
}
return true;
}

View File

@ -120,6 +120,8 @@ class RDSvc : public QObject
void GetParserStrings(ImportSource src,QString *break_str,QString *track_str, void GetParserStrings(ImportSource src,QString *break_str,QString *track_str,
QString *label_cart,QString *track_cart); QString *label_cart,QString *track_cart);
bool CheckId(std::vector<int> *v,int value); bool CheckId(std::vector<int> *v,int value);
QString MakeErrorLine(int indent,unsigned lineno,const QString &msg) const;
bool ResolveInlineTrafficLinks(const QString &logname,QString *err_msg) const;
QString svc_name; QString svc_name;
RDStation *svc_station; RDStation *svc_station;
RDConfig *svc_config; RDConfig *svc_config;

View File

@ -6681,6 +6681,10 @@ Prověřte, prosím, svá nastavení a zkuste to znovu.</translation>
<source>[voice track]</source> <source>[voice track]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ViewAdapters</name> <name>ViewAdapters</name>

View File

@ -6307,6 +6307,10 @@ Bitte überprüfen Sie ihre Einstellungen und versuchen sie es erneut.</translat
<source>[voice track]</source> <source>[voice track]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ViewAdapters</name> <name>ViewAdapters</name>

View File

@ -6648,6 +6648,10 @@ Revise los parámetros e intente de nuevo.</translation>
<source>[voice track]</source> <source>[voice track]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ViewAdapters</name> <name>ViewAdapters</name>

View File

@ -5127,6 +5127,10 @@ please check your settings and try again.</source>
<source>[voice track]</source> <source>[voice track]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ViewAdapters</name> <name>ViewAdapters</name>

View File

@ -6153,6 +6153,10 @@ Sjekk oppsettet ditt og prøv att.</translation>
<source>[voice track]</source> <source>[voice track]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ViewAdapters</name> <name>ViewAdapters</name>

View File

@ -6153,6 +6153,10 @@ Sjekk oppsettet ditt og prøv att.</translation>
<source>[voice track]</source> <source>[voice track]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ViewAdapters</name> <name>ViewAdapters</name>

View File

@ -6275,6 +6275,10 @@ por favor, cheque suas configurações e tente novamente</translation>
<source>[voice track]</source> <source>[voice track]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Line</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ViewAdapters</name> <name>ViewAdapters</name>

View File

@ -134,6 +134,8 @@ TestImport::TestImport(RDSvc *svc,RDSvc::ImportSource src,QWidget *parent)
test_events_list->setColumnAlignment(6,Qt::AlignCenter); test_events_list->setColumnAlignment(6,Qt::AlignCenter);
test_events_list->addColumn(tr("Annc Type")); test_events_list->addColumn(tr("Annc Type"));
test_events_list->setColumnAlignment(7,Qt::AlignCenter); test_events_list->setColumnAlignment(7,Qt::AlignCenter);
test_events_list->addColumn(tr("Line"));
test_events_list->setColumnAlignment(8,Qt::AlignRight);
test_events_list->setColumnSortType(0,RDListView::LineSort); test_events_list->setColumnSortType(0,RDListView::LineSort);
test_events_label=new QLabel(test_events_list,tr("Imported Events"),this); test_events_label=new QLabel(test_events_list,tr("Imported Events"),this);
test_events_label->setGeometry(15,160,sizeHint().width()-30,18); test_events_label->setGeometry(15,160,sizeHint().width()-30,18);
@ -204,7 +206,8 @@ void TestImport::importData()
"EXT_EVENT_ID,"+ // 05 "EXT_EVENT_ID,"+ // 05
"EXT_ANNC_TYPE,"+ // 06 "EXT_ANNC_TYPE,"+ // 06
"TITLE,"+ // 07 "TITLE,"+ // 07
"TYPE "+ // 08 "TYPE,"+ // 08
"FILE_LINE "+ // 09
"from IMPORTER_LINES where "+ "from IMPORTER_LINES where "+
"STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\" && "+ "STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\" && "+
QString().sprintf("PROCESS_ID=%u ",getpid())+ QString().sprintf("PROCESS_ID=%u ",getpid())+
@ -223,6 +226,7 @@ void TestImport::importData()
item->setText(5,q->value(4).toString().trimmed()); item->setText(5,q->value(4).toString().trimmed());
item->setText(6,q->value(5).toString().trimmed()); item->setText(6,q->value(5).toString().trimmed());
item->setText(7,q->value(6).toString().trimmed()); item->setText(7,q->value(6).toString().trimmed());
item->setText(8,QString().sprintf("%u",1+q->value(9).toUInt()));
switch((RDLogLine::Type)q->value(8).toUInt()) { switch((RDLogLine::Type)q->value(8).toUInt()) {
case RDLogLine::Cart: case RDLogLine::Cart:
item->setPixmap(0,*test_playout_map); item->setPixmap(0,*test_playout_map);

View File

@ -2,7 +2,7 @@
// //
// Generate a Rivendell Log // Generate a Rivendell Log
// //
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -427,13 +427,14 @@ void GenerateLog::musicData()
connect(svc,SIGNAL(generationProgress(int)), connect(svc,SIGNAL(generationProgress(int)),
gen_progress_dialog,SLOT(setValue(int))); gen_progress_dialog,SLOT(setValue(int)));
QString report; QString report;
if(!svc->linkLog(RDSvc::Music,gen_date_edit->date(),logname,&report,rda->user(), if(!svc->linkLog(RDSvc::Music,gen_date_edit->date(),logname,&report,
&err_msg)) { rda->user(),&err_msg)) {
gen_progress_dialog->setValue(gen_progress_dialog->maximum());
QMessageBox::warning(this,"RDLogManager - "+tr("Error"), RDTextFile(tr("RDLogManager Error Report")+"\n\n"+
tr("Unable to link music log")+": "+err_msg); tr("Music schedule import failed!")+"\n\n"+err_msg);
delete log; delete log;
delete svc; delete svc;
UpdateControls();
return; return;
} }
SendNotification(RDNotification::ModifyAction,log->name()); SendNotification(RDNotification::ModifyAction,log->name());
@ -489,10 +490,12 @@ void GenerateLog::trafficData()
QString report; QString report;
if(!svc->linkLog(RDSvc::Traffic,gen_date_edit->date(),logname,&report,rda->user(), if(!svc->linkLog(RDSvc::Traffic,gen_date_edit->date(),logname,&report,rda->user(),
&err_msg)) { &err_msg)) {
QMessageBox::warning(this,"RDLogManager - "+tr("Error"), gen_progress_dialog->setValue(gen_progress_dialog->maximum());
tr("Unable to link traffic log")+": "+err_msg); RDTextFile(tr("RDLogManager Error Report")+"\n\n"+
tr("Traffic schedule import failed!")+"\n\n"+err_msg);
delete log; delete log;
delete svc; delete svc;
UpdateControls();
return; return;
} }
SendNotification(RDNotification::ModifyAction,log->name()); SendNotification(RDNotification::ModifyAction,log->name());

View File

@ -1012,14 +1012,6 @@ Opětovné sloučení tato data smaže. Sloučit znovu?</translation>
<source>Unable to clear music links</source> <source>Unable to clear music links</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unable to link music log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to link traffic log</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Generate Log</source> <source>Generate Log</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1064,6 +1056,18 @@ Opětovné sloučení tato data smaže. Sloučit znovu?</translation>
<source>No broken rules or validation exceptions found.</source> <source>No broken rules or validation exceptions found.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>RDLogManager Error Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Music schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Traffic schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImportListView</name> <name>ImportListView</name>

View File

@ -1012,14 +1012,6 @@ Einbinden wird diese entfernen. Fortfahren?</translation>
<source>Unable to clear music links</source> <source>Unable to clear music links</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unable to link music log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to link traffic log</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Generate Log</source> <source>Generate Log</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1064,6 +1056,18 @@ Einbinden wird diese entfernen. Fortfahren?</translation>
<source>No broken rules or validation exceptions found.</source> <source>No broken rules or validation exceptions found.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>RDLogManager Error Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Music schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Traffic schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImportListView</name> <name>ImportListView</name>

View File

@ -1014,14 +1014,6 @@ removerá estos datos. ¿Remezclar?</translation>
<source>Unable to clear music links</source> <source>Unable to clear music links</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unable to link music log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to link traffic log</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Generate Log</source> <source>Generate Log</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1066,6 +1058,18 @@ removerá estos datos. ¿Remezclar?</translation>
<source>No broken rules or validation exceptions found.</source> <source>No broken rules or validation exceptions found.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>RDLogManager Error Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Music schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Traffic schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImportListView</name> <name>ImportListView</name>

View File

@ -820,14 +820,6 @@ Do you want to save?</source>
<source>Unable to clear music links</source> <source>Unable to clear music links</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unable to link music log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to link traffic log</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Generate Log</source> <source>Generate Log</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -876,6 +868,18 @@ Do you want to save?</source>
<source>No broken rules or validation exceptions found.</source> <source>No broken rules or validation exceptions found.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>RDLogManager Error Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Music schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Traffic schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImportListView</name> <name>ImportListView</name>

View File

@ -1013,14 +1013,6 @@ Flettar du på nytt, vil du fjerna desse dataa. Flett på nytt?</translation>
<source>Unable to clear music links</source> <source>Unable to clear music links</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unable to link music log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to link traffic log</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>already exists. Recreating it</source> <source>already exists. Recreating it</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1061,6 +1053,18 @@ Flettar du på nytt, vil du fjerna desse dataa. Flett på nytt?</translation>
<source>No broken rules or validation exceptions found.</source> <source>No broken rules or validation exceptions found.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>RDLogManager Error Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Music schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Traffic schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImportListView</name> <name>ImportListView</name>

View File

@ -1013,14 +1013,6 @@ Flettar du på nytt, vil du fjerna desse dataa. Flett på nytt?</translation>
<source>Unable to clear music links</source> <source>Unable to clear music links</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unable to link music log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to link traffic log</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>already exists. Recreating it</source> <source>already exists. Recreating it</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1061,6 +1053,18 @@ Flettar du på nytt, vil du fjerna desse dataa. Flett på nytt?</translation>
<source>No broken rules or validation exceptions found.</source> <source>No broken rules or validation exceptions found.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>RDLogManager Error Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Music schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Traffic schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImportListView</name> <name>ImportListView</name>

View File

@ -1014,14 +1014,6 @@ Re-agregar removerá estes dados. Re-agregar? </translation>
<source>Unable to clear music links</source> <source>Unable to clear music links</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Unable to link music log</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unable to link traffic log</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Generate Log</source> <source>Generate Log</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -1066,6 +1058,18 @@ Re-agregar removerá estes dados. Re-agregar? </translation>
<source>No broken rules or validation exceptions found.</source> <source>No broken rules or validation exceptions found.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>RDLogManager Error Report</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Music schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Traffic schedule import failed!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImportListView</name> <name>ImportListView</name>

View File

@ -40,6 +40,16 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
// NEW SCHEMA REVERSIONS GO HERE... // NEW SCHEMA REVERSIONS GO HERE...
//
// Revert 341
//
if((cur_schema==341)&&(set_schema<cur_schema)) {
DropColumn("IMPORTER_LINES","FILE_LINE");
DropColumn("IMPORTER_LINES","LINK_START_TIME");
DropColumn("IMPORTER_LINES","LINK_LENGTH");
WriteSchemaVersion(--cur_schema);
}
// //
// Revert 340 // Revert 340
// //
@ -85,6 +95,7 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg)
return false; return false;
} }
DropColumn("IMPORTER_LINES","TYPE"); DropColumn("IMPORTER_LINES","TYPE");
WriteSchemaVersion(--cur_schema); WriteSchemaVersion(--cur_schema);
} }

View File

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

View File

@ -10339,6 +10339,30 @@ bool MainObject::UpdateSchema(int cur_schema,int set_schema,QString *err_msg)
WriteSchemaVersion(++cur_schema); WriteSchemaVersion(++cur_schema);
} }
if((cur_schema<341)&&(set_schema>cur_schema)) {
sql=QString("delete from IMPORTER_LINES"); // Purge stale lines first
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("alter table IMPORTER_LINES ")+
"add column FILE_LINE int unsigned not null after PROCESS_ID";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("alter table IMPORTER_LINES ")+
"add column LINK_START_TIME time after EXT_CART_NAME";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
sql=QString("alter table IMPORTER_LINES ")+
"add column LINK_LENGTH int after LINK_START_TIME";
if(!RDSqlQuery::apply(sql,err_msg)) {
return false;
}
WriteSchemaVersion(++cur_schema);
}
// NEW SCHEMA UPDATES GO HERE... // NEW SCHEMA UPDATES GO HERE...