2
0

SensorsTab.qml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.fillHeight: true
  34. border.width: 1
  35. border.color: "black"
  36. radius: 5
  37. Column {
  38. id: column
  39. anchors.fill: parent
  40. Text {
  41. anchors.horizontalCenter: parent.horizontalCenter
  42. text: hwmon.name
  43. horizontalAlignment: Text.horizontalCenter
  44. }
  45. Repeater {
  46. model: hwmon.fans.length
  47. RowLayout {
  48. width: parent.width
  49. Text {
  50. anchors.left: parent.left
  51. anchors.leftMargin: padding
  52. Layout.maximumWidth: parent.width - rpmValue.width - padding*2
  53. clip: true
  54. text: "Fan " + (index+1) + " RPM : "
  55. }
  56. Text {
  57. id: rpmValue
  58. anchors.right: parent.right
  59. anchors.rightMargin: padding
  60. text: hwmon.fans[index].rpm
  61. }
  62. }
  63. }
  64. Repeater {
  65. model: hwmon.temps.length
  66. RowLayout {
  67. width: parent.width
  68. Text {
  69. anchors.left: parent.left
  70. anchors.leftMargin: padding
  71. text: hwmon.temps[index].label + ": "
  72. Layout.maximumWidth: parent.width - tempValue.width - padding*2
  73. clip: true
  74. }
  75. Text {
  76. id: tempValue
  77. anchors.right: parent.right
  78. anchors.rightMargin: padding
  79. text: hwmon.temps[index].value
  80. }
  81. }
  82. }
  83. }
  84. }
  85. }
  86. }