2023-01-26 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdlogmanager(1) that caused the slop factors for
	inline traffic events to fail to be applied when importing a traffic
	log.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2023-01-26 10:53:57 -05:00
parent 5b08dc312c
commit f556f23647
2 changed files with 36 additions and 2 deletions

View File

@ -20969,3 +20969,7 @@
2023-01-18 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdservice(8) that could cause dropboxes to be
instantiated with invalid segue level values.
2023-01-26 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdlogmanager(1) that caused the slop factors for
inline traffic events to fail to be applied when importing a traffic
log.

View File

@ -926,6 +926,7 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
//
QString sql;
RDSqlQuery *q;
RDSqlQuery *q1;
RDLogLine *logline=NULL;
//
@ -952,6 +953,35 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
int grace_time=link_logline->graceTime();
QTime time=link_logline->startTime(RDLogLine::Logged);
//
// Get slop factors for inline traffic breaks
//
int inline_start_slop=0;
int inline_end_slop=0;
if(event_import_source==RDEventLine::Music) {
sql=QString("select ")+
"`NESTED_EVENT` "+ // 00
"from `EVENTS` where "+
"`NAME`='"+RDEscapeString(event_name)+"'";
q=new RDSqlQuery(sql);
if(q->first()) {
if(!q->value(0).toString().trimmed().isEmpty()) {
sql=QString("select ")+
"`START_SLOP`,"+ // 00
"`END_SLOP` "+ // 01
"from `EVENTS` where "+
"`NAME`='"+RDEscapeString(q->value(0).toString().trimmed())+"'";
q1=new RDSqlQuery(sql);
if(q1->first()) {
inline_start_slop=q1->value(0).toInt();
inline_end_slop=q1->value(1).toInt();
}
delete q1;
}
}
delete q;
}
//
// Insert Parent Link
//
@ -1047,8 +1077,8 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname,
logline->setLinkEventName(event_nested_event);
logline->setLinkStartTime(q->value(9).toTime());
logline->setLinkLength(q->value(10).toInt());
logline->setLinkStartSlop(link_logline->linkStartSlop());
logline->setLinkEndSlop(link_logline->linkEndSlop());
logline->setLinkStartSlop(inline_start_slop);
logline->setLinkEndSlop(inline_end_slop);
logline->setLinkId(link_logline->linkId());
logline->setLinkEmbedded(true);
}