mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 23:30:20 +01:00
2017-10-15 Fred Gleason <fredg@paravelsystems.com>
* Added a 'STATIONS.SHORT_NAME' field to the database. * Incremented the database version to 270. * Added 'RDStation::shortName()' and 'RDStation::setShortName()' methods. * Removed the 'Broadcast Security Model' control from the 'Edit Host' dialog. * Added a 'Short Name' control to the 'Edit Host' dialog. * Implemented a '%R' wildcard for Rivendell Host Short Name.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
/*
|
||||
* Current Database Version
|
||||
*/
|
||||
#define RD_VERSION_DATABASE 269
|
||||
#define RD_VERSION_DATABASE 270
|
||||
|
||||
|
||||
#endif // DBVERSION_H
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include <rdcart.h>
|
||||
|
||||
|
||||
bool RDReport::ExportBmiEmr(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
bool RDReport::ExportBmiEmr(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
@@ -38,14 +38,6 @@ bool RDReport::ExportBmiEmr(const QDate &startdate,const QDate &enddate,
|
||||
QString usage_code;
|
||||
QString station_format=stationFormat();
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
//
|
||||
// Station Type
|
||||
//
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include <rddatedecode.h>
|
||||
#include <rdreport.h>
|
||||
|
||||
bool RDReport::ExportCutLog(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
bool RDReport::ExportCutLog(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
@@ -40,14 +40,6 @@ bool RDReport::ExportCutLog(const QDate &startdate,const QDate &enddate,
|
||||
QString cart_fmt;
|
||||
QString cart_num;
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"w"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -34,22 +34,14 @@
|
||||
#include <rdreport.h>
|
||||
|
||||
|
||||
bool RDReport::ExportDeltaflex(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
bool RDReport::ExportDeltaflex(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
FILE *f;
|
||||
QString air_fmt;
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"wb"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
#include <rddatedecode.h>
|
||||
#include <rdreport.h>
|
||||
|
||||
bool RDReport::ExportMusicClassical(const QDate &startdate,const QDate &enddate,
|
||||
bool RDReport::ExportMusicClassical(const QString &filename,
|
||||
const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
@@ -40,14 +41,6 @@ bool RDReport::ExportMusicClassical(const QDate &startdate,const QDate &enddate,
|
||||
QString cart_fmt;
|
||||
QString cart_num;
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"w"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
#include <rddatedecode.h>
|
||||
#include <rdreport.h>
|
||||
|
||||
bool RDReport::ExportMusicPlayout(const QDate &startdate,const QDate &enddate,
|
||||
bool RDReport::ExportMusicPlayout(const QString &filename,
|
||||
const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
@@ -40,14 +41,6 @@ bool RDReport::ExportMusicPlayout(const QDate &startdate,const QDate &enddate,
|
||||
QString cart_fmt;
|
||||
QString cart_num;
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"w"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
#include <rdreport.h>
|
||||
|
||||
|
||||
bool RDReport::ExportMusicSummary(const QDate &startdate,const QDate &enddate,
|
||||
bool RDReport::ExportMusicSummary(const QString &filename,
|
||||
const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
@@ -39,14 +40,6 @@ bool RDReport::ExportMusicSummary(const QDate &startdate,const QDate &enddate,
|
||||
QString cut;
|
||||
QString str;
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"w"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
// for more information.
|
||||
//
|
||||
|
||||
bool RDReport::ExportNprSoundEx(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
bool RDReport::ExportNprSoundEx(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
@@ -50,13 +50,6 @@ bool RDReport::ExportNprSoundEx(const QDate &startdate,const QDate &enddate,
|
||||
QString trans_category=stationFormat();
|
||||
QString channel_name=stationId();
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
if((f=fopen(filename,"wb"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
return false;
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
#include <rdreport.h>
|
||||
|
||||
|
||||
bool RDReport::ExportRadioTraffic(const QDate &startdate,const QDate &enddate,
|
||||
bool RDReport::ExportRadioTraffic(const QString &filename,
|
||||
const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
@@ -37,14 +38,6 @@ bool RDReport::ExportRadioTraffic(const QDate &startdate,const QDate &enddate,
|
||||
FILE *f;
|
||||
QString air_fmt;
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"wb"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -29,9 +29,8 @@
|
||||
#include <rdreport.h>
|
||||
#include <rdget_ath.h>
|
||||
|
||||
|
||||
bool RDReport::ExportSoundEx(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
bool RDReport::ExportSoundEx(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
@@ -47,14 +46,6 @@ bool RDReport::ExportSoundEx(const QDate &startdate,const QDate &enddate,
|
||||
QString trans_category=stationFormat();
|
||||
QString channel_name=stationId();
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
//
|
||||
// Get ATH Value
|
||||
//
|
||||
|
||||
@@ -31,9 +31,8 @@
|
||||
#include <rddatedecode.h>
|
||||
#include <rdreport.h>
|
||||
|
||||
|
||||
bool RDReport::ExportSpinCount(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
bool RDReport::ExportSpinCount(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
@@ -48,15 +47,6 @@ bool RDReport::ExportSpinCount(const QDate &startdate,const QDate &enddate,
|
||||
std::map<unsigned,QString> labels;
|
||||
std::map<unsigned,QString> albums;
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"w"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -29,9 +29,8 @@
|
||||
#include <rddatedecode.h>
|
||||
#include <rdreport.h>
|
||||
|
||||
|
||||
bool RDReport::ExportTechnical(const QDate &startdate,const QDate &enddate,
|
||||
bool incl_hdr,bool incl_crs,
|
||||
bool RDReport::ExportTechnical(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,bool incl_hdr,bool incl_crs,
|
||||
const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
@@ -43,16 +42,9 @@ bool RDReport::ExportTechnical(const QDate &startdate,const QDate &enddate,
|
||||
QString cart_num;
|
||||
char eol[3]="\n";
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
if(incl_crs) {
|
||||
strcpy(eol,"\r\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"w"))==NULL) {
|
||||
|
||||
@@ -29,9 +29,8 @@
|
||||
#include <rddatedecode.h>
|
||||
#include <rdreport.h>
|
||||
|
||||
|
||||
bool RDReport::ExportTextLog(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable)
|
||||
bool RDReport::ExportTextLog(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
@@ -41,14 +40,6 @@ bool RDReport::ExportTextLog(const QDate &startdate,const QDate &enddate,
|
||||
QString cart_fmt;
|
||||
QString cart_num;
|
||||
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
|
||||
QFile file(filename);
|
||||
if((f=fopen((const char *)filename,"w"))==NULL) {
|
||||
report_error_code=RDReport::ErrorCantOpen;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
#include <rddatedecode.h>
|
||||
|
||||
QString RDDateDecode(QString str,const QDate &date,RDConfig *config,
|
||||
const QString &svcname)
|
||||
QString RDDateDecode(QString str,const QDate &date,RDStation *station,
|
||||
RDConfig *config,const QString &svcname)
|
||||
{
|
||||
QString string;
|
||||
int yearnum;
|
||||
@@ -122,6 +122,10 @@ QString RDDateDecode(QString str,const QDate &date,RDConfig *config,
|
||||
field=config->stationName();
|
||||
break;
|
||||
|
||||
case 'R': // Rivendell Host Short Name
|
||||
field=station->shortName();
|
||||
break;
|
||||
|
||||
case 's': // Service name
|
||||
if(!svcname.isEmpty()) {
|
||||
field=svcname;
|
||||
@@ -176,7 +180,8 @@ QString RDDateDecode(QString str,const QDate &date,RDConfig *config,
|
||||
|
||||
|
||||
QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
RDConfig *config,const QString &svcname)
|
||||
RDStation *station,RDConfig *config,
|
||||
const QString &svcname)
|
||||
{
|
||||
QString string;
|
||||
int yearnum;
|
||||
@@ -303,6 +308,10 @@ QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
field=config->stationName();
|
||||
break;
|
||||
|
||||
case 'R': // Rivendell Host Short Name
|
||||
field=station->shortName();
|
||||
break;
|
||||
|
||||
case 'S': // Second (SS)
|
||||
field=QString().sprintf("%02d",datetime.time().second());
|
||||
break;
|
||||
|
||||
@@ -23,12 +23,14 @@
|
||||
|
||||
#include <qdatetime.h>
|
||||
|
||||
#include <rdstation.h>
|
||||
#include <rdconfig.h>
|
||||
|
||||
QString RDDateDecode(QString str,const QDate &date,RDConfig *config,
|
||||
const QString &svcname="");
|
||||
QString RDDateDecode(QString str,const QDate &date,RDStation *station,
|
||||
RDConfig *config,const QString &svcname="");
|
||||
QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
RDConfig *config,const QString &svcname="");
|
||||
RDStation *station,RDConfig *config,
|
||||
const QString &svcname="");
|
||||
|
||||
|
||||
#endif // RDDATEDECODE
|
||||
|
||||
@@ -32,9 +32,11 @@
|
||||
#include <rdescape_string.h>
|
||||
#include <rddatedecode.h>
|
||||
|
||||
RDReport::RDReport(const QString &rptname,RDConfig *config,QObject *parent)
|
||||
RDReport::RDReport(const QString &rptname,RDStation *station,RDConfig *config,
|
||||
QObject *parent)
|
||||
{
|
||||
report_name=rptname;
|
||||
report_station=station;
|
||||
report_config=config;
|
||||
report_error_code=RDReport::ErrorOk;
|
||||
}
|
||||
@@ -312,11 +314,11 @@ bool RDReport::outputExists(const QDate &startdate)
|
||||
{
|
||||
QString out_path;
|
||||
#ifdef WIN32
|
||||
out_path=RDDateDecode(exportPath(RDReport::Windows),startdate,report_config,
|
||||
serviceName());
|
||||
out_path=RDDateDecode(exportPath(RDReport::Windows),startdate,report_station,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_config,
|
||||
serviceName());
|
||||
out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_station,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
return QFile::exists(out_path);
|
||||
}
|
||||
@@ -451,7 +453,7 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
|
||||
(const char *)name());
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
svc=new RDSvc(q->value(0).toString(),report_config);
|
||||
svc=new RDSvc(q->value(0).toString(),report_station,report_config);
|
||||
if(svc->exists()) {
|
||||
rec_name=q->value(0).toString();
|
||||
rec_name.replace(" ","_");
|
||||
@@ -602,71 +604,79 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
|
||||
delete q;
|
||||
|
||||
bool ret=false;
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_station,report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_station,report_config,serviceName());
|
||||
#endif
|
||||
|
||||
switch(filter()) {
|
||||
case RDReport::CbsiDeltaFlex:
|
||||
ret=ExportDeltaflex(startdate,enddate,mixname);
|
||||
ret=ExportDeltaflex(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::TextLog:
|
||||
ret=ExportTextLog(startdate,enddate,mixname);
|
||||
ret=ExportTextLog(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::BmiEmr:
|
||||
ret=ExportBmiEmr(startdate,enddate,mixname);
|
||||
ret=ExportBmiEmr(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::NaturalLog:
|
||||
case RDReport::Technical:
|
||||
ret=ExportTechnical(startdate,enddate,true,false,mixname);
|
||||
ret=ExportTechnical(filename,startdate,enddate,true,false,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::SoundExchange:
|
||||
ret=ExportSoundEx(startdate,enddate,mixname);
|
||||
ret=ExportSoundEx(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::NprSoundExchange:
|
||||
ret=ExportNprSoundEx(startdate,enddate,mixname);
|
||||
ret=ExportNprSoundEx(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::RadioTraffic:
|
||||
ret=ExportRadioTraffic(startdate,enddate,mixname);
|
||||
ret=ExportRadioTraffic(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::VisualTraffic:
|
||||
ret=ExportDeltaflex(startdate,enddate,mixname);
|
||||
ret=ExportDeltaflex(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::CounterPoint:
|
||||
case RDReport::WideOrbit:
|
||||
ret=ExportRadioTraffic(startdate,enddate,mixname);
|
||||
ret=ExportRadioTraffic(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::Music1:
|
||||
ret=ExportRadioTraffic(startdate,enddate,mixname);
|
||||
ret=ExportRadioTraffic(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::MusicClassical:
|
||||
ret=ExportMusicClassical(startdate,enddate,mixname);
|
||||
ret=ExportMusicClassical(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::MusicPlayout:
|
||||
ret=ExportMusicPlayout(startdate,enddate,mixname);
|
||||
ret=ExportMusicPlayout(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::SpinCount:
|
||||
ret=ExportSpinCount(startdate,enddate,mixname);
|
||||
ret=ExportSpinCount(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::MusicSummary:
|
||||
ret=ExportMusicSummary(startdate,enddate,mixname);
|
||||
ret=ExportMusicSummary(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::MrMaster:
|
||||
ret=ExportTechnical(startdate,enddate,false,true,mixname);
|
||||
ret=ExportTechnical(filename,startdate,enddate,false,true,mixname);
|
||||
break;
|
||||
|
||||
case RDReport::CutLog:
|
||||
ret=ExportCutLog(startdate,enddate,mixname);
|
||||
ret=ExportCutLog(filename,startdate,enddate,mixname);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -678,10 +688,10 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
|
||||
QString post_cmd=RDDateDecode(postExportCommand(RDReport::Windows),startdate,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
*out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_config,
|
||||
serviceName());
|
||||
*out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_station,
|
||||
report_config,serviceName());
|
||||
QString post_cmd=RDDateDecode(postExportCommand(RDReport::Linux),startdate,
|
||||
report_config,serviceName());
|
||||
report_station,report_config,serviceName());
|
||||
#endif
|
||||
system(post_cmd);
|
||||
// printf("MIXDOWN TABLE: %s_SRT\n",(const char *)mixname);
|
||||
|
||||
@@ -42,7 +42,8 @@ class RDReport
|
||||
enum ExportType {Generic=0,Traffic=1,Music=2};
|
||||
enum StationType {TypeOther=0,TypeAm=1,TypeFm=2,TypeLast=3};
|
||||
enum ErrorCode {ErrorOk=0,ErrorCanceled=1,ErrorCantOpen=2};
|
||||
RDReport(const QString &rptname,RDConfig *config,QObject *parent=0);
|
||||
RDReport(const QString &rptname,RDStation *station,RDConfig *config,
|
||||
QObject *parent=0);
|
||||
QString name() const;
|
||||
bool exists() const;
|
||||
QString description() const;
|
||||
@@ -94,30 +95,31 @@ class RDReport
|
||||
static QString errorText(RDReport::ErrorCode code);
|
||||
|
||||
private:
|
||||
bool ExportDeltaflex(const QDate &startdate,const QDate &enddate,
|
||||
bool ExportDeltaflex(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportTextLog(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportBmiEmr(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportTechnical(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,bool incl_hdr,bool incl_crs,
|
||||
const QString &mixtable);
|
||||
bool ExportTextLog(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportBmiEmr(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportTechnical(const QDate &startdate,const QDate &enddate,
|
||||
bool incl_hdr,bool incl_crs,const QString &mixtable);
|
||||
bool ExportSoundEx(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportNprSoundEx(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportRadioTraffic(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportMusicClassical(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportMusicPlayout(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportMusicSummary(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportSpinCount(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportCutLog(const QDate &startdate,const QDate &enddate,
|
||||
const QString &mixtable);
|
||||
bool ExportSoundEx(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportNprSoundEx(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportRadioTraffic(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportMusicClassical(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportMusicPlayout(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportMusicSummary(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportSpinCount(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
bool ExportCutLog(const QString &filename,const QDate &startdate,
|
||||
const QDate &enddate,const QString &mixtable);
|
||||
QString StringField(const QString &str,const QString &null_text="") const;
|
||||
void SetRow(const QString ¶m,const QString &value) const;
|
||||
void SetRow(const QString ¶m,int value) const;
|
||||
@@ -128,6 +130,7 @@ class RDReport
|
||||
QString OsFieldName(ExportOs os) const;
|
||||
QString TypeFieldName(ExportType type,bool forced) const;
|
||||
QString report_name;
|
||||
RDStation *report_station;
|
||||
RDConfig *report_config;
|
||||
RDReport::ErrorCode report_error_code;
|
||||
};
|
||||
|
||||
@@ -56,6 +56,18 @@ QString RDStation::name() const
|
||||
}
|
||||
|
||||
|
||||
QString RDStation::shortName() const
|
||||
{
|
||||
return RDGetSqlValue("STATIONS","NAME",station_name,"SHORT_NAME").toString();
|
||||
}
|
||||
|
||||
|
||||
void RDStation::setShortName(const QString &str) const
|
||||
{
|
||||
SetRow("SHORT_NAME",str);
|
||||
}
|
||||
|
||||
|
||||
QString RDStation::description() const
|
||||
{
|
||||
return RDGetSqlValue("STATIONS","NAME",station_name,"DESCRIPTION").toString();
|
||||
@@ -678,6 +690,7 @@ bool RDStation::create(const QString &name,QString *err_msg,
|
||||
if(exemplar.isEmpty()) { // Create Blank Host Config
|
||||
sql=QString("insert into STATIONS set ")+
|
||||
"NAME=\""+RDEscapeString(name)+"\","+
|
||||
"SHORT_NAME=\""+RDEscapeString(name)+"\","+
|
||||
"IPV4_ADDRESS=\""+RDEscapeString(addr.toString())+"\","+
|
||||
"DESCRIPTION=\"Workstation "+RDEscapeString(name)+"\","+
|
||||
"USER_NAME=\"user\","+
|
||||
@@ -774,6 +787,7 @@ bool RDStation::create(const QString &name,QString *err_msg,
|
||||
if(q->first()) {
|
||||
sql=QString("insert into STATIONS set ")+
|
||||
"NAME=\""+RDEscapeString(name)+"\","+
|
||||
"SHORT_NAME=\""+RDEscapeString(name)+"\","+
|
||||
"IPV4_ADDRESS=\""+RDEscapeString(addr.toString())+"\","+
|
||||
"DESCRIPTION=\""+RDEscapeString("Workstation "+name)+"\","+
|
||||
"USER_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
|
||||
|
||||
@@ -46,6 +46,8 @@ class RDStation
|
||||
~RDStation();
|
||||
QString name() const;
|
||||
bool exists() const;
|
||||
QString shortName() const;
|
||||
void setShortName(const QString &str) const;
|
||||
QString description() const;
|
||||
void setDescription(QString path) const;
|
||||
QString userName() const;
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
//
|
||||
// Global Classes
|
||||
//
|
||||
RDSvc::RDSvc(QString svcname,RDConfig *config,QObject *parent)
|
||||
RDSvc::RDSvc(QString svcname,RDStation *station,RDConfig *config,QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
svc_name=svcname;
|
||||
svc_station=station;
|
||||
svc_config=config;
|
||||
}
|
||||
|
||||
@@ -338,7 +339,8 @@ QString RDSvc::importFilename(ImportSource src,const QDate &date) const
|
||||
QString ret;
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=RDDateDecode(q->value(0).toString(),date,svc_config,svc_name);
|
||||
ret=RDDateDecode(q->value(0).toString(),date,svc_station,svc_config,
|
||||
svc_name);
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
@@ -418,7 +420,8 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
|
||||
//
|
||||
// Open Source File
|
||||
//
|
||||
if((infile=fopen(RDDateDecode(infilename,date,svc_config,svc_name),"r"))==
|
||||
if((infile=
|
||||
fopen(RDDateDecode(infilename,date,svc_station,svc_config,svc_name),"r"))==
|
||||
NULL) {
|
||||
return false;
|
||||
}
|
||||
@@ -427,7 +430,7 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
|
||||
// Run Preimport Command
|
||||
//
|
||||
if(!preimport_cmd.isEmpty()) {
|
||||
system(RDDateDecode(preimport_cmd,date,svc_config,svc_name));
|
||||
system(RDDateDecode(preimport_cmd,date,svc_station,svc_config,svc_name));
|
||||
}
|
||||
|
||||
QString parser_table;
|
||||
@@ -735,7 +738,7 @@ bool RDSvc::generateLog(const QDate &date,const QString &logname,
|
||||
MODIFIED_DATETIME=now(),START_DATE=null,\
|
||||
END_DATE=null,NEXT_ID=0",
|
||||
(const char *)RDEscapeString(svc_name),
|
||||
(const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_config,svc_name)),
|
||||
(const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_station,svc_config,svc_name)),
|
||||
"RDLogManager");
|
||||
if(!purge_date.isValid()) {
|
||||
sql+=(",PURGE_DATE=\""+purge_date.toString("yyyy-MM-dd")+"\"");
|
||||
@@ -757,7 +760,7 @@ bool RDSvc::generateLog(const QDate &date,const QString &logname,
|
||||
PURGE_DATE=%s",
|
||||
(const char *)RDEscapeString(logname),
|
||||
(const char *)RDEscapeString(svc_name),
|
||||
(const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_config,svc_name)),
|
||||
(const char *)RDEscapeString(RDDateDecode(descriptionTemplate(),date,svc_station,svc_config,svc_name)),
|
||||
"RDLogManager",
|
||||
(const char *)RDCheckDateTime(purge_date,"yyyy-MM-dd"));
|
||||
q=new RDSqlQuery(sql);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <qobject.h>
|
||||
#include <qsqldatabase.h>
|
||||
|
||||
#include <rdstation.h>
|
||||
#include <rdconfig.h>
|
||||
|
||||
class RDSvc : public QObject
|
||||
@@ -37,7 +38,7 @@ class RDSvc : public QObject
|
||||
enum ImportField {CartNumber=0,ExtData=3,ExtEventId=4,ExtAnncType=5,
|
||||
Title=6,StartHours=7,StartMinutes=8,StartSeconds=9,
|
||||
LengthHours=10,LengthMinutes=11,LengthSeconds=12};
|
||||
RDSvc(QString svcname,RDConfig *config,QObject *parent=0);
|
||||
RDSvc(QString svcname,RDStation *station,RDConfig *config,QObject *parent=0);
|
||||
QString name() const;
|
||||
bool exists() const;
|
||||
QString description() const;
|
||||
@@ -111,6 +112,7 @@ class RDSvc : public QObject
|
||||
QString *label_cart,QString *track_cart);
|
||||
bool CheckId(std::vector<int> *v,int value);
|
||||
QString svc_name;
|
||||
RDStation *svc_station;
|
||||
RDConfig *svc_config;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user