Main.qml 3.3 KB

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