2023-04-12 Fred Gleason <fredg@paravelsystems.com>

* Added 'RDReplicator::roundDownToDow()' methods.
	* Added a 'Westwood One Wegener Portal' replicator.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2023-04-12 12:06:04 -04:00
parent 423e2b0e81
commit 4d95134b13
7 changed files with 580 additions and 42 deletions

View File

@@ -205,6 +205,10 @@ QString RDReplicator::typeString(RDReplicator::Type type)
ret="Citadel X-Digital Portal";
break;
case RDReplicator::TypeWw1Ipump:
ret="Westwood One Wegener Portal";
break;
case RDReplicator::TypeLast:
break;
}
@@ -212,6 +216,22 @@ QString RDReplicator::typeString(RDReplicator::Type type)
}
QDate RDReplicator::roundDownToDow(const QDate &date,int dow)
{
return date.addDays(-(date.dayOfWeek()-dow));
}
QDateTime RDReplicator::roundDownToDow(const QDateTime &dt,int dow)
{
QDateTime ret=dt;
ret.setDate(RDReplicator::roundDownToDow(dt.date(),dow));
return ret;
}
QVariant RDReplicator::GetValue(const QString &field) const
{
QVariant ret;

View File

@@ -28,7 +28,7 @@
class RDReplicator
{
public:
enum Type {TypeCitadelXds=0,TypeLast=1};
enum Type {TypeCitadelXds=0,TypeWw1Ipump=1,TypeLast=2};
RDReplicator(const QString &name);
QString name() const;
RDReplicator::Type type() const;
@@ -58,6 +58,8 @@ class RDReplicator
int normalizeLevel() const;
void setNormalizeLevel(int lvl) const;
QString typeString() const;
static QDate roundDownToDow(const QDate &date,int dow);
static QDateTime roundDownToDow(const QDateTime &dt,int dow);
static QString typeString(RDReplicator::Type type);
private: