first commit

This commit is contained in:
Ward 2023-02-23 22:01:01 +02:00
commit 5d0ac22dc1
750 changed files with 129422 additions and 0 deletions

71
corectrl/.clang-format Normal file
View File

@ -0,0 +1,71 @@
# -- General settings --
Language: Cpp
# Merge empty functions in a single line.
AllowShortFunctionsOnASingleLine: None
# Align pointers and references to the right
PointerAlignment: Right
DerivePointerAlignment: false
# Remove space after template keyword
SpaceAfterTemplateKeyword: false
# Avoid mixing comments with code when code containing comments has been commented
ReflowComments: false
# Sort options
SortIncludes: true
# -- Indentation settings --
UseTab: Never
TabWidth: 2
IndentWidth: 2
IndentCaseLabels: true
ContinuationIndentWidth: 4
# Indentation witdh before ':' in constructors and class inheritance lists.
ConstructorInitializerIndentWidth: 0
# Enable indentation for [public, private, protected]
# and takes one space from the general indentation setting.
AccessModifierOffset: -1
# -- Break settings--
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
# Initializers breaks.
BreakConstructorInitializers: BeforeComma
# Inheritance breaks.
BreakInheritanceList: BeforeComma
#BreakBeforeInheritanceComma: true # Use with clang < 7
# Template breaks.
AlwaysBreakTemplateDeclarations: true
# Penalties
PenaltyBreakAssignment: 30
PenaltyBreakBeforeFirstCallParameter: 10
PenaltyExcessCharacter: 15
# Uncoment to reset line breaks
#ColumnLimit: 500
...

15
corectrl/.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
*.o
*.gch
*.pch
*.so
*.a
*.out
*.swp
*.swo
*.un~
*.orig
*.txt.user
*.txt.autosave
*.patch
*.qm
compile_commands.json

314
corectrl/CHANGELOG.md Normal file
View File

@ -0,0 +1,314 @@
# Changelog
All notable changes to this project will be documented in this file.
## Unreleased
### Fixed
- QML Connections deprecation warning (#123).
- Automatic profiles are not activated using the default wine packages in Pop!_OS (#161).
### Changed
- Require Qt 5.15
- Replace file headers license section with [SPDX unique license identifiers](https://spdx.dev/ids/).
### Added
- Implement resizable graph and sensors regions. Both regions are configurable by dragging their split handles and the sizes persist between sessions (#309).
## CoreCtrl 1.3.1 (2022-10-08)
### Fixed
- Incorrect alignment of state voltage labels when automatic voltage is selected on the frequency & voltage control.
- CPU performance scaling mode not being restored from file (#322).
- Compilation issues with Linux 6.0 API headers (#325).
### Changed
- Explicitly require Qt 5.9 (or compatible versions).
- Install application binary and library files into GNU standard installation directories (#324).
## CoreCtrl 1.3.0 (2022-09-18)
### Fixed
- Profiles not loading consistently between reboots when using multiple GPUs (#300). If you are affected by this issue and your GPUs supports unique IDs (Vega and later models), re-save your profiles. More info on the [Known Issues](https://gitlab.com/corectrl/corectrl/-/wikis/Known-issues#profiles-reset-randomly-between-reboots-when-using-multiple-gpus) Wiki page.
- Active profile is not deactivated after changing its name or executable name.
- Profile icons and other displayed images not preserving their aspect ratio (#310).
- Crash on application exit when running under some window managers (like IceWM).
- Crash when applying specific fan curves in some circumstances (#164). Now, only constant and ascending curves can be created and used as fan curves.
- `corectrl_helper` blocking when running on kernels in which the option `CONFIG_PROC_EVENTS` has not been set (#71). The automatic profiles won't work when running on such kernels, though.
### Changed
- Replace KAuth dependency with Polkit, D-Bus and Qt5::DBus.
- Replace KArchive dependency with QuaZip.
- Update Russian translation. Thanks to OlesyaGerasimenko (!35).
### Added
- Display the GPU unique ID in the GPU info tab. Available on Vega and later GPU models.
- Make custom profile icons optional in the profile dialog. The user can now select a custom icon or simply use the default one in their profiles (#127).
- Manual profiles. The user can now create profiles to partially or completely override the settings applied by the global and per-application profiles. They can be toggled from the system tray or through the main GUI (#49).
- System tray menu entry to hide and show the main window (#280).
- New command line options:
- `--minimize-systray`: starts the application minimized either to the system tray (when available) or to the taskbar. When an instance of the application is already running, the action will be applied to its main window (#78).
- `--toggle-window-visibility`: when an instance of the application is already running, it will toggle the main window visibility showing or minimizing it, either to the taskbar or to system tray.
- `m`, `--toggle-manual-profile`: when an instance of the application is already running, it will toggle the given manual profile (#224).
- Option to save the window geometry (#312). The saved geometry is always restored at application startup. Restoring some window properties, such as window position, can be unreliable under Wayland.
- German translation. Thanks to Rüdiger Arp, polyphase and SE. (#104).
## CoreCtrl 1.2.7 (2022-08-09)
### Fixed
- Fix power profiles parsing on sienna cichlid asics (#305).
### Added
- Workaround for a [long-standing driver bug](https://gitlab.freedesktop.org/drm/amd/-/issues/1706) which affects the RX6000 series. It allows the user to control the maximum memory frequency when using these cards. Turned out that this was not the cause of the low memory frequency issue (#304), so it should be safe to restore this functionality.
## CoreCtrl 1.2.6 (2022-08-06)
### Removed
- Workaround for a [long-standing driver bug](https://gitlab.freedesktop.org/drm/amd/-/issues/1706) affecting the RX6000 series. This workaround allowed the user to control the maximum memory frequency on those models. Unfortunately, this functionality triggers another memory related driver bug that locks the memory frequency to a low value (#304).
## CoreCtrl 1.2.5 (2022-08-02)
### Added
- Add a workaround for a [long-standing driver bug](https://gitlab.freedesktop.org/drm/amd/-/issues/1706) which affects the RX6000 series. It allows the user to control the maximum memory frequency when using these cards.
- Support power profile mode on asics without heuristics settings (#303).
## CoreCtrl 1.2.4 (2022-07-17)
### Fixed
- Fix clangd not picking the project C++ standard level.
- Fix deprecated calls to QProcess::start.
- Fix warning on FindBotan.cmake.
- Explicitly disable QApplication quit on last window closed.
- Fix voltage offset not being restored during the initialization phase.
### Added
- Add support for unix paths to .exe files on wine launch cmdline.
- Add Czech translation. Thanks to viktorp (!32).
- Add Dutch translation. Thanks to Heimen Stoffels (!33).
## CoreCtrl 1.2.3 (2022-02-23)
### Fixed
- Use QObject parent/child ownership to manage system tray icon lifetime (#76).
- Parse kernel versions without patch number (#254).
## CoreCtrl 1.2.2 (2021-11-14)
### Fixed
- Various fixes for some wine apps not being recognized when launched:
- Using custom compatibility tools on Steam.
- Having uppercase extensions and launched from a case sensitive file system.
- Fixed missing profile icon after editing the profile executable name.
- Fixed profile not being monitored after editing the profile executable name.
### Changed
- Session code improvements.
## CoreCtrl 1.2.1 (2021-09-19)
### Fixed
- Use tension instead of voltage on french translation. Thanks to DarkeoX ABYSSION Tar Valantinir (!31).
- Fixed system hang on some models of RX 6000 XT series (#213).
- Fixed ignored disabled states on overdrive frequency + voltage controls (#218).
- Rework command generation and handling. The number of submitted commands has been reduced and now commands writing to different files won't be interleaved, thus improving the stability of the system. The previous implementation might trigger unexpected driver behavior and bugs that might hang the system, as reported on both #217 and #218.
### Changed
- Rework driver quirks handling. Now, it's done in a more granular way, per overdrive control. As a consequence of this, the fallback fixed frequency control is now only used when `pp_od_clk_voltage` is missing or empty (typically, when the user has not set `amdgpu.ppfeaturemask`).
- Reduce the amount of events sent to the process monitor. Process thread events are now filtered out.
## CoreCtrl 1.2.0 (2021-09-05)
### Added
- Added GPU memory and junction sensors (#36).
- Added GPU voltage sensor.
- Added support for voltage offset (#139). With this RX 6XXX are fully supported. Use with caution, as no voltage range is provided by the driver.
- Added noop control. This control can be used to hand over control of certain components to other programs. More info in the Wiki: [Do not control mode](https://gitlab.com/corectrl/corectrl/-/wikis/How-profiles-works#do-not-control-mode), [Controlling parts of your system with external applications](https://gitlab.com/corectrl/corectrl/-/wikis/How-profiles-works#controlling-parts-of-your-system-with-external-applications).
- Modularized overdrive controls. This adds clock controls to RX 6XXX (#139).
### Changed
- Sensor color is no longer stored in profiles.
- Group sensor's colors by type.
## CoreCtrl 1.1.5 (2021-08-22)
### Fixed
- Fixed wrong VRAM usage shown (#92). Thanks to Dmitry Fateev (!30).
- Fixed incorrect amount of VRAM detected (#83). GPU video ram is now read from ioctl.
- Fixed advanced performance settings not being cleaned when switching to other performance modes (#204).
### Changed
- Minor code refactorings.
- Move translations and QT_STYLE_OVERRIDE messages to INFO level.
## CoreCtrl 1.1.4 (2021-07-25)
### Changed
- Code cleanups.
- Remove unsafe flags on arch installation instructions (#181).
### Added
- Rework AMD fan sensors creation logic (#184).
## CoreCtrl 1.1.3 (2021-05-09)
### Fixed
- Fix tests compilation (#178).
### Added
- Make path to pci.ids configurable at build time using -DWITH_PCI_IDS_PATH=<path-to-pci.ids-file>. Thanks to Alexander Kapshuna (!26).
## CoreCtrl 1.1.2 (2021-05-02)
### Fixed
- Fixed theme by ignoring QT_STYLE_OVERRIDE environment variable (#106).
- Fixed header width of mode selector controls (#176).
### Changed
- Use KDEInstallDirs instead of hardcoded paths to install resources. Thanks to Alexander Kapshuna (!27).
## CoreCtrl 1.1.1 (2020-08-19)
### Fixed
- Fixed kernel version parsing. Thanks to Norbert Preining (#82).
- Added svg Qt component as required dependency (#61).
- Fixed incorrect executable file name on profile dialog (#94).
- Added a workaround for bogus values on critical temperature (#103).
- Fixed settings are not being applied with some wine executables (#121).
### Added
- Added Bulgarian translation. Thanks to Xrey274 (!17).
- Added Russian translation to launcher.desktop comment. Thanks to Harry Kane (!24).
## CoreCtrl 1.1.0 (2020-05-31)
### Fixed
- Fixed compilation with newer versions of gcc (#54, #62).
- Reworked vega20 (navi... and newer hardware) advanced power management controls (#37).
### Added
- Added French translation. Thanks to DarkeoX ABYSSION Tar Valantinir (#30).
- Added Catalan translation. Thanks to bla6 (#72).
- Added workaround for high cpu load on some hardware (#29).
- Added navi support (#41).
## CoreCtrl 1.0.9 (2020-04-19)
### Fixed
- Fix compilation on some systems (#62).
## CoreCtrl 1.0.8 (2020-03-15)
### Fixed
- Fix compilation with gcc 10 (#54).
## CoreCtrl 1.0.7 (2019-11-23)
### Fixed
- Missing character on profile menu icon.
- Skip empty GPU info vendor, device and subdevice names.
- Add deferred system tray icon support (#43).
### Changed
- Code cleanups.
- Removed Patreon info.
## CoreCtrl 1.0.6 (2019-08-08)
### Fixed
- Missing controls when using Qt 5.9 (#17).
- UI performance issues (#28).
### Changed
- Update russian translation. Thanks to Schwonder Reismus (!13).
- Do not create controls and sensors when data sources have invalid data.
- Check and try to fix the state of some controls and all profiles after importing wrong values.
- Fan curve control scale the curve into valid range.
- Reduce CPU usage when the sensors graph is not visible.
### Added
- Restore previous hardware state after init.
## CoreCtrl 1.0.5 (2019-07-22)
### Fixed
- Remove qca build dependency.
- Fix wrong icon size. If you installed CoreCtrol from source, you may want to uninstall it before instaling this version. This will remove no longer used files from your computer. You can also remove them manually:
```
sudo rm /usr/share/applications/CoreCtrl.desktop /usr/share/icons/hicolor/196x196/apps/corectrl.svg
```
If `/usr/share/icons/hicolor/196x196` directory only contains `apps/corectrl.svg` remove it with:
```
sudo rm /usr/share/applications/CoreCtrl.desktop
sudo rm -rf /usr/share/icons/hicolor/196x196
```
### Added
- Add Russian translation.
- Add AppStream metadata file.
### Changed
- Improve default cpu frequency scaling governor selection.
- Follow freedesktop naming conventions for the .desktop file.
## CoreCtrl 1.0.4 (2019-07-17)
### Fixed
- Removed an unused qml module import.
### Changed
- CoreCtrl now does not start minimized on system tray by default.
## CoreCtrl 1.0.3 (2019-07-15)
### Fixed
- Fixed application crash when using Qt 5.9.
### Added
- Add uninstall target to CMake.
## CoreCtrl 1.0.2 (2019-07-15)
### Fixed
- Require CMake version 3.12 instead 3.3.
- Launcher doesn't show its icon due to installed icons having a wrong name.
## CoreCtrl 1.0.1 (2019-07-14)
### Fixed
- Compilation failed due to a wrong symbolic link.
- Some typos.
## CoreCtrl 1.0.0 (2019-07-14)
### Added
- Automatic application of profiles for native and Windows programs.
- Full AMD GPUs controls (for both old and new models).
- Basic CPU controls.

74
corectrl/CMakeLists.txt Normal file
View File

@ -0,0 +1,74 @@
cmake_minimum_required(VERSION 3.3)
project(CoreCtrl LANGUAGES CXX)
set(PROJECT_VERSION 1.4.0-dev)
include(GNUInstallDirs)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# add uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
set(CMAKE_CXX_STANDARD 17)
option (WITH_DEBUG_INFO "Add debug information (to Debug builds)" OFF)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions("-D_DEBUG")
add_compile_options("-W;-Wall;-Wextra")
add_compile_options("-Wno-redundant-move;-Wno-sign-compare")
if (WITH_DEBUG_INFO)
add_compile_options("-ggdb;-fno-omit-frame-pointer")
endif()
endif()
find_package(Qt5 5.15 COMPONENTS Core DBus Quick Charts Widgets Network Svg REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
find_package(QuaZip REQUIRED)
find_package(Botan REQUIRED)
# Allow pci.ids path customization using -DWITH_PCI_IDS_PATH=<path-to-pci.ids-file> (#136)
set(WITH_PCI_IDS_PATH "/usr/share/hwdata/pci.ids" CACHE FILEPATH "Path to pci.ids file")
add_subdirectory(src)
# Tests
include(CTest)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()
# Icons
string(TOLOWER "${PROJECT_NAME}" ICON_NAME)
foreach(ICON_SIZE 16 22 24 32 48 64 72 96 128 192 256)
install(
FILES resources/icon/app_${ICON_SIZE}.svg
DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/icons/hicolor/${ICON_SIZE}x${ICON_SIZE}/apps
RENAME ${ICON_NAME}.svg
)
endforeach()
# .desktop file
install(
FILES resources/launcher.desktop
DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications
RENAME org.corectrl.corectrl.desktop
)
# AppStream metadata
install(
FILES resources/org.corectrl.corectrl.appdata.xml
DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/metainfo
)

28
corectrl/CONTRIBUTING.md Normal file
View File

@ -0,0 +1,28 @@
# Contributing
CoreCtrl welcomes your contributions.
## Build instructions
You can find the build instructions on the [wiki](https://gitlab.com/corectrl/corectrl/wikis/Installation).
## Issues writing guidelines
Please, follow these guidelines to write your issues. Reported issues not following this guidelines may be closed as invalid.
* One issue per report.
* Be precise and clear.
* Use the issue templates.
* Use good descriptive titles for new issues.
As first step, read the [FAQ](https://gitlab.com/corectrl/corectrl/wikis/FAQ) and [Known issues](https://gitlab.com/corectrl/corectrl/wikis/Known-issues). If your issue doesn't appear on them, search for similar issues on the issue tracker. If you find an already opened issue and you can provide new information, then add a new comment (please, do not write +1 o similar comments). If the issue is closed, open a new one and include a reference to the old one (for example, add 'Related to #<closed_issue_number>').
## Merge request
Before starting to work on a merge request, please follow these instructions:
1. Open an issue explaining the reason for the change, state that you want to work on it and wait for the developers response. Then, create a merge request from the issue and start working on the change.
2. Follow the [coding style](#coding-style) rules and make sure your code integrates well into the application architecture.
3. Make sure that all unit tests pass when you are working on existing controls. If you are working on a new control, you must write tests for it.
4. During the merge request, be concise on your comments and make sure that you fully understand what you are stating on them.
## Coding style
* Format your code with clang-format. You can do it with your editor or running `./format.sh` on the root project directory, then pick the formatted files that you are working on.
* Use [east const](https://mariusbancila.ro/blog/2018/11/23/join-the-east-const-revolution/).
* Use plain C++17 as much as possible. Don't use Qt functionality unless you have to.

674
corectrl/COPYING Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

3
corectrl/LICENSE Normal file
View File

@ -0,0 +1,3 @@
All CoreCtrl source files are licensed under the GNU General Public License. See the 'COPYING' file for details.
Thirdparty project files from Easylogging++, {fmt}, pugixml, UNITS, Catch2 and Trompeloeil use their own license. See the accompanying LICENSE file of each project for more details.

77
corectrl/README.md Normal file
View File

@ -0,0 +1,77 @@
# CoreCtrl
[![CoreCtrl 1.0 overview video](https://gitlab.com/corectrl/corectrl/wikis/img/overview-1.0.png)](https://www.youtube.com/watch?v=6uchS6OiwiU)
**CoreCtrl** is a Free and Open Source GNU/Linux application that allows you to control with ease your computer hardware using application profiles. It aims to be flexible, comfortable and accessible to regular users.
There are already others GNU/Linux applications that allow you to control your hardware. *Some* of them are pretty good. *Most* of them are not built with regular users in mind and/or are focused on some specific hardware or features, so usually you end up with multiple control programs installed and running at the same time, each of them having its own specific configuration. Also, most of them do not respond to external events other that the hardware events they control so, if you want to change the behavior of the system for a given period of time, let's say, during one specific program execution, you have to manually interact with each control program in order to change its behavior, before and after that specific program execution.
All of this is perceived by regular users as a big burden or even a barrier that impedes them to migrate to GNU/Linux for some specific tasks (as gaming).
**CoreCtrl** aims to be a game changer in this particular field. You can use it to automatically configure your system when a program is launched (works for Windows applications too). It doesn't matter what the program is, a game, a 3D modeling application, a video editor or... even a compiler! It offers you full hardware control per application.
The actual version of **CoreCtrl** automatically apply profiles for native and Windows applications, has basic CPU controls and full AMD GPUs controls (for both old and new models). The goal is to support as much hardware as possible, even from other vendors. Please, see [Future work](https://gitlab.com/corectrl/corectrl/wikis/home#future-work) for more details.
## Installation
### Distribution packages
This list may contain unofficial distribution packages, maintained by other people not directly related with this proyect. Please report any problems you find in these packages to them.
For security reasons, always be extra careful on what you install on your system. I you are suspicious about them, you can wait until you distribution packages CoreCtrl officially or you can install it from the [source code](https://gitlab.com/corectrl/corectrl/wikis/Installation).
If you find something malicious on any of them, please open an issue so the list can be updated.
#### Arch Linux
pacman -S corectrl
#### Fedora
sudo dnf install corectrl
#### Gentoo
Add the [farmboy0](https://github.com/farmboy0/portage-overlay) overlay.
Then run:
emerge --ask --verbose kde-misc/corectrl
#### openSUSE
Install the [corectrl](https://software.opensuse.org/download.html?project=home%3ADead_Mozay&package=corectrl) package from OBS.
#### Ubuntu
Add the [`Ernst ppa-mesarc`](https://launchpad.net/~ernstp/+archive/ubuntu/mesarc) PPA.
**WARNING:** This repository also hosts **release candidate and development versions** of many other packages. Notice that, by installing such packages, you can run into bugs that could break your system.
Most users may only want to install `corectrl` from this PPA. If so, create the file `/etc/apt/preferences.d/corectrl` with the following content:
# Never prefer packages from the ernstp repository
Package: *
Pin: release o=LP-PPA-ernstp-mesarc
Pin-Priority: 1
# Allow upgrading only corectrl from LP-PPA-ernstp-mesarc
Package: corectrl
Pin: release o=LP-PPA-ernstp-mesarc
Pin-Priority: 500
Then run:
sudo apt install corectrl
#### Others
For other installation methods, see [Installation](https://gitlab.com/corectrl/corectrl/-/wikis/Installation).
## Setup
It's **strongly recommended** to [setup your system](https://gitlab.com/corectrl/corectrl/-/wikis/Setup) for better user experience and to unlock **hidden hardware features**.
## More info
Check the [Wiki](https://gitlab.com/corectrl/corectrl/wikis/home) for more useful info.

View File

@ -0,0 +1,41 @@
# - Find botan
# Find the botan cryptographic library
#
# This module defines the following variables:
# Botan_FOUND - True if library and include directory are found
# If set to TRUE, the following are also defined:
# Botan_INCLUDE_DIRS - The directory where to find the header file
# Botan_LIBRARIES - Where to find the library file
#
# For conveniance, these variables are also set. They have the same values
# than the variables above. The user can thus choose his/her prefered way
# to write them.
# Botan_LIBRARY
# Botan_INCLUDE_DIR
#
# This file is in the public domain
find_package(PkgConfig REQUIRED)
pkg_check_modules(Botan botan-2)
if(NOT Botan_FOUND)
find_path(Botan_INCLUDE_DIRS NAMES botan/botan.h
PATH_SUFFIXES botan-2
DOC "The botan include directory")
find_library(Botan_LIBRARIES NAMES botan botan-2
DOC "The botan library")
# Use some standard module to handle the QUIETLY and REQUIRED arguments, and
# set Botan_FOUND to TRUE if these two variables are set.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Botan REQUIRED_VARS Botan_LIBRARIES Botan_INCLUDE_DIRS)
if(Botan_FOUND)
set(Botan_LIBRARY ${Botan_LIBRARIES} CACHE INTERNAL "")
set(Botan_INCLUDE_DIR ${Botan_INCLUDE_DIRS} CACHE INTERNAL "")
set(Botan_FOUND ${Botan_FOUND} CACHE INTERNAL "")
endif()
endif()
mark_as_advanced(Botan_INCLUDE_DIRS Botan_LIBRARIES)

View File

@ -0,0 +1,49 @@
#
# SPDX-License-Identifier: BSD-3-Clause
#
# QUAZIP_FOUND - QuaZip library was found
# QUAZIP_INCLUDE_DIR - Path to QuaZip include dir
# QUAZIP_INCLUDE_DIRS - Path to QuaZip and zlib include dir (combined from QUAZIP_INCLUDE_DIR + ZLIB_INCLUDE_DIR)
# QUAZIP_LIBRARIES - List of QuaZip libraries
# QUAZIP_ZLIB_INCLUDE_DIR - The include dir of zlib headers
if(Qt5Core_FOUND)
set(QUAZIP_LIB_VERSION_SUFFIX 5)
elseif(Qt6Core_FOUND)
set(QUAZIP_LIB_VERSION_SUFFIX 6)
endif(Qt5Core_FOUND)
find_package(QuaZip-Qt${QUAZIP_LIB_VERSION_SUFFIX} QUIET)
if(QuaZip-Qt${QUAZIP_LIB_VERSION_SUFFIX}_FOUND)
set(QUAZIP_INCLUDE_DIRS QuaZip::QuaZip)
set(QUAZIP_LIBRARIES QuaZip::QuaZip)
set(QUAZIP_FOUND TRUE)
elseif(QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
set(QUAZIP_FOUND TRUE)
else()
find_library(QUAZIP_LIBRARIES
NAMES quazip${QUAZIP_LIB_VERSION_SUFFIX}
HINTS /usr/lib /usr/lib64
)
find_path(QUAZIP_INCLUDE_DIR quazip.h
HINTS /usr/include /usr/local/include
PATH_SUFFIXES quazip${QUAZIP_LIB_VERSION_SUFFIX}
)
find_path(QUAZIP_ZLIB_INCLUDE_DIR zlib.h
HINTS /usr/include /usr/local/include
)
set(QUAZIP_INCLUDE_DIRS ${QUAZIP_INCLUDE_DIR} ${QUAZIP_ZLIB_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QuaZip DEFAULT_MSG
QUAZIP_LIBRARIES
QUAZIP_INCLUDE_DIR
QUAZIP_ZLIB_INCLUDE_DIR
QUAZIP_INCLUDE_DIRS
)
endif()

View File

@ -0,0 +1,25 @@
#
# From CMake FAQ:
# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake
#
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)

View File

@ -0,0 +1,5 @@
corectrl (1.4.0-99pika1) kinetic; urgency=medium
* First Push
-- Ward Nakchbandi <hotrod.master@hotmail.com> Fri, 09 Oct 2022 21:38:00 +0300

1
corectrl/debian/compat Normal file
View File

@ -0,0 +1 @@
13

49
corectrl/debian/control Normal file
View File

@ -0,0 +1,49 @@
Source: corectrl
Section: admin
Priority: optional
Maintainer: Ernst Sjöstrand <ernstp@gmail.com>
Build-Depends:
gcc-11 | gcc-10 | gcc-9 | gcc-8,
g++-11 | g++-10 | g++-9 | g++-8,
cmake,
extra-cmake-modules,
debhelper (>=11~),
qttools5-dev,
qml-module-qtquick2,
qtdeclarative5-dev,
libqt5charts5-dev,
libqt5svg5-dev,
libbotan-2-dev,
libqca-qt5-2-dev,
libdrm-dev,
qtbase5-dev,
libegl1-mesa-dev | libegl-dev,
libquazip5-dev,
libpolkit-gobject-1-dev,
libdbus-1-dev
Standards-Version: 4.1.4
Homepage: https://gitlab.com/corectrl/corectrl
Package: corectrl
Architecture: any
Multi-Arch: foreign
Depends:
${misc:Depends},
${shlibs:Depends},
qml-module-qtquick2,
qml-module-qtquick-controls2,
qml-module-qtquick-layouts,
qml-module-qtquick-window2,
qml-module-qt-labs-platform,
qml-module-qtcharts,
sysvinit-utils,
util-linux,
hwdata,
mesa-utils,
vulkan-tools | vulkan-utils
Description: Core control application
CoreCtrl is a Free and Open Source GNU/Linux application that
allows you to control with ease your computer hardware using
application profiles. It aims to be flexible, comfortable and
accessible to regular users.
By Juan Palacios: https://www.patreon.com/jpalaciosdev

848
corectrl/debian/copyright Normal file
View File

@ -0,0 +1,848 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: corectrl
Source: <url://example.com>
#
# Please double check copyright with the licensecheck(1) command.
Files: *
Copyright: 2019 Juan Palacios <jpalaciosdev@gmail.com>
License: GPL-3.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Distributed under the GPL version 3 or any later version.
.
On Debian systems, the complete text of the GNU General Public License
Version 3 can be found in `/usr/share/common-licenses/GPL-3'.
Files: .clang-format
.gitignore
CMakeLists.txt
CONTRIBUTING.md
README.md
build/CMakeCache.txt
build/CMakeFiles/3.13.4/CMakeCXXCompiler.cmake
build/CMakeFiles/3.13.4/CMakeDetermineCompilerABI_CXX.bin
build/CMakeFiles/3.13.4/CMakeSystem.cmake
build/CMakeFiles/3.13.4/CompilerIdCXX/CMakeCXXCompilerId.cpp
build/CMakeFiles/3.13.4/CompilerIdCXX/a.out
build/CMakeFiles/CMakeOutput.log
build/CMakeFiles/cmake.check_cache
build/CMakeFiles/feature_tests.bin
build/CMakeFiles/feature_tests.cxx
build/cmake_uninstall.cmake
build/prefix.sh
cmake/FindBotan.cmake
cmake/cmake_uninstall.cmake.in
debian/rules
format.sh
resources/launcher.desktop
src/CMakeLists.txt
src/helper/CMakeLists.txt
src/helper/org.corectrl.helper.actions.ini
src/helper/org.corectrl.helperkiller.actions.ini
src/images/patreon.png
src/qtquickcontrols2.conf
tests/CMakeLists.txt
Copyright: __NO_COPYRIGHT_NOR_LICENSE__
License: __NO_COPYRIGHT_NOR_LICENSE__
Files: src/3rdparty/pugixml/pugiconfig.hpp
src/3rdparty/pugixml/pugixml.cpp
src/3rdparty/pugixml/pugixml.hpp
Copyright: 2006-2018 Arseny Kapoulkine (arseny.kapoulkine@gmail.com) Report bugs and download new versions at http://pugixml.org/
License: __UNKNOWN__
This library is distributed under the MIT License. See notice at the end
of this file.
.
This work is based on the pugxml parser, which is:
Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
Files: src/3rdparty/fmt/core.h
src/3rdparty/fmt/format-inl.h
src/3rdparty/fmt/format.cc
Copyright: 2012 present, Victor Zverovich
2012-2016 Victor Zverovich
License: __UNKNOWN__
For the license information refer to format.h.
Files: src/3rdparty/easyloggingpp/easylogging++.cc
src/3rdparty/easyloggingpp/easylogging++.h
Copyright: 2012-2018 @abumusamq
2012-2018 Zuhd Web Services
License: __UNKNOWN__
This library is released under the MIT Licence.
https://github.com/zuhd-org/easyloggingpp/blob/master/LICENSE
.
https://zuhd.org
http://muflihun.com
Files: src/3rdparty/units/units.h
Copyright: __NO_COPYRIGHT__ in: src/3rdparty/units/units.h
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Files: tests/3rdparty/catch/catch.hpp
Copyright: 2019 Two Blue Cubes Ltd.
License: BSL-1.0
Distributed under the Boost Software License, Version 1.0. (See accompanying
Files: tests/3rdparty/trompeloeil/trompeloeil.hpp
Copyright: 2014-2019 Björn Fahller
2017-2018 Andrew Paxie
License: __UNKNOWN__
Use, modification and distribution is subject to the
Boost Software License, Version 1.0. (See accompanying
Files: src/3rdparty/fmt/format.h
Copyright: 2012 present, Victor Zverovich
License: BSD-2-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#----------------------------------------------------------------------------
# xml and html files (skipped):
# src/resources.qrc
# src/helper/org.corectrl.helper.conf
# src/translations/lang_es_ES.ts
# src/translations/lang_ru_RU.ts
# src/translations/lang_en_EN.ts
# src/images/DefaultIcon.svg
# src/images/GlobalProfile.svg
# resources/icon/app_16.svg
# resources/icon/app_256.svg
# resources/icon/app_64.svg
# resources/icon/app_128.svg
# resources/icon/app_192.svg
# resources/icon/app_24.svg
# resources/icon/app_22.svg
# resources/icon/app_96.svg
# resources/icon/app_48.svg
# resources/icon/app_32.svg
# resources/icon/app_72.svg
#----------------------------------------------------------------------------
# Files marked as NO_LICENSE_TEXT_FOUND may be covered by the following
# license/copyright files.
#----------------------------------------------------------------------------
# License file: COPYING
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
.
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
.
Preamble
.
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
.
The precise terms and conditions for copying, distribution and
modification follow.
.
TERMS AND CONDITIONS
.
0. Definitions.
.
"This License" refers to version 3 of the GNU General Public License.
.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
.
A "covered work" means either the unmodified Program or a work based
on the Program.
.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
.
1. Source Code.
.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
.
The Corresponding Source for a work in source code form is that
same work.
.
2. Basic Permissions.
.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
.
4. Conveying Verbatim Copies.
.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
.
5. Conveying Modified Source Versions.
.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
.
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
.
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
.
6. Conveying Non-Source Forms.
.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
.
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
.
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
.
7. Additional Terms.
.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
.
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
.
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
.
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
.
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
.
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
.
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
.
8. Termination.
.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
.
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
.
9. Acceptance Not Required for Having Copies.
.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
.
10. Automatic Licensing of Downstream Recipients.
.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
.
11. Patents.
.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
.
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
.
12. No Surrender of Others' Freedom.
.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
.
13. Use with the GNU Affero General Public License.
.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
.
14. Revised Versions of this License.
.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
.
15. Disclaimer of Warranty.
.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
.
16. Limitation of Liability.
.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
.
17. Interpretation of Sections 15 and 16.
.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
.
END OF TERMS AND CONDITIONS
.
How to Apply These Terms to Your New Programs
.
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
Also add information on how to contact you by electronic and paper mail.
.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
#----------------------------------------------------------------------------
# License file: LICENSE
All CoreCtrl source files are licensed under the GNU General Public License. See the 'COPYING' file for details.
.
Thirdparty project files from Easylogging++, {fmt}, pugixml, UNITS, Catch2 and Trompeloeil use their own license. See the accompanying LICENSE file of each project for more details.

14
corectrl/debian/rules Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/make -f
dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
DEB_DISTRIBUTION = $(call dpkg_late_eval,DEB_DISTRIBUTION,dpkg-parsechangelog -SDistribution)
ifeq ($(DEB_DISTRIBUTION),bionic)
export CC = gcc-8
export CXX = g++-8
endif
%:
dh $@ --buildsystem=cmake
override_dh_auto_test:
true

7
corectrl/format.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
echo "Formatting code..."
find . -type d -name 3rdparty -prune -o -type f \( -name "*\.h" -o -name "*\.cpp" \) -print0 | xargs -0 -I '{}' sh -c "clang-format -i {}; echo -n '.'"
echo "Done."

View File

@ -0,0 +1,313 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="128"
height="128"
sodipodi:docname="app_128.svg"
viewBox="0 0 128 128"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1149"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="5.6568543"
inkscape:cx="11.313708"
inkscape:cy="70.62229"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g947"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
inkscape:label="corectrl"
transform="translate(-1.999998,29)"
id="g961"
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996">
<g
id="g1074"
inkscape:label="pins"
transform="translate(7)">
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M 12.999998,99 V -29 h 4 V 99 Z"
id="path1072"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1231"
d="M 20.999998,99 V -29 h 4 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M 28.999998,99 V -29 h 4 V 99 Z"
id="path1233"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1235"
d="M 36.999998,99 V -29 h 4 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M 44.999998,99 V -29 h 4 V 99 Z"
id="path1237"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1239"
d="M 52.999998,99 V -29 h 4 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M 60.999998,99 V -29 h 4 V 99 Z"
id="path1241"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1243"
d="M 68.999998,99 V -29 h 4 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M 76.999998,99 V -29 h 4 V 99 Z"
id="path1245"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1247"
d="M 84.999998,99 V -29 h 4 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M 92.999998,99 V -29 h 4 V 99 Z"
id="path1249"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1251"
d="M 101,99 V -29 h 4 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
inkscape:connector-curvature="0"
id="path1253"
d="M -5.000001,-11.000001 H 123 v 4 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M -5.000001,-3.000001 H 123 v 4 H -5.000001 Z"
id="path1255"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1257"
d="M -5.000001,4.999999 H 123 v 4 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M -5.000001,12.999999 H 123 v 4 H -5.000001 Z"
id="path1259"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1261"
d="M -5.000001,20.999999 H 123 v 4 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M -5.000001,28.999999 H 123 v 4 H -5.000001 Z"
id="path1263"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1265"
d="M -5.000001,36.999999 H 123 v 4 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M -5.000001,44.999999 H 123 v 4 H -5.000001 Z"
id="path1267"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1269"
d="M -5.000001,52.999999 H 123 v 4 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M -5.000001,60.999999 H 123 v 4 H -5.000001 Z"
id="path1271"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1273"
d="M -5.000001,68.999999 H 123 v 4 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:2"
d="M -5.000001,77.000001 H 123 v 4 H -5.000001 Z"
id="path1275"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:label="chip"
id="g947"
transform="matrix(3.9905084,0,0,3.9774572,2.2847455,-28.954914)">
<rect
inkscape:label="shadow"
style="opacity:0.2;stroke-width:1.00376534"
width="28.06657"
height="28.144342"
x="1.9334009"
y="3.0200186"
rx="1.5035663"
ry="1.5077326"
id="rect941" />
<rect
inkscape:label="main"
style="fill:#363636;stroke-width:1.00402009;fill-opacity:1"
width="28.06657"
height="28.158625"
x="1.9334298"
y="2"
rx="1.5035663"
ry="1.5084978"
id="rect943" />
<path
sodipodi:nodetypes="sscsscsss"
inkscape:label="highlight"
style="opacity:0.1;fill:#ffffff"
inkscape:connector-curvature="0"
d="m 3.4307761,2.0055516 c -0.831,1.84e-4 -1.4959948,0.6717767 -1.497231,1.5027758 l -0.0015,1.005877 c 0,-0.831 0.666231,-1.5025918 1.497231,-1.5027758 L 28.4985,3.0058786 c 0.831,-1.84e-4 1.5,0.669 1.5,1.5 L 30,3.5 C 30.001236,2.6690009 29.331,1.999816 28.5,2 Z"
id="path945" />
</g>
<g
inkscape:label="slider"
id="g955"
transform="matrix(4.14064,0,0,4.14064,12.601047,-36.656638)">
<path
inkscape:label="upper"
sodipodi:nodetypes="ccccc"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.78729308"
inkscape:connector-curvature="0"
d="m 7.1000983,7.8868576 -0.00542,7.2955714 H 8.3076445 V 7.8868576 Z"
id="path949" />
<path
inkscape:label="lower"
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.60352343"
d="M 7.095484,15.182429 7.10006,26 h 1.2075845 c 5.227e-4,-3.155124 -0.00169,-7.662446 0,-10.817571 z"
id="path951" />
<path
inkscape:connector-curvature="0"
id="path953"
d="m 4.2321844,12.958537 h 6.7320506 v 2.656594 H 4.2321844 Z"
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:1.33609354" />
</g>
<path
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:4.22975826;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 101,5 -0.0452,-9 H 74.999998 l 4e-6,33 H 101 V 17 h -5.000002 v 7 h -12 v -7 l -4,-4 V 1 h 13 v 4"
id="path959"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path851"
d="m 101,47 -0.0452,-9 H 74.999998 l 4e-6,33 H 101 V 59 h -5.000002 v 7 h -12 v -7 l -4,-4 V 43 h 13 v 4"
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:4.22975826;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="16"
height="16"
sodipodi:docname="app_16.svg"
viewBox="0 0 16 16"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1149"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="45.254834"
inkscape:cx="3.3808543"
inkscape:cy="8.0322911"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g872"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
inkscape:label="corectrl"
transform="translate(20.000017,8.5555555)"
id="g872"
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996">
<g
id="g888"
inkscape:label="pins"
transform="matrix(1,0,0,1.3333333,0,0.18518485)">
<path
inkscape:connector-curvature="0"
id="path874"
d="m -5.000017,-6.5555554 v 12 h -2 v -12 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -9.0000168,-6.5555553 v 12 h -2.0000002 v -12 z"
id="path876"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path878"
d="m -13.000017,-6.5555553 v 12 h -2 v -12 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -17.000017,-6.5555554 v 12 h -2 v -12 z"
id="path880"
inkscape:connector-curvature="0" />
</g>
<rect
inkscape:label="chip"
style="fill:#363636;stroke-width:0.49487168;fill-opacity:1"
width="12"
height="16"
x="-6.5555553"
y="4.0000172"
rx="0"
ry="0"
id="rect858"
transform="rotate(90)" />
<path
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:0.54772258;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m -13.000017,-1.5555555 v -2 h -4 v 6 h 4 v -2 h -1 v 1 h -2 c -0.0025,-1.2000433 0.0051,-2.7999845 0,-4 h 2 v 1"
id="path882"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccc"
inkscape:connector-curvature="0"
id="path826"
d="m -7.000017,-1.5555555 v -2 h -4 v 6 h 4 v -2 h -1 v 1 h -2 c -0.0025,-1.2000433 0.0051,-2.7999845 0,-4 h 2 v 1"
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:0.54772258;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1,323 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="192"
height="192"
sodipodi:docname="app_192.svg"
viewBox="0 0 192 192"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1149"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="5.6568545"
inkscape:cx="90.156111"
inkscape:cy="95.194246"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g947"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
inkscape:label="corectrl"
transform="matrix(0.97957625,0,0,0.97961069,-1.9591506,95.018541)"
id="g961"
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996">
<g
id="g1074"
inkscape:label="pins"
transform="translate(7)">
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="m 16.437839,99.003773 v -196 h 6.125097 v 196 z"
id="path1072"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path969"
d="m 28.688034,99.003773 v -196 h 6.125097 v 196 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="m 40.938229,99.003773 v -196 h 6.125097 v 196 z"
id="path971"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path973"
d="m 53.188423,99.003773 v -196 h 6.125097 v 196 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="m 65.438619,99.003773 v -196 h 6.125097 v 196 z"
id="path975"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path977"
d="m 77.688813,99.003773 v -196 h 6.125097 v 196 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="m 89.939008,99.003773 v -196 h 6.125097 v 196 z"
id="path979"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path981"
d="m 102.1892,99.003773 v -196 h 6.1251 v 196 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="m 114.4394,99.003773 v -196 h 6.1251 v 196 z"
id="path983"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path985"
d="m 126.68959,99.003773 v -196 h 6.1251 v 196 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="m 138.93979,99.003773 v -196 h 6.1251 v 196 z"
id="path987"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path989"
d="m 151.18998,99.003773 v -196 h 6.1251 v 196 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="m 163.44018,99.003773 v -196 h 6.1251 v 196 z"
id="path991"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1019"
d="M -5.001886,-75.557256 H 191.005 v 6.124882 H -5.001886 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="M -5.001886,-63.307491 H 191.005 v 6.124881 H -5.001886 Z"
id="path1021"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1023"
d="M -5.001886,-51.057727 H 191.005 v 6.124882 H -5.001886 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="M -5.001886,-38.807964 H 191.005 v 6.124882 H -5.001886 Z"
id="path1025"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1027"
d="M -5.001886,-26.558198 H 191.005 v 6.124881 H -5.001886 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="M -5.001886,-14.308435 H 191.005 v 6.1248815 H -5.001886 Z"
id="path1029"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1031"
d="M -5.001886,-2.0586708 H 191.005 V 4.0662108 H -5.001886 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="M -5.001886,10.19109 H 191.005 v 6.124885 H -5.001886 Z"
id="path1033"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1035"
d="M -5.001886,22.44086 H 191.005 v 6.124884 H -5.001886 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="M -5.001886,34.690619 H 191.005 v 6.124885 H -5.001886 Z"
id="path1037"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1039"
d="M -5.001886,46.940388 H 191.005 v 6.124885 H -5.001886 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408"
d="M -5.001886,59.190148 H 191.005 v 6.124884 H -5.001886 Z"
id="path1041"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1043"
d="M -5.001886,71.439917 H 191.005 v 6.124885 H -5.001886 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.06252408" />
</g>
<g
inkscape:label="chip"
id="g947"
transform="matrix(6.255958,0,0,6.2303728,0.11605986,-99.248836)">
<rect
inkscape:label="shadow"
style="opacity:0.2;stroke-width:1.00376534"
width="28.06657"
height="28.144342"
x="1.9334009"
y="3.0200186"
rx="1.5035663"
ry="1.5077326"
id="rect941" />
<rect
inkscape:label="main"
style="fill:#363636;stroke-width:1.00443196;fill-opacity:1"
width="28.067053"
height="28.18125"
x="1.9329468"
y="2"
rx="1.5035921"
ry="1.5097098"
id="rect943" />
<path
sodipodi:nodetypes="sscsscsss"
inkscape:label="highlight"
style="opacity:0.1;fill:#ffffff"
inkscape:connector-curvature="0"
d="m 3.4307761,2.0055516 c -0.831,1.84e-4 -1.4981162,0.6717762 -1.497231,1.5027758 l 0.00105,0.9853964 c 0,-0.831 0.666231,-1.5025918 1.497231,-1.5027758 L 28.50105,2.985398 c 0.831,-1.839e-4 1.5,0.669 1.5,1.5 L 30,3.5 C 29.999115,2.6690004 29.331,1.999816 28.5,2 Z"
id="path945" />
</g>
<g
inkscape:label="slider"
id="g955"
transform="matrix(4.5823082,0,0,4.5823082,31.743865,-61.140011)">
<path
inkscape:label="upper"
sodipodi:nodetypes="ccccc"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.93937129"
inkscape:connector-curvature="0"
d="m 6.875964,0.19489666 -0.006,9.38391704 H 8.2124998 V 0.19489666 Z"
id="path949" />
<path
inkscape:label="lower"
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.76092911"
d="m 6.8758159,10.442446 0.00504,15.594097 h 1.3316409 c 5.764e-4,-4.548277 -0.00187,-11.045818 0,-15.594097 z"
id="path951" />
<path
inkscape:connector-curvature="0"
id="path953"
d="M 2.6429837,7.3236268 H 12.445332 V 11.55631 H 2.6429837 Z"
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:2.035043" />
</g>
<path
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:6.3558507;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 152.06489,-44.934729 v -15.312205 h -37.77144 v 52.0614976 h 37.77144 V -27.580896 h -8.1668 v 11.22895 H 129.6062 v -11.22895 l -7.14595,-6.124883 v -18.374646 h 17.35444 v 7.145696"
id="path959"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path1045"
d="M 152.06489,21.41816 V 6.1059553 H 114.29345 V 58.167453 h 37.77144 v -19.39546 h -8.1668 v 11.22895 H 129.6062 V 38.771993 L 122.46025,32.64711 V 14.272464 h 17.35444 v 7.145696"
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:6.3558507;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,260 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="22"
height="22"
sodipodi:docname="app_22.svg"
viewBox="0 0 22 22"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1340"
inkscape:window-height="1148"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="16"
inkscape:cx="10.5625"
inkscape:cy="15"
inkscape:window-x="578"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="corectrl"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996"
id="corectrl"
transform="translate(22.000002,-7)"
inkscape:label="corectrl">
<g
id="g876"
inkscape:label="pins">
<path
inkscape:connector-curvature="0"
id="path825"
d="M -17.000002,29 V 7 h 1 v 22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M -15.000002,29 V 7 h 1 v 22 z"
id="path828"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path830"
d="M -13.000002,29 V 7 h 1 v 22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M -11.000002,29 V 7 h 1 v 22 z"
id="path832"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path834"
d="M -9.000002,29 V 7 h 1 v 22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M -7.000002,29 V 7 h 1 v 22 z"
id="path836"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path838"
d="M -5.000002,29 V 7 h 1 v 22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M -19.000002,29 V 7 h 1 v 22 z"
id="path842"
inkscape:connector-curvature="0" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -22.000002,12 h 22 v 1 h -22 z"
id="path844"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path846"
d="m -22.000002,14 h 22 v 1 h -22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -22.000002,16 h 22 v 1 h -22 z"
id="path848"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path850"
d="m -22.000002,18 h 22 v 1 h -22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -22.000002,20 h 22 v 1 h -22 z"
id="path852"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path854"
d="m -22.000002,22 h 22 v 1 h -22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -22.000002,24 h 22 v 1 h -22 z"
id="path856"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path858"
d="m -22.000002,10 h 22 v 1 h -22 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
</g>
<rect
id="rect2-0"
ry="0.96428561"
rx="0.9644472"
y="10"
x="-20.000002"
height="18"
width="18.003014"
style="clip-rule:evenodd;opacity:0.2;fill-rule:evenodd;stroke-width:0.6429109;stroke-linejoin:round;stroke-miterlimit:1.41420996"
inkscape:label="shadow" />
<rect
id="rect4-0"
ry="0.96428573"
rx="0.96428573"
y="9"
x="-20.000002"
height="18"
width="18"
style="fill:#363636;stroke-width:0.64285719;fill-opacity:1"
inkscape:label="chip" />
<g
transform="matrix(0.77777778,0,0,0.77777778,-20.822919,4.7777778)"
id="g868"
inkscape:label="slider">
<path
id="path8"
d="M 6.211462,7.9999999 6.2057477,15 H 7.4865885 V 7.9999999 Z"
inkscape:connector-curvature="0"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.77140063"
sodipodi:nodetypes="ccccc"
inkscape:label="upper" />
<path
id="path10"
d="m 6.2008933,15 0.00485,11 h 1.2808408 c 5.544e-4,-3.208333 -0.00179,-7.791667 0,-11 z"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.62677896"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="lower" />
<path
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd"
d="m 3.6294649,13.142857 h 6.4285711 v 2.571429 H 3.6294649 Z"
id="path827"
inkscape:connector-curvature="0" />
</g>
<path
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:0.79056948;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m -5.000002,21 v -2 h -5 v 6 h 5 v -2 h -1 v 1 h -3 c -0.00403,-1.500054 0.00844,-2.499981 0,-4 h 3.0000003 l -3e-7,1"
id="path1079"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccc"
inkscape:connector-curvature="0"
id="path1077"
d="m -5.000002,13 v -2 h -5 v 6 h 5 v -2 h -1 v 1 h -3 c -0.00583,-1.500053 0.00856,-2.499993 1.19e-4,-4 h 2.999881 v 1"
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:0.79056948;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,286 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="24"
height="24"
sodipodi:docname="app_24.svg"
viewBox="0 0 24 24"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<inkscape:path-effect
effect="spiro"
id="path-effect1126"
is_visible="true" />
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1372"
inkscape:window-height="1148"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="16"
inkscape:cx="15.5625"
inkscape:cy="13.0625"
inkscape:window-x="546"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="g850"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996"
id="corectrl"
transform="translate(22.000002,-4)"
inkscape:label="corectrl">
<g
id="g898"
inkscape:label="pins">
<path
inkscape:connector-curvature="0"
id="path844"
d="m -19.000002,4 v 24 h 1 V 4 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -17.000002,4 v 24 h 1 V 4 Z"
id="path846"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path848"
d="m -15.000002,4 v 24 h 1 V 4 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -13.000002,4 v 24 h 1 V 4 Z"
id="path850"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path852"
d="m -11.000002,4 v 24 h 1 V 4 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -9.000002,4 v 24 h 1 V 4 Z"
id="path854"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path856"
d="m -7.000002,4 v 24 h 1 V 4 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m -5.000002,4 v 24 h 1 V 4 Z"
id="path858"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path860"
d="m -3.000002,4 v 24 h 1 V 4 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,7 h -24 v 1 h 24 z"
id="path862"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path864"
d="m 1.999998,9 h -24 v 1 h 24 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,11 h -24 v 1 h 24 z"
id="path866"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path868"
d="m 1.999998,13 h -24 v 1 h 24 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,15 h -24 v 1 h 24 z"
id="path870"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path872"
d="m 1.999998,17 h -24 v 1 h 24 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,19 h -24 v 1 h 24 z"
id="path874"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path876"
d="m 1.999998,21 h -24 v 1 h 24 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,23 h -24 v 1 h 24 z"
id="path878"
inkscape:connector-curvature="0" />
</g>
<g
transform="matrix(0.71348951,0,0,0.71428572,-21.424884,4.5714286)"
id="g850"
inkscape:label="chip">
<rect
id="rect2-0"
ry="1.5"
rx="1.5"
y="3.3999996"
x="2.0283067"
height="28"
width="28"
style="opacity:0.2"
inkscape:label="shadow" />
<rect
id="rect4-0"
ry="1.5"
rx="1.5014665"
y="2"
x="2"
height="28"
width="28.027374"
style="fill:#363636;stroke-width:1.00048876;fill-opacity:1"
inkscape:label="main" />
<path
id="path6"
d="M 3.5,2 C 2.669,2 2,2.669 2,3.5 v 1.4046875 c 0,-0.831 0.669,-1.5 1.5,-1.5 h 25 c 0.831,0 1.5,0.669 1.5,1.5 V 3.5 C 30,2.669 29.331,2 28.5,2 Z"
inkscape:connector-curvature="0"
style="opacity:0.1;fill:#ffffff"
inkscape:label="highlight"
sodipodi:nodetypes="sscsscsss" />
</g>
<g
transform="matrix(0.77786016,0,0,0.77786016,-20.174267,2.7756365)"
id="g868"
inkscape:label="slider">
<path
id="path8"
d="m 6.6576572,8 -0.00574,7 H 7.9374806 V 8 Z"
inkscape:connector-curvature="0"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.77282006"
sodipodi:nodetypes="ccccc"
inkscape:label="upper" />
<path
id="path10"
d="m 6.6470496,15 0.00487,11 h 1.2855587 c 5.564e-4,-3.208333 -0.0018,-7.791667 0,-11 z"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.62793225"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="lower" />
<path
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd"
d="m 4.0807656,13.144218 h 6.4278904 v 2.571157 H 4.0807656 Z"
id="path826"
inkscape:connector-curvature="0" />
</g>
<path
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:0.77777785;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m -4.000002,19 v -2 h -5 v 6 h 5 v -2 h -1 v 1 h -3 v -4 h 3 v 1"
id="path1079"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccc"
inkscape:connector-curvature="0"
id="path1077"
d="M -4.000002,11 V 9 h -5 v 6 h 5 v -2 h -0.984375 l -0.015625,1 h -3 v -4 h 3 v 0.984375"
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:0.77777785;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,313 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="256"
height="256"
sodipodi:docname="app_256.svg"
viewBox="0 0 256 256"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1149"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="4"
inkscape:cx="126.75"
inkscape:cy="134.875"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g947"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
inkscape:label="corectrl"
transform="translate(-1.999998,157)"
id="g961"
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996">
<g
id="g1074"
inkscape:label="pins"
transform="translate(7)">
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="m 30.999998,99 v -256 h 8 V 99 Z"
id="path1072"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1509"
d="m 46.999998,99 v -256 h 8 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="m 62.999998,99 v -256 h 8 V 99 Z"
id="path1511"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1513"
d="m 78.999998,99 v -256 h 8 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="M 94.999998,99 V -157 H 103 V 99 Z"
id="path1515"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1517"
d="m 111,99 v -256 h 8 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="m 127,99 v -256 h 8 V 99 Z"
id="path1519"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1521"
d="m 143,99 v -256 h 8 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="m 159,99 v -256 h 8 V 99 Z"
id="path1523"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1525"
d="m 175,99 v -256 h 8 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="m 191,99 v -256 h 8 V 99 Z"
id="path1527"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1529"
d="m 207,99 v -256 h 8 V 99 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
inkscape:connector-curvature="0"
id="path1531"
d="M -5.000001,-121 H 251 v 8 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="M -5.000001,-105 H 251 v 7.999999 H -5.000001 Z"
id="path1533"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1535"
d="M -5.000001,-89.000001 H 251 v 8 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="M -5.000001,-73.000001 H 251 v 8 H -5.000001 Z"
id="path1537"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1539"
d="M -5.000001,-57.000001 H 251 v 8.000002 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="M -5.000001,-40.999999 H 251 v 8 H -5.000001 Z"
id="path1541"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1543"
d="M -5.000001,-24.999999 H 251 v 8 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="M -5.000001,-8.999999 H 251 v 8 H -5.000001 Z"
id="path1545"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1547"
d="M -5.000001,7.000001 H 251 v 8 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="M -5.000001,23.000001 H 251 v 8 H -5.000001 Z"
id="path1549"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1551"
d="M -5.000001,39.000001 H 251 v 8 H -5.000001 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:3.99999952"
d="M -5.000001,55.000001 H 251 v 8 H -5.000001 Z"
id="path1553"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:label="chip"
id="g947"
transform="matrix(7.9808877,0,0,7.9464506,2.5733667,-156.8929)">
<rect
inkscape:label="shadow"
style="opacity:0.2;stroke-width:1.0045563"
width="28.066599"
height="28.188686"
x="1.9334009"
y="3.0067387"
rx="1.5035678"
ry="1.5101081"
id="rect941" />
<rect
inkscape:label="main"
style="fill:#363636;stroke-width:1.0045644;fill-opacity:1"
width="28.067053"
height="28.188686"
x="1.9329468"
y="2"
rx="1.5035921"
ry="1.5101081"
id="rect943" />
<path
sodipodi:nodetypes="sscsscsss"
inkscape:label="highlight"
style="opacity:0.1;fill:#ffffff"
inkscape:connector-curvature="0"
d="m 3.4307761,2.0055516 c -0.831,1.84e-4 -1.496738,0.6717759 -1.497231,1.5027758 l -5.983e-4,1.0085194 c 0,-0.831 0.6730833,-1.5107177 1.5040833,-1.5106409 l 25.0623719,0.00232 c 0.831,7.68e-5 1.5,0.669 1.5,1.5 L 30,3.5 C 30.000493,2.6690001 29.331,1.999816 28.5,2 Z"
id="path945" />
</g>
<g
inkscape:label="slider"
id="g955"
transform="matrix(5.786135,0,0,5.786135,40.821464,-107.43951)">
<path
inkscape:label="upper"
sodipodi:nodetypes="ccccc"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.95549989"
inkscape:connector-curvature="0"
d="M 6.9437228,0.24878611 6.937517,9.6327031 H 8.3265482 V 0.24878611 Z"
id="path949" />
<path
inkscape:label="lower"
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.77319968"
d="M 6.9375207,10.505625 6.9427643,26 h 1.3837839 c 5.989e-4,-4.519191 -0.00193,-10.975182 0,-15.494375 z"
id="path951" />
<path
inkscape:connector-curvature="0"
id="path953"
d="M 2.6376614,7.5075175 H 12.647222 V 11.655364 H 2.6376614 Z"
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:2.03572726" />
</g>
<path
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:8.11214066;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 198,-86 v -20 h -48 v 66 h 48 v -23 h -10 v 13 h -19 v -14 l -9,-9 v -23 h 23 v 10"
id="path959"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path849"
d="m 198,-3 v -20 h -48 v 66 h 48 V 20 H 188 V 33 H 169 V 19 l -9,-9 v -23 h 23 v 10"
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:8.11214066;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,322 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="32"
height="32"
sodipodi:docname="app_32.svg"
viewBox="0 0 32 32"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1376"
inkscape:window-height="1148"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="22.627417"
inkscape:cx="17.103145"
inkscape:cy="16.130873"
inkscape:window-x="542"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="g850"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996"
id="corectrl"
transform="translate(1.9073486e-6)"
inkscape:label="corectrl">
<g
id="g907"
inkscape:label="pins">
<path
inkscape:connector-curvature="0"
id="path829"
d="m 2.9999981,0 v 32 h 1 V 0 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 4.9999981,0 v 32 h 1 V 0 Z"
id="path831"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path833"
d="m 6.9999981,0 v 32 h 1 V 0 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 8.9999981,0 V 32 H 9.999998 V 0 Z"
id="path835"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path837"
d="m 10.999998,0 v 32 h 1 V 0 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 12.999998,0 v 32 h 1 V 0 Z"
id="path839"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path841"
d="m 14.999998,0 v 32 h 1 V 0 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 16.999998,0 v 32 h 1 V 0 Z"
id="path843"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path845"
d="m 18.999998,0 v 32 h 1 V 0 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 20.999998,0 v 32 h 1 V 0 Z"
id="path847"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path849"
d="m 22.999998,0 v 32 h 1 V 0 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 24.999998,0 v 32 h 1 V 0 Z"
id="path851"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path853"
d="m 26.999998,0 v 32 h 1 V 0 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 31.999998,3 H -1.9073486e-6 V 4 H 31.999998 Z"
id="path855"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path857"
d="M 31.999998,5 H -1.9073486e-6 V 6 H 31.999998 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 31.999998,7 H -1.9073486e-6 V 8.0000001 L 31.999998,8 Z"
id="path859"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path861"
d="M 31.999998,9 H -1.9073486e-6 v 1 H 31.999998 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 31.999998,11 H -1.9073486e-6 v 1 H 31.999998 Z"
id="path863"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path865"
d="M 31.999998,13 H -1.9073486e-6 v 1 H 31.999998 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 31.999998,15 H -1.9073486e-6 v 1 H 31.999998 Z"
id="path867"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path869"
d="M 31.999998,17 H -1.9073486e-6 v 1 H 31.999998 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 31.999998,19 H -1.9073486e-6 v 1 H 31.999998 Z"
id="path871"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path873"
d="M 31.999998,21 H -1.9073486e-6 v 1 H 31.999998 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 31.999998,23 H -1.9073486e-6 v 1 H 31.999998 Z"
id="path875"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path877"
d="M 31.999998,25 H -1.9073486e-6 v 1 H 31.999998 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 31.999998,27 H -1.9073486e-6 v 1 H 31.999998 Z"
id="path879"
inkscape:connector-curvature="0" />
</g>
<g
transform="matrix(0.99981309,0,0,0.99507389,0.00304622,0.00985221)"
id="g850"
inkscape:label="chip">
<rect
id="rect2-0"
ry="1.5076909"
rx="1.5"
y="3"
x="2"
height="28.143564"
width="28"
style="opacity:0.2;stroke-width:1.00256038"
inkscape:label="shadow" />
<rect
id="rect4-0"
ry="1.5075707"
rx="1.5"
y="2"
x="2"
height="28.141321"
width="28"
style="fill:#363636;stroke-width:1.00252044;fill-opacity:1"
inkscape:label="main" />
<path
id="path6"
d="M 3.5,2 C 2.669,2 2,2.669 2,3.5 v 1 C 2,3.669 2.669,3 3.5,3 h 25 C 29.331,3 30,3.669 30,4.5 v -1 C 30,2.669 29.331,2 28.5,2 Z"
inkscape:connector-curvature="0"
style="opacity:0.1;fill:#ffffff"
inkscape:label="highlight" />
</g>
<g
transform="translate(3.0624981,-1)"
id="g868"
inkscape:label="slider">
<path
id="path8"
d="M 6.9419614,8 6.9375,15 h 1 V 8 Z"
inkscape:connector-curvature="0"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.68160444"
sodipodi:nodetypes="ccccc"
inkscape:label="upper" />
<path
id="path10"
d="M 6.93371,15 6.9375,26 h 1 c 4.328e-4,-3.208333 -0.0014,-7.791667 0,-11 z"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.55381769"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="lower" />
<path
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd"
d="m 3.9375,13 h 7 v 3 h -7 z"
id="path828"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
</g>
<path
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 23.999998,19 v -2 h -6 v 8 h 6 v -3 h -1 v 2 h -4 v -6 h 3 v 1"
id="path1079"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccc"
inkscape:connector-curvature="0"
id="path1077"
d="M 23.999998,9 V 7 h -6 v 8 h 6 v -3 h -1 v 2 h -4 V 8 h 3 v 1"
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,283 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="48"
height="48"
sodipodi:docname="app_48.svg"
viewBox="0 0 48 48"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1352"
inkscape:window-height="1148"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="11.313709"
inkscape:cx="28.107495"
inkscape:cy="35.355339"
inkscape:window-x="566"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="g850"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:snap-bbox="false"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996"
id="corectrl"
transform="translate(-62.999998,-74)"
inkscape:label="corectrl">
<g
id="g885"
inkscape:label="pins">
<path
inkscape:connector-curvature="0"
id="path831"
d="m 69.999998,74 v 48 h 2 V 74 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 73.999998,74 v 48 h 2 V 74 Z"
id="path833"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path835"
d="m 77.999998,74 v 48 h 2 V 74 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 81.999998,74 v 48 h 2 V 74 Z"
id="path837"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path839"
d="m 85.999998,74 v 48 h 2 V 74 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 89.999998,74 v 48 h 2 V 74 Z"
id="path841"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path843"
d="m 93.999998,74 v 48 h 2 V 74 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 97.999998,74 v 48 h 2 V 74 Z"
id="path845"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path847"
d="m 102,74 v 48 h 2 V 74 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 111,80.999999 H 62.999999 v 2 H 111 Z"
id="path849"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path851"
d="M 111,84.999999 H 62.999999 v 2 H 111 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 111,88.999999 H 62.999999 v 2 H 111 Z"
id="path853"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path855"
d="M 111,92.999999 H 62.999999 v 2 H 111 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 111,96.999999 H 62.999999 v 2 H 111 Z"
id="path857"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path859"
d="M 111,101 H 62.999999 v 2 H 111 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 111,105 H 62.999999 v 2 H 111 Z"
id="path861"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path863"
d="M 111,109 H 62.999999 v 2 H 111 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 111,113 H 62.999999 v 2 H 111 Z"
id="path865"
inkscape:connector-curvature="0" />
</g>
<g
transform="matrix(1.4961953,0,0,1.491438,63.127558,74.017124)"
id="g850"
inkscape:label="chip">
<rect
id="rect2-0"
ry="1.5085577"
rx="1.5040519"
y="3.3419855"
x="1.9202281"
height="28.159742"
width="28.075636"
style="opacity:0.2;stroke-width:1.00420213"
inkscape:label="shadow" />
<rect
id="rect4-0"
ry="1.5084666"
rx="1.5043515"
y="2"
x="1.9187713"
height="28.158041"
width="28.081228"
style="fill:#363636;stroke-width:1.00427175;fill-opacity:1"
inkscape:label="main" />
<path
id="path6"
d="m 3.4242871,2 c -0.831,0 -1.5029353,0.661596 -1.5055158,1.492592 l -0.00435,1.4008147 c 0,-0.831 0.7032345,-1.5555377 1.5342345,-1.5554508 l 25.0574362,0.00262 c 0.831,8.69e-5 1.489557,0.7292397 1.489557,1.5602397 L 30,3.5 C 30.002581,2.669004 29.331,2 28.5,2 Z"
inkscape:connector-curvature="0"
style="opacity:0.1;fill:#ffffff"
inkscape:label="highlight"
sodipodi:nodetypes="sscsscsss" />
</g>
<g
transform="matrix(1.443729,0,0,1.443729,67.881916,73.463047)"
id="g868"
inkscape:label="slider">
<path
id="path8"
d="m 6.3218513,7.2984286 -0.00618,7.6926504 h 1.385303 V 7.2984286 Z"
inkscape:connector-curvature="0"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.84099573"
sodipodi:nodetypes="ccccc"
inkscape:label="upper" />
<path
id="path10"
d="m 6.3104226,14.917587 0.00525,11.775063 H 7.700948 c 5.996e-4,-3.434393 -0.00194,-8.34067 0,-11.775063 z"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.67440403"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="lower" />
<path
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:1.29099429"
d="m 3.5450433,12.839635 h 6.9265077 v 2.770603 H 3.5450433 Z"
id="path828"
inkscape:connector-curvature="0" />
</g>
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path1077"
d="m 99.999998,87 v -3 h -9 v 12 h 9 v -4 h -2 v 3 h -4 v -3 l -1,-1 v -6 h 4 v 2"
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:1.44444418;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
<path
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:1.44444418;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 99.999998,103 v -3 h -9 v 12 h 9 v -4 h -2 v 3 h -4 v -3 l -1,-1 v -6 h 4 v 2"
id="path919"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="c" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,312 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="64"
height="64"
sodipodi:docname="app_64.svg"
viewBox="0 0 64 64"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1355"
inkscape:window-height="1148"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="11.313709"
inkscape:cx="27.709746"
inkscape:cy="44.547725"
inkscape:window-x="563"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="g850"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996"
id="corectrl"
transform="translate(-1.9999981,-35)"
inkscape:label="corectrl">
<g
id="g901"
inkscape:label="pins">
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 14.999998,99 V 35 h 2 v 64 z"
id="path831"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path833"
d="M 18.999998,99 V 35 h 2 v 64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 22.999998,99 V 35 h 2 v 64 z"
id="path835"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path837"
d="M 26.999998,99 V 35 h 2 v 64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 30.999998,99 V 35 h 2 v 64 z"
id="path839"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path841"
d="M 34.999998,99 V 35 h 2 v 64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 38.999998,99 V 35 h 2 v 64 z"
id="path843"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path845"
d="M 42.999998,99 V 35 h 2 v 64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 46.999998,99 V 35 h 2 v 64 z"
id="path847"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path849"
d="M 50.999998,99 V 35 h 2 v 64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
inkscape:connector-curvature="0"
id="path855"
d="m 1.999998,48 h 64 v 2 h -64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,52 h 64 v 2 h -64 z"
id="path857"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path859"
d="m 1.999998,56 h 64 v 2 h -64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,60 h 64 v 2 h -64 z"
id="path861"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path863"
d="m 1.999998,64 h 64 v 2 h -64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,68 h 64 v 2 h -64 z"
id="path865"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path867"
d="m 1.999998,72 h 64 v 2 h -64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,76 h 64 v 2 h -64 z"
id="path869"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path871"
d="m 1.999998,80 h 64 v 2 h -64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="m 1.999998,84 h 64 v 2 h -64 z"
id="path873"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path846"
d="M 10.999998,99 V 35 h 2 v 64 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 54.999998,99 V 35 h 2 v 64 z"
id="path848"
inkscape:connector-curvature="0" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd"
d="M 1.9999981,44 H 65.999998 v 2 H 1.9999981 Z"
id="path850"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path852"
d="M 1.9999981,88 H 65.999998 v 2 H 1.9999981 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd" />
</g>
<g
transform="matrix(1.9950739,0,0,1.9901478,2.1477814,35.019704)"
id="g850"
inkscape:label="chip">
<rect
id="rect2-0"
ry="1.5077326"
rx="1.5035663"
y="3"
x="1.9334298"
height="28.144342"
width="28.06657"
style="opacity:0.2;stroke-width:1.00376534"
inkscape:label="shadow" />
<rect
id="rect4-0"
ry="1.5074265"
rx="1.5035663"
y="2"
x="1.9334298"
height="28.138626"
width="28.06657"
style="fill:#363636;stroke-width:1.00366342;fill-opacity:1"
inkscape:label="main" />
<path
id="path6"
d="m 3.4307761,2.0055516 c -0.831,1.84e-4 -1.497231,0.6717758 -1.497231,1.5027758 v 1 c 0,-0.831 0.666231,-1.5025918 1.497231,-1.5027758 L 28.5,3 C 29.331,2.999816 30,3.669 30,4.5 v -1 C 30,2.669 29.331,1.999816 28.5,2 Z"
inkscape:connector-curvature="0"
style="opacity:0.1;fill:#ffffff"
inkscape:label="highlight"
sodipodi:nodetypes="sscsscsss" />
</g>
<g
transform="matrix(1.9981602,0,0,1.9981602,8.1396015,33.027597)"
id="g868"
inkscape:label="slider">
<path
id="path8"
d="M 6.9419614,7.4930939 6.9375,15 h 1 V 7.4930939 Z"
inkscape:connector-curvature="0"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.70585239"
sodipodi:nodetypes="ccccc"
inkscape:label="upper" />
<path
id="path10"
d="M 6.93371,15 6.9375,26 h 1 c 4.328e-4,-3.208333 -0.0014,-7.791667 0,-11 z"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.55381769"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="lower" />
<path
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:1.44973171"
d="M 3.9280788,12.497698 H 10.940262 V 15.50046 H 3.9280788 Z"
id="path828"
inkscape:connector-curvature="0" />
</g>
<path
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 50.999998,73 v -4 h -12 v 16 h 12 v -5.40625 h -2 V 83 h -6 v -4 l -2,-2 v -6 h 6 v 2"
id="path1079"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path1077"
d="m 50.999998,52 v -4 h -12 v 16 h 12 v -6 h -2 v 4 h -6 v -4 l -2,-2 v -6 h 6 v 2"
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,322 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="72"
height="72"
sodipodi:docname="app_72.svg"
viewBox="0 0 72 72"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1355"
inkscape:window-height="1148"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="8"
inkscape:cx="23.4375"
inkscape:cy="60.875"
inkscape:window-x="563"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="g947"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
inkscape:label="corectrl"
transform="translate(-1.999998,-27)"
id="g961"
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996">
<g
inkscape:label="pins"
id="g939">
<path
inkscape:connector-curvature="0"
id="path891"
d="M 12.999998,99 V 27 h 2 v 72 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024"
d="M 16.999998,99 V 27 h 2 v 72 z"
id="path893"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path895"
d="M 20.999998,99 V 27 h 2 v 72 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024"
d="M 24.999998,99 V 27 h 2 v 72 z"
id="path897"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path899"
d="M 28.999998,99 V 27 h 2 v 72 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024"
d="M 32.999998,99 V 27 h 2 v 72 z"
id="path901"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path903"
d="M 36.999998,99 V 27 h 2 v 72 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024"
d="M 40.999998,99 V 27 h 2 v 72 z"
id="path905"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path907"
d="M 44.999998,99 V 27 h 2 v 72 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024"
d="M 48.999998,99 V 27 h 2 v 72 z"
id="path909"
inkscape:connector-curvature="0" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012"
d="M 1.9999979,50 H 73.999998 v 2 H 1.9999979 Z"
id="path911"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path913"
d="M 1.9999979,54 H 73.999998 v 2 H 1.9999979 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012"
d="M 1.9999979,58 H 73.999998 v 2 H 1.9999979 Z"
id="path915"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path917"
d="M 1.9999979,62 H 73.999998 v 2 H 1.9999979 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012"
d="M 1.9999979,66 H 73.999998 v 2 H 1.9999979 Z"
id="path919"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path921"
d="M 1.9999979,70 H 73.999998 v 2 H 1.9999979 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012"
d="M 1.9999979,74 H 73.999998 v 2 H 1.9999979 Z"
id="path923"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path925"
d="M 1.9999979,78 H 73.999998 v 2 H 1.9999979 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012"
d="M 1.9999979,82 H 73.999998 v 2 H 1.9999979 Z"
id="path927"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path929"
d="M 1.9999979,86 H 73.999998 v 2 H 1.9999979 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012" />
<path
inkscape:connector-curvature="0"
id="path933"
d="M 52.999998,99 V 27 h 2 v 72 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024" />
<path
inkscape:connector-curvature="0"
id="path935"
d="M 1.9999979,46 H 73.999998 v 2 H 1.9999979 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012"
d="M 1.9999979,42 H 73.999998 v 2 H 1.9999979 Z"
id="path963"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path965"
d="M 1.9999979,38 H 73.999998 v 2 H 1.9999979 Z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066012" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024"
d="M 56.999998,99 V 27 h 2 v 72 z"
id="path969"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path971"
d="M 60.999998,99 V 27 h 2 v 72 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.06066024" />
</g>
<g
inkscape:label="chip"
id="g947"
transform="matrix(2.2803011,0,0,2.2746707,1.5909658,26.458716)">
<rect
inkscape:label="shadow"
style="opacity:0.2;stroke-width:1.00376534"
width="28.06657"
height="28.144342"
x="1.9335307"
y="3.3069282"
rx="1.5035663"
ry="1.5077326"
id="rect941" />
<rect
inkscape:label="main"
style="fill:#363636;stroke-width:1.00366342;fill-opacity:1"
width="28.06657"
height="28.138626"
x="1.9334298"
y="2"
rx="1.5035663"
ry="1.5074265"
id="rect943" />
<path
sodipodi:nodetypes="sscsscsss"
inkscape:label="highlight"
style="opacity:0.1;fill:#ffffff"
inkscape:connector-curvature="0"
d="m 3.4307761,2.0055516 c -0.831,1.84e-4 -1.4954251,0.6717777 -1.497231,1.5027758 l -0.00284,1.3058784 c 0,-0.831 0.666231,-1.5025918 1.497231,-1.5027758 L 28.49716,3.30588 c 0.831,-1.841e-4 1.5,0.669 1.5,1.5 L 30,3.5 C 30.001806,2.6690019 29.331,1.999816 28.5,2 Z"
id="path945" />
</g>
<g
inkscape:label="slider"
id="g955"
transform="matrix(2.5395925,0,0,2.5395925,5.6262495,19.970595)">
<path
inkscape:label="upper"
sodipodi:nodetypes="ccccc"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.76717156"
inkscape:connector-curvature="0"
d="M 6.8464262,7.8868578 6.841156,15 h 1.1812919 l 0,-7.1131422 z"
id="path949" />
<path
inkscape:label="lower"
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.60017622"
d="M 6.8462786,14.974609 6.8507194,26 h 1.1717168 c 5.071e-4,-3.215739 -0.00164,-7.809652 0,-11.025391 z"
id="path951" />
<path
inkscape:connector-curvature="0"
id="path953"
d="m 4.0895448,13.005789 h 6.6892512 v 2.756348 H 4.0895448 Z"
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:1.35661399" />
</g>
<path
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:2.5;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 58.999998,45 v -5 h -15 v 20 h 15 v -8 h -3 v 5 h -7 v -5 l -2,-2 v -7 h 7 v 2"
id="path959"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path975"
d="m 58.999998,71 v -5 h -15 v 20 h 15 v -8 h -3 v 5 h -7 v -5 l -2,-2 v -7 h 7 v 2"
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:2.5;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,322 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
id="svg4153"
version="1.1"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
width="96"
height="96"
sodipodi:docname="app_96.svg"
viewBox="0 0 96 96"
inkscape:label="main"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4159">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4157">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#31363b;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1149"
id="namedview4155"
inkscape:document-units="px"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:zoom="8"
inkscape:cx="55.625"
inkscape:cy="41.6875"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g947"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:lockguides="true"
showguides="true"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1">
<inkscape:grid
type="xygrid"
id="grid818"
empspacing="5" />
</sodipodi:namedview>
<inkscape:clipboard
style="opacity:0.01000001;fill:#00000f;fill-opacity:0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stroke:none"
min="0,0"
max="22,22" />
<g
inkscape:label="corectrl"
transform="translate(-1.999998,-3)"
id="g961"
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41420996">
<g
id="g1074"
inkscape:label="pins">
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="M 12.999998,99 V 3 h 3 v 96 z"
id="path1072"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1080"
d="M 18.999998,99 V 3 h 3 v 96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="M 24.999998,99 V 3 h 3 v 96 z"
id="path1082"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1084"
d="M 30.999998,99 V 3 h 3 v 96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="M 36.999998,99 V 3 h 3 v 96 z"
id="path1086"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1088"
d="M 42.999998,99 V 3 h 3 v 96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="M 48.999998,99 V 3 h 3 v 96 z"
id="path1090"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1092"
d="M 54.999998,99 V 3 h 3 v 96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="M 60.999998,99 V 3 h 3 v 96 z"
id="path1094"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1096"
d="M 66.999998,99 V 3 h 3 v 96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="M 72.999998,99 V 3 h 3 v 96 z"
id="path1098"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1100"
d="M 78.999998,99 V 3 h 3 v 96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="M 84.999998,99 V 3 h 3 v 96 z"
id="path1102"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1104"
d="m 1.999998,14 h 96 v 3 h -96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="m 1.999998,20 h 96 v 3 h -96 z"
id="path1106"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1108"
d="m 1.999998,26 h 96 v 3 h -96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="m 1.999998,32 h 96 v 3 h -96 z"
id="path1110"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1112"
d="m 1.999998,38 h 96 v 3 h -96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="m 1.999998,44 h 96 v 3 h -96 z"
id="path1114"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1116"
d="m 1.999998,50 h 96 v 3 h -96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="m 1.999998,56 h 96 v 3 h -96 z"
id="path1118"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1120"
d="m 1.999998,62 h 96 v 3 h -96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="m 1.999998,68 h 96 v 3 h -96 z"
id="path1122"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1124"
d="m 1.999998,74 h 96 v 3 h -96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
<path
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5"
d="m 1.999998,80 h 96 v 3 h -96 z"
id="path1126"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path1128"
d="m 1.999998,86 h 96 v 3 h -96 z"
style="fill:#8e8e8e;fill-opacity:1;fill-rule:evenodd;stroke-width:1.5" />
</g>
<g
inkscape:label="chip"
id="g947"
transform="matrix(3.0634594,0,0,3.0558953,1.0767052,1.8943738)">
<rect
inkscape:label="shadow"
style="opacity:0.2;stroke-width:1.00376534"
width="28.06657"
height="28.144342"
x="1.9335307"
y="3.3069282"
rx="1.5035663"
ry="1.5077326"
id="rect941" />
<rect
inkscape:label="main"
style="fill:#363636;stroke-width:1.00379241;fill-opacity:1"
width="28.06657"
height="28.145857"
x="1.9334298"
y="2"
rx="1.5035663"
ry="1.5078139"
id="rect943" />
<path
sodipodi:nodetypes="sscsscsss"
inkscape:label="highlight"
style="opacity:0.1;fill:#ffffff"
inkscape:connector-curvature="0"
d="m 3.4307761,2.0055516 c -0.831,1.84e-4 -1.4954251,0.6717777 -1.497231,1.5027758 l -0.00284,1.3058784 c 0,-0.831 0.666231,-1.5025918 1.497231,-1.5027758 L 28.49716,3.30588 c 0.831,-1.841e-4 1.5,0.669 1.5,1.5 L 30,3.5 C 30.001806,2.6690019 29.331,1.999816 28.5,2 Z"
id="path945" />
</g>
<g
inkscape:label="slider"
id="g955"
transform="matrix(3.3125119,0,0,3.3125119,7.170103,-5.1253107)">
<path
inkscape:label="upper"
sodipodi:nodetypes="ccccc"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.77426326"
inkscape:connector-curvature="0"
d="m 6.9235401,7.8868579 -0.00527,7.2452571 H 8.0995618 V 7.8868579 Z"
id="path949" />
<path
inkscape:label="lower"
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
style="fill:#ff4500;fill-opacity:1;stroke-width:0.59656948"
d="M 6.9233925,15.106724 6.9278325,26 h 1.1717168 c 5.071e-4,-3.177205 -0.00164,-7.71607 0,-10.893276 z"
id="path951" />
<path
inkscape:connector-curvature="0"
id="path953"
d="m 4.1750476,13.018915 h 6.6414854 v 2.716971 H 4.1750476 Z"
style="fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:1.34207153" />
</g>
<path
style="clip-rule:evenodd;fill:#ff9a0a;fill-opacity:1;fill-rule:evenodd;stroke-width:3.20652175;stroke-linejoin:round;stroke-miterlimit:1.41420996"
d="m 75.999998,28 v -7 h -19 v 26 h 19 V 37 h -4 v 6 h -8 v -6 l -3,-3 v -9 h 9 v 3"
id="path959"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="c" />
<path
inkscape:label="c"
sodipodi:nodetypes="cccccccccccccc"
inkscape:connector-curvature="0"
id="path1130"
d="m 75.999998,62 v -7 h -19 v 26 h 19 V 71 h -4 v 6 h -8 v -6 l -3,-3 v -9 h 9 v 3"
style="clip-rule:evenodd;fill:#ff4500;fill-opacity:1;fill-rule:evenodd;stroke-width:3.20652175;stroke-linejoin:round;stroke-miterlimit:1.41420996" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,22 @@
[Desktop Entry]
Name=CoreCtrl
GenericName=Core control
Comment=Control your computer with ease using application profiles
Exec=corectrl
Icon=corectrl
StartupNotify=true
StartupWMClass=corectrl
Terminal=false
Type=Application
Categories=System;Settings;Utility;
Keywords=core;control;system;hardware;
# Translations
GenericName[bg]=Централен Контрол
Comment[bg]=Управлявайте компютъра си с лекота, изполвайки профили за програмите ви
GenericName[es_ES]=Control central
Comment[es_ES]=Controle su computadora fácilmente usando perfiles de aplicaciones
GenericName[ru]=Центральный контроль
Comment[ru]=Управляйте своим оборудованием с легкостью, используя профили приложений

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.corectrl.corectrl</id>
<!-- Copyright 2019 Artem Polishchuk <ego.cordatus@gmail.com> -->
<metadata_license>CC0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>CoreCtrl</name>
<summary>A friendly hardware control</summary>
<description>
<p>CoreCtrl is a Free and Open Source GNU/Linux application that allows you
to control with ease your computer hardware using application profiles.
It aims to be flexible, comfortable and accessible to regular users.</p>
</description>
<provides>
<binary>corectrl</binary>
</provides>
<screenshots>
<screenshot type="default">
<image>https://gitlab.com/corectrl/corectrl/wikis/img/screenshot1.png</image>
</screenshot>
</screenshots>
<developer_name>Juan Palacios</developer_name>
<url type="homepage">https://gitlab.com/corectrl/corectrl</url>
<url type="bugtracker">https://gitlab.com/corectrl/corectrl/issues</url>
<url type="translate">https://gitlab.com/corectrl/corectrl/tree/master/src/translations</url>
<url type="help">https://gitlab.com/corectrl/corectrl/wikis</url>
</component>

View File

@ -0,0 +1,25 @@
The MIT License (MIT)
Copyright (c) 2012-2018 Amrayn Web Services
Copyright (c) 2012-2018 @abumusamq
https://github.com/amrayn/
https://amrayn.com
https://muflihun.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

27
corectrl/src/3rdparty/fmt/LICENSE vendored Normal file
View File

@ -0,0 +1,27 @@
Copyright (c) 2012 - present, Victor Zverovich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- Optional exception to the license ---
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into a machine-executable object form of such
source code, you may redistribute such embedded portions in such object form
without including the above copyright and permission notices.

3002
corectrl/src/3rdparty/fmt/core.h vendored Normal file

File diff suppressed because it is too large Load Diff

2620
corectrl/src/3rdparty/fmt/format-inl.h vendored Normal file

File diff suppressed because it is too large Load Diff

78
corectrl/src/3rdparty/fmt/format.cc vendored Normal file
View File

@ -0,0 +1,78 @@
// Formatting library for C++
//
// Copyright (c) 2012 - 2016, Victor Zverovich
// All rights reserved.
//
// For the license information refer to format.h.
#include "fmt/format-inl.h"
FMT_BEGIN_NAMESPACE
namespace detail {
template <typename T>
int format_float(char* buf, std::size_t size, const char* format, int precision,
T value) {
#ifdef FMT_FUZZ
if (precision > 100000)
throw std::runtime_error(
"fuzz mode - avoid large allocation inside snprintf");
#endif
// Suppress the warning about nonliteral format string.
int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF;
return precision < 0 ? snprintf_ptr(buf, size, format, value)
: snprintf_ptr(buf, size, format, precision, value);
}
template FMT_API dragonbox::decimal_fp<float> dragonbox::to_decimal(float x)
FMT_NOEXCEPT;
template FMT_API dragonbox::decimal_fp<double> dragonbox::to_decimal(double x)
FMT_NOEXCEPT;
} // namespace detail
// Workaround a bug in MSVC2013 that prevents instantiation of format_float.
int (*instantiate_format_float)(double, int, detail::float_specs,
detail::buffer<char>&) = detail::format_float;
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
template FMT_API detail::locale_ref::locale_ref(const std::locale& loc);
template FMT_API std::locale detail::locale_ref::get<std::locale>() const;
#endif
// Explicit instantiations for char.
template FMT_API auto detail::thousands_sep_impl(locale_ref)
-> thousands_sep_result<char>;
template FMT_API char detail::decimal_point_impl(locale_ref);
template FMT_API void detail::buffer<char>::append(const char*, const char*);
// DEPRECATED!
// There is no correspondent extern template in format.h because of
// incompatibility between clang and gcc (#2377).
template FMT_API void detail::vformat_to(
detail::buffer<char>&, string_view,
basic_format_args<FMT_BUFFER_CONTEXT(char)>, detail::locale_ref);
template FMT_API int detail::snprintf_float(double, int, detail::float_specs,
detail::buffer<char>&);
template FMT_API int detail::snprintf_float(long double, int,
detail::float_specs,
detail::buffer<char>&);
template FMT_API int detail::format_float(double, int, detail::float_specs,
detail::buffer<char>&);
template FMT_API int detail::format_float(long double, int, detail::float_specs,
detail::buffer<char>&);
// Explicit instantiations for wchar_t.
template FMT_API auto detail::thousands_sep_impl(locale_ref)
-> thousands_sep_result<wchar_t>;
template FMT_API wchar_t detail::decimal_point_impl(locale_ref);
template FMT_API void detail::buffer<wchar_t>::append(const wchar_t*,
const wchar_t*);
template struct detail::basic_data<void>;
FMT_END_NAMESPACE

2830
corectrl/src/3rdparty/fmt/format.h vendored Normal file

File diff suppressed because it is too large Load Diff

24
corectrl/src/3rdparty/pugixml/LICENSE vendored Normal file
View File

@ -0,0 +1,24 @@
MIT License
Copyright (c) 2006-2020 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,77 @@
/**
* pugixml parser - version 1.11
* --------------------------------------------------------
* Copyright (C) 2006-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
* of this file.
*
* This work is based on the pugxml parser, which is:
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
*/
#ifndef HEADER_PUGICONFIG_HPP
#define HEADER_PUGICONFIG_HPP
// Uncomment this to enable wchar_t mode
// #define PUGIXML_WCHAR_MODE
// Uncomment this to enable compact mode
// #define PUGIXML_COMPACT
// Uncomment this to disable XPath
// #define PUGIXML_NO_XPATH
// Uncomment this to disable STL
// #define PUGIXML_NO_STL
// Uncomment this to disable exceptions
// #define PUGIXML_NO_EXCEPTIONS
// Set this to control attributes for public classes/functions, i.e.:
// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL
// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL
// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall
// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead
// Tune these constants to adjust memory-related behavior
// #define PUGIXML_MEMORY_PAGE_SIZE 32768
// #define PUGIXML_MEMORY_OUTPUT_STACK 10240
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096
// Tune this constant to adjust max nesting for XPath queries
// #define PUGIXML_XPATH_DEPTH_LIMIT 1024
// Uncomment this to switch to header-only version
// #define PUGIXML_HEADER_ONLY
// Uncomment this to enable long long support
// #define PUGIXML_HAS_LONG_LONG
#endif
/**
* Copyright (c) 2006-2020 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/

13020
corectrl/src/3rdparty/pugixml/pugixml.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

1499
corectrl/src/3rdparty/pugixml/pugixml.hpp vendored Normal file

File diff suppressed because it is too large Load Diff

21
corectrl/src/3rdparty/units/LICENSE vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Nic Holthaus
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

4844
corectrl/src/3rdparty/units/units.h vendored Normal file

File diff suppressed because it is too large Load Diff

423
corectrl/src/CMakeLists.txt Normal file
View File

@ -0,0 +1,423 @@
configure_file(config.h.in config.h)
list(APPEND 3RDPARTY_INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty
)
list (APPEND 3RDPARTY_COMMON_SRC
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/fmt/format.cc
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/easyloggingpp/easylogging++.cc
)
list (APPEND 3RDPARTY_COMMON_DEFINITIONS
ELPP_THREAD_SAFE
ELPP_FORCE_USE_STD_THREAD
ELPP_NO_LOG_TO_FILE
ELPP_NO_DEFAULT_LOG_FILE
)
list (APPEND 3RDPARTY_SRC
${3RDPARTY_COMMON_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/pugixml/pugixml.cpp
)
list (APPEND 3RDPARTY_DEFINITIONS
${3RDPARTY_COMMON_DEFINITIONS}
UNIT_LIB_DISABLE_IOSTREAM
DISABLE_PREDEFINED_UNITS
ENABLE_PREDEFINED_DATA_UNITS
ENABLE_PREDEFINED_ANGLE_UNITS
ENABLE_PREDEFINED_TIME_UNITS
ENABLE_PREDEFINED_ANGULAR_VELOCITY_UNITS
ENABLE_PREDEFINED_FREQUENCY_UNITS
ENABLE_PREDEFINED_VOLTAGE_UNITS
ENABLE_PREDEFINED_POWER_UNITS
ENABLE_PREDEFINED_TEMPERATURE_UNITS
ENABLE_PREDEFINED_CONVERT_UNITS
ENABLE_PREDEFINED_CONCENTRATION_UNITS
)
list(APPEND COMMON_SRC
${CMAKE_CURRENT_SOURCE_DIR}/common/fileutils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/common/stringutils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/common/cryptolayer.cpp
)
list(APPEND CORE_SRC
core/filecache.cpp
core/profileiconcache.cpp
core/commandqueue.cpp
core/sysmodel.cpp
core/sysexplorer.cpp
core/sysmodelfactory.cpp
core/sysmodelsyncer.cpp
core/session.cpp
core/profileview.cpp
core/profilepartview.cpp
core/profileviewfactory.cpp
core/profilestorage.cpp
core/profilexmlparserfactory.cpp
core/profilepartxmlparserprovider.cpp
core/profilexmlparser.cpp
core/profilepartxmlparser.cpp
core/profilemanager.cpp
core/profile.cpp
core/profilepart.cpp
core/profilepartprovider.cpp
core/profilefactory.cpp
core/ccpro/zipdatasource.cpp
core/ccpro/zipdatasink.cpp
core/ccpro/ccproparser.cpp
core/info/cpuinfo.cpp
core/info/gpuinfo.cpp
core/info/swinfo.cpp
core/info/hwiddatasource.cpp
core/info/hwidtranslator.cpp
core/components/commonutils.cpp
core/components/cpuutils.cpp
core/components/amdutils.cpp
core/components/gpu.cpp
core/components/gpuprofilepart.cpp
core/components/gpuxmlparser.cpp
core/components/cpu.cpp
core/components/cpuprofilepart.cpp
core/components/cpuxmlparser.cpp
core/components/controls/control.cpp
core/components/controls/controlmode.cpp
core/components/controls/controlmodeprofilepart.cpp
core/components/controls/controlmodexmlparser.cpp
core/components/controls/controlgroup.cpp
core/components/controls/controlgroupprofilepart.cpp
core/components/controls/controlgroupxmlparser.cpp
)
list(APPEND INFO_SRC
core/info/infoproviderregistry.cpp
core/info/common/cpuinfolscpu.cpp
core/info/common/cpuinfoproccpuinfo.cpp
core/info/common/gpuinfouevent.cpp
core/info/common/gpuinforevision.cpp
core/info/common/gpuinfoopengl.cpp
core/info/common/gpuinfovulkan.cpp
core/info/common/swinfokernel.cpp
core/info/common/swinfomesa.cpp
core/info/amd/gpuinfopm.cpp
core/info/amd/gpuinfopmoverdrive.cpp
core/info/amd/gpuinfovbios.cpp
core/info/amd/gpuinfovram.cpp
core/info/amd/gpuinfouniqueid.cpp
)
list(APPEND CONTROLS_SRC
core/components/controls/noop.cpp
core/components/controls/noopprofilepart.cpp
core/components/controls/noopxmlparser.cpp
core/components/controls/gpucontrolprovider.cpp
core/components/controls/amd/pm/handlers/ppdpmhandler.cpp
core/components/controls/amd/pm/pmperfmodeprovider.cpp
core/components/controls/amd/pm/pmperfmodeprofilepart.cpp
core/components/controls/amd/pm/pmperfmodexmlparser.cpp
core/components/controls/amd/pm/auto/pmauto.cpp
core/components/controls/amd/pm/auto/pmautolegacy.cpp
core/components/controls/amd/pm/auto/pmautor600.cpp
core/components/controls/amd/pm/auto/pmautoprovider.cpp
core/components/controls/amd/pm/auto/pmautoprofilepart.cpp
core/components/controls/amd/pm/auto/pmautoxmlparser.cpp
core/components/controls/amd/pm/fixed/pmfixed.cpp
core/components/controls/amd/pm/fixed/pmfixedlegacy.cpp
core/components/controls/amd/pm/fixed/pmfixedr600.cpp
core/components/controls/amd/pm/fixed/pmfixedprovider.cpp
core/components/controls/amd/pm/fixed/pmfixedprofilepart.cpp
core/components/controls/amd/pm/fixed/pmfixedxmlparser.cpp
core/components/controls/amd/pm/advanced/pmadvancedprovider.cpp
core/components/controls/amd/pm/advanced/pmadvancedprofilepart.cpp
core/components/controls/amd/pm/advanced/pmadvancedxmlparser.cpp
core/components/controls/amd/pm/advanced/dynamicfreq/pmdynamicfreq.cpp
core/components/controls/amd/pm/advanced/dynamicfreq/pmdynamicfreqprovider.cpp
core/components/controls/amd/pm/advanced/dynamicfreq/pmdynamicfreqprofilepart.cpp
core/components/controls/amd/pm/advanced/dynamicfreq/pmdynamicfreqxmlparser.cpp
core/components/controls/amd/pm/advanced/fixedfreq/pmfixedfreq.cpp
core/components/controls/amd/pm/advanced/fixedfreq/pmfixedfreqprovider.cpp
core/components/controls/amd/pm/advanced/fixedfreq/pmfixedfreqadvprovider.cpp
core/components/controls/amd/pm/advanced/fixedfreq/pmfixedfreqprofilepart.cpp
core/components/controls/amd/pm/advanced/fixedfreq/pmfixedfreqxmlparser.cpp
core/components/controls/amd/pm/advanced/freqmode/pmfreqmodeprovider.cpp
core/components/controls/amd/pm/advanced/freqmode/pmfreqmodeprofilepart.cpp
core/components/controls/amd/pm/advanced/freqmode/pmfreqmodexmlparser.cpp
core/components/controls/amd/pm/advanced/overclock/pmoverclockprovider.cpp
core/components/controls/amd/pm/advanced/overclock/pmoverclockprofilepart.cpp
core/components/controls/amd/pm/advanced/overclock/pmoverclockxmlparser.cpp
core/components/controls/amd/pm/advanced/overclock/freqod/pmfreqod.cpp
core/components/controls/amd/pm/advanced/overclock/freqod/pmfreqodprovider.cpp
core/components/controls/amd/pm/advanced/overclock/freqod/pmfreqodprofilepart.cpp
core/components/controls/amd/pm/advanced/overclock/freqod/pmfreqodxmlparser.cpp
core/components/controls/amd/pm/advanced/overdrive/pmoverdrive.cpp
core/components/controls/amd/pm/advanced/overdrive/pmoverdriveprovider.cpp
core/components/controls/amd/pm/advanced/overdrive/pmoverdriveprofilepart.cpp
core/components/controls/amd/pm/advanced/overdrive/pmoverdrivexmlparser.cpp
core/components/controls/amd/pm/advanced/overdrive/freqvolt/pmfreqvolt.cpp
core/components/controls/amd/pm/advanced/overdrive/freqvolt/pmfreqvoltprovider.cpp
core/components/controls/amd/pm/advanced/overdrive/freqvolt/pmfreqvoltprofilepart.cpp
core/components/controls/amd/pm/advanced/overdrive/freqvolt/pmfreqvoltxmlparser.cpp
core/components/controls/amd/pm/advanced/overdrive/freqrange/pmfreqrange.cpp
core/components/controls/amd/pm/advanced/overdrive/freqrange/pmfreqrangeprovider.cpp
core/components/controls/amd/pm/advanced/overdrive/freqrange/pmfreqrangeprofilepart.cpp
core/components/controls/amd/pm/advanced/overdrive/freqrange/pmfreqrangexmlparser.cpp
core/components/controls/amd/pm/advanced/overdrive/voltcurve/pmvoltcurve.cpp
core/components/controls/amd/pm/advanced/overdrive/voltcurve/pmvoltcurveprovider.cpp
core/components/controls/amd/pm/advanced/overdrive/voltcurve/pmvoltcurveprofilepart.cpp
core/components/controls/amd/pm/advanced/overdrive/voltcurve/pmvoltcurvexmlparser.cpp
core/components/controls/amd/pm/advanced/overdrive/voltoffset/pmvoltoffset.cpp
core/components/controls/amd/pm/advanced/overdrive/voltoffset/pmvoltoffsetprovider.cpp
core/components/controls/amd/pm/advanced/overdrive/voltoffset/pmvoltoffsetprofilepart.cpp
core/components/controls/amd/pm/advanced/overdrive/voltoffset/pmvoltoffsetxmlparser.cpp
core/components/controls/amd/pm/advanced/powerprofile/pmpowerprofile.cpp
core/components/controls/amd/pm/advanced/powerprofile/pmpowerprofileprovider.cpp
core/components/controls/amd/pm/advanced/powerprofile/pmpowerprofileprofilepart.cpp
core/components/controls/amd/pm/advanced/powerprofile/pmpowerprofilexmlparser.cpp
core/components/controls/amd/pm/advanced/powercap/pmpowercap.cpp
core/components/controls/amd/pm/advanced/powercap/pmpowercapprovider.cpp
core/components/controls/amd/pm/advanced/powercap/pmpowercapprofilepart.cpp
core/components/controls/amd/pm/advanced/powercap/pmpowercapxmlparser.cpp
core/components/controls/amd/pm/powerstate/pmpowerstate.cpp
core/components/controls/amd/pm/powerstate/pmpowerstateprovider.cpp
core/components/controls/amd/pm/powerstate/pmpowerstateprofilepart.cpp
core/components/controls/amd/pm/powerstate/pmpowerstatexmlparser.cpp
core/components/controls/amd/pm/powerstate/pmpowerstatemodeprovider.cpp
core/components/controls/amd/pm/powerstate/pmpowerstatemodeprofilepart.cpp
core/components/controls/amd/pm/powerstate/pmpowerstatemodexmlparser.cpp
core/components/controls/amd/fan/fanmodeprovider.cpp
core/components/controls/amd/fan/fanmodeprofilepart.cpp
core/components/controls/amd/fan/fanmodexmlparser.cpp
core/components/controls/amd/fan/auto/fanauto.cpp
core/components/controls/amd/fan/auto/fanautoprovider.cpp
core/components/controls/amd/fan/auto/fanautoprofilepart.cpp
core/components/controls/amd/fan/auto/fanautoxmlparser.cpp
core/components/controls/amd/fan/fixed/fanfixed.cpp
core/components/controls/amd/fan/fixed/fanfixedprovider.cpp
core/components/controls/amd/fan/fixed/fanfixedprofilepart.cpp
core/components/controls/amd/fan/fixed/fanfixedxmlparser.cpp
core/components/controls/amd/fan/curve/fancurve.cpp
core/components/controls/amd/fan/curve/fancurveprovider.cpp
core/components/controls/amd/fan/curve/fancurveprofilepart.cpp
core/components/controls/amd/fan/curve/fancurvexmlparser.cpp
core/components/controls/cpucontrolprovider.cpp
core/components/controls/cpu/cpufreq.cpp
core/components/controls/cpu/cpufreqprovider.cpp
core/components/controls/cpu/cpufreqprofilepart.cpp
core/components/controls/cpu/cpufreqxmlparser.cpp
core/components/controls/cpu/cpufreqmodeprovider.cpp
core/components/controls/cpu/cpufreqmodeprofilepart.cpp
core/components/controls/cpu/cpufreqmodexmlparser.cpp
)
list(APPEND SENSORS_SRC
core/components/sensors/graphitemprofilepart.cpp
core/components/sensors/graphitemxmlparser.cpp
core/components/sensors/gpusensorprovider.cpp
core/components/sensors/amd/gpufreq.cpp
core/components/sensors/amd/memfreq.cpp
core/components/sensors/amd/gputemp.cpp
core/components/sensors/amd/junctiontemp.cpp
core/components/sensors/amd/memorytemp.cpp
core/components/sensors/amd/gpuvolt.cpp
core/components/sensors/amd/power.cpp
core/components/sensors/amd/activity.cpp
core/components/sensors/amd/memusage.cpp
core/components/sensors/amd/fanspeedrpm.cpp
core/components/sensors/amd/fanspeedperc.cpp
core/components/sensors/cpusensorprovider.cpp
core/components/sensors/cpu/cpufreqpack.cpp
)
list(APPEND UI_COMPONENTS_SRC
core/uifactory.cpp
core/qmlitem.cpp
core/profilemanagerui.cpp
core/systeminfoui.cpp
core/qmlcomponentfactory.cpp
core/qmlcomponentregistry.cpp
core/sysmodelqmlitem.cpp
core/components/gpuqmlitem.cpp
core/components/cpuqmlitem.cpp
core/components/sensors/graphitem.cpp
core/components/sensors/amd/gpufreqgraphitem.cpp
core/components/sensors/amd/memfreqgraphitem.cpp
core/components/sensors/amd/gputempgraphitem.cpp
core/components/sensors/amd/junctiontempgraphitem.cpp
core/components/sensors/amd/memorytempgraphitem.cpp
core/components/sensors/amd/gpuvoltgraphitem.cpp
core/components/sensors/amd/powergraphitem.cpp
core/components/sensors/amd/activitygraphitem.cpp
core/components/sensors/amd/memusagegraphitem.cpp
core/components/sensors/amd/fanspeedrpmgraphitem.cpp
core/components/sensors/amd/fanspeedpercgraphitem.cpp
core/components/sensors/cpu/cpufreqpackgraphitem.cpp
core/components/controls/controlmodeqmlitem.cpp
core/components/controls/controlgroupqmlitem.cpp
core/components/controls/noopqmlitem.cpp
core/components/controls/amd/pm/pmperfmodeqmlitem.cpp
core/components/controls/amd/pm/auto/pmautoqmlitem.cpp
core/components/controls/amd/pm/fixed/pmfixedqmlitem.cpp
core/components/controls/amd/pm/advanced/pmadvancedqmlitem.cpp
core/components/controls/amd/pm/advanced/dynamicfreq/pmdynamicfreqqmlitem.cpp
core/components/controls/amd/pm/advanced/fixedfreq/pmfixedfreqqmlitem.cpp
core/components/controls/amd/pm/advanced/freqmode/pmfreqmodeqmlitem.cpp
core/components/controls/amd/pm/advanced/overclock/pmoverclockqmlitem.cpp
core/components/controls/amd/pm/advanced/overclock/freqod/pmfreqodqmlitem.cpp
core/components/controls/amd/pm/advanced/overdrive/pmoverdriveqmlitem.cpp
core/components/controls/amd/pm/advanced/overdrive/freqvolt/pmfreqvoltqmlitem.cpp
core/components/controls/amd/pm/advanced/overdrive/freqrange/pmfreqrangeqmlitem.cpp
core/components/controls/amd/pm/advanced/overdrive/voltcurve/pmvoltcurveqmlitem.cpp
core/components/controls/amd/pm/advanced/overdrive/voltoffset/pmvoltoffsetqmlitem.cpp
core/components/controls/amd/pm/advanced/powerprofile/pmpowerprofileqmlitem.cpp
core/components/controls/amd/pm/advanced/powercap/pmpowercapqmlitem.cpp
core/components/controls/amd/pm/powerstate/pmpowerstateqmlitem.cpp
core/components/controls/amd/pm/powerstate/pmpowerstatemodeqmlitem.cpp
core/components/controls/amd/fan/fanmodeqmlitem.cpp
core/components/controls/amd/fan/auto/fanautoqmlitem.cpp
core/components/controls/amd/fan/fixed/fanfixedqmlitem.cpp
core/components/controls/amd/fan/curve/fancurveqmlitem.cpp
core/components/controls/cpu/cpufreqqmlitem.cpp
core/components/controls/cpu/cpufreqmodeqmlitem.cpp
)
list(APPEND APP_SRC
app/app.cpp
app/appfactory.cpp
app/settings.cpp
app/singleinstance.cpp
app/systray.cpp
helper/helpercontrol.cpp
helper/helpermonitor.cpp
helper/helpersysctl.cpp
)
list (APPEND TRANSLATABLE_FILES
${UI_COMPONENTS_SRC}
app/systray.cpp
qml/main.qml
qml/ProfileButton.qml
qml/ProfileInfoDialog.qml
qml/FVControl.qml
qml/FreqStateControl.qml
qml/Profiles.qml
qml/System.qml
qml/About.qml
qml/SettingsDialog.qml
qml/SettingsGeneral.qml
qml/SettingsWorkarounds.qml
qml/SysModelForm.qml
qml/CPUForm.qml
qml/GPUForm.qml
qml/SensorGraph.qml
qml/NoopForm.qml
qml/AMDPMPerfModeForm.qml
qml/AMDPMAutoForm.qml
qml/AMDPMFixedForm.qml
qml/AMDPMAdvancedForm.qml
qml/AMDPMDynamicFreqForm.qml
qml/AMDPMFixedFreqForm.qml
qml/AMDPMFreqModeForm.qml
qml/AMDPMOverclockForm.qml
qml/AMDPMFreqVoltForm.qml
qml/AMDPMFreqRangeForm.qml
qml/AMDPMVoltCurveForm.qml
qml/AMDPMVoltOffsetForm.qml
qml/AMDPMFreqOdForm.qml
qml/AMDPMPowerProfileForm.qml
qml/AMDPMPowerCapForm.qml
qml/AMDPMPowerStateForm.qml
qml/AMDPMPowerStateModeForm.qml
qml/AMDFanModeForm.qml
qml/AMDFanAutoForm.qml
qml/AMDFanFixedForm.qml
qml/AMDFanCurveForm.qml
qml/CPUFreqForm.qml
qml/CPUFreqModeForm.qml
)
list(APPEND TRANSLATIONS
translations/lang_en_EN.ts
translations/lang_es_ES.ts
translations/lang_ru_RU.ts
translations/lang_fr_FR.ts
translations/lang_ca_ES.ts
translations/lang_bg_BG.ts
translations/lang_cs_CZ.ts
translations/lang_nl_NL.ts
translations/lang_de_DE.ts
)
set_source_files_properties(${TRANSLATIONS} PROPERTIES
OUTPUT_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/translations
)
option (UPDATE_TRANSLATIONS "Update translation files" OFF)
if (UPDATE_TRANSLATIONS)
qt5_create_translation(QM_FILES ${TRANSLATABLE_FILES} ${TRANSLATIONS} OPTIONS -noobsolete)
else (UPDATE_TRANSLATIONS)
qt5_add_translation(QM_FILES ${TRANSLATIONS})
endif (UPDATE_TRANSLATIONS)
add_custom_target(translations DEPENDS ${QM_FILES})
qt5_add_resources(CPP_QRC resources.qrc)
set(CMAKE_AUTOMOC ON)
add_library(corectrl_lib SHARED
${3RDPARTY_SRC}
${COMMON_SRC}
${CORE_SRC}
${INFO_SRC}
${CONTROLS_SRC}
${SENSORS_SRC}
${APP_SRC}
${UI_COMPONENTS_SRC}
)
set(CMAKE_AUTOMOC OFF)
target_include_directories(corectrl_lib PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${3RDPARTY_INCLUDE_DIRECTORIES}
${CMAKE_CURRENT_SOURCE_DIR}
${QUAZIP_INCLUDE_DIRS}
${Botan_INCLUDE_DIRS}
)
target_compile_features(corectrl_lib PRIVATE ${TARGET_COMMON_COMPILE_FEATURES})
target_compile_definitions(corectrl_lib PRIVATE ${3RDPARTY_DEFINITIONS})
target_link_libraries(corectrl_lib PRIVATE
Qt5::Quick
Qt5::Charts
Qt5::Widgets
Qt5::DBus
stdc++fs
pthread
${QUAZIP_LIBRARIES}
${Botan_LIBRARIES}
)
set_target_properties(corectrl_lib PROPERTIES OUTPUT_NAME corectrl)
add_executable(corectrl
main.cpp
${CPP_QRC}
${QM_FILES}
)
target_include_directories(corectrl PRIVATE
${3RDPARTY_INCLUDE_DIRECTORIES}
${CMAKE_CURRENT_SOURCE_DIR}
${Botan_INCLUDE_DIRS}
)
target_compile_features(corectrl PRIVATE ${TARGET_COMMON_COMPILE_FEATURES})
target_compile_definitions(corectrl PRIVATE ${3RDPARTY_DEFINITIONS})
target_link_libraries(corectrl PRIVATE
corectrl_lib
Qt5::Core
Qt5::Network
Qt5::Widgets
)
install(TARGETS corectrl corectrl_lib
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
add_subdirectory(helper)

342
corectrl/src/app/app.cpp Normal file
View File

@ -0,0 +1,342 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "app.h"
#include "common/stringutils.h"
#include "core/isession.h"
#include "core/isysmodelsyncer.h"
#include "core/iuifactory.h"
#include "easyloggingpp/easylogging++.h"
#include "fmt/format.h"
#include "helper/ihelpercontrol.h"
#include "settings.h"
#include "systray.h"
#include "units/units.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QIcon>
#include <QLocale>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickWindow>
#include <QTranslator>
#include <Qt>
#include <QtGlobal>
#include <algorithm>
#include <utility>
#if defined(_DEBUG)
#include <QQmlDebuggingEnabler>
#endif
App::App(std::unique_ptr<IHelperControl> &&helperControl,
std::shared_ptr<ISysModelSyncer> sysSyncer,
std::unique_ptr<ISession> &&session,
std::unique_ptr<IUIFactory> &&uiFactory) noexcept
: QObject()
, appInfo_(App::Name, App::VersionStr)
, singleInstance_(App::Name)
, helperControl_(std::move(helperControl))
, sysSyncer_(std::move(sysSyncer))
, session_(std::move(session))
, uiFactory_(std::move(uiFactory))
{
}
App::~App() = default;
int App::exec(int argc, char **argv)
{
QCoreApplication::setApplicationName(QString(App::Name.data()).toLower());
QCoreApplication::setApplicationVersion(App::VersionStr.data());
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
// Ignore QT_STYLE_OVERRIDE. It breaks the qml theme.
if (qEnvironmentVariableIsSet("QT_STYLE_OVERRIDE")) {
LOG(INFO) << fmt::format(
"Ignoring QT_STYLE_OVERRIDE environment variable.");
qunsetenv("QT_STYLE_OVERRIDE");
}
QApplication app(argc, argv);
#if defined(_DEBUG)
QQmlDebuggingEnabler enabler;
#endif
int const minHelperTimeout = helperControl_->minExitTimeout().to<int>();
int const helperTimeout{std::max(180000, // default helper timeout in milliseconds
minHelperTimeout)};
setupCmdParser(cmdParser_, minHelperTimeout, helperTimeout);
cmdParser_.process(app);
// exit if there is another instance running
if (!singleInstance_.mainInstance(app.arguments()))
return 0;
noop_ = cmdParser_.isSet("help") || cmdParser_.isSet("version");
if (noop_)
return 0;
QString lang = cmdParser_.isSet("lang") ? cmdParser_.value("lang")
: QLocale().system().name();
QTranslator translator;
if (!translator.load(QStringLiteral(":/translations/lang_") + lang)) {
LOG(INFO) << fmt::format("No translation found for locale {}",
lang.toStdString());
LOG(INFO) << fmt::format("Using en_EN translation.");
translator.load(QStringLiteral(":/translations/lang_en_EN"));
}
app.installTranslator(&translator);
app.setWindowIcon(QIcon::fromTheme(QString(App::Name.data()).toLower()));
// Ensure that the application do not implicitly call to quit after closing
// the last window, which is not the desired behaviour when minimize to
// system tray is being used.
app.setQuitOnLastWindowClosed(false);
try {
settings_ = std::make_unique<Settings>(QString(App::Name.data()).toLower());
int timeoutValue = helperTimeout;
if (cmdParser_.isSet("helper-timeout") &&
Utils::String::toNumber<int>(
timeoutValue, cmdParser_.value("helper-timeout").toStdString())) {
timeoutValue = std::max(helperControl_->minExitTimeout().to<int>(),
timeoutValue);
}
helperControl_->init(units::time::millisecond_t(timeoutValue));
sysSyncer_->init();
session_->init(sysSyncer_->sysModel());
QQmlApplicationEngine qmlEngine;
buildUI(qmlEngine);
// Load and apply stored settings
settings_->signalSettings();
showMainWindow(!toSysTray());
return app.exec();
}
catch (std::exception const &e) {
LOG(WARNING) << e.what();
LOG(WARNING) << "Initialization failed";
LOG(WARNING) << "Exiting...";
return -1;
}
return 0;
}
void App::exit()
{
if (!noop_) {
sysSyncer_->stop();
helperControl_->stop();
}
}
void App::showMainWindow(bool show)
{
if (show) {
mainWindow_->show();
mainWindow_->raise();
mainWindow_->requestActivate();
}
else {
if (sysTray_->isVisible())
mainWindow_->hide();
else
mainWindow_->showMinimized();
}
}
void App::onNewInstance(QStringList args)
{
cmdParser_.parse(args);
if (cmdParser_.isSet("toggle-manual-profile")) {
auto profileName = cmdParser_.value("toggle-manual-profile");
if (!profileName.isEmpty() && profileName.length() < 512)
session_->toggleManualProfile(profileName.toStdString());
}
else {
auto show = true;
if (cmdParser_.isSet("minimize-systray"))
show = false;
else if (cmdParser_.isSet("toggle-window-visibility")) {
// When the window is minimized, calling show() will raise it.
auto minimized =
((mainWindow_->windowState() & Qt::WindowState::WindowMinimized) ==
Qt::WindowState::WindowMinimized);
show = minimized ? true : !mainWindow_->isVisible();
}
showMainWindow(show);
}
}
void App::onSysTrayActivated()
{
showMainWindow(!mainWindow_->isVisible());
}
void App::onSettingChanged(QString const &key, QVariant const &value)
{
sysTray_->settingChanged(key, value);
sysSyncer_->settingChanged(key, value);
}
bool App::toSysTray()
{
bool hideMainWindow{false};
auto minimizeArgIsSet = cmdParser_.isSet("minimize-systray");
if (minimizeArgIsSet || settings_->getValue("sysTray", true).toBool()) {
sysTray_->show();
hideMainWindow = minimizeArgIsSet
? true
: settings_->getValue("startOnSysTray", false).toBool();
}
return hideMainWindow;
}
void App::setupCmdParser(QCommandLineParser &parser, int minHelperTimeout,
int helperTimeout) const
{
parser.addHelpOption();
parser.addVersionOption();
parser.addOptions({
{{"l", "lang"},
"Forces a specific <language>, given in locale format. Example: "
"en_EN.",
"language"},
{{"m", "toggle-manual-profile"},
"When an instance of the application is already running, it will toggle "
"the manual profile whose name is <\"profile name\">.",
"\"profile name\""},
{"minimize-systray",
"Minimizes the main window either to the system tray (when "
"available) or to the taskbar.\nWhen an instance of the application is "
"already running, the action will be applied to its main window."},
{{"t", "helper-timeout"},
"Sets helper auto exit timeout. "
"The helper process kills himself when no signals are received from "
"the application before the timeout expires.\nValues lesser than " +
QString::number(minHelperTimeout) +
+" milliseconds will be ignored.\nDefault value: " +
QString::number(helperTimeout) + " milliseconds.",
"milliseconds"},
{"toggle-window-visibility",
"When an instance of the application is already running, it will toggle "
"the main window visibility showing or minimizing it, either to the "
"taskbar or to system tray."},
});
}
void App::buildUI(QQmlApplicationEngine &qmlEngine)
{
qmlEngine.rootContext()->setContextProperty("appInfo", &appInfo_);
qmlEngine.rootContext()->setContextProperty("settings", &*settings_);
uiFactory_->build(qmlEngine, sysSyncer_->sysModel(), *session_);
mainWindow_ = qobject_cast<QQuickWindow *>(qmlEngine.rootObjects().value(0));
setupMainWindowGeometry();
connect(&qmlEngine, &QQmlApplicationEngine::quit, QApplication::instance(),
&QApplication::quit);
connect(QApplication::instance(), &QApplication::aboutToQuit, this, &App::exit);
connect(&*settings_, &Settings::settingChanged, this, &App::onSettingChanged);
connect(&singleInstance_, &SingleInstance::newInstance, this,
&App::onNewInstance);
sysTray_ = new SysTray(&*session_, mainWindow_);
connect(sysTray_, &SysTray::quit, this, &QApplication::quit);
connect(sysTray_, &SysTray::activated, this, &App::onSysTrayActivated);
connect(sysTray_, &SysTray::showMainWindowToggled, this, &App::showMainWindow);
connect(mainWindow_, &QQuickWindow::visibleChanged, &*sysTray_,
&SysTray::onMainWindowVisibleChanged);
qmlEngine.rootContext()->setContextProperty("systemTray", sysTray_);
}
void App::setupMainWindowGeometry()
{
restoreMainWindowGeometry();
// The geometry save timer is used to reduce the window geometry changed
// events fired within a time interval into a single event that will save the
// window geometry.
geometrySaveTimer_.setInterval(2000);
geometrySaveTimer_.setSingleShot(true);
connect(&geometrySaveTimer_, &QTimer::timeout, this,
&App::saveMainWindowGeometry);
connect(mainWindow_, &QWindow::heightChanged, this,
[&](int) { geometrySaveTimer_.start(); });
connect(mainWindow_, &QWindow::widthChanged, this,
[&](int) { geometrySaveTimer_.start(); });
connect(mainWindow_, &QWindow::xChanged, this,
[&](int) { geometrySaveTimer_.start(); });
connect(mainWindow_, &QWindow::yChanged, this,
[&](int) { geometrySaveTimer_.start(); });
}
void App::saveMainWindowGeometry()
{
if (!settings_->getValue("saveWindowGeometry", true).toBool())
return;
if (mainWindow_ == nullptr)
return;
auto windowGeometry = mainWindow_->geometry();
auto savedXPos =
settings_->getValue("Window/main-x-pos", DefaultWindowGeometry.x()).toInt();
if (savedXPos != windowGeometry.x())
settings_->setValue("Window/main-x-pos", windowGeometry.x());
auto savedYPos =
settings_->getValue("Window/main-y-pos", DefaultWindowGeometry.y()).toInt();
if (savedYPos != windowGeometry.y())
settings_->setValue("Window/main-y-pos", windowGeometry.y());
auto savedWidth =
settings_->getValue("Window/main-width", DefaultWindowGeometry.width())
.toInt();
if (savedWidth != windowGeometry.width())
settings_->setValue("Window/main-width", windowGeometry.width());
auto savedHeight =
settings_->getValue("Window/main-height", DefaultWindowGeometry.height())
.toInt();
if (savedHeight != windowGeometry.height())
settings_->setValue("Window/main-height", windowGeometry.height());
}
void App::restoreMainWindowGeometry()
{
if (mainWindow_ == nullptr)
return;
auto x =
settings_->getValue("Window/main-x-pos", DefaultWindowGeometry.x()).toInt();
auto y =
settings_->getValue("Window/main-y-pos", DefaultWindowGeometry.y()).toInt();
auto width =
settings_->getValue("Window/main-width", DefaultWindowGeometry.width())
.toInt();
auto height =
settings_->getValue("Window/main-height", DefaultWindowGeometry.height())
.toInt();
mainWindow_->setGeometry(x, y, width, height);
}

104
corectrl/src/app/app.h Normal file
View File

@ -0,0 +1,104 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "config.h"
#include "singleinstance.h"
#include <QCommandLineParser>
#include <QObject>
#include <QRect>
#include <QString>
#include <QStringList>
#include <QTimer>
#include <QVariant>
#include <memory>
#include <string_view>
class IHelperControl;
class ISession;
class ISysModelSyncer;
class IUIFactory;
class QQmlApplicationEngine;
class QQuickWindow;
class Settings;
class SysTray;
class AppInfo final : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ getName CONSTANT)
Q_PROPERTY(QString version READ getVersion CONSTANT)
public:
AppInfo(std::string_view appName, std::string_view appVersion) noexcept
: QObject()
, name_(appName.data())
, version_(appVersion.data())
{
}
QString const &getName() const
{
return name_;
}
QString const &getVersion() const
{
return version_;
}
private:
QString const name_;
QString const version_;
};
class App final : public QObject
{
Q_OBJECT
public:
static constexpr std::string_view Name{PROJECT_NAME};
static constexpr std::string_view VersionStr{PROJECT_VERSION};
static constexpr QRect DefaultWindowGeometry{0, 0, 970, 600};
App(std::unique_ptr<IHelperControl> &&helperControl,
std::shared_ptr<ISysModelSyncer> sysSyncer,
std::unique_ptr<ISession> &&session,
std::unique_ptr<IUIFactory> &&uiFactory) noexcept;
~App();
int exec(int argc, char **argv);
private slots:
void exit();
void showMainWindow(bool show);
void onNewInstance(QStringList args);
void onSysTrayActivated();
void onSettingChanged(QString const &key, QVariant const &value);
void saveMainWindowGeometry();
private:
bool toSysTray();
void setupCmdParser(QCommandLineParser &parser, int minHelperTimeout,
int helperTimeout) const;
void buildUI(QQmlApplicationEngine &qmlEngine);
void setupMainWindowGeometry();
void restoreMainWindowGeometry();
AppInfo appInfo_;
SingleInstance singleInstance_;
QCommandLineParser cmdParser_;
QTimer geometrySaveTimer_;
std::unique_ptr<IHelperControl> helperControl_;
std::shared_ptr<ISysModelSyncer> sysSyncer_;
std::unique_ptr<ISession> session_;
std::unique_ptr<IUIFactory> uiFactory_;
std::unique_ptr<Settings> settings_;
bool noop_{false};
QQuickWindow *mainWindow_{nullptr};
SysTray *sysTray_{nullptr};
};

View File

@ -0,0 +1,184 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "appfactory.h"
#include "app.h"
#include "common/cryptolayer.h"
#include "config.h"
#include "core/ccpro/ccproparser.h"
#include "core/components/controls/cpucontrolprovider.h"
#include "core/components/controls/gpucontrolprovider.h"
#include "core/components/sensors/cpusensorprovider.h"
#include "core/components/sensors/gpusensorprovider.h"
#include "core/filecache.h"
#include "core/info/hwiddatasource.h"
#include "core/info/hwidtranslator.h"
#include "core/info/infoproviderregistry.h"
#include "core/info/swinfo.h"
#include "core/iprofileparser.h"
#include "core/profile.h"
#include "core/profilefactory.h"
#include "core/profileiconcache.h"
#include "core/profilemanager.h"
#include "core/profilepartprovider.h"
#include "core/profilepartxmlparserprovider.h"
#include "core/profilestorage.h"
#include "core/profileviewfactory.h"
#include "core/profilexmlparserfactory.h"
#include "core/qmlcomponentfactory.h"
#include "core/qmlcomponentregistry.h"
#include "core/session.h"
#include "core/sysexplorer.h"
#include "core/sysmodelfactory.h"
#include "core/sysmodelsyncer.h"
#include "core/uifactory.h"
#include "easyloggingpp/easylogging++.h"
#include "fmt/format.h"
#include "helper/helpercontrol.h"
#include "helper/helpermonitor.h"
#include "helper/helpersysctl.h"
#include <QStandardPaths>
#include <algorithm>
#include <cctype>
#include <exception>
#include <system_error>
#include <utility>
INITIALIZE_EASYLOGGINGPP
namespace fs = std::filesystem;
AppFactory::AppFactory() noexcept
: gpuVendors_{Vendor::AMD}
{
}
std::unique_ptr<App> AppFactory::build() const
{
try {
std::string appName(App::Name);
std::transform(appName.cbegin(), appName.cend(), appName.begin(), ::tolower);
auto [config, cache] = standardDirectories();
createAppDirectories(appName, config, cache);
auto cryptoLayer = std::make_shared<CryptoLayer>();
auto helperControl = std::make_unique<HelperControl>(cryptoLayer);
InfoProviderRegistry infoProviderRegistry;
auto swInfo = std::make_unique<SWInfo>();
swInfo->initialize(infoProviderRegistry.swInfoProviders());
SysModelFactory sysModelFactory(
std::move(swInfo), std::make_unique<SysExplorer>(gpuVendors_),
std::make_unique<HWIDTranslator>(
gpuVendors_, std::make_unique<HWIDDataSource>(PCI_IDS_PATH)),
std::make_unique<CPUControlProvider>(),
std::make_unique<CPUSensorProvider>(),
std::make_unique<GPUControlProvider>(),
std::make_unique<GPUSensorProvider>(), infoProviderRegistry,
infoProviderRegistry);
auto sysModel = sysModelFactory.build();
ProfileFactory profileFactory(std::make_unique<ProfilePartProvider>());
auto defaultProfile = profileFactory.build(*sysModel);
ProfileXMLParserFactory parserFactory(
std::make_unique<ProfilePartXMLParserProvider>());
auto profileParser = parserFactory.build(*defaultProfile);
auto profileFileParser = std::make_unique<CCPROParser>();
auto iconCache = std::make_unique<ProfileIconCache>(
std::make_unique<FileCache>(cache / appName / "icons"));
auto profileManager = std::make_unique<ProfileManager>(
std::move(defaultProfile),
std::make_unique<ProfileStorage>(
config / appName / "profiles", std::move(profileParser),
std::move(profileFileParser), std::move(iconCache)));
auto sysModelSyncer = std::make_shared<SysModelSyncer>(
std::move(sysModel), std::make_unique<HelperSysCtl>(cryptoLayer));
auto session = std::make_unique<Session>(
sysModelSyncer, std::move(profileManager),
std::make_unique<ProfileViewFactory>(),
std::make_unique<HelperMonitor>(cryptoLayer));
auto uiFactory =
std::make_unique<UIFactory>(std::make_unique<QMLComponentFactory>(
std::make_unique<QMLComponentRegistry>()));
return std::make_unique<App>(std::move(helperControl),
std::move(sysModelSyncer), std::move(session),
std::move(uiFactory));
}
catch (std::exception const &e) {
LOG(WARNING) << "Cannot create main application";
LOG(WARNING) << e.what();
}
return nullptr;
}
std::tuple<std::filesystem::path, std::filesystem::path>
AppFactory::standardDirectories() const
{
return {QStandardPaths::standardLocations(QStandardPaths::ConfigLocation)
.first()
.toStdString(),
QStandardPaths::standardLocations(QStandardPaths::CacheLocation)
.first()
.toStdString()};
}
void AppFactory::createAppDirectories(std::string const &appDirectory,
std::filesystem::path const &config,
std::filesystem::path const &cache) const
{
std::error_code ec;
fs::perms dirPerms = fs::perms::owner_all | fs::perms::group_read |
fs::perms::group_exec | fs::perms::others_read |
fs::perms::others_exec;
if (!fs::exists(config)) {
fs::create_directory(config);
fs::permissions(config, dirPerms, ec);
if (ec.value() != 0)
LOG(ERROR) << "Cannot set permissions for " << config;
}
if (!fs::is_directory(config))
throw std::runtime_error(
fmt::format("{} is not a directory", config.c_str()));
fs::path appConfigDir = config / appDirectory;
if (!fs::exists(appConfigDir)) {
fs::create_directory(appConfigDir);
fs::permissions(appConfigDir, dirPerms, ec);
if (ec.value() != 0)
LOG(ERROR) << "Cannot set permissions for " << appConfigDir;
}
if (!fs::is_directory(appConfigDir))
throw std::runtime_error(
fmt::format("{} is not a directory", appConfigDir.c_str()));
if (!fs::exists(cache)) {
fs::create_directory(cache);
fs::permissions(cache, dirPerms, ec);
if (ec.value() != 0)
LOG(ERROR) << "Cannot set permissions for " << cache;
}
if (!fs::is_directory(cache))
throw std::runtime_error(fmt::format("{} is not a directory", cache.c_str()));
fs::path cacheApp = cache / appDirectory;
if (!fs::exists(cacheApp)) {
fs::create_directory(cacheApp);
fs::permissions(cacheApp, dirPerms, ec);
if (ec.value() != 0)
LOG(ERROR) << "Cannot set permissions for " << cacheApp;
}
if (!fs::is_directory(cacheApp))
throw std::runtime_error(
fmt::format("{} is not a directory", cacheApp.c_str()));
}

View File

@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/info/vendor.h"
#include <filesystem>
#include <memory>
#include <string>
#include <tuple>
#include <vector>
class App;
class AppFactory final
{
public:
AppFactory() noexcept;
std::unique_ptr<App> build() const;
private:
std::tuple<std::filesystem::path, std::filesystem::path>
standardDirectories() const;
void createAppDirectories(std::string const &appDirectory,
std::filesystem::path const &config,
std::filesystem::path const &cache) const;
std::vector<Vendor> gpuVendors_;
};

View File

@ -0,0 +1,46 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "settings.h"
Settings::Settings(QString const &appName) noexcept
: QSettings(QSettings::IniFormat, QSettings::UserScope, appName, appName)
{
}
void Settings::setValue(QString const &key, QVariant const &value)
{
QSettings::setValue(key, value);
emit settingChanged(key, value);
}
QVariant Settings::getValue(QString const &key, QVariant const &defaultValue) const
{
auto value = QSettings::value(key, defaultValue);
value.convert(static_cast<int>(defaultValue.type()));
return value;
}
void Settings::setStringList(QString const &key, QStringList const &list)
{
if (list.empty())
QSettings::remove(key);
else
QSettings::setValue(key, list);
emit settingChanged(key, list);
}
QVariant Settings::getStringList(QString const &key,
QStringList const &defaultValue) const
{
auto value = QSettings::value(key, defaultValue);
return value.toStringList();
}
void Settings::signalSettings()
{
auto keys = QSettings::allKeys();
for (auto &key : keys)
emit settingChanged(key, QSettings::value(key));
}

View File

@ -0,0 +1,31 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include <QObject>
#include <QSettings>
#include <QString>
#include <QStringList>
#include <QVariant>
class Settings final : public QSettings
{
Q_OBJECT
public:
Settings(QString const &appName) noexcept;
Q_INVOKABLE void setValue(QString const &key, QVariant const &value);
Q_INVOKABLE QVariant getValue(QString const &key,
QVariant const &defaultValue) const;
Q_INVOKABLE void setStringList(QString const &key, QStringList const &list);
Q_INVOKABLE QVariant getStringList(QString const &key,
QStringList const &defaultList) const;
void signalSettings();
signals:
void settingChanged(QString const &key, QVariant const &value);
};

View File

@ -0,0 +1,81 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "singleinstance.h"
SingleInstanceClient::SingleInstanceClient(QLocalSocket *client)
: QObject(client)
{
connect(client, &QLocalSocket::readyRead, this,
&SingleInstanceClient::onReadyRead);
connect(client, &QLocalSocket::disconnected, this,
&SingleInstanceClient::onDisconnected);
connect(client, &QLocalSocket::disconnected, client,
&QLocalSocket::deleteLater);
}
void SingleInstanceClient::onReadyRead()
{
QLocalSocket *client = qobject_cast<QLocalSocket *>(parent());
args_ = fromRawData(client->readAll());
}
void SingleInstanceClient::onDisconnected()
{
emit newInstance(args_);
}
QStringList SingleInstanceClient::fromRawData(QByteArray const &data) const
{
QStringList result;
auto dataList = data.split('\0');
for (auto const &rawData : dataList)
result.push_back(QString::fromUtf8(rawData));
return result;
}
SingleInstance::SingleInstance(std::string_view name, QObject *parent)
: QObject(parent)
, name_(name.data())
{
connect(&server_, &QLocalServer::newConnection, this,
&SingleInstance::newConnection);
}
bool SingleInstance::mainInstance(QStringList const &args)
{
QLocalSocket socket;
socket.connectToServer(name_, QLocalSocket::WriteOnly);
if (socket.waitForConnected(100)) {
socket.write(toRawData(args));
socket.flush();
socket.disconnectFromServer();
return false;
}
server_.removeServer(name_);
server_.listen(name_);
return true;
}
void SingleInstance::newConnection()
{
auto client = new SingleInstanceClient(server_.nextPendingConnection());
connect(client, &SingleInstanceClient::newInstance, this,
&SingleInstance::newInstance);
}
QByteArray SingleInstance::toRawData(QStringList const &data) const
{
QByteArray result;
for (auto &item : data) {
result.append(item.toUtf8());
result.append('\0');
}
return result;
}

View File

@ -0,0 +1,52 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include <QByteArray>
#include <QLocalServer>
#include <QLocalSocket>
#include <QObject>
#include <QString>
#include <QStringList>
#include <string_view>
class SingleInstance : public QObject
{
Q_OBJECT
public:
explicit SingleInstance(std::string_view name, QObject *parent = 0);
bool mainInstance(QStringList const &args);
signals:
void newInstance(QStringList args);
private slots:
void newConnection();
private:
QByteArray toRawData(QStringList const &data) const;
QString const name_;
QLocalServer server_;
};
class SingleInstanceClient : public QObject
{
Q_OBJECT
public:
SingleInstanceClient(QLocalSocket *client);
signals:
void newInstance(QStringList args);
public slots:
void onReadyRead();
void onDisconnected();
private:
QStringList fromRawData(QByteArray const &data) const;
QStringList args_;
};

View File

@ -0,0 +1,308 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "systray.h"
#include "app.h"
#include "core/iprofile.h"
#include "core/iprofilemanager.h"
#include "core/isession.h"
#include <QIcon>
#include <QTimer>
#include <algorithm>
class SysTray::ProfileManagerObserver : public IProfileManager::Observer
{
public:
ProfileManagerObserver(SysTray &outer) noexcept
: outer_(outer)
{
}
void profileAdded(std::string const &profileName) override;
void profileRemoved(std::string const &profileName) override;
void profileInfoChanged(IProfile::Info const &oldInfo,
IProfile::Info const &newInfo) override;
void profileChanged(std::string const &) override
{
}
void profileActiveChanged(std::string const &, bool) override
{
}
void profileSaved(std::string const &) override
{
}
private:
SysTray &outer_;
};
void SysTray::ProfileManagerObserver::profileAdded(std::string const &profileName)
{
outer_.profileAdded(profileName);
}
void SysTray::ProfileManagerObserver::profileRemoved(std::string const &profileName)
{
outer_.profileRemoved(profileName);
}
void SysTray::ProfileManagerObserver::profileInfoChanged(
IProfile::Info const &oldInfo, IProfile::Info const &newInfo)
{
outer_.profileInfoChanged(oldInfo, newInfo);
}
class SysTray::ManualProfileObserver : public ISession::ManualProfileObserver
{
public:
ManualProfileObserver(SysTray &outer) noexcept
: outer_(outer)
{
}
void toggled(std::string const &profileName, bool active) override;
private:
SysTray &outer_;
};
void SysTray::ManualProfileObserver::toggled(const std::string &profileName,
bool active)
{
outer_.manualProfileToggled(profileName, active);
}
SysTray::SysTray(ISession *session, QObject *parent)
: QObject(parent)
, session_(session)
, profileManager_(&session->profileManager())
, menu_()
, profileManagerObserver_(
std::make_shared<SysTray::ProfileManagerObserver>(*this))
, manualProfileObserver_(std::make_shared<SysTray::ManualProfileObserver>(*this))
{
session_->addManualProfileObserver(manualProfileObserver_);
profileManager_->addObserver(profileManagerObserver_);
sysTray_ = createSystemTrayIcon();
}
bool SysTray::isAvailable() const
{
return QSystemTrayIcon::isSystemTrayAvailable();
}
bool SysTray::isVisible() const
{
return isAvailable() && sysTray_->isVisible();
}
void SysTray::show()
{
sysTray_->show();
}
void SysTray::hide()
{
sysTray_->hide();
}
void SysTray::settingChanged(QString const &key, QVariant const &value)
{
if (key == "sysTray")
sysTray_->setVisible(value.toBool());
}
void SysTray::onMainWindowVisibleChanged(bool isVisible)
{
showMainWindow_ = isVisible;
showMainWindowAction_->setText(isVisible ? tr("Hide") : tr("Show"));
}
void SysTray::onTrayIconActivated(QSystemTrayIcon::ActivationReason reason)
{
switch (reason) {
case QSystemTrayIcon::Trigger:
emit activated();
break;
default:
break;
}
}
void SysTray::onShowMainWindowActionTriggered()
{
emit showMainWindowToggled(!showMainWindow_);
}
QSystemTrayIcon *SysTray::createSystemTrayIcon()
{
auto sysTray = new QSystemTrayIcon(this);
sysTray->setIcon(QIcon::fromTheme(QString(App::Name.data()).toLower()));
sysTray->setContextMenu(menu());
connect(sysTray, &QSystemTrayIcon::activated, this,
&SysTray::onTrayIconActivated);
return sysTray;
}
QMenu *SysTray::menu()
{
if (menu_.isEmpty()) {
showMainWindowAction_ = new QAction(&menu_);
onMainWindowVisibleChanged(false); // initialize label and state
connect(showMainWindowAction_, &QAction::triggered, this,
&SysTray::onShowMainWindowActionTriggered);
menu_.addAction(showMainWindowAction_);
menu_.addSeparator();
manualProfileMenu_ = menu_.addMenu(tr("Manual profiles"));
addManualProfilesTo(manualProfileMenu_);
menu_.addSeparator();
QAction *quitAction = new QAction(tr("Quit"), &menu_);
connect(quitAction, &QAction::triggered, this, &SysTray::quit);
menu_.addAction(quitAction);
}
return &menu_;
}
QAction *SysTray::createManualProfileAction(QMenu *menu,
std::string const &profileName)
{
QAction *action = new QAction(QString::fromStdString(profileName), menu);
action->setCheckable(true);
connect(action, &QAction::triggered, this,
[=]() { onManualProfileMenuTriggered(action->text()); });
return action;
}
std::optional<QAction *>
SysTray::findManualProfileAction(std::string const &profileName)
{
auto name = QString::fromStdString(profileName);
auto actions = manualProfileMenu_->actions();
auto actionIt = std::find_if(
actions.begin(), actions.end(),
[&](QAction *action) { return action->text() == name; });
return actionIt != actions.end() ? std::make_optional(*actionIt)
: std::nullopt;
}
QAction *
SysTray::findNextManualProfileActionPosition(std::string const &profileName)
{
auto name = QString::fromStdString(profileName);
auto actions = manualProfileMenu_->actions();
auto actionIt = std::find_if(
actions.begin(), actions.end(),
[&](QAction *action) { return action->text() > name; });
return actionIt != actions.end() ? *actionIt : nullptr;
}
void SysTray::addManualProfilesTo(QMenu *menu)
{
auto profiles = profileManager_->profiles();
std::sort(profiles.begin(), profiles.end());
for (auto const &profileName : profiles) {
auto const &profile = profileManager_->profile(profileName);
if (profile->get().info().exe == IProfile::Info::ManualID) {
auto action = createManualProfileAction(menu, profileName);
menu->addAction(action);
}
}
menu->setDisabled(menu->isEmpty());
}
void SysTray::onManualProfileMenuTriggered(QString const &profile)
{
session_->toggleManualProfile(profile.toStdString());
}
void SysTray::profileAdded(std::string const &profileName)
{
auto profile = profileManager_->profile(profileName);
if (profile.has_value() &&
profile->get().info().exe == IProfile::Info::ManualID) {
auto action = createManualProfileAction(manualProfileMenu_, profileName);
auto beforeAction = findNextManualProfileActionPosition(profileName);
manualProfileMenu_->insertAction(beforeAction, action);
manualProfileMenu_->setDisabled(false);
}
}
void SysTray::profileRemoved(std::string const &profileName)
{
auto action = findManualProfileAction(profileName);
if (action.has_value()) {
manualProfileMenu_->removeAction(*action);
delete *action;
manualProfileMenu_->setDisabled(manualProfileMenu_->isEmpty());
}
}
void SysTray::profileInfoChanged(IProfile::Info const &oldInfo,
IProfile::Info const &newInfo)
{
if (oldInfo.exe == IProfile::Info::ManualID ||
newInfo.exe == IProfile::Info::ManualID) {
// automatic profile converted to manual profile
if (oldInfo.exe != IProfile::Info::ManualID &&
newInfo.exe == IProfile::Info::ManualID) {
auto action = createManualProfileAction(manualProfileMenu_, newInfo.name);
auto beforeAction = findNextManualProfileActionPosition(newInfo.name);
manualProfileMenu_->insertAction(beforeAction, action);
}
// manual profile converted to automatic profile
else if (oldInfo.exe == IProfile::Info::ManualID &&
newInfo.exe != IProfile::Info::ManualID) {
profileRemoved(oldInfo.name);
}
// manual profile name has changed
else if (oldInfo.name != newInfo.name) {
auto action = findManualProfileAction(oldInfo.name);
if (action.has_value()) {
// remove old action
auto isChecked = (*action)->isChecked();
manualProfileMenu_->removeAction(*action);
delete *action;
// insert a new action
auto action = createManualProfileAction(manualProfileMenu_, newInfo.name);
action->setChecked(isChecked);
auto beforeAction = findNextManualProfileActionPosition(newInfo.name);
manualProfileMenu_->insertAction(beforeAction, action);
}
}
manualProfileMenu_->setDisabled(manualProfileMenu_->isEmpty());
}
}
void SysTray::manualProfileToggled(std::string const &profileName, bool active)
{
auto action = findManualProfileAction(profileName);
if (action.has_value())
(*action)->setChecked(active);
}

View File

@ -0,0 +1,72 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/iprofile.h"
#include <QAction>
#include <QMenu>
#include <QObject>
#include <QString>
#include <QSystemTrayIcon>
#include <QVariant>
#include <memory>
#include <optional>
#include <string>
class IProfileManager;
class ISession;
class SysTray : public QObject
{
Q_OBJECT
public:
explicit SysTray(ISession *session, QObject *parent = nullptr);
Q_INVOKABLE bool isAvailable() const;
Q_INVOKABLE bool isVisible() const;
signals:
void activated();
void quit();
void showMainWindowToggled(bool visible);
public slots:
void show();
void hide();
void settingChanged(QString const &key, QVariant const &value);
void onMainWindowVisibleChanged(bool isVisible);
private slots:
void onTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
void onShowMainWindowActionTriggered();
private:
void profileAdded(std::string const &profileName);
void profileRemoved(std::string const &profileName);
void profileInfoChanged(IProfile::Info const &oldInfo,
IProfile::Info const &newInfo);
void manualProfileToggled(std::string const &profileName, bool active);
QSystemTrayIcon *createSystemTrayIcon();
QMenu *menu();
QAction *createManualProfileAction(QMenu *menu, std::string const &profileName);
std::optional<QAction *> findManualProfileAction(std::string const &profileName);
QAction *findNextManualProfileActionPosition(std::string const &profileName);
void addManualProfilesTo(QMenu *menu);
void onManualProfileMenuTriggered(QString const &profile);
ISession *session_;
IProfileManager *profileManager_;
QSystemTrayIcon *sysTray_{nullptr};
QMenu menu_;
QMenu *manualProfileMenu_{nullptr};
QAction *showMainWindowAction_{nullptr};
bool showMainWindow_;
class ProfileManagerObserver;
std::shared_ptr<ProfileManagerObserver> profileManagerObserver_;
class ManualProfileObserver;
std::shared_ptr<ManualProfileObserver> manualProfileObserver_;
};

View File

@ -0,0 +1,67 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "cryptolayer.h"
#include "easyloggingpp/easylogging++.h"
#include "fmt/format.h"
#include <botan/base64.h>
#include <botan/data_src.h>
#include <botan/ed25519.h>
#include <botan/pubkey.h>
#include <botan/system_rng.h>
#include <botan/x509_key.h>
#include <cstddef>
#include <cstdint>
#include <exception>
void CryptoLayer::init()
{
privateKey_ = std::make_unique<Botan::Ed25519_PrivateKey>(Botan::system_rng());
}
QByteArray CryptoLayer::publicKey()
{
auto key = Botan::X509::PEM_encode(*privateKey_);
return {key.c_str()};
}
void CryptoLayer::usePublicKey(QByteArray const &publicKey)
{
auto keyStr = publicKey.toStdString();
Botan::DataSource_Memory pubKey(keyStr);
opPublicKey_ =
std::unique_ptr<Botan::Public_Key>(Botan::X509::load_key(pubKey));
}
bool CryptoLayer::verify(QByteArray const &data, QByteArray const &signature)
{
try {
Botan::PK_Verifier verifier(*opPublicKey_, "SHA-512");
auto decodedSignature = Botan::base64_decode(signature.toStdString());
return verifier.verify_message(
reinterpret_cast<uint8_t const *>(data.data()),
static_cast<size_t>(data.size()), decodedSignature.data(),
decodedSignature.size());
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
return false;
}
QByteArray CryptoLayer::signature(QByteArray const &data)
{
try {
Botan::PK_Signer signer(*privateKey_, Botan::system_rng(), "SHA-512");
auto signature = signer.sign_message(
reinterpret_cast<uint8_t const *>(data.data()),
static_cast<size_t>(data.size()), Botan::system_rng());
auto encodedSignature = Botan::base64_encode(signature);
return {encodedSignature.c_str()};
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
return {};
}

View File

@ -0,0 +1,24 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "icryptolayer.h"
#include <botan/pk_keys.h>
#include <memory>
class CryptoLayer final : public ICryptoLayer
{
public:
void init() override;
QByteArray publicKey() override;
void usePublicKey(QByteArray const &publicKey) override;
bool verify(QByteArray const &data, QByteArray const &signature) override;
QByteArray signature(QByteArray const &data) override;
private:
std::unique_ptr<Botan::Private_Key> privateKey_;
std::unique_ptr<Botan::Public_Key> opPublicKey_;
};

View File

@ -0,0 +1,157 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fileutils.h"
#include "easyloggingpp/easylogging++.h"
#include "fmt/format.h"
#include <QFile>
#include <exception>
#include <fstream>
#include <utility>
namespace fs = std::filesystem;
namespace Utils {
namespace File {
std::vector<char> readFile(std::filesystem::path const &path)
{
std::vector<char> data;
if (isFilePathValid(path)) {
std::ifstream file(path, std::ios::binary);
if (file.is_open()) {
data.resize(fs::file_size(path));
file.read(data.data(), data.size());
}
else
LOG(ERROR) << fmt::format("Cannot open file {}", path.c_str());
}
else
LOG(ERROR) << fmt::format("Invalid file path {}", path.c_str());
return data;
}
bool writeFile(std::filesystem::path const &path, std::vector<char> const &data)
{
std::ofstream file(path, std::ios::binary);
if (file.is_open()) {
file.write(data.data(), data.size());
return true;
}
else
LOG(ERROR) << fmt::format("Cannot open file {}", path.c_str());
return false;
}
std::vector<std::string> readFileLines(std::filesystem::path const &path,
char delim)
{
std::vector<std::string> entries;
if (isFilePathValid(path)) {
std::ifstream file(path);
if (file.is_open()) {
for (std::string entry; std::getline(file, entry, delim);)
entries.emplace_back(std::move(entry));
}
else
LOG(ERROR) << fmt::format("Cannot open file {}", path.c_str());
}
else
LOG(ERROR) << fmt::format("Invalid file path {}", path.c_str());
return entries;
}
bool isFilePathValid(std::filesystem::path const &path)
{
try {
return fs::exists(path) && fs::is_regular_file(path);
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
return false;
}
bool isDirectoryPathValid(std::filesystem::path const &path)
{
try {
return fs::exists(path) && fs::is_directory(path);
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
return false;
}
std::vector<std::filesystem::path> search(std::regex const &regex,
std::filesystem::path const &path)
{
std::vector<std::filesystem::path> paths;
if (isDirectoryPathValid(path)) {
for (auto &entry : fs::directory_iterator(path)) {
auto &entryDirPath = entry.path();
std::string entryDirName((*(--entryDirPath.end())).string());
if (std::regex_search(entryDirName, regex))
paths.push_back(entryDirPath);
}
}
else
LOG(ERROR) << fmt::format("Invalid directory path {}", path.c_str());
return paths;
}
std::optional<std::filesystem::path>
findHWMonXDirectory(std::filesystem::path const &path)
{
std::regex const hwmonXRegex(R"(hwmon[0-9]+)");
auto paths = Utils::File::search(hwmonXRegex, path);
if (!paths.empty()) {
if (paths.size() > 1) {
LOG(WARNING) << fmt::format(
"Multiple hwmon directories detected on {}.\nUsing {}", path.c_str(),
paths.front().c_str());
}
// use the first hwmon[0-*] directory from gpu sysfs/hwmon path
return paths.front();
}
return {};
}
bool isSysFSEntryValid(std::filesystem::path const &path)
{
if (!isFilePathValid(path))
return false;
if (readFileLines(path).empty()) {
LOG(WARNING) << fmt::format("Empty sysfs entry {}", path.c_str());
return false;
}
return true;
}
std::vector<char> readQrcFile(std::string_view qrcPath)
{
QFile file(qrcPath.data());
if (file.open(QFile::ReadOnly)) {
auto fileData = file.readAll();
return std::vector<char>(fileData.cbegin(), fileData.cend());
}
return {};
}
} // namespace File
} // namespace Utils

View File

@ -0,0 +1,74 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include <filesystem>
#include <optional>
#include <regex>
#include <string>
#include <string_view>
#include <vector>
namespace Utils {
namespace File {
/// Reads the contents of a file.
/// @param path path to the file to read
/// @returns file contents or no contents on error
///
/// @note Reading /sys files will produce more data than expected as
/// its file size doesn't match the actual file contents.
/// @note Reading /proc files won't produce any data. Those files must
/// be readed line by line. Use readFileLines instead.
std::vector<char> readFile(std::filesystem::path const &path);
/// Writes data to a file. Any previous file contents will be destroyed.
/// @param path path to the file to read
/// @param data to be written
/// @returns true on success
bool writeFile(std::filesystem::path const &path, std::vector<char> const &data);
/// Read the data of a file line by line. Contents will be splitted in
/// lines using a delimiter.
/// @param path file to read
/// @param delimiter new line character
/// @returns lines of data
std::vector<std::string> readFileLines(std::filesystem::path const &path,
char delim = '\n');
/// Checks if a path exists and points to a file.
/// @param path file to validate
/// @returns true if the path points to a valid file
bool isFilePathValid(std::filesystem::path const &path);
/// Checks if a path exists and points to a directory.
/// @param path directory to validate
/// @returns true if the path points to a valid directory
bool isDirectoryPathValid(std::filesystem::path const &path);
/// Search for files or directories whose name matches a regular expression.
/// @param regex regular expression to match the directory entries
/// @param path target directory to search
/// @returns path to the directory entries that match the regular expression
std::vector<std::filesystem::path> search(std::regex const &regex,
std::filesystem::path const &path);
/// Find the hwmon[0-*] directory in a path.
/// @param path directory to seach for hwmon[0-*] directory
/// @returns path to hwmon[0-*] directory
std::optional<std::filesystem::path>
findHWMonXDirectory(std::filesystem::path const &path);
/// Checks if a path points to an existing and non empty sysfs entry file.
/// @param path file to validate
/// @return true if the path points to a valid sysfs entry
bool isSysFSEntryValid(std::filesystem::path const &path);
/// Read file data from a Qt qrc path.
/// @param path rcc file path
/// @return file contents or no contents on error
std::vector<char> readQrcFile(std::string_view qrcPath);
} // namespace File
} // namespace Utils

View File

@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include <QByteArray>
class ICryptoLayer
{
public:
/// Initialization.
virtual void init() = 0;
/// @return subject public key.
virtual QByteArray publicKey() = 0;
/// Set the key that will be used in public key operations (as verify).
/// This key is generated by other subject.
virtual void usePublicKey(QByteArray const &publicKey) = 0;
/// Compute and validates the data signature against the provided signature.
virtual bool verify(QByteArray const &data, QByteArray const &signature) = 0;
/// Generates the signature of the data.
virtual QByteArray signature(QByteArray const &data) = 0;
virtual ~ICryptoLayer() = default;
};

View File

@ -0,0 +1,39 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "easyloggingpp/easylogging++.h"
#include <filesystem>
#include <string>
void setupLogger(std::filesystem::path const &logFilePath,
std::string const &globalLogFlushThreshold = "50")
{
el::Configurations c;
c.setToDefault();
// Global
c.setGlobally(el::ConfigurationType::Enabled, "true");
c.setGlobally(el::ConfigurationType::Format,
"[%datetime{%d-%M-%y %H:%m:%s.%g}][%levshort] %msg");
c.setGlobally(el::ConfigurationType::ToFile, "true");
c.setGlobally(el::ConfigurationType::Filename, logFilePath);
c.setGlobally(el::ConfigurationType::ToStandardOutput, "false");
c.setGlobally(el::ConfigurationType::SubsecondPrecision, "3");
c.setGlobally(el::ConfigurationType::PerformanceTracking, "false");
c.setGlobally(el::ConfigurationType::MaxLogFileSize, "524288");
c.setGlobally(el::ConfigurationType::LogFlushThreshold,
globalLogFlushThreshold);
// Error
c.set(el::Level::Error, el::ConfigurationType::Format,
"[%datetime{%d-%M-%y %H:%m:%s.%g}][%levshort] [%fbase:%line] %msg");
c.set(el::Level::Error, el::ConfigurationType::LogFlushThreshold, "1");
// Warning
c.set(el::Level::Warning, el::ConfigurationType::ToStandardOutput, "true");
el::Loggers::setDefaultConfigurations(c, true);
el::Loggers::addFlag(el::LoggingFlag::ColoredTerminalOutput);
}

View File

@ -0,0 +1,71 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include <algorithm>
#include <utility>
#include <vector>
namespace Utils {
namespace Math {
/// Performs a linear normalization to a collection of values from an old range
/// to a new range.
///
/// @note Only works with regular numeric types.
///
/// @param values collection of values to normalize
/// @param oldRange old range of the values of the collection
/// @param newRange new range for the result of the normalization
template<typename T>
void linearNorm(std::vector<T> &values, std::pair<T, T> const &oldRange,
std::pair<T, T> const &newRange)
{
std::transform(values.cbegin(), values.cend(), values.begin(), [&](T value) {
return static_cast<T>(
(value - oldRange.first) *
(static_cast<double>(newRange.second - newRange.first) /
(oldRange.second - oldRange.first)) +
newRange.first);
});
}
/// Performs a lineal interpolation between two points resolving the y value at
/// the supplied x value.
///
/// @note Only works with regular numeric types.
///
/// @param value x value to be evaluated
/// @param p1 first point
/// @param p2 second point
/// @return resolved y value
template<typename X, typename Y>
Y lerpX(X value, std::pair<X, Y> const &p1, std::pair<X, Y> const &p2)
{
return static_cast<X>(
(static_cast<double>(p2.second - p1.second) / (p2.first - p1.first)) *
(value - p1.first) +
p1.second);
}
/// Performs a lineal interpolation between two points resolving the x value at
/// the supplied y value.
///
/// @note Only works with regular numeric types.
///
/// @param value y value to be evaluated
/// @param p1 first point
/// @param p2 second point
/// @return resolved x value
template<typename X, typename Y>
X lerpY(Y value, std::pair<X, Y> const &p1, std::pair<X, Y> const &p2)
{
return static_cast<Y>(
(static_cast<double>(p2.first - p1.first) / (p2.second - p1.second)) *
(value - p1.second) +
p1.first);
}
} // namespace Math
} // namespace Utils

View File

@ -0,0 +1,80 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "stringutils.h"
#include <algorithm>
#include <cstddef>
#include <regex>
#include <sstream>
namespace Utils {
namespace String {
std::string cleanPrefix(std::string const &str, std::string const &prefix)
{
auto it = std::search(str.cbegin(), str.cend(), prefix.cbegin(), prefix.cend());
if (it != str.cend()) {
size_t const pos = prefix.size();
return str.substr(pos, str.size() - pos);
}
return str;
}
std::tuple<int, int, int> parseVersion(std::string const &version)
{
try {
if (std::count(version.cbegin(), version.cend(), '.') == 2) {
auto firstDot = version.find(".");
auto secondDot = version.find(".", firstDot + 1);
if (firstDot > 0 && // mayor version exists
firstDot + 1 < secondDot && // minor version exists
secondDot < version.length() - 1) // patch version exists
return {std::stoi(version.substr(0, firstDot)),
std::stoi(version.substr(firstDot + 1, secondDot)),
std::stoi(version.substr(secondDot + 1, std::string::npos))};
}
LOG(ERROR) << fmt::format("'{}' is not a valid version string",
version.c_str());
}
catch (std::exception const &e) {
LOG(ERROR) << fmt::format("Cannot parse version string '{}'. Error: {}",
version.c_str(), e.what());
}
return {0, 0, 0};
}
std::vector<std::string> split(std::string const &src, char delim)
{
std::vector<std::string> result;
std::istringstream istream(src);
for (std::string part; std::getline(istream, part, delim);)
if (!part.empty()) // skip empty parts
result.push_back(part);
return result;
}
std::optional<std::string> parseKernelProcVersion(std::string const &data)
{
std::regex const regex(R"(^Linux\s*version\s*(\d+\.\d+(?:\.\d+){0,1}).*)");
std::smatch result;
if (!std::regex_search(data, result, regex)) {
LOG(ERROR) << "Cannot parse kernel version";
return {};
}
// Append .0 when the patch version number is missing, see #254
std::string version = result[1];
if (std::count(version.cbegin(), version.cend(), '.') == 1)
version.append(".0");
return version;
}
} // namespace String
} // namespace Utils

View File

@ -0,0 +1,88 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "easyloggingpp/easylogging++.h"
#include "fmt/format.h"
#include <exception>
#include <optional>
#include <string>
#include <tuple>
#include <type_traits>
#include <vector>
namespace Utils {
namespace String {
/// Cleans a prefix from a string.
///
/// @returns substring of the input string without prefix
std::string cleanPrefix(std::string const &str, std::string const &prefix);
/// Converts a string in 'mayor.minor.patch' format into numeric value.
///
/// @param version string in 'mayor.minor.patch' format
/// @returns version [mayor, minor, patch] as integers or [0, 0, 0] on error
std::tuple<int, int, int> parseVersion(std::string const &version);
/// Converts a string containing a number representation into its numerical value.
/// @param value will store the result of the conversion
/// @param rep representation of the number to convert
/// @param base numerical base of the representation to convert from (for integers)
/// @returns true on a successful conversion
template<typename T>
bool toNumber(T &value, std::string const &rep, int base = 10)
{
try {
if constexpr (std::is_same_v<T, char>) {
value = static_cast<char>(std::stoi(rep, nullptr, base));
}
else if constexpr (std::is_same_v<T, short>) {
value = static_cast<short>(std::stoi(rep, nullptr, base));
}
else if constexpr (std::is_same_v<T, int>)
value = std::stoi(rep, nullptr, base);
else if constexpr (std::is_same_v<T, long>)
value = std::stol(rep, nullptr, base);
else if constexpr (std::is_same_v<T, long long>)
value = std::stoll(rep, nullptr, base);
else if constexpr (std::is_same_v<T, unsigned char> ||
std::is_same_v<T, unsigned short> ||
std::is_same_v<T, unsigned int> ||
std::is_same_v<T, unsigned long>)
value = static_cast<T>(std::stoul(rep, nullptr, base));
else if constexpr (std::is_same_v<T, unsigned long long>)
value = std::stoull(rep, nullptr, base);
else if constexpr (std::is_same_v<T, float>)
value = std::stof(rep, nullptr);
else if constexpr (std::is_same_v<T, double>)
value = std::stod(rep, nullptr);
else if constexpr (std::is_same_v<T, long double>)
value = std::stold(rep, nullptr);
return true;
}
catch (std::exception const &e) {
LOG(ERROR) << fmt::format(
"Cannot parse a number from the string '{}'. Error: {}", rep.c_str(),
e.what());
}
return false;
}
/// Splits a string into substrings using a delimiter.
/// @param src string to be splitted
/// @param delim delimiter to cut into substrings
/// @returns collection of substrings
std::vector<std::string> split(std::string const &src, char delim = ' ');
/// Parse kernel version from a string following the format used by the kernel
/// on /proc/version.
/// @param data string to parse the kernel version from
/// @returns a string containing the kernel version following semver format
std::optional<std::string> parseKernelProcVersion(std::string const &data);
} // namespace String
} // namespace Utils

8
corectrl/src/config.h.in Normal file
View File

@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#define PROJECT_NAME "${PROJECT_NAME}"
#define PROJECT_VERSION "${PROJECT_VERSION}"
#define PCI_IDS_PATH "${WITH_PCI_IDS_PATH}"

View File

@ -0,0 +1,50 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "ccproparser.h"
#include "easyloggingpp/easylogging++.h"
#include "zipdatasink.h"
#include "zipdatasource.h"
#include <exception>
std::string CCPROParser::fileExtension() const
{
return "ccpro";
}
std::optional<std::vector<char>>
CCPROParser::load(std::filesystem::path const &path,
std::string const &internalDataName)
{
ZipDataSource dataSource(path);
if (!internalDataName.empty()) {
try {
std::vector<char> fileData;
if (dataSource.read(internalDataName, fileData))
return {fileData};
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
}
return {};
}
bool CCPROParser::save(
std::filesystem::path const &path,
std::vector<std::pair<std::string, std::vector<char>>> const &data)
{
ZipDataSink dataSink(path);
try {
return dataSink.write(data);
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
return false;
}

View File

@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/iprofilefileparser.h"
class CCPROParser final : public IProfileFileParser
{
public:
std::string fileExtension() const override;
std::optional<std::vector<char>>
load(std::filesystem::path const &path,
std::string const &internalDataName) override;
bool save(std::filesystem::path const &path,
std::vector<std::pair<std::string, std::vector<char>>> const &data)
override;
};

View File

@ -0,0 +1,117 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "zipdatasink.h"
#include "easyloggingpp/easylogging++.h"
#include "fmt/format.h"
#include <QByteArray>
#include <QIODevice>
#include <QString>
#include <exception>
#include <quazip.h>
#include <quazipfile.h>
#include <quazipnewinfo.h>
#include <stdexcept>
namespace fs = std::filesystem;
ZipDataSink::ZipDataSink(std::filesystem::path const &path) noexcept
: path_(path)
{
backupFile();
}
ZipDataSink::~ZipDataSink()
{
removeBackupFile();
}
std::string ZipDataSink::sink() const
{
return path_.string();
}
bool ZipDataSink::write(
std::vector<std::pair<std::string, std::vector<char>>> const &data)
{
if (!data.empty()) {
QuaZip zip(QString::fromStdString(sink()));
if (zip.open(QuaZip::mdCreate)) {
for (auto &[dataFilePath, fileData] : data) {
if (!dataFilePath.empty() && !fileData.empty()) {
QuaZipFile file(&zip);
if (!(file.open(QIODevice::WriteOnly,
QuaZipNewInfo(QString::fromStdString(dataFilePath))) &&
file.write(QByteArray::fromRawData(fileData.data(),
fileData.size())) >= 0)) {
if (file.isOpen())
file.close();
zip.close();
restorePreWriteFileState();
throw std::runtime_error(
fmt::format("Failed to write {} data to file {}",
dataFilePath.data(), sink().data()));
}
file.close();
}
}
zip.close();
return true;
}
else {
throw std::runtime_error(
fmt::format("Failed to open file {}", sink().data()));
}
}
return false;
}
void ZipDataSink::backupFile() const
{
try {
if (fs::exists(path_) && fs::is_regular_file(path_))
fs::copy_file(path_, sink() + ".bak", fs::copy_options::overwrite_existing);
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
}
void ZipDataSink::removeBackupFile() const
{
try {
fs::remove(sink() + ".bak");
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
}
void ZipDataSink::restorePreWriteFileState() const
{
// remove the current file
try {
fs::remove(path_.string());
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
// restore the backup file
try {
if (fs::exists(sink() + ".bak") && fs::is_regular_file(sink() + ".bak"))
fs::copy_file(sink() + ".bak", path_, fs::copy_options::overwrite_existing);
}
catch (std::exception const &e) {
LOG(ERROR) << e.what();
}
}

View File

@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/idatasink.h"
#include <filesystem>
#include <string>
#include <utility>
#include <vector>
class ZipDataSink final
: public IDataSink<std::vector<std::pair<std::string, std::vector<char>>>>
{
public:
ZipDataSink(std::filesystem::path const &path) noexcept;
~ZipDataSink();
std::string sink() const override;
bool write(std::vector<std::pair<std::string, std::vector<char>>> const &data)
override;
private:
void backupFile() const;
void removeBackupFile() const;
void restorePreWriteFileState() const;
std::filesystem::path const path_;
};

View File

@ -0,0 +1,55 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "zipdatasource.h"
#include "fmt/format.h"
#include <QByteArray>
#include <QIODevice>
#include <QString>
#include <algorithm>
#include <iterator>
#include <quazip.h>
#include <quazipfile.h>
#include <stdexcept>
ZipDataSource::ZipDataSource(std::filesystem::path const &path) noexcept
: path_(path)
{
}
std::string ZipDataSource::source() const
{
return path_.string();
}
bool ZipDataSource::read(std::string const &internalDataPath,
std::vector<char> &data)
{
if (!internalDataPath.empty()) {
QuaZip zip(QString::fromStdString(source()));
if (zip.open(QuaZip::mdUnzip)) {
if (zip.setCurrentFile(QString::fromStdString(internalDataPath))) {
QuaZipFile file(&zip);
if (file.open(QIODevice::ReadOnly)) {
data.clear();
auto fileData = file.readAll();
std::copy(fileData.cbegin(), fileData.cend(), std::back_inserter(data));
file.close();
zip.close();
return true;
}
}
zip.close();
}
else {
throw std::runtime_error(fmt::format("Failed to open file {}", source()));
}
}
return false;
}

View File

@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/idatasource.h"
#include <filesystem>
#include <string>
#include <vector>
class ZipDataSource final
: public IDataSource<std::string const, std::vector<char>>
{
public:
ZipDataSource(std::filesystem::path const &path) noexcept;
std::string source() const override;
bool read(std::string const &internalBundleDataPath,
std::vector<char> &data) override;
private:
std::filesystem::path const path_;
};

View File

@ -0,0 +1,93 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "commandqueue.h"
#include <QByteArray>
#include <algorithm>
#include <iterator>
#include <optional>
CommandQueue::CommandQueue() noexcept
: packIndex_(std::nullopt)
{
commands().reserve(50);
}
void CommandQueue::pack(bool activate)
{
if (activate) {
// do not overwrite a previous index
if (!packIndex_.has_value())
packIndex_ = commands_.size();
}
else {
packIndex_ = std::nullopt;
}
}
std::optional<bool> CommandQueue::packWritesTo(std::string const &file)
{
if (packIndex_.has_value()) {
// find the last queued command that touch the same file
auto it = std::find_if(commands().crbegin(), commands().crend(),
[&](auto &v) { return v.first == file; });
if (it != commands().crend()) {
auto index = std::distance(commands().cbegin(), it.base()) - 1;
return index >= *packIndex();
}
else {
return false;
}
}
return std::nullopt;
}
void CommandQueue::add(std::pair<std::string, std::string> &&cmd)
{
// find the last queued command that touch the same file
auto lastIt = std::find_if(commands().crbegin(), commands().crend(),
[&](auto &v) { return v.first == cmd.first; });
if (lastIt != commands().crend() && lastIt->second == cmd.second)
return; // command already queued
// insert command at the end by default
auto insertIt = commands().cend();
// update insertIt when lastIt is in pack range
if (lastIt != commands().crend() && packIndex().has_value()) {
auto index = std::distance(commands().cbegin(), lastIt.base()) - 1;
if (index >= *packIndex())
insertIt = lastIt.base();
}
commands().emplace(insertIt, std::move(cmd));
}
QByteArray CommandQueue::toRawData()
{
QByteArray data;
for (auto &[path, value] : commands()) {
data += path.c_str();
data += '\0';
data += value.c_str();
data += '\0';
}
commands().clear();
packIndex_ = std::nullopt;
return data;
}
std::vector<std::pair<std::string, std::string>> &CommandQueue::commands()
{
return commands_;
}
std::optional<unsigned int> const &CommandQueue::packIndex() const
{
return packIndex_;
}

View File

@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "icommandqueue.h"
#include <string>
#include <utility>
#include <vector>
class CommandQueue : public ICommandQueue
{
public:
CommandQueue() noexcept;
void pack(bool activate) override;
std::optional<bool> packWritesTo(std::string const &file) override;
void add(std::pair<std::string, std::string> &&cmd) override;
QByteArray toRawData() override;
protected:
std::vector<std::pair<std::string, std::string>> &commands();
std::optional<unsigned int> const &packIndex() const;
private:
std::optional<unsigned int> packIndex_;
std::vector<std::pair<std::string, std::string>> commands_;
};

View File

@ -0,0 +1,690 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "amdutils.h"
#include "common/stringutils.h"
#include "units/units.h"
#include <algorithm>
#include <cstddef>
#include <iterator>
#include <regex>
#include <unordered_map>
#include <utility>
namespace Utils {
namespace AMD {
bool readAMDGPUVRamSize(int deviceFD, units::data::megabyte_t *size)
{
#if defined(DRM_IOCTL_AMDGPU_INFO) && defined(AMDGPU_INFO_MEMORY)
struct drm_amdgpu_memory_info drm_info = {};
struct drm_amdgpu_info buffer = {};
buffer.query = AMDGPU_INFO_MEMORY;
buffer.return_pointer = reinterpret_cast<std::uint64_t>(&drm_info);
buffer.return_size = sizeof(drm_info);
if (ioctl(deviceFD, DRM_IOCTL_AMDGPU_INFO, &buffer) >= 0) {
*size = units::make_unit<units::data::megabyte_t>(
drm_info.vram.total_heap_size / (1024 * 1024));
return true;
}
else
return false;
#else
return false;
#endif
}
bool readRadeonVRamSize(int deviceFD, units::data::megabyte_t *size)
{
#if defined(DRM_IOCTL_RADEON_GEM_INFO)
struct drm_radeon_gem_info buffer = {};
if (ioctl(deviceFD, DRM_IOCTL_RADEON_GEM_INFO, &buffer) >= 0) {
*size = units::make_unit<units::data::megabyte_t>(buffer.vram_size /
(1024 * 1024));
return true;
}
else
return false;
#else
return false;
#endif
}
std::optional<std::vector<std::pair<unsigned int, units::frequency::megahertz_t>>>
parseDPMStates(std::vector<std::string> const &ppDpmLines)
{
// Relevant lines format (kernel 4.6+)
// 0: 300Mhz *
// ...
// N: 1303Mhz
std::regex const regex(R"(^(\d+)\s*:\s*(\d+)\s*Mhz\s*\*?\s*$)",
std::regex::icase);
std::vector<std::pair<unsigned int, units::frequency::megahertz_t>> states;
for (auto &line : ppDpmLines) {
std::smatch result;
if (!std::regex_search(line, result, regex))
return {};
unsigned int index{0}, freq{0};
if (!(Utils::String::toNumber<unsigned int>(index, result[1]) &&
Utils::String::toNumber<unsigned int>(freq, result[2])))
return {};
states.emplace_back(index, units::frequency::megahertz_t(freq));
}
if (states.empty())
return {};
return std::move(states);
}
std::optional<unsigned int>
parseDPMCurrentStateIndex(std::vector<std::string> const &ppDpmLines)
{
// Relevant lines format (kernel 4.6+)
// 0: 300Mhz *
// ...
// N: 1303Mhz
//
// '*' marks the current state
std::regex const regex(R"(^(\d+)\s*:\s*\d+\s*Mhz\s*\*\s*$)", std::regex::icase);
for (auto &line : ppDpmLines) {
std::smatch result;
if (std::regex_search(line, result, regex)) {
unsigned int index{0};
if (!Utils::String::toNumber<unsigned int>(index, result[1]))
return {};
return index;
}
}
return {};
}
std::optional<std::vector<std::pair<std::string, int>>>
parsePowerProfileModeModes(std::vector<std::string> const &ppPowerProfileModeLines)
{
// Relevant lines format:
// 1 3D_FULL_SCREEN *: ...
// 1 3D_FULL_SCREEN: ...
// 1 3D_FULL_SCREEN*: ...
// 1 3D_FULL_SCREEN : ...
// 1 3D_FULL_SCREEN*
// 1 3D_FULL_SCREEN
std::regex const regex(R"(^\s*(\d+)\s+([^\*\(\s:]+))");
std::vector<std::pair<std::string, int>> modes;
for (auto &line : ppPowerProfileModeLines) {
std::smatch result;
if (!std::regex_search(line, result, regex))
continue;
// skip BOOT and CUSTOM modes
std::string const mode(result[2]);
if (mode.find("BOOT") != std::string::npos ||
mode.find("CUSTOM") != std::string::npos)
continue;
int index{0};
if (!Utils::String::toNumber<int>(index, result[1]))
continue;
modes.emplace_back(std::move(mode), index);
}
if (!modes.empty())
return std::move(modes);
return {};
}
std::optional<int> parsePowerProfileModeCurrentModeIndex(
std::vector<std::string> const &ppPowerProfileModeLines)
{
// Relevant lines format:
// 1 3D_FULL_SCREEN *: ...
// 1 3D_FULL_SCREEN*: ...
// 1 3D_FULL_SCREEN*
std::regex const regex(R"(^\s*(\d+)\s+(?:[^\*\(\s]+)\s*\*)");
for (auto &line : ppPowerProfileModeLines) {
std::smatch result;
if (!std::regex_search(line, result, regex))
continue;
int index{0};
if (!Utils::String::toNumber<int>(index, result[1]))
break;
return index;
}
return {};
}
std::optional<std::tuple<unsigned int, units::frequency::megahertz_t,
units::voltage::millivolt_t>>
parseOverdriveClkVoltLine(std::string const &line)
{
// Relevant lines format (kernel 4.17+):
// ...
// 0: 300MHz 800mV
//
// On Navi ASICs:
// ...
// 0: 300MHz @ 800mV
// ...
std::regex const regex(R"((\d+)\s*:\s*(\d+)\s*MHz[\s@]*(\d+)\s*mV\s*$)",
std::regex::icase);
std::smatch result;
if (std::regex_search(line, result, regex)) {
unsigned int index{0}, freq{0}, volt{0};
if (Utils::String::toNumber<unsigned int>(index, result[1]) &&
Utils::String::toNumber<unsigned int>(freq, result[2]) &&
Utils::String::toNumber<unsigned int>(volt, result[3]))
return std::make_tuple(index, units::frequency::megahertz_t(freq),
units::voltage::millivolt_t(volt));
}
return {};
}
std::optional<std::vector<std::tuple<unsigned int, units::frequency::megahertz_t,
units::voltage::millivolt_t>>>
parseOverdriveClksVolts(std::string_view controlName,
std::vector<std::string> const &ppOdClkVoltageLines)
{
// Relevant lines format (kernel 4.17+):
// ...
// OD_controlName:
// ...
// OD_otherLbl:
// ...
auto targetIt = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_" + std::string(controlName) + ":") !=
std::string::npos;
});
if (targetIt != ppOdClkVoltageLines.cend() &&
std::next(targetIt) != ppOdClkVoltageLines.cend()) {
targetIt = std::next(targetIt);
auto endIt = std::find_if(targetIt, ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_") != std::string::npos;
});
std::vector<std::tuple<unsigned int, units::frequency::megahertz_t,
units::voltage::millivolt_t>>
states;
while (targetIt != endIt) {
auto state = parseOverdriveClkVoltLine(*targetIt);
if (state.has_value())
states.emplace_back(std::move(*state));
targetIt = std::next(targetIt);
}
return std::move(states);
}
return {};
}
std::optional<std::pair<units::frequency::megahertz_t, units::frequency::megahertz_t>>
parseOverdriveClkRange(std::string const &line)
{
// Relevant lines format (kernel 4.18+):
// ...
// Lbl...: 400MHz 500MHz
// ...
std::regex const regex(R"(^(?:[^\:\s]+)\s*:\s*(\d+)\s*MHz\s*(\d+)\s*MHz\s*$)",
std::regex::icase);
std::smatch result;
if (std::regex_search(line, result, regex)) {
int min{0}, max{0};
if (Utils::String::toNumber<int>(min, result[1]) &&
Utils::String::toNumber<int>(max, result[2]))
return std::make_pair(units::make_unit<units::frequency::megahertz_t>(min),
units::make_unit<units::frequency::megahertz_t>(max));
}
return {};
}
std::optional<std::pair<units::frequency::megahertz_t, units::frequency::megahertz_t>>
parseOverdriveClkRange(std::string_view controlName,
std::vector<std::string> const &ppOdClkVoltageLines)
{
// Relevant lines format (kernel 4.18+):
// ...
// OD_RANGE:
// ...
// controlName: min max
// ...
auto rangeIt = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_RANGE:") != std::string::npos;
});
if (rangeIt != ppOdClkVoltageLines.cend()) {
auto targetIt = std::find_if(
rangeIt, ppOdClkVoltageLines.cend(), [&](std::string const &line) {
return line.find(std::string(controlName) + ":") != std::string::npos;
});
if (targetIt != ppOdClkVoltageLines.cend())
return parseOverdriveClkRange(*targetIt);
}
return {};
}
std::optional<std::pair<units::voltage::millivolt_t, units::voltage::millivolt_t>>
parseOverdriveVoltRangeLine(std::string const &line)
{
// Relevant lines format (kernel 4.18+):
// ...
// Lbl...: 400mV 500mV
// ...
std::regex const regex(R"(^(?:[^\:\s]+)\s*:\s*(\d+)\s*mV\s*(\d+)\s*mV\s*$)",
std::regex::icase);
std::smatch result;
if (std::regex_search(line, result, regex)) {
int min{0}, max{0};
if (Utils::String::toNumber<int>(min, result[1]) &&
Utils::String::toNumber<int>(max, result[2]))
return std::make_pair(units::make_unit<units::voltage::millivolt_t>(min),
units::make_unit<units::voltage::millivolt_t>(max));
}
return {};
}
std::optional<std::pair<units::voltage::millivolt_t, units::voltage::millivolt_t>>
parseOverdriveVoltRange(std::vector<std::string> const &ppOdClkVoltageLines)
{
// Relevant lines format (kernel 4.18+):
// ...
// OD_RANGE:
// ...
// VDDC: min max
// ...
auto rangeIt = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_RANGE:") != std::string::npos;
});
if (rangeIt != ppOdClkVoltageLines.cend()) {
auto targetIt = std::find_if(
rangeIt, ppOdClkVoltageLines.cend(), [&](std::string const &line) {
return line.find("VDDC:") != std::string::npos;
});
if (targetIt != ppOdClkVoltageLines.cend())
return parseOverdriveVoltRangeLine(*targetIt);
}
return {};
}
std::optional<std::pair<unsigned int, units::frequency::megahertz_t>>
parseOverdriveClksLine(std::string const &line)
{
// Relevant lines format (kernel 4.20+):
// ...
// 0: 300MHz
// ...
std::regex const regex(R"(^(\d+)\s*:\s*(\d+)\s*MHz\s*$)", std::regex::icase);
std::smatch result;
if (std::regex_search(line, result, regex)) {
unsigned int index{0}, freq{0};
if (Utils::String::toNumber<unsigned int>(index, result[1]) &&
Utils::String::toNumber<unsigned int>(freq, result[2]))
return std::make_pair(index, units::frequency::megahertz_t(freq));
}
return {};
}
std::optional<std::vector<std::pair<unsigned int, units::frequency::megahertz_t>>>
parseOverdriveClks(std::string_view controlName,
std::vector<std::string> const &ppOdClkVoltageLines)
{
// Relevant lines format (kernel 4.17+):
// ...
// OD_controlName:
// ...
// OD_otherLbl:
// ...
auto targetIt = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_" + std::string(controlName) + ":") !=
std::string::npos;
});
if (targetIt != ppOdClkVoltageLines.cend() &&
std::next(targetIt) != ppOdClkVoltageLines.cend()) {
targetIt = std::next(targetIt);
auto endIt = std::find_if(targetIt, ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_") != std::string::npos;
});
std::vector<std::pair<unsigned int, units::frequency::megahertz_t>> states;
while (targetIt != endIt) {
auto state = parseOverdriveClksLine(*targetIt);
if (state.has_value())
states.emplace_back(std::move(*state));
targetIt = std::next(targetIt);
}
return std::move(states);
}
return {};
}
std::optional<std::vector<
std::pair<units::frequency::megahertz_t, units::voltage::millivolt_t>>>
parseOverdriveVoltCurve(std::vector<std::string> const &ppOdClkVoltageLines)
{
// Relevant lines format (kernel 4.20+):
// ...
// OD_VDDC_CURVE:
// 0: 700Mhz 800mV
// ...
// OD_RANGE:
auto targetIt = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_VDDC_CURVE:") != std::string::npos;
});
if (targetIt != ppOdClkVoltageLines.cend() &&
std::next(targetIt) != ppOdClkVoltageLines.cend()) {
targetIt = std::next(targetIt);
auto endIt = std::find_if(targetIt, ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_") != std::string::npos;
});
std::vector<std::pair<units::frequency::megahertz_t, units::voltage::millivolt_t>>
points;
while (targetIt != endIt) {
auto state = parseOverdriveClkVoltLine(*targetIt);
if (state.has_value()) {
auto &[_, freq, volt] = *state;
points.emplace_back(std::make_pair(freq, volt));
}
targetIt = std::next(targetIt);
}
return std::move(points);
}
return {};
}
std::optional<std::vector<std::pair<
std::pair<units::frequency::megahertz_t, units::frequency::megahertz_t>,
std::pair<units::voltage::millivolt_t, units::voltage::millivolt_t>>>>
parseOverdriveVoltCurveRange(std::vector<std::string> const &ppOdClkVoltageLines)
{
// Relevant lines format (kernel 4.20+):
// ...
// OD_RANGE:
// ...
// VDDC_CURVE_SCLK[0]: 808Mhz 2200Mhz
// VDDC_CURVE_VOLT[0]: 738mV 1218mV
// ...
// VDDC_CURVE_SCLK[N]: 808Mhz 2200Mhz
// VDDC_CURVE_VOLT[N]: 738mV 1218mV
// ...
auto rangeIt = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_RANGE:") != std::string::npos;
});
if (rangeIt != ppOdClkVoltageLines.cend()) {
std::vector<std::pair<
std::pair<units::frequency::megahertz_t, units::frequency::megahertz_t>,
std::pair<units::voltage::millivolt_t, units::voltage::millivolt_t>>>
ranges;
auto freqIt = std::next(rangeIt);
// skip lines not starting with VDDC_CURVE_
freqIt = std::find_if(
freqIt, ppOdClkVoltageLines.cend(), [&](std::string const &line) {
return line.find("VDDC_CURVE_") != std::string::npos;
});
while (freqIt != ppOdClkVoltageLines.cend() &&
(*freqIt).find("VDDC_CURVE_SCLK[") != std::string::npos) {
auto voltIt = std::next(freqIt);
if (voltIt != ppOdClkVoltageLines.cend() &&
(*voltIt).find("VDDC_CURVE_VOLT[") != std::string::npos) {
auto freqRange = parseOverdriveClkRange(*freqIt);
auto voltRange = parseOverdriveVoltRangeLine(*voltIt);
if (freqRange.has_value() && voltRange.has_value())
ranges.emplace_back(
std::make_pair(std::move(*freqRange), std::move(*voltRange)));
else
return {}; // invalid data format
}
else
return {}; // invalid data format
freqIt = std::next(voltIt);
}
if (!ranges.empty())
return std::move(ranges);
}
return {};
}
std::optional<units::voltage::millivolt_t>
parseOverdriveVoltOffset(std::vector<std::string> const &ppOdClkVoltageLines)
{
auto targetIt = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("OD_VDDGFX_OFFSET:") != std::string::npos;
});
if (targetIt != ppOdClkVoltageLines.cend() &&
std::next(targetIt) != ppOdClkVoltageLines.cend()) {
std::regex const regex(R"(^(-?\d+)\s*mV\s*$)", std::regex::icase);
std::smatch result;
if (std::regex_search(*std::next(targetIt), result, regex)) {
int value;
if (Utils::String::toNumber(value, result[1]))
return units::voltage::millivolt_t(value);
}
}
return {};
}
std::optional<std::vector<std::string>>
parseOverdriveClkControls(std::vector<std::string> const &ppOdClkVoltageLines)
{
std::regex const regex(R"(^OD_(\wCLK):\s*$)", std::regex::icase);
std::vector<std::string> controlNames;
for (auto &line : ppOdClkVoltageLines) {
std::smatch result;
if (!std::regex_search(line, result, regex))
continue;
controlNames.emplace_back(result[1]);
}
if (!controlNames.empty())
return controlNames;
return {};
}
std::optional<std::string>
getOverdriveClkControlCmdId(std::string_view controlName)
{
static std::unordered_map<std::string_view, std::string> const nameCmdIdMap{
{"SCLK", "s"}, {"MCLK", "m"}};
if (nameCmdIdMap.count(controlName) > 0)
return nameCmdIdMap.at(controlName);
return {};
}
std::optional<std::vector<unsigned int>> ppOdClkVoltageFreqRangeOutOfRangeStates(
std::string const &controlName,
std::vector<std::string> const &ppOdClkVoltageLines)
{
// Search for out of range frequency clocks (RX6X00 XT)
// ...
// "OD_MCLK:",
// "0: 97Mhz",
// ...
// "OD_RANGE:",
// ...
// "MCLK: 674Mhz 1200Mhz",
auto clks = parseOverdriveClks(controlName, ppOdClkVoltageLines);
auto range = parseOverdriveClkRange(controlName, ppOdClkVoltageLines);
if (!(clks.has_value() && range.has_value()))
return std::nullopt;
std::vector<unsigned int> states;
auto [min, max] = *range;
for (auto &[index, clk] : *clks) {
if (!(clk >= min && clk <= max))
states.push_back(index);
}
if (!states.empty())
return states;
return std::nullopt;
}
bool ppOdClkVoltageHasKnownFreqVoltQuirks(
std::string const &, std::vector<std::string> const &ppOdClkVoltageLines)
{
// Check for missing range section (kernel < 4.18)
auto odRangeIter = std::find_if(
ppOdClkVoltageLines.cbegin(), ppOdClkVoltageLines.cend(),
[&](std::string const &line) { return line == "OD_RANGE:"; });
if (odRangeIter == ppOdClkVoltageLines.cend())
return true;
return false;
}
bool ppOdClkVoltageHasKnownVoltCurveQuirks(
std::vector<std::string> const &ppOdClkVoltageLines)
{
// Check for voltage incomplete curve points (navi on kernel < 5.6)
// "OD_VDDC_CURVE:",
// "0: 700Mhz @ 0mV",
auto atIter = std::find_if(ppOdClkVoltageLines.cbegin(),
ppOdClkVoltageLines.cend(),
[&](std::string const &line) {
return line.find("@") != std::string::npos;
});
if (atIter != ppOdClkVoltageLines.cend()) {
auto points = parseOverdriveVoltCurve(ppOdClkVoltageLines);
if (!points.has_value())
return true;
return points->at(0).second == units::voltage::millivolt_t(0);
}
return false;
}
bool hasOverdriveClkVoltControl(std::vector<std::string> const &data)
{
std::regex const clkRegex(R"(^OD_\wCLK:)", std::regex::icase);
std::smatch result;
auto clkIt = std::find_if(data.cbegin(), data.cend(),
[&](std::string const &line) {
return std::regex_match(line, result, clkRegex);
});
if (clkIt != data.cend() && std::next(clkIt) != data.cend()) {
auto state = parseOverdriveClkVoltLine(*std::next(clkIt));
return state.has_value();
}
return false;
}
bool hasOverdriveClkControl(std::vector<std::string> const &data)
{
std::regex const clkRegex(R"(^OD_\wCLK:)", std::regex::icase);
std::smatch result;
auto clkIt = std::find_if(data.cbegin(), data.cend(),
[&](std::string const &line) {
return std::regex_match(line, result, clkRegex);
});
if (clkIt != data.cend() && std::next(clkIt) != data.cend()) {
auto state = parseOverdriveClksLine(*std::next(clkIt));
return state.has_value();
}
return false;
}
bool hasOverdriveVoltCurveControl(std::vector<std::string> const &data)
{
auto curveIt = std::find_if(
data.cbegin(), data.cend(), [&](std::string const &line) {
return line.find("OD_VDDC_CURVE:") != std::string::npos;
});
return curveIt != data.cend();
}
bool hasOverdriveVoltOffsetControl(std::vector<std::string> const &data)
{
auto offsetIt = std::find_if(
data.cbegin(), data.cend(), [&](std::string const &line) {
return line.find("OD_VDDGFX_OFFSET:") != std::string::npos;
});
return offsetIt != data.cend();
}
} // namespace AMD
} // namespace Utils

View File

@ -0,0 +1,182 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "units/units.h"
#include <cstdint>
#include <libdrm/amdgpu_drm.h>
#include <libdrm/radeon_drm.h>
#include <optional>
#include <string>
#include <string_view>
#include <sys/ioctl.h>
#include <tuple>
#include <utility>
#include <vector>
namespace Utils {
namespace AMD {
template<typename Data>
bool readAMDGPUInfoSensor(int deviceFD, Data *value, std::uint32_t sensor)
{
#if defined(AMDGPU_INFO_SENSOR) && defined(DRM_IOCTL_AMDGPU_INFO)
struct drm_amdgpu_info buffer = {};
buffer.query = AMDGPU_INFO_SENSOR;
buffer.return_pointer = reinterpret_cast<std::uint64_t>(value);
buffer.return_size = sizeof(*value);
buffer.sensor_info.type = sensor;
return ioctl(deviceFD, DRM_IOCTL_AMDGPU_INFO, &buffer) >= 0;
#else
return false;
#endif
}
template<typename Data>
bool readAMDGPUInfo(int deviceFD, Data *value, std::uint32_t query)
{
#if defined(DRM_IOCTL_AMDGPU_INFO)
struct drm_amdgpu_info buffer = {};
buffer.query = query;
buffer.return_pointer = reinterpret_cast<std::uint64_t>(value);
buffer.return_size = sizeof(*value);
return ioctl(deviceFD, DRM_IOCTL_AMDGPU_INFO, &buffer) >= 0;
#else
return false;
#endif
}
bool readAMDGPUVRamSize(int deviceFD, units::data::megabyte_t *size);
template<typename Data>
bool readRadeonInfoSensor(int deviceFD, Data *value, std::uint32_t sensor)
{
#if defined(DRM_IOCTL_RADEON_INFO)
struct drm_radeon_info buffer = {};
buffer.request = sensor;
buffer.value = reinterpret_cast<std::uint64_t>(value);
return ioctl(deviceFD, DRM_IOCTL_RADEON_INFO, &buffer) >= 0;
#else
return false;
#endif
}
bool readRadeonVRamSize(int deviceFD, units::data::megabyte_t *size);
/// Returns DPM states clocks. (4.6+)
/// @param ppDpmLines pp_dpm_sclk / pp_dpm_mclk data source contents
std::optional<std::vector<std::pair<unsigned int, units::frequency::megahertz_t>>>
parseDPMStates(std::vector<std::string> const &ppDpmLines);
/// Returns the current state index from pp_dpm_sclk / pp_dpm_mclk. (4.6+)
/// @param ppDpmLines pp_dpm_sclk / pp_dpm_mclk data source contents
std::optional<unsigned int>
parseDPMCurrentStateIndex(std::vector<std::string> const &ppDpmLines);
/// Returns power profile modes. (4.17+)
/// @param ppPowerProfileModeLines pp_power_profile_mode data source contents
std::optional<std::vector<std::pair<std::string, int>>>
parsePowerProfileModeModes(std::vector<std::string> const &ppPowerProfileModeLines);
/// Returns current power profile mode index. (4.17+)
/// @param ppPowerProfileModeLines pp_power_profile_mode data source contents
std::optional<int> parsePowerProfileModeCurrentModeIndex(
std::vector<std::string> const &ppPowerProfileModeLines);
/// Returns the available clock + voltage states for a control. (4.17+)
/// @param controlName name of the control
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::vector<std::tuple<unsigned int, units::frequency::megahertz_t,
units::voltage::millivolt_t>>>
parseOverdriveClksVolts(std::string_view controlName,
std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns the state's clock range for a control. (4.18+)
/// @param controlName name of the control
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::pair<units::frequency::megahertz_t, units::frequency::megahertz_t>>
parseOverdriveClkRange(std::string_view controlName,
std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns the state's voltage range. (4.18+)
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::pair<units::voltage::millivolt_t, units::voltage::millivolt_t>>
parseOverdriveVoltRange(std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns the available clock states for a control. (4.20+, vega20+)
/// @param controlName name of the control
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::vector<std::pair<unsigned int, units::frequency::megahertz_t>>>
parseOverdriveClks(std::string_view controlName,
std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns the voltage curve points for curve voltage ASICs. (4.20+, vega20+)
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::vector<
std::pair<units::frequency::megahertz_t, units::voltage::millivolt_t>>>
parseOverdriveVoltCurve(std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns voltage range of curve points for curve voltage ASICs. (4.20+, vega20+)
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::vector<std::pair<
std::pair<units::frequency::megahertz_t, units::frequency::megahertz_t>,
std::pair<units::voltage::millivolt_t, units::voltage::millivolt_t>>>>
parseOverdriveVoltCurveRange(std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns the voltage offset.
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<units::voltage::millivolt_t>
parseOverdriveVoltOffset(std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns a list containing the name of the available CLK controls.
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::vector<std::string>>
parseOverdriveClkControls(std::vector<std::string> const &ppOdClkVoltageLines);
/// Translates a CLK control name to the control commit command id.
/// @param controlName name of the control
/// @returns commit command id
std::optional<std::string>
getOverdriveClkControlCmdId(std::string_view controlName);
/// Returns a list containing the indices of all out of range states present on
/// pp_od_clk_voltage for the given control name.
/// @param controlName name of the control
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
std::optional<std::vector<unsigned int>> ppOdClkVoltageFreqRangeOutOfRangeStates(
std::string const &controlName,
std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns whether pp_od_clk_voltage has known frequency + voltage control quirks.
/// @param controlName name of the control
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
bool ppOdClkVoltageHasKnownFreqVoltQuirks(
std::string const &controlName,
std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns whether pp_od_clk_voltage has known voltage curve control quirks.
/// @param ppOdClkVoltageLines pp_od_clk_voltage data source contents
bool ppOdClkVoltageHasKnownVoltCurveQuirks(
std::vector<std::string> const &ppOdClkVoltageLines);
/// Returns true when overdrive clock + voltage state control is available.
bool hasOverdriveClkVoltControl(std::vector<std::string> const &data);
/// Returns true when overdrive clock control is available.
bool hasOverdriveClkControl(std::vector<std::string> const &data);
/// Returns true when overdrive voltage curve control is available.
bool hasOverdriveVoltCurveControl(std::vector<std::string> const &data);
/// Returns true when overdrive voltage offset control is available.
bool hasOverdriveVoltOffsetControl(std::vector<std::string> const &data);
} // namespace AMD
} // namespace Utils

View File

@ -0,0 +1,48 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "commonutils.h"
#include "common/mathutils.h"
#include <algorithm>
#include <cstddef>
#include <iterator>
void Utils::Common::normalizePoints(
std::vector<std::pair<units::temperature::celsius_t,
units::concentration::percent_t>> &points,
std::pair<units::temperature::celsius_t, units::temperature::celsius_t> range)
{
std::vector<double> temps;
if (std::any_of(points.cbegin(), points.cend(), [&](auto &point) {
return point.first < range.first || point.first > range.second;
})) {
std::transform(points.cbegin(), points.cend(), std::back_inserter(temps),
[](auto &point) { return point.first.template to<double>(); });
auto [minTemp, maxTemp] = std::minmax_element(temps.cbegin(), temps.cend());
Utils::Math::linearNorm(
temps, std::make_pair(std::min(0.0, *minTemp), std::max(90.0, *maxTemp)),
std::make_pair(range.first.to<double>(), range.second.to<double>()));
}
for (size_t i = 0; i < points.size(); ++i) {
auto &[temp, pwm] = points.at(i);
// always clamp pwm value into [0, 100] range
pwm = std::clamp(pwm, units::concentration::percent_t(0),
units::concentration::percent_t(100));
// ensure that point.pwm >= prevPoint.pwm
if (points.size() > 1 && i > 0) {
auto const &[_, prevPwm] = points.at(i - 1);
if (pwm < prevPwm)
pwm = prevPwm;
}
if (!temps.empty())
temp = units::temperature::celsius_t(temps[i]);
}
}

View File

@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "units/units.h"
#include <utility>
#include <vector>
namespace Utils {
namespace Common {
/// Normalizes points into temperature and percentage ranges.
/// @note Temperature normalization is only performed when needed.
/// @param points points to normalize
/// @param range target temperature range
void normalizePoints(
std::vector<std::pair<units::temperature::celsius_t,
units::concentration::percent_t>> &points,
std::pair<units::temperature::celsius_t, units::temperature::celsius_t> range);
} // namespace Common
} // namespace Utils

View File

@ -0,0 +1,52 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fanauto.h"
#include "core/icommandqueue.h"
#include "core/idatasource.h"
#include <utility>
AMD::FanAuto::FanAuto(std::unique_ptr<IDataSource<unsigned int>> &&dataSource) noexcept
: Control(true)
, id_(AMD::FanAuto::ItemID)
, dataSource_(std::move(dataSource))
{
}
void AMD::FanAuto::preInit(ICommandQueue &)
{
}
void AMD::FanAuto::postInit(ICommandQueue &)
{
}
void AMD::FanAuto::init()
{
}
std::string const &AMD::FanAuto::ID() const
{
return id_;
}
void AMD::FanAuto::importControl(IControl::Importer &)
{
}
void AMD::FanAuto::exportControl(IControl::Exporter &) const
{
}
void AMD::FanAuto::cleanControl(ICommandQueue &)
{
}
void AMD::FanAuto::syncControl(ICommandQueue &ctlCmds)
{
if (dataSource_->read(pwmEnable_)) {
if (pwmEnable_ != 2)
ctlCmds.add({dataSource_->source(), "2"});
}
}

View File

@ -0,0 +1,43 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/components/controls/control.h"
#include <memory>
#include <string>
#include <string_view>
template<typename...>
class IDataSource;
namespace AMD {
class FanAuto : public Control
{
public:
static constexpr std::string_view ItemID{"AMD_FAN_AUTO"};
FanAuto(std::unique_ptr<IDataSource<unsigned int>> &&dataSource) noexcept;
void preInit(ICommandQueue &ctlCmds) final override;
void postInit(ICommandQueue &ctlCmds) final override;
void init() final override;
std::string const &ID() const final override;
protected:
void importControl(IControl::Importer &i) final override;
void exportControl(IControl::Exporter &e) const final override;
void cleanControl(ICommandQueue &ctlCmds) final override;
void syncControl(ICommandQueue &ctlCmds) final override;
private:
std::string const id_;
std::unique_ptr<IDataSource<unsigned int>> const dataSource_;
unsigned int pwmEnable_;
};
} // namespace AMD

View File

@ -0,0 +1,82 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fanautoprofilepart.h"
#include "core/profilepartprovider.h"
#include <memory>
class AMD::FanAutoProfilePart::Initializer final : public AMD::FanAuto::Exporter
{
public:
Initializer(AMD::FanAutoProfilePart &outer) noexcept
: outer_(outer)
{
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &) override
{
return {};
}
void takeActive(bool active) override;
private:
AMD::FanAutoProfilePart &outer_;
};
void AMD::FanAutoProfilePart::Initializer::takeActive(bool active)
{
outer_.activate(active);
}
AMD::FanAutoProfilePart::FanAutoProfilePart() noexcept
: id_(AMD::FanAuto::ItemID)
{
}
std::unique_ptr<Exportable::Exporter>
AMD::FanAutoProfilePart::factory(IProfilePartProvider const &)
{
return nullptr;
}
std::unique_ptr<Exportable::Exporter> AMD::FanAutoProfilePart::initializer()
{
return std::make_unique<AMD::FanAutoProfilePart::Initializer>(*this);
}
std::string const &AMD::FanAutoProfilePart::ID() const
{
return id_;
}
std::optional<std::reference_wrapper<Importable::Importer>>
AMD::FanAutoProfilePart::provideImporter(Item const &)
{
return {};
}
bool AMD::FanAutoProfilePart::provideActive() const
{
return active();
}
void AMD::FanAutoProfilePart::importProfilePart(IProfilePart::Importer &)
{
}
void AMD::FanAutoProfilePart::exportProfilePart(IProfilePart::Exporter &) const
{
}
std::unique_ptr<IProfilePart> AMD::FanAutoProfilePart::cloneProfilePart() const
{
return std::make_unique<AMD::FanAutoProfilePart>();
}
bool const AMD::FanAutoProfilePart::registered_ =
ProfilePartProvider::registerProvider(AMD::FanAuto::ItemID, []() {
return std::make_unique<AMD::FanAutoProfilePart>();
});

View File

@ -0,0 +1,51 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/profilepart.h"
#include "fanauto.h"
#include <string>
namespace AMD {
class FanAutoProfilePart final
: public ProfilePart
, public AMD::FanAuto::Importer
{
public:
class Importer : public IProfilePart::Importer
{
};
class Exporter : public IProfilePart::Exporter
{
};
FanAutoProfilePart() noexcept;
std::unique_ptr<Exportable::Exporter>
factory(IProfilePartProvider const &profilePartProvider) override;
std::unique_ptr<Exportable::Exporter> initializer() override;
std::string const &ID() const override;
std::optional<std::reference_wrapper<Importable::Importer>>
provideImporter(Item const &i) override;
bool provideActive() const override;
protected:
void importProfilePart(IProfilePart::Importer &i) override;
void exportProfilePart(IProfilePart::Exporter &e) const override;
std::unique_ptr<IProfilePart> cloneProfilePart() const override;
private:
class Initializer;
std::string const id_;
static bool const registered_;
};
} // namespace AMD

View File

@ -0,0 +1,53 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fanautoprovider.h"
#include "../fanmodeprovider.h"
#include "common/fileutils.h"
#include "common/stringutils.h"
#include "core/info/igpuinfo.h"
#include "core/info/iswinfo.h"
#include "core/sysfsdatasource.h"
#include "fanauto.h"
#include <filesystem>
#include <memory>
#include <tuple>
std::vector<std::unique_ptr<IControl>>
AMD::FanAutoProvider::provideGPUControls(IGPUInfo const &gpuInfo,
ISWInfo const &swInfo) const
{
std::vector<std::unique_ptr<IControl>> controls;
if (gpuInfo.vendor() == Vendor::AMD) {
auto kernel =
Utils::String::parseVersion(swInfo.info(ISWInfo::Keys::kernelVersion));
auto driver = gpuInfo.info(IGPUInfo::Keys::driver);
if ((driver == "radeon" && kernel >= std::make_tuple(4, 0, 0)) ||
(driver == "amdgpu" && kernel >= std::make_tuple(4, 2, 0))) {
auto path =
Utils::File::findHWMonXDirectory(gpuInfo.path().sys / "hwmon");
if (path.has_value()) {
auto pwmEnable = path.value() / "pwm1_enable";
if (Utils::File::isSysFSEntryValid(pwmEnable)) {
controls.emplace_back(std::make_unique<AMD::FanAuto>(
std::make_unique<SysFSDataSource<unsigned int>>(
pwmEnable, [](std::string const &data, unsigned int &output) {
Utils::String::toNumber<unsigned int>(output, data);
})));
}
}
}
}
return controls;
}
bool const AMD::FanAutoProvider::registered_ =
AMD::FanModeProvider::registerProvider(
std::make_unique<AMD::FanAutoProvider>());

View File

@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/components/controls/igpucontrolprovider.h"
namespace AMD {
class FanAutoProvider final : public IGPUControlProvider::IProvider
{
public:
std::vector<std::unique_ptr<IControl>>
provideGPUControls(IGPUInfo const &gpuInfo,
ISWInfo const &swInfo) const override;
private:
static bool const registered_;
};
} // namespace AMD

View File

@ -0,0 +1,107 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fanautoqmlitem.h"
#include "core/qmlcomponentregistry.h"
#include "fanauto.h"
#include <QQmlApplicationEngine>
#include <QQmlComponent>
#include <QString>
#include <QtGlobal>
#include <QtQml>
#include <memory>
char const *const AMD::FanAutoQMLItem::trStrings[] = {
QT_TRANSLATE_NOOP("ControlModeQMLItem", "AMD_FAN_AUTO"),
};
class AMD::FanAutoQMLItem::Initializer final
: public QMLItem::Initializer
, public IControl::Exporter
{
public:
Initializer(IQMLComponentFactory const &qmlComponentFactory,
QQmlApplicationEngine &qmlEngine,
AMD::FanAutoQMLItem &qmlItem) noexcept
: QMLItem::Initializer(qmlComponentFactory, qmlEngine)
, outer_(qmlItem)
{
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &) override
{
return {};
}
void takeActive(bool active) override;
private:
AMD::FanAutoQMLItem &outer_;
};
void AMD::FanAutoQMLItem::Initializer::takeActive(bool active)
{
outer_.takeActive(active);
}
AMD::FanAutoQMLItem::FanAutoQMLItem() noexcept
{
setName(tr(FanAuto::ItemID.data()));
}
void AMD::FanAutoQMLItem::activate(bool active)
{
takeActive(active);
}
std::optional<std::reference_wrapper<Importable::Importer>>
AMD::FanAutoQMLItem::provideImporter(Item const &)
{
return {};
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
AMD::FanAutoQMLItem::provideExporter(Item const &)
{
return {};
}
bool AMD::FanAutoQMLItem::provideActive() const
{
return active_;
}
void AMD::FanAutoQMLItem::takeActive(bool active)
{
active_ = active;
setVisible(active);
}
std::unique_ptr<Exportable::Exporter>
AMD::FanAutoQMLItem::initializer(IQMLComponentFactory const &qmlComponentFactory,
QQmlApplicationEngine &qmlEngine)
{
return std::make_unique<AMD::FanAutoQMLItem::Initializer>(qmlComponentFactory,
qmlEngine, *this);
}
bool AMD::FanAutoQMLItem::register_()
{
QMLComponentRegistry::addQMLTypeRegisterer([]() {
qmlRegisterType<AMD::FanAutoQMLItem>("CoreCtrl.UIComponents", 1, 0,
AMD::FanAuto::ItemID.data());
});
QMLComponentRegistry::addQMLItemProvider(
AMD::FanAuto::ItemID, [](QQmlApplicationEngine &engine) {
QQmlComponent component(&engine,
QStringLiteral("qrc:/qml/AMDFanAutoForm.qml"));
return qobject_cast<QMLItem *>(component.create());
});
return true;
}
bool const AMD::FanAutoQMLItem::registered_ = AMD::FanAutoQMLItem::register_();

View File

@ -0,0 +1,48 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/qmlitem.h"
#include "fanautoprofilepart.h"
#include <QObject>
namespace AMD {
class FanAutoQMLItem
: public QMLItem
, public AMD::FanAutoProfilePart::Importer
, public AMD::FanAutoProfilePart::Exporter
{
Q_OBJECT
public:
explicit FanAutoQMLItem() noexcept;
void activate(bool active) override;
std::optional<std::reference_wrapper<Importable::Importer>>
provideImporter(Item const &i) override;
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &i) override;
bool provideActive() const override;
void takeActive(bool active) override;
std::unique_ptr<Exportable::Exporter>
initializer(IQMLComponentFactory const &qmlComponentFactory,
QQmlApplicationEngine &qmlEngine) override;
private:
class Initializer;
bool active_;
static bool register_();
static bool const registered_;
static char const *const trStrings[];
};
} // namespace AMD

View File

@ -0,0 +1,96 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fanautoxmlparser.h"
#include "core/profilepartxmlparserprovider.h"
#include "fanauto.h"
#include <memory>
class AMD::FanAutoXMLParser::Initializer final
: public AMD::FanAutoProfilePart::Exporter
{
public:
Initializer(AMD::FanAutoXMLParser &outer) noexcept
: outer_(outer)
{
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &) override
{
return {};
}
void takeActive(bool active) override;
private:
AMD::FanAutoXMLParser &outer_;
};
void AMD::FanAutoXMLParser::Initializer::takeActive(bool active)
{
outer_.active_ = outer_.activeDefault_ = active;
}
AMD::FanAutoXMLParser::FanAutoXMLParser() noexcept
: ProfilePartXMLParser(AMD::FanAuto::ItemID, *this, *this)
{
}
std::unique_ptr<Exportable::Exporter>
AMD::FanAutoXMLParser::factory(IProfilePartXMLParserProvider const &)
{
return nullptr;
}
std::unique_ptr<Exportable::Exporter> AMD::FanAutoXMLParser::initializer()
{
return std::make_unique<AMD::FanAutoXMLParser::Initializer>(*this);
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
AMD::FanAutoXMLParser::provideExporter(Item const &)
{
return {};
}
std::optional<std::reference_wrapper<Importable::Importer>>
AMD::FanAutoXMLParser::provideImporter(Item const &)
{
return {};
}
void AMD::FanAutoXMLParser::takeActive(bool active)
{
active_ = active;
}
bool AMD::FanAutoXMLParser::provideActive() const
{
return active_;
}
void AMD::FanAutoXMLParser::appendTo(pugi::xml_node &parentNode)
{
auto pmFixedNode = parentNode.append_child(ID().c_str());
pmFixedNode.append_attribute("active") = active_;
}
void AMD::FanAutoXMLParser::resetAttributes()
{
active_ = activeDefault_;
}
void AMD::FanAutoXMLParser::loadPartFrom(pugi::xml_node const &parentNode)
{
auto pmFixedNode = parentNode.find_child(
[&](pugi::xml_node const &node) { return node.name() == ID(); });
active_ = pmFixedNode.attribute("active").as_bool(activeDefault_);
}
bool const AMD::FanAutoXMLParser::registered_ =
ProfilePartXMLParserProvider::registerProvider(AMD::FanAuto::ItemID, []() {
return std::make_unique<AMD::FanAutoXMLParser>();
});

View File

@ -0,0 +1,47 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/profilepartxmlparser.h"
#include "fanautoprofilepart.h"
#include <string>
namespace AMD {
class FanAutoXMLParser final
: public ProfilePartXMLParser
, public AMD::FanAutoProfilePart::Exporter
, public AMD::FanAutoProfilePart::Importer
{
public:
FanAutoXMLParser() noexcept;
std::unique_ptr<Exportable::Exporter> factory(
IProfilePartXMLParserProvider const &profilePartParserProvider) override;
std::unique_ptr<Exportable::Exporter> initializer() override;
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &i) override;
std::optional<std::reference_wrapper<Importable::Importer>>
provideImporter(Item const &i) override;
void takeActive(bool active) override;
bool provideActive() const override;
void appendTo(pugi::xml_node &parentNode) override;
protected:
void resetAttributes() override;
void loadPartFrom(pugi::xml_node const &parentNode) override;
private:
class Initializer;
bool active_;
bool activeDefault_;
static bool const registered_;
};
} // namespace AMD

View File

@ -0,0 +1,233 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fancurve.h"
#include "common/mathutils.h"
#include "core/components/commonutils.h"
#include "core/icommandqueue.h"
#include "core/idatasource.h"
#include <algorithm>
#include <cmath>
#include <iterator>
#include <limits>
AMD::FanCurve::FanCurve(
std::unique_ptr<IDataSource<unsigned int>> &&pwmEnableDataSource,
std::unique_ptr<IDataSource<unsigned int>> &&pwmDataSource,
std::unique_ptr<IDataSource<int>> &&tempInputDataSource,
units::temperature::celsius_t tempMin,
units::temperature::celsius_t tempMax) noexcept
: Control(false)
, id_(AMD::FanCurve::ItemID)
, pwmEnableDataSource_(std::move(pwmEnableDataSource))
, pwmDataSource_(std::move(pwmDataSource))
, tempInputDataSource_(std::move(tempInputDataSource))
, tempRange_(std::make_pair(tempMin, tempMax))
, fanStop_(false)
, fanStartValue_(54)
, hysteresis_(5)
, lastPwmValue_(std::numeric_limits<unsigned int>::max())
, lastFanStop_(false)
{
// default curve
points_.emplace_back(units::temperature::celsius_t(35),
units::make_unit<units::concentration::percent_t>(20));
points_.emplace_back(units::temperature::celsius_t(52),
units::make_unit<units::concentration::percent_t>(22));
points_.emplace_back(units::temperature::celsius_t(67),
units::make_unit<units::concentration::percent_t>(30));
points_.emplace_back(units::temperature::celsius_t(78),
units::make_unit<units::concentration::percent_t>(50));
points_.emplace_back(units::temperature::celsius_t(85),
units::make_unit<units::concentration::percent_t>(82));
Utils::Common::normalizePoints(points_, tempRange_);
// compute fan start temperature
fanStartTemp_ = evaluatePwm(std::round(fanStartValue_ / 2.55));
}
void AMD::FanCurve::preInit(ICommandQueue &)
{
}
void AMD::FanCurve::postInit(ICommandQueue &)
{
}
void AMD::FanCurve::init()
{
}
std::string const &AMD::FanCurve::ID() const
{
return id_;
}
void AMD::FanCurve::importControl(IControl::Importer &i)
{
auto &fanCurveImporter = dynamic_cast<AMD::FanCurve::Importer &>(i);
curve(fanCurveImporter.provideFanCurvePoints());
fanStop(fanCurveImporter.provideFanCurveFanStop());
fanStartValue(static_cast<unsigned int>(std::round(
fanCurveImporter.provideFanCurveFanStartValue().to<double>() * 255)));
}
void AMD::FanCurve::exportControl(IControl::Exporter &e) const
{
auto &fanCurveExporter = dynamic_cast<AMD::FanCurve::Exporter &>(e);
fanCurveExporter.takeFanCurveTemperatureRange(tempRange_.first,
tempRange_.second);
fanCurveExporter.takeFanCurvePoints(curve());
fanCurveExporter.takeFanCurveFanStop(fanStop());
fanCurveExporter.takeFanCurveFanStartValue(std::round(fanStartValue() / 2.55));
}
void AMD::FanCurve::cleanControl(ICommandQueue &)
{
lastPwmValue_ = std::numeric_limits<unsigned int>::max();
lastFanStop_ = false;
}
void AMD::FanCurve::syncControl(ICommandQueue &ctlCmds)
{
if (pwmEnableDataSource_->read(pwmEnable_) && pwmDataSource_->read(pwm_) &&
tempInputDataSource_->read(tempInput_)) {
unsigned int pwmValue;
if (fanStop() &&
((pwm_ > 0 && tempInput_ < fanStartTemp_ - hysteresis_) || // stop it
(pwm_ == 0 && tempInput_ < fanStartTemp_))) { // don't start it
pwmValue = 0;
}
else {
if (fanStop() && pwm_ > 0 && tempInput_ < fanStartTemp_)
pwmValue = fanStartValue_; // cap it to fan start value
else
pwmValue = evaluateTemp(units::temperature::celsius_t(tempInput_));
}
if (pwmEnable_ != 1) {
ctlCmds.add({pwmEnableDataSource_->source(), "1"});
ctlCmds.add({pwmDataSource_->source(), std::to_string(pwmValue)});
}
// NOTE pwm_ must be checked as well. The value that the hardware uses
// doesn't have to match the assigned value through pwm1.
// See: https://bugs.freedesktop.org/show_bug.cgi?id=110213
else if ((pwm_ != pwmValue && lastPwmValue_ != pwmValue) ||
lastFanStop_ != fanStop()) { // force sync
ctlCmds.add({pwmDataSource_->source(), std::to_string(pwmValue)});
}
lastPwmValue_ = pwmValue;
lastFanStop_ = fanStop();
}
}
std::vector<AMD::FanCurve::Point> const &AMD::FanCurve::curve() const
{
return points_;
}
void AMD::FanCurve::curve(std::vector<AMD::FanCurve::Point> const &points)
{
points_ = points;
Utils::Common::normalizePoints(points_, tempRange_);
fanStartTemp_ = evaluatePwm(std::round(fanStartValue_ / 2.55));
}
bool AMD::FanCurve::fanStop() const
{
return fanStop_;
}
void AMD::FanCurve::fanStop(bool enable)
{
fanStop_ = enable;
}
unsigned int AMD::FanCurve::fanStartValue() const
{
return fanStartValue_;
}
void AMD::FanCurve::fanStartValue(unsigned int value)
{
fanStartValue_ = static_cast<unsigned int>(std::clamp(value, 0u, 255u));
fanStartTemp_ = evaluatePwm(std::round(fanStartValue_ / 2.55));
}
int AMD::FanCurve::hysteresis() const
{
return hysteresis_;
}
int AMD::FanCurve::evaluatePwm(units::concentration::percent_t input) const
{
if (points_.size() > 1) {
auto pIt = std::find_if(points_.cbegin(), points_.cend(),
[=](auto &p) { return p.second > input; });
auto &p1 = (pIt == points_.cbegin()
? *pIt
: (pIt == points_.cend() ? *std::prev(std::prev(pIt))
: *std::prev(pIt)));
auto &p2 = (pIt == points_.cend()
? *std::prev(pIt)
: (pIt == points_.cbegin() ? *std::next(pIt) : *pIt));
return lerpFromPwm(input, p1, p2);
}
else if (points_.size() == 1)
return static_cast<int>(std::round(points_.front().first.to<double>()));
else
return 0;
}
int AMD::FanCurve::lerpFromPwm(units::concentration::percent_t input,
AMD::FanCurve::Point const &p1,
AMD::FanCurve::Point const &p2) const
{
input = std::clamp(input, p1.second, p2.second);
return static_cast<int>(std::round(Utils::Math::lerpY(
input.to<double>(),
std::make_pair(p1.first.to<double>(), p1.second.to<double>()),
std::make_pair(p2.first.to<double>(), p2.second.to<double>()))));
}
unsigned int AMD::FanCurve::evaluateTemp(units::temperature::celsius_t input) const
{
if (points_.size() > 1) {
auto pIt = std::find_if(points_.cbegin(), points_.cend(),
[=](auto &p) { return p.first > input; });
auto &p1 = (pIt == points_.cbegin()
? *pIt
: (pIt == points_.cend() ? *std::prev(std::prev(pIt))
: *std::prev(pIt)));
auto &p2 = (pIt == points_.cend()
? *std::prev(pIt)
: (pIt == points_.cbegin() ? *std::next(pIt) : *pIt));
return lerpFromTemp(input, p1, p2);
}
else if (points_.size() == 1)
return static_cast<unsigned int>(
std::round(points_.front().second.to<double>() * 255));
else
return 0;
}
unsigned int AMD::FanCurve::lerpFromTemp(units::temperature::celsius_t input,
AMD::FanCurve::Point const &p1,
AMD::FanCurve::Point const &p2) const
{
input = std::clamp(input, p1.first, p2.first);
return static_cast<unsigned int>(std::round(
Utils::Math::lerpX(
input.to<double>(),
std::make_pair(p1.first.to<double>(), p1.second.to<double>()),
std::make_pair(p2.first.to<double>(), p2.second.to<double>())) *
255)); // scale to [0, 255] range of pwm1
}

View File

@ -0,0 +1,112 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/components/controls/control.h"
#include "units/units.h"
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
template<typename...>
class IDataSource;
namespace AMD {
class FanCurve : public Control
{
public:
static constexpr std::string_view ItemID{"AMD_FAN_CURVE"};
using Point =
std::pair<units::temperature::celsius_t, units::concentration::percent_t>;
class Importer : public IControl::Importer
{
public:
virtual std::vector<FanCurve::Point> const &provideFanCurvePoints() const = 0;
virtual bool provideFanCurveFanStop() const = 0;
virtual units::concentration::percent_t
provideFanCurveFanStartValue() const = 0;
};
class Exporter : public IControl::Exporter
{
public:
virtual void
takeFanCurvePoints(std::vector<FanCurve::Point> const &points) = 0;
virtual void takeFanCurveFanStop(bool enabled) = 0;
virtual void
takeFanCurveFanStartValue(units::concentration::percent_t value) = 0;
virtual void
takeFanCurveTemperatureRange(units::temperature::celsius_t min,
units::temperature::celsius_t max) = 0;
};
FanCurve(std::unique_ptr<IDataSource<unsigned int>> &&pwmEnableDataSource,
std::unique_ptr<IDataSource<unsigned int>> &&pwmDataSource,
std::unique_ptr<IDataSource<int>> &&tempInputDataSource,
units::temperature::celsius_t tempMin,
units::temperature::celsius_t tempMax) noexcept;
void preInit(ICommandQueue &ctlCmds) final override;
void postInit(ICommandQueue &ctlCmds) final override;
void init() final override;
std::string const &ID() const final override;
protected:
void importControl(IControl::Importer &i) final override;
void exportControl(IControl::Exporter &e) const final override;
void cleanControl(ICommandQueue &ctlCmds) final override;
void syncControl(ICommandQueue &ctlCmds) final override;
std::vector<FanCurve::Point> const &curve() const;
void curve(std::vector<FanCurve::Point> const &points);
bool fanStop() const;
void fanStop(bool active);
unsigned int fanStartValue() const;
void fanStartValue(unsigned int value);
int hysteresis() const;
int evaluatePwm(units::concentration::percent_t input) const;
int lerpFromPwm(units::concentration::percent_t input,
FanCurve::Point const &p1, FanCurve::Point const &p2) const;
unsigned int evaluateTemp(units::temperature::celsius_t input) const;
unsigned int lerpFromTemp(units::temperature::celsius_t input,
FanCurve::Point const &p1,
FanCurve::Point const &p2) const;
private:
std::string const id_;
std::unique_ptr<IDataSource<unsigned int>> const pwmEnableDataSource_;
std::unique_ptr<IDataSource<unsigned int>> const pwmDataSource_;
std::unique_ptr<IDataSource<int>> const tempInputDataSource_;
std::pair<units::temperature::celsius_t, units::temperature::celsius_t> const
tempRange_;
unsigned int pwmEnable_;
unsigned int pwm_;
int tempInput_;
bool fanStop_;
unsigned int fanStartValue_;
int fanStartTemp_;
int const hysteresis_;
unsigned int lastPwmValue_;
bool lastFanStop_;
std::vector<FanCurve::Point> points_;
};
} // namespace AMD

View File

@ -0,0 +1,156 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fancurveprofilepart.h"
#include "core/components/commonutils.h"
#include "core/profilepartprovider.h"
#include <algorithm>
#include <memory>
class AMD::FanCurveProfilePart::Initializer final : public AMD::FanCurve::Exporter
{
public:
Initializer(AMD::FanCurveProfilePart &outer) noexcept
: outer_(outer)
{
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &) override
{
return {};
}
void takeActive(bool active) override;
void
takeFanCurvePoints(std::vector<AMD::FanCurve::Point> const &points) override;
void takeFanCurveFanStop(bool enabled) override;
void takeFanCurveFanStartValue(units::concentration::percent_t value) override;
void takeFanCurveTemperatureRange(units::temperature::celsius_t min,
units::temperature::celsius_t max) override;
private:
AMD::FanCurveProfilePart &outer_;
};
void AMD::FanCurveProfilePart::Initializer::takeActive(bool active)
{
outer_.activate(active);
}
void AMD::FanCurveProfilePart::Initializer::takeFanCurvePoints(
std::vector<AMD::FanCurve::Point> const &points)
{
outer_.points_ = points;
}
void AMD::FanCurveProfilePart::Initializer::takeFanCurveFanStop(bool enabled)
{
outer_.fanStop_ = enabled;
}
void AMD::FanCurveProfilePart::Initializer::takeFanCurveFanStartValue(
units::concentration::percent_t value)
{
outer_.fanStartValue_ = value;
}
void AMD::FanCurveProfilePart::Initializer::takeFanCurveTemperatureRange(
units::temperature::celsius_t min, units::temperature::celsius_t max)
{
outer_.tempRange_ = std::make_pair(min, max);
}
AMD::FanCurveProfilePart::FanCurveProfilePart() noexcept
: id_(AMD::FanCurve::ItemID)
{
}
std::unique_ptr<Exportable::Exporter>
AMD::FanCurveProfilePart::factory(IProfilePartProvider const &)
{
return nullptr;
}
std::unique_ptr<Exportable::Exporter> AMD::FanCurveProfilePart::initializer()
{
return std::make_unique<AMD::FanCurveProfilePart::Initializer>(*this);
}
std::string const &AMD::FanCurveProfilePart::ID() const
{
return id_;
}
std::optional<std::reference_wrapper<Importable::Importer>>
AMD::FanCurveProfilePart::provideImporter(Item const &)
{
return {};
}
bool AMD::FanCurveProfilePart::provideActive() const
{
return active();
}
std::vector<AMD::FanCurve::Point> const &
AMD::FanCurveProfilePart::provideFanCurvePoints() const
{
return points_;
}
bool AMD::FanCurveProfilePart::provideFanCurveFanStop() const
{
return fanStop_;
}
units::concentration::percent_t
AMD::FanCurveProfilePart::provideFanCurveFanStartValue() const
{
return fanStartValue_;
}
void AMD::FanCurveProfilePart::importProfilePart(IProfilePart::Importer &i)
{
auto &pmfImporter = dynamic_cast<AMD::FanCurveProfilePart::Importer &>(i);
points(pmfImporter.provideFanCurvePoints());
fanStop_ = pmfImporter.provideFanCurveFanStop();
startValue(pmfImporter.provideFanCurveFanStartValue());
}
void AMD::FanCurveProfilePart::exportProfilePart(IProfilePart::Exporter &e) const
{
auto &pmfExporter = dynamic_cast<AMD::FanCurveProfilePart::Exporter &>(e);
pmfExporter.takeFanCurvePoints(points_);
pmfExporter.takeFanCurveFanStop(fanStop_);
pmfExporter.takeFanCurveFanStartValue(fanStartValue_);
}
std::unique_ptr<IProfilePart> AMD::FanCurveProfilePart::cloneProfilePart() const
{
auto clone = std::make_unique<AMD::FanCurveProfilePart>();
clone->tempRange_ = tempRange_;
clone->points_ = points_;
clone->fanStop_ = fanStop_;
clone->fanStartValue_ = fanStartValue_;
return std::move(clone);
}
void AMD::FanCurveProfilePart::points(std::vector<FanCurve::Point> const &points)
{
points_ = points;
Utils::Common::normalizePoints(points_, tempRange_);
}
void AMD::FanCurveProfilePart::startValue(units::concentration::percent_t value)
{
fanStartValue_ = std::clamp(value, units::concentration::percent_t(0),
units::concentration::percent_t(100));
}
bool const AMD::FanCurveProfilePart::registered_ =
ProfilePartProvider::registerProvider(AMD::FanCurve::ItemID, []() {
return std::make_unique<AMD::FanCurveProfilePart>();
});

View File

@ -0,0 +1,75 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/profilepart.h"
#include "fancurve.h"
#include <string>
#include <utility>
#include <vector>
namespace AMD {
class FanCurveProfilePart final
: public ProfilePart
, public AMD::FanCurve::Importer
{
public:
class Importer : public IProfilePart::Importer
{
public:
virtual std::vector<FanCurve::Point> const &provideFanCurvePoints() const = 0;
virtual bool provideFanCurveFanStop() const = 0;
virtual units::concentration::percent_t
provideFanCurveFanStartValue() const = 0;
};
class Exporter : public IProfilePart::Exporter
{
public:
virtual void
takeFanCurvePoints(std::vector<FanCurve::Point> const &points) = 0;
virtual void takeFanCurveFanStop(bool enabled) = 0;
virtual void
takeFanCurveFanStartValue(units::concentration::percent_t value) = 0;
};
FanCurveProfilePart() noexcept;
std::unique_ptr<Exportable::Exporter>
factory(IProfilePartProvider const &profilePartProvider) override;
std::unique_ptr<Exportable::Exporter> initializer() override;
std::string const &ID() const override;
std::optional<std::reference_wrapper<Importable::Importer>>
provideImporter(Item const &i) override;
bool provideActive() const override;
std::vector<FanCurve::Point> const &provideFanCurvePoints() const override;
bool provideFanCurveFanStop() const override;
units::concentration::percent_t provideFanCurveFanStartValue() const override;
protected:
void importProfilePart(IProfilePart::Importer &i) override;
void exportProfilePart(IProfilePart::Exporter &e) const override;
std::unique_ptr<IProfilePart> cloneProfilePart() const override;
private:
void points(std::vector<FanCurve::Point> const &points);
void startValue(units::concentration::percent_t value);
class Initializer;
std::string const id_;
std::vector<FanCurve::Point> points_;
std::pair<units::temperature::celsius_t, units::temperature::celsius_t> tempRange_;
bool fanStop_;
units::concentration::percent_t fanStartValue_;
static bool const registered_;
};
} // namespace AMD

View File

@ -0,0 +1,122 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fancurveprovider.h"
#include "../fanmodeprovider.h"
#include "common/fileutils.h"
#include "common/stringutils.h"
#include "core/info/igpuinfo.h"
#include "core/info/iswinfo.h"
#include "core/sysfsdatasource.h"
#include "easyloggingpp/easylogging++.h"
#include "fancurve.h"
#include "fmt/format.h"
#include <filesystem>
#include <memory>
#include <string>
#include <tuple>
std::vector<std::unique_ptr<IControl>>
AMD::FanCurveProvider::provideGPUControls(IGPUInfo const &gpuInfo,
ISWInfo const &swInfo) const
{
std::vector<std::unique_ptr<IControl>> controls;
if (gpuInfo.vendor() == Vendor::AMD) {
auto kernel =
Utils::String::parseVersion(swInfo.info(ISWInfo::Keys::kernelVersion));
auto driver = gpuInfo.info(IGPUInfo::Keys::driver);
if ((driver == "radeon" && kernel >= std::make_tuple(4, 0, 0)) ||
(driver == "amdgpu" && kernel >= std::make_tuple(4, 2, 0))) {
auto path =
Utils::File::findHWMonXDirectory(gpuInfo.path().sys / "hwmon");
if (path.has_value()) {
auto pwmEnable = path.value() / "pwm1_enable";
auto pwm = path.value() / "pwm1";
auto tempInput = path.value() / "temp1_input";
auto tempCrit = path.value() / "temp1_crit";
if (Utils::File::isSysFSEntryValid(pwm) &&
Utils::File::isSysFSEntryValid(pwmEnable) &&
Utils::File::isSysFSEntryValid(tempInput) &&
Utils::File::isSysFSEntryValid(tempCrit)) {
int tempCritValue{0};
Utils::String::toNumber(tempCritValue,
Utils::File::readFileLines(tempCrit).front());
tempCritValue = (tempCritValue > 0 &&
tempCritValue < 150000) // check bogus values, see #103
? tempCritValue / 1000
: 90;
unsigned int value;
auto pwmEnableLines = Utils::File::readFileLines(pwmEnable);
auto pwmEnableValid = Utils::String::toNumber<unsigned int>(
value, pwmEnableLines.front());
auto pwmLines = Utils::File::readFileLines(pwm);
auto pwmValid = Utils::String::toNumber<unsigned int>(
value, pwmLines.front());
int tempInputValue;
auto tempInputLines = Utils::File::readFileLines(tempInput);
auto tempInputValid = Utils::String::toNumber<int>(
tempInputValue, tempInputLines.front());
if (pwmEnableValid && pwmValid && tempInputValid) {
controls.emplace_back(std::make_unique<AMD::FanCurve>(
std::make_unique<SysFSDataSource<unsigned int>>(
pwmEnable,
[](std::string const &data, unsigned int &output) {
Utils::String::toNumber<unsigned int>(output, data);
}),
std::make_unique<SysFSDataSource<unsigned int>>(
pwm,
[](std::string const &data, unsigned int &output) {
Utils::String::toNumber<unsigned int>(output, data);
}),
std::make_unique<SysFSDataSource<int>>(
tempInput,
[](std::string const &data, int &output) {
int value;
Utils::String::toNumber<int>(value, data);
output = value / 1000;
}),
units::temperature::celsius_t(0),
units::temperature::celsius_t(tempCritValue)));
}
else {
if (!pwmEnableValid) {
LOG(WARNING) << fmt::format("Unknown data format on {}",
pwmEnable.string());
LOG(ERROR) << pwmEnableLines.front().c_str();
}
if (!pwmValid) {
LOG(WARNING) << fmt::format("Unknown data format on {}",
pwm.string());
LOG(ERROR) << pwmLines.front().c_str();
}
if (!tempInputValid) {
LOG(WARNING) << fmt::format("Unknown data format on {}",
tempInput.string());
LOG(ERROR) << tempInputLines.front().c_str();
}
}
}
}
}
}
return controls;
}
bool const AMD::FanCurveProvider::registered_ =
AMD::FanModeProvider::registerProvider(
std::make_unique<AMD::FanCurveProvider>());

View File

@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/components/controls/igpucontrolprovider.h"
namespace AMD {
class FanCurveProvider final : public IGPUControlProvider::IProvider
{
public:
std::vector<std::unique_ptr<IControl>>
provideGPUControls(IGPUInfo const &gpuInfo,
ISWInfo const &swInfo) const override;
private:
static bool const registered_;
};
} // namespace AMD

View File

@ -0,0 +1,265 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fancurveqmlitem.h"
#include "core/qmlcomponentregistry.h"
#include "fancurve.h"
#include <QQmlApplicationEngine>
#include <QQmlComponent>
#include <QString>
#include <QtQml>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <memory>
#include <utility>
char const *const AMD::FanCurveQMLItem::trStrings[] = {
QT_TRANSLATE_NOOP("ControlModeQMLItem", "AMD_FAN_CURVE"),
};
class AMD::FanCurveQMLItem::Initializer final
: public QMLItem::Initializer
, public AMD::FanCurve::Exporter
{
public:
Initializer(IQMLComponentFactory const &qmlComponentFactory,
QQmlApplicationEngine &qmlEngine,
AMD::FanCurveQMLItem &qmlItem) noexcept
: QMLItem::Initializer(qmlComponentFactory, qmlEngine)
, outer_(qmlItem)
{
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &) override
{
return {};
}
void takeActive(bool active) override;
void
takeFanCurvePoints(std::vector<AMD::FanCurve::Point> const &points) override;
void takeFanCurveFanStop(bool enabled) override;
void takeFanCurveFanStartValue(units::concentration::percent_t value) override;
void takeFanCurveTemperatureRange(units::temperature::celsius_t min,
units::temperature::celsius_t max) override;
private:
AMD::FanCurveQMLItem &outer_;
};
void AMD::FanCurveQMLItem::Initializer::takeActive(bool active)
{
outer_.takeActive(active);
}
void AMD::FanCurveQMLItem::Initializer::takeFanCurvePoints(
std::vector<AMD::FanCurve::Point> const &points)
{
outer_.takeFanCurvePoints(points);
}
void AMD::FanCurveQMLItem::Initializer::takeFanCurveFanStop(bool enabled)
{
outer_.takeFanCurveFanStop(enabled);
}
void AMD::FanCurveQMLItem::Initializer::takeFanCurveFanStartValue(
units::concentration::percent_t value)
{
outer_.takeFanCurveFanStartValue(value);
}
void AMD::FanCurveQMLItem::Initializer::takeFanCurveTemperatureRange(
units::temperature::celsius_t min, units::temperature::celsius_t max)
{
outer_.temperatureRange(min, max);
}
AMD::FanCurveQMLItem::FanCurveQMLItem() noexcept
{
setName(tr(AMD::FanCurve::ItemID.data()));
}
void AMD::FanCurveQMLItem::enableFanStop(bool enabled)
{
if (fanStop_ != enabled) {
fanStop_ = enabled;
emit fanStopChanged(fanStop_);
emit settingsChanged();
}
}
void AMD::FanCurveQMLItem::changeFanStartValue(qreal value)
{
auto newValue = static_cast<unsigned int>(std::round(value));
if (fanStartValue_ != newValue) {
fanStartValue_ = newValue;
emit fanStartValueChanged(fanStartValue_);
emit settingsChanged();
}
}
void AMD::FanCurveQMLItem::updateCurvePoint(QPointF const &oldPoint,
QPointF const &newPoint)
{
if (oldPoint != newPoint) {
auto oPoint = std::make_pair(
units::temperature::celsius_t(std::round(oldPoint.x())),
units::concentration::percent_t(std::round(oldPoint.y())));
auto nPoint = std::make_pair(
units::temperature::celsius_t(std::round(newPoint.x())),
units::concentration::percent_t(std::round(newPoint.y())));
for (size_t i = 0; i < points_.size(); ++i) {
if (points_[i] == oPoint) {
points_[i] = nPoint;
qPoints_.replace(static_cast<int>(i), newPoint);
emit curveChanged(qPoints_);
emit settingsChanged();
break;
}
}
}
}
void AMD::FanCurveQMLItem::activate(bool active)
{
takeActive(active);
}
QVariantList const &AMD::FanCurveQMLItem::curve() const
{
return qPoints_;
}
bool AMD::FanCurveQMLItem::fanStop() const
{
return fanStop_;
}
qreal AMD::FanCurveQMLItem::fanStartValue() const
{
return static_cast<qreal>(fanStartValue_);
}
qreal AMD::FanCurveQMLItem::minTemp() const
{
return minTemp_;
}
qreal AMD::FanCurveQMLItem::maxTemp() const
{
return maxTemp_;
}
std::optional<std::reference_wrapper<Importable::Importer>>
AMD::FanCurveQMLItem::provideImporter(Item const &)
{
return {};
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
AMD::FanCurveQMLItem::provideExporter(Item const &)
{
return {};
}
bool AMD::FanCurveQMLItem::provideActive() const
{
return active_;
}
std::vector<AMD::FanCurve::Point> const &
AMD::FanCurveQMLItem::provideFanCurvePoints() const
{
return points_;
}
bool AMD::FanCurveQMLItem::provideFanCurveFanStop() const
{
return fanStop_;
}
units::concentration::percent_t
AMD::FanCurveQMLItem::provideFanCurveFanStartValue() const
{
return fanStartValue_;
}
void AMD::FanCurveQMLItem::takeActive(bool active)
{
active_ = active;
setVisible(active);
}
void AMD::FanCurveQMLItem::takeFanCurvePoints(
std::vector<AMD::FanCurve::Point> const &points)
{
if (points_ != points) {
points_ = points;
qPoints_.clear();
for (auto &[temp, pwm] : points_)
qPoints_.push_back(QPointF(temp.to<qreal>(), pwm.to<qreal>() * 100));
emit curveChanged(qPoints_);
}
}
void AMD::FanCurveQMLItem::takeFanCurveFanStop(bool active)
{
if (fanStop_ != active) {
fanStop_ = active;
emit fanStopChanged(fanStop_);
}
}
void AMD::FanCurveQMLItem::takeFanCurveFanStartValue(
units::concentration::percent_t value)
{
auto newValue = static_cast<unsigned int>(value * 100);
if (fanStartValue_ != newValue) {
fanStartValue_ = newValue;
emit fanStartValueChanged(fanStartValue_);
}
}
std::unique_ptr<Exportable::Exporter>
AMD::FanCurveQMLItem::initializer(IQMLComponentFactory const &qmlComponentFactory,
QQmlApplicationEngine &qmlEngine)
{
return std::make_unique<AMD::FanCurveQMLItem::Initializer>(
qmlComponentFactory, qmlEngine, *this);
}
void AMD::FanCurveQMLItem::temperatureRange(units::temperature::celsius_t min,
units::temperature::celsius_t max)
{
minTemp_ = min.to<qreal>();
maxTemp_ = max.to<qreal>();
emit temperatureRangeChanged(minTemp_, maxTemp_);
}
bool AMD::FanCurveQMLItem::register_()
{
QMLComponentRegistry::addQMLTypeRegisterer([]() {
qmlRegisterType<AMD::FanCurveQMLItem>("CoreCtrl.UIComponents", 1, 0,
AMD::FanCurve::ItemID.data());
});
QMLComponentRegistry::addQMLItemProvider(
AMD::FanCurve::ItemID, [](QQmlApplicationEngine &engine) {
QQmlComponent component(&engine,
QStringLiteral("qrc:/qml/AMDFanCurveForm.qml"));
return qobject_cast<QMLItem *>(component.create());
});
return true;
}
bool const AMD::FanCurveQMLItem::registered_ = AMD::FanCurveQMLItem::register_();

View File

@ -0,0 +1,90 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/qmlitem.h"
#include "fancurveprofilepart.h"
#include <QObject>
#include <QPointF>
#include <QVariantList>
#include <QtGlobal>
#include <vector>
namespace AMD {
class FanCurveQMLItem
: public QMLItem
, public AMD::FanCurveProfilePart::Importer
, public AMD::FanCurveProfilePart::Exporter
{
Q_OBJECT
Q_PROPERTY(bool fanStop READ fanStop WRITE enableFanStop NOTIFY fanStopChanged)
Q_PROPERTY(qreal fanStartValue READ fanStartValue WRITE changeFanStartValue
NOTIFY fanStartValueChanged)
Q_PROPERTY(qreal minTemp READ minTemp)
Q_PROPERTY(qreal maxTemp READ maxTemp)
public:
explicit FanCurveQMLItem() noexcept;
signals:
void curveChanged(QVariantList const &points);
void fanStopChanged(bool enabled);
void fanStartValueChanged(qreal value);
void temperatureRangeChanged(qreal min, qreal max);
public slots:
void enableFanStop(bool enabled);
void changeFanStartValue(qreal value);
void updateCurvePoint(QPointF const &oldPoint, QPointF const &newPoint);
public:
void activate(bool active) override;
QVariantList const &curve() const;
bool fanStop() const;
qreal fanStartValue() const;
qreal minTemp() const;
qreal maxTemp() const;
std::optional<std::reference_wrapper<Importable::Importer>>
provideImporter(Item const &i) override;
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &i) override;
bool provideActive() const override;
std::vector<FanCurve::Point> const &provideFanCurvePoints() const override;
bool provideFanCurveFanStop() const override;
units::concentration::percent_t provideFanCurveFanStartValue() const override;
void takeActive(bool active) override;
void takeFanCurvePoints(std::vector<FanCurve::Point> const &points) override;
void takeFanCurveFanStop(bool enabled) override;
void takeFanCurveFanStartValue(units::concentration::percent_t value) override;
std::unique_ptr<Exportable::Exporter>
initializer(IQMLComponentFactory const &qmlComponentFactory,
QQmlApplicationEngine &qmlEngine) override;
private:
void temperatureRange(units::temperature::celsius_t min,
units::temperature::celsius_t max);
class Initializer;
bool active_;
std::vector<FanCurve::Point> points_;
QVariantList qPoints_;
bool fanStop_;
unsigned int fanStartValue_;
qreal minTemp_;
qreal maxTemp_;
static bool register_();
static bool const registered_;
static char const *const trStrings[];
};
} // namespace AMD

View File

@ -0,0 +1,191 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fancurvexmlparser.h"
#include "core/profilepartxmlparserprovider.h"
#include "fancurve.h"
#include <cmath>
#include <memory>
class AMD::FanCurveXMLParser::Initializer final
: public AMD::FanCurveProfilePart::Exporter
{
public:
Initializer(AMD::FanCurveXMLParser &outer) noexcept
: outer_(outer)
{
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &) override
{
return {};
}
void takeActive(bool active) override;
void
takeFanCurvePoints(std::vector<AMD::FanCurve::Point> const &points) override;
void takeFanCurveFanStop(bool enabled) override;
void takeFanCurveFanStartValue(units::concentration::percent_t value) override;
private:
AMD::FanCurveXMLParser &outer_;
};
void AMD::FanCurveXMLParser::Initializer::takeActive(bool active)
{
outer_.active_ = outer_.activeDefault_ = active;
}
void AMD::FanCurveXMLParser::Initializer::takeFanCurvePoints(
std::vector<AMD::FanCurve::Point> const &points)
{
outer_.points_ = outer_.pointsDefault_ = points;
}
void AMD::FanCurveXMLParser::Initializer::takeFanCurveFanStop(bool enabled)
{
outer_.fanStop_ = outer_.fanStopDefault_ = enabled;
}
void AMD::FanCurveXMLParser::Initializer::takeFanCurveFanStartValue(
units::concentration::percent_t value)
{
outer_.fanStartValue_ = outer_.fanStartValueDefault_ = value * 100;
}
AMD::FanCurveXMLParser::FanCurveXMLParser() noexcept
: ProfilePartXMLParser(AMD::FanCurve::ItemID, *this, *this)
{
}
std::unique_ptr<Exportable::Exporter>
AMD::FanCurveXMLParser::factory(IProfilePartXMLParserProvider const &)
{
return nullptr;
}
std::unique_ptr<Exportable::Exporter> AMD::FanCurveXMLParser::initializer()
{
return std::make_unique<AMD::FanCurveXMLParser::Initializer>(*this);
}
std::optional<std::reference_wrapper<Exportable::Exporter>>
AMD::FanCurveXMLParser::provideExporter(Item const &)
{
return {};
}
std::optional<std::reference_wrapper<Importable::Importer>>
AMD::FanCurveXMLParser::provideImporter(Item const &)
{
return {};
}
void AMD::FanCurveXMLParser::takeActive(bool active)
{
active_ = active;
}
bool AMD::FanCurveXMLParser::provideActive() const
{
return active_;
}
void AMD::FanCurveXMLParser::takeFanCurvePoints(
std::vector<AMD::FanCurve::Point> const &points)
{
points_ = points;
}
std::vector<AMD::FanCurve::Point> const &
AMD::FanCurveXMLParser::provideFanCurvePoints() const
{
return points_;
}
void AMD::FanCurveXMLParser::takeFanCurveFanStop(bool enabled)
{
fanStop_ = enabled;
}
bool AMD::FanCurveXMLParser::provideFanCurveFanStop() const
{
return fanStop_;
}
void AMD::FanCurveXMLParser::takeFanCurveFanStartValue(
units::concentration::percent_t value)
{
fanStartValue_ = value * 100;
}
units::concentration::percent_t
AMD::FanCurveXMLParser::provideFanCurveFanStartValue() const
{
return fanStartValue_;
}
void AMD::FanCurveXMLParser::appendTo(pugi::xml_node &parentNode)
{
auto pmFixedNode = parentNode.append_child(ID().c_str());
pmFixedNode.append_attribute("active") = active_;
pmFixedNode.append_attribute("fanStop") = fanStop_;
pmFixedNode.append_attribute("fanStartValue") = fanStartValue_;
auto curveNode = pmFixedNode.append_child(CurveNodeName.data());
for (auto &[temp, pwm] : points_) {
auto pointNode = curveNode.append_child(PointNodeName.data());
pointNode.append_attribute("temp") = temp.to<int>();
pointNode.append_attribute("pwm") =
static_cast<unsigned int>(std::round(pwm.to<double>() * 100));
}
}
void AMD::FanCurveXMLParser::resetAttributes()
{
active_ = activeDefault_;
points_ = pointsDefault_;
fanStop_ = fanStopDefault_;
fanStartValue_ = fanStartValueDefault_;
}
void AMD::FanCurveXMLParser::loadPartFrom(pugi::xml_node const &parentNode)
{
auto pmFixedNode = parentNode.find_child(
[&](pugi::xml_node const &node) { return node.name() == ID(); });
active_ = pmFixedNode.attribute("active").as_bool(activeDefault_);
fanStop_ = pmFixedNode.attribute("fanStop").as_bool(fanStopDefault_);
fanStartValue_ =
pmFixedNode.attribute("fanStartValue").as_uint(fanStartValueDefault_);
auto curveNode = pmFixedNode.find_child(
[&](pugi::xml_node const &node) { return node.name() == CurveNodeName; });
if (!curveNode) {
points_ = pointsDefault_;
}
else {
points_.clear();
for (auto pointNode : curveNode.children(PointNodeName.data())) {
auto tempAttr = pointNode.attribute("temp");
auto pwmAttr = pointNode.attribute("pwm");
if (tempAttr && pwmAttr) {
points_.emplace_back(units::temperature::celsius_t(tempAttr.as_int()),
units::concentration::percent_t(pwmAttr.as_uint()));
}
else { // malformed point data -> restore defaults
points_ = pointsDefault_;
break;
}
}
if (points_.size() < 2) // two or more points are needed
points_ = pointsDefault_;
}
}
bool const AMD::FanCurveXMLParser::registered_ =
ProfilePartXMLParserProvider::registerProvider(AMD::FanCurve::ItemID, []() {
return std::make_unique<AMD::FanCurveXMLParser>();
});

View File

@ -0,0 +1,70 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/profilepartxmlparser.h"
#include "fancurveprofilepart.h"
#include <string>
#include <string_view>
#include <vector>
namespace AMD {
class FanCurveXMLParser final
: public ProfilePartXMLParser
, public AMD::FanCurveProfilePart::Exporter
, public AMD::FanCurveProfilePart::Importer
{
public:
FanCurveXMLParser() noexcept;
std::unique_ptr<Exportable::Exporter> factory(
IProfilePartXMLParserProvider const &profilePartParserProvider) override;
std::unique_ptr<Exportable::Exporter> initializer() override;
std::optional<std::reference_wrapper<Exportable::Exporter>>
provideExporter(Item const &i) override;
std::optional<std::reference_wrapper<Importable::Importer>>
provideImporter(Item const &i) override;
void takeActive(bool active) override;
bool provideActive() const override;
void takeFanCurvePoints(std::vector<FanCurve::Point> const &points) override;
std::vector<FanCurve::Point> const &provideFanCurvePoints() const override;
void takeFanCurveFanStop(bool enabled) override;
bool provideFanCurveFanStop() const override;
void takeFanCurveFanStartValue(units::concentration::percent_t value) override;
units::concentration::percent_t provideFanCurveFanStartValue() const override;
void appendTo(pugi::xml_node &parentNode) override;
protected:
void resetAttributes() override;
void loadPartFrom(pugi::xml_node const &parentNode) override;
private:
static constexpr std::string_view CurveNodeName{"CURVE"};
static constexpr std::string_view PointNodeName{"POINT"};
class Initializer;
bool active_;
bool activeDefault_;
std::vector<FanCurve::Point> points_;
std::vector<FanCurve::Point> pointsDefault_;
bool fanStop_;
bool fanStopDefault_;
unsigned int fanStartValue_;
unsigned int fanStartValueDefault_;
static bool const registered_;
};
} // namespace AMD

View File

@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/components/controls/controlmode.h"
#include <memory>
#include <string_view>
#include <utility>
#include <vector>
namespace AMD {
class FanMode : public ControlMode
{
public:
static constexpr std::string_view ItemID{"AMD_FAN_MODE"};
FanMode(std::vector<std::unique_ptr<IControl>> &&controls) noexcept
: ControlMode(FanMode::ItemID, std::move(controls), true)
{
}
};
} // namespace AMD

View File

@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#include "fanmodeprofilepart.h"
#include "core/profilepartprovider.h"
#include "fanmode.h"
#include <memory>
AMD::FanModeProfilePart::FanModeProfilePart() noexcept
: ControlModeProfilePart(AMD::FanMode::ItemID)
{
}
std::unique_ptr<ControlModeProfilePart> AMD::FanModeProfilePart::instance() const
{
return std::make_unique<AMD::FanModeProfilePart>();
}
bool const AMD::FanModeProfilePart::registered_ =
ProfilePartProvider::registerProvider(AMD::FanMode::ItemID, []() {
return std::make_unique<AMD::FanModeProfilePart>();
});

View File

@ -0,0 +1,22 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright 2019 Juan Palacios <jpalaciosdev@gmail.com>
#pragma once
#include "core/components/controls/controlmodeprofilepart.h"
namespace AMD {
class FanModeProfilePart final : public ControlModeProfilePart
{
public:
FanModeProfilePart() noexcept;
protected:
std::unique_ptr<ControlModeProfilePart> instance() const override;
private:
static bool const registered_;
};
} // namespace AMD

Some files were not shown because too many files have changed in this diff Show More