Skip to content
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
2 changes: 2 additions & 0 deletions console_backend/src/common_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ pub enum Keys {
PREVIOUS_SERIAL_CONFIGS,
#[strum(serialize = "RECORDING_FILENAME")]
RECORDING_FILENAME,
#[strum(serialize = "CONSOLE_VERSION")]
CONSOLE_VERSION,
}

#[derive(Clone, Debug, Display, EnumString, EnumVariantNames, Eq, Hash, PartialEq)]
Expand Down
1 change: 1 addition & 0 deletions console_backend/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub fn refresh_connection_frontend<P: CapnProtoSender>(
let msg = builder.init_root::<crate::console_backend_capnp::message::Builder>();

let mut connection_status = msg.init_connection_status();
connection_status.set_console_version(&shared_state.console_version());
let mut ports: Vec<String> = vec![];
if let Ok(ports_) = &mut available_ports() {
// TODO(johnmichael.burke@) [CPP-114]Find solution to this hack for Linux serialport.
Expand Down
1 change: 1 addition & 0 deletions resources/ConnectionScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ Item {
return ;

if (!available_baudrates.length || !available_flows.length) {
Globals.consoleVersion = connectionData.console_version;
available_baudrates = connectionData.available_baudrates;
serialDeviceBaudRate.currentIndex = 1;
available_flows = connectionData.available_flows;
Expand Down
43 changes: 33 additions & 10 deletions resources/Constants/Constants.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ QtObject {
property QtObject connection
property QtObject sideNavBar
property QtObject loggingBar
property QtObject licensesPopup
property QtObject commonChart
property QtObject commonLegend
property QtObject commonTable
Expand All @@ -40,6 +39,7 @@ QtObject {
property QtObject trackingSkyPlot
property QtObject networking
property QtObject fusionStatusFlags
property QtObject logoPopup
readonly property int staticTimerIntervalRate: 5 // 5 Hz
readonly property int staticTableTimerIntervalRate: 10 // 10 Hz
readonly property int staticTimerSlowIntervalRate: 2 // 2 Hz
Expand All @@ -53,6 +53,34 @@ QtObject {
readonly property color materialGrey: "dimgrey"
readonly property color swiftOrange: "#FF8300"

logoPopup: QtObject {
readonly property int heightPadding: 120
readonly property int buttonWidth: 30
readonly property int buttonRightMargin: 15
readonly property int buttonTopMargin: 10
property QtObject licenses
property QtObject aboutMe

licenses: QtObject {
readonly property int dropdownHeight: 40
readonly property string robotoFontTabLabel: "Roboto Font"
readonly property string fontAwesomeIconsTabLabel: "Font Awesome Icons"
readonly property string robotoFontLicensePath: "qrc:///fonts/Roboto-LICENSE.txt"
readonly property string fontAwesomeIconsLicensePath: "qrc:///images/fontawesome/LICENSE.txt"
}

aboutMe: QtObject {
readonly property int logoWidth: 200
readonly property int bottomPadding: 20
readonly property string supportWebsite: "https://swiftnav.com/support"
readonly property string website: "https://www.swiftnav.com"
readonly property string copyrightText: "Copyright © 2011-2022 Swift Navigation Inc."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preparing for the future I see 😎

readonly property int titlePointSize: 14
readonly property int secondaryPointSize: 10
}

}

sideNavBar: QtObject {
readonly property int buttonSvgHeight: 15
readonly property string hamburgerPath: "images/fontawesome/bars-solid.svg"
Expand All @@ -68,6 +96,9 @@ QtObject {
readonly property int tabBarSpacing: 10
readonly property int buttonPadding: 0
readonly property int buttonInset: 0
readonly property int separatorMargin: 10
readonly property int separatorHeight: 1
readonly property color backgroundColor: "#fafafa"
}

updateTab: QtObject {
Expand Down Expand Up @@ -207,15 +238,6 @@ QtObject {
property var defaultColumns: ["Item", "Value"]
}

licensesPopup: QtObject {
readonly property real tabBarHeight: 40
readonly property real dialogPopupHeightPadding: 100
readonly property string robotoFontTabLabel: "Roboto Font"
readonly property string fontAwesomeIconsTabLabel: "Font Awesome Icons"
readonly property string robotoFontLicensePath: "../fonts/Roboto-LICENSE.txt"
readonly property string fontAwesomeIconsLicensePath: "../images/fontawesome/LICENSE.txt"
}

statusBar: QtObject {
readonly property int margin: 10
readonly property int spacing: 10
Expand Down Expand Up @@ -552,6 +574,7 @@ QtObject {
readonly property string playPath: "qrc:///images/iconic/play.svg"
readonly property string solidCirclePath: "qrc:///images/fontawesome/circle-solid.svg"
readonly property string squareSolidPath: "qrc:///images/fontawesome/square-solid.svg"
readonly property string swiftLogoPath: "qrc:///images/icon.png"
}

insSettingsPopup: QtObject {
Expand Down
1 change: 1 addition & 0 deletions resources/Constants/Globals.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import QtQuick 2.6
pragma Singleton

QtObject {
property string consoleVersion: "0.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any ideas on how we can update this in the future? Can we pull in the version from a file or console resource?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have it tied to when it is provided in the Update tab. So would show as 0.0.0 until the first connection. Maybe I should disable this button before the first connection as well? Currently our version.txt file is not created in the resources folder so that would need to be changed for us to get it available before first connection.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would pretty odd to require a customer to connect to a device just to see about information. The version information definitely needs to be accessible without that. Why is knowing the current version of the app dependent on connecting to a device? That seems super awkward.

property int currentRefreshRate: 5 // 5 Hz
property bool useOpenGL: true
property int initialMainTabIndex: 0 // Tracking
Expand Down
61 changes: 61 additions & 0 deletions resources/LogoPopup.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import "Constants"
import "LogoPopupComponents" as LogoPopupComponents
import QtQuick 2.5
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

Item {
function open() {
if (!dialog.visible)
dialog.open();

}

Dialog {
id: dialog

width: parent.width / 2
height: parent.height - Constants.logoPopup.heightPadding
anchors.centerIn: parent
standardButtons: Dialog.Close

ColumnLayout {
anchors.fill: parent

TabBar {
id: logoPopupBar

z: Constants.commonChart.zAboveCharts
Layout.fillWidth: true
Layout.preferredHeight: Constants.tabBarHeight

Repeater {
model: ["About", "Licenses"]

TabButton {
text: modelData
width: implicitWidth
}

}

}

StackLayout {
currentIndex: logoPopupBar.currentIndex
Layout.fillWidth: true
Layout.fillHeight: true

LogoPopupComponents.AboutMe {
}

LogoPopupComponents.Licenses {
}

}

}

}

}
53 changes: 53 additions & 0 deletions resources/LogoPopupComponents/AboutMe.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import "../Constants"
import QtQuick 2.5
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

ColumnLayout {
Item {
Layout.fillWidth: true
Layout.fillHeight: true

Image {
anchors.centerIn: parent
height: Constants.logoPopup.aboutMe.logoWidth
width: Constants.logoPopup.aboutMe.logoWidth
source: Constants.icons.swiftLogoPath
}

}

Label {
Layout.alignment: Qt.AlignHCenter
text: "Swift Navigation Console " + Globals.consoleVersion
font.pointSize: Constants.logoPopup.aboutMe.titlePointSize
font.bold: true
}

Label {
Layout.alignment: Qt.AlignHCenter
text: Constants.logoPopup.aboutMe.copyrightText
font.pointSize: Constants.logoPopup.aboutMe.secondaryPointSize
}

Label {
readonly property string website: Constants.logoPopup.aboutMe.supportWebsite

Layout.alignment: Qt.AlignHCenter
text: "Find help at the Swift Navigation <a href='" + website + "'>support portal</a>"
font.pointSize: Constants.logoPopup.aboutMe.secondaryPointSize
onLinkActivated: {
Qt.openUrlExternally(website);
}
}

Label {
Layout.alignment: Qt.AlignHCenter
text: "Learn more at the <a href='" + Constants.logoPopup.aboutMe.website + "'>Swift Navigation website</a>"
font.pointSize: Constants.logoPopup.aboutMe.secondaryPointSize
onLinkActivated: {
Qt.openUrlExternally(Constants.logoPopup.aboutMe.website);
}
}

}
64 changes: 64 additions & 0 deletions resources/LogoPopupComponents/Licenses.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import "../Constants"
import QtQuick 2.5
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

ColumnLayout {
ComboBox {
id: licenses

Layout.preferredHeight: Constants.logoPopup.licenses.dropdownHeight
Layout.preferredWidth: parent.width / 2
Layout.alignment: Qt.AlignHCenter
model: [Constants.logoPopup.licenses.robotoFontTabLabel, Constants.logoPopup.licenses.fontAwesomeIconsTabLabel]
}

StackLayout {
currentIndex: licenses.currentIndex
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter

ScrollView {
ScrollBar.vertical.policy: ScrollBar.AlwaysOn

TextArea {
id: robotoFontTextArea

readOnly: true
activeFocusOnPress: false
horizontalAlignment: TextEdit.AlignJustify
selectByKeyboard: true
selectByMouse: true
}

}

ScrollView {
ScrollBar.vertical.policy: ScrollBar.AlwaysOn

TextArea {
id: fontAwesomeTextArea

readOnly: true
activeFocusOnPress: false
horizontalAlignment: TextEdit.AlignJustify
selectByKeyboard: true
selectByMouse: true
}

}

}

Timer {
interval: 1
running: true
repeat: false
onTriggered: {
Utils.readTextFile(Constants.logoPopup.licenses.robotoFontLicensePath, robotoFontTextArea);
Utils.readTextFile(Constants.logoPopup.licenses.fontAwesomeIconsLicensePath, fontAwesomeTextArea);
}
}

}
58 changes: 0 additions & 58 deletions resources/MainDrawer.qml

This file was deleted.

Loading