diff --git a/TODO b/TODO index 9374d6088cd975e72490d6b0e5df584266dd93cf..5163084640932a2aa85432c53d5563475be1fb3c 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/changes b/changes index ba19ee69ab336141b80d7163467e8fd86e4dee8c..5a2905c3d5622602e95c9ae8d4a1fef1cfd52453 100644 --- a/changes +++ b/changes @@ -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 diff --git a/src/plugins/charts/tchart.cpp b/src/plugins/charts/tchart.cpp index 0f9330c639d6b357536f735ff1849fcee6961a3a..b532cb0b0d17e249f42a7d8a788b86c31959991f 100644 --- a/src/plugins/charts/tchart.cpp +++ b/src/plugins/charts/tchart.cpp @@ -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); diff --git a/src/plugins/charts/tlinearchart.cpp b/src/plugins/charts/tlinearchart.cpp index a7ae0011fb9380fd582f5dbe2f14aaff7b360786..ac12719c2fe4ed8a028d0d2e8c91fd006873e730 100644 --- a/src/plugins/charts/tlinearchart.cpp +++ b/src/plugins/charts/tlinearchart.cpp @@ -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) diff --git a/src/plugins/charts/tmainline.cpp b/src/plugins/charts/tmainline.cpp index cebf39d736f721e99141015c7c1318252759a956..eee9b9fd1ceee8990b00260d8767e995fd3078c3 100644 --- a/src/plugins/charts/tmainline.cpp +++ b/src/plugins/charts/tmainline.cpp @@ -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); diff --git a/src/plugins/charts/tmainline.h b/src/plugins/charts/tmainline.h index dcabf95287e9bc9023b1c4801b19f8355f7d9be9..ba75869883b6b554817ed71d8ae57c91c2ef0a33 100644 --- a/src/plugins/charts/tmainline.h +++ b/src/plugins/charts/tmainline.h @@ -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;