Main.qml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. visible: Globals.logoSplashVisible
  26. Component.onCompleted: {
  27. splashTIMER.running = true;
  28. }
  29. }
  30. }
  31. Timer {
  32. id: splashTIMER
  33. interval: 1500
  34. running: false
  35. repeat: false
  36. onTriggered: {
  37. // StackView Start
  38. stackView.push("qrc:/Start_Container.qml");
  39. }
  40. }
  41. //===================================
  42. StackView {
  43. id: stackView
  44. anchors.fill: parent
  45. pushEnter: Transition {
  46. PropertyAnimation {
  47. property: "opacity"
  48. from: 0
  49. to: 1
  50. duration: 50
  51. }
  52. }
  53. pushExit: Transition {
  54. PropertyAnimation {
  55. property: "opacity"
  56. from: 1
  57. to:0
  58. duration: 50
  59. }
  60. }
  61. popEnter: Transition {
  62. PropertyAnimation {
  63. property: "opacity"
  64. from: 0
  65. to:1
  66. duration: 50
  67. }
  68. }
  69. popExit: Transition {
  70. PropertyAnimation {
  71. property: "opacity"
  72. from: 1
  73. to:0
  74. duration: 50
  75. }
  76. }
  77. onBusyChanged: enabled = !busy
  78. }
  79. onWidthChanged: {
  80. console.debug(">>>WIDTH : ", width);
  81. }
  82. onHeightChanged: {
  83. console.debug(">>>HEIGHT : ", height);
  84. }
  85. Component.onCompleted: {
  86. var defrouter = sysinfo.defaultRouter();
  87. //-- Systembeeper off
  88. sysinfo.beepOn(false);
  89. console.log("==========");
  90. //console.log(JSON.stringify(sysinfo.dnsServer()));
  91. console.log("==========");
  92. settings.setValue("MAINQML/start", new Date().toLocaleString("DE-de"));
  93. console.log(">>> LangLoad Start");
  94. transLoad.selectLanguage(settings.value("HMI/Language", "en"));
  95. console.log("<<< LangLoad End");
  96. // if(settings.value("CAM1SETTINGS/IpAddress", "0.0.0.0") !== "0.0.0.0") {
  97. if(0) {
  98. Globals.jsonGetSystem("http://" + settings.value("CAM1SETTINGS/IpAddress", "0.0.0.0") + "/api/v1/command", 1);
  99. }
  100. else {
  101. Globals.cam1Name = "--";
  102. Globals.cam1Model = "--";
  103. Globals.cam1Ver = "--";
  104. }
  105. // if(settings.value("CAM2SETTINGS/IpAddress", "0.0.0.0") !== "0.0.0.0") {
  106. if(0) {
  107. Globals.jsonGetSystem("http://" + settings.value("CAM2SETTINGS/IpAddress", "0.0.0.0") + "/api/v1/command", 2);
  108. }
  109. else {
  110. Globals.cam2Name = "--";
  111. Globals.cam2Model = "--";
  112. Globals.cam2Ver = "--";
  113. }
  114. //splashTIMER.running = true;
  115. }
  116. }