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: QT += androidextras
android: TARGET = CUBO-BMS-Tool TARGET = CUBO-BMS-Tool
!android: TARGET = CUBO-BMS-Tool-V$$DT_VERSION
TEMPLATE = app TEMPLATE = app

View File

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