From 37b97ed4aa068560daeec25c71e5afddffbc2dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Tue, 18 Dec 2018 20:14:34 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@674 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src_main/io_devices/piiodevice.cpp | 10 ++++++++++ src_main/io_devices/piiodevice.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src_main/io_devices/piiodevice.cpp b/src_main/io_devices/piiodevice.cpp index 646f40e4..307cae2f 100755 --- a/src_main/io_devices/piiodevice.cpp +++ b/src_main/io_devices/piiodevice.cpp @@ -379,6 +379,16 @@ void PIIODevice::splitFullPath(PIString fpwm, PIString * full_path, DeviceMode * } +PIStringList PIIODevice::availablePrefixes() { + PIStringList ret; + PIVector rd(PICollection::groupElements("__PIIODevices__")); + piForeachC (PIObject * d, rd) { + ret << ((const PIIODevice * )d)->fullPathPrefix(); + } + return ret; +} + + PIString PIIODevice::fullPathOptions() const { if (mode_ == ReadWrite && options_ == 0) return PIString(); PIString ret(" ("); diff --git a/src_main/io_devices/piiodevice.h b/src_main/io_devices/piiodevice.h index b152feb5..45129ee1 100755 --- a/src_main/io_devices/piiodevice.h +++ b/src_main/io_devices/piiodevice.h @@ -256,6 +256,9 @@ public: static void splitFullPath(PIString fpwm, PIString * full_path, DeviceMode * mode = 0, DeviceOptions * opts = 0); + //! Returns fullPath prefixes of all registered devices + static PIStringList availablePrefixes(); + EVENT_HANDLER(bool, open) {if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;} EVENT_HANDLER1(bool, open, const PIString &, _path) {setPath(_path); if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;}