PIVector2D - add funcs, optimize, tests, fixes, doxygen (#194)

Reviewed-on: #194
Co-authored-by: andrey.bychkov <andrey@signalmodelling.ru>
Co-committed-by: andrey.bychkov <andrey@signalmodelling.ru>
This commit was merged in pull request #194.
This commit is contained in:
2026-02-27 23:58:44 +03:00
parent 1739836a18
commit 9588b48105
7 changed files with 1724 additions and 375 deletions

View File

@@ -342,12 +342,12 @@ PIVector<PIHIDeviceInfo> PIHIDevice::allDevices(bool try_open) {
PIDir hid_dir("/sys/bus/hid/devices"_a);
auto hid_devs = hid_dir.entries();
for (auto hd: hid_devs) {
for (const auto & hd: hid_devs) {
// piCout << d.path;
if (!isDir(hd)) continue;
PIDir dir_input(hd.path + "/input"_a);
auto hid_inputs = dir_input.entries();
for (auto hd_i: hid_inputs) {
for (const auto & hd_i: hid_inputs) {
if (!isDir(hd_i)) continue;
// now in /sys/bus/hid/devices/<dev>/input/input<N>
// piCout << hd_i.path;
@@ -364,7 +364,7 @@ PIVector<PIHIDeviceInfo> PIHIDevice::allDevices(bool try_open) {
PIDir dir_e(hd_i.path);
PIStringList devs;
auto dl_e = dir_e.entries();
for (auto d_e: dl_e) {
for (const auto & d_e: dl_e) {
if (!d_e.isDir() || d_e.flags[PIFile::FileInfo::Dot] || d_e.flags[PIFile::FileInfo::DotDot]) continue;
devs << d_e.name();
}
@@ -392,7 +392,7 @@ PIVector<PIHIDeviceInfo> PIHIDevice::allDevices(bool try_open) {
if (test_f.isClosed()) continue;
}
ullong ev = readFile(hd_i.path + "/capabilities/ev"_a).toULLong(16);
// ullong ev = readFile(hd_i.path + "/capabilities/ev"_a).toULLong(16);
auto readAxes = [readFile, checkBit, &hd_i, &dev](const PIString & file, bool is_relative) {
PIVector<PIHIDeviceInfo::AxisInfo> ret;