Use the maximum test-age for subjects past that age

This commit is contained in:
Michael Mandl 2019-01-27 20:09:10 +01:00
parent 97192b6190
commit c044bebece
3 changed files with 9 additions and 9 deletions

View file

@ -166,3 +166,8 @@ std::string MetaDataModel::toHtml() const
return out.str(); return out.str();
} }
Age MetaDataModel::getAge() const
{
return {m_dateOfBirth, m_dateOfTest};
}

View file

@ -24,19 +24,14 @@ public:
MetaDataModel(QObject *parent); MetaDataModel(QObject *parent);
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data( QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
const QModelIndex &index, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override; Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex &index, const QVariant &value, bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
int role = Qt::EditRole) override;
void read(const ESGRAF48::MetaDataModel &model); void read(const ESGRAF48::MetaDataModel &model);
void write(ESGRAF48::MetaDataModel &model) const; void write(ESGRAF48::MetaDataModel &model) const;
std::string toHtml() const; std::string toHtml() const;
Age getAge() const Age getAge() const;
{
return { m_dateOfBirth, m_dateOfTest };
}
}; };

View file

@ -20,7 +20,7 @@ unsigned int PRMap::lookup(const Age &age, const unsigned int &points)
if (m_ages.back() < age) if (m_ages.back() < age)
{ {
return m_ages.size() - 1; return m_ages.size() - 2;
} }
for (size_t index = 1; index < m_ages.size(); ++index) for (size_t index = 1; index < m_ages.size(); ++index)