Added Aurora Forecast Model

This commit is contained in:
Marco Dalla Tiezza
2024-06-01 11:48:27 +02:00
parent 3fdbdbfae4
commit c6afcc0e75
5 changed files with 204 additions and 48 deletions

View File

@@ -53,6 +53,9 @@ Window {
TabButton {
text: qsTr("DRAP")
}
TabButton {
text: qsTr("Aurora")
}
}
StackLayout {
@@ -77,6 +80,12 @@ Window {
id: spaceWeatherDRAPPage
}
}
Item {
SpaceWeatherAuroraPage {
id: spaceWeatherAuroraPage
}
}
}
}
}

View File

@@ -0,0 +1,49 @@
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Layouts
Page {
id: spaceWeatherAurora
anchors.fill: parent
objectName: "spaceWeatherAuroraObj"
function loadAuroraReport() {
checkUrlExists("https://www.aresvalley.com/poseidon_engine/aurora.png", function(exists) {
if (exists) {
imageBox.source = "https://www.aresvalley.com/poseidon_engine/aurora.png"
} else {
imageBox.source = "qrc:///images/artemis_not_available.svg"
}
})
}
function checkUrlExists(url, callback) {
var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
callback(xhr.status === 200)
}
}
xhr.open("HEAD", url, true)
xhr.send()
}
ColumnLayout {
anchors.fill: parent
anchors.rightMargin: 20
anchors.leftMargin: 20
anchors.bottomMargin: 20
anchors.topMargin: 20
Image {
id: imageBox
Layout.fillHeight: true
Layout.fillWidth: true
fillMode: Image.PreserveAspectFit
}
}
}