-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix all examples following the IntermediatePy one
- Loading branch information
1 parent
2fc57bc
commit b869b5d
Showing
100 changed files
with
752 additions
and
1,018 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...C++/src/BasicMinimalC++/Logic/Mock/qmldir → ...c/BasicMinimalC++/Backends/MockQml/qmldir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
module MockLogic | ||
module MockQml | ||
|
||
singleton BackendProxy BackendProxy.qml | ||
singleton Project Project.qml | ||
singleton Report Report.qml | ||
singleton Status Status.qml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Logic | ||
|
||
singleton MockBackend MockBackend.qml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
examples/BasicMinimalC++/src/BasicMinimalC++/Gui/Globals/BackendProxy.qml
This file was deleted.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
examples/BasicMinimalC++/src/BasicMinimalC++/Gui/Globals/BackendWrapper.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// SPDX-FileCopyrightText: 2024 EasyApp contributors | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// © 2024 Contributors to the EasyApp project <https://github.com/easyscience/EasyApp> | ||
|
||
pragma Singleton | ||
|
||
import QtQuick | ||
|
||
// This module is registered in the main.py file and allows access to the properties | ||
// and backend methods of the singleton object of the ‘PyBackend’ class. | ||
// If ‘PyBackend’ is not defined, then 'MockBackend' from directory 'Backends' is used. | ||
// It is needed to run the GUI frontend via the qml runtime tool without any Python backend. | ||
import Backends as Backends | ||
|
||
|
||
QtObject { | ||
|
||
//////////////// | ||
// Backend proxy | ||
//////////////// | ||
|
||
readonly property var activeBackend: { | ||
if (typeof Backends.PyBackend !== 'undefined') { | ||
console.debug('Currently, the REAL python backend is in use') | ||
return Backends.PyBackend | ||
} else { | ||
console.debug('Currently, the MOCK backend is in use') | ||
return Backends.MockBackend | ||
} | ||
} | ||
|
||
///////////// | ||
// Status bar | ||
///////////// | ||
|
||
readonly property string statusProject: activeBackend.status.project | ||
readonly property string statusPhasesCount: activeBackend.status.phasesCount | ||
readonly property string statusExperimentsCount: activeBackend.status.experimentsCount | ||
readonly property string statusCalculator: activeBackend.status.calculator | ||
readonly property string statusMinimizer: activeBackend.status.minimizer | ||
readonly property string statusVariables: activeBackend.status.variables | ||
|
||
/////////////// | ||
// Project page | ||
/////////////// | ||
|
||
readonly property var projectInfo: activeBackend.project.info | ||
readonly property var projectExamples: activeBackend.project.examples | ||
|
||
property bool projectCreated: activeBackend.project.created | ||
onProjectCreatedChanged: activeBackend.project.created = projectCreated | ||
property string projectName: activeBackend.project.name | ||
onProjectNameChanged: activeBackend.project.name = projectName | ||
|
||
function projectCreate() { activeBackend.project.create() } | ||
function projectSave() { activeBackend.project.save() } | ||
function projectEditInfo(path, new_value) { activeBackend.project.editInfo(path, new_value) } | ||
|
||
/////////////// | ||
// Summary page | ||
/////////////// | ||
|
||
readonly property string reportAsHtml: activeBackend.report.asHtml | ||
|
||
property bool reportCreated: activeBackend.report.created | ||
onReportCreatedChanged: activeBackend.report.created = reportCreated | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.