Skip to content

Commit

Permalink
Release v0.6.0 (#19)
Browse files Browse the repository at this point in the history
* Split easyApp content to Gui and Logic

* Add rich text to table header

* Change check for updates button text

* Add new release date property

* Fix disabled combo box color

* Update preferences dialog style

* Fix preferences dialog height

* Fix path to MaintenanceTool for Linux and Windows

* Bump version to 0.1.0

* Minor refactoring

* Fix changelog path

* Fix check on app start label

* Add nunito font

* Store app preferences tabs as global vars

* Fixed dependencies after refactoring

* Add support for iconified names in fitting constraints

* Fix ComboBox Label padding

* Remove vertical insets for ComboBox

* Set elide middle to be default for the TableViewLabel

* Fix vertical spacing on the preferences window

* Define 3rd line for Bokeh charts, showing current phase profile

* Add multiple phases support to the analysis chart

* Add support for the multiple HKL sets

* Replaced GNU license with BSD-3.

* Update license description

* update license copyright year

* Expand python versions and add RichText (#4)

* Expand python versions and add RichText

* plotting 3d libs boxes only visible for easyDiffraction

* Comments from Andrew S

* Fixing a typo (#5)

* dicttoxml -> XMLSerializer

* Plotly (#9)

* Bump qtquick to 2.15

* Remove `Structure plotting` from preferences

* Add simple 1d chart view based on Plotly

Co-authored-by: Andrew Sazonov <[email protected]>

* Add another Plotly example: 2D Heatmap

* Update pyproject.toml

* New interface (#18)

* Qt6: Back to Qt.labs.settings before Qt 6.5

* Qt6: Fixed GroupBox component

* Qt6: Use Dialogs from Qt.labs.platform instead of QtQuick.Dialogs

* Qt6: Add comment `Parameter "mouse" is not declared` for future fix

* Qt6: Remove modules version number for easyApp

* Capitalize first letter in easyApp -> EasyApp

* Qt6: QtQuick.Dialogs seems better than Qt.labs.platform

* Remove wrong SPDX header

* Add splash screen implementation

* Modify splash screen to simplify live preview

* Remove QtCharts, Bokeh and ChemDoodle

* Add some default chart sizes

* Add title to the `parameter` component

* Extend basic Plotly 1d Line chart

* Implement new Plotly 1D chart: Measured vs Calculated data

* Move html templates into separate dir

* Add draft of the basic report

* Add pyproject.toml

* Fix pyproject.toml

* Continue improving BasicReport template

* Plotly 1.58.5 -> 2.18.0

* Remove old plotly 1.58.5

* Try with 'scattergl' instead of 'scatter' as default in plotly

* Get rid of miscProxy

* Remove default placeholder text from Parameter element

* Fix project description

* Add useWebGL property

* Hide splash screen right after app window is loaded

* Modify RemoteController

* Try to capitalize package name

* Try poetry

* Capitalize EasyApp from easyApp

* Back to hatch

* Allow py3.11

* Hardcode axes ranges

* Fix warning: Parameter "mouse" is not declared

* Fix 1d plot webgl toggler

* Add read write file functions

* Split x and y datasets for charts

* Cleaning up / renaiming

* Show tooltip on slider hover

* Refactor table view and status bar

* Add missing functions to remote controller

* Update Plotly1d chart

* Update TableView

* Add basic QtCharts

* EaGlobals.Variables -> EaGlobals.Vars

* Add background line

* Fix status bar model key names

* TableView: disable save-restore current state

* Fix `Qt.labs.settings is deprecated` for Qt6.5

* Fix `The current style does not support customization`

* Find `Using a Component as the root of a qmldocument is deprecated`

* Split header and delegate in TableView

* Clean up TableView

* Add children count property to SideBarColumn

* Add axis ranges to plotly chart

* Update persistent settings

* Enable logging level selector in app preferences

* Set QtCharts to be default 1d plotting lib

* The same useOpenGL property for all chart series

* Hide status bar model element if empty

* Extend logging options

* Fix logging level model

* Move logger to EasyApp

* Splash screen animation

* Extend and fix `fitting in progress` label

* Fix fitting label animation type

* Make base 1d chart

* Split logging message into chunks

* Fix logging

* Split qtchart to base and main

* Fix module name

* Set color for calc series

* Extend base chart

* Auto width and focus for the `Parameter` element

* All sidebar groups are collapsed by default

* No need to set group row width

* Fix sidebar group inner layout

* Update sidebar group row layout

* Minor fixes

* Some design changes: colors, animation

* New status bar design

* Add orange color

* Increase sidebar width

* Extend base QtCharts chart

* Remove focus on TableView TextEdit field change  accepted

* Add Font Awesome v.6 (but continue using v.5)

* Modify 'grey' color

* Modify default vertical padding for check box

* Fix preferences layout after check box changes

* Add custom scroll bar

* Extend base chart with pan functionality

* Add ranges after reset properties

* Add 'fit' property to some components

* Add menu component. Extend parameter component

* Minor fixes

* Improve parameter component

* TextArea and TabButton functionality ext

* Fix status bar spacing

* Add tooltip to tableview label

* Set default number of digits for parameter value and error

* Clean up

* Minor style changes for buttons, labels, tables

* Clean up

* Add background color property

* Reduce width of the group header clickable area

* Extend ComboBox and Group parameters

* Add gradient to the sidebar

* Add extra field to table view parameter

* Add outline icon property to table button

* New style for continue button

* Auto-hide and auto last for group boxes

* Fix group box title top margin

* Minor fixes

* Fix group box internal spacing

* Add color reset animation

* Reduce tab button icon size

* Add icon to the group box component

* Modify status bar

* Highlight title of the unfolded sidebar groups

* Minor fixes

* Use HoverHandler to react on hover events. New 2-lines table label

* Fix some cursor shape issues

* Increase sidebar button hight

* Multiple changes

* Fix project name validator

* Disable 1d charting library selector

* Modify parameter names format

* Update colors

* Disable loading 1d chart lib prom preferences

* New property for current color palette

* Save color scheme

* Fix menu background color

* Set 'error' to be the default logging level

* Fix logging header. Need move to EA from ED

* Add default project parent dir property

* Add extended logging to the Updater class

* Update translator

* Use categories in CIF

* Temporarily disable 'User guides' selector

* Minor changes

* Increase logging main message width

* Fixes updater's web date

* Add opacity to the `stop tutorial` button

* Accept project create dialog on return pressed

* Fix color

* Try Python 3.12

* Fix pyside6 version to be 6.5.3 because of the issues on macOS

Never version of pyside6 fails with QtQuick3D rendering on macOS:
- Particles not supported due to missing RGBA32F and RGBA16F texture format support
- No GLSL shader code found (versions tried:  QList(120) ) in baked shader

* Force using pyside6==6.7.0 and above

* Force using pyside6==6.6 and above

* Force using pyside6==6.6 only

* Keep the scrollbar thin, even if it is interactive

* Implement most basic qml and py examples

* Update readme

* Fix how to run qml

* Simplify structure

* Clean up. Minor corrections

* Update the Qt installation instruction

* Add instruction on how to edit GUI in live mode

* Update the readme file

* New way to access the backend and GUI components

* New qml-py-py example

* Update README.md

* Add qml-qml-cpp example

* Restructure examples

* Restructure the whole set of examples

* Add README.md

* Update examples.md

* Add ref to examples

* Move EasyApp to src/EasyApp

* Add link to web app based on BasicMinimalC++

* Clean up

* Fix qmlproject

* Add CI to build wasm

* Add libxkbcommon

* Switch to macos

* Cache emsdk and qt

* Add build wasm step

* Fix path to emsdk

* Add upload steps to CI

* Fix path

* Add GITHUB_API_PERSONAL_ACESS_TOKEN

* Update readme

* Fix GH_API_PERSONAL_ACESS_TOKEN

* Change path to Qt installation

* Update readme

* Change path to Qt

* Simplify BackendProxy.qml

* Simplify pyproject.toml

* Move the property 'version' back to pyproject.toml

* Add the full path to the logo image in the readme

* Minor fixes in examples.md

* Update project description

* adjustments BasicMinimalPy

* adjustments BasicPy

* adjustments BasicPy

* adjustments IntermediatePy

* vscode

* updates examples.md

* adjustment to examples

* Rename Status.py to status.py

* Rename Report.py to report.py

* Rename Project.py to project.py

* Rename Helpers.py to helpers.py

* Rename Helpers.py to helpers.py

* Rename Project.py to project.py

* Rename Report.py to report.py

* Rename Status.py to status.py

* handle when local EasyApp module is used

* updates to example.md

* Update EXAMPLES.md

* Re-order imports

* Update application info

* Remove unused __version__.py

* Update project structure diagram

* Remove missing files from resources.qrc

* Remove intermediate layer between GUI and backends (old implementation)

* Fix name_changed notification

* Add docstring

* Remove proxy access from all objects except the connections handler

* Remove unused property

* Replace setContextProperty with qmlRegisterSingletonType

* Implement onObjChanged in the intermediate backend layer

* Rename Backend

* Force PySide6>=6.6,<6.7

* moved entry to python backend to python dir

* flat backend

* renamed to BackendProxy to BackendWrapper

* Renamed Logic folder to Backends

* removed proxy from backend name

* cleaning BackendWrapper.qml

* Rename GUI accessible properties and slots following Qt standards

* Move ConnectionsHandler functionality into Backend

* Move real_backend.py out of RealPy

* Fix Backend name in debug output

* Fix pyproject structure

* Rename RealPy to real_py

* Update the IntermediatePy project diagram

* Fix all examples following the IntermediatePy one

* Rename examples (more simple structure)

* BasicMinimalPy to BasicPy
* BasicMinimalC++ to BasicC++
* BasicPy to IntermediatePy
* IntermediatePy to AdvancedPy

* Move non-QObject backend logic into subfolder

* Simplify examples and add more comments

* Update descriptions

* Update readme [ci skip]

* Move VS Code initial settings from `vscode/` to `.vscode`

* Update readme [ci skip]

---------

Co-authored-by: Andrew Sazonov <[email protected]>
Co-authored-by: Andreas Pedersen <[email protected]>
  • Loading branch information
3 people authored Sep 2, 2024
1 parent 2fe0df4 commit 31919b1
Show file tree
Hide file tree
Showing 472 changed files with 16,603 additions and 93,296 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: wasm

on:
push:
#schedule:
# - cron: '*/120 8-18 * * *' # every 2 hours from 8:00 to 18:00 every day

jobs:
wasm-build: # the first job
# current job matrix. if modified, remember to UPDATE the strategy in the next job
strategy:
fail-fast: false
matrix:
os: [macos-14]

runs-on: ${{ matrix.os }}

timeout-minutes: 30

steps: # job steps
- name: Check-out repository
uses: actions/checkout@v4

- name: Cache emsdk
id: cache-emsdk
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/emsdk
key: ${{ runner.os }}-emsdk

- name: Install emsdk
if: steps.cache-emsdk.outputs.cache-hit != 'true'
shell: bash
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
./emsdk install 3.1.50 # this version is needed for Qt 6.7
./emsdk activate 3.1.50
- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/Qt
key: ${{ runner.os }}-qt

- name: Install Qt for WebAssembly
if: steps.cache-qt.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L -O https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg
chmod u+x qt-unified-mac-x64-online.dmg
hdiutil attach qt-unified-mac-x64-online.dmg
/Volumes/qt-online-installer-macOS-x64-4.8.0/qt-online-installer-macOS-x64-4.8.0.app/Contents/MacOS/qt-online-installer-macOS-x64-4.8.0 \
--email ${{ secrets.QT_ACCOUNT_EMAIL }} \
--pw ${{ secrets.QT_ACCOUNT_PASSWORD }} \
--root ${{ github.workspace }}/Qt \
--accept-licenses \
--accept-obligations \
--default-answer \
--confirm-command \
install qt.qt6.672.wasm_singlethread qt.qt6.672.qt5compat
hdiutil detach /Volumes/qt-online-installer-macOS-x64-4.8.0
- name: Print some debug info
shell: bash
run: |
source ${{ github.workspace }}/emsdk/emsdk_env.sh
em++ --version
export PATH=$PATH:${{ github.workspace }}/Qt/6.7.2/wasm_singlethread/bin
qmake -v
- name: Build WASM from BasicC++ example
shell: bash
run: |
source ${{ github.workspace }}/emsdk/emsdk_env.sh
export PATH=$PATH:${{ github.workspace }}/Qt/6.7.2/wasm_singlethread/bin
cd examples/BasicC++/src
qmake BasicC++.pro -spec wasm-emscripten
make -j
- name: Copy the built WASM to the build/wasm folder
shell: bash
run: |
mkdir -p build/wasm
cp examples/BasicC++/src/*.wasm build/wasm
cp examples/BasicC++/src/*.html build/wasm
cp examples/BasicC++/src/*.js build/wasm
cp examples/BasicC++/src/*.svg build/wasm
- name: Upload the zipped wasm folder
uses: actions/upload-artifact@v4
with:
name: wasm # name of the zip file to be created and uploaded
path: build/wasm # directory whose content is to be zipped
compression-level: 0 # no compression
if-no-files-found: error

- name: Push the built wasm to the webapp branch
uses: s0/git-publish-subdir-action@develop
env:
GITHUB_TOKEN: ${{ secrets.GH_API_PERSONAL_ACESS_TOKEN }}
REPO: self
BRANCH: webapp
FOLDER: build/wasm # directory whose content is to be pushed
20 changes: 15 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# QtCreator
# Qt Creator
*.autosave

# QtCreator Qml
# Qt Creator Qml
*.qmlproject.user
*.qmlproject.user.*

# QtCreator Python
# Qt Creator Python
*.pyproject.user
*.pyproject.user.*

# QtCreator CMake
# Qt Creator C++
*.pro.user
*.pro.user.*

# Qt Creator CMake
CMakeLists.txt.user*

# VS Code
.vscode/

# PyCharm
.idea/

# Fortran
fort.1

Expand Down Expand Up @@ -41,6 +51,6 @@ build
..*
*.log
*.zip
settings.ini*
temp.cif
.ci/
.idea/
39 changes: 39 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${cwd}/src"
}
},
{
"name": "Python Debugger: BasicPy",
"type": "debugpy",
"request": "launch",
"program": "${cwd}/examples/BasicPy/src/BasicPy/main.py",
"console": "integratedTerminal",
},
{
"name": "Python Debugger: IntermediatePy",
"type": "debugpy",
"request": "launch",
"program": "${cwd}/examples/IntermediatePy/src/IntermediatePy/main.py",
"console": "integratedTerminal",
},
{
"name": "Python Debugger: AdvancedPy",
"type": "debugpy",
"request": "launch",
"program": "${cwd}/examples/AdvancedPy/src/AdvancedPy/main.py",
"console": "integratedTerminal",
}
]
}
1 change: 0 additions & 1 deletion CHANGELOG.md

This file was deleted.

1 change: 0 additions & 1 deletion CONTRIBUTING.md

This file was deleted.

139 changes: 139 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
## Types of examples

Different types of examples are given here. All examples have a graphical frontend implemented in QML, but differ in the way the backend logic is implemented and the runtime used to run them. These examples can be categorised as shown in the following table:

| Example | Type | Frontend | Backend | Runtime |
| -------------- | ---- | -------- | -------- | -------------------- |
| BasicQml | I | QML | Mock QML | `qml` tool |
| BasicPy | II | QML | Mock QML | `python` interpreter |
| IntermediatePy | III | QML | Python | `python` interpreter |
| AdvancedPy | III | QML | Python | `python` interpreter |
| BasicC++ | IV | QML | Mock QML | need to be compiled |

## Setting up Python and IDE

### Python environment

* Create and activate a python environment (_optional_)

***macOS and Linux***

```
python3.11 -m venv .venv
source .venv/bin/activate
```

***Windows***

```
python3.11 -m venv .venv
.venv\Scripts\activate
```

* Upgrade PIP, the package installer for Python (_optional_)

```
pip install --upgrade pip
```

* Install the Qt for Python `PySide6` package using PIP

```
pip install --force-reinstall "PySide6>=6.6,<6.7"
```

### Integrated development environment (IDE)

#### Qt Creator

Qt Creator is a prefered IDE for developing the GUI in QML. It allows to run QML code in debug mode with breakpoints, preview changes to QML code in live mode, has build in documentation for QML modules, has QML code auto-completion, and more unique feature related to the QML code.

* Download Qt Online Installer from [qt.io](https://www.qt.io/download-qt-installer-oss). More info at [doc.qt.io](https://doc.qt.io/qt-6/qt-online-installation.html).
* Install Qt for desktop development using a custom installation that includes the following components:
* Qt
* [ ] Qt 6.7.z
* [x] Desktop (***macOS***) or MSVC 2019 64-bit (***Windows***)
* [x] Qt 5 Compatibility Module
* [x] Qt Shader Tools
* [ ] Additional Libraries
* [x] Qt Charts
* [ ] Developer and Designer Tools
* [x] Qt Creator x.y.z

#### VS Code (_alternative to Qt Creator_)

VS Code is an alternative IDE to Qt Creator. It has a syntax highlighting plugin for QML code, but lacks some of the unique features of Qt Creator mentioned above to make QML development easier.

* Download an install VS Code
* Add the python extension
* The initial launch configuration is in the `.vscode/launch.json` file, which should be automatically read by VS Code
* Select any python file in the repo and choose the desired python environment

## How to run

### Type I Examples: BasicQml (QML runtime with QML backend)

This example is located in `examples/BasicQml` and the source code is in the subfolder `src/BasicQml`. The example consists of a graphical QML frontend (`Gui/Application.qml`) and a QML backend (`Logic/Mock/BackendProxy.qml`). It is considered a mock backend as it only returns hardcoded values rather than providing the required functionality. The entry point for Qt is `main.qml`, which can be displayed using Qt `qml` viewer.

#### Run using the QML Runtime

##### Run via the Qt Creator IDE

* Run Qt Creator
* Open the qml project file from the example folder `examples/BasicQml/src/BasicQml.qmlproject`
* Click Run (Green play button)

#### How to edit GUI elements in live mode

* In Qt Creator, select the `*.qml` file to be edited in live mode
* Click the `Design` button at the top of the left sidebar of `Qt Creator`
* _Note: If this button is disabled, find and click `About plugins...` in the `Qt Creator` menu, scroll down to the `Qt Quick` section and enable `QmlDesigner`._
* In the `Design` window, click the `Show Live Preview` button in the top panel of the application (small play button in a circle).
* _Note: Showing the entire `main.qml` application window in live mode works best when the open `main.qml` is moved to another monitor and does not overlap with the `Qt Creator` window_.
* When the desired GUI component appears, you can click the `Edit` button at the top of the left sidebar of `Qt Creator` to return to the source code of that qml component and still see it live in a separate window.

### Type II Examples: BasicPy (Python runtime with QML backend)

This example is in the `examples/BasicPy` folder, and the source code is in the `examples/BasicPy/src/BasicPy` folder. This example serves to demonstrate how an application with a QML frontend and QML backend (similar to the Type I example) can be run from Python. The entry point for the Python application is the `main.py` file. To run it, follow the steps below:

#### Run using the Python interpreter

##### Run from the terminal

* Go to the example folder, e.g.,

```sh
$ cd examples/BasicPy/src/BasicPy
```
* Run using Python (provided that the required python environment is activated as explained above)

```sh
$ python main.py
```

##### Run via the Qt Creator IDE (_alternative to run from the terminal_)

* Run Qt Creator
* Open the python project file from the example folder `examples/BasicPy/src/BasicPy.pyproject`
* Select the desired python environment with the Qt `PySide6` module installed
* Click Run (Green play button)

##### Run via the VS Code IDE (_alternative to run from the terminal or via the Qt Creator IDE_)

* Open the repo in VS Code
* Click on the debug extension and select which example to execute
![Debug dropdown window](resources/images/vscode_debug.jpg)

### Type III Examples: IntermediatePy and AdvancedPy (Python runtime with Python backend)

These examples demonstrate how to use the Python runtime to run the QML GUI binded with the Python backend located in `Backends/real_backend.py`. These examples can be run through Python in the same way as Type II described above. In these examples, the Python-based backend is registered in `main.py` and then imported into QML. The Qt QML GUI then accesses the backend by calling the properties and methods of the classes defined in the `Backends/real_py` folder.

#### Possible Issues

* If in Qt Creator some components are highlighted and marked as "Unknown component. (M300)", try resetting via "Tools > QML/JS > Reset Code Model".

### Type IV Examples: BasicC++ (QML backend)

This example can be run after compilation into an executable program. It only has a mock backend in QML (the C++ backend is not implemented). The minimum configuration requires a base `main.cpp` file and, if Qt Creator is used as the IDE, a `*.pro` file.

This example is currently used to create a WebAssembly application that can be run inside a web browser.
2 changes: 1 addition & 1 deletion LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021-2022, European Spallation Source
Copyright (c) 2024, EasyApp contributors (https://github.com/easyscience/EasyApp).
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
<img src="https://github.com/EasyScience/EasyApp/blob/examples/resources/images/ea_logo.svg?raw=true" height="65">

EasyApp is a collection of Qt QML graphical components which allows one to quickly create cross-platform applications with an eye-catching and intuitive graphical interface based on the [EasyScience](http://github.com/EasyScience) framework.

* Website: https://app.easyscience.software
* Source code: https://github.com/EasyScience/EasyApp
* Bug reports: https://github.com/EasyScience/EasyApp/issues

EasyApp is currently being used as the basis for the graphical interface in the following projects:

* [EasyDiffraction](http://github.com/EasyScience/EasyDiffraction)
* [EasyReflectometry](http://github.com/EasyScience/EasyReflectometry)
* [EasyTexture](http://github.com/EasyScience/EasyTextureApp)

More simple examples of how to use EasyApp are described in [EXAMPLES.md](https://github.com/EasyScience/EasyApp/blob/master/EXAMPLES.md) and presented in the project [examples](https://github.com/EasyScience/EasyApp/tree/master/examples) directory:

* [BasicQml](https://github.com/EasyScience/EasyApp/tree/master/examples/BasicQml)
* [BasicPy](https://github.com/EasyScience/EasyApp/tree/master/examples/BasicPy)
* [BasicC++](https://github.com/EasyScience/EasyApp/tree/master/examples/BasicC++)
* [IntermediatePy](https://github.com/EasyScience/EasyApp/tree/master/examples/IntermediatePy)
* [AdvancedPy](https://github.com/EasyScience/EasyApp/tree/master/examples/AdvancedPy)

If you want to see what EasyApp looks like, you can try the web demo based on the [BasicC++](https://github.com/EasyScience/EasyApp/tree/master/examples/BasicC++) example at https://easyscience.github.io/EasyApp/BasicC++.html.
Empty file removed docs/UserManual/description.txt
Empty file.
Loading

0 comments on commit 31919b1

Please sign in to comment.