2
0

SensorsTab.qml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (C) 2015 Malte Veerman <maldela@halloarsch.de>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. *
  18. */
  19. import QtQuick 2.4
  20. import QtQuick.Controls 1.2
  21. import QtQuick.Layouts 1.1
  22. import "../javascript/arrayfunctions.js" as ArrayFunctions
  23. RowLayout {
  24. id: root
  25. anchors.fill: parent
  26. anchors.topMargin: 10
  27. Repeater {
  28. model: loader.hwmons.length
  29. Rectangle {
  30. property var hwmon: loader.hwmons[index]
  31. property int padding: 10
  32. Layout.preferredWidth: root.width / loader.hwmons.length - root.spacing
  33. Layout.maximumWidth: 500
  34. Layout.fillHeight: true
  35. border.width: 1
  36. border.color: "black"
  37. radius: 5
  38. Column {
  39. id: column
  40. anchors.fill: parent
  41. Text {
  42. anchors.horizontalCenter: parent.horizontalCenter
  43. text: hwmon.name
  44. horizontalAlignment: Text.horizontalCenter
  45. }
  46. Repeater {
  47. model: hwmon.fans.length
  48. RowLayout {
  49. width: parent.width
  50. Text {
  51. anchors.left: parent.left
  52. anchors.leftMargin: padding
  53. Layout.maximumWidth: parent.width - rpmValue.width - padding*2
  54. clip: true
  55. text: "Fan " + (index+1) + " RPM : "
  56. }
  57. Text {
  58. id: rpmValue
  59. anchors.right: parent.right
  60. anchors.rightMargin: padding
  61. text: hwmon.fans[index].rpm
  62. }
  63. }
  64. }
  65. Repeater {
  66. model: hwmon.temps.length
  67. RowLayout {
  68. width: parent.width
  69. Text {
  70. anchors.left: parent.left
  71. anchors.leftMargin: padding
  72. text: hwmon.temps[index].label + ": "
  73. Layout.maximumWidth: parent.width - tempValue.width - padding*2
  74. clip: true
  75. }
  76. Text {
  77. id: tempValue
  78. anchors.right: parent.right
  79. anchors.rightMargin: padding
  80. text: hwmon.temps[index].value
  81. }
  82. }
  83. }
  84. }
  85. }
  86. }
  87. }