overte-JulianGro/scripts/developer/utilities/audio/MovingValuePair.qml
2016-09-27 10:29:35 -07:00

78 lines
2 KiB
QML

//
// MovingValuePair.qml
// scripts/developer/utilities/audio
//
// Created by Zach Pomerantz on 9/22/2016
// Copyright 2016 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
//
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import "../lib/plotperf"
RowLayout {
id: value
property string label
property string label1
property string label2
property var source1
property var source2
property color color1
property color color2
property string unit: "ms"
property bool showGraphs: false
property int labelPixelWidth: 50
property int dataPixelWidth: 100
Label {
Layout.preferredWidth: 50 - value.spacing
text: value.label
}
ColumnLayout {
RowLayout {
Label {
Layout.preferredWidth: 50
color: value.color1
text: value.label1
}
Label {
visible: !value.showGraphs
Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight
color: value.color1
text: value.source1 + ' ' + unit
}
}
RowLayout {
Label {
Layout.preferredWidth: 50
color: value.color2
text: value.label2
}
Label {
visible: !value.showGraphs
Layout.preferredWidth: 50
horizontalAlignment: Text.AlignRight
color: value.color2
text: value.source2 + ' ' + unit
}
}
}
PlotPerf {
visible: value.showGraphs
Layout.fillWidth: true
height: 70
valueUnit: value.unit
valueNumDigits: 0
backgroundOpacity: 0.2
plots: [{ binding: "source1", color: value.color1 }, { binding: "source2", color: value.color2 }]
}
}