Skip to content
Snippets Groups Projects
Commit 49535b95 authored by SeeLook's avatar SeeLook
Browse files

Fixed chart issues when melodies are analyzing

parent c9a19f12
Branches
Tags
No related merge requests found
......@@ -12,10 +12,8 @@
============================================================================
====== BUGS AND ISSUES ===============================================
- melody tip may display result text for every attempt
- played note in single mode wrongly shows enharmonic
- key signatures chart is wrongly scaled when Y axis is different
- Y axis in empty chart has to be adjusted to window height (it has fixed size)
- remove some console debug messages
- clean tartini unused code
......
......@@ -5,6 +5,7 @@
BUGS FIXES
- checking intonation properly respects level accuracy setting
- fixed determining mistake types for melodies
- fixed chart issues when melodies are analyzing
1.1.7 rc2
- improvements/fixes related to low latency and real-time audio
......
......@@ -40,7 +40,7 @@ Tchart::Tchart(QWidget* parent) :
yAxis = new TYaxis();
scene->addItem(yAxis);
yAxis->setLength(400);
yAxis->setLength(300);
yAxis->setMaxValue(3);
yAxis->setPos(45, 0);
yAxis->setZValue(55);
......
......@@ -138,7 +138,7 @@ TlinearChart::TlinearChart(Texam* exam, Tchart::Tsettings& settings, QWidget* pa
for (int i = 0; i < sortedLists.size(); i++)
ln += sortedLists[i].size();
prepareChart(ln);
m_mainLine = new TmainLine(sortedLists, this);
m_mainLine = new TmainLine(sortedLists, this, settings.yValue);
int goodOffset = 0; // 0 when not unrelated question list inside
if (hasListUnrelated)
......
......@@ -30,6 +30,25 @@
// #include <QDebug>
inline qreal TmainLine::yValue(TQAunit* question, TmainLine::EyValue valType) {
switch (valType) {
case e_playedCount:
return m_chart->yAxis->mapValue(question->totalPlayBacks());
case e_prepareTime:
return m_chart->yAxis->mapValue((double)question->attempt(0)->prepareTime() / 10.0);
case e_attemptsCount:
return m_chart->yAxis->mapValue(question->attemptsCount());
case e_effectiveness:
return m_chart->yAxis->mapValue(question->effectiveness());
default:
return m_chart->yAxis->mapValue(question->getTime()); // default - answer time
}
}
//#################################################################################################
//################### PUBLIC ############################################
//#################################################################################################
TmainLine::TmainLine(QList<TQAunit*>* answers, Tchart* chart, TmainLine::EyValue yVal) :
m_answers(answers),
m_chart(chart)
......@@ -42,25 +61,7 @@ TmainLine::TmainLine(QList<TQAunit*>* answers, Tchart* chart, TmainLine::EyValue
m_points << new TquestionPoint(tmpQA);
m_chart->scene->addItem(m_points[i]);
m_points[i]->setZValue(50);
qreal yy;
switch (yVal) {
case e_playedCount:
yy = m_chart->yAxis->mapValue(m_answers->operator[](i)->totalPlayBacks());
break;
case e_prepareTime:
yy = m_chart->yAxis->mapValue((double)m_answers->operator[](i)->attempt(0)->prepareTime() / 10.0);
break;
case e_attemptsCount:
yy = m_chart->yAxis->mapValue(m_answers->operator[](i)->attemptsCount());
break;
case e_effectiveness:
yy = m_chart->yAxis->mapValue(m_answers->operator[](i)->effectiveness());
break;
default:
yy = m_chart->yAxis->mapValue(m_answers->operator[](i)->getTime()); // default - answer time
break;
}
m_points[i]->setPos(xPos, yy);
m_points[i]->setPos(xPos, yValue(m_answers->operator[](i), yVal));
if (i) {
TstaffLineChart *line = new TstaffLineChart();
m_chart->scene->addItem(line);
......@@ -72,7 +73,7 @@ TmainLine::TmainLine(QList<TQAunit*>* answers, Tchart* chart, TmainLine::EyValue
}
TmainLine::TmainLine(QList<TgroupedQAunit>& listOfLists, Tchart* chart) :
TmainLine::TmainLine(QList< TgroupedQAunit >& listOfLists, Tchart* chart, TmainLine::EyValue yVal) :
m_chart(chart)
{
int ln = 0, cnt = 0;
......@@ -86,7 +87,7 @@ TmainLine::TmainLine(QList<TgroupedQAunit>& listOfLists, Tchart* chart) :
m_points << new TquestionPoint(listOfLists[i].operator[](j));
m_chart->scene->addItem(m_points[cnt]);
m_points[cnt]->setZValue(50);
m_points[cnt]->setPos(xPos, m_chart->yAxis->mapValue(listOfLists[i].operator[](j).qaPtr->getTime()));
m_points[cnt]->setPos(xPos, yValue(listOfLists[i].operator[](j).qaPtr, yVal));
if (cnt) {
TstaffLineChart *line = new TstaffLineChart();
m_chart->scene->addItem(line);
......
......@@ -54,9 +54,12 @@ public:
};
TmainLine(QList<TQAunit*> *answers, Tchart *chart, EyValue yVal = e_questionTime);
TmainLine(QList<TgroupedQAunit> &listOfLists, Tchart *chart);
TmainLine(QList<TgroupedQAunit> &listOfLists, Tchart *chart, EyValue yVal = e_questionTime);
virtual ~TmainLine();
protected:
/** Returns answer result (Y value) depend on chart type, mapped to Y axis */
inline qreal yValue(TQAunit* question, EyValue valType);
private:
QList<TQAunit*> *m_answers;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment