Commit 2303b694 authored by Ionut Alexandrescu's avatar Ionut Alexandrescu

Add The info and maps popups

General improuvments of the general logic
- Reset to the initial state when the charging is done
- Add the promotion spot video
parent 754342c8
......@@ -69,6 +69,7 @@ Item {
batteryBar.topValue = batteryItem.chargedPercentage;
if ( chargedPercentage >= topUpCharge )
{
chargedPercentage = topUpCharge;
batteryItem.chargingStarted = false;
batteryItem.signalChargeCompleted();
}
......
QT += qml quick
QT += qml quick multimedia
CONFIG += c++11
SOURCES += main.cpp
......
This diff is collapsed.
......@@ -16,6 +16,7 @@ Item {
property alias rightButtonEnabled: rightButton.enabled
property alias pageIndicatorcurrentIndex: pageIndicator.currentIndex
property alias pageIndicatorcount: pageIndicator.count
property alias pageIndicatorVisible: pageIndicator.opacity
RowLayout {
anchors.fill: parent
......@@ -32,6 +33,7 @@ Item {
PageIndicator {
id: pageIndicator
opacity: 0
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
}
......
......@@ -11,6 +11,7 @@ Button {
width: 150
font.pointSize: Variables.footerButtonPoints
flat: true
opacity: 0
contentItem: Label {
color: "#ffffff"
......
......@@ -4,7 +4,9 @@ import QtQuick.Layouts 1.3
Item {
id: header
signal openInfo
signal openMap
// Left Positioner
RowLayout
......@@ -36,7 +38,7 @@ Item {
{
anchors.right: parent.right
height: 50
spacing: 10
spacing: 15
ComboBox
{
Layout.preferredWidth: 110
......@@ -55,7 +57,6 @@ Item {
fillMode: Image.PreserveAspectFit
source: modelData
}
//highlighted: control.highlightedIndex === index
}
indicator: Canvas {
......@@ -146,7 +147,7 @@ Item {
source: "Assets/Icons/EVCS_icon_map_31x31.png"
}
flat: true
//onClicked: header.openInfo();
onClicked: header.openMap();
}
Button
......@@ -160,27 +161,7 @@ Item {
source: "Assets/Icons/EVCS_icon_info_30x31.png"
}
flat: true
//onClicked: header.openInfo();
onClicked: header.openInfo();
}
}
/**/
/*Button {
id: infoButton
x: parent.width - width - 20
y: 9
width: 30
height: 31
background: Image {
anchors.fill: parent
fillMode: Image.PreserveAspectFit
source: "Assets/Icons/EVCS_icon_info_30x31.png"
}
flat: true
onClicked: header.openInfo();
}*/
/**/
}
......@@ -7,6 +7,8 @@ Item {
signal valueChanged( real value );
signal priceChanged( real value );
property bool indicatorText: true;
function setChargeValue( value )
{
chargeSpinBox.from = value;
......@@ -23,8 +25,8 @@ Item {
function setPriceValue( value )
{
priceSpinBox.from = value;
priceSpinBox.to = value;
priceSpinBox.from = value;
priceSpinBox.to = value;
priceSpinBox.value = value;
}
......@@ -52,6 +54,7 @@ Item {
SpinBoxNumber
{
id: chargeSpinBox
indicatorText: root.indicatorText
function updateValue( inValue )
{
chargeSpinBox.value = inValue * 100
......@@ -70,6 +73,7 @@ Item {
SpinBoxTime
{
id: timeSpinBox
indicatorText: root.indicatorText
y: 60
function updateValue( inValue )
......@@ -92,6 +96,7 @@ Item {
SpinBoxPrice
{
id: priceSpinBox
indicatorText: root.indicatorText
y: 119
stepSize: Variables.timeOnePercent * 100
......
......@@ -4,42 +4,58 @@ import QtQuick.Layouts 1.3
import App 1.0
Page {
property alias batteryInfo: battery
background: Item {
InfoSpinBoxes
{
id: spinBoxes
x:360
y:103
width:230
height: 150
}
Battery
{
id: battery
x: 650
y: 40
onChargedPercentageChanged :
{
spinBoxes.setChargeValue( chargedPercentage * 100 )
spinBoxes.setTimeValue( ( battery.topUpCharge - chargedPercentage ) * Variables.timeOnePercent * 100 )
spinBoxes.setPriceValue( ( chargedPercentage - battery.initialCharge) * Variables.priceOnePercent * 100 )
}
}
Text {
x: 50
anchors.verticalCenter: parent.verticalCenter
color: "#ffffff"
text: qsTr("Charging")
font.pointSize: 36
font.bold: true
}
}
id: root
property alias batteryInfo: battery
signal signalChargeCompleted();
Component.onCompleted:
{
spinBoxes.indicatorText = false;
}
background: Item {
InfoSpinBoxes
{
id: spinBoxes
x:360
y:103
width:230
height: 150
}
Battery
{
id: battery
x: 650
y: 40
onChargedPercentageChanged :
{
spinBoxes.setChargeValue( chargedPercentage * 100 )
spinBoxes.setTimeValue( ( battery.topUpCharge - chargedPercentage ) * Variables.timeOnePercent * 100 )
spinBoxes.setPriceValue( ( chargedPercentage - battery.initialCharge) * Variables.priceOnePercent * 100 )
}
onSignalChargeCompleted:
{
spinBoxes.setChargeValue( chargedPercentage * 100 )
spinBoxes.setTimeValue( ( battery.topUpCharge - chargedPercentage ) * Variables.timeOnePercent * 100 )
spinBoxes.setPriceValue( ( chargedPercentage - battery.initialCharge) * Variables.priceOnePercent * 100 )
root.signalChargeCompleted();
}
}
Text
{
x: 50
anchors.verticalCenter: parent.verticalCenter
color: "#ffffff"
text: qsTr("Charging")
font.pointSize: 36
font.bold: true
}
}
}
......@@ -7,6 +7,11 @@ Page
id: root
signal paymentAccepted
function initializeValues()
{
textField.clear();
}
background: Item
{
......
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtMultimedia 5.8
Page {
id: root
signal nextPage
background: Item {
anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
y:2
width: 760
height: 400
Rectangle {
anchors.fill: parent
color: "#B8BBC5"
opacity: 0.5
Video
{
z: 10;
anchors.fill: parent
source: "Assets/Promo/Promo01.mp4"
autoLoad: true
autoPlay: true
fillMode: VideoOutput.PreserveAspectFit
loops: MediaPlayer.Infinite
}
}
Button {
anchors.top: parent.top
......@@ -21,7 +32,6 @@ Page {
width: 320
height: 45
flat: true
contentItem: Label {
......
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
Popup {
id: popup
modal: true
focus: true
closePolicy: Popup.CloseOnEscape
leftMargin: 125
topPadding: 50
leftPadding: 20
rightPadding: 140
function setDescription( index )
{
textId.text = decriptions[index];
}
property variant decriptions:
[
qsTr( "Please tap to start for entering your credentials and start charging your car" ),
qsTr( "Please set the charge that you want achieve using the rotational Knob" ),
qsTr( "Please add your pin number in order to start the charge" ),
qsTr( "Charging information status" )
]
Component.onCompleted:
{
setDescription( 0 )
}
background: Image {
id: backImage
width: 550
height: 368
fillMode: Image.PreserveAspectFit
source: "Assets/Background/EVCS_infobox_550x368.png"
MouseArea
{
anchors.fill: parent
onClicked:
{
if ( mouse.x > 485 && mouse.x < 524 && mouse.y > 17 && mouse.y < 56 )
popup.close();
}
}
}
contentItem: Text {
id: textId
color: "#ffffff"
font.pointSize: 20
wrapMode: Text.WordWrap
text: ""
}
}
import QtQuick 2.9
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import QtLocation 5.6
import QtPositioning 5.6
Popup {
id: popup
modal: true
focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
leftMargin: 100
topMargin: 50
Plugin {
id: mapPlugin
name: "osm"
}
Component.onCompleted:
{
point.center =QtPositioning.coordinate(52.520686, 13.41638)
locationData.center =QtPositioning.coordinate(52.520686, 13.41638)
}
background:Rectangle
{
width: 600
height: 400
color: "transparent"
border.color: "black"
Map
{
id: locationData
anchors.fill: parent
plugin: mapPlugin
zoomLevel: 16
MapCircle {
id: point
radius: 10
color: "#ff0000"
border.color: "#190a33"
border.width: 2
smooth: true
opacity: 0.75
}
}
}
}
......@@ -10,6 +10,8 @@ SpinBox {
height: 34
font.pointSize: Variables.controlSpinFontPoints
property bool indicatorText: true;
contentItem: Rectangle
{
anchors.fill:parent
......@@ -36,6 +38,7 @@ SpinBox {
border.color: "#0b2a4a"
Text {
visible: control.indicatorText
text: "+"
font.pixelSize: control.font.pixelSize * 2
color: "#fefefe"
......@@ -55,6 +58,7 @@ SpinBox {
border.color: "#0b2a4a"
Text {
visible: control.indicatorText
text: "-"
font.pixelSize: control.font.pixelSize * 2
color: "#fefefe"
......
......@@ -5,6 +5,7 @@ import QtQuick.VirtualKeyboard 2.1
import App 1.0
ApplicationWindow {
id: mainWindow
visible: true
width: 800
height: 480
......@@ -13,17 +14,31 @@ ApplicationWindow {
background: Image { source: "Assets/Background/EVCS_UI_background_800x480.jpg" }
header: Header {
height: 50
/* onOpenInfo:
{
popup.open();
}*/
}
height: 50
onOpenInfo:
{
infoPopup.open();
}
onOpenMap:
{
mapPopup.open();
}
}
PopupInfo
{
id: infoPopup
}
PopupMap
{
id: mapPopup
}
footer: Footer {
id: footerItem
height: 63
visible: swipeView.currentIndex /*|| swipeView.currentIndex == 2 ? 0 : 1*/
pageIndicatorcount: swipeView.count - 1
onRightButtonReleased: swipeView.currentIndex == 3 ? swipeView.setCurrentIndex(0) : swipeView.incrementCurrentIndex()
onLeftButtonReleased: swipeView.decrementCurrentIndex()
......@@ -51,6 +66,7 @@ ApplicationWindow {
PagePayment
{
id: pagePayment
onPaymentAccepted:
{
footerItem.rightButtonEnabled = 1;
......@@ -60,13 +76,26 @@ ApplicationWindow {
PageCharging
{
id: pageCharging
onSignalChargeCompleted :
{
footerItem.rightButtonEnabled = 1
}
}
onCurrentIndexChanged: {
footerItem.pageIndicatorcurrentIndex = swipeView.currentIndex - 1
footerItem.pageIndicatorVisible = swipeView.currentIndex > 0;
switch (swipeView.currentIndex)
{
case 0: // Promo page
footerItem.leftButtonVisible = 0
footerItem.rightButtonVisible = 0
pageChargeSelect.initializeValues();
pagePayment.initializeValues();
infoPopup.setDescription( 0 )
break;
case 1: // PageChargeSelect
footerItem.leftButtonVisible = 1
footerItem.leftButtonEnabled = 1
......@@ -74,6 +103,7 @@ ApplicationWindow {
footerItem.rightButtonVisible = 1
footerItem.rightButtonEnabled = ( pageChargeSelect.dialValue > Variables.initialCharge );
footerItem.rightButtonText = qsTr("Confirm")
infoPopup.setDescription( 1 )
break;
case 2: // PagePayment
footerItem.leftButtonVisible = 1
......@@ -82,6 +112,7 @@ ApplicationWindow {
footerItem.rightButtonVisible = 1
footerItem.rightButtonEnabled = 0
footerItem.rightButtonText = qsTr("Continue")
infoPopup.setDescription( 2 )
break;
case 3: // PageChargeConfirm
footerItem.leftButtonVisible = 0
......@@ -89,10 +120,11 @@ ApplicationWindow {
footerItem.rightButtonVisible = 1
footerItem.rightButtonEnabled = 0
footerItem.rightButtonText = qsTr("Done")
pageCharging.batteryInfo.topUpCharge = Math.floor( pageChargeSelect.dialValue )
pageCharging.batteryInfo.topUpCharge = pageChargeSelect.dialValue
pageCharging.batteryInfo.chargingStarted = true;
pageCharging.batteryInfo.initialCharge = Variables.initialCharge
pageCharging.batteryInfo.initializeValues();
infoPopup.setDescription( 3 )
break;
}
}
......
......@@ -44,5 +44,9 @@
<file>PadType.qml</file>
<file>PageCharging.qml</file>
<file>SpinBoxPrice.qml</file>
<file>PopupInfo.qml</file>
<file>Assets/Background/EVCS_infobox_550x368.png</file>
<file>PopupMap.qml</file>
<file>Assets/Promo/Promo01.mp4</file>
</qresource>
</RCC>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment