From 76d2f02e5ad08a50684810436555f44b26e2e620 Mon Sep 17 00:00:00 2001 From: marcofilho Date: Sun, 4 Aug 2024 22:26:28 +0200 Subject: [PATCH 1/2] Put class declaration into header file. Also change the DRIVER_MODIFICATION number even though I'm not sure if this should be done since this shouldn't change anything in the driver per se. --- urlApp/src/URLDriver.cpp | 34 +--------------------------------- urlApp/src/URLDriver.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 urlApp/src/URLDriver.h diff --git a/urlApp/src/URLDriver.cpp b/urlApp/src/URLDriver.cpp index 1d0efa4..b9c781b 100644 --- a/urlApp/src/URLDriver.cpp +++ b/urlApp/src/URLDriver.cpp @@ -22,43 +22,11 @@ #include using namespace Magick; -#include "ADDriver.h" - #include - -#define DRIVER_VERSION 2 -#define DRIVER_REVISION 3 -#define DRIVER_MODIFICATION 0 +#include static const char *driverName = "URLDriver"; -/** URL driver; reads images from URLs, such as Web cameras and Axis video servers, but also files, etc. */ -class URLDriver : public ADDriver { -public: - URLDriver(const char *portName, int maxBuffers, size_t maxMemory, - int priority, int stackSize); - - /* These are the methods that we override from ADDriver */ - virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value); - virtual void report(FILE *fp, int details); - void URLTask(); /**< Should be private, but gets called from C, so must be public */ - -protected: - int URLName; - #define FIRST_URL_DRIVER_PARAM URLName - -private: - /* These are the methods that are new to this class */ - virtual asynStatus readImage(); - - /* Our data */ - Image image; - epicsEventId startEventId; - epicsEventId stopEventId; -}; - -#define URLNameString "URL_NAME" - asynStatus URLDriver::readImage() { diff --git a/urlApp/src/URLDriver.h b/urlApp/src/URLDriver.h new file mode 100644 index 0000000..736e36a --- /dev/null +++ b/urlApp/src/URLDriver.h @@ -0,0 +1,32 @@ +#include "ADDriver.h" + +#define DRIVER_VERSION 2 +#define DRIVER_REVISION 3 +#define DRIVER_MODIFICATION 1 + +/** URL driver; reads images from URLs, such as Web cameras and Axis video servers, but also files, etc. */ +class URLDriver : public ADDriver { +public: + URLDriver(const char *portName, int maxBuffers, size_t maxMemory, + int priority, int stackSize); + + /* These are the methods that we override from ADDriver */ + virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value); + virtual void report(FILE *fp, int details); + void URLTask(); /**< Should be private, but gets called from C, so must be public */ + +protected: + int URLName; + #define FIRST_URL_DRIVER_PARAM URLName + +private: + /* These are the methods that are new to this class */ + virtual asynStatus readImage(); + + /* Our data */ + Image image; + epicsEventId startEventId; + epicsEventId stopEventId; +}; + +#define URLNameString "URL_NAME" \ No newline at end of file From 44d49527073f4cdd1492cd88b6bf39e6982f54a2 Mon Sep 17 00:00:00 2001 From: marcofilho Date: Sun, 4 Aug 2024 22:32:09 +0200 Subject: [PATCH 2/2] Style: remove invisible ^L characters --- urlApp/src/URLDriver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/urlApp/src/URLDriver.cpp b/urlApp/src/URLDriver.cpp index b9c781b..2c3652d 100644 --- a/urlApp/src/URLDriver.cpp +++ b/urlApp/src/URLDriver.cpp @@ -256,7 +256,7 @@ void URLDriver::URLTask() } } - + /** Called when asyn clients call pasynInt32->write(). * This function performs actions for some parameters, including ADAcquire, ADColorMode, etc. * For all parameters it sets the value in the parameter library and calls any registered callbacks.. @@ -305,7 +305,7 @@ asynStatus URLDriver::writeInt32(asynUser *pasynUser, epicsInt32 value) - + /** Report status of the driver. * Prints details about the driver if details>0. * It then calls the ADDriver::report() method.