Artemis 4 RC1

This commit is contained in:
Marco Dalla Tiezza
2024-05-28 22:40:45 +02:00
parent acc44c93b3
commit 528c816508
254 changed files with 14757 additions and 30137 deletions

View File

@@ -0,0 +1,140 @@
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Layouts
Item {
function setLights(aIndex) {
resetLights()
if (aIndex >= 0 && aIndex < 8) {
rect0.color = "#539bff"
} else if (aIndex >= 8 && aIndex < 16) {
rect1.color = "#0ccf43"
} else if (aIndex >= 16 && aIndex < 30) {
rect2.color = "#f0e000"
} else if (aIndex >= 30 && aIndex < 50) {
rect3.color = "#ffb700"
} else if (aIndex >= 50 && aIndex < 100) {
rect4.color = "#ff7b00"
} else if (aIndex >= 100) {
rect5.color = "#e80000"
}
}
function resetLights() {
rect0.color = "#2b4d7f"
rect1.color = "#076823"
rect2.color = "#797200"
rect3.color = "#815f00"
rect4.color = "#814100"
rect5.color = "#750300"
}
ColumnLayout {
anchors.fill: parent
spacing: 0
Rectangle {
id: rect5
color: "#750300"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
topLeftRadius: 10
topRightRadius: 10
Label {
text: qsTr("SEVERE STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.2
}
}
Rectangle {
id: rect4
color: "#814100"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("MAJOR STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.2
}
}
Rectangle {
id: rect3
color: "#815f00"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("MINOR STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.2
}
}
Rectangle {
id: rect2
color: "#797200"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("ACTIVE")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.2
}
}
Rectangle {
id: rect1
color: "#076823"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("UNSETTLED")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.2
}
}
Rectangle {
id: rect0
color: "#2b4d7f"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
bottomLeftRadius: 10
bottomRightRadius: 10
Label {
text: qsTr("QUIET")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.2
}
}
}
}

View File

@@ -0,0 +1,156 @@
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Material
import QtMultimedia
Item {
width: 200
height: 80
property bool loop: false
function loadSound(audio_path) {
player.stop()
player.source = audio_path
buttonPlay.icon.color = Material.accent
buttonPlay.enabled = true
buttonLoop.enabled = true
}
function playSound() {
buttonPlay.icon.color = Material.foreground
buttonPause.icon.color = Material.accent
buttonStop.icon.color = Material.accent
buttonPlay.enabled = false
buttonPause.enabled = true
buttonStop.enabled = true
buttonLoop.enabled = true
playerPosition.enabled = player.seekable
player.play()
}
function pauseSound() {
buttonPlay.icon.color = Material.accent
buttonPause.icon.color = Material.foreground
buttonPlay.enabled = true
buttonPause.enabled = false
player.pause()
}
function stopSound() {
buttonPlay.icon.color = Material.accent
buttonPause.icon.color = Material.foreground
buttonStop.icon.color = Material.foreground
buttonLoop.icon.color = Material.foreground
buttonPlay.enabled = true
buttonPause.enabled = false
buttonStop.enabled = false
buttonLoop.enabled = false
loop = false
player.stop()
}
function resetPlayer() {
player.stop()
player.source = ''
loop = false
buttonPlay.icon.color = Material.foreground
buttonPause.icon.color = Material.foreground
buttonStop.icon.color = Material.foreground
buttonLoop.icon.color = Material.foreground
buttonPlay.enabled = false
buttonPause.enabled = false
buttonStop.enabled = false
buttonLoop.enabled = false
playerPosition.enabled = false
}
ColumnLayout {
RowLayout {
spacing: 0
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
RoundButton {
id: buttonPlay
icon.color: Material.foreground
icon.source: "qrc:/images/icons/player_play.svg"
display: AbstractButton.IconOnly
enabled: false
flat: true
onClicked: playSound()
}
RoundButton {
id: buttonPause
icon.color: Material.foreground
icon.source: "qrc:/images/icons/player_pause.svg"
display: AbstractButton.IconOnly
enabled: false
flat: true
onClicked: pauseSound()
}
RoundButton {
id: buttonStop
icon.color: Material.foreground
icon.source: "qrc:/images/icons/player_stop.svg"
display: AbstractButton.IconOnly
enabled: false
flat: true
onClicked: stopSound()
}
RoundButton {
id: buttonLoop
icon.color: Material.foreground
icon.source: "qrc:/images/icons/player_loop.svg"
display: AbstractButton.IconOnly
enabled: false
flat: true
onClicked: {
if (loop) {
loop = false
icon.color = Material.foreground
} else {
loop = true
icon.color = Material.accent
}
}
}
}
Slider {
id: playerPosition
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.preferredHeight: 20
enabled: player.seekable
value: player.duration > 0 ? player.position / player.duration : 0
onMoved: {
player.position = player.duration * playerPosition.position
}
}
MediaPlayer {
id: player
audioOutput: audioOutput
onPlaybackStateChanged: {
if (player.playbackState === MediaPlayer.StoppedState) {
if (loop) {
playSound()
} else {
stopSound()
}
}
}
}
AudioOutput {
id: audioOutput
//volume: volumeSlider.value
}
}
}

261
ui/components/BandBar.qml Normal file
View File

@@ -0,0 +1,261 @@
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Material
Item {
width: 400
height: 20
function setBandBar(lof, upf) {
resetBandBar()
if (lof < 30) {
selector.anchors.left = rectangleELF.left
} else if (lof >= 30 && lof < 300) {
selector.anchors.left = rectangleSLF.left
} else if (lof >= 300 && lof < 3000) {
selector.anchors.left = rectangleULF.left
} else if (lof >= 3000 && lof < 30000) {
selector.anchors.left = rectangleVLF.left
} else if (lof >= 30000 && lof < 300000) {
selector.anchors.left = rectangleLF.left
} else if (lof >= 300000 && lof < 3000000) {
selector.anchors.left = rectangleMF.left
} else if (lof >= 3000000 && lof < 30000000) {
selector.anchors.left = rectangleHF.left
} else if (lof >= 30000000 && lof < 300000000) {
selector.anchors.left = rectangleVHF.left
} else if (lof >= 300000000 && lof < 3000000000) {
selector.anchors.left = rectangleUHF.left
} else if (lof >= 3000000000 && lof < 30000000000) {
selector.anchors.left = rectangleSHF.left
} else if (lof >= 30000000000 && lof < 300000000000) {
selector.anchors.left = rectangleEHF.left
}
if (upf < 30) {
selector.anchors.right = rectangleELF.right
} else if (upf >= 30 && upf < 300) {
selector.anchors.right = rectangleSLF.right
} else if (upf >= 300 && upf < 3000) {
selector.anchors.right = rectangleULF.right
} else if (upf >= 3000 && upf < 30000) {
selector.anchors.right = rectangleVLF.right
} else if (upf >= 30000 && upf < 300000) {
selector.anchors.right = rectangleLF.right
} else if (upf >= 300000 && upf < 3000000) {
selector.anchors.right = rectangleMF.right
} else if (upf >= 3000000 && upf < 30000000) {
selector.anchors.right = rectangleHF.right
} else if (upf >= 30000000 && upf < 300000000) {
selector.anchors.right = rectangleVHF.right
} else if (upf >= 300000000 && upf < 3000000000) {
selector.anchors.right = rectangleUHF.right
} else if (upf >= 3000000000 && upf < 30000000000) {
selector.anchors.right = rectangleSHF.right
} else if (upf >= 30000000000 && upf < 300000000000) {
selector.anchors.right = rectangleEHF.right
}
}
function resetBandBar() {
selector.anchors.left = container.left
selector.anchors.right = container.left
}
Rectangle {
id: container
radius: 13
anchors.fill: parent
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop {
position: 0
color: "#1a000000"
}
GradientStop {
position: 0.5
color: "#26000000"
}
GradientStop {
position: 1
color: "#1a000000"
}
}
Rectangle {
id: rectangleELF
width: parent.width/11
anchors.left: parent.left
anchors.right: rectangleSLF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("ELF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleSLF
width: parent.width/11
anchors.right: rectangleULF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("SLF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleULF
width: parent.width/11
anchors.right: rectangleVLF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("ULF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleVLF
width: parent.width/11
anchors.right: rectangleLF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("VLF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleLF
width: parent.width/11
anchors.right: rectangleMF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("LF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleMF
width: parent.width/11
anchors.right: rectangleHF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("MF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleHF
width: parent.width/11
anchors.right: rectangleVHF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("HF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleVHF
width: parent.width/11
anchors.right: rectangleUHF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("VHF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleUHF
width: parent.width/11
anchors.right: rectangleSHF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("UHF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleSHF
width: parent.width/11
anchors.right: rectangleEHF.left
height: 20
color: "#00ffffff"
Label {
text: qsTr("SHF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: rectangleEHF
width: parent.width/11
anchors.right: parent.right
height: 20
color: "#00ffffff"
Label {
text: qsTr("EHF")
font.bold: true
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
Rectangle {
id: selector
height: 20
color: Material.accent
radius: 10
z: -1
}
}
}

View File

@@ -0,0 +1,216 @@
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Layouts
Item {
function setLights(kIndex) {
resetLights()
if (kIndex === 0) {
rect0.color = "#539bff"
} else if (kIndex === 1) {
rect1.color = "#0ccf43"
} else if (kIndex === 2) {
rect2.color = "#0ccf43"
} else if (kIndex === 3) {
rect3.color = "#f0e000"
} else if (kIndex === 4) {
rect4.color = "#f0e000"
} else if (kIndex === 5) {
rect5.color = "#ffb700"
} else if (kIndex === 6) {
rect6.color = "#ff7b00"
} else if (kIndex === 7) {
rect7.color = "#e80000"
} else if (kIndex === 8) {
rect8.color = "#e80000"
} else if (kIndex === 9) {
rect9.color = "#e80000"
}
}
function resetLights() {
rect0.color = "#2b4d7f"
rect1.color = "#076823"
rect2.color = "#076823"
rect3.color = "#797200"
rect4.color = "#797200"
rect5.color = "#815f00"
rect6.color = "#814100"
rect7.color = "#750300"
rect8.color = "#750300"
rect9.color = "#750300"
}
ColumnLayout {
anchors.fill: parent
spacing: 0
Rectangle {
id: rect9
color: "#750300"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
topLeftRadius: 10
topRightRadius: 10
Label {
text: qsTr("SUPER STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect8
color: "#750300"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("EXTREME STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect7
color: "#750300"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("SEVERE STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect6
color: "#814100"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("MAJOR STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect5
color: "#815f00"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("MINOR STORM")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect4
color: "#797200"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("ACTIVE")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect3
color: "#797200"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("UNSETTLED")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect2
color: "#076823"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("QUIET")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect1
color: "#076823"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Label {
text: qsTr("VERY QUIET")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
Rectangle {
id: rect0
color: "#2b4d7f"
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
bottomLeftRadius: 10
bottomRightRadius: 10
Label {
text: qsTr("INACTIVE")
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: parent.height*0.3
}
}
}
}