Fixed point info display on visualization screen. Removed version number from app name

This commit is contained in:
Yury Shuvakin
2022-11-28 06:32:26 +03:00
parent 92c3e42039
commit 7c732215ec
2 changed files with 14 additions and 9 deletions

View File

@@ -38,8 +38,7 @@ contains(DEFINES, HAS_SERIALPORT) {
android: QT += androidextras
android: TARGET = CUBO-BMS-Tool
!android: TARGET = CUBO-BMS-Tool-V$$DT_VERSION
TARGET = CUBO-BMS-Tool
TEMPLATE = app

View File

@@ -174,20 +174,26 @@ ChartView {
}
function updatePointInfo() {
var currentPointVisibility = mouseX >= chart.plotArea.x && mouseX <= chart.plotArea.x + chart.plotArea.width &&
let currentPointVisibility = mouseX >= chart.plotArea.x && mouseX <= chart.plotArea.x + chart.plotArea.width &&
mouseY >= chart.plotArea.y && mouseY <= chart.plotArea.y + chart.plotArea.height
currentPointInfo.visible = currentPointVisibility
currentPointInfo.x = mouseX + 5
currentPointInfo.y = mouseY - currentPointInfo.height - 5
var currentX = Math.ceil(mapToValue(Qt.point(mouseX, mouseY), chart.series(selectedSeriesIndex)).x)
var selectedPoint = Qt.point(0, 0)
let currentX = mapToValue(Qt.point(mouseX, mouseY), chart.series(selectedSeriesIndex)).x
let selectedPoint = Qt.point(0, 0)
if (currentX < chart.series(selectedSeriesIndex).count && currentX > 0) {
selectedPoint = chart.series(selectedSeriesIndex).at(currentX)
for(let i = 0; i < chart.series(selectedSeriesIndex).count; ++i) {
let point = chart.series(selectedSeriesIndex).at(i)
if (point.x > currentX || i === chart.series(selectedSeriesIndex).count - 1) {
selectedPoint = chart.series(selectedSeriesIndex).at(i)
currentPointInfoLabel.text = selectedPoint.x + " " + infoXMark + ", " + selectedPoint.y + " " + infoYMark
} else {
break
}
}
if (chart.series(selectedSeriesIndex).count === 0) {
currentPointInfo.visible = false
}