shm.qml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. import QtQuick 2.6
  2. import QtQuick.Window 2.2
  3. import QtQuick.Controls 1.5
  4. import QtQuick.Controls.Styles 1.4
  5. import QtQuick.Controls.Private 1.0
  6. import com.gfa.ipc.appctrl 1.0
  7. import com.gfa.shm._oem_ 1.0
  8. Rectangle {
  9. width: 800
  10. height: 480
  11. /////////////////////////////////////////////////////////////////////////////////////////////////
  12. Rectangle {
  13. x: 10
  14. y: 10
  15. width: parent.width - 20
  16. height: 30
  17. radius: 5
  18. border.width: 1
  19. border.color: "black"
  20. color: "lightgreen"
  21. Image {
  22. anchors.left: parent.left
  23. anchors.verticalCenter: parent.verticalCenter
  24. fillMode: Image.PreserveAspectFit
  25. height: parent.height
  26. source: "qrc:/img/blank.png"
  27. }
  28. Text {
  29. font.pixelSize: 16
  30. font.bold: true
  31. anchors.verticalCenter: parent.verticalCenter
  32. anchors.centerIn: parent
  33. text: "SHM - Bell frames"
  34. }
  35. Image {
  36. anchors.right: parent.right
  37. anchors.verticalCenter: parent.verticalCenter
  38. fillMode: Image.PreserveAspectFit
  39. height: parent.height
  40. source: "qrc:/img/next.png"
  41. MouseArea {
  42. anchors.fill: parent
  43. onClicked: { idPageLoader.source = "appctrl.qml" }
  44. }
  45. }
  46. }
  47. /////////////////////////////////////////////////////////////////////////////////////////////////
  48. Rectangle {
  49. x: 10
  50. y: 40
  51. height: 400
  52. width: parent.width - 20
  53. ListModel {
  54. id: bellFrameModel
  55. Component.onCompleted: {
  56. var i = 0;
  57. bellFrameModel.clear();
  58. for(i = 0; i < qSHM.bellFrames.length; ++i)
  59. {
  60. var bf = qSHM.bellFrames[i];
  61. if(bf.id.val > 0)
  62. {
  63. bellFrameModel.append({"mid": bf.id.val, "type": bf.type.val, "relaisID": bf.relaisID.val,
  64. "startOffsMin": bf.startOffsMin.val, "startOffsSec": bf.startOffsSec.val,
  65. "durationMin": bf.durationMin.val, "durationSec": bf.durationSec.val});
  66. }
  67. }
  68. }
  69. }
  70. TableView {
  71. anchors.fill: parent
  72. model: bellFrameModel
  73. style: TableViewStyle {
  74. itemDelegate: idTableViewItemStyle
  75. headerDelegate: idTableViewHeaderStyle
  76. }
  77. TableViewColumn {
  78. role: "mid"
  79. width: 50
  80. title: "ID"
  81. }
  82. TableViewColumn {
  83. role: "type"
  84. width: 50
  85. title: "Typ"
  86. }
  87. TableViewColumn {
  88. role: "relaisID"
  89. width: 80
  90. title: "Relais"
  91. }
  92. TableViewColumn {
  93. role: "startOffsMin"
  94. width: 100
  95. title: "Start-Min."
  96. }
  97. TableViewColumn {
  98. role: "startOffsSec"
  99. width: 100
  100. title: "Start-Sec."
  101. }
  102. TableViewColumn {
  103. role: "durationMin"
  104. width: 100
  105. title: "Dauer-Min."
  106. }
  107. TableViewColumn {
  108. role: "durationSec"
  109. width: 100
  110. title: "Dauer-Sec."
  111. }
  112. }
  113. }
  114. /////////////////////////////////////////////////////////////////////////////////////////////////
  115. Rectangle {
  116. x: 10
  117. y: 440
  118. height: 30
  119. width: parent.width - 20
  120. Button {
  121. text: "Exit"
  122. anchors.fill: parent
  123. onClicked: Qt.quit()
  124. style: idButtonStyle
  125. }
  126. }
  127. }