From 0290988cff80ffdcb7291e576cfe37169b53a22f Mon Sep 17 00:00:00 2001 From: Ashley Blewer Date: Tue, 29 May 2018 16:55:06 -0400 Subject: [PATCH] clarifies current value in bar chart tooltip --- Source/GUI/Plot.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/GUI/Plot.h b/Source/GUI/Plot.h index e77a0e63f..a8620eab0 100644 --- a/Source/GUI/Plot.h +++ b/Source/GUI/Plot.h @@ -297,7 +297,7 @@ class PlotSeriesData : public QObject, public QwtPointSeriesData auto plotGroup = m_plotGroup; engine.globalObject().setProperty("yHalf", (::pow(2, bitdepth)) / 2); - autocomplete << QPair("yHalf", QString("2^(bitdepth) / 2 = %1").arg(engine.globalObject().property("yHalf").toInt())); + autocomplete << QPair("yHalf", QString("2^(bitdepth) / 2 (Current value = %1)").arg(engine.globalObject().property("yHalf").toInt())); auto pow2 = engine.evaluate("function(value) { return Math.pow(value, 2); }"); engine.globalObject().setProperty("pow2", pow2); @@ -318,7 +318,7 @@ class PlotSeriesData : public QObject, public QwtPointSeriesData if(plotGroup == Group_Y || plotGroup == Group_U || plotGroup == Group_V || plotGroup == Group_YDiff || plotGroup == Group_UDiff || plotGroup == Group_VDiff) { engine.globalObject().setProperty("maxval", ::pow(2, bitdepth)); - autocomplete << QPair("maxval", QString("2^bitdepth = %1").arg(engine.globalObject().property("maxval").toInt())); + autocomplete << QPair("maxval", QString("2^bitdepth (Current value = %1)").arg(engine.globalObject().property("maxval").toInt())); engine.globalObject().setProperty("minval", 0); autocomplete << QPair("minval", QString("0")); @@ -326,28 +326,28 @@ class PlotSeriesData : public QObject, public QwtPointSeriesData if(plotGroup == Group_Y || plotGroup == Group_YDiff) { engine.globalObject().setProperty("broadcastmaxval", 235 * (::pow(2, bitdepth - 8))); - autocomplete << QPair("broadcastmaxval", QString("235 * (2^(bitdepth - 8)) = %1").arg(engine.globalObject().property("broadcastmaxval").toInt())); + autocomplete << QPair("broadcastmaxval", QString("235 * (2^(bitdepth - 8)) (Current value = %1)").arg(engine.globalObject().property("broadcastmaxval").toInt())); } else if(plotGroup == Group_U || plotGroup == Group_UDiff || plotGroup == Group_V || plotGroup == Group_VDiff) { engine.globalObject().setProperty("broadcastmaxval", 240 * (::pow(2, bitdepth - 8))); - autocomplete << QPair("broadcastmaxval", QString("240 * (2^(bitdepth - 8)) = %1").arg(engine.globalObject().property("broadcastmaxval").toInt())); + autocomplete << QPair("broadcastmaxval", QString("240 * (2^(bitdepth - 8)) (Current value = %1)").arg(engine.globalObject().property("broadcastmaxval").toInt())); } engine.globalObject().setProperty("broadcastminval", 16 * (::pow(2, bitdepth - 8))); - autocomplete << QPair("broadcastminval", QString("16 * (2^(bitdepth - 8)) = %1").arg(engine.globalObject().property("broadcastminval").toInt())); + autocomplete << QPair("broadcastminval", QString("16 * (2^(bitdepth - 8)) (Current value = %1)").arg(engine.globalObject().property("broadcastminval").toInt())); } else if(plotGroup == Group_Sat) { engine.globalObject().setProperty("satmax", sqrt(2 * ::pow(::pow(2, bitdepth)/2,2) )); - autocomplete << QPair("satmax", QString("sqrt(2*((2^bitdepth)/2)^2) = %1").arg(engine.globalObject().property("satmax").toInt())); + autocomplete << QPair("satmax", QString("sqrt(2*((2^bitdepth)/2)^2) (Current value = %1)").arg(engine.globalObject().property("satmax").toInt())); /* use the hypotenuse of green plotted in Cb/Cr based on ITU BT.601 values as the satyuvmax */ engine.globalObject().setProperty("satyuvmax", sqrt(::pow(-74.203,2)+::pow(93.786,2)) * (::pow(2, bitdepth - 8))); - autocomplete << QPair("satyuvmax", QString("sqrt(-74.203^2+93.786^2) * (2^(bitdepth - 8)) = %1").arg(engine.globalObject().property("satyuvmax").toInt())); + autocomplete << QPair("satyuvmax", QString("sqrt(-74.203^2+93.786^2) * (2^(bitdepth - 8)) (Current value = %1)").arg(engine.globalObject().property("satyuvmax").toInt())); /* 75% of satyuvmax as satbroadcastmax */ engine.globalObject().setProperty("satbroadcastmax", sqrt(::pow(-74.203,2)+::pow(93.786,2)) * (::pow(2, bitdepth - 8)) * 0.75); - autocomplete << QPair("satbroadcastmax", QString("sqrt(-74.203^2+93.786^2) * (2^(bitdepth - 8)) * 0.75 = %1").arg(engine.globalObject().property("satbroadcastmax").toInt())); + autocomplete << QPair("satbroadcastmax", QString("sqrt(-74.203^2+93.786^2) * (2^(bitdepth - 8)) * 0.75 (Current value = %1)").arg(engine.globalObject().property("satbroadcastmax").toInt())); } engine.setProperty("autocomplete", QVariant::fromValue(autocomplete));