Giter Site home page Giter Site logo

gui-v2's Introduction

gui-v2, part of Victron Energy Venus OS

image

Venus OS is the software that runs on the Victron family of GX monitoring devices, as well as RaspberryPis. gui-v2 is the next generation UI for Venus OS.

gui-v2 is for the on-screen display on a GX Touch 50, 70 and Ekrano GX. And also to be used remotely in a webbrowser, aka the Victron Remote Console feature.

For more technical information on Venus OS, see the Venus OS wiki.

Main differences between gui-v1 and gui-v2

  • Touch oriented, rather than button oriented.
  • New looks
  • Based on Qt6 instead of Qt4
  • Remote Console is done by running a Webassembly (WASM) build in the browser, and data over MQTT, rather than (browser based-) VNC
  • Besides being a UI, gui-v1 also took care of various more core tasks, like starting stopping services; those have all been moved to the venus-platform repo.
  • Because gui-v2 is can also run remotely (WASM), it can no longer issue commands directly to Venus OS. The only data path is MQTT (for WASM) and D-Bus (when
  • running locally on the GX). For that, various features have been added to venus-platform (like starting a reboot, or starting a firmware update) so that the
  • command for that can be issued over D-Bus / MQTT. Same for creation of settings; they need to be created elsewhere.

Status: This is available for public preview, and lots of work needs to be done before official release/inclusion in Venus OS.

How to install: See https://bit.ly/gui-v2

Don't use the issue tracker for support

Do not use the issue tracker in this repo to ask for support. The issue tracker is our development workflow; and not for support. Instead, please use the open Venus OS beta thread on the Modifications section on Victron Community (see top section on that page).

Modifications

The prime reason to share this source code publicly is to allow for modifications. But that will work differently than in gui-v1.

While all the sources of gui-v1 were not open source, all the visible elements were taken care of in QML, of which are non-compiled files that could be edited after obtaining root access to the GX device. This allowed for modifications. Small ones, but also large projects like Kevin Windrems gui-mods.

In gui-v2 this is a bit different. The QML files are still on the rootfs and can be edited, but doing so only changes the version you see on screen. It won't change the version used remotely in a browser, ie. the WASM version. That is a compiled single binary blob, which can't be rebuild on the GX itself.

Building the WASM requires lots of tooling installed (Qt6, emscriptem), and then takes a while. To learn more, see the guiv-2 automated build, a Github Action workflow in this repo, as well as the [how to build page in the gui-v2 wiki.

Concluding, we'll need a different solution to allow modifications. Preferably one that, like gui-v2, has a low barrier to get started. Publishing these sources is a first step.

To discuss this, see https://community.victronenergy.com/questions/245056/venus-os-modifying-gui-v2.html.

Building

See the wiki page: https://github.com/victronenergy/gui-v2/wiki/How-to-build-venus-gui-v2

License

See license file in the repo.

gui-v2's People

Contributors

blammit avatar chriadam avatar danielmcinnes avatar jpetrell avatar dirkjanfaber avatar mattvogt2 avatar mr-manuel avatar mpvader avatar jhofstee avatar martinbosma avatar nmbath avatar

Stargazers

Matt Sigman avatar Sergey Ilinsky avatar Rudi avatar wr avatar Fredrik Bore avatar Paul Me avatar  avatar  avatar BRUNO BARANGE SALA avatar Kevin avatar Joshua Attridge avatar  avatar  avatar Osman TASKIRAN avatar  avatar  avatar Eleanor Davies avatar  avatar André J avatar Jiri Jagos avatar

Watchers

Valentin Bonnet avatar  avatar  avatar Warwick Bruce Chapman avatar  avatar Thiemo van Engelen avatar  avatar  avatar  avatar  avatar  avatar

gui-v2's Issues

1.c Implement status-bar component (and refactor Page etc to replace the Controls button)

Implement a status bar component (consisting of: controls button, clock/time, side panel button).
The status bar component needs to be owned by the top level Window, rather than specific sub-pages.
Its visibility needs to be determined by a binding (e.g. to allow animating it out due to inactivity).
The visibility of the sub-components needs to be bound to some specific conditions (e.g. side-panel button only visible on Brief page, for example).

Similarly: the navigation bar needs to able to be animated it in/out due to inactivity + wakeup-press also, and subpage content needs to be animated smoothly in response.

Levels page

Serj has added the UI design for the Levels page, which shows various tank levels, so this can now be implemented.

1.e Create hierarchical theme .json description files, remove hardcoded values from QML

Create 4 different .json files:

  • 7inch-dark.json
  • 7inch-light.json
  • 5inch-dark.json
  • 5inch-light.json

Each .json should have hierarchical values for every geometry, margin, color, etc (i.e. "theme all the things").
We should load the appropriate .json file at runtime, and populate nested QQmlPropertyMap with the values.
Then, the various QML files should load all of the values from these files, rather than hardcoding ANY values.

Advantages:

  • no runtime bindings to set size depending on e.g. 7inch vs 5inch, instead the variation happens at the theme-level.
  • easy to add more themes later on (different colour schemes, different screen sizes, etc)

5.b Implement OverviewWidgetConnection component

  • bezier curves with two anchor points. must be able to animate the anchor points!
  • electron animations showing directionality of energy flow

Some complexities when there are multiple connections in the same direction:
connections-one

Also, note that the design includes coupled-connections cases:
connections-coupled

1.i See if Theme needs QQmlParserStatus support to avoid binding capture issues at startup

Daniel noticed an issue:

Where SeparatorBar.qml looks like:

import QtQuick
import Victron.VenusOS

Rectangle {
	width: Theme.geometry.separatorBar.width
	height: Theme.geometry.separatorBar.width
	color: Theme.color.background.disabled
}

and LevelsPage.qml looks like:

import QtQuick
import Victron.VenusOS

Page {
	id: root

	Label {
		anchors.centerIn: parent
		text: "LevelsPage placeholder"
	}

	SeparatorBar {
		y: parent.height - 5
		width: 100
		height: 30
		color: "red"
	}
}

The actual behaviour does not match the expected behaviour - specifically, at runtime, printing out the width/height values in Component.onCompleted shows that the width, height of the SeparatorBar is 1,1 rather than 100,30 as expected.

My surmise is that:
a) During construction, the parent binding captures Theme.geometry.separatorBar.width
b) Then, the parent binding is overridden by the child declaration so the value is set to 100
c) Then, the Theme object finishes parsing the json and emits a change signal for the geometry.separatorBar.width subproperty
d) And thus the engine re-evaluates the parent binding and overwrites the value to the new value (1)

This seems like a bug in Qt6, but it might also be because the Theme object doesn't have proper QQmlParserStatus support?

This should be investigated and fixed if necessary...

--

Note: for now, the workaround fix is to change SeparatorBar.qml to bind implicitWidth/implicitHeight rather than width/height.

1.f Use ControlValue in various other cards

Recently, I removed the usage of ControlValue from several places, because it was slightly broken with theme support (since internally it didn't use the Button type). But then, I updated ControlValue to use the Button type, and it works properly now. So, we should use it in the cards where I removed it (e.g. ESS card) or where I wasn't using it (e.g. Generator card), as it does nicely encapsulate the "Label + Button + Separator" delegate.

1.h Implement Toast Notification type

While 1.d is for a modal full-screen(ish) modal notification, this task (1.h) is to implement toast notifications. These are popup notifications which are shown at the bottom of the screen.

There are 5 different types:

  • No Category
  • Info
  • Confirm
  • Warning
  • Error

They must scale larger vertically if there is more text.

toasts

ESS details card

The ESS controls card, and subsequent popups

image

  • keep batteries charged
  • optimized with battery life
  • optimized without battery life
  • minimum SOC
    • minimum SOC dialog
  • "Battery life limit: 80%" + info button

Brief view - solar available

  • Add 'solar yield' historical display
  • Add 'generator' display
  • Add 'loads' display
  • Add digital clock to the top centre of screen
  • Add new toggle switches to the top LHS
  • Update colors for navbar buttons

1.a 7 inch scaling

Implement 7-inch scaling for existing views (Splash, Brief Page, Brief Page Side Panel, Controls Page, Controls Cards, Controls Cards Dialogs).

3.a.ii Brief view - side indicators

When the side panel is not open, show indicators to the sides of the central multi gauge.
It appears that the layout varies dynamically according to what data sources are available.

image

image

7. WebAssembly / Emscripten build

We need to try a WebAssembly build of the UI, and test it in various browsers.
Eventually, we need to switch from DBus to MQTT for the data model integration, but that can come later...
First step is to ensure that animations / UI works, and iron out build issues.

Subtasks:

Inverter details card

The Inverter controls card, and subsequent popups

image

  • inverter card
  • display input current limit
    • input current limit dialog
  • mode
    • mode change dialog

1.j Fix translations support to ensure that .qm files are bundled appropriately

This specifically affects builds for the device.

The qt6_add_translations CMake macro isn't working properly, and the .qm files aren't being bundled appropriately in a resource linked into the executable. So, instead, we need to do all of the following PRIOR to building the venus-gui-v2 target:

  1. generate .ts files from source files
  2. generate .qm files from .ts files
  3. add a translations.qrc file which includes those generated .qm files
  4. link that .qrc file into the dependencies for the venus-gui-v2 target, so that the .qm files are bundled appropriately.

Connect gauge maximum levels to dbus backend

Various UI components show a "current" level as a percentage of a "maximum" level. For example:

  • The "Loads" and "Generator" arcs on the Brief page
  • The "Inverter", "Grid" and "Shore" widgets on the Overview page, which have gauges along the right-hand side

The max levels are currently set to be a bit higher than whatever max has been previously seen in the current session, using a stored value in Utils.js. Discussed with Matthijs that these values will be added in the dbus backend later on; at that point we can hook them up to the UI.

3.d Enable 4xMSAA once we have proper device support

ArcGauge currently does:

		layer.enabled: true
		layer.samples: 4

for antialiasing, but the CerboGX device doesn't support multisampling.
We need to implement antialiasing in software for this specific component.

1.g Fix SegmentedButtonRow

The SegmentedButtonRow previously relied on solid-background-colour (i.e. no transparency) in order to draw over the rounded edges of interior buttons in the row. This no longer works, as the button background color has transparency now in Figma.

Instead, we need to draw the buttons using QtQuick.Shapes so that the outer buttons have two rounded corners, and the inner buttons have all four corners as square.

4.d Bug: In the inverter card, setting 'input current limit' doesn't always work

To reproduce:

  1. On the inverter card, click the 'Input current limit' button.
  2. select '16' from the segmented button row.
  3. Click 'close'. The input current limit stays at 10.7A, as expected.
  4. click the 'input current limit' button again. '16' is still highlighted.
  5. click 'set'.
  6. The input current limit stays at 10.7A, it should be 16A.

Controls 'inverter'

  • inverter card
  • display input current limit
    • input current limit dialog
  • mode
    • mode change dialog

5.a Implement OverviewWidget component

  • 5 different possible sizes / geometries (XL/L/M/S/XS)
  • Basic widget is just a rectangle with title (icon+label), status (large text)
  • Border visible if clickable/interactable, invisible if non-interactable
  • Four derived types: SideGaugeOverviewWidget, FillGaugeOverviewWidget, BarGraphOverviewWidget, SegmentedOverviewWidget
    - e.g. Inverter/Charger, Battery, SolarYield, [Shore+DCGen+Alternator+Wind+SolarYield] in 5inch 5x inputs case.

Image of the segmented widget attached:
segmented-widget

5.c Determine data-backed state machine for Overview UI layout/connections

  • Determine which blocks connect to which blocks, with which directionality, depending on data from data model
  • Populate overview page with appropriate blocks of appropriate types, and appropriate connections, sized appropriately according to the number of widgets, and the size variations supported by each shown widget, and the screen size (5inch vs 7inch).

Generator details card

  • generator card

  • autostart switch

    • 'disable autostart' dialog
  • timed run switch

  • duration

    • set duration dialog
  • start / stop button

  • generator runtime dialog

  • input limit dialog

  • minimum SOC dialog

image

Controls - ESS

  • ESS card
  • keep batteries charged
  • optimized with battery life
  • optimized without battery life
  • minimum SOC
    • minimum SOC dialog
  • "Battery life limit: 80%" + info button

3.b Brief Page side panel improvements

Some subtasks:

  • update weather forecast to include only three future days, according to updated design
  • implement "percentage details" variation (switch in Settings to turn it on, add percentage to circular gauge text)
  • split out the "generator time duration icon+label" from the Generator Card into a component
  • implement the Loads graph
  • update 'solar yield' with new graph, layout etc.
  • update 'generator' as per figma

Also ensure that 7-inch scaling is implemented for the Brief Page side panel.

3.c Brief Page single-circular gauge with central display

If the data model only has data for one tank, then the circular gauge in the central Brief Page display should be a single-gauge.
Create a new component: CircularSingleGauge.qml, which implements this.
Update Brief Page to show the CircularSingleGauge instead of CircularMultiGauge, in the case where the data model only has 1 appropriate data entry.

single-circular-gauge

3.a.i Value presentation with units

Make a component to display values. Should be able to handle:

  • varying levels of precision
  • changing units (KM vs miles, Wh vs KWh)
  • separation of units fro mvalues

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.