-
Notifications
You must be signed in to change notification settings - Fork 19
refactor: unify Signals plugin (absorbs FilteredCharts) #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
41588bc
refactor: unify Signals plugin (absorbs FilteredCharts)
uavinda 2774fc1
fix: Timer in Fact children, eval for bind expressions, defer chart a…
uavinda 2346352
fix: apply review feedback - binding, null-checks, cached fns, licens…
Copilot 3449c43
refactor
uavinda 7640a47
update docs and refactor
uavinda 3332464
model refactor
uavinda 9176951
docs update
uavinda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 +1,23 @@ | ||
| apx_plugin(SRCS "*.qml") | ||
| set(QRC_QML | ||
| ColorChoiceFact.qml | ||
| ColorChooser.qml | ||
| FilterBase.qml | ||
| FilterFact.qml | ||
| FilterKalman.qml | ||
| FilterRegistry.qml | ||
| FilterRunningAverage.qml | ||
| MenuItem.qml | ||
| MenuPage.qml | ||
| MenuSet.qml | ||
| MenuSets.qml | ||
| PageButton.qml | ||
| SignalButton.qml | ||
| Signals.qml | ||
| SignalsModel.qml | ||
| SignalsPlugin.qml | ||
| SignalsView.qml | ||
| ) | ||
|
|
||
| apx_qrc(${MODULE} PREFIX ${MODULE} SRCS "*.qml") | ||
| apx_plugin(SRCS ${QRC_QML}) | ||
|
|
||
| apx_qrc(${MODULE} PREFIX ${MODULE} SRCS ${QRC_QML}) | ||
This file contains hidden or 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,42 @@ | ||
| /* | ||
| * APX Autopilot project <http://docs.uavos.com> | ||
| * | ||
| * Copyright (c) 2003-2020, Aliaksei Stratsilatau <sa@uavos.com> | ||
| * All rights reserved | ||
| * | ||
| * This file is part of APX Ground Control. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Lesser General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| import QtQuick | ||
|
|
||
| import APX.Facts | ||
|
|
||
| Fact { | ||
| id: colorFact | ||
|
|
||
| property bool isColorChoice: true | ||
| property var itemOwner: null | ||
| property string colorValue: "" | ||
|
|
||
| flags: Fact.CloseOnTrigger | ||
| opts: ({ | ||
| "editor": Qt.resolvedUrl("ColorChooser.qml") | ||
| }) | ||
|
|
||
| onTriggered: { | ||
| if (itemOwner && typeof itemOwner.setColorValue === "function") | ||
| itemOwner.setColorValue(colorValue) | ||
| } | ||
| } |
This file contains hidden or 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,59 @@ | ||
| /* | ||
| * APX Autopilot project <http://docs.uavos.com> | ||
| * | ||
| * Copyright (c) 2003-2020, Aliaksei Stratsilatau <sa@uavos.com> | ||
| * All rights reserved | ||
| * | ||
| * This file is part of APX Ground Control. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Lesser General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| import QtQuick | ||
| import QtQuick.Controls.Material | ||
|
|
||
| Rectangle { | ||
| id: editor | ||
|
|
||
| readonly property string colorText: fact && fact.colorValue !== undefined | ||
| ? String(fact.colorValue).trim().toUpperCase() | ||
| : (fact && fact.itemOwner && fact.itemOwner.colorValue !== undefined | ||
| ? String(fact.itemOwner.colorValue).trim().toUpperCase() | ||
| : "") | ||
| readonly property bool selected: fact && fact.itemOwner | ||
| && fact.itemOwner.colorValue === colorText | ||
|
|
||
| implicitHeight: factButton.height * 0.6 | ||
| implicitWidth: factButton.height * 1.8 | ||
| radius: height / 5 | ||
| border.width: selected ? 2 : 1 | ||
| border.color: selected ? "white" : "#66000000" | ||
| color: colorText !== "" ? colorText : "transparent" | ||
|
|
||
| Rectangle { | ||
| anchors.fill: parent | ||
| anchors.margins: 3 | ||
| visible: colorText === "" | ||
| radius: parent.radius - 1 | ||
| color: "transparent" | ||
| border.width: 1 | ||
| border.color: Material.hintTextColor | ||
|
|
||
| Text { | ||
| anchors.centerIn: parent | ||
| text: qsTr("A") | ||
| font: apx.font_narrow(Math.max(10, parent.height * 0.55)) | ||
| color: Material.hintTextColor | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,99 @@ | ||
| /* | ||
| * APX Autopilot project <http://docs.uavos.com> | ||
| * | ||
| * Copyright (c) 2003-2020, Aliaksei Stratsilatau <sa@uavos.com> | ||
| * All rights reserved | ||
| * | ||
| * This file is part of APX Ground Control. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Lesser General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| import QtQuick | ||
|
|
||
| import APX.Facts | ||
|
|
||
| Fact { | ||
| id: filterSettingsFact | ||
|
|
||
| property var data: ({}) | ||
| property string filterType: "" | ||
| property string filterTitle: "" | ||
| property string detailsText: "" | ||
| property real outputValue: 0 | ||
|
|
||
| flags: (Fact.Group | Fact.Section) | ||
| title: filterTitle | ||
| descr: detailsText | ||
|
|
||
| Component.onCompleted: load(data) | ||
|
|
||
| function asNumber(value, fallback) | ||
| { | ||
| var number = Number(value) | ||
| return isFinite(number) ? number : fallback | ||
| } | ||
|
|
||
| function clamp(value, minValue, maxValue) | ||
| { | ||
| return Math.max(minValue, Math.min(maxValue, value)) | ||
| } | ||
|
|
||
| function normalizedInput(inputValue) | ||
| { | ||
| return asNumber(inputValue, 0) | ||
| } | ||
|
|
||
| function passThrough(inputValue) | ||
| { | ||
| outputValue = normalizedInput(inputValue) | ||
| return outputValue | ||
| } | ||
|
|
||
| function load(filterData) | ||
| { | ||
| var source = filterData && typeof filterData === "object" ? filterData : {} | ||
| loadParameters(source) | ||
| reset() | ||
| } | ||
|
|
||
| function save() | ||
| { | ||
| var filterData = saveParameters() | ||
| if (!filterData || filterData instanceof Array || typeof filterData !== "object") | ||
| filterData = {} | ||
|
|
||
| filterData.type = filterType | ||
| return filterData | ||
| } | ||
|
|
||
| function loadParameters(filterData) | ||
| { | ||
| } | ||
|
|
||
| function saveParameters() | ||
| { | ||
| return ({}) | ||
| } | ||
|
|
||
| function reset() | ||
| { | ||
| outputValue = 0 | ||
| } | ||
|
|
||
| // Each concrete filter updates its own state and returns the latest output. | ||
| function update(inputValue) | ||
| { | ||
| return passThrough(inputValue) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PageButton.qmlis included inQRC_QML, but it is not referenced anywhere in the repo (noPageButtonusages found). If it’s truly unused, removing it from the resource list (and deleting the file) will avoid shipping dead UI variants and reduce maintenance overhead.