Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/icons/battery-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/battery-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/battery-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/battery-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/battery-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/seame-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 40 additions & 14 deletions ui/FootbarInfo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,50 @@ Row {
height: 50
spacing: 30
padding: 10

Column {

Row {
spacing: 5
Text {
font.family: "Open Sans"
text: canBusHandler.battery
font.pixelSize: app.letterSize
color: "white"
}
Text {
font.family: "Open Sans"
text: "%"
font.pixelSize: app.letterSize
color: "gray"

anchors.verticalCenterOffset: -10
Image {
id: batteryLevel
// source: {
// if (canBusHandler.battery >= 80) {
// "qrc:/assets/icons/battery-5.png"
// } else if (canBusHandler.battery >= 60) {
// "qrc:/assets/icons/battery-4.png"
// } else if (canBusHandler.battery >= 40) {
// "qrc:/assets/icons/battery-3.png"
// } else if (canBusHandler.battery >= 20) {
// "qrc:/assets/icons/battery-2.png"
// } else {
// "qrc:/assets/icons/battery-1.png"
// }
// }
width: 80
visible: true
fillMode: Image.PreserveAspectFit
source: "qrc:/assets/icons/battery-5.png"
// Adjust this value to move the image up or down
}
}
// Row {
// spacing: 5

// Text {
// font.family: "Open Sans"
// //text: canBusHandler.battery
// text: "100"
// font.pixelSize: app.letterSize
// color: "white"
// }
// Text {
// font.family: "Open Sans"
// text: "%"
// font.pixelSize: app.letterSize
// color: "gray"
// }
// }
}

Column {
Expand Down Expand Up @@ -55,7 +81,7 @@ Row {
}
Text {
font.family: "Open Sans"
text: "G"
text: "C"
font.pixelSize: app.letterSize
color: "gray"
}
Expand Down
62 changes: 62 additions & 0 deletions ui/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,67 @@ ApplicationWindow {
anchors.left: parent.left
anchors.leftMargin: 70
}

TimeInfo {
anchors.bottom: parent.bottom
anchors.bottomMargin: 60
anchors.right: parent.right
anchors.rightMargin: 70
}
}

// Logo Screen
Rectangle {
id: splashScreen
visible: app.showSplash
anchors.fill: parent
color: "black"

// O retângulo sempre fica visível, mas apenas o logo tem a opacidade animada
Image {
id: logo
source: "qrc:/assets/icons/seame-logo.png" // Substitua pelo logo do carro
anchors.centerIn: parent
width: parent.width * 0.5
height: parent.width * 0.5
fillMode: Image.PreserveAspectFit
opacity: 1.0 // Começa visível

SequentialAnimation {
running: true
loops: 1

// Transição para mostrar o logo
PropertyAnimation {
target: logo
property: "opacity"
from: 0.0
to: 1.0
duration: 3000 // 3 segundos
}

PauseAnimation { duration: 1000 } // Aguarda 1 segundo com o logo visível

// Transição para esconder o logo
PropertyAnimation {
target: logo
property: "opacity"
from: 1.0
to: 0.0
duration: 2000 // 2 segundos
}

PauseAnimation { duration: 1000 } // Aguarda 2 segundos com a tela preta

ScriptAction {
script: {
app.showSplash = false; // Oculta a splash screen
app.carClusterVisible = true; // Mostra o cluster
}
}
}
}
}


}
60 changes: 60 additions & 0 deletions ui/TimeInfo.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import QtQuick 2.15

Row {
spacing: 5

// Hora
Text {
font.family: "Open Sans"
id: timeDisplay
text: "11:11"
font.pixelSize: app.letterSize
color: "white"
opacity: 0.0
}

// AM/PM
Text {
font.family: "Open Sans"
id: amPmDisplay
text: "AM"
font.pixelSize: app.letterSize
color: "gray"
opacity: 0.0
}

Timer {
id: clockTimer
interval: 1000 // Atualiza a cada 1 segundo
running: true
repeat: true
onTriggered: {
timeDisplay.text = timeHelper.getCurrentTime();
timeDisplay.opacity = 1.0

amPmDisplay.text = timeHelper.getCurrentAmPm();
amPmDisplay.opacity = 1.0
}
}

// Funções encapsuladas em um QtObject
QtObject {
id: timeHelper

function getCurrentTime() {
const currentDate = new Date();
let hours = currentDate.getHours();
let minutes = currentDate.getMinutes();

hours = hours % 12 || 12;
minutes = minutes < 10 ? "0" + minutes : minutes

return hours + ":" + minutes;
}

function getCurrentAmPm() {
const currentDate = new Date();
return currentDate.getHours() >= 12 ? "PM" : "AM";
}
}
}
8 changes: 8 additions & 0 deletions ui/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<file>LightInfo.qml</file>
<file>FootbarInfo.qml</file>
<file>GearShiftInfo.qml</file>
<file>TimeInfo.qml</file>

</qresource>

<qresource prefix="/assets/icons">
Expand All @@ -17,5 +19,11 @@
<file alias="parking_lights_on.png">../assets/icons/parking_lights_on.png</file>
<file alias="turn_left_on.png">../assets/icons/turn_left_on.png</file>
<file alias="turn_right_on.png">../assets/icons/turn_right_on.png</file>
<file alias="seame-logo.png">../assets/icons/seame-logo.png</file>
<file alias="battery-1.png">../assets/icons/battery-1.png</file>
<file alias="battery-2.png">../assets/icons/battery-2.png</file>
<file alias="battery-3.png">../assets/icons/battery-3.png</file>
<file alias="battery-4.png">../assets/icons/battery-4.png</file>
<file alias="battery-5.png">../assets/icons/battery-5.png</file>
</qresource>
</RCC>
Loading