Added D-Region Absorption Predictions

This commit is contained in:
Marco Dalla Tiezza
2024-05-31 19:59:51 +02:00
parent 359e5c9076
commit 3fdbdbfae4
6 changed files with 1561 additions and 153 deletions

View File

@@ -22,6 +22,7 @@
<file>images/icons/documents.svg</file> <file>images/icons/documents.svg</file>
<file>images/icons/abort.svg</file> <file>images/icons/abort.svg</file>
<file>images/spectrum_not_available.svg</file> <file>images/spectrum_not_available.svg</file>
<file>images/artemis_not_available.svg</file>
<file>ui/Artemis.qml</file> <file>ui/Artemis.qml</file>
<file>ui/DbManager.qml</file> <file>ui/DbManager.qml</file>
@@ -37,6 +38,7 @@
<file>ui/SignalPage.qml</file> <file>ui/SignalPage.qml</file>
<file>ui/SpaceWeatherCurrentPage.qml</file> <file>ui/SpaceWeatherCurrentPage.qml</file>
<file>ui/SpaceWeatherForecastPage.qml</file> <file>ui/SpaceWeatherForecastPage.qml</file>
<file>ui/SpaceWeatherDRAPPage.qml</file>
<file>ui/About.qml</file> <file>ui/About.qml</file>

File diff suppressed because it is too large Load Diff

View File

@@ -12,6 +12,7 @@ class UIspaceweather(QObject):
show_ui = Signal() show_ui = Signal()
load_poseidon_report = Signal(dict) load_poseidon_report = Signal(dict)
load_poseidon_forecast_report = Signal(dict) load_poseidon_forecast_report = Signal(dict)
load_poseidon_drap_report = Signal(dict)
update_bottom_bar = Signal(str) update_bottom_bar = Signal(str)
@@ -26,6 +27,7 @@ class UIspaceweather(QObject):
self._window_current = self._window.findChild(QObject, "spaceWeatherCurrentObj") self._window_current = self._window.findChild(QObject, "spaceWeatherCurrentObj")
self._window_forecast = self._window.findChild(QObject, "spaceWeatherForecastObj") self._window_forecast = self._window.findChild(QObject, "spaceWeatherForecastObj")
self._window_drap = self._window.findChild(QObject, "spaceWeatherDRAPObj")
self._connect() self._connect()
@@ -38,6 +40,7 @@ class UIspaceweather(QObject):
self.update_bottom_bar.connect(self._window.updateBottomBar) self.update_bottom_bar.connect(self._window.updateBottomBar)
self.load_poseidon_report.connect(self._window_current.loadReport) self.load_poseidon_report.connect(self._window_current.loadReport)
self.load_poseidon_forecast_report.connect(self._window_forecast.loadForecastReport) self.load_poseidon_forecast_report.connect(self._window_forecast.loadForecastReport)
self.load_poseidon_drap_report.connect(self._window_drap.loadDrapReport)
def load_spaceweather_ui(self): def load_spaceweather_ui(self):
@@ -55,6 +58,7 @@ class UIspaceweather(QObject):
if poseidon_data: if poseidon_data:
self.load_poseidon_report.emit(poseidon_data) self.load_poseidon_report.emit(poseidon_data)
self.load_poseidon_forecast_report.emit(poseidon_data) self.load_poseidon_forecast_report.emit(poseidon_data)
self.load_poseidon_drap_report.emit(poseidon_data)
self.update_bottom_bar.emit( self.update_bottom_bar.emit(
'Loaded Poseidon report issued on {} at {} UTC'.format( 'Loaded Poseidon report issued on {} at {} UTC'.format(

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -50,6 +50,9 @@ Window {
TabButton { TabButton {
text: qsTr("Forecasts") text: qsTr("Forecasts")
} }
TabButton {
text: qsTr("DRAP")
}
} }
StackLayout { StackLayout {
@@ -68,6 +71,12 @@ Window {
id: spaceWeatherForecastPage id: spaceWeatherForecastPage
} }
} }
Item {
SpaceWeatherDRAPPage {
id: spaceWeatherDRAPPage
}
}
} }
} }
} }

107
ui/SpaceWeatherDRAPPage.qml Normal file
View File

@@ -0,0 +1,107 @@
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Layouts
Page {
id: spaceWeatherDRAP
anchors.fill: parent
objectName: "spaceWeatherDRAPObj"
function loadDrapReport(poseidon_data) {
labelRecovery.text = poseidon_data['DRAP']['Recovery Time']
labelXrayMsg.text = poseidon_data['DRAP']['XRay Msg']
labelProtonMsg.text = poseidon_data['DRAP']['Proton Msg']
checkUrlExists("https://www.aresvalley.com/poseidon_engine/drap.png", function(exists) {
if (exists) {
imageBox.source = "https://www.aresvalley.com/poseidon_engine/drap.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
}
RowLayout {
Item {
Layout.fillWidth: true
}
Label {
text: qsTr("RECOVERY TIME:")
Layout.fillWidth: false
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
Label {
id: labelRecovery
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
font.pointSize: 12
font.bold: true
}
Item {
Layout.fillWidth: true
}
}
RowLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.fillWidth: true
ColumnLayout {
Label {
text: qsTr("X-RAY STATUS")
}
Label {
id: labelXrayMsg
font.pointSize: 12
font.bold: true
}
}
Item {
Layout.fillWidth: true
}
ColumnLayout {
Label {
text: qsTr("PROTON STATUS")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
}
Label {
id: labelProtonMsg
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
font.pointSize: 12
font.bold: true
}
}
}
}
}