Main.qml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import QtQuick 2.5
  2. import QtWebEngine 1.2
  3. import QtQuick.Window 2.1
  4. import QtQuick.Controls 1.4
  5. //import Qt.labs.controls 1.0
  6. import QtQuick.Controls 2.0
  7. import ApplicationLauncher 1.0
  8. import "qrc:/Globals"
  9. Window {
  10. id: mainWIN
  11. visible: true
  12. property QtObject glob: Globals // zum Zugriff auf das Globals Objekt
  13. // Startfenster
  14. Rectangle {
  15. id: splashRECT
  16. anchors.centerIn: parent
  17. width: parent.width * 0.9
  18. height: parent.height * 0.9
  19. Image {
  20. anchors.centerIn: parent
  21. source: Globals.logoSplash
  22. fillMode: Image.PreserveAspectFit
  23. sourceSize.width: parent.width
  24. sourceSize.height: parent.height
  25. height: sourceSize.height
  26. width:sourceSize.width
  27. visible: Globals.logoSplashVisible
  28. Component.onCompleted: {
  29. splashTIMER.running = true;
  30. }
  31. }
  32. }
  33. Timer {
  34. id: splashTIMER
  35. interval: 1500
  36. running: false
  37. repeat: false
  38. onTriggered: {
  39. // StackView Start
  40. stackView.push("qrc:/Start_Container.qml");
  41. }
  42. }
  43. //===================================
  44. StackView {
  45. id: stackView
  46. anchors.fill: parent
  47. pushEnter: Transition {
  48. PropertyAnimation {
  49. property: "opacity"
  50. from: 0
  51. to: 1
  52. duration: 50
  53. }
  54. }
  55. pushExit: Transition {
  56. PropertyAnimation {
  57. property: "opacity"
  58. from: 1
  59. to:0
  60. duration: 50
  61. }
  62. }
  63. popEnter: Transition {
  64. PropertyAnimation {
  65. property: "opacity"
  66. from: 0
  67. to:1
  68. duration: 50
  69. }
  70. }
  71. popExit: Transition {
  72. PropertyAnimation {
  73. property: "opacity"
  74. from: 1
  75. to:0
  76. duration: 50
  77. }
  78. }
  79. onBusyChanged: enabled = !busy
  80. }
  81. onWidthChanged: {
  82. console.debug(">>>WIDTH : ", width);
  83. }
  84. onHeightChanged: {
  85. console.debug(">>>HEIGHT : ", height);
  86. }
  87. Component.onCompleted: {
  88. var defrouter = sysinfo.defaultRouter();
  89. //-- Systembeeper off
  90. sysinfo.beepOn(false);
  91. console.log("==========");
  92. //console.log(JSON.stringify(sysinfo.dnsServer()));
  93. console.log("==========");
  94. settings.setValue("MAINQML/start", new Date().toLocaleString("DE-de"));
  95. console.log(">>> LangLoad Start");
  96. transLoad.selectLanguage(settings.value("HMI/Language", "en"));
  97. console.log("<<< LangLoad End");
  98. // if(settings.value("CAM1SETTINGS/IpAddress", "0.0.0.0") !== "0.0.0.0") {
  99. if(0) {
  100. Globals.jsonGetSystem("http://" + settings.value("CAM1SETTINGS/IpAddress", "0.0.0.0") + "/api/v1/command", 1);
  101. }
  102. else {
  103. Globals.cam1Name = "--";
  104. Globals.cam1Model = "--";
  105. Globals.cam1Ver = "--";
  106. }
  107. // if(settings.value("CAM2SETTINGS/IpAddress", "0.0.0.0") !== "0.0.0.0") {
  108. if(0) {
  109. Globals.jsonGetSystem("http://" + settings.value("CAM2SETTINGS/IpAddress", "0.0.0.0") + "/api/v1/command", 2);
  110. }
  111. else {
  112. Globals.cam2Name = "--";
  113. Globals.cam2Model = "--";
  114. Globals.cam2Ver = "--";
  115. }
  116. //splashTIMER.running = true;
  117. }
  118. }