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

* Modified reports in rdlogmanager(1) to use standard date/time
	formats.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-08-12 13:14:18 -04:00
parent 15f76bae66
commit a7ea971910
11 changed files with 76 additions and 38 deletions

View File

@@ -22253,3 +22253,6 @@
2021-08-12 Fred Gleason <fredg@paravelsystems.com> 2021-08-12 Fred Gleason <fredg@paravelsystems.com>
* Adjusted layout in the 'Cut Info/Record' dialog in rdlibrary(1) * Adjusted layout in the 'Cut Info/Record' dialog in rdlibrary(1)
to be compatible with 12 hour time format. to be compatible with 12 hour time format.
2021-08-12 Fred Gleason <fredg@paravelsystems.com>
* Modified reports in rdlogmanager(1) to use standard date/time
formats.

View File

@@ -25,6 +25,7 @@
#include <QTextStream> #include <QTextStream>
#include <rdairplay_conf.h> #include <rdairplay_conf.h>
#include <rdapplication.h>
#include <rdconf.h> #include <rdconf.h>
#include <rddatedecode.h> #include <rddatedecode.h>
#include <rddb.h> #include <rddb.h>
@@ -82,15 +83,20 @@ bool RDReport::ExportCutLog(const QString &filename,const QDate &startdate,
// //
if(startdate==enddate) { if(startdate==enddate) {
*strm << RDReport::center(QString("Rivendell RDAirPlay Cut Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Cut Report for ")+
startdate.toString("MM/dd/yyyy"),75); rda->shortDateString(startdate),78)+"\n";
} }
else { else {
*strm << RDReport::center(QString("Rivendell RDAirPlay Cut Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Cut Report for ")+
startdate.toString("MM/dd/yyyy")+" - "+ rda->shortDateString(startdate)+" - "+
enddate.toString("MM/dd/yyyy"),75)+"\n"; rda->shortDateString(enddate),78)+"\n";
}
*strm << RDReport::center(name()+" -- "+description(),78)+"\n";
if(rda->showTwelveHourTime()) {
*strm << "--Time----- -Cart- --Title---------------- Cut --Description------- -Len-\n";
}
else {
*strm << "--Time-- -Cart- --Title---------------- Cut --Description------- -Len-\n";
} }
*strm << RDReport::center(name()+" -- "+description(),75)+"\n";
*strm << "--Time-- -Cart- --Title---------------- Cut --Description------- -Len-\n";
// //
// Write Data Rows // Write Data Rows
@@ -113,7 +119,7 @@ bool RDReport::ExportCutLog(const QString &filename,const QDate &startdate,
if(desc.isEmpty()) { if(desc.isEmpty()) {
desc=" "; desc=" ";
} }
*strm << q->value(2).toTime().toString("hh:mm:ss")+" "; *strm << rda->timeString(q->value(2).toTime(),true)+" ";
*strm << cart_num+" "; *strm << cart_num+" ";
*strm << RDReport::leftJustify(q->value(8).toString(),23)+" "; *strm << RDReport::leftJustify(q->value(8).toString(),23)+" ";
*strm << cut+" "; *strm << cut+" ";

View File

@@ -23,6 +23,7 @@
#include <QTextStream> #include <QTextStream>
#include "rdairplay_conf.h" #include "rdairplay_conf.h"
#include "rdapplication.h"
#include "rdconf.h" #include "rdconf.h"
#include "rddatedecode.h" #include "rddatedecode.h"
#include "rddb.h" #include "rddb.h"
@@ -73,12 +74,12 @@ bool RDReport::ExportMusicClassical(const QString &filename,
// //
if(startdate==enddate) { if(startdate==enddate) {
*strm << RDReport::center(QString("Rivendell RDAirPlay Classical Music Playout Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Classical Music Playout Report for ")+
startdate.toString("MM/dd/yyyy"),120)+"\n"; rda->shortDateString(startdate),120)+"\n";
} }
else { else {
*strm << RDReport::center(QString("Rivendell RDAirPlay Classical Music Playout Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Classical Music Playout Report for ")+
startdate.toString("MM/dd/yyyy")+" - "+ rda->shortDateString(startdate)+" - "+
enddate.toString("MM/dd/yyyy"),120)+"\n"; rda->shortDateString(enddate),120)+"\n";
} }
*strm << RDReport::center(name()+" -- "+description(),120)+"\n"; *strm << RDReport::center(name()+" -- "+description(),120)+"\n";
*strm << "Time -Len- --Title----------------------- --Composer-------------------- --Label / Spine #-------- Lib # Cart #\n"; *strm << "Time -Len- --Title----------------------- --Composer-------------------- --Label / Spine #-------- Lib # Cart #\n";

View File

@@ -23,6 +23,7 @@
#include <QTextStream> #include <QTextStream>
#include "rdairplay_conf.h" #include "rdairplay_conf.h"
#include "rdapplication.h"
#include "rdconf.h" #include "rdconf.h"
#include "rddatedecode.h" #include "rddatedecode.h"
#include "rddb.h" #include "rddb.h"
@@ -76,15 +77,20 @@ bool RDReport::ExportMusicPlayout(const QString &filename,
// //
if(startdate==enddate) { if(startdate==enddate) {
*strm << RDReport::center(QString("Rivendell RDAirPlay Music Playout Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Music Playout Report for ")+
startdate.toString("MM/dd/yyyy"),144)+"\n"; rda->shortDateString(startdate),144)+"\n";
} }
else { else {
*strm << RDReport::center(QString("Rivendell RDAirPlay Music Playout Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Music Playout Report for ")+
startdate.toString("MM/dd/yyyy")+" - "+ rda->shortDateString(startdate)+" - "+
enddate.toString("MM/dd/yyyy"),144)+"\n"; rda->shortDateString(enddate),144)+"\n";
} }
*strm << RDReport::center(name()+" -- "+description(),144)+"\n"; *strm << RDReport::center(name()+" -- "+description(),144)+"\n";
*strm << "--Time-- -Cart- Cut A-Len --Title----------------------- --Artist---------------------- --Album------------------ --Label-------------\n"; if(rda->showTwelveHourTime()) {
*strm << "--Time----- -Cart- Cut A-Len --Title----------------------- --Artist---------------------- --Album------------------ --Label-------------\n";
}
else {
*strm << "--Time-- -Cart- Cut A-Len --Title----------------------- --Artist---------------------- --Album------------------ --Label-------------\n";
}
// //
// Write Data Rows // Write Data Rows
@@ -103,7 +109,7 @@ bool RDReport::ExportMusicPlayout(const QString &filename,
} }
} }
cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt()); cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt());
*strm << q->value(2).toDateTime().time().toString("hh:mm:ss")+" "; *strm << rda->timeString(q->value(2).toDateTime().time(),true)+" ";
*strm << cart_num+" "; *strm << cart_num+" ";
*strm << cut+" "; *strm << cut+" ";
*strm << RDGetTimeLength(q->value(0).toInt(),true,false).right(5)+" "; *strm << RDGetTimeLength(q->value(0).toInt(),true,false).right(5)+" ";

View File

@@ -23,6 +23,7 @@
#include <QTextStream> #include <QTextStream>
#include "rdairplay_conf.h" #include "rdairplay_conf.h"
#include "rdapplication.h"
#include "rdconf.h" #include "rdconf.h"
#include "rddatedecode.h" #include "rddatedecode.h"
#include "rddb.h" #include "rddb.h"
@@ -62,14 +63,14 @@ bool RDReport::ExportMusicSummary(const QString &filename,
// //
if(startdate==enddate) { if(startdate==enddate) {
*strm << RDReport::center(QString("Rivendell RDAirPlay Music Summary Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Music Summary Report for ")+
startdate.toString("MM/dd/yyyy"),75)+"\n"; rda->shortDateString(startdate),78)+"\n";
} }
else { else {
*strm << RDReport::center(QString("Rivendell RDAirPlay Music Summary Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Music Summary Report for ")+
startdate.toString("MM/dd/yyyy")+" - "+ rda->shortDateString(startdate)+" - "+
enddate.toString("MM/dd/yyyy"),75)+"\n"; rda->shortDateString(enddate),78)+"\n";
} }
*strm << RDReport::center(name()+" -- "+description(),75)+"\n"; *strm << RDReport::center(name()+" -- "+description(),78)+"\n";
// //
// Write Data Rows // Write Data Rows

View File

@@ -25,6 +25,7 @@
#include <QTextStream> #include <QTextStream>
#include "rdairplay_conf.h" #include "rdairplay_conf.h"
#include "rdapplication.h"
#include "rdconf.h" #include "rdconf.h"
#include "rddatedecode.h" #include "rddatedecode.h"
#include "rddb.h" #include "rddb.h"
@@ -89,12 +90,12 @@ bool RDReport::ExportSpinCount(const QString &filename,const QDate &startdate,
// //
if(startdate==enddate) { if(startdate==enddate) {
*strm << RDReport::center(QString("Rivendell Spin Count Report for ")+ *strm << RDReport::center(QString("Rivendell Spin Count Report for ")+
startdate.toString("MM/dd/yyyy"),132)+"\n"; rda->shortDateString(startdate),132)+"\n";
} }
else { else {
*strm << RDReport::center(QString("Rivendell Spin Count Report for ")+ *strm << RDReport::center(QString("Rivendell Spin Count Report for ")+
startdate.toString("MM/dd/yyyy")+" - "+ rda->shortDateString(startdate)+" - "+
enddate.toString("MM/dd/yyyy"),132)+"\n"; rda->shortDateString(enddate),132)+"\n";
} }
*strm << RDReport::center(name()+" -- "+description(),132)+"\n"; *strm << RDReport::center(name()+" -- "+description(),132)+"\n";
*strm << "--Title------------------------ --Artist----------------------- --Album------------------------ --Label----------------------- Spins\n"; *strm << "--Title------------------------ --Artist----------------------- --Album------------------------ --Label----------------------- Spins\n";

View File

@@ -2,7 +2,7 @@
// //
// Export a Rivendell Technical Report to an ASCII Text File. // Export a Rivendell Technical Report to an ASCII Text File.
// //
// (C) Copyright 2002-2006,2016-2018 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 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
@@ -22,6 +22,7 @@
#include <QTextStream> #include <QTextStream>
#include "rdairplay_conf.h" #include "rdairplay_conf.h"
#include "rdapplication.h"
#include "rdconf.h" #include "rdconf.h"
#include "rddb.h" #include "rddb.h"
#include "rdescape_string.h" #include "rdescape_string.h"
@@ -86,18 +87,23 @@ bool RDReport::ExportTechnical(const QString &filename,const QDate &startdate,
if(incl_hdr) { if(incl_hdr) {
if(startdate==enddate) { if(startdate==enddate) {
*strm << RDReport::center("Rivendell RDAirPlay Technical Playout Report for "+ *strm << RDReport::center("Rivendell RDAirPlay Technical Playout Report for "+
startdate.toString("MM/dd/yyyy"),96); rda->shortDateString(startdate),96);
*strm << eol; *strm << eol;
} }
else { else {
*strm << RDReport::center("Rivendell RDAirPlay Technical Playout Report for "+ *strm << RDReport::center("Rivendell RDAirPlay Technical Playout Report for "+
startdate.toString("MM/dd/yyyy")+" - "+ rda->shortDateString(startdate)+" - "+
enddate.toString("MM/dd/yyyy"),96); rda->shortDateString(enddate),96);
*strm << eol; *strm << eol;
} }
*strm << RDReport::center(name()+" -- "+description(),96); *strm << RDReport::center(name()+" -- "+description(),96);
*strm << eol; *strm << eol;
*strm << "--Time-- -Cart- Cut --Title---------------- A-Len N-Len --Host---- Srce StartedBy OnAir"; if(rda->showTwelveHourTime()) {
*strm << "--Time----- -Cart- Cut --Title---------------- A-Len N-Len --Host---- Srce StartedBy OnAir";
}
else {
*strm << "--Time-- -Cart- Cut --Title---------------- A-Len N-Len --Host---- Srce StartedBy OnAir";
}
*strm << eol; *strm << eol;
} }
@@ -118,7 +124,7 @@ bool RDReport::ExportTechnical(const QString &filename,const QDate &startdate,
} }
} }
cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt()); cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt());
*strm << q->value(2).toTime().toString("hh:mm:ss")+" "; *strm << rda->timeString(q->value(2).toTime(),true)+" ";
*strm << cart_num+" "; *strm << cart_num+" ";
*strm << cut+" "; *strm << cut+" ";
*strm << RDReport::leftJustify(q->value(8).toString(),23)+" "; *strm << RDReport::leftJustify(q->value(8).toString(),23)+" ";

View File

@@ -23,6 +23,7 @@
#include <QTextStream> #include <QTextStream>
#include "rdairplay_conf.h" #include "rdairplay_conf.h"
#include "rdapplication.h"
#include "rdconf.h" #include "rdconf.h"
#include "rddatedecode.h" #include "rddatedecode.h"
#include "rddb.h" #include "rddb.h"
@@ -79,15 +80,20 @@ bool RDReport::ExportTextLog(const QString &filename,const QDate &startdate,
// //
if(startdate==enddate) { if(startdate==enddate) {
*strm << RDReport::center(QString("Rivendell RDAirPlay Playout Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Playout Report for ")+
startdate.toString("MM/dd/yyyy"),78)+"\n"; rda->shortDateString(startdate),81)+"\n";
} }
else { else {
*strm << RDReport::center(QString("Rivendell RDAirPlay Playout Report for ")+ *strm << RDReport::center(QString("Rivendell RDAirPlay Playout Report for ")+
startdate.toString("MM/dd/yyyy")+" - "+ rda->shortDateString(startdate)+" - "+
enddate.toString("MM/dd/yyyy"),78)+"\n"; rda->shortDateString(enddate),81)+"\n";
}
*strm << RDReport::center(name()+" -- "+description(),81)+"\n";
if(rda->showTwelveHourTime()) {
*strm << "--Time----- -Cart- Cut --Title---------------- A-Len N-Len --Host---- Srce\n";
}
else {
*strm << "--Time-- -Cart- Cut --Title---------------- A-Len N-Len --Host---- Srce\n";
} }
*strm << RDReport::center(name()+" -- "+description(),78)+"\n";
*strm << "--Time-- -Cart- Cut --Title---------------- A-Len N-Len --Host---- Srce\n";
// //
// Write Data Rows // Write Data Rows
@@ -106,7 +112,7 @@ bool RDReport::ExportTextLog(const QString &filename,const QDate &startdate,
} }
} }
cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt()); cart_num=QString().sprintf(cart_fmt.toUtf8(),q->value(1).toUInt());
*strm << q->value(2).toTime().toString("hh:mm:ss")+" "; *strm << rda->timeString(q->value(2).toTime(),true)+" ";
*strm << RDReport::rightJustify(cart_num,6)+" "; *strm << RDReport::rightJustify(cart_num,6)+" ";
*strm << cut+" "; *strm << cut+" ";
*strm << RDReport::leftJustify(q->value(8).toString(),23)+" "; *strm << RDReport::leftJustify(q->value(8).toString(),23)+" ";

View File

@@ -661,6 +661,9 @@
#define RD_TWELVE_HOUR_FORMAT "h:mm:ss AP" #define RD_TWELVE_HOUR_FORMAT "h:mm:ss AP"
#define RD_TWELVE_HOUR_TENTHS_FORMAT "h:mm:ss.z AP" #define RD_TWELVE_HOUR_TENTHS_FORMAT "h:mm:ss.z AP"
#define RD_TWELVE_HOUR_PADDED_FORMAT "hh:mm:ss AP"
#define RD_TWELVE_HOUR_TENTHS_PADDED_FORMAT "hh:mm:ss.z AP"
#define RD_OFFSET_FORMAT "mm:ss" #define RD_OFFSET_FORMAT "mm:ss"
#define RD_OFFSET_TENTHS_FORMAT "mm:ss.z" #define RD_OFFSET_TENTHS_FORMAT "mm:ss.z"

View File

@@ -354,21 +354,26 @@ QString RDCoreApplication::shortDateString(const QDate &date) const
} }
QString RDCoreApplication::timeString(const QTime &time) const QString RDCoreApplication::timeString(const QTime &time,bool padded) const
{ {
if(app_show_twelve_hour_time) { if(app_show_twelve_hour_time) {
// return time.toString("h:mm:ss ap"); if(padded) {
return time.toString(RD_TWELVE_HOUR_PADDED_FORMAT);
}
return time.toString(RD_TWELVE_HOUR_FORMAT); return time.toString(RD_TWELVE_HOUR_FORMAT);
} }
return time.toString(RD_TWENTYFOUR_HOUR_FORMAT); return time.toString(RD_TWENTYFOUR_HOUR_FORMAT);
} }
QString RDCoreApplication::tenthsTimeString(const QTime &time) const QString RDCoreApplication::tenthsTimeString(const QTime &time,bool padded) const
{ {
QString ret; QString ret;
if(app_show_twelve_hour_time) { if(app_show_twelve_hour_time) {
if(padded) {
ret=time.toString(RD_TWELVE_HOUR_TENTHS_PADDED_FORMAT);
}
ret=time.toString(RD_TWELVE_HOUR_TENTHS_FORMAT); ret=time.toString(RD_TWELVE_HOUR_TENTHS_FORMAT);
} }
else { else {

View File

@@ -75,8 +75,8 @@ class RDCoreApplication : public QObject
QString longDateString(const QDate &date) const; QString longDateString(const QDate &date) const;
QString shortDateFormat() const; QString shortDateFormat() const;
QString shortDateString(const QDate &date) const; QString shortDateString(const QDate &date) const;
QString timeString(const QTime &time) const; QString timeString(const QTime &time,bool padded=false) const;
QString tenthsTimeString(const QTime &time) const; QString tenthsTimeString(const QTime &time,bool padded=false) const;
bool dropTable(const QString &tbl_name); bool dropTable(const QString &tbl_name);
void addTempFile(const QString &pathname); void addTempFile(const QString &pathname);
void syslog(int priority,const char *fmt,...) const; void syslog(int priority,const char *fmt,...) const;